[PATCH] D36233: [ThinLTO] Add FunctionAttrs to ThinLTO index
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 3 09:13:55 PDT 2017
tejohnson added inline comments.
================
Comment at: test/Bitcode/thinlto-function-summary-functionattrs.ll:4
+
+; CHECK: <GLOBALVAL_SUMMARY_BLOCK
+; ensure @f is marked readnone
----------------
ncharlie wrote:
> tejohnson wrote:
> > ncharlie wrote:
> > > tejohnson wrote:
> > > > Can you add a check for noalias as well?
> > > Sure - is there some trick to force a function to be marked as noalias?
> > >
> > > I can't find any examples of noalias functions in any of the tests and this doesn't seem to work:
> > > ```
> > > define noalias i32* @i() {
> > > %d = alloca i32;
> > > ret i32* %d;
> > > }
> > > ```
> > I see a few in the tests, here are some samples:
> > test/Transforms/SimplifyCFG/2011-03-08-UnreachableUse.ll:define noalias i8* @func_29() nounwind {
> > test/Transforms/GVN/malloc-load-removal.ll:define noalias i8* @test1() nounwind uwtable ssp {
> > test/Transforms/NewGVN/malloc-load-removal.ll:define noalias i8* @test1() nounwind uwtable ssp {
> > test/Transforms/LoopIdiom/basic.ll:define noalias i32* @test17(i32* nocapture readonly %a, i32 %c) {
> > test/Transforms/DeadStoreElimination/simple.ll:define noalias i8* @test23() nounwind uwtable ssp {
> > test/Transforms/FunctionAttrs/nonnull.ll:; CHECK: define noalias nonnull i8* @test4_helper
> >
> > In what way does it not work when you try it for your small example?
> >
> The functions (even with the noalias keyword) don't have the NoAlias flag set on them in my example or in the tests.
Somehow it is getting propagated. I.e. I took one of these tests (DeadStoreElimination/simple.ll) and did the following
$ llvm-as test/Transforms/DeadStoreElimination/simple.ll -o - | llvm-dis -o - | grep test23
I get:
define noalias i8* @test23() #3 {
Can you check this example?
https://reviews.llvm.org/D36233
More information about the llvm-commits
mailing list