[PATCH] D11918: Constant propagation after hiting assume(icmp)

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 02:35:07 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Transforms/Scalar/GVN.cpp:1778
@@ +1777,3 @@
+    // successor, but propagateEquality checks it.
+    Changed |= propagateEquality(V,
+                                 True,
----------------
It looks like all of the arguments could fit on one line (or at most two), please do that.


================
Comment at: lib/Transforms/Scalar/GVN.cpp:1782
@@ +1781,3 @@
+  }
+  if (auto *CmpI = dyn_cast<CmpInst>(V)) {
+    if (CmpI->getPredicate() == CmpInst::Predicate::ICMP_EQ ||
----------------
I'd prefer a blank line between the } and the if.

================
Comment at: lib/Transforms/Scalar/GVN.cpp:1784
@@ +1783,3 @@
+    if (CmpI->getPredicate() == CmpInst::Predicate::ICMP_EQ ||
+        CmpI->getPredicate() == CmpInst::Predicate::FCMP_OEQ) {
+      Value *CmpLHS = CmpI->getOperand(0);
----------------
We can include FCMP_UEQ here if the fcmp has the nnans fast-math flag, please do so.



http://reviews.llvm.org/D11918





More information about the llvm-commits mailing list