[PATCH] D66927: [Attributor] Implement AANoAliasCallSiteArgument initialization
Hideto Ueno via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 03:02:39 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL370456: [Attributor] Implement AANoAliasCallSiteArgument initialization (authored by uenoku, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D66927?vs=217782&id=218058#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66927/new/
https://reviews.llvm.org/D66927
Files:
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
llvm/trunk/test/Transforms/FunctionAttrs/noalias_returned.ll
Index: llvm/trunk/test/Transforms/FunctionAttrs/noalias_returned.ll
===================================================================
--- llvm/trunk/test/Transforms/FunctionAttrs/noalias_returned.ll
+++ llvm/trunk/test/Transforms/FunctionAttrs/noalias_returned.ll
@@ -142,8 +142,7 @@
; TEST 9
; Simple Argument Test
define internal void @test9(i8* %a, i8* %b) {
-; FIXME: missing noalias
-; CHECK: define internal void @test9(i8* %a, i8* %b)
+; CHECK: define internal void @test9(i8* noalias %a, i8* %b)
ret void
}
define void @test9_helper(i8* %a, i8* %b) {
@@ -156,12 +155,18 @@
; TEST 10
; Simple CallSite Test
-declare void @test10_helper(i8* %a)
+declare void @test10_helper_1(i8* %a)
+define void @test10_helper_2(i8* noalias %a) {
+ ret void
+}
define void @test10(i8* noalias %a) {
; CHECK: define void @test10(i8* noalias %a)
; FIXME: missing noalias
-; CHECK-NEXT: tail call void @test10_helper(i8* %a)
- tail call void @test10_helper(i8* %a)
+; CHECK-NEXT: tail call void @test10_helper_1(i8* %a)
+ tail call void @test10_helper_1(i8* %a)
+
+; CHECK-NEXT: tail call void @test10_helper_2(i8* noalias %a)
+ tail call void @test10_helper_2(i8* %a)
ret void
}
Index: llvm/trunk/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp
@@ -1592,8 +1592,10 @@
/// See AbstractAttribute::initialize(...).
void initialize(Attributor &A) override {
- // TODO: It isn't sound to initialize as the same with `AANoAliasImpl`
- // because `noalias` may not be valid in the current position.
+ // See callsite argument attribute and callee argument attribute.
+ ImmutableCallSite ICS(&getAnchorValue());
+ if (ICS.paramHasAttr(getArgNo(), Attribute::NoAlias))
+ indicateOptimisticFixpoint();
}
/// See AbstractAttribute::updateImpl(...).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66927.218058.patch
Type: text/x-patch
Size: 1948 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190830/69a5b966/attachment.bin>
More information about the llvm-commits
mailing list