Skip to content

Commit 4b2f7f8

Browse files
committed
[BasicAA] Add extra onevscale test for multiple dependent geps that lose the NSW flag. NFC
1 parent 3e33b6f commit 4b2f7f8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

llvm/test/Analysis/BasicAA/vscale.ll

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,29 @@ define void @vscale_v1v2types(ptr %p) {
458458
ret void
459459
}
460460

461+
; CHECK-LABEL: onevscale
462+
; CHECK-DAG: MustAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
463+
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
464+
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
465+
define void @onevscale(ptr %p) vscale_range(1,16) {
466+
%v1 = call i64 @llvm.vscale.i64()
467+
%vp1 = mul nsw i64 %v1, 16
468+
%vp2 = mul nsw i64 %v1, 16
469+
%vp3 = mul nsw i64 %v1, 17
470+
%vp161 = getelementptr i8, ptr %p, i64 %vp1
471+
%vp162 = getelementptr i8, ptr %p, i64 %vp2
472+
%vp161b = getelementptr i8, ptr %vp161, i64 %vp3
473+
load <vscale x 4 x i32>, ptr %vp161
474+
load <vscale x 4 x i32>, ptr %vp162
475+
load <vscale x 4 x i32>, ptr %vp161b
476+
ret void
477+
}
478+
461479
; CHECK-LABEL: twovscales
462480
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
463481
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
464482
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
465-
define void @twovscales(ptr %p) {
483+
define void @twovscales(ptr %p) vscale_range(1,16) {
466484
%v1 = call i64 @llvm.vscale.i64()
467485
%v2 = call i64 @llvm.vscale.i64()
468486
%vp1 = mul nsw i64 %v1, 16

0 commit comments

Comments
 (0)