[PATCH] D21110: [CFLAA] Add yet another StratifiedAttr

Jia Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 13:49:56 PDT 2016


grievejia added inline comments.

================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:1014
@@ +1013,3 @@
+        if (MaybeCurAttr && Direction == Level::Below)
+          Builder.noteAttributes(OtherValue, *MaybeCurAttr);
+
----------------
george.burgess.iv wrote:
> ISTM we would end up with different attributes for the StratifiedSets in cases like:
> 
> ```
> void foo(int **a) {
>   int **aalias = a;
>   int *b = *a;
> }
> ```
> 
> and
> 
> ```
> void foo(int **a) {
>   int **aalias = a;
>   int *b = *aalias;
> }
> ```
> 
> ...Since, when analyzing `*a`, MaybeCurAttr is marked as External (and Arg #0), whereas when looking at `*aalias`, we won't mark any attributes. After set finalization/etc, the former code sample will end with two sets, each with External and Arg #0 attrs, but the latter will produce two sets with only the External attr set.
> 
> Is this intentional?
But a and aalias will be merged together into one node later, right? Whatever attribute that a gets will be transferred to aalias.

================
Comment at: lib/Analysis/CFLAliasAnalysis.cpp:1037
@@ -1018,5 +1036,3 @@
 
-    auto Attr = valueToAttr(&Arg);
-    if (Attr.hasValue())
-      Builder.noteAttributes(&Arg, *Attr);
+    Builder.noteAttributes(&Arg, AttrExternal);
   }
----------------
george.burgess.iv wrote:
> Is there a reason that we don't honor the `noalias` attribute anymore here?
Sorry. That was my negligence. 


http://reviews.llvm.org/D21110





More information about the llvm-commits mailing list