[all-commits] [llvm/llvm-project] b1b7a2: [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sa...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sun Oct 20 13:18:33 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b1b7a2f7b63db915fbc0e7ee5e1811b8846fbd9b
      https://github.com/llvm/llvm-project/commit/b1b7a2f7b63db915fbc0e7ee5e1811b8846fbd9b
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2019-10-20 (Sun, 20 Oct 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/saturating-add-sub.ll

  Log Message:
  -----------
  [InstCombine] Fold uadd.sat(a, b) == 0 and usub.sat(a, b) == 0

This adds folds for comparing uadd.sat/usub.sat with zero:

 * uadd.sat(a, b) == 0 => a == 0 && b == 0 => (a | b) == 0
 * usub.sat(a, b) == 0 => a <= b

And inverted forms for !=.

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

llvm-svn: 375374




More information about the All-commits mailing list