[PATCH] D28181: [MemDep] NFC walk invariant.group graph only down

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 04:33:04 PST 2017


davide added inline comments.


================
Comment at: lib/Analysis/MemoryDependenceAnalysis.cpp:359
   // Queue to process all pointers that are equivalent to load operand.
-  SmallVector<const Value *, 8> LoadOperandsQueue;
-  SmallSet<const Value *, 14> SeenValues;
-  auto TryInsertToQueue = [&](Value *V) {
-    if (SeenValues.insert(V).second)
-      LoadOperandsQueue.push_back(V);
-  };
-
-  TryInsertToQueue(LoadOperand);
+  SmallVector<const Value *, 10> LoadOperandsQueue;
+  LoadOperandsQueue.push_back(LoadOperand);
----------------
Any reason why did you change the initial size of the `SmallVector`?


================
Comment at: test/Transforms/GVN/invariant.group.ll:372-393
+define void @testNotGlobal() {
+   %a = alloca i8
+   call void @foo(i8* %a)
+; CHECK:  %b = load i8, i8* %a, !invariant.group !0
+   %b = load i8, i8* %a, !invariant.group !0
+   call void @foo2(i8* %a, i8 %b)
+
----------------
ideally the checks should be auto-generated (many people, me included forget to do so)


https://reviews.llvm.org/D28181





More information about the llvm-commits mailing list