1 # RUN: llc -mtriple=x86_64-unknown-linux-gnu -run-pass=register-coalescer -o - %s
3 # An implicit-def will be added to SUBREG_TO_REG during coalescing
5 name: rematerialize_subreg_to_reg_added_impdef_0
6 tracksRegLiveness: true
9 successors: %bb.1(0x2aaaaaab), %bb.2(0x55555555)
12 %0:gr32 = MOV32r0 implicit-def dead $eflags
13 %1:gr8 = COPY %0.sub_8bit
14 %2:gr64 = SUBREG_TO_REG 0, killed %0, %subreg.sub_32bit
15 JCC_1 %bb.2, 5, implicit killed undef $eflags
19 %5:gr8 = COPY killed undef %1
23 %6:gr64 = IMPLICIT_DEF
24 %2:gr64 = COPY killed %6
28 successors: %bb.6(0x30000000), %bb.7(0x50000000)
30 TEST8rr killed undef %5, %5, implicit-def $eflags
31 JCC_1 %bb.7, 5, implicit killed undef $eflags
35 RET 0, killed undef $al
38 MOV64mr undef $noreg, 1, undef $noreg, 0, undef $noreg, killed %2 :: (store (s64))
39 RET 0, killed undef $al
44 # Reduced version of previous with the SUBREG_TO_REG already folded
47 # The mov32r0 defines a subregister and has an implicit-def of the
48 # super register. After coalescing, the full register implicit def of
49 # %2 becomes a different subregister def.
52 name: rematerialize_subreg_to_reg_coalesces_to_subreg_impdef
53 tracksRegLiveness: true
56 successors: %bb.1(0x2aaaaaab), %bb.2(0x55555555)
59 undef %2.sub_32bit:gr64_with_sub_8bit = MOV32r0 implicit-def dead $eflags, implicit-def %2
60 %1:gr8 = COPY %2.sub_8bit
61 JCC_1 %bb.2, 5, implicit killed undef $eflags
64 successors: %bb.3(0x80000000)
67 %4:gr8 = COPY undef %1
71 successors: %bb.3(0x80000000)
73 %5:gr64 = IMPLICIT_DEF
74 %2:gr64_with_sub_8bit = COPY %5
78 successors: %bb.4(0x30000000), %bb.5(0x50000000)
80 TEST8rr undef %4, %4, implicit-def $eflags
81 JCC_1 %bb.5, 5, implicit killed undef $eflags
85 RET 0, killed undef $al
88 MOV64mr undef $noreg, 1, undef $noreg, 0, undef $noreg, %2 :: (store (s64))
89 RET 0, killed undef $al