[PATCH] D30109: [MemorySSA] NFC small fixes

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 15:15:50 PST 2017


davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

You can probably on and commit a subset of this. I'm in doubt about the first chunk so I asked Danny/George to take a look.



================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1324-1335
   // increment the PopEpoch to account for this.
-  while (!VersionStack.empty()) {
+  while (true) {
+    assert(!VersionStack.empty() &&
+        "Version stack should have liveOnEntry sentinel dominating everything");
     BasicBlock *BackBlock = VersionStack.back()->getBlock();
     if (DT->dominates(BackBlock, BB))
       break;
----------------
hmm, this is probably correct but there's something that doesn't really convinces me about it, I'll let Danny/George to sign-off on this part of the patch. 


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1453-1461
-
-  // We perform a non-recursive top-down dominator tree walk
-  struct StackInfo {
-    const DomTreeNode *Node;
-    DomTreeNode::const_iterator Iter;
-  };
-
----------------
This is obviously dead code, so I'm fine with this part of the patch.,


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1462
   unsigned long PopEpoch = 1;
+  // We perform a non-recursive top-down dominator tree walk.
   for (const auto *DomNode : depth_first(DT->getRootNode()))
----------------
Nice comment.


https://reviews.llvm.org/D30109





More information about the llvm-commits mailing list