| Issue |
176559
|
| Summary |
[AMDGPU] Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
|
| Labels |
backend:AMDGPU,
crash-on-valid,
generated by fuzzer
|
| Assignees |
XChy
|
| Reporter |
XChy
|
Reproducer: https://godbolt.org/z/e58sfGdPz
Testcase:
```llvm
target datalayout = "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
target triple = "amdgcn-amd-amdhsa"
define <2 x i32> @backsmith_pure_2(i32 %0, i1 %cmp17.not, i1 %tobool.not) #0 {
entry:
%1 = tail call i32 @llvm.amdgcn.perm(i32 %0, i32 0, i32 0)
br i1 %cmp17.not, label %for.cond.cleanup, label %for.inc
for.cond.cleanup: ; preds = %for.inc, %entry
%vecins = insertelement <2 x i32> splat (i32 1), i32 0, i32 %1
ret <2 x i32> %vecins
for.inc: ; preds = %for.inc, %entry
%2 = zext i32 %1 to i128
%conv8 = select i1 %tobool.not, i128 %2, i128 -8064623960549
%iszero = icmp eq i128 %conv8, 0
br i1 %iszero, label %for.inc, label %for.cond.cleanup
}
; Function Attrs: nocallback nofree nounwind speculatable willreturn memory(none)
declare i32 @llvm.amdgcn.perm(i32, i32, i32) #1
attributes #0 = { "target-cpu"="gfx1201" }
attributes #1 = { nocallback nofree nounwind speculatable willreturn memory(none) }
```
Dump:
```
llc: /root/llvm-project/llvm/include/llvm/ADT/APInt.h:1552: uint64_t llvm::APInt::getZExtValue() const: Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' 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 -O1 <source>
1. Running pass 'CallGraph Pass Manager' on module '<source>'.
2. Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@backsmith_pure_2'
#0 0x0000000004252608 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4252608)
#1 0x000000000424f4e4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x0000778d03c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x0000778d03c969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x0000778d03c42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x0000778d03c287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000778d03c2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#7 0x0000778d03c39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#8 0x0000000000b37736 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb37736)
#9 0x000000000107818d llvm::SITargetLowering::performSetCCCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x107818d)
#10 0x000000000109f3ec llvm::SITargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x109f3ec)
#11 0x0000000003e70fbf (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) DAGCombiner.cpp:0:0
#12 0x0000000003e72b40 (anonymous namespace)::DAGCombiner::Run(llvm::CombineLevel) DAGCombiner.cpp:0:0
#13 0x0000000003e75593 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::BatchAAResults*, llvm::CodeGenOptLevel) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3e75593)
#14 0x0000000003fe2bd1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe2bd1)
#15 0x0000000003fe64e8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe64e8)
#16 0x0000000003fe7ffc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fe7ffc)
#17 0x00000000012243b5 llvm::AMDGPUDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x12243b5)
#18 0x0000000003fd300f llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3fd300f)
#19 0x000000000311d0e9 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#20 0x0000000003773256 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3773256)
#21 0x0000000002b690c8 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) CallGraphSCCPass.cpp:0:0
#22 0x0000000003773e6f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3773e6f)
#23 0x00000000008eb34d compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) llc.cpp:0:0
#24 0x00000000007c6f8c main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c6f8c)
#25 0x0000778d03c29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x0000778d03c29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x00000000008e03f5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x8e03f5)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs