This is an archive of the discontinued LLVM Phabricator instance.

TailDuplicator: Remove live-in updating logic
ClosedPublic

Authored by MatzeB on Jul 5 2016, 8:58 PM.

Details

Summary

This logic was introduced in r157663 and does not make any sense to me.
The motivating example in rdar://11538365 looks like this:

This is the tail:
BB#16: derived from LLVM BB %if.end68

Live Ins: %R0 %R4 %R5
Predecessors according to CFG: BB#15 BB#5
    tBLXi pred:14, pred:%noreg, <ga:@CFRelease>, %R0<kill>, <regmask>, %LR<imp-def,dead>, %SP<imp-use>, %SP<imp-def>
    t2B <BB#20>, pred:14, pred:%noreg
Successors according to CFG: BB#20

This is the predBB:
BB#5:

Live Ins: %R5
Predecessors according to CFG: BB#4
    %R4<def> = t2MOVi 0, pred:14, pred:%noreg, opt:%noreg
    t2B <BB#16>, pred:14, pred:%noreg
Successors according to CFG: BB#16

However this is invalid machine code to begin with, if %R0 is live-in to
BB#16 then it must be live-in to BB#5 as well if BB#5 does not define
it. We should not need logic to retroactively fix broken machine code
and in fact the example from r157663 passes cleanly today with the updating
code removed and I do not see any (newly) failing tests with the machine
verifier enabled.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 62819.Jul 5 2016, 8:58 PM
MatzeB retitled this revision from to TailDuplicator: Remove live-in updating logic.
MatzeB updated this object.
MatzeB added reviewers: qcolombet, atrick.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
qcolombet accepted this revision.Jul 6 2016, 11:26 AM
qcolombet edited edge metadata.

Hi Matthias,

Yeah, that looks awful, thanks for the cleanup!

Cheers,
-Quentin

This revision is now accepted and ready to land.Jul 6 2016, 11:26 AM
This revision was automatically updated to reflect the committed changes.