This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Fix crash when matching associative reduction for integer min/max.
ClosedPublic

Authored by vdmitrie on Mar 11 2021, 8:48 AM.

Details

Summary

Associative reduction matcher in SLP begins with select instruction but when
it reached call to llvm.umax (or alike) via def-use chain the latter also matched
as UMax kind. The routine's later code assumes matched instruction to be a select
and thus it merely died on the first encountered cast that did not fit.

Diff Detail

Event Timeline

vdmitrie created this revision.Mar 11 2021, 8:48 AM
vdmitrie requested review of this revision.Mar 11 2021, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2021, 8:48 AM
spatel accepted this revision.Mar 11 2021, 11:10 AM

LGTM - I'm looking at what it will take to allow matching intrinsics, but we should fix the crash first.

This revision is now accepted and ready to land.Mar 11 2021, 11:10 AM
This revision was landed with ongoing or failed builds.Mar 11 2021, 11:54 AM
This revision was automatically updated to reflect the committed changes.