This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Improve isel of smul and smla instructions for thumb2
ClosedPublic

Authored by samparker on Jul 28 2016, 3:26 AM.

Details

Summary

Added (ashr (shl x, 16), 16) pattern to the sext_16_node patleaf which allowed some removal of some pattern matching for ARM instructions and enabled more simple matching for their thumb counterparts, which also operate on the top / bottom 16-bits of a register. Updated the smul test with more patterns and thumb targets.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker updated this revision to Diff 65896.Jul 28 2016, 3:26 AM
samparker retitled this revision from to [ARM] Improve isel of smul and smla instructions for thumb2.
samparker updated this object.
samparker added a subscriber: llvm-commits.

The patch looks sensible, but there's a lot of unneeded reorganization. Also, a slightly more descriptive commit message would be nice.

cheers,
--renato

lib/Target/ARM/ARMInstrThumb2.td
2631 ↗(On Diff #65896)

No need to move this code around, it just makes it harder to git-blame later.

2665 ↗(On Diff #65896)

Same here, if you can keep the same order, it's easier to review.

test/CodeGen/ARM/smul.ll
10 ↗(On Diff #65896)

Same here, try to keep the same tests on their original positions and namings.

Thanks Renato, patch to follow.

samparker updated this revision to Diff 66449.Aug 2 2016, 3:00 AM
samparker updated this object.
samparker updated this revision to Diff 66450.Aug 2 2016, 3:06 AM
rengolin accepted this revision.Aug 2 2016, 3:25 AM
rengolin added a reviewer: rengolin.

LGTM with the nit. Thanks!

lib/Target/ARM/ARMInstrFormats.td
1002 ↗(On Diff #66449)

You don't seem to be using the first two. Maybe we shouldn't create them "just to complete the pattern"?

This revision is now accepted and ready to land.Aug 2 2016, 3:25 AM

Ok, I will remove them before I commit.

cheers

This revision was automatically updated to reflect the committed changes.