Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVPTX: "LLVM ERROR: Cannot select" when translating num::from_str_radix #41132

Open
japaric opened this issue Apr 7, 2017 · 2 comments
Open
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-NVPTX Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@japaric
Copy link
Member

japaric commented Apr 7, 2017

STR

$ rustc libcore/lib.rs
LLVM ERROR: Cannot select: 0x7f1356ad1170: i64,ch,glue = NVPTXISD::LoadParam<LDST0[<unknown>](align=8)> 0x7f13567aa6c0:1, Constant:i32<1>, Constant:i32<1454182880>, 0x7f13567aa6c0:2
  0x7f13567aac00: i32 = Constant<1>
  0x7f1356ad18e0: i32 = Constant<1454182880>
  0x7f13567aa6c0: i64,ch,glue = NVPTXISD::LoadParam<LDST16[<unknown>](align=8)> 0x7f1356420650, Constant:i32<1>, Constant:i32<0>, 0x7f1356420650:1
    0x7f13567aac00: i32 = Constant<1>
    0x7f134764fba0: i32 = Constant<0>
    0x7f1356420650: ch,glue = NVPTXISD::CallArgEnd 0x7f13546d9620, Constant:i32<1>, 0x7f13546d9620:1
      0x7f13567aac00: i32 = Constant<1>
      0x7f13546d9620: ch,glue = NVPTXISD::LastCallArg 0x7f13567aa5e0, Constant:i32<1>, Constant:i32<0>, 0x7f13567aa5e0:1
        0x7f13567aac00: i32 = Constant<1>
        0x7f134764fba0: i32 = Constant<0>
        0x7f13567aa5e0: ch,glue = NVPTXISD::CallArgBegin 0x7f1356ad1aa0, 0x7f1356ad1aa0:1
          0x7f1356ad1aa0: ch,glue = NVPTXISD::CallVoid 0x7f1356ad1a30, 0x7f13546d9460, 0x7f1356ad1a30:1
            0x7f13546d9460: i64 = NVPTXISD::Wrapper TargetGlobalAddress:i64<i128 (i32)* @"_ZN54_$LT$u128$u20$as$u20$core..num..FromStrRadixHelper$GT$8from_u3217h2e1aa7ebab2ba02cE"> 0
              0x7f13549f5900: i64 = TargetGlobalAddress<i128 (i32)* @"_ZN54_$LT$u128$u20$as$u20$core..num..FromStrRadixHelper$GT$8from_u3217h2e1aa7ebab2ba02cE"> 0
            0x7f1356ad1a30: ch,glue = NVPTXISD::PrintCallUni 0x7f134764ff20, Constant:i32<1>, 0x7f134764ff20:1
              0x7f13567aac00: i32 = Constant<1>
              0x7f134764ff20: ch,glue = NVPTXISD::DeclareRet 0x7f1356273c20, Constant:i32<1>, Constant:i32<128>, Constant:i32<0>, 0x7f1356273c20:1
                0x7f13567aac00: i32 = Constant<1>
                0x7f1356ad11e0: i32 = Constant<128>
                0x7f134764fba0: i32 = Constant<0>
                0x7f1356273c20: ch,glue = NVPTXISD::StoreParam<LDST4[<unknown>]> 0x7f13568bf2e0, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, 0x7f13568bf2e0:1
                  0x7f134764fba0: i32 = Constant<0>
                  0x7f134764fba0: i32 = Constant<0>
                  0x7f134764fba0: i32 = Constant<0>
                  0x7f13568bf2e0: ch,glue = NVPTXISD::DeclareScalarParam 0x7f13568beda0, Constant:i32<0>,Constant:i32<32>, Constant:i32<0>, 0x7f13568beda0:1




In function: _ZN4core3num14from_str_radix17h4c0c1d66bbd93620E

NOTE: Requires turning off LLVM assertions to avoid #38824

Meta

$ rustc --version
rustc 1.18.0-dev (50c186419 2017-04-06)
@japaric japaric added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. O-NVPTX Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html labels Apr 7, 2017
@est31
Copy link
Member

est31 commented Apr 7, 2017

from_str_radix ... sounds like an i128 related issue as well.

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Apr 7, 2017

Possible, but the instruction that it can't select seems to be an i64 load, so I wouldn't bet on it.

Edit: @est31 pointed out to me on IRC that this occurs in the i128 expansion of the macro (it references <u128 as FromRadixHelper>::from_u32), so it is in fact i128 related.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-NVPTX Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants