[llvm] [VectorCombine] Expand `vector_insert` into shufflevector for earlier cost optimizations (#145512) (PR #146479)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 10 03:39:00 PDT 2025
laurenmchin wrote:
> Why is this necessary? Is there some pass that emits fixed vector insert instead of shufflevector?
Yes, because SLPVectorizer runs before VectorCombine in the default O2/O3 pipelines.
check-llvm tests like `alternate-cast.ll` expect `vector_insert` to be folded to `shufflevector` before SLP runs, which only happens if the fold is in InstCombine, otherwise SLP won’t catch it. You can see this in `PassBuilderPipelines.cpp`, in `PassBuilder::addVectorPasses`: InstCombinePass -> SLPVectorizerPass -> VectorCombinePass.
https://github.com/llvm/llvm-project/pull/146479
More information about the llvm-commits
mailing list