This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Remove block insertion legalizer check
ClosedPublic

Authored by arsenm on Jun 7 2023, 2:25 PM.

Details

Summary

This report was broken. The passed null block would crash in the
remark constructor.

I have a patch which will introduce a new block, and it seems to work
fine. It doesn't require legalizing any instructions in the new block,
so it's possible those will be missed.

Diff Detail

Event Timeline

arsenm created this revision.Jun 7 2023, 2:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 2:25 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
arsenm requested review of this revision.Jun 7 2023, 2:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 2:25 PM
Herald added a subscriber: wdng. · View Herald Transcript

If we get a different number of blocks, can we instead check that the blocks have been legalized? If we get unlegalized instruction failures at selection time, it'll be confusing if the root cause is this.

arsenm added a comment.Jun 8 2023, 2:59 PM

If we get a different number of blocks, can we instead check that the blocks have been legalized? If we get unlegalized instruction failures at selection time, it'll be confusing if the root cause is this.

I basically see no value in trying to catch this with a special case fallback. First I don't actually know if the blocks will be missed, I'm just assuming. Anything attempted here is just going to be bug ridden and probably won't actually work, like this check didn't. I also don't think debugging that will be that difficult for whenever other block splitting legalizations are added

bogner accepted this revision.Jun 8 2023, 8:49 PM

I think this is reasonable. If/when we hit a case where missing a more specific check here would be helpful to understand what went wrong we can add such a thing, but given that it's all hypothetical at this point and the current check is incorrect in some cases it makes sense to drop it.

This revision is now accepted and ready to land.Jun 8 2023, 8:49 PM
aemerson accepted this revision.Jun 8 2023, 8:51 PM