[llvm] 2ae67c9 - [BasicAA] Add range test with multiple indices (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 24 07:13:34 PDT 2021
Author: Nikita Popov
Date: 2021-10-24T16:13:03+02:00
New Revision: 2ae67c9684ec3ecc5ae61802528d4a3618bed57a
URL: https://github.com/llvm/llvm-project/commit/2ae67c9684ec3ecc5ae61802528d4a3618bed57a
DIFF: https://github.com/llvm/llvm-project/commit/2ae67c9684ec3ecc5ae61802528d4a3618bed57a.diff
LOG: [BasicAA] Add range test with multiple indices (NFC)
Added:
Modified:
llvm/test/Analysis/BasicAA/range.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/range.ll b/llvm/test/Analysis/BasicAA/range.ll
index 5a3c09b57a0e5..d1847d618e948 100644
--- a/llvm/test/Analysis/BasicAA/range.ll
+++ b/llvm/test/Analysis/BasicAA/range.ll
@@ -178,6 +178,25 @@ define void @zeroext_index([256 x i32]* %s, i8* %q) {
ret void
}
+; CHECK-LABEL: Function: multiple
+; CHECK: MayAlias: i32* %p, i32* %p.01
+; CHECK: MayAlias: i32* %p, i32* %p.02
+; CHECK: MayAlias: i32* %p.01, i32* %p.02
+; CHECK: NoAlias: i32* %p.01, i32* %p.2
+; CHECK: MayAlias: i32* %p.02, i32* %p.2
+; CHECK: NoAlias: i32* %p.01, i32* %p.3
+; TODO: This can be NoAlias.
+; CHECK: MayAlias: i32* %p.02, i32* %p.3
+define void @multiple(i32* %p, i32* %o1_ptr, i32* %o2_ptr) {
+ %o1 = load i32, i32* %o1_ptr, !range !0
+ %o2 = load i32, i32* %o2_ptr, !range !0
+ %p.01 = getelementptr i32, i32* %p, i32 %o1 ; p + [0, 1]
+ %p.02 = getelementptr i32, i32* %p.01, i32 %o2 ; p + [0, 2]
+ %p.2 = getelementptr i32, i32* %p, i32 2
+ %p.3 = getelementptr i32, i32* %p, i32 3
+ ret void
+}
+
!0 = !{ i32 0, i32 2 }
!1 = !{ i32 0, i32 1 }
More information about the llvm-commits
mailing list