[llvm] 9981f5a - [BasicAA] Add extra onevscale test for multiple dependent geps that lose the NSW flag. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 10 05:25:57 PST 2024
Author: David Green
Date: 2024-02-10T13:25:53Z
New Revision: 9981f5a72e998e5334852695164731b01bf0307b
URL: https://github.com/llvm/llvm-project/commit/9981f5a72e998e5334852695164731b01bf0307b
DIFF: https://github.com/llvm/llvm-project/commit/9981f5a72e998e5334852695164731b01bf0307b.diff
LOG: [BasicAA] Add extra onevscale test for multiple dependent geps that lose the NSW flag. NFC
Added:
Modified:
llvm/test/Analysis/BasicAA/vscale.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/BasicAA/vscale.ll b/llvm/test/Analysis/BasicAA/vscale.ll
index b2f5c66be5bb2e..895ae1e0023321 100644
--- a/llvm/test/Analysis/BasicAA/vscale.ll
+++ b/llvm/test/Analysis/BasicAA/vscale.ll
@@ -469,11 +469,29 @@ define void @vscale_negativescale(ptr %p) vscale_range(1,16) {
ret void
}
+; CHECK-LABEL: onevscale
+; CHECK-DAG: MustAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
+; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
+; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
+define void @onevscale(ptr %p) vscale_range(1,16) {
+ %v1 = call i64 @llvm.vscale.i64()
+ %vp1 = mul nsw i64 %v1, 16
+ %vp2 = mul nsw i64 %v1, 16
+ %vp3 = mul nsw i64 %v1, 17
+ %vp161 = getelementptr i8, ptr %p, i64 %vp1
+ %vp162 = getelementptr i8, ptr %p, i64 %vp2
+ %vp161b = getelementptr i8, ptr %vp161, i64 %vp3
+ load <vscale x 4 x i32>, ptr %vp161
+ load <vscale x 4 x i32>, ptr %vp162
+ load <vscale x 4 x i32>, ptr %vp161b
+ ret void
+}
+
; CHECK-LABEL: twovscales
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
-define void @twovscales(ptr %p) {
+define void @twovscales(ptr %p) vscale_range(1,16) {
%v1 = call i64 @llvm.vscale.i64()
%v2 = call i64 @llvm.vscale.i64()
%vp1 = mul nsw i64 %v1, 16
More information about the llvm-commits
mailing list