[llvm] 7e97347 - [BasicAA] Add test for incorrect non-negative logic (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 25 09:02:49 PDT 2021
Author: Nikita Popov
Date: 2021-10-25T18:02:41+02:00
New Revision: 7e97347409ded0f8218ac39d5291790a6a2b8625
URL: https://github.com/llvm/llvm-project/commit/7e97347409ded0f8218ac39d5291790a6a2b8625
DIFF: https://github.com/llvm/llvm-project/commit/7e97347409ded0f8218ac39d5291790a6a2b8625.diff
LOG: [BasicAA] Add test for incorrect non-negative logic (NFC)
Added:
Modified:
llvm/test/Analysis/BasicAA/assume-index-positive.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/assume-index-positive.ll b/llvm/test/Analysis/BasicAA/assume-index-positive.ll
index 88f2d84fcabb..451592067f4b 100644
--- a/llvm/test/Analysis/BasicAA/assume-index-positive.ll
+++ b/llvm/test/Analysis/BasicAA/assume-index-positive.ll
@@ -130,5 +130,20 @@ define void @symmetry([0 x i8]* %ptr, i32 %a, i32 %b, i32 %c) {
ret void
}
+; TODO: %ptr.neg and %ptr.shl may alias, as the shl renders the previously
+; non-negative value potentially negative.
+define void @shl_of_non_negative(i8* %ptr, i64 %a) {
+; CHECK-LABEL: Function: shl_of_non_negative
+; CHECK: NoAlias: i8* %ptr.a, i8* %ptr.neg
+; CHECK: NoAlias: i8* %ptr.neg, i8* %ptr.shl
+ %a.cmp = icmp sge i64 %a, 0
+ call void @llvm.assume(i1 %a.cmp)
+ %ptr.neg = getelementptr i8, i8* %ptr, i64 -2
+ %ptr.a = getelementptr i8, i8* %ptr, i64 %a
+ %shl = shl i64 %a, 1
+ %ptr.shl = getelementptr i8, i8* %ptr, i64 %shl
+ ret void
+}
+
declare void @llvm.assume(i1 %cond)
declare void @barrier()
More information about the llvm-commits
mailing list