Now, nocapture is deduced in Attributor therefore, this patch introduces deduction for noalias callsite argument using nocapture.
Details
Diff Detail
- Repository
 - rL LLVM
 
Event Timeline
| llvm/lib/Transforms/IPO/Attributor.cpp | ||
|---|---|---|
| 1675 ↗ | (On Diff #219124) | 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 ↗ | (On Diff #219124) | 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 ↗ | (On Diff #219124) | 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 ↗ | (On Diff #219124) | 
 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 | ||
|---|---|---|
| 1732 ↗ | (On Diff #219244) | AANoCapture will get a "isCapturedBefore" functionality at some point to solve this.  | 
| 1736 ↗ | (On Diff #219244) | make it isAssumedNoCaptureMaybeReturned.  | 
| 2644 ↗ | (On Diff #219244) | I do not understand these changes. Why do they help? Can we extract them into a different commit?  | 
| 2914 ↗ | (On Diff #219244) | Again, why is this needed?  | 
| llvm/lib/Transforms/IPO/Attributor.cpp | ||
|---|---|---|
| 2644 ↗ | (On Diff #219244) | I used an internal attribute to look at deduction but anyway I don't need anymore.   | 
| 2914 ↗ | (On Diff #219244) | 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.  |