Issue |
124001
|
Summary |
Cannot select SystemZISD::GET_CCMASK with PGO instrumentation
|
Labels |
new issue
|
Assignees |
|
Reporter |
cuviper
|
Using this reduced IR from Rust:
```llvm-ir
; ModuleID = 'reduced.bc'
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
target triple = "s390x-unknown-linux-gnu"
define void @"_ZN4core3num22_$LT$impl$u20$u128$GT$14from_str_radix17hca3660e94cc40985E"(ptr %0, i128 %.sroa.0.0) #0 {
br label %2
2: ; preds = %2, %1
%.sroa.0.01 = phi i128 [ %.sroa.0.0, %1 ], [ %.sroa.01.1, %2 ]
%3 = load i32, ptr %0, align 4
%4 = zext i32 %3 to i128
%5 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %.sroa.0.01, i128 %4)
%6 = extractvalue { i128, i1 } %5, 1
%.sroa.01.1 = select i1 %6, i128 %.sroa.0.0, i128 0
br label %2
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i128, i1 } @llvm.uadd.with.overflow.i128(i128, i128) #1
attributes #0 = { "target-cpu"="z13" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
```
A simple `opt -O1 | llc` pipeline works.
However, adding PGO instrumentation fails:
```
$ opt -pgo-kind=pgo-instr-gen-pipeline -O1 <reduced.bc | llc
.file ""
LLVM ERROR: Cannot select: t154: i32 = SystemZISD::GET_CCMASK t168, Constant:i32<15>, Constant:i32<3>
t168: i32 = truncate t167
t167: i128 = AssertZext t165, ValueType:ch:i1
t165: i128 = SystemZISD::VACC t212, t73
t212: i128 = SystemZISD::SELECT_CCMASK t23, Constant:i128<0>, TargetConstant:i32<14>, TargetConstant:i32<6>, t211
t23: i128,ch = CopyFromReg t0, Register:i128 %4
t22: i128 = Register %4
t24: i128 = Constant<0>
t206: i32 = TargetConstant<14>
t207: i32 = TargetConstant<6>
t211: i32 = SystemZISD::ICMP t178, Constant:i32<0>, TargetConstant:i32<0>
t178: i32 = truncate t177
t177: i128 = AssertZext t176, ValueType:ch:i1
t176: i128 = SystemZISD::VACC t210, t89
t210: i128 = SystemZISD::SELECT_CCMASK t23, Constant:i128<0>, TargetConstant:i32<14>, TargetConstant:i32<6>, t209
t89: i128,ch = load<(load (s32) from %ir.0), zext from i32> t95, t9, undef:i64
t157: i32 = Constant<0>
t204: i32 = TargetConstant<0>
t73: i128,ch = load<(load (s32) from %ir.0), zext from i32> t79, t9, undef:i64
t9: i64,ch = CopyFromReg t0, Register:i64 %2
t8: i64 = Register %2
t3: i64 = undef
t153: i32 = Constant<15>
t152: i32 = Constant<3>
In function: _ZN4core3num22_$LT$impl$u20$u128$GT$14from_str_radix17hca3660e94cc40985E
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: llc
1. Running pass 'Function Pass Manager' on module '<stdin>'.
2. Running pass 'SystemZ DAG->DAG Pattern Instruction Selection' on function '@"_ZN4core3num22_$LT$impl$u20$u128$GT$14from_str_radix17hca3660e94cc40985E"'
#0 0x0000000001aec96b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/jistone/llvm-project-bisect/llvm/lib/Support/Unix/Signals.inc:798:3
#1 0x0000000001aea0a4 llvm::sys::RunSignalHandlers() /home/jistone/llvm-project-bisect/llvm/lib/Support/Signals.cpp:105:20
#2 0x0000000001aea486 SignalHandler(int) /home/jistone/llvm-project-bisect/llvm/lib/Support/Unix/Signals.inc:411:1
#3 0x00007f7fda940090 __restore_rt (/lib64/libc.so.6+0x1a090)
#4 0x00007f7fda9990f4 __pthread_kill_implementation (/lib64/libc.so.6+0x730f4)
#5 0x00007f7fda93ffde gsignal (/lib64/libc.so.6+0x19fde)
#6 0x00007f7fda927942 abort (/lib64/libc.so.6+0x1942)
#7 0x0000000000407e3b std::mutex::lock() /usr/include/c++/14/bits/std_mutex.h:117:22
#8 0x0000000000407e3b std::lock_guard<std::mutex>::lock_guard(std::mutex&) /usr/include/c++/14/bits/std_mutex.h:250:23
#9 0x0000000000407e3b llvm::install_bad_alloc_error_handler(void (*)(void*, char const*, bool), void*) (.cold) /home/jistone/llvm-project-bisect/llvm/lib/Support/ErrorHandling.cpp:132:61
#10 0x00000000018933ee llvm::SDNode::getOperand(unsigned int) const /home/jistone/llvm-project-bisect/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:993:5
#11 0x00000000018933ee llvm::SDNode::getConstantOperandVal(unsigned int) const /home/jistone/llvm-project-bisect/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1724:61
#12 0x00000000018933ee llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:4425:44
#13 0x000000000189a41f llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:4135:35
#14 0x000000000188f456 llvm::SmallVectorTemplateCommon<llvm::SDNode*, void>::isSmall() const /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/SmallVector.h:143:39
#15 0x000000000188f456 llvm::SmallVectorImpl<llvm::SDNode*>::~SmallVectorImpl() /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/SmallVector.h:603:23
#16 0x000000000188f456 llvm::SmallVector<llvm::SDNode*, 4u>::~SmallVector() /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/SmallVector.h:1203:3
#17 0x000000000188f456 llvm::SelectionDAGISel::DoInstructionSelection() /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1354:5
#18 0x000000000189ee36 llvm::TimeRegion::~TimeRegion() /home/jistone/llvm-project-bisect/llvm/include/llvm/Support/Timer.h:160:9
#19 0x000000000189ee36 llvm::NamedRegionTimer::~NamedRegionTimer() /home/jistone/llvm-project-bisect/llvm/include/llvm/Support/Timer.h:168:8
#20 0x000000000189ee36 llvm::SelectionDAGISel::CodeGenAndEmitDAG() /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1123:3
#21 0x00000000018a2a2d llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1905:33
#22 0x00000000018a41ed llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:616:22
#23 0x000000000188ec33 llvm::OptLevelChanger::~OptLevelChanger() /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:269:11
#24 0x000000000188ec33 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:376:1
#25 0x000000000188ec33 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:347:6
#26 0x0000000000a66ff4 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) /home/jistone/llvm-project-bisect/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:33
#27 0x00000000010307f4 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/jistone/llvm-project-bisect/llvm/lib/IR/LegacyPassManager.cpp:1416:7
#28 0x0000000001030a01 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#29 0x0000000001030a01 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/ilist_node.h:117:66
#30 0x0000000001030a01 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /home/jistone/llvm-project-bisect/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#31 0x0000000001030a01 llvm::FPPassManager::runOnModule(llvm::Module&) /home/jistone/llvm-project-bisect/llvm/lib/IR/LegacyPassManager.cpp:1451:22
#32 0x000000000103128d runOnModule /home/jistone/llvm-project-bisect/llvm/lib/IR/LegacyPassManager.cpp:1528:7
#33 0x000000000103128d llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/jistone/llvm-project-bisect/llvm/lib/IR/LegacyPassManager.cpp:539:55
#34 0x00000000004f4171 compileModule(char**, llvm::LLVMContext&) /home/jistone/llvm-project-bisect/llvm/tools/llc/llc.cpp:753:34
#35 0x000000000041267f main /home/jistone/llvm-project-bisect/llvm/tools/llc/llc.cpp:411:35
#36 0x00007f7fda929248 __libc_start_call_main (/lib64/libc.so.6+0x3248)
#37 0x00007f7fda92930b __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x330b)
#38 0x00000000004e9dd5 _start (/home/jistone/llvm-project-bisect/build/bin/llc+0x4e9dd5)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs