[PATCH] Refactor: Simplify boolean conditional return statements in llvm/lib/CodeGen
Craig Topper
craig.topper at gmail.com
Sun May 24 23:57:52 PDT 2015
================
Comment at: lib/CodeGen/MachineLICM.cpp:946
@@ -945,6 +945,3 @@
// Stores and side effects are already checked by isSafeToMove.
- if (I.mayLoad() && !isLoadFromGOTOrConstantPool(I) &&
- !IsGuaranteedToExecute(I.getParent()))
- return false;
-
- return true;
+ return !(I.mayLoad() && !isLoadFromGOTOrConstantPool(I) &&
+ !IsGuaranteedToExecute(I.getParent()));
----------------
Push the negate through
================
Comment at: lib/CodeGen/PseudoSourceValue.cpp:98
@@ -97,3 +97,3 @@
bool PseudoSourceValue::mayAlias(const MachineFrameInfo *MFI) const {
- if (this == getGOT() ||
+ return !(this == getGOT() ||
this == getConstantPool() ||
----------------
Push the negate through and use ANDs
================
Comment at: lib/CodeGen/TargetInstrInfo.cpp:202
@@ -201,6 +201,3 @@
SrcOpIdx2 = SrcOpIdx1 + 1;
- if (!MI->getOperand(SrcOpIdx1).isReg() ||
- !MI->getOperand(SrcOpIdx2).isReg())
- // No idea.
- return false;
- return true;
+ return !(!MI->getOperand(SrcOpIdx1).isReg() ||
+ !MI->getOperand(SrcOpIdx2).isReg());
----------------
Push the negate through
http://reviews.llvm.org/D9970
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list