This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Fix rematerialization of bitcast of bitcast.
ClosedPublic

Authored by mjacob on Dec 27 2015, 5:58 AM.

Details

Summary

Previously, only the outer (last) bitcast was rematerialized, resulting in a
use of the unrelocated inner (first) bitcast after the statepoint. See the
test case for an example.

Diff Detail

Event Timeline

mjacob updated this revision to Diff 43662.Dec 27 2015, 5:58 AM
mjacob retitled this revision from to [RS4GC] Fix rematerialization of bitcast of bitcast..
mjacob updated this object.
mjacob added reviewers: reames, igor-laevsky.
mjacob added subscribers: llvm-commits, alex.
reames edited edge metadata.Dec 27 2015, 11:11 AM
reames added a subscriber: reames.

I think you need to leave in:

if (!CI->isNoopCast(CI->getModule()->getDataLayout()))

  • return false;

This is needed to catch things like addrspacecast.

Other than that, LGTM.

igor-laevsky edited edge metadata.Dec 28 2015, 4:37 AM

Looks good for me too. I agree with Philip's comments - better leave isNoopCast check.

mjacob updated this revision to Diff 43699.Dec 28 2015, 12:07 PM
mjacob edited edge metadata.

Only rematerialize noop casts, add test for this.

This revision was automatically updated to reflect the committed changes.