[all-commits] [llvm/llvm-project] 4892d3: [InstCombine] Fold abs with dominating condition

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Sep 5 07:19:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4892d3a1983b0fae83e9476d8cec1d139da7eae0
      https://github.com/llvm/llvm-project/commit/4892d3a1983b0fae83e9476d8cec1d139da7eae0
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-09-05 (Sat, 05 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/abs-intrinsic.ll

  Log Message:
  -----------
  [InstCombine] Fold abs with dominating condition

Similar to D87168, but for abs. If we have a dominating x >= 0
condition, then we know that abs(x) is x. This fold is in
InstCombine, because we need to create a sub instruction for
the x < 0 case.

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




More information about the All-commits mailing list