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.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
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 | ||
---|---|---|
349 | 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? | |
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. |
lib/CodeGen/SelectionDAG/StatepointLowering.cpp | ||
---|---|---|
349 | Actually there is no difference on how to handle this case. I restructured code to make it more clear. |
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?