1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=riscv32 -global-isel -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=RV32
5 define i16 @constant_fold_barrier_i16(i16 %x, i16 %y) {
6 ; RV32-LABEL: constant_fold_barrier_i16:
7 ; RV32: # %bb.0: # %entry
9 ; RV32-NEXT: slli a1, a1, 11
10 ; RV32-NEXT: and a0, a0, a1
11 ; RV32-NEXT: addi a1, a1, 289
12 ; RV32-NEXT: or a0, a0, a1
15 %and = and i16 %x, 2048
16 %or = or i16 %and, 2337
20 define void @constant_fold_barrier_i128(ptr %p) {
21 ; RV32-LABEL: constant_fold_barrier_i128:
22 ; RV32: # %bb.0: # %entry
24 ; RV32-NEXT: slli a1, a1, 11
25 ; RV32-NEXT: lw a2, 0(a0)
26 ; RV32-NEXT: lw a3, 4(a0)
27 ; RV32-NEXT: lw a4, 8(a0)
28 ; RV32-NEXT: lw a5, 12(a0)
29 ; RV32-NEXT: and a2, a2, a1
30 ; RV32-NEXT: and a3, a3, zero
31 ; RV32-NEXT: and a4, a4, zero
32 ; RV32-NEXT: and a5, a5, zero
33 ; RV32-NEXT: add a2, a2, a1
34 ; RV32-NEXT: sltu a1, a2, a1
35 ; RV32-NEXT: add a6, a3, zero
36 ; RV32-NEXT: sltu a3, a6, a3
37 ; RV32-NEXT: add a6, a6, a1
38 ; RV32-NEXT: seqz a7, a6
39 ; RV32-NEXT: and a1, a7, a1
40 ; RV32-NEXT: or a1, a3, a1
41 ; RV32-NEXT: add a3, a4, zero
42 ; RV32-NEXT: sltu a4, a3, a4
43 ; RV32-NEXT: add a3, a3, a1
44 ; RV32-NEXT: seqz a7, a3
45 ; RV32-NEXT: and a1, a7, a1
46 ; RV32-NEXT: or a1, a4, a1
47 ; RV32-NEXT: add a5, a5, zero
48 ; RV32-NEXT: add a1, a5, a1
49 ; RV32-NEXT: sw a2, 0(a0)
50 ; RV32-NEXT: sw a6, 4(a0)
51 ; RV32-NEXT: sw a3, 8(a0)
52 ; RV32-NEXT: sw a1, 12(a0)
55 %x = load i128, ptr %p
56 %and = and i128 %x, 2048
57 %add = add i128 %and, 2048
58 store i128 %add, ptr %p