1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
8 define i32 @vscale_SExt_i8toi32() vscale_range(0, 127) {
9 ; CHECK-LABEL: @vscale_SExt_i8toi32(
11 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32()
12 ; CHECK-NEXT: ret i32 [[TMP0]]
15 %0 = call i8 @llvm.vscale.i8()
16 %1 = sext i8 %0 to i32
20 define i32 @vscale_SExt_i8toi32_poison() vscale_range(0, 128) {
21 ; CHECK-LABEL: @vscale_SExt_i8toi32_poison(
23 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
24 ; CHECK-NEXT: [[TMP1:%.*]] = sext i8 [[TMP0]] to i32
25 ; CHECK-NEXT: ret i32 [[TMP1]]
28 %0 = call i8 @llvm.vscale.i8()
29 %1 = sext i8 %0 to i32
37 define i32 @vscale_ZExt_i8toi32() vscale_range(0, 128) {
38 ; CHECK-LABEL: @vscale_ZExt_i8toi32(
40 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32()
41 ; CHECK-NEXT: ret i32 [[TMP0]]
44 %0 = call i8 @llvm.vscale.i8()
45 %1 = zext i8 %0 to i32
49 define i32 @vscale_ZExt_i8toi32_poison() vscale_range(0, 256) {
50 ; CHECK-LABEL: @vscale_ZExt_i8toi32_poison(
52 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
53 ; CHECK-NEXT: [[TMP1:%.*]] = zext i8 [[TMP0]] to i32
54 ; CHECK-NEXT: ret i32 [[TMP1]]
57 %0 = call i8 @llvm.vscale.i8()
58 %1 = zext i8 %0 to i32
63 ; No vscale_range attribute
66 define i32 @vscale_ZExt_i8toi32_unknown() {
67 ; CHECK-LABEL: @vscale_ZExt_i8toi32_unknown(
69 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
70 ; CHECK-NEXT: [[TMP1:%.*]] = zext i8 [[TMP0]] to i32
71 ; CHECK-NEXT: ret i32 [[TMP1]]
74 %0 = call i8 @llvm.vscale.i8()
75 %1 = zext i8 %0 to i32
80 ; unbounded vscale_range maximum (0)
83 define i32 @vscale_SExt_i8toi32_unbounded() vscale_range(0, 0) {
84 ; CHECK-LABEL: @vscale_SExt_i8toi32_unbounded(
86 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
87 ; CHECK-NEXT: [[TMP1:%.*]] = sext i8 [[TMP0]] to i32
88 ; CHECK-NEXT: ret i32 [[TMP1]]
91 %0 = call i8 @llvm.vscale.i8()
92 %1 = sext i8 %0 to i32
96 define i32 @vscale_ZExt_i8toi32_unbounded() vscale_range(0, 0) {
97 ; CHECK-LABEL: @vscale_ZExt_i8toi32_unbounded(
99 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
100 ; CHECK-NEXT: [[TMP1:%.*]] = zext i8 [[TMP0]] to i32
101 ; CHECK-NEXT: ret i32 [[TMP1]]
104 %0 = call i8 @llvm.vscale.i8()
105 %1 = zext i8 %0 to i32
109 declare i8 @llvm.vscale.i8()