Skip to content

Commit

Permalink
[BasicAA] Add extra onevscale test for multiple dependent geps that l…
Browse files Browse the repository at this point in the history
…ose the NSW flag. NFC
  • Loading branch information
davemgreen committed Feb 10, 2024
1 parent 7d9540e commit 9981f5a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion llvm/test/Analysis/BasicAA/vscale.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9981f5a

Please sign in to comment.