This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] BITREVERSE vector legalization of bit operations
ClosedPublic

Authored by RKSimon on May 2 2016, 7:18 AM.

Details

Summary

Vector bit operations are typically promoted instead of having custom lowering. This patch changes the isOperationLegalOrCustom tests for vector AND/OR operations to use isOperationLegalOrPromote instead, allowing the SSE implementations to stay on the simd unit.

I can't find any cases where vector AND/OR operations use custom lowering, but if I have missed something it would be possible to add a TLI::isOperationLegalOrCustomOrPromote function to cover all cases - what do you think?

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 55815.May 2 2016, 7:18 AM
RKSimon retitled this revision from to [SelectionDAG] BITREVERSE vector legalization of bit operations.
RKSimon updated this object.
RKSimon added a reviewer: jmolloy.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
jmolloy accepted this revision.May 4 2016, 6:44 AM
jmolloy edited edge metadata.

Hi,

This looks sensible to me, thanks!

I also like the improvement in the testcase!

Cheers,

James

This revision is now accepted and ready to land.May 4 2016, 6:44 AM
This revision was automatically updated to reflect the committed changes.

Thanks, I've reverted the commit and will investigate the isOperationLegalOrCustomOrPromote approach.

Hi Simon,

It'd be interesting to discover why you didn't notice this failure when running the regression tests locally. Perhaps this test doesn't run as frequently as it should do (too strict REQUIRES list maybe?)

Cheers,

James

It'd be interesting to discover why you didn't notice this failure when running the regression tests locally. Perhaps this test doesn't run as frequently as it should do (too strict REQUIRES list maybe?)

Definitely, this is the first time that I've noticed that all the AARCH64 and WebAssembly codegen tests are flagged as unsupported for lit tests on windows builds. so weren't getting tested. Any ideas why?

sunfish added a subscriber: sunfish.May 4 2016, 3:14 PM

WebAssembly, for its part, is currently an "experimental" target in LLVM which is not built unless explicitly enabled.

Reapplied using a newly added TLI::isOperationLegalOrCustomOrPromote - tested on windows and osx before commit and the buildbots are happier this time.

lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp