]> granicus.if.org Git - clang/commitdiff
[X86] When emitting masked loads/stores don't check for all ones mask.
authorCraig Topper <craig.topper@intel.com>
Sun, 3 Jun 2018 18:08:36 +0000 (18:08 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 3 Jun 2018 18:08:36 +0000 (18:08 +0000)
This seems like a premature optimization. It's unlikely a user would pass something the frontend can tell is all ones to the masked load/store intrinsics.

We do this optimization for emitting select for masking because we have builtin calls in header files that pass an all ones mask in. Though at this point we may not longer have any builtins that emit some IR and a select. We may only have the select builtins so maybe we can remove that optimization too.

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

lib/CodeGen/CGBuiltin.cpp

index ffcc5ba5fe2b41a5c1134cfc151e885da8d61aa2..e078a091a728fb974aeac178cd27833ca8c96110 100644 (file)
@@ -8269,11 +8269,6 @@ static Value *EmitX86MaskedStore(CodeGenFunction &CGF,
   Ops[0] = CGF.Builder.CreateBitCast(Ops[0],
                                llvm::PointerType::getUnqual(Ops[1]->getType()));
 
-  // If the mask is all ones just emit a regular store.
-  if (const auto *C = dyn_cast<Constant>(Ops[2]))
-    if (C->isAllOnesValue())
-      return CGF.Builder.CreateAlignedStore(Ops[1], Ops[0], Align);
-
   Value *MaskVec = getMaskVecValue(CGF, Ops[2],
                                    Ops[1]->getType()->getVectorNumElements());
 
@@ -8286,11 +8281,6 @@ static Value *EmitX86MaskedLoad(CodeGenFunction &CGF,
   Ops[0] = CGF.Builder.CreateBitCast(Ops[0],
                                llvm::PointerType::getUnqual(Ops[1]->getType()));
 
-  // If the mask is all ones just emit a regular store.
-  if (const auto *C = dyn_cast<Constant>(Ops[2]))
-    if (C->isAllOnesValue())
-      return CGF.Builder.CreateAlignedLoad(Ops[0], Align);
-
   Value *MaskVec = getMaskVecValue(CGF, Ops[2],
                                    Ops[1]->getType()->getVectorNumElements());