- 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;
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]