1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc -mtriple=x86_64-pc-linux-gnu -run-pass=register-coalescer -verify-coalescing -o - %s | FileCheck %s
4 # Check for "Live range continues after dead def flag".
6 # There are 2 copies of undef, but the registers also appear to be
7 # live due to block live outs, and thus were not deleted as
8 # eliminateUndefCopy only considered the live range, and not the undef
11 # removePartialRedundancy would move the COPY undef %0 in bb.1 to
12 # bb.0. The live range of %1 would then be extended to be live out of
13 # %bb.1 for the backedge phi. This would then fail the verifier, since
14 # the dead flag was no longer valid. This was fixed by directly
15 # considering the undef flag to avoid considering this special case.
18 name: partial_redundancy_coalesce_undef_copy_live_out
19 tracksRegLiveness: true
21 ; CHECK-LABEL: name: partial_redundancy_coalesce_undef_copy_live_out
23 ; CHECK-NEXT: successors: %bb.1(0x80000000)
24 ; CHECK-NEXT: liveins: $rdi
26 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $rdi
29 ; CHECK-NEXT: successors: %bb.1(0x80000000)
31 ; CHECK-NEXT: dead [[XOR32ri:%[0-9]+]]:gr32 = XOR32ri undef [[XOR32ri]], 1, implicit-def dead $eflags
32 ; CHECK-NEXT: dead [[MOV32rr:%[0-9]+]]:gr32 = MOV32rr [[COPY]]
33 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = IMPLICIT_DEF
34 ; CHECK-NEXT: JMP_1 %bb.1
41 %1:gr32 = COPY undef %0
42 dead %1:gr32 = XOR32ri %1, 1, implicit-def dead $eflags
43 dead %2:gr32 = MOV32rr killed %0
44 %0:gr32 = COPY killed undef %1