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

Craig Topper craig.topper at gmail.com
Mon May 25 02:35:36 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)) {
----------------
Push the negate through.

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

http://reviews.llvm.org/D9985

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






More information about the llvm-commits mailing list