Page MenuHomePhabricator

Fix Sub-register Rewriting in Aggressive Anti-Dependence Breaker

Authored by tjablin on Mar 24 2016, 8:43 AM.



Previously, HandleLastUse would delete RegRef information for sub-registers if they were dead even if their corresponding super-register were still live. If the super-register were later renamed, then the definitions of the sub-register would not be updated appropriately. This patch alters the behavior so that RegInfo information for sub-registers is only deleted when the sub-register and super-register are both dead. This resolves PR26775. This is the mirror image of Hal's r227311 commit.

Diff Detail

Event Timeline

tjablin updated this revision to Diff 51557.Mar 24 2016, 8:43 AM
tjablin retitled this revision from to Fix Sub-register Rewriting in Aggressive Anti-Dependence Breaker.
tjablin updated this object.
tjablin added reviewers: hfinkel, kbarton, uweigand, nemanjai.
tjablin added a subscriber: llvm-commits.
hfinkel accepted this revision.Mar 25 2016, 8:07 AM
hfinkel edited edge metadata.

LGTM, thanks! -- Nice efficient patch :-) [I realize that I'm ruining that somewhat by asking for a comment ;) ]

315 ↗(On Diff #51557)

Please add a comment here explaining why we do this only if the superregister was not live. Maybe something like this:

// Note that we only do this if the superregister was not live because otherwise, regardless whether we have an explicit use of the subregister, the subregister's contents are needed for the uses of the superregister.

This revision is now accepted and ready to land.Mar 25 2016, 8:07 AM
tjablin updated this revision to Diff 52312.Mar 31 2016, 5:13 PM
tjablin edited edge metadata.

Add comments per Hal's suggestion.

cycheng closed this revision.Mar 31 2016, 7:12 PM
cycheng added a subscriber: cycheng.

Committed r265097 (On behalf of Tom)

Can this patch please be considered for inclusion in LLVM 3.8.1?

This is also a fix for 25503 which is important for mesa/llvmpipe on
ppc64le. I know some IBMers would like this to be fixed for 3.8.1.