This is an archive of the discontinued LLVM Phabricator instance.

ARM SMLAW[B|T], SMULW[B|T] ISel
ClosedPublic

Authored by samparker on Apr 8 2016, 2:41 AM.

Details

Summary

Added ISel for smlawb, smlawt, smulwb and smulwt instructions for the ARM backend, along with CodeGen tests.
A fix for the bug reported in llvm.org/bugs/show_bug.cgi?id=21297

Diff Detail

Repository
rL LLVM

Event Timeline

samparker updated this revision to Diff 53006.Apr 8 2016, 2:41 AM
samparker retitled this revision from to ARM SMLAW[B|T], SMULW[B|T] ISel.
samparker updated this object.

Hi Sam,

The patch looks good. My comments are more about the format than the contents, which seems ok.

I don't particularly like how the Opc is set down all those nested functions across the multiple branches, but I don't have a better idea. This sequence of instructions is really hard to map into a simple structure (too many orthogonal variations).

Can you re-format and re-submit with -U999 so we can have a bit more context, please?

cheers,
--renato

lib/Target/ARM/ARMISelDAGToDAG.cpp
94 ↗(On Diff #53006)

irrelevant whispace change

2534 ↗(On Diff #53006)

clang format

test/CodeGen/ARM/smul.ll
39 ↗(On Diff #53006)

better to use

CHECK-LABEL: @f4

on all of them

samparker updated this revision to Diff 53024.Apr 8 2016, 7:18 AM

same diff, just with added context

Hi Renato,

Thanks for the review and sorry I forgot about the added context again, I will add the changes after further review.

cheers,
sam

rengolin added inline comments.Apr 8 2016, 8:12 AM
lib/Target/ARM/ARMISelDAGToDAG.cpp
254 ↗(On Diff #53024)

It seems these two could be coalesced into one method with a bit more logic inside the method... They're not really that different and they both call the same private static methods anyway.

2596 ↗(On Diff #53024)

Maybe you should also test the opcode here and return null?

samparker updated this revision to Diff 53029.Apr 8 2016, 8:45 AM
samparker marked an inline comment as done.

Combined the SelectSMLAWX and SelectSMULWX functions into one, as well as adding extra checks that Opc gets assigned before creating the new node. Also updated the test check labels.

rengolin accepted this revision.Apr 8 2016, 8:58 AM
rengolin added a reviewer: rengolin.

LGTM. Thanks!

This revision is now accepted and ready to land.Apr 8 2016, 8:58 AM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/test/CodeGen/ARM/smul.ll