Now, nocapture is deduced in Attributor therefore, this patch introduces deduction for noalias callsite argument using nocapture.
Details
Diff Detail
Event Timeline
| llvm/lib/Transforms/IPO/Attributor.cpp | ||
|---|---|---|
| 1675–1677 | Once I thought it is not sound to do this initialization but, I reconsider that unless we don't manifest the information for floating value, there is no problem. | |
| llvm/test/Transforms/FunctionAttrs/noalias_returned.ll | ||
|---|---|---|
| 235 | We need to make sure this test works as well: define void @test12_3(){
%A = tail call noalias i8* @malloc(i64 4)
tail call void @two_args(i8* %A, i8* %A)
ret void
} | |
| llvm/test/Transforms/FunctionAttrs/noalias_returned.ll | ||
|---|---|---|
| 235 | If @two_args is: declare void @two_args(i8* nocapture , i8* nocapture) then define void @test12_3(){
%A = tail call noalias i8* @malloc(i64 4)
tail call void @two_args(i8* noalias nocapture %A, i8* noalias nocapture%A)
ret void
}(If either argument is not marked as nocapture, there is no problem.) | |
| llvm/test/Transforms/FunctionAttrs/noalias_returned.ll | ||
|---|---|---|
| 235 |
Exactly. They need to be checked for aliases wrt. other arguments. | |
Except the nocapture changes this looks good to me. Can we make sure these are needed before we commit this?
| llvm/lib/Transforms/IPO/Attributor.cpp | ||
|---|---|---|
| 1733 | AANoCapture will get a "isCapturedBefore" functionality at some point to solve this. | |
| 1737 | make it isAssumedNoCaptureMaybeReturned. | |
| 2647 | I do not understand these changes. Why do they help? Can we extract them into a different commit? | |
| 2917 | Again, why is this needed? | |
| llvm/lib/Transforms/IPO/Attributor.cpp | ||
|---|---|---|
| 2647 | I used an internal attribute to look at deduction but anyway I don't need anymore. | |
| 2917 | I encountered a runtime exception in test/Transform/FunctionAttrs/misc.ll. Once I added this check as a solution but now I find that it works well without the check. | |
Once I thought it is not sound to do this initialization but, I reconsider that unless we don't manifest the information for floating value, there is no problem.