[all-commits] [llvm/llvm-project] adf42d: [ValueTracking] peek through min/max to find isKno...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Mar 24 15:02:47 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adf42dff421c0509cc8d2fe103d6e6fe3a30f855
      https://github.com/llvm/llvm-project/commit/adf42dff421c0509cc8d2fe103d6e6fe3a30f855
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/include/llvm/IR/PatternMatch.h
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstSimplify/AndOrXor.ll

  Log Message:
  -----------
  [ValueTracking] peek through min/max to find isKnownToBeAPowerOfTwo

This is similar to the select logic just ahead of the new code.
Min/max choose exactly one value from the inputs, so if both of
those are a power-of-2, then the result must be a power-of-2.

This might help with D98152, but we likely still need other
pieces of the puzzle to avoid regressions.

The change in PatternMatch.h is needed to build with clang.
It's possible there is a better way to deal with the 'const'
incompatibities.

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




More information about the All-commits mailing list