[PATCH] D59992: [SLP] Add support for commutative icmp/fcmp predicates

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 06:56:39 PDT 2019


RKSimon created this revision.
RKSimon added reviewers: ABataev, dtemirbulatov, vporpo.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/D57059>/D59973 <https://reviews.llvm.org/D59973> refactors.


Repository:
  rL LLVM

https://reviews.llvm.org/D59992

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/cmp_commute.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59992.192816.patch
Type: text/x-patch
Size: 11363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190329/ebcd9053/attachment.bin>


More information about the llvm-commits mailing list