[PATCH] Refactor: Simplify boolean conditional return statements in lib/Target/AArch64

Richard legalize at xmission.com
Mon May 25 08:57:42 PDT 2015


================
Comment at: lib/Target/AArch64/AArch64AddressTypePromotion.cpp:205
@@ -207,5 +204,3 @@
 static bool shouldSExtOperand(const Instruction *Inst, int OpIdx) {
-  if (isa<SelectInst>(Inst) && OpIdx == 0)
-    return false;
-  return true;
+  return !(isa<SelectInst>(Inst) && OpIdx == 0);
 }
----------------
craig.topper wrote:
> Push negate through
Fixed.

================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:133
@@ -132,5 +132,3 @@
   // so stay safe here and check both.
-  if (MFI->hasCalls() || hasFP(MF) || NumBytes > 128)
-    return false;
-  return true;
+  return !(MFI->hasCalls() || hasFP(MF) || NumBytes > 128);
 }
----------------
craig.topper wrote:
> Push negate through
Fixed.

================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:527
@@ -528,3 +526,3 @@
       MI->getOpcode() == AArch64::LDPXi || MI->getOpcode() == AArch64::LDPDi) {
-    if (!isCalleeSavedRegister(MI->getOperand(RtIdx).getReg(), CSRegs) ||
+    return !(!isCalleeSavedRegister(MI->getOperand(RtIdx).getReg(), CSRegs) ||
         !isCalleeSavedRegister(MI->getOperand(RtIdx + 1).getReg(), CSRegs) ||
----------------
craig.topper wrote:
> Push negate through
Fixed.

================
Comment at: lib/Target/AArch64/AArch64PromoteConstant.cpp:288
@@ -287,6 +287,3 @@
   const CallInst *CI = dyn_cast<const CallInst>(Instr);
-  if (CI && isa<const InlineAsm>(CI->getCalledValue()))
-    return false;
-
-  return true;
+  return !(CI && isa<const InlineAsm>(CI->getCalledValue()));
 }
----------------
craig.topper wrote:
> Push negate through
Fixed.

http://reviews.llvm.org/D9979

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list