]> granicus.if.org Git - llvm/commitdiff
[X86] Don't turn avx masked.load with constant mask into masked.load+vselect when...
authorCraig Topper <craig.topper@intel.com>
Thu, 6 Jun 2019 05:41:27 +0000 (05:41 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 6 Jun 2019 05:41:27 +0000 (05:41 +0000)
This is intended to enable the use of an immediate blend or
more optimal instruction. But if the passthru is zero we don't
need any additional instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362675 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/masked_load.ll

index c7f5ebfb98f818dd34b9ccbd45122e403a31680a..250af7ab8bc4109a929ef62b4bf5653f72ac5c54 100644 (file)
@@ -39120,6 +39120,9 @@ combineMaskedLoadConstantMask(MaskedLoadSDNode *ML, SelectionDAG &DAG,
   if (ML->getPassThru().isUndef())
     return SDValue();
 
+  if (ISD::isBuildVectorAllZeros(ML->getPassThru().getNode()))
+    return SDValue();
+
   // The new masked load has an undef pass-through operand. The select uses the
   // original pass-through operand.
   SDValue NewML = DAG.getMaskedLoad(VT, DL, ML->getChain(), ML->getBasePtr(),
index 738fb31364eae91ba336a9cac9ae4c317f1e3069..b5efae10536e6b32765694332cbc16325fbf3868 100644 (file)
@@ -6852,8 +6852,6 @@ define <8 x float> @mload_constmask_v8f32_zero(<8 x float>* %addr, <8 x float> %
 ; AVX1OR2:       ## %bb.0:
 ; AVX1OR2-NEXT:    vmovaps {{.*#+}} ymm0 = [4294967295,4294967295,4294967295,0,0,0,0,0]
 ; AVX1OR2-NEXT:    vmaskmovps (%rdi), %ymm0, %ymm0
-; AVX1OR2-NEXT:    vxorps %xmm1, %xmm1, %xmm1
-; AVX1OR2-NEXT:    vblendps {{.*#+}} ymm0 = ymm0[0,1,2],ymm1[3,4,5,6,7]
 ; AVX1OR2-NEXT:    retq
 ;
 ; AVX512F-LABEL: mload_constmask_v8f32_zero: