This is an archive of the discontinued LLVM Phabricator instance.

[FastISel] Fix the crash in gc.result lowering
ClosedPublic

Authored by skatkov on Apr 2 2019, 11:47 PM.

Details

Summary

The Fast ISel has a fallback to SelectionDAGISel in case it cannot handle the instruction.
This works as follows:
Using reverse order, try to select instruction using Fast ISel, if it cannot handle instruction it fallbacks to SelectionDAGISel
for these instructions if it is a call and continue fast instruction selections.

However if unhandled instruction is not a call or statepoint related instruction it fallbacks to SelectionDAGISel for all remaining
instructions in basic block.

However gc.result instruction is missed and as a result it is possible that gc.result is processed earlier than statepoint
causing breakage invariant the gc.results should be handled after statepoint.

Test is updated because in the current form fast-isel cannot handle ret instruction (due to i1 ret type without explicit ext)
and as a result test does not check isel at all.

Diff Detail

Event Timeline

skatkov updated this revision to Diff 193438.Apr 2 2019, 11:47 PM
skatkov created this revision.
reames accepted this revision.Apr 3 2019, 8:54 AM

LGTM

This revision is now accepted and ready to land.Apr 3 2019, 8:54 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2019, 9:19 PM
Herald added a subscriber: hiraditya. · View Herald Transcript