With r274952 and rXXXX in place there are no cases left where a forward
liveness analysis yields different results to a backward one. So we can
remove the forward stepping logic.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
What have you done to prove to yourself that this code is no longer necessary?
If unnecessary, then both before and after the change, the code for 401.bzip2 from spec20006 ought to
be identical.
One way of showing that this code is no longer necessary would be to use the new code and simply
add an assertion after line 389 that NewMI was always nullptr. Once that code had been in for a while,
you could make the extra forward pass be a debug-only code in an attempt to catch other regressions
that might occur in live-reg tracking.
Also, I kind of liked the better abstraction of tryReplaceInstr. I thought that was an improvement, and is another
reason I don't think just a simple revert is the ideal fix.
I can certainly explain to you what caused these ridiculous live-in lists. Basically looking at a set of register units and then adding all registers with that unit leads to al, ax, eax, rax getting added even if just al is live (additonally the code would unnecessarily add all the pristine registers). So I am pretty sure these wrong live-in lists causes the way too conversative lifeness when walking the block from the end.
One way of showing that this code is no longer necessary would be to use the new code and simply
add an assertion after line 389 that NewMI was always nullptr. Once that code had been in for a while,
you could make the extra forward pass be a debug-only code in an attempt to catch other regressions
that might occur in live-reg tracking.Also, I kind of liked the better abstraction of tryReplaceInstr. I thought that was an improvement, and is another
reason I don't think just a simple revert is the ideal fix.
Fair enough do a round of testing with the full llvm test-suite including externals (spec95,spec2k,spec2k6) to see that there is really no change. Keeping the tryReplaceInstr() function around is fine, this review is mainly here to get the discussion started :)
I added an assert that the forward liveness analysis would not find additional transformation opportunities. As expected most of the problems were fixed with http://reviews.llvm.org/D22027 in place. However it turned out that there existed another subtle case where forward and backward analysis could disagree, I fixed that one in r274952.