[PATCH] D29064: [MemorySSA] Add invariant.group handling

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 00:45:35 PST 2017


davide requested changes to this revision.
davide added a comment.
This revision now requires changes to proceed.

This probably needs rebasing after the recent Danny's change. First round of comments inline.



================
Comment at: include/llvm/Transforms/Utils/MemorySSA.h:633-637
+  const InvariantGroupAccesses *
+  getInvariantGroupBlockAccesses(const BasicBlock *BB) const {
+    auto It = PerBlockInvariantGroupAccesses.find(BB);
+    return It == PerBlockInvariantGroupAccesses.end() ? nullptr : &It->second;
+  }
----------------
comment this function? (as the one above)


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1508
+
+      // Skip liveOnEntry uses to not pesimize.
+      if (MSSA->isLiveOnEntryDef(MU->getDefiningAccess()))
----------------
s/pesimize/pessimize.


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1514-1517
+      if (isa<MemoryUse>(MU))
+        InsertingAccess = MU->getDefiningAccess();
+      else // MemoryDef
+        InsertingAccess = MU;
----------------
Ternary op here maybe?


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1537
   SmallVector<MemoryAccess *, 16> VersionStack;
+  // FIXME: this is not used.
   SmallVector<StackInfo, 16> DomTreeWorklist;
----------------
if it's not used, can you remove that separately?


================
Comment at: lib/Transforms/Utils/MemorySSA.cpp:1579-1582
+static bool hasInvariantGroupMD(const Instruction &I) {
+  return I.getMetadata(LLVMContext::MD_invariant_group) != nullptr;
+}
+
----------------
instead of a static function here you can probably make this a lambda inside `buildMemorySSA()` ? 


https://reviews.llvm.org/D29064





More information about the llvm-commits mailing list