Page MenuHomePhabricator

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

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



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, 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