This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX] Missing AVX1 memory folding float instructions
ClosedPublic

Authored by RKSimon on Jan 19 2015, 7:18 AM.

Details

Summary

Now that we can create much more exhaustive X86 memory folding tests, this patch adds the missing AVX1/F16C floating point instruction stack foldings I can easily test for including the scalar intrinsics (add, div, max, min, mul, sub), conversions float/int to double, half precision conversions, rounding, dot product and bit test.

I haven't added the SSE tests yet (I intend to complete the AVX1 version first and just do a 'cutdown' version for SSE with its own fix up patch for review) but I've added a couple of obviously missing SSE instructions here (just tested locally so far).

Once all the AVX1/SSE floats are done I'll start on the integer tests.

Now that scalar folding is working it broke a very old test (2006-10-07-ScalarSSEMiscompile.ll) - this test appears to make no sense as its trying to ensure that a scalar subtraction isn't folded as it 'would zero the top elts of the loaded vector' - this test just appears to be wrong to me.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 18390.Jan 19 2015, 7:18 AM
RKSimon retitled this revision from to [X86][AVX] Missing AVX1 memory folding float instructions.
RKSimon updated this object.
RKSimon edited the test plan for this revision. (Show Details)
RKSimon added reviewers: qcolombet, mkuper, andreadb, spatel.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: Unknown Object (MLST).
qcolombet accepted this revision.Jan 19 2015, 10:30 AM
qcolombet edited edge metadata.

Hi Simon,

LGTM.

Thanks,
-Quentin

This revision is now accepted and ready to land.Jan 19 2015, 10:30 AM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp