1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
4 define i8 @vscale_trunc_i32toi8() vscale_range(1, 128) {
5 ; CHECK-LABEL: @vscale_trunc_i32toi8(
7 ; CHECK-NEXT: [[TMP0:%.*]] = call i8 @llvm.vscale.i8()
8 ; CHECK-NEXT: ret i8 [[TMP0]]
11 %0 = call i32 @llvm.vscale.i32()
12 %1 = trunc i32 %0 to i8
17 define i8 @vscale_trunc_i32toi8_poison() vscale_range(1, 256) {
18 ; CHECK-LABEL: @vscale_trunc_i32toi8_poison(
20 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32()
21 ; CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[TMP0]] to i8
22 ; CHECK-NEXT: ret i8 [[TMP1]]
25 %0 = call i32 @llvm.vscale.i32()
26 %1 = trunc i32 %0 to i8
30 define i8 @vscale_trunc_i32toi8_noAttr() {
31 ; CHECK-LABEL: @vscale_trunc_i32toi8_noAttr(
33 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32()
34 ; CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[TMP0]] to i8
35 ; CHECK-NEXT: ret i8 [[TMP1]]
38 %0 = call i32 @llvm.vscale.i32()
39 %1 = trunc i32 %0 to i8
43 declare i32 @llvm.vscale.i32()