1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 declare i32 @llvm.riscv.vsetvli.i32(i32, i32, i32)
5 declare i64 @llvm.riscv.vsetvli.i64(i64, i64, i64)
7 define i32 @vsetvli_i32() nounwind {
8 ; CHECK-LABEL: @vsetvli_i32(
10 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @llvm.riscv.vsetvli.i32(i32 1, i32 1, i32 1)
11 ; CHECK-NEXT: ret i32 [[TMP0]]
14 %0 = call i32 @llvm.riscv.vsetvli.i32(i32 1, i32 1, i32 1)
15 %1 = and i32 %0, 2147483647
19 define i64 @vsetvli_sext_i64() nounwind {
20 ; CHECK-LABEL: @vsetvli_sext_i64(
22 ; CHECK-NEXT: [[TMP0:%.*]] = call i64 @llvm.riscv.vsetvli.i64(i64 1, i64 1, i64 1)
23 ; CHECK-NEXT: ret i64 [[TMP0]]
26 %0 = call i64 @llvm.riscv.vsetvli.i64(i64 1, i64 1, i64 1)
27 %1 = trunc i64 %0 to i32
28 %2 = sext i32 %1 to i64
32 define i64 @vsetvli_zext_i64() nounwind {
33 ; CHECK-LABEL: @vsetvli_zext_i64(
35 ; CHECK-NEXT: [[TMP0:%.*]] = call i64 @llvm.riscv.vsetvli.i64(i64 1, i64 1, i64 1)
36 ; CHECK-NEXT: ret i64 [[TMP0]]
39 %0 = call i64 @llvm.riscv.vsetvli.i64(i64 1, i64 1, i64 1)
40 %1 = trunc i64 %0 to i32
41 %2 = zext i32 %1 to i64