This is an archive of the discontinued LLVM Phabricator instance.

[CodegenPrepare] Do not rematerialize gc.relocates across different basic blocks
ClosedPublic

Authored by igor-laevsky on Nov 2 2015, 1:20 PM.

Details

Summary

In a case when we have an if condition and base relocate is inserted in a different branch than derived relocate we should check that base dominates derived relocation. Otherwise rematerialized object will be inserted in one branch while all the uses of it will be located in another.

However it seems that introducing dominator tree lookup for such cases is too expensive. I think it is better to simply abort transformation if there is a suspicion that base relocation doesn't dominate derived relocation.

Diff Detail

Repository
rL LLVM

Event Timeline

igor-laevsky retitled this revision from to [CodegenPrepare] Do not rematerialize gc.relocates across different basic blocks.
igor-laevsky updated this object.
igor-laevsky added reviewers: sanjoy, artagnon.
sanjoy accepted this revision.Nov 2 2015, 6:52 PM
sanjoy edited edge metadata.
This revision is now accepted and ready to land.Nov 2 2015, 6:52 PM
artagnon accepted this revision.Nov 3 2015, 8:52 AM
artagnon edited edge metadata.

Pretty silly mistake on my part. Thanks for the clear tests.

This revision was automatically updated to reflect the committed changes.