[llvm] [CostModel] getInstructionCost - match SK_InsertSubvector shuffle patterns before SK_Select (PR #145920)
Mikael Holmén via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 26 22:51:53 PDT 2025
mikaelholmen wrote:
Hi @RKSimon
With this patch I start seeing lots of crashes with llvm-stress generated input. E.g. this reduced reproducer:
```llc -march=x86-64 -mcpu=corei7 -o /dev/null bbi-108404.ll```
crashes with
```
llc: ../lib/IR/Instructions.cpp:2140: static bool llvm::ShuffleVectorInst::isInsertSubvectorMask(ArrayRef<int>, int, int &, int &): Assertion `!Src0Elts.isZero() && !Src1Elts.isZero() && "2-source shuffle not found"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: build-all/bin/llc -march=x86-64 -mcpu=corei7 -o /dev/null stress_14455.ll
1. Running pass 'Function Pass Manager' on module 'stress_14455.ll'.
2. Running pass 'CodeGen Prepare' on function '@autogen_SD0'
#0 0x00005574e2cbd466 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/llc+0x76a4466)
#1 0x00005574e2cbaf85 llvm::sys::RunSignalHandlers() (build-all/bin/llc+0x76a1f85)
#2 0x00005574e2cbdb99 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f17eba76d10 __restore_rt (/lib64/libpthread.so.0+0x12d10)
#4 0x00007f17e941652f raise (/lib64/libc.so.6+0x4e52f)
#5 0x00007f17e93e9e65 abort (/lib64/libc.so.6+0x21e65)
#6 0x00007f17e93e9d39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39)
#7 0x00007f17e940ee86 (/lib64/libc.so.6+0x46e86)
#8 0x00005574e2205d97 llvm::ShuffleVectorInst::isInsertSubvectorMask(llvm::ArrayRef<int>, int, int&, int&) (build-all/bin/llc+0x6becd97)
#9 0x00005574e1499a21 llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getInstructionCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>, llvm::TargetTransformInfo::TargetCostKind) const X86TargetTransformInfo.cpp:0:0
#10 0x00005574e1495224 llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::isExpensiveToSpeculativelyExecute(llvm::Instruction const*) const X86TargetTransformInfo.cpp:0:0
#11 0x00005574e1b3df3c (anonymous namespace)::CodeGenPrepare::optimizeSelectInst(llvm::SelectInst*) CodeGenPrepare.cpp:0:0
#12 0x00005574e1b22ebb (anonymous namespace)::CodeGenPrepare::_run(llvm::Function&) CodeGenPrepare.cpp:0:0
#13 0x00005574e1b209dc (anonymous namespace)::CodeGenPrepareLegacyPass::runOnFunction(llvm::Function&) CodeGenPrepare.cpp:0:0
#14 0x00005574e2227839 llvm::FPPassManager::runOnFunction(llvm::Function&) (build-all/bin/llc+0x6c0e839)
#15 0x00005574e222fe12 llvm::FPPassManager::runOnModule(llvm::Module&) (build-all/bin/llc+0x6c16e12)
#16 0x00005574e22282f8 llvm::legacy::PassManagerImpl::run(llvm::Module&) (build-all/bin/llc+0x6c0f2f8)
#17 0x00005574dfc6e5f0 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#18 0x00005574dfc6bd00 main (build-all/bin/llc+0x4652d00)
#19 0x00007f17e94027e5 __libc_start_main (/lib64/libc.so.6+0x3a7e5)
#20 0x00005574dfc6b16e _start (build-all/bin/llc+0x465216e)
Abort (core dumped)
```
[bbi-108404.ll.gz](https://github.com/user-attachments/files/20940083/bbi-108404.ll.gz)
https://github.com/llvm/llvm-project/pull/145920
More information about the llvm-commits
mailing list