This is an archive of the discontinued LLVM Phabricator instance.

ARM: Fix cttz expansion on vector types.
ClosedPublic

Authored by logan on Jul 12 2015, 4:16 AM.

Details

Summary

The 64/128-bit vector types will be treated as legal type when NEON is
enabled, but there was no matching pattern for @llvm.cttz.*()
intrinsics. This commit fix the problem by lowering cttz to ctpop or
ctlz.

Diff Detail

Event Timeline

logan updated this revision to Diff 29521.Jul 12 2015, 4:16 AM
logan retitled this revision from to ARM: Fix cttz expansion on vector types..
logan updated this object.
logan added reviewers: t.p.northover, grosbach, rengolin, chh.
logan added a subscriber: llvm-commits.
rengolin edited edge metadata.Jul 12 2015, 6:04 AM

Hi Logan,

The patch looks good, though I was expecting the vector test to be checking instructions as well.

cheers,
--renato

logan updated this revision to Diff 29569.Jul 13 2015, 8:16 AM
logan edited edge metadata.

Add test cases for 64/128-bit vector types.

rengolin accepted this revision.Jul 13 2015, 8:23 AM
rengolin edited edge metadata.

Hi Logan, looks good, thanks!

The cases where you didn't add CHECKs, was it because it didn't use vector instructions? I think it should be fine to check for scalar instructions, like the others, at least to check that the instructions you were expecting got lowered.

Otherwise, LGTM. Thanks!

This revision is now accepted and ready to land.Jul 13 2015, 8:23 AM
logan added a comment.Jul 13 2015, 8:23 AM

Hi Renato,

I have added the test cases for 64/128-bit vector types. For the other cases I am leaving them unchanged because they are automatically expanded by the code generator and irrelevant to this change. Please have a look again. Thanks.

Logan

Ok, no problems.

logan closed this revision.Jul 13 2015, 8:40 AM

Hi Renato,

Thanks for your review. I have committed this as rL242037.

Regarding to your comments on the check lines (for automatically expanded cases), I will try to address them in the different change after I have figured out the pattern for automatic expansion.

Logan

Perfect, thanks!

test/CodeGen/ARM/cttz_vector.ll