This is an archive of the discontinued LLVM Phabricator instance.

[CodeGenPrepare] Fix crash due to an invalid CFG
ClosedPublic

Authored by bcahoon on Apr 17 2017, 10:16 AM.

Details

Summary

The splitIndirectCriticalEdges transformation generates an invalid CFG when the 'Target' basic block is a loop to itself. When this occurs, the code that updates the predecessor terminators needs to update the terminator in the split basic block.

This occurs when there is an edge from 'D' to 'D'. Since D is split into D0 and D1, the code needs to update the terminator in D1, but D1 isn't in the OtherPreds vector so it doesn't get updated.

Diff Detail

Repository
rL LLVM

Event Timeline

bcahoon created this revision.Apr 17 2017, 10:16 AM
mkuper accepted this revision.Apr 17 2017, 10:25 AM

LGTM, Thanks!

This revision is now accepted and ready to land.Apr 17 2017, 10:25 AM
This revision was automatically updated to reflect the committed changes.