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 }
12 # The first copy is dead copy which is not used.
13 # CHECK-LABEL: name: copyprop1
15 # CHECK-NOT: %w20 = COPY
21 BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
22 RET_ReallyLR implicit %w0
25 # The first copy is not a dead copy which is used in the second copy after the
27 # CHECK-LABEL: name: copyprop2
35 BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
37 RET_ReallyLR implicit %w0
40 # Both the first and second copy are dead copies which are not used.
41 # CHECK-LABEL: name: copyprop3
49 BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
51 RET_ReallyLR implicit %w0
53 # The second copy is removed as a NOP copy, after then the first copy become
54 # dead which should be removed as well.
55 # CHECK-LABEL: name: copyprop4
64 BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
65 RET_ReallyLR implicit %w0