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

Craig Topper craig.topper at gmail.com
Mon May 25 02:27:41 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);
 }
----------------
Push negate through

================
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);
 }
----------------
Push negate through

================
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) ||
----------------
Push negate through

================
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()));
 }
----------------
Push negate through

http://reviews.llvm.org/D9979

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






More information about the llvm-commits mailing list