This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix infinite loop in peephole CR optimization (PR49509)
ClosedPublic

Authored by nikic on Mar 10 2021, 5:42 AM.

Details

Summary

If we encounter a degenerate select node where both operands are the same, then we can continue negating the condition while swapping operands, resulting in an infinite loop. Avoid this by bailout out if both operands are the same.

Fixes https://bugs.llvm.org/show_bug.cgi?id=49509, encountered in stage2 rustc build.

Diff Detail

Event Timeline

nikic created this revision.Mar 10 2021, 5:42 AM
nikic requested review of this revision.Mar 10 2021, 5:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2021, 5:42 AM
nagisa added a subscriber: nagisa.Mar 10 2021, 3:45 PM
nemanjai accepted this revision.Mar 11 2021, 3:56 AM

LGTM. Thanks for fixing this.

This revision is now accepted and ready to land.Mar 11 2021, 3:56 AM