HomePhabricator

[SLP] Fix crash in reduction for integer min/max

Authored by yrouban on Mar 25 2021, 7:32 AM.

Description

[SLP] Fix crash in reduction for integer min/max

The SCEV commit b46c085d2b6d1 [NFCI] SCEVExpander:

emit intrinsics for integral {u,s}{min,max} SCEV expressions

seems to reveal a new crash in SLPVectorizer.
SLP crashes expecting a SelectInst as an externally used value
but umin() call is found.

The patch relaxes the assumption to make the IR flag propagation safe.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D99328

Details