[all-commits] [llvm/llvm-project] a5f7bc: [InstCombine] Canonicalize uadd.with.overflow to u...

David Green via All-commits all-commits at lists.llvm.org
Thu Oct 31 06:02:44 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a5f7bc0de72f1c631ef13d2cccf2b77c9a030e7d
      https://github.com/llvm/llvm-project/commit/a5f7bc0de72f1c631ef13d2cccf2b77c9a030e7d
  Author: David Green <david.green at arm.com>
  Date:   2019-10-31 (Thu, 31 Oct 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/overflow_to_sat.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize uadd.with.overflow to uadd.sat

This adds some patterns to transform uadd.with.overflow to uadd.sat
(with usub.with.overflow to usub.sat too). The patterns selects from
UINTMAX (or 0 for subs) depending on whether the operation overflowed.

Signed patterns are a little more involved (they can wrap in two
directions), but can be added here in a followup patch too.

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




More information about the All-commits mailing list