This is an archive of the discontinued LLVM Phabricator instance.

Target Power9 bit counting and vector comparison instructions through builtins (backend portion)
ClosedPublic

Authored by nemanjai on Sep 9 2016, 7:35 AM.

Details

Summary

This patch adds support for the "vector count trailing zeroes", "vector compare not equal" and "vector compare not equal or zero instructions" as well as "scalar count trailing zeroes" instructions. It also changes the vector negation to use XXLNOR (when VSX is enabled) so as not to increase register pressure (previously this was done with a splat immediate of all ones followed by an XXLXOR). This was done because the altivec.h builtins (patch to follow) use vector negation and the use of an additional register for the splat immediate is not optimal.

Diff Detail

Repository
rL LLVM

Event Timeline

nemanjai updated this revision to Diff 70833.Sep 9 2016, 7:35 AM
nemanjai retitled this revision from to Target Power9 bit counting and vector comparison instructions through builtins (backend portion).
nemanjai updated this object.
nemanjai set the repository for this revision to rL LLVM.
nemanjai added subscribers: llvm-commits, echristo.
kbarton accepted this revision.Sep 22 2016, 12:12 PM
kbarton edited edge metadata.

Aside from a couple minor comments, this LGTM.

lib/Target/PowerPC/PPCISelLowering.cpp
219

Need to update this comment

7689

maybe want to add an llvm_unreachable for the default case.
I know this shouldn't happen right now, but it will prevent this from switch from getting out of sync with the outer case statements in the future.

7770

And here

This revision is now accepted and ready to land.Sep 22 2016, 12:12 PM
nemanjai closed this revision.Sep 27 2016, 1:51 AM

Committed revision 282478.