This is an archive of the discontinued LLVM Phabricator instance.

[StatepointLowering] Remove distinction between call and invoke safepoints
ClosedPublic

Authored by igor-laevsky on Oct 28 2015, 2:10 PM.

Details

Summary

There is no point in having invoke safepoints handled differently than the call safepoints. All relevant decisions could be made by looking at whether or not gc.result and gc.relocate lay in a same basic block. This change will allow to lower call safepoints with relocates and results in a different basic blocks. See test case for example.

Diff Detail

Event Timeline

igor-laevsky retitled this revision from to [StatepointLowering] Remove distinction between call and invoke safepoints.
igor-laevsky updated this object.
igor-laevsky set the repository for this revision to rL LLVM.
igor-laevsky added a subscriber: llvm-commits.
reames requested changes to this revision.Oct 28 2015, 9:15 PM
reames edited edge metadata.

Looks straight forward. Two minor comments, but once those are addressed (in particular, the HasDef one), should be a quick LGTM.

lib/CodeGen/SelectionDAG/StatepointLowering.cpp
348

Shouldn't it be an assert that GCResult is available if HasDef? Actually, no. But I think the gc.result in basic block case is going to be encountering the no use of result case. Is that what you want?

369–370

It looks like this comment is a bit stale. Can you emphasis that this is handling a gc.result within the same basic block? i.e. nothing specific to calls vs invokes.

This revision now requires changes to proceed.Oct 28 2015, 9:15 PM
igor-laevsky edited edge metadata.
igor-laevsky removed rL LLVM as the repository for this revision.
igor-laevsky marked 2 inline comments as done.
igor-laevsky added inline comments.
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
348

Actually there is no difference on how to handle this case. I restructured code to make it more clear.

reames accepted this revision.Nov 3 2015, 3:18 PM
reames edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 3 2015, 3:18 PM
This revision was automatically updated to reflect the committed changes.