This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Use the general SMAX/SMIN/UMAX/UMIN pattern matching and remove the X86 implementation
ClosedPublic

Authored by RKSimon on Aug 13 2015, 3:51 AM.

Details

Summary

Follow up to D10947 - D9746 added general SMAX/SMIN/UMAX/UMIN pattern matching to SelectionDAGBuilder::visitSelect.

This patch removes the X86 implementation and improves the AVX1/AVX2 support to correctly lower 256-bit integer vectors.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 32041.Aug 13 2015, 3:51 AM
RKSimon retitled this revision from to [X86][SSE] Use the general SMAX/SMIN/UMAX/UMIN pattern matching and remove the X86 implementation.
RKSimon updated this object.
RKSimon added reviewers: jmolloy, qcolombet, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
jmolloy edited edge metadata.Aug 13 2015, 4:50 AM

From a target-independent viewpoint I don't see anything wrong here, but I can't say anything about the X86-specific stuff.

James

qcolombet edited edge metadata.Aug 13 2015, 10:00 AM

Hi Simon,

Just asking, since I haven’t followed the previous related patches: Aren’t we regressing AVX512 by removing matchIntegerMINMAX?
More generally, does the generic code produce as many MIN/MAX patterns as this target specific one?

Thanks,
-Quentin

Just asking, since I haven’t followed the previous related patches: Aren’t we regressing AVX512 by removing matchIntegerMINMAX?
More generally, does the generic code produce as many MIN/MAX patterns as this target specific one?

Before this patch I'll put in some more thorough min max tests to ensure that we don't (there might be a few AVX512 cases that aren't been declared legal yet). I was intending to do this when I added constant folding support anyway.

qcolombet accepted this revision.Aug 13 2015, 11:05 AM
qcolombet edited edge metadata.

Thanks Simon.

LGTM.

-Quentin

This revision is now accepted and ready to land.Aug 13 2015, 11:05 AM
This revision was automatically updated to reflect the committed changes.