This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Extending size reduction pass with XOR16
ClosedPublic

Authored by milena.vujosevic.janicic on Jun 15 2017, 7:24 AM.

Details

Summary

The patch extends size reduction pass for MicroMIPS.
XOR instruction is transformed into 16-bit instruction XOR16, if possible.

Diff Detail

Repository
rL LLVM

Event Timeline

sdardis accepted this revision.Jun 16 2017, 2:35 AM

LGTM with inline comments addressed.

lib/Target/Mips/MicroMipsSizeReduction.cpp
460–475 ↗(On Diff #102669)

Change this if..else chain to switch on OpTransfer, with a default case of llvm_unreachable.

496 ↗(On Diff #102669)

There's a small 'gotcha' here, if Subtarget->hasMips64r6() is true, Subtarget->hasMips32r6() is also true. So "|| Subtarget->hasMips64r6()" can be removed.

hasMips64(rX)() implies hasMips32(rX)() is also true, due to the way the architecture is defined, so generally you only need to check for the availability of the 32bit revision of the ISA to determine what revision is being targeted.

This revision is now accepted and ready to land.Jun 16 2017, 2:35 AM
This revision was automatically updated to reflect the committed changes.