| Issue |
171869
|
| Summary |
[llvm][PowerPC] `Assertion 'Legalized && "Can't legalize BR_CC with legal condition!"' failed`
|
| Labels |
backend:PowerPC,
crash-on-valid
|
| Assignees |
|
| Reporter |
alexrp
|
```llvm
target datalayout = "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64le-unknown-linux5.10.0-gnu2.31.0"
define fastcc fp128 @math.hypot.hypot__anon_420901(fp128 %0, fp128 %1) {
Entry:
%2 = fcmp uno fp128 %0, 0xL00000000000000000000000000000000
%3 = fcmp uno fp128 %1, 0xL00000000000000000000000000000000
%or.cond36 = select i1 %2, i1 true, i1 %3
br i1 %or.cond36, label %common.ret, label %Else3
common.ret: ; preds = %Entry
ret fp128 0xL00000000000000000000000000000000
Else3: ; preds = %Entry
ret fp128 0xL00000000000000000000000000000000
}
```
```
❯ llc --version | head -n2
LLVM (http://llvm.org/):
LLVM version 21.1.8
❯ llc -O3 reduced.ll
llc: /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4393: bool {anonymous}::SelectionDAGLegalize::ExpandNode(llvm::SDNode*): Assertion `Legalized && "Can't legalize BR_CC with legal condition!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc -O3 reduced.ll
1. Running pass 'Function Pass Manager' on module 'reduced.ll'.
2. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@math.hypot.hypot__anon_420901'
#0 0x000077c7f65b456d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:838:3
#1 0x000077c7f65b16a4 llvm::sys::RunSignalHandlers() /home/alexrp/Sources/llvm/llvm/lib/Support/Signals.cpp:104:20
#2 0x000077c7f65b1ebc SignalHandler(int, siginfo_t*, void*) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:426:14
#3 0x000077c7f4e45f60 (/lib/x86_64-linux-gnu/libc.so.6+0x45f60)
#4 0x000077c7f4ea5fed __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x000077c7f4ea5fed __pthread_kill_internal ./nptl/pthread_kill.c:89:10
#6 0x000077c7f4ea5fed pthread_kill ./nptl/pthread_kill.c:100:10
#7 0x000077c7f4e45e2e raise ./signal/../sysdeps/posix/raise.c:27:6
#8 0x000077c7f4e28888 internal_signal_block_all ./stdlib/../sysdeps/unix/sysv/linux/internal-signals.h:81:3
#9 0x000077c7f4e28888 __abort_lock_wrlock ./stdlib/abort.c:62:3
#10 0x000077c7f4e28888 abort ./stdlib/abort.c:85:3
#11 0x000077c7f4e287f0 __assert_perror_fail ./assert/assert-perr.c:31:1
#12 0x000077c7f5f39015 llvm::SmallVectorBase<unsigned int>::set_size(unsigned long) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4393:5
#13 0x000077c7f5f39015 llvm::SmallVectorImpl<llvm::SDValue>::append(unsigned long, llvm::SDValue) /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/SmallVector.h:696:19
#14 0x000077c7f5f39015 (anonymous namespace)::SelectionDAGLegalize::ExpandNode(llvm::SDNode*) (.cold) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3169:19
#15 0x000077c7f6fe1a6e (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1379:7
#16 0x000077c7f6fe4828 llvm::SelectionDAG::Legalize() /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:6120:28
#17 0x000077c7f71c035b llvm::TimeRegion::~TimeRegion() /home/alexrp/Sources/llvm/llvm/include/llvm/Support/Timer.h:162:9
#18 0x000077c7f71c035b llvm::NamedRegionTimer::~NamedRegionTimer() /home/alexrp/Sources/llvm/llvm/include/llvm/Support/Timer.h:170:8
#19 0x000077c7f71c035b llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1068:3
#20 0x000077c7f71c3bb8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1891:33
#21 0x000077c7f71c53fc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:605:22
#22 0x000077c7fa4c03fc (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Sources/llvm/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:172:5
#23 0x000077c7f71bcd81 llvm::OptLevelChanger::~OptLevelChanger() /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:267:11
#24 0x000077c7f71bcd81 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:373:1
#25 0x000077c7f71bcd81 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:345:6
#26 0x000077c7f6afe32a llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:30
#27 0x000077c7f6771faa llvm::FPPassManager::runOnFunction(llvm::Function&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1398:40
#28 0x000077c7f67721b5 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#29 0x000077c7f67721b5 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node.h:119:66
#30 0x000077c7f67721b5 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#31 0x000077c7f67721b5 llvm::FPPassManager::runOnModule(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1443:22
#32 0x000077c7f6772a4f runOnModule /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1513:38
#33 0x000077c7f6772a4f llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:531:55
#34 0x000059be1785a1b9 compileModule(char**, llvm::LLVMContext&) /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:761:34
#35 0x000059be1784e707 main /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:404:35
#36 0x000077c7f4e2a575 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#37 0x000077c7f4e2a628 call_init ./csu/../csu/libc-start.c:128:20
#38 0x000077c7f4e2a628 __libc_start_main ./csu/../csu/libc-start.c:347:5
#39 0x000059be1784fcf5 _start (/opt/llvm-21/bin/llc+0x14cf5)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs