[all-commits] [llvm/llvm-project] 09feee: [BPF] Undo transformation for LICM.cpp:hoistMinMax()

eddyz87 via All-commits all-commits at lists.llvm.org
Thu Jul 6 06:27:25 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 09feee559a294611257ee157dba039fb05fe4f68
      https://github.com/llvm/llvm-project/commit/09feee559a294611257ee157dba039fb05fe4f68
  Author: Eduard Zingerman <eddyz87 at gmail.com>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

  Changed paths:
    M llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
    A llvm/test/CodeGen/BPF/sink-min-max.ll

  Log Message:
  -----------
  [BPF] Undo transformation for LICM.cpp:hoistMinMax()

Extended BPFCheckAndAdjustIR pass with sinkMinMax() transformation
that undoes LICM hoistMinMax pass.

The undo transformation converts the following patterns:

    x < min(a, b) -> x < a && x < b
    x > min(a, b) -> x > a || x > b
    x < max(a, b) -> x < a || x < b
    x > max(a, b) -> x > a && x > b

Where 'a' or 'b' is a constant.
Also supports `sext min(...) ...` and `zext min(...) ...`.

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




More information about the All-commits mailing list