xref: /llvm-project/llvm/test/Transforms/InstSimplify/fold-vscale.ll (revision b280ee1dd7e9b36ae7aaa3953556e4b7a7f31a29)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
3
4define i64 @vscale_i64_range_none() #0 {
5; CHECK-LABEL: @vscale_i64_range_none(
6; CHECK-NEXT:    [[OUT:%.*]] = call i64 @llvm.vscale.i64()
7; CHECK-NEXT:    ret i64 [[OUT]]
8;
9  %out = call i64 @llvm.vscale.i64()
10  ret i64 %out
11}
12
13define i64 @vscale_i64_range_1_1() #1 {
14; CHECK-LABEL: @vscale_i64_range_1_1(
15; CHECK-NEXT:    ret i64 1
16;
17  %out = call i64 @llvm.vscale.i64()
18  ret i64 %out
19}
20
21define i32 @vscale_i32_range_2_2() #2 {
22; CHECK-LABEL: @vscale_i32_range_2_2(
23; CHECK-NEXT:    ret i32 2
24;
25  %out = call i32 @llvm.vscale.i32()
26  ret i32 %out
27}
28
29define i64 @vscale_i64_range_2_4() #3 {
30; CHECK-LABEL: @vscale_i64_range_2_4(
31; CHECK-NEXT:    [[OUT:%.*]] = call i64 @llvm.vscale.i64()
32; CHECK-NEXT:    ret i64 [[OUT]]
33;
34  %out = call i64 @llvm.vscale.i64()
35  ret i64 %out
36}
37
38; Function Attrs: nofree nosync nounwind readnone willreturn
39declare i64 @llvm.vscale.i64() #0
40
41; Function Attrs: nofree nosync nounwind readnone willreturn
42declare i32 @llvm.vscale.i32() #0
43
44attributes #0 = { nofree nosync nounwind readnone willreturn }
45attributes #1 = { mustprogress nofree nosync nounwind uwtable vscale_range(1,1) }
46attributes #2 = { mustprogress nofree nosync nounwind uwtable vscale_range(2,2) }
47attributes #3 = { mustprogress nofree nosync nounwind uwtable vscale_range(2,4) }
48
49
50