[llvm] [SLP]Improved reduction cost/codegen (PR #118293)
Mikael Holmén via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 14 03:16:33 PST 2025
mikaelholmen wrote:
I'm seeing a crash with this patch when compiling for my out-of-tree target:
```
opt: ../lib/IR/Instructions.cpp:1748: llvm::ShuffleVectorInst::ShuffleVectorInst(Value *, Value *, ArrayRef<int>, const Twine &, InsertPosition): Assertion `isValidOperands(V1, V2, Mask) && "Invalid shuffle vector instruction operands!"' failed.
[...]
#9 0x0000555848bf2503 (anonymous namespace)::HorizontalReduction::tryToReduce(llvm::slpvectorizer::BoUpSLP&, llvm::DataLayout const&, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo const&, llvm::AssumptionCache*) SLPVectorizer.cpp:0:0
#10 0x0000555848bc1089 llvm::SLPVectorizerPass::vectorizeHorReduction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::SmallVectorImpl<llvm::WeakTrackingVH>&) (build-all/bin/opt+0x5faa089)
#11 0x0000555848bc14f2 llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (build-all/bin/opt+0x5faa4f2)
#12 0x0000555848bb601c llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (build-all/bin/opt+0x5f9f01c)
#13 0x0000555848bb2fd4 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (build-all/bin/opt+0x5f9bfd4)
#14 0x0000555848bb2557 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (build-all/bin/opt+0x5f9b557)
```
I'll see if I can manage to reproduce for some in-tree target too.
https://github.com/llvm/llvm-project/pull/118293
More information about the llvm-commits
mailing list