This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Enable SMMLS isel
ClosedPublic

Authored by samparker on Jul 20 2016, 2:32 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker updated this revision to Diff 64650.Jul 20 2016, 2:32 AM
samparker retitled this revision from to [ARM] Enable SMMLS isel.
samparker updated this object.
t.p.northover added inline comments.
lib/Target/ARM/ARMISelDAGToDAG.cpp
3041–3042 ↗(On Diff #64650)

I think you need isThumb2 for the Thumb mode instruction.

3045–3046 ↗(On Diff #64650)

This condition could be inverted with a break to reduce indentation.

3054 ↗(On Diff #64650)

Don't you also need to check that the correct Subc result is being used by N?

lib/Target/ARM/ARMInstrThumb2.td
2642 ↗(On Diff #64650)

These changes don't appear to be related to supporting SMMLS. They're just a bit of refactoring as far as I can tell.

test/CodeGen/ARM/smml.ll
27–28 ↗(On Diff #64650)

I think you should test actual dataflow here too (i.e. the registers that get used). It's very easy to mess that kind of thing up with manual C++ selection.

samparker updated this revision to Diff 64837.Jul 21 2016, 1:51 AM

Updated after Tim's comments, including: checking for thumb2, what value of subc the sube node uses, reducing indentation and improving the test.

t.p.northover added inline comments.Jul 21 2016, 6:33 AM
lib/Target/ARM/ARMISelDAGToDAG.cpp
3041 ↗(On Diff #64837)

This still isn't quite right, I'm afraid. We only need Thumb2 if we're in Thumb mode. The check for both Thumb mode and Thumb2 is isThumb2 by the looks of it.

Could you also add an armv6-eabi line to the test to make sure it's working?

lib/Target/ARM/ARMInstrThumb2.td
2642 ↗(On Diff #64837)

Any explanation for these changes?

samparker added inline comments.Jul 21 2016, 6:59 AM
lib/Target/ARM/ARMISelDAGToDAG.cpp
3041 ↗(On Diff #64837)

ok, I will use that check when the opcode is being selected.

lib/Target/ARM/ARMInstrThumb2.td
2642 ↗(On Diff #64837)

Yes, its just a bit of refactoring. Should I include it in a different patch instead?

t.p.northover added inline comments.Jul 21 2016, 7:31 AM
lib/Target/ARM/ARMInstrThumb2.td
2642 ↗(On Diff #64837)

I think it's OK to review here (and have no objections), but a separate commit would definitely be appreciated.

samparker updated this revision to Diff 64889.Jul 21 2016, 7:40 AM

Added armv6, thumbv6 and thumbv6t2 targets to the test.

t.p.northover added inline comments.Jul 21 2016, 9:20 AM
lib/Target/ARM/ARMISelDAGToDAG.cpp
3041–3042 ↗(On Diff #64889)

OK, I see why this works now (there will never be an SMUL_LOHI in Thumb1 code) but I think it needs at least an assertion to make clear to a reader that we have considered thumbv6.

samparker updated this revision to Diff 65032.Jul 22 2016, 1:29 AM

Added assertion to catch Thumb generation.

t.p.northover accepted this revision.Jul 22 2016, 7:01 AM
t.p.northover added a reviewer: t.p.northover.

Thanks Sam. I think this looks fine now.

This revision is now accepted and ready to land.Jul 22 2016, 7:01 AM
This revision was automatically updated to reflect the committed changes.