summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-09-27 21:28:41 +0000
committerCraig Topper <craig.topper@intel.com>2018-09-27 21:28:41 +0000
commitdfe460db5718829545a436b998dcc1927ab67c9d (patch)
treeadb656e4429c4b2033070c4cc734e5f3beac28dc /llvm/lib/CodeGen
parent49dad8b8af88c8359cfd3659b92d6f0b9a1bd13a (diff)
downloadbcm5719-llvm-dfe460db5718829545a436b998dcc1927ab67c9d.tar.gz
bcm5719-llvm-dfe460db5718829545a436b998dcc1927ab67c9d.zip
[ScalarizeMaskedMemIntrin] Remove some temporary variables that are only used by a single if condition.
llvm-svn: 343268
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
index ed598682aa4..549697c7139 100644
--- a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
+++ b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
@@ -131,10 +131,7 @@ static void scalarizeMaskedLoad(CallInst *CI) {
Builder.SetCurrentDebugLocation(CI->getDebugLoc());
// Short-cut if the mask is all-true.
- bool IsAllOnesMask =
- isa<Constant>(Mask) && cast<Constant>(Mask)->isAllOnesValue();
-
- if (IsAllOnesMask) {
+ if (isa<Constant>(Mask) && cast<Constant>(Mask)->isAllOnesValue()) {
Value *NewI = Builder.CreateAlignedLoad(Ptr, AlignVal);
CI->replaceAllUsesWith(NewI);
CI->eraseFromParent();
@@ -269,10 +266,7 @@ static void scalarizeMaskedStore(CallInst *CI) {
Builder.SetCurrentDebugLocation(CI->getDebugLoc());
// Short-cut if the mask is all-true.
- bool IsAllOnesMask =
- isa<Constant>(Mask) && cast<Constant>(Mask)->isAllOnesValue();
-
- if (IsAllOnesMask) {
+ if (isa<Constant>(Mask) && cast<Constant>(Mask)->isAllOnesValue()) {
Builder.CreateAlignedStore(Src, Ptr, AlignVal);
CI->eraseFromParent();
return;
@@ -391,9 +385,7 @@ static void scalarizeMaskedGather(CallInst *CI) {
unsigned VectorWidth = VecType->getNumElements();
// Shorten the way if the mask is a vector of constants.
- bool IsConstMask = isa<ConstantVector>(Mask);
-
- if (IsConstMask) {
+ if (isa<ConstantVector>(Mask)) {
for (unsigned Idx = 0; Idx < VectorWidth; ++Idx) {
if (cast<ConstantVector>(Mask)->getOperand(Idx)->isNullValue())
continue;
@@ -512,9 +504,7 @@ static void scalarizeMaskedScatter(CallInst *CI) {
unsigned VectorWidth = Src->getType()->getVectorNumElements();
// Shorten the way if the mask is a vector of constants.
- bool IsConstMask = isa<ConstantVector>(Mask);
-
- if (IsConstMask) {
+ if (isa<ConstantVector>(Mask)) {
for (unsigned Idx = 0; Idx < VectorWidth; ++Idx) {
if (cast<ConstantVector>(Mask)->getOperand(Idx)->isNullValue())
continue;
@@ -527,6 +517,7 @@ static void scalarizeMaskedScatter(CallInst *CI) {
CI->eraseFromParent();
return;
}
+
for (unsigned Idx = 0; Idx < VectorWidth; ++Idx) {
// Fill the "else" block, created in the previous iteration
//
OpenPOWER on IntegriCloud