Skip to content

Assertion `VT.isInteger() && "Cannot create FP integer constant!"' failed. #120093

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

Closed
TatyanaDoubts opened this issue Dec 16, 2024 · 1 comment
Closed
Assignees
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well

Comments

@TatyanaDoubts
Copy link

To reproduce run the following test on llc:

; ModuleID = 'reduced.ll'
source_filename = "reduced.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"

define double @widget() gc "statepoint-example" {
bb:
  %insertelement = insertelement <2 x double> <double poison, double 0xFFFFFFFFFFFFFFFF>, double 0.000000e+00, i64 0
  %fcmp = fcmp uge <2 x double> zeroinitializer, %insertelement
  %extractelement = extractelement <2 x i1> %fcmp, i64 0
  %extractelement1 = extractelement <2 x i1> %fcmp, i64 1
  %select = select i1 %extractelement, i1 %extractelement1, i1 false
  br i1 %select, label %bb2, label %bb3

bb2:                                              ; preds = %bb
  ret double 0.000000e+00

bb3:                                              ; preds = %bb
  unreachable
}

Reproducer: https://godbolt.org/z/EG69jzzfz

Stack dump:

0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@widget'
 #0 0x0000000003c7e2e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c7e2e8)
 #1 0x0000000003c7bcec SignalHandler(int) Signals.cpp:0:0
 #2 0x00007c08a0642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007c08a06969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007c08a0642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007c08a06287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007c08a062871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007c08a0639e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x00000000039f7f6b llvm::SelectionDAG::getConstant(llvm::ConstantInt const&, llvm::SDLoc const&, llvm::EVT, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39f7f6b)
 #9 0x00000000039f8c00 llvm::SelectionDAG::getAllOnesConstant(llvm::SDLoc const&, llvm::EVT, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39f8c00)
#10 0x00000000038b1b31 (anonymous namespace)::DAGCombiner::visitFREEZE(llvm::SDNode*) (.isra.0) DAGCombiner.cpp:0:0
#11 0x00000000038ca30f (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*) DAGCombiner.cpp:0:0
#12 0x00000000038cca3c (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#13 0x00000000038ce328 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#14 0x00000000038d0c3b llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38d0c3b)
#15 0x0000000003a32a08 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a32a08)
#16 0x0000000003a366f9 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a366f9)
#17 0x0000000003a379b0 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a379b0)
#18 0x0000000003a283af llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a283af)
#19 0x0000000002bc1829 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#20 0x00000000031c737f llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c737f)
#21 0x00000000031c7731 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c7731)
#22 0x00000000031c7fd1 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c7fd1)
#23 0x000000000089a608 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#24 0x000000000078563e main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x78563e)
#25 0x00007c08a0629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007c08a0629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000000000890f35 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x890f35)
Program terminated with signal: SIGSEGV
Compiler returned: 139
@EugeneZelenko EugeneZelenko added backend:X86 crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well and removed new issue labels Dec 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 16, 2024

@llvm/issue-subscribers-backend-x86

Author: None (TatyanaDoubts)

To reproduce run the following test on llc:
; ModuleID = 'reduced.ll'
source_filename = "reduced.ll"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
target triple = "x86_64-unknown-linux-gnu"

define double @<!-- -->widget() gc "statepoint-example" {
bb:
  %insertelement = insertelement &lt;2 x double&gt; &lt;double poison, double 0xFFFFFFFFFFFFFFFF&gt;, double 0.000000e+00, i64 0
  %fcmp = fcmp uge &lt;2 x double&gt; zeroinitializer, %insertelement
  %extractelement = extractelement &lt;2 x i1&gt; %fcmp, i64 0
  %extractelement1 = extractelement &lt;2 x i1&gt; %fcmp, i64 1
  %select = select i1 %extractelement, i1 %extractelement1, i1 false
  br i1 %select, label %bb2, label %bb3

bb2:                                              ; preds = %bb
  ret double 0.000000e+00

bb3:                                              ; preds = %bb
  unreachable
}

Reproducer: https://godbolt.org/z/EG69jzzfz

Stack dump:

0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel &lt;source&gt;
1.	Running pass 'Function Pass Manager' on module '&lt;source&gt;'.
2.	Running pass 'X86 DAG-&gt;DAG Instruction Selection' on function '@<!-- -->widget'
 #<!-- -->0 0x0000000003c7e2e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3c7e2e8)
 #<!-- -->1 0x0000000003c7bcec SignalHandler(int) Signals.cpp:0:0
 #<!-- -->2 0x00007c08a0642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #<!-- -->3 0x00007c08a06969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #<!-- -->4 0x00007c08a0642476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #<!-- -->5 0x00007c08a06287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #<!-- -->6 0x00007c08a062871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #<!-- -->7 0x00007c08a0639e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #<!-- -->8 0x00000000039f7f6b llvm::SelectionDAG::getConstant(llvm::ConstantInt const&amp;, llvm::SDLoc const&amp;, llvm::EVT, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39f7f6b)
 #<!-- -->9 0x00000000039f8c00 llvm::SelectionDAG::getAllOnesConstant(llvm::SDLoc const&amp;, llvm::EVT, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x39f8c00)
#<!-- -->10 0x00000000038b1b31 (anonymous namespace)::DAGCombiner::visitFREEZE(llvm::SDNode*) (.isra.0) DAGCombiner.cpp:0:0
#<!-- -->11 0x00000000038ca30f (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*) DAGCombiner.cpp:0:0
#<!-- -->12 0x00000000038cca3c (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#<!-- -->13 0x00000000038ce328 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#<!-- -->14 0x00000000038d0c3b llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x38d0c3b)
#<!-- -->15 0x0000000003a32a08 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a32a08)
#<!-- -->16 0x0000000003a366f9 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a366f9)
#<!-- -->17 0x0000000003a379b0 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a379b0)
#<!-- -->18 0x0000000003a283af llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3a283af)
#<!-- -->19 0x0000000002bc1829 llvm::MachineFunctionPass::runOnFunction(llvm::Function&amp;) (.part.0) MachineFunctionPass.cpp:0:0
#<!-- -->20 0x00000000031c737f llvm::FPPassManager::runOnFunction(llvm::Function&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c737f)
#<!-- -->21 0x00000000031c7731 llvm::FPPassManager::runOnModule(llvm::Module&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c7731)
#<!-- -->22 0x00000000031c7fd1 llvm::legacy::PassManagerImpl::run(llvm::Module&amp;) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x31c7fd1)
#<!-- -->23 0x000000000089a608 compileModule(char**, llvm::LLVMContext&amp;) llc.cpp:0:0
#<!-- -->24 0x000000000078563e main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x78563e)
#<!-- -->25 0x00007c08a0629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#<!-- -->26 0x00007c08a0629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#<!-- -->27 0x0000000000890f35 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x890f35)
Program terminated with signal: SIGSEGV
Compiler returned: 139

@RKSimon RKSimon self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

No branches or pull requests

4 participants