[PATCH] D45828: [PatternMatch] Stabilize the matching order of commutative matchers

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 15:01:30 PDT 2018


lebedev.ri updated this revision to Diff 144207.
lebedev.ri marked 4 inline comments as done.
lebedev.ri added a comment.

- Renamed it to `m_Deferred()`.
- Simplified some existing code using it.

In https://reviews.llvm.org/D45828#1079612, @spatel wrote:

> In https://reviews.llvm.org/D45828#1079125, @lebedev.ri wrote:
>
> > Ping. Would really like some feedback on this idea.
>
>
> My implementation knowledge is limited, so I defer to other reviewers for the actual diffs.




> Are the eval-order-stabilization changes independent of the new matcher?

I suppose so.
The matcher can be separate, though then i'm not sure right now how to test the rest of the changes.

> How often does this come up?

Not *too* often, but it does come up.

> Ie, besides the proposed patch in https://reviews.llvm.org/D45664, can you use this on existing code to simplify it? If so, it might be worth including at least one of those changes here to show the value of adding a new matcher.

It's a bit cumbersome to find such instances, but sure, there you go.


Repository:
  rL LLVM

https://reviews.llvm.org/D45828

Files:
  include/llvm/IR/PatternMatch.h
  lib/Analysis/ValueTracking.cpp
  lib/Transforms/InstCombine/InstCombineAddSub.cpp
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  test/Transforms/InstCombine/and-or-not.ll
  test/Transforms/InstCombine/or-xor.ll
  unittests/IR/PatternMatch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45828.144207.patch
Type: text/x-patch
Size: 13435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180426/422fa4c1/attachment.bin>


More information about the llvm-commits mailing list