Skip to content

Commit 9981f5a

Browse files
committed
[BasicAA] Add extra onevscale test for multiple dependent geps that lose the NSW flag. NFC
1 parent 7d9540e commit 9981f5a

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
@@ -469,11 +469,29 @@ define void @vscale_negativescale(ptr %p) vscale_range(1,16) {
469469
ret void
470470
}
471471

472+
; CHECK-LABEL: onevscale
473+
; CHECK-DAG: MustAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
474+
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
475+
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
476+
define void @onevscale(ptr %p) vscale_range(1,16) {
477+
%v1 = call i64 @llvm.vscale.i64()
478+
%vp1 = mul nsw i64 %v1, 16
479+
%vp2 = mul nsw i64 %v1, 16
480+
%vp3 = mul nsw i64 %v1, 17
481+
%vp161 = getelementptr i8, ptr %p, i64 %vp1
482+
%vp162 = getelementptr i8, ptr %p, i64 %vp2
483+
%vp161b = getelementptr i8, ptr %vp161, i64 %vp3
484+
load <vscale x 4 x i32>, ptr %vp161
485+
load <vscale x 4 x i32>, ptr %vp162
486+
load <vscale x 4 x i32>, ptr %vp161b
487+
ret void
488+
}
489+
472490
; CHECK-LABEL: twovscales
473491
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp162
474492
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161, <vscale x 4 x i32>* %vp161b
475493
; CHECK-DAG: MayAlias: <vscale x 4 x i32>* %vp161b, <vscale x 4 x i32>* %vp162
476-
define void @twovscales(ptr %p) {
494+
define void @twovscales(ptr %p) vscale_range(1,16) {
477495
%v1 = call i64 @llvm.vscale.i64()
478496
%v2 = call i64 @llvm.vscale.i64()
479497
%vp1 = mul nsw i64 %v1, 16

0 commit comments

Comments
 (0)