1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test/CodeGen/AArch64/machine-dead-copy.mir
Puyan Lotfi d4c615be8c Followup on Proposal to move MIR physical register namespace to '$' sigil.
Discussed here:

http://lists.llvm.org/pipermail/llvm-dev/2018-January/120320.html

In preparation for adding support for named vregs we are changing the sigil for
physical registers in MIR to '$' from '%'. This will prevent name clashes of
named physical register with named vregs.

llvm-svn: 323922
2018-01-31 22:04:26 +00:00

68 lines
1.7 KiB
YAML

# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass machine-cp -verify-machineinstrs -o - %s | FileCheck %s
--- |
define i32 @copyprop1(i32 %a, i32 %b) { ret i32 %a }
define i32 @copyprop2(i32 %a, i32 %b) { ret i32 %a }
define i32 @copyprop3(i32 %a, i32 %b) { ret i32 %a }
define i32 @copyprop4(i32 %a, i32 %b) { ret i32 %a }
declare i32 @foo(i32)
...
---
# The first copy is dead copy which is not used.
# CHECK-LABEL: name: copyprop1
# CHECK: bb.0:
# CHECK-NOT: $w20 = COPY
name: copyprop1
body: |
bb.0:
liveins: $w0, $w1
$w20 = COPY $w1
BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
RET_ReallyLR implicit $w0
...
---
# The first copy is not a dead copy which is used in the second copy after the
# call.
# CHECK-LABEL: name: copyprop2
# CHECK: bb.0:
# CHECK: $w20 = COPY
name: copyprop2
body: |
bb.0:
liveins: $w0, $w1
$w20 = COPY $w1
BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
$w0 = COPY $w20
RET_ReallyLR implicit $w0
...
---
# Both the first and second copy are dead copies which are not used.
# CHECK-LABEL: name: copyprop3
# CHECK: bb.0:
# CHECK-NOT: COPY
name: copyprop3
body: |
bb.0:
liveins: $w0, $w1
$w20 = COPY $w1
BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
$w20 = COPY $w0
RET_ReallyLR implicit $w0
...
# The second copy is removed as a NOP copy, after then the first copy become
# dead which should be removed as well.
# CHECK-LABEL: name: copyprop4
# CHECK: bb.0:
# CHECK-NOT: COPY
name: copyprop4
body: |
bb.0:
liveins: $w0, $w1
$w20 = COPY $w0
$w0 = COPY $w20
BL @foo, csr_aarch64_aapcs, implicit $w0, implicit-def $w0
RET_ReallyLR implicit $w0
...