| Issue |
166525
|
| Summary |
[PowerPC][GISel] llc crashed with assertion "legality mutation invalid for match" at all optimization flags
|
| Labels |
backend:PowerPC,
crash-on-valid
|
| Assignees |
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/bqqMjE93q
Testcase:
```llvm
target datalayout = "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512"
target triple = "powerpc64le-unknown-linux-musl"
define i64 @backsmith_pure_5(<4 x i16> %conv) {
entry:
%xor = xor <4 x i16> %conv, zeroinitializer
%0 = bitcast <4 x i16> %xor to i64
ret i64 %0
}
```
llc output:
```
llc: /root/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp:206: llvm::LegalizeActionStep llvm::LegalizeRuleSet::apply(const llvm::LegalityQuery&) const: Assertion `mutationIsSane(Rule, Query, Mutation) && "legality mutation invalid for match"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -O0 -global-isel <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'Legalizer' on function '@backsmith_pure_5'
#0 0x000000000419d348 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x419d348)
#1 0x000000000419a1f4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x000077968fc42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x000077968fc969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x000077968fc42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x000077968fc287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x000077968fc2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x000077968fc39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000004863325 llvm::LegalizeRuleSet::apply(llvm::LegalityQuery const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4863325)
#9 0x0000000004864b06 llvm::LegalizerInfo::getAction(llvm::LegalityQuery const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4864b06)
#10 0x0000000004864f7c llvm::LegalizerInfo::getAction(llvm::MachineInstr const&, llvm::MachineRegisterInfo const&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4864f7c)
#11 0x00000000048623a5 llvm::LegalizerHelper::legalizeInstrStep(llvm::MachineInstr&, llvm::LostDebugLocObserver&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x48623a5)
#12 0x000000000480d7db llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&, llvm::LegalizerInfo const&, llvm::ArrayRef<llvm::GISelChangeObserver*>, llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&, llvm::GISelValueTracking*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x480d7db)
#13 0x000000000480fbae llvm::Legalizer::runOnMachineFunction(llvm::MachineFunction&) (.part.0) Legalizer.cpp:0:0
#14 0x000000000307fcc9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#15 0x00000000036cfa86 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36cfa86)
#16 0x00000000036cfe31 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36cfe31)
#17 0x00000000036d069f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x36d069f)
#18 0x00000000008fa803 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x00000000007c7986 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c7986)
#20 0x000077968fc29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#21 0x000077968fc29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#22 0x00000000008efc45 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8efc45)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs