The patch extends size reduction pass for MicroMIPS.
The following instructions are examined and transformed, if possible:
ADDIU instruction is transformed into 16-bit instruction ADDIUSP
ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP
Function InRange is changed to avoid left shifting of negative values, since
that caused some sanitizer tests to fail (so the previous patch
https://reviews.llvm.org/D33887 was reverted).
Details
Details
Diff Detail
Diff Detail
Event Timeline
lib/Target/Mips/MicroMipsSizeReduction.cpp | ||
---|---|---|
429 | This is common between the two branches of the if, so it can be hoisted above the if. | |
432 | This is common too, so it should be hoisted up. | |
461–463 | Formatting: Break overly long conditional statements _after_ the '||' or '&&' operators, not before. i.e. This should be: if (!Subtarget->inMicroMipsMode() || !Subtarget->hasMips32r2() || Subtarget->hasMips32r6()) clang-format handles this. |
Comment Actions
LGTM with nit addressed.
lib/Target/Mips/MicroMipsSizeReduction.cpp | ||
---|---|---|
443 | Needs: } else llvm_unreachable("Unknown operand transfer!"); |
This is common between the two branches of the if, so it can be hoisted above the if.