[all-commits] [llvm/llvm-project] 8a10f4: [InstCombine] use isFreeToInvert to generalize min...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Sep 1 11:35:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a10f4a0f661a11715ab0430c2b3b27a8f36267e
      https://github.com/llvm/llvm-project/commit/8a10f4a0f661a11715ab0430c2b3b27a8f36267e
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-09-01 (Wed, 01 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/minmax-intrinsics.ll

  Log Message:
  -----------
  [InstCombine] use isFreeToInvert to generalize min/max with 'not'

This mimics the code for the corresponding cmp-select idiom.

This also prevents an infinite loop because isFreeToInvert
does not match constant expressions.

So this patch solves the same problem as D108814 and obsoletes
it, but my main motivation is to enhance the pattern matching
to allow more invertible ops. That change will be a follow-up
patch on top of this one.

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




More information about the All-commits mailing list