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

Richard legalize at xmission.com
Mon May 25 09:57:19 PDT 2015


================
Comment at: lib/Target/R600/R600InstrInfo.cpp:916
@@ -915,5 +915,3 @@
     // TODO: We don't support KC merging atm
-    if (MI->getOperand(3).getImm() != 0 || MI->getOperand(4).getImm() != 0)
-      return false;
-    return true;
+    return !(MI->getOperand(3).getImm() != 0 || MI->getOperand(4).getImm() != 0);
   } else if (isVector(*MI)) {
----------------
craig.topper wrote:
> Push the negate through.
Fixed.

================
Comment at: lib/Target/R600/R600Packetizer.cpp:215
@@ -216,6 +214,3 @@
                  TII->usesAddressRegister(MIJ);
-    if (ARDef && ARUse)
-      return false;
-
-    return true;
+    return !(ARDef && ARUse);
   }
----------------
craig.topper wrote:
> Push the negate through
Fixed.

http://reviews.llvm.org/D9985

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






More information about the llvm-commits mailing list