[PATCH] D45299: API to update MemorySSA for cloned blocks.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 16:00:37 PDT 2018


asbirlea added inline comments.


================
Comment at: lib/Analysis/MemorySSA.cpp:1548
+    Use = dyn_cast_or_null<MemoryUse>(Template) != nullptr;
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+    ModRefInfo ModRef = AA->getModRefInfo(I, None);
----------------
george.burgess.iv wrote:
> Why `|| defined(LLVM_ENABLE_DUMP)`?
copy-paste :)..removed.


================
Comment at: lib/Analysis/MemorySSAUpdater.cpp:702
+      if (!AddedBlockSet.count(Pi)) {
+        bool Inserted = PrevBlockSet.insert(Pi).second;
+        if (!Inserted)
----------------
george.burgess.iv wrote:
> Looks like you can replace everything between `{ ... }` with `EdgeCountMap[{Pi, BB}]++;`.
> 
> operator[] on map-like containers generally acts like "return a reference if it exists. otherwise, construct or zero-init a member in the map and return a ref to that"
Ah, I wasn't sure it was zero-inited. 


Repository:
  rL LLVM

https://reviews.llvm.org/D45299





More information about the llvm-commits mailing list