[llvm] [InstCombine][X86] Only demand used bits for PSHUFB mask values (PR #106377)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 05:45:00 PDT 2024


================
@@ -2950,11 +2950,16 @@ X86TTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const {
 
   case Intrinsic::x86_ssse3_pshuf_b_128:
   case Intrinsic::x86_avx2_pshuf_b:
-  case Intrinsic::x86_avx512_pshuf_b_512:
+  case Intrinsic::x86_avx512_pshuf_b_512: {
     if (Value *V = simplifyX86pshufb(II, IC.Builder)) {
       return IC.replaceInstUsesWith(II, V);
     }
+    KnownBits KnownMask(8);
+    if (IC.SimplifyDemandedBits(&II, 1, APInt(8, 0b10001111), KnownMask)) {
+      return ⅈ
+    }
----------------
phoebewang wrote:

Remove parentheses

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


More information about the llvm-commits mailing list