This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Added SMAX/SMIN/UMAX/UMIN constant folding
ClosedPublic

Authored by RKSimon on Aug 18 2015, 2:59 PM.

Details

Summary

Added support for constant folding of SMAX/SMIN/UMAX/UMIN nodes

We still need to add constant folding of vector comparisons to fold the tests for targets that don't support the respective min/max nodes

I needed to update 2011-12-06-AVXVectorExtractCombine to load a vector instead of using a constant vector to prevent it folding

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 32458.Aug 18 2015, 2:59 PM
RKSimon retitled this revision from to [DAGCombiner] Added SMAX/SMIN/UMAX/UMIN constant folding.
RKSimon updated this object.
RKSimon added reviewers: jmolloy, spatel, andreadb.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
arsenm added a subscriber: arsenm.Aug 18 2015, 3:46 PM

Where are these being produced in the first place? I would have expected these would have folded away before the min/max was created.

Code using the llvm.x86.sse*.pmin* / llvm.x86.sse*.pmax* intrinsics has been the main source of them so far, but I wanted to create a general implementation if I could.

jmolloy accepted this revision.Aug 19 2015, 2:48 AM
jmolloy edited edge metadata.

This looks good from my point of view, but I haven't audited the X86 test changes!

James

This revision is now accepted and ready to land.Aug 19 2015, 2:48 AM
This revision was automatically updated to reflect the committed changes.