This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary
  • 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 LanaiInstrInfo.td;
  • 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.

lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
368

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

1050

Here too, a comment could help explain the logic

lib/Target/Lanai/LanaiISelLowering.cpp
1293

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

1321

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

lib/Target/Lanai/LanaiInstrInfo.h
91

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
lib/Target/Lanai/MCTargetDesc/LanaiBaseInfo.h