[PATCH] D152082: [ValueTracking] getUnderlyingObject() look through phi.

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 3 17:22:32 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5647
 const Value *llvm::getUnderlyingObject(const Value *V, unsigned MaxLookup) {
+  DenseMap<const Value *, const Value *> Visited;
   std::function<const Value *(const Value *, unsigned)> Visit =
----------------
How often is the cache hit?


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5673
+            Visited[V] = V;
+            const Value *NewUnderlying = V;
+            for (const Value *IncomingValue : PHI->incoming_values()) {
----------------
Shouldn't V startout as PHI->getIncomingValue(0)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152082/new/

https://reviews.llvm.org/D152082



More information about the llvm-commits mailing list