Issue |
138686
|
Summary |
[AArch64][ISel][SVE] Cannot select setcc
|
Labels |
new issue
|
Assignees |
|
Reporter |
tyb0807
|
LLVM version 21
[input.txt](https://github.com/user-attachments/files/20062592/input.txt)
Command to repro: `llc -mtriple=aarch64-unknown-linux-gnu -mattr=+sve input.txt`
Error message:
```
LLVM ERROR: Cannot select: t18: nxv8i1 = setcc t12, t16, setole:ch
t12: nxv8bf16,ch = masked_load<(load unknown-size from %ir.scevgep4, align 2, !noalias !5)> t0, t7, undef:i64, t10, undef:nxv8bf16
t7: i64 = add t6, t4
t6: i64,ch = CopyFromReg t0, Register:i64 %4
t5: i64 = Register %4
t4: i64 = shl t2, Constant:i64<1>
t2: i64,ch = CopyFromReg t0, Register:i64 %7
t1: i64 = Register %7
t3: i64 = Constant<1>
t11: i64 = undef
t10: nxv8i1,ch = CopyFromReg t0, Register:nxv8i1 %8
t9: nxv8i1 = Register %8
t136: nxv8bf16 = undef
t16: nxv8bf16 = splat_vector ConstantFP:bf16<APFloat(49920)>
t13: bf16 = ConstantFP<APFloat(49920)>
In function: convert.2_kernel
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./build/bin/llc -mtriple=aarch64-unknown-linux-gnu -mattr=+sve -o output.s test.ll --debug-_only_=isel --print-after-all
1. Running pass 'Function Pass Manager' on module 'test.ll'.
2. Running pass 'AArch64 Instruction Selection' on function '@convert.2_kernel'
#0 0x000000010413ac38 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10384ec38)
#1 0x000000010413b1d0 PrintStackTraceSignalHandler(void*) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10384f1d0)
#2 0x0000000104138fc4 llvm::sys::RunSignalHandlers() (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10384cfc4)
#3 0x000000010413bac4 SignalHandler(int, __siginfo*, void*) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10384fac4)
#4 0x000000019ec5f624 (/usr/lib/system/libsystem_platform.dylib+0x1804ab624)
#5 0x000000019ec2588c (/usr/lib/system/libsystem_pthread.dylib+0x18047188c)
#6 0x000000019eb2ec60 (/usr/lib/system/libsystem_c.dylib+0x18037ac60)
#7 0x000000010401c97c llvm::report_fatal_error(llvm::Twine const&, bool) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10373097c)
#8 0x0000000103ecb1d0 llvm::SmallVectorTemplateCommon<(anonymous namespace)::MatchScope, void>::back() (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035df1d0)
#9 0x0000000103ec841c llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035dc41c)
#10 0x0000000101788d78 (anonymous namespace)::AArch64DAGToDAGISel::SelectCode(llvm::SDNode*) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x100e9cd78)
#11 0x00000001017704c8 (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x100e844c8)
#12 0x0000000103ebb6b8 llvm::SelectionDAGISel::DoInstructionSelection() (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035cf6b8)
#13 0x0000000103eba9a4 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035ce9a4)
#14 0x0000000103eb96ec llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, bool&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035cd6ec)
#15 0x0000000103eb9070 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035cd070)
#16 0x0000000103eb6dbc llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035cadbc)
#17 0x000000010175df20 (anonymous namespace)::AArch64DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x100e71f20)
#18 0x0000000103eb57f4 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1035c97f4)
#19 0x000000010295b618 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x10206f618)
#20 0x000000010320d768 llvm::FPPassManager::runOnFunction(llvm::Function&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x102921768)
#21 0x0000000103213f08 llvm::FPPassManager::runOnModule(llvm::Module&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x102927f08)
#22 0x000000010320df98 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x102921f98)
#23 0x000000010320db60 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x102921b60)
#24 0x00000001032142d0 llvm::legacy::PassManager::run(llvm::Module&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1029282d0)
#25 0x00000001008f07a4 compileModule(char**, llvm::LLVMContext&) (/Users/sonvu/dev/llvm-project/build/bin/llc+0x1000047a4)
#26 0x00000001008ee964 main (/Users/sonvu/dev/llvm-project/build/bin/llc+0x100002964)
```
I've tried to follow the transformation logic for non-SVE version of the code and it seems `setcc` is combined into `select` to produce `select_cc`. Do we want to do the same for `vselect` here? I can try to take a deeper look but I'm not familiar with SVE codegen so any advice would be much appreciated! @paulwalker-arm @david-arm
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs