Page MenuHomePhabricator

[lanai] Use peephole optimizer to generate more conditional ALU operations.

Authored by jpienaar on Jul 6 2016, 4:34 PM.


  • Similiar to the ARM backend yse the peephole optimizer to generate more conditional ALU operations;
  • Add predicated type with default always true to RR instructions in;
  • Move LanaiSetflagAluCombiner into optimizeCompare;
  • The ASM parser can currently only handle explicitly specified CC, so specify ".t" (true) where needed in the ASM test;
  • Remove unused MachineOperand flags;

Diff Detail

Event Timeline

jpienaar updated this revision to Diff 62993.Jul 6 2016, 4:34 PM
jpienaar retitled this revision from to [lanai] Use peephole optimizer to generate more conditional ALU operations..
jpienaar updated this object.
jpienaar added a reviewer: eliben.
eliben edited edge metadata.Jul 7 2016, 9:11 AM

Since most of the actual peephole code is taken from the ARM backend, I left less comments on that part.


A comment here could be helpful to explain why < UNKNOWN makes isCondCode true


Here too, a comment could help explain the logic


Can you clarify what the AllOnes arg does? And it's not very clear about Invert, I'd add more details (or example)


I feel this could be clearer as separate cases without the fall through, because in case ISD::SIGN_EXTEND we know !AllOnes and we know the opcode so many of the conditions become trivial

... not a strong feeling about it - you can try to rewrite it the other way and see if it looks cleaner to you


Can you document these methods? Their arguments, etc.

[even if this mirrors the ARM backend it's nice to have all clear here for Lanai]

jpienaar updated this revision to Diff 63121.Jul 7 2016, 1:09 PM
jpienaar edited edge metadata.

Comments addressed, thanks.

eliben accepted this revision.Jul 7 2016, 4:41 PM
eliben edited edge metadata.
This revision is now accepted and ready to land.Jul 7 2016, 4:41 PM
jpienaar closed this revision.Jul 7 2016, 4:43 PM