Make MemorySSA::dominates/locallydominates constant time
Details
Diff Detail
Event Timeline
LGTM with a few comments; thanks for the patch!
include/llvm/Transforms/Utils/MemorySSA.h | ||
---|---|---|
635 | Given that we only ever store true for the value, can this be a DenseSet instead? | |
lib/Transforms/Utils/MemorySSA.cpp | ||
1205 | Do we need to invalidate numbering here, as well? (Alternatively, we could start all counts from 2, and always give a newly-created phi a value of 1, but that could also be done later as a part of the "number with a stride of N" optimization) | |
1582 | Nit: Please remove braces |
include/llvm/Transforms/Utils/MemorySSA.h | ||
---|---|---|
635 | Replaced with SmallPtrSet | |
lib/Transforms/Utils/MemorySSA.cpp | ||
1205 | Fixed. so after the equality/etc checks in dominates, you could do if (isa<MemoryPhi>(Dominator)) return true; if (isa<MemoryPhi>(Dominatee)) return false; But we can do this in a followup if it matters. |
Given that we only ever store true for the value, can this be a DenseSet instead?