[PATCH] D10000: Refactor: Simplify boolean conditional return statements in lib/Transforms/Scalar

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 24 15:01:19 PDT 2015


sanjoy added a subscriber: sanjoy.
sanjoy added a comment.

I have only one nit inline.  Once that's fixed I'm happy to check this in on your behalf.


================
Comment at: lib/Transforms/Scalar/EarlyCSE.cpp:218
@@ -217,5 +217,3 @@
     CallInst *CI = dyn_cast<CallInst>(Inst);
-    if (!CI || !CI->onlyReadsMemory())
-      return false;
-    return true;
+    return !(!CI || !CI->onlyReadsMemory());
   }
----------------
This one should be "de-morganized" to `return CI && CI->onlyReadsMemory();`


http://reviews.llvm.org/D10000





More information about the llvm-commits mailing list