This is an archive of the discontinued LLVM Phabricator instance.

[LoopFlatten] Fix crash if the inner loop trip count comes from a sext instruction.
ClosedPublic

Authored by craig.topper on Jun 6 2022, 1:56 PM.

Details

Summary

If we look through a truncate in matchLinearIVUser, it's possible
we find a sext/zext instruction that didn't come from widening.
This will fail the MatchedItCount->getType() == InnerInductionPHI->getType()
assertion.

Fix this by checking that we did not look through a truncate already.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 6 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 1:56 PM
craig.topper requested review of this revision.Jun 6 2022, 1:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 1:56 PM
SjoerdMeijer accepted this revision.Jun 7 2022, 12:39 AM

Thanks for fixing, LGTM.

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