[PATCH] D85230: [PatternMatch] allow intrinsic form of min/max with existing matchers

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 11:12:51 PDT 2020


spatel created this revision.
spatel added reviewers: lebedev.ri, nikic, RKSimon.
Herald added a subscriber: mcrosier.
Herald added a project: LLVM.
spatel requested review of this revision.

I skimmed the existing users of these matchers and don't see any problems (eg, the caller assumes the matched value was a select instruction without checking).

So I think we can generalize the matching to allow the new intrinsics or the cmp+select idioms.

I did not find any unit tests for the matchers, so added some basics there. The instsimplify tests are adapted from existing tests for the cmp+select pattern and cover the folds in simplifyICmpWithMinMax().


https://reviews.llvm.org/D85230

Files:
  llvm/include/llvm/IR/PatternMatch.h
  llvm/test/Transforms/InstSimplify/maxmin_intrinsics.ll
  llvm/unittests/IR/PatternMatch.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85230.282963.patch
Type: text/x-patch
Size: 13797 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200804/2c46b66b/attachment.bin>


More information about the llvm-commits mailing list