# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
# RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass=register-coalescer -o - %s | FileCheck %s
---
name: rematerialize_subreg_to_reg_added_impdef_1
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: rematerialize_subreg_to_reg_added_impdef_1
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x2aaaaaab), %bb.2(0x55555555)
; CHECK-NEXT: liveins: $edi
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: undef [[MOV32r0_:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags
; CHECK-NEXT: JCC_1 %bb.2, 5, implicit killed undef $eflags
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: successors: %bb.3(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: JMP_1 %bb.3
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: successors: %bb.3(0x80000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[MOV32r0_:%[0-9]+]]:gr64_with_sub_8bit = IMPLICIT_DEF
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3:
; CHECK-NEXT: successors: %bb.4(0x30000000), %bb.5(0x50000000)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: JCC_1 %bb.5, 5, implicit killed undef $eflags
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4:
; CHECK-NEXT: dead $eax = MOV32r0 implicit-def dead $eflags, implicit-def $al
; CHECK-NEXT: RET 0, killed undef $al
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5:
; CHECK-NEXT: MOV64mr undef $noreg, 1, undef $noreg, 0, undef $noreg, [[MOV32r0_]] :: (store (s64))
; CHECK-NEXT: RET 0, killed undef $al
bb.0:
successors: %bb.1(0x2aaaaaab), %bb.2(0x55555555)
liveins: $edi
%0:gr32 = MOV32r0 implicit-def dead $eflags
%1:gr8 = COPY %0.sub_8bit
%2:gr64 = SUBREG_TO_REG 0, killed %0, %subreg.sub_32bit
JCC_1 %bb.2, 5, implicit killed undef $eflags
bb.1:
successors: %bb.3(0x80000000)
JMP_1 %bb.3
bb.2:
successors: %bb.3(0x80000000)
%5:gr64 = IMPLICIT_DEF
%2:gr64 = COPY killed %5
bb.3:
successors: %bb.4(0x30000000), %bb.5(0x50000000)
JCC_1 %bb.5, 5, implicit killed undef $eflags
bb.4:
$al = COPY killed %1
RET 0, killed undef $al
bb.5:
MOV64mr undef $noreg, 1, undef $noreg, 0, undef $noreg, killed %2 :: (store (s64))
RET 0, killed undef $al
...