[PATCH] D60897: [SLP] Look-ahead operand reordering heuristic.

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 14:55:22 PDT 2019


vporpo updated this revision to Diff 202491.
vporpo added a comment.

I investigated the two AArch64 failing tests. These tests feature the exact problem that we are trying to solve with this look-ahead heuristic. A commutative instruction had operands of the same opcode that the current heuristic has no way of reordering in an informed way. The current reordering was just lucky to pick the proper one, while the look-ahead heuristic was reordering the operands according to the score. However, the problem was that the score calculation was not considering external uses and was therefore favoring a sub-optimal operand ordering.

I updated the patch to factor in the cost of external uses, and both failures are now gone. I also updated the lit-test with a test that shows the problem with the external-uses.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60897/new/

https://reviews.llvm.org/D60897

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/PR39774.ll
  test/Transforms/SLPVectorizer/X86/broadcast.ll
  test/Transforms/SLPVectorizer/X86/lookahead.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60897.202491.patch
Type: text/x-patch
Size: 36101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190531/bd5653a8/attachment-0001.bin>


More information about the llvm-commits mailing list