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

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 20:37:52 PDT 2015


nlewycky added inline comments.

================
Comment at: lib/Transforms/Scalar/GVN.cpp:1777-1778
@@ +1776,4 @@
+
+    // Equality propagation can't be done for every successor,
+    // but propagateEquality checks it.
+    Changed |= propagateEquality(V, True, Edge);
----------------
I think this comment could be made more clear. Why can't equality propagation be done for every successor? What does propagateEquality check? Something like:
  "This property is only true in dominated successors, propagateEquality will check dominance for us."
perhaps?

================
Comment at: lib/Transforms/Scalar/GVN.cpp:2077
@@ +2076,3 @@
+  for (unsigned OpNum = 0; OpNum < Instr->getNumOperands(); ++OpNum) {
+    Value *operand = Instr->getOperand(OpNum);
+    auto it = ReplaceWithConstMap.find(operand);
----------------
Operand

================
Comment at: test/Transforms/GVN/assume-ptr-equal.ll:28
@@ +27,3 @@
+  %2 = load i32 (%struct.A*)*, i32 (%struct.A*)** %vtable1.cast, align 8
+  %call2 = tail call i32 %2(%struct.A* %0) #1
+  br label %if.end
----------------
Is this a call to _ZN1A3fooEv or _Z1A3barEv? Put the CHECK line next to this line (usually right after).



http://reviews.llvm.org/D11918





More information about the llvm-commits mailing list