[PowerPC] hit llvm_unreachable("Wasn't expecting to be able to lower this!")
for the IR bash> cat reduced.ll
define i32 @main(i8 %0) {
entry:
%cmp2.not.i.4 = icmp eq i8 %0, 0
%1 = sext i1 %cmp2.not.i.4 to i32
ret i32 %1
}
bash > llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
UNREACHABLE executed at llvm/lib/Target/PowerPC/PPCISelLowering.cpp:12790!
PLEASE submit a bug report tohttps://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments:llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
1. Running pass 'Function Pass Manager' on module 'reduced.ll'.
2. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@main'
IOT/Abort trap (core dumped) llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
it hit the in source code
SDValue PPCTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
switch (Op.getOpcode()) {
default:
llvm_unreachable("Wasn't expecting to be able to lower this!");
@llvm/issue-subscribers-backend-powerpc
Author: zhijian lin (diggerlin)
for the IR bash> cat reduced.ll
define i32 @<!-- -->main(i8 %0) {
entry:
%cmp2.not.i.4 = icmp eq i8 %0, 0
%1 = sext i1 %cmp2.not.i.4 to i32
ret i32 %1
}
bash > llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
UNREACHABLE executed at llvm/lib/Target/PowerPC/PPCISelLowering.cpp:12790! PLEASE submit a bug report tohttps://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.and include the crash backtrace and instructions to reproduce the bug. Stack dump: 0. Program arguments:llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
-
Running pass 'Function Pass Manager' on module 'reduced.ll'. -
Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@<!-- -->main'
IOT/Abort trap (core dumped) llc -mtriple=powerpc-ibm-aix7.2.0.0 reduced.ll
it hit the in source code
SDValue PPCTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const { switch (Op.getOpcode()) { default: llvm_unreachable("Wasn't expecting to be able to lower this!");
the crash is introduced by patch [PowerPC] fixed issue "Failure to optimize (x == 0) ? 0xFF : 0 to addic+subfe instead of cntlzw+srwi+neg"
I closed the patch, the patch. https://github.com/llvm/llvm-project/pull/207721 already fix the issue in another way