[PATCH] LLVM CFL Alias Analysis -- Algorithm

George Burgess IV gbiv at google.com
Thu Jul 24 11:06:22 PDT 2014


================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:121
@@ +120,3 @@
+
+    return MayAlias;
+    if (isa<Constant>(locA.Ptr) && isa<Constant>(locB.Ptr)) {
----------------
Daniel Berlin wrote:
> Unless i'm miscounting braces, doesn't this cause this function to always return MayAlias?
> I assume this was just debugging code that was left in when you were running final numbers, since i've seen the actual numbers :)
Yup, it's from testing timing/etc. My apologies/will be removed in the next revision.. :)

================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:142
@@ +141,3 @@
+// \brief Edges can be one of four "weights"
+enum class EdgeWeight { AssignFrom, AssignTo, Dereference, Reference };
+
----------------
Daniel Berlin wrote:
> AssignTo appears unused, and could you add a comment about what type of statement you expect each to represent.
It's meant to be the counterpart for AssignFrom, because we're using a bidirected graph. Will add comments and will condense AssignFrom/AssignTo down to Assign if the From/To ends up giving us nothing.

================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:293
@@ +292,3 @@
+    auto *val = inst.getOperand(1);
+    output->push_back({val, ptr, EdgeWeight::Reference});
+    return true;
----------------
Daniel Berlin wrote:
> Can you talk a bit about why the Insert* calls are Reference edges, instead of say, assignto?
Good point! Fixed in next rev.

http://reviews.llvm.org/D4551






More information about the llvm-commits mailing list