This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] allow undef elements when comparing vector constants for min/max bailout
ClosedPublic

Authored by spatel on Jun 11 2020, 4:29 PM.

Details

Summary

This is a hacky, but low-risk fix to avoid the infinite loop in PR46271:
https://bugs.llvm.org/show_bug.cgi?id=46271

As discussed there, the problem is that FoldOpIntoSelect() can get into a conflict with a transform that wants to pull a 'not' op through min/max via SimplifyDemandedVectorElts(). We need to relax our matching of min/max to include undefined elements in vector constants to avoid that. Alternatively, we could improve or cripple the demanded elements analysis, but that could create even more problems.

The likely better, safer alternative will be to create min/max intrinsics, so we can remove all of the hacks related to min/max matching in instcombine.

Diff Detail

Event Timeline

spatel created this revision.Jun 11 2020, 4:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2020, 4:29 PM
This revision is now accepted and ready to land.Jun 12 2020, 6:59 PM
This revision was automatically updated to reflect the committed changes.