[PATCH] D14476: [LVI] Introduce an intersect operation on lattice values

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 11:25:05 PST 2015


sanjoy added a comment.

Two nitpicky comments inline.


================
Comment at: lib/Analysis/LazyValueInfo.cpp:1019
@@ +1018,3 @@
+    // TODO: Arbitrary choice, could be improved
+    return A;
+  }
----------------
Why not return `A.isConstantRange() ? A : B`?

================
Comment at: lib/Analysis/LazyValueInfo.cpp:1041
@@ +1040,3 @@
+  LVILatticeVal LocalResult;
+  if (getEdgeValueLocal(Val, BBFrom, BBTo, LocalResult)) {
+    // No new work to push, just fallthrough
----------------
This looks a little misleading.  If the return value of `getEdgeValueLocal` truly does not matter, I'd prefer the more idiomatic `(void)getEdgeValueLocal(...)`


http://reviews.llvm.org/D14476





More information about the llvm-commits mailing list