This is an archive of the discontinued LLVM Phabricator instance.

[X86] Also create v2f32 FMIN/FMAX nodes from fcmp/select.
ClosedPublic

Authored by ab on Dec 5 2014, 4:20 PM.

Details

Summary

We also learned to legalize v2f32 FMIN/FMAX nodes later on.
I tried to also support v3f32, which might also happen often, but they
were already widened to v4f32 by the generic split-and-rebuild-vector
legalization.

This happens in the HINT benchmark, where the SLP-vectorizer created
v2f32 fcmp/select code. The "correct" solution would have been to
teach the vectorizer cost model that v2f32 isn't legal (because really,
it isn't), but if we can vectorize we might as well do so.

Diff Detail

Repository
rL LLVM

Event Timeline

ab updated this revision to Diff 17007.Dec 5 2014, 4:20 PM
ab retitled this revision from to [X86] Also create v2f32 FMIN/FMAX nodes from fcmp/select..
ab updated this object.
ab edited the test plan for this revision. (Show Details)
ab added a subscriber: Unknown Object (MLST).
ab updated this object.Dec 15 2014, 9:31 AM

Ping!

qcolombet accepted this revision.Jan 8 2015, 11:49 AM
qcolombet added a reviewer: qcolombet.
qcolombet added a subscriber: qcolombet.

Hi Ahmed,

LGTM with maybe more verbose tests.

Also, shouldn’t we fix some vector cost model since you mentioned the vectorizer shouldn’t have kicked in some benchmarks?
File free to file a PR for that (or to fix it in a following commit :)).

Thanks,
-Quentin

test/CodeGen/X86/sse-minmax.ll
942 ↗(On Diff #17007)

I know the surrounding tests are already written like this, but I would like something more verbose that check we just generate this one instruction (+ret).

This revision is now accepted and ready to land.Jan 8 2015, 11:49 AM
This revision was automatically updated to reflect the committed changes.