This is an archive of the discontinued LLVM Phabricator instance.

[SLP] Add support for commutative icmp/fcmp predicates
ClosedPublic

Authored by RKSimon on Mar 29 2019, 6:56 AM.

Details

Summary

For the cases where the icmp/fcmp predicate is commutative, use reorderInputsAccordingToOpcode to collect and commute the operands.

This requires a helper to recognise commutativity in both general Instruction and CmpInstr types - the CmpInst::isCommutative doesn't overload the Instruction::isCommutative method for reasons I'm not clear on (maybe because its based on predicate not opcode?!?).

If at all possible I'd like to get this in before the D57059/D59973 refactors.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Mar 29 2019, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2019, 6:56 AM
This revision is now accepted and ready to land.Mar 29 2019, 8:08 AM
This revision was automatically updated to reflect the committed changes.