[PATCH] Refactor: Simplify boolean conditional return statements in lib/Transforms/InstCombine
Richard
legalize at xmission.com
Mon May 25 10:30:05 PDT 2015
================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:281
@@ -280,6 +280,3 @@
// idiom where each element of the extended vector is either zero or all ones.
- if (opc == Instruction::SExt && isa<CmpInst>(V) && Ty->isVectorTy())
- return false;
-
- return true;
+ return !(opc == Instruction::SExt && isa<CmpInst>(V) && Ty->isVectorTy());
}
----------------
craig.topper wrote:
> Push the negate through
Fixed.
================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2559
@@ -2558,5 +2558,3 @@
auto *IC = dyn_cast<ICmpInst>(BI->getCondition());
- if (!IC || (IC->getOperand(0) != SI && IC->getOperand(1) != SI))
- return false;
- return true;
+ return !(!IC || (IC->getOperand(0) != SI && IC->getOperand(1) != SI));
}
----------------
craig.topper wrote:
> Push the negate through.
Fixed.
================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:100
@@ -99,6 +99,3 @@
// do allow things like i160 -> i64, but not i64 -> i160.
- if (!FromLegal && !ToLegal && ToWidth > FromWidth)
- return false;
-
- return true;
+ return !(!FromLegal && !ToLegal && ToWidth > FromWidth);
}
----------------
craig.topper wrote:
> Push the negate through
FIxed.
================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:959
@@ -961,5 +958,3 @@
// the indices.
- if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() &&
- !Src.hasOneUse())
- return false;
- return true;
+ return !(GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() &&
+ !Src.hasOneUse());
----------------
craig.topper wrote:
> Push the negate through
Fixed.
http://reviews.llvm.org/D9989
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list