This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Try to merge edge block when threading (PR55765)
ClosedPublic

Authored by nikic on Jun 7 2022, 7:06 AM.

Details

Summary

When threading, we always create a new block for the threaded edge (even if the edge is not critical), which will later get folded back into the predecessor if possible. Depending on precise processing order, this separate block may break the detection of trivial cycles in the threading code, which normally avoids infinite threading of loops. Explicitly merge the created edge block into the predecessor to avoid this.

Fixes https://github.com/llvm/llvm-project/issues/55765.

Diff Detail

Event Timeline

nikic created this revision.Jun 7 2022, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 7:06 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
nikic requested review of this revision.Jun 7 2022, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 7:06 AM
spatel accepted this revision.Jun 17 2022, 7:26 AM

LGTM

This revision is now accepted and ready to land.Jun 17 2022, 7:26 AM