[PATCH] D41766: [MachineCombiner] Add check for optimal pattern order.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 08:41:31 PST 2018


fhahn created this revision.
fhahn added reviewers: Gerolf, spatel, mssimpso.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

In https://reviews.llvm.org/D41587, @mssimpso discovered that the order of some patterns for
AArch64 was sub-optimal. I thought a bit about how we could avoid that
case in the future. I do not think there is a need for evaluating all
patterns for now. But this patch adds an extra (expensive) check, that
evaluates the latencies of all patterns, and ensures that the latency
saved decreases for subsequent patterns.

This catches the sub-optimal order fixed in https://reviews.llvm.org/D41587, but I am not
entirely happy with the check, as it only applies to sub-optimal
patterns seen while building with EXPENSIVE_CHECKS on. It did not
discover any other sub-optimal pattern ordering.

Do you think that additional check would be useful?


https://reviews.llvm.org/D41766

Files:
  lib/CodeGen/MachineCombiner.cpp
  test/CodeGen/AArch64/aarch64-combine-fmul-fsub.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41766.128752.patch
Type: text/x-patch
Size: 6790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180105/c543a868/attachment.bin>


More information about the llvm-commits mailing list