[llvm] [InstCombine][X86] Fold blendv(x, y, shuffle(bitcast(sext(m)))) -> select(shuffle(m),x,y) (PR #96882)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 03:51:15 PDT 2024


================
@@ -2800,6 +2800,23 @@ X86TTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
       return SelectInst::Create(NewSelector, Op1, Op0, "blendv");
     }
 
+    // Peek through a one-use shuffle - VectorCombine should have simplified
+    // this for cases where we're splitting wider vectors to use blendv
+    // intrinsics.
+    Value *MaskSrc = nullptr;
----------------
RKSimon wrote:

I'll investigate this as a followup, but I've already tried very hard on VectorCombine to make sure we simplify bitcast(shuffle(bitcast(shuffle()))) chains that we would have to peek through

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


More information about the llvm-commits mailing list