1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
llvm-mirror/test/CodeGen/X86/unreachable-mbb-undef-phi.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

39 lines
964 B
YAML

# RUN: llc -march=x86-64 %s -o - -run-pass=processimpdefs -run-pass=unreachable-mbb-elimination | FileCheck %s
---
name: f
tracksRegLiveness: true
registers:
- { id: 0, class: gr32, preferred-register: '' }
- { id: 1, class: gr32, preferred-register: '' }
- { id: 2, class: gr32, preferred-register: '' }
body: |
bb.0:
%0 = IMPLICIT_DEF
JMP_1 %bb.1
bb.1:
%1 = PHI %0, %bb.0, %2, %bb.2
%2 = ADD32ri8 killed %1, 1, implicit-def $eflags
JMP_1 %bb.3
bb.2:
JMP_1 %bb.1
bb.3:
...
# bb2 above is dead and should be removed and the PHI should be replaced with a
# COPY from an undef value since the bb0 value in the PHI is undef.
# CHECK: bb.0:
# CHECK: successors: %bb.1
# CHECK: JMP_1 %bb.1
# CHECK: bb.1:
# CHECK: successors: %bb.2
# CHECK: [[TMP1:%[0-9]+]]:gr32 = COPY undef %{{[0-9]+}}
# CHECK: %{{[0-9]+}}:gr32 = ADD32ri8 killed [[TMP1]], 1
# CHECK: JMP_1 %bb.2
# CHECK: bb.2: