From 3c6cf4a209b4e71273e2dba97c9169ebdf70532c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 3 Jun 2018 18:08:36 +0000 Subject: [PATCH] [X86] When emitting masked loads/stores don't check for all ones mask. 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 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index ffcc5ba5fe..e078a091a7 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -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(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(Ops[2])) - if (C->isAllOnesValue()) - return CGF.Builder.CreateAlignedLoad(Ops[0], Align); - Value *MaskVec = getMaskVecValue(CGF, Ops[2], Ops[1]->getType()->getVectorNumElements()); -- 2.50.1