[PATCH] D32135: [LVI Printer] Rely on the LVI analysis functions rather than the LVI cache

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 16:23:18 PDT 2017


reames accepted this revision.
reames added a comment.

LGTM w/required changes.



================
Comment at: lib/Analysis/LazyValueInfo.cpp:1871
+    const BasicBlock *BB, formatted_raw_ostream &OS) {
+  // Find if there are latticevalues defined for arguments of the function.
+  auto *F = const_cast<Function *>(BB->getParent());
----------------
The const_casts looks concerning here.  We should be able to walk all the function/arg stuff without them; at most we need to cast before invoking the LVI interface.


================
Comment at: lib/Analysis/LazyValueInfo.cpp:1901
+    // Do not print undefined lattivce values.
+    if (!Result.isUndefined()) {
+      OS << "; LatticeVal for: '" << *I << "' in BB: '";
----------------
I'd print the unknown values too for ease of testing and consistency.


https://reviews.llvm.org/D32135





More information about the llvm-commits mailing list