This came up in http://reviews.llvm.org/D21085; on the original testcase: Looks like BranchFolding, when merging tails, indiscriminately marks every register defined but not killed (it might really be live, but not necessarily) before the tail as live-in the new tail block. It queries the RegisterScavenger, which walks the original block forward, using kill flags; maybe it should walk the tail block backward instead? That patch adds forward liveness computation to X86FixupBWInsts (using flags, via LivePhysRegs) as a stopgap. Instead, seems like we should: - teach RegScavenger to compute liveness backwards (or replace it with something else) - fix the various users; in this case, BranchFolding - remove the X86FixupBWInsts workaround, and probably more
This looks like a duplicate of http://llvm.org/PR28295 to me.
Unfortunately the testcase of r272797 just codifies the bad live-in list in a .mir test so I cannot use it to whether the revision is not necessary any longer after http://reviews.llvm.org/D22027 any tips in reproducing the problem? (I am on a question to kill the kill flags which means we cannot use forward liveness simulation any longer).
I proposed http://reviews.llvm.org/D22083 which in my tests produces identical code for the llvm test-suite including all externals.
I think Kevin said this was seen on SPEC, so no difference in the test-suite is perfect.
the test-suite optionally allows to plug in Spec95, spec2000 and spec2006 in the Externals directory which I did.