[llvm] [InstCombine] Sink widening casts used only by extractelements (PR #201529)

Barbara Mitic via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 09:03:13 PDT 2026


barbara-amd wrote:

> Would this fold (inc the existing canonicalisation) be better in vectorcombine where we can drive it by costs?

I’m treating this as generalizing the existing single-use extract(cast) → cast(extract) canonicalization, not a separate target-cost-driven pass. It only fires for widening casts whose every user is a sinkable extractelement, so the wide cast is fully removed - there’s no remaining use of the widened value as a vector, only lane-wise extracts.

Do you have a particular concern with keeping this in InstCombine, or a strong preference to move the multi-use case to VectorCombine? 

https://github.com/llvm/llvm-project/pull/201529


More information about the llvm-commits mailing list