[PATCH] D13512: [GlobalsAA] Loosen an overly conservative bailout

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 10:33:26 PDT 2015


chandlerc added inline comments.

================
Comment at: lib/Analysis/GlobalsModRef.cpp:613
@@ +612,3 @@
+      continue;
+    if (isa<GlobalValue>(Input) || isa<Argument>(Input) || isa<CallInst>(Input) ||
+        isa<InvokeInst>(Input))
----------------
GlobalValue is repeated here. I would keep a single if, and merge the two comments. Your comment above is excellent.

================
Comment at: lib/Analysis/GlobalsModRef.cpp:730
@@ -668,1 +729,3 @@
     }
+    // Recurse through a limited number of selects, loads and PHIs. This is an
+    // arbitrary depth of 4, lower numbers could be used to fix compile time
----------------
Add vertical space before here?

================
Comment at: lib/Analysis/GlobalsModRef.cpp:741
@@ -673,1 +740,3 @@
+      const Value *Ptr = GetUnderlyingObject(LI->getPointerOperand(), DL);
+      if (isa<GlobalValue>(Ptr))
         continue;
----------------
Just call the function? This is the first test it does.

================
Comment at: lib/Analysis/GlobalsModRef.cpp:747
@@ +746,3 @@
+        continue;
+      } else {
+        // Otherwise, a load could come from anywhere, so bail.
----------------
No need for else after a continue.


Repository:
  rL LLVM

http://reviews.llvm.org/D13512





More information about the llvm-commits mailing list