This is an archive of the discontinued LLVM Phabricator instance.

[LoopSimplifyCFG] Prevent use-def dominance breach by handling dead exits. PR56243
ClosedPublic

Authored by mkazantsev on Jul 18 2022, 12:37 AM.

Details

Summary

One of the transforms in LoopSimplifyCFG demands that the LCSSA form is
truly maintained for all values, tokens included, otherwise it may end up creating
a use that is not dominated by def (and Phi creation for tokens is impossible).
Detect this situation and prevent transform for it early.

Diff Detail

Event Timeline

mkazantsev created this revision.Jul 18 2022, 12:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 12:37 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
mkazantsev requested review of this revision.Jul 18 2022, 12:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 12:37 AM
efriedma accepted this revision.Jul 18 2022, 11:21 AM

LGTM

I'm a little worried about the performance cost of the scan, but I guess this should be rare enough that it's unlikely to matter.

This revision is now accepted and ready to land.Jul 18 2022, 11:21 AM
This revision was landed with ongoing or failed builds.Jul 19 2022, 1:54 AM
This revision was automatically updated to reflect the committed changes.