• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass machine-cp  -verify-machineinstrs  -o - %s | FileCheck %s
3
4--- |
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  declare i32 @foo(i32)
10...
11---
12# The first copy is dead copy which is not used.
13# CHECK-LABEL: name: copyprop1
14# CHECK: bb.0:
15# CHECK-NOT: %w20 = COPY
16name:            copyprop1
17allVRegsAllocated: true
18body:             |
19  bb.0:
20    liveins: %w0,  %w1
21    %w20 = COPY %w1
22    BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
23    RET_ReallyLR implicit %w0
24...
25---
26# The first copy is not a dead copy which is used in the second copy after the
27# call.
28# CHECK-LABEL: name: copyprop2
29# CHECK: bb.0:
30# CHECK: %w20 = COPY
31name:            copyprop2
32allVRegsAllocated: true
33body:             |
34  bb.0:
35    liveins: %w0,  %w1
36    %w20 = COPY %w1
37    BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
38    %w0 = COPY %w20
39    RET_ReallyLR implicit %w0
40...
41---
42# Both the first and second copy are dead copies which are not used.
43# CHECK-LABEL: name: copyprop3
44# CHECK: bb.0:
45# CHECK-NOT: COPY
46name:            copyprop3
47allVRegsAllocated: true
48body:             |
49  bb.0:
50    liveins: %w0,  %w1
51    %w20 = COPY %w1
52    BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
53    %w20 = COPY %w0
54    RET_ReallyLR implicit %w0
55...
56# The second copy is removed as a NOP copy, after then the first copy become
57# dead which should be removed as well.
58# CHECK-LABEL: name: copyprop4
59# CHECK: bb.0:
60# CHECK-NOT: COPY
61name:            copyprop4
62allVRegsAllocated: true
63body:             |
64  bb.0:
65    liveins: %w0,  %w1
66    %w20 = COPY %w0
67    %w0 = COPY %w20
68    BL @foo, csr_aarch64_aapcs, implicit %w0, implicit-def %w0
69    RET_ReallyLR implicit %w0
70...
71
72