2 # RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass machine-cp -verify-machineinstrs -o - %s | FileCheck %s
5 define i32 @copyprop1(i32 %a, i32 %b) { ret i32 %a }
6 define i32 @copyprop2(i32 %a, i32 %b) { ret i32 %a }
7 define i32 @copyprop3(i32 %a, i32 %b) { ret i32 %a }
8 define i32 @copyprop4(i32 %a, i32 %b) { ret i32 %a }
9 define i32 @copyprop5(i32 %a, i32 %b) { ret i32 %a }
10 define i32 @copyprop6(i32 %a, i32 %b) { ret i32 %a }
14 # The first copy is dead copy which is not used.
15 # CHECK-LABEL: name: copyprop1
17 # CHECK-NOT: $w20 = COPY
23 BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
24 RET_ReallyLR implicit $w0
27 # The first copy is not a dead copy which is used in the second copy after the
29 # CHECK-LABEL: name: copyprop2
37 BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
39 RET_ReallyLR implicit $w0
42 # Both the first and second copy are dead copies which are not used.
43 # CHECK-LABEL: name: copyprop3
51 BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
53 RET_ReallyLR implicit $w0
55 # The second copy is removed as a NOP copy, after then the first copy become
56 # dead which should be removed as well.
57 # CHECK-LABEL: name: copyprop4
66 BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
67 RET_ReallyLR implicit $w0
70 # Don't try to erase any COPY which overlaps itself.
71 # CHECK-LABEL: name: copyprop5
73 # CHECK: COPY killed $q26_q27_q28_q29
74 # CHECK: COPY killed $q28_q29_q30_q31
78 liveins: $q26_q27_q28_q29
79 $q28_q29_q30_q31 = COPY killed $q26_q27_q28_q29
80 $q26_q27_q28_q29 = COPY killed $q28_q29_q30_q31
81 BL @foo, csr_aarch64_aapcs, implicit killed $q26_q27_q28_q29
85 # Don't try to analyze any COPY which overlaps itself.
86 # CHECK-LABEL: name: copyprop6
88 # CHECK: COPY killed $q26_q27_q28_q29
89 # CHECK: $q30 = COPY $q28
93 liveins: $q26_q27_q28_q29
94 $q28_q29_q30_q31 = COPY killed $q26_q27_q28_q29
96 BL @foo, csr_aarch64_aapcs, implicit killed $q28_q29_q30_q31