Toward noalias backward propagation(similar to D65402), this patch adds AANoAliasArgument and AANoAliasCallSiteArgument as staring point.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Minor comments
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1358 ↗ | (On Diff #215059) | this can now be auto CallSiteCheck = [&](CallSiteCheck CS){ ... } |
1375 ↗ | (On Diff #215059) | It looks like this is not the latest version of checkForAllCallSites. Now it also takes a function as a parameter. |
Please add an SCC test and maybe also tests we cannot handle yet (see my link) and https://reviews.llvm.org/D50125#change-PYgdy9Zf8j2e
Edit: we don't need the extended functionality in this patch but tests would be nice.
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1398 ↗ | (On Diff #215059) | This is a good first step. For an extension we could do something like this: |
Can we make prioritize this, at least a simple version which is almost done, just the additional argument checks are missing (see below).
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1398 ↗ | (On Diff #215059) | See my example below, we need to check the other uses in the call site as I did in the link above. |
llvm/test/Transforms/FunctionAttrs/noalias.ll | ||
164 ↗ | (On Diff #215059) | ; TEST 11 ; CallSite Test declare void @test11_helper(i8* %a, i8 *%b) define void @test11(i8* noalias %a) { ; CHECK: define void @test11(i8* noalias %a) ; CHECK-NEXT: tail call void @test11_helper(i8* %a, i8* %a) tail call void @test11_helper(i8* %a) ret void } |
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
396 ↗ | (On Diff #217603) | About initialize, I think it suffices to ignore this line for call site argument. |
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1533 ↗ | (On Diff #217603) | I do not understand. Could you elaborate or point me to a test case? |
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1533 ↗ | (On Diff #217603) | declare void @test11_helper(i8* %a) define void @test11(i8* noalias %a) { tail call void @test11_helper(i8* %a) ; maybe captured %c = load i8 , i8* %a ; It is invalid to deduce noalias for %a because of noalias in argument ret void } Isn't it? |
I think except the small nits below this is fine. We can get this in and work from there
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1533 ↗ | (On Diff #217603) | Ah, now I see your point. thx |
llvm/test/Transforms/FunctionAttrs/internal-noalias.ll | ||
8 ↗ | (On Diff #217603) | Add check lines above or use llvm/utils/update_test_checks.py for the test files. |
llvm/test/Transforms/FunctionAttrs/noalias_returned.ll | ||
145 ↗ | (On Diff #217603) | Missing noalias where? Maybe show how it should look like. |