1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -O3 -mtriple=riscv64 -riscv-enable-copy-propagation=false | FileCheck %s --check-prefix=NOPROP
3 ; RUN: llc < %s -O3 -mtriple=riscv64 -riscv-enable-copy-propagation=true | FileCheck %s --check-prefix=PROP
5 define void @copyprop_after_mbp(i32 %v, i32* %a, i32* %b, i32* %c, i32* %d) {
6 ; NOPROP-LABEL: copyprop_after_mbp:
8 ; NOPROP-NEXT: sext.w a0, a0
9 ; NOPROP-NEXT: li a5, 10
10 ; NOPROP-NEXT: bne a0, a5, .LBB0_2
11 ; NOPROP-NEXT: # %bb.1: # %bb.0
12 ; NOPROP-NEXT: li a0, 15
13 ; NOPROP-NEXT: sw a0, 0(a2)
14 ; NOPROP-NEXT: li a0, 1
15 ; NOPROP-NEXT: sw a0, 0(a1)
16 ; NOPROP-NEXT: li a0, 12
17 ; NOPROP-NEXT: sw a0, 0(a4)
19 ; NOPROP-NEXT: .LBB0_2: # %bb.1
20 ; NOPROP-NEXT: li a0, 0
21 ; NOPROP-NEXT: li a2, 25
22 ; NOPROP-NEXT: sw a2, 0(a3)
23 ; NOPROP-NEXT: sw a0, 0(a1)
24 ; NOPROP-NEXT: li a0, 12
25 ; NOPROP-NEXT: sw a0, 0(a4)
28 ; PROP-LABEL: copyprop_after_mbp:
30 ; PROP-NEXT: sext.w a0, a0
31 ; PROP-NEXT: li a5, 10
32 ; PROP-NEXT: bne a0, a5, .LBB0_2
33 ; PROP-NEXT: # %bb.1: # %bb.0
34 ; PROP-NEXT: li a0, 15
35 ; PROP-NEXT: sw a0, 0(a2)
37 ; PROP-NEXT: sw a0, 0(a1)
38 ; PROP-NEXT: li a0, 12
39 ; PROP-NEXT: sw a0, 0(a4)
41 ; PROP-NEXT: .LBB0_2: # %bb.1
42 ; PROP-NEXT: li a2, 25
43 ; PROP-NEXT: sw a2, 0(a3)
44 ; PROP-NEXT: sw zero, 0(a1)
45 ; PROP-NEXT: li a0, 12
46 ; PROP-NEXT: sw a0, 0(a4)
48 %1 = icmp eq i32 %v, 10
49 br i1 %1, label %bb.0, label %bb.1
52 store i32 15, i32* %b, align 4
56 store i32 25, i32* %c, align 4
60 %2 = phi i32 [ 1, %bb.0 ], [ 0, %bb.1 ]
61 store i32 %2, i32* %a, align 4
62 store i32 12, i32* %d, align 4