[all-commits] [llvm/llvm-project] 60f2c6: [PatternMatch] allow intrinsic form of min/max wit...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Aug 6 07:53:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 60f2c6a94cdff51fb8906030bbb73ba1c90da1c4
      https://github.com/llvm/llvm-project/commit/60f2c6a94cdff51fb8906030bbb73ba1c90da1c4
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-08-06 (Thu, 06 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/PatternMatch.h
    M llvm/test/Transforms/InstSimplify/maxmin_intrinsics.ll
    M llvm/unittests/IR/PatternMatch.cpp

  Log Message:
  -----------
  [PatternMatch] allow intrinsic form of min/max with existing matchers

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().

Differential Revision: https://reviews.llvm.org/D85230




More information about the All-commits mailing list