This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fix infinite loop in min/max load/store bitcast combine (PR44835)
ClosedPublic

Authored by nikic on Feb 8 2020, 3:12 AM.

Details

Summary

Fixes https://bugs.llvm.org/show_bug.cgi?id=44835. Skip the transform if it wouldn't actually do anything (apart from removing and reinserting the same instructions).

Note that the test case doesn't loop on current master anymore, only on the LLVM 10 release branch. The issue is already mitigated on master due to worklist order fixes, but we should probably fixing the root cause there as well.

As a side note, we should probably assert in combineLoadToNewType() that it does not combine to the same type. Not doing this here, because this assertion would also be triggered in another place right now.

Diff Detail

Event Timeline

nikic created this revision.Feb 8 2020, 3:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2020, 3:12 AM
spatel accepted this revision.Feb 8 2020, 7:30 AM

LGTM

This revision is now accepted and ready to land.Feb 8 2020, 7:30 AM
This revision was automatically updated to reflect the committed changes.