[llvm] c1706f2 - [tests] precommit tests for an upcoming AA improvement
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 09:51:07 PST 2021
Author: Philip Reames
Date: 2021-02-24T09:51:00-08:00
New Revision: c1706f2269ac82cbae2ed538f0857fa6516bcbb4
URL: https://github.com/llvm/llvm-project/commit/c1706f2269ac82cbae2ed538f0857fa6516bcbb4
DIFF: https://github.com/llvm/llvm-project/commit/c1706f2269ac82cbae2ed538f0857fa6516bcbb4.diff
LOG: [tests] precommit tests for an upcoming AA improvement
Added:
Modified:
llvm/test/Analysis/BasicAA/recphi.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/recphi.ll b/llvm/test/Analysis/BasicAA/recphi.ll
index 7f8bc9d7b668..ac0b27cca650 100644
--- a/llvm/test/Analysis/BasicAA/recphi.ll
+++ b/llvm/test/Analysis/BasicAA/recphi.ll
@@ -292,4 +292,85 @@ exit:
ret void
}
+; CHECK-LABEL: Function: nested_loop3
+; CHECK: NoAlias: i8* %a, i8* %p.base
+; CHECK: NoAlias: i8* %a, i8* %p.outer
+; CHECK: NoAlias: i8* %a, i8* %p.outer.next
+; CHECK: MayAlias: i8* %a, i8* %p.inner
+; CHECK: NoAlias: i8* %a, i8* %p.inner.next
+; TODO: %p.inner does not alias %a
+define void @nested_loop3(i1 %c, i1 %c2, i8* noalias %p.base) {
+entry:
+ %a = alloca i8
+ br label %outer_loop
+
+outer_loop:
+ %p.outer = phi i8* [ %p.base, %entry ], [ %p.outer.next, %outer_loop_latch ]
+ %p.outer.next = getelementptr inbounds i8, i8* %p.outer, i64 10
+ br label %inner_loop
+
+inner_loop:
+ %p.inner = phi i8* [ %p.outer, %outer_loop ], [ %p.inner.next, %inner_loop ]
+ %p.inner.next = getelementptr inbounds i8, i8* %p.inner, i64 1
+ br i1 %c, label %inner_loop, label %outer_loop_latch
+
+outer_loop_latch:
+ br i1 %c2, label %outer_loop, label %exit
+
+exit:
+ ret void
+}
+
+; CHECK-LABEL: Function: sibling_loop
+; CHECK: NoAlias: i8* %a, i8* %p.base
+; CHECK: NoAlias: i8* %a, i8* %p1
+; CHECK: NoAlias: i8* %a, i8* %p1.next
+; CHECK: MayAlias: i8* %a, i8* %p2
+; CHECK: NoAlias: i8* %a, i8* %p2.next
+; TODO: %p2 does not alias %a
+define void @sibling_loop(i1 %c, i1 %c2, i8* noalias %p.base) {
+entry:
+ %a = alloca i8
+ br label %loop1
+
+loop1:
+ %p1 = phi i8* [ %p.base, %entry ], [ %p1.next, %loop1 ]
+ %p1.next = getelementptr inbounds i8, i8* %p1, i64 10
+ br i1 %c, label %loop1, label %loop2
+
+loop2:
+ %p2 = phi i8* [ %p1.next, %loop1 ], [ %p2.next, %loop2 ]
+ %p2.next = getelementptr inbounds i8, i8* %p2, i64 1
+ br i1 %c2, label %loop2, label %exit
+
+exit:
+ ret void
+}
+
+; CHECK-LABEL: Function: sibling_loop2
+; CHECK: NoAlias: i8* %a, i8* %p.base
+; CHECK: NoAlias: i8* %a, i8* %p1
+; CHECK: NoAlias: i8* %a, i8* %p1.next
+; CHECK: MayAlias: i8* %a, i8* %p2
+; CHECK: NoAlias: i8* %a, i8* %p2.next
+; TODO: %p2 does not alias %a
+define void @sibling_loop2(i1 %c, i1 %c2, i8* noalias %p.base) {
+entry:
+ %a = alloca i8
+ br label %loop1
+
+loop1:
+ %p1 = phi i8* [ %p.base, %entry ], [ %p1.next, %loop1 ]
+ %p1.next = getelementptr inbounds i8, i8* %p1, i64 10
+ br i1 %c, label %loop1, label %loop2
+
+loop2:
+ %p2 = phi i8* [ %p1, %loop1 ], [ %p2.next, %loop2 ]
+ %p2.next = getelementptr inbounds i8, i8* %p2, i64 1
+ br i1 %c2, label %loop2, label %exit
+
+exit:
+ ret void
+}
+
declare i16 @call(i32)
More information about the llvm-commits
mailing list