[all-commits] [llvm/llvm-project] 284b6d: [CVP] After proving that @llvm.with.overflow()/@ll...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Oct 18 12:32:18 PDT 2019

  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 284b6d7f4da2260d996834fd1fabec461310bc96
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    M llvm/test/Transforms/CorrelatedValuePropagation/overflows.ll

  Log Message:
  [CVP] After proving that @llvm.with.overflow()/@llvm.sat() don't overflow, also try to prove other no-wrap

CVP, unlike InstCombine, does not run till exaustion.
It only does a single pass.

When dealing with those special binops, if we prove that they can
safely be demoted into their usual binop form,
we do set the no-wrap we deduced. But when dealing with usual binops,
we try to deduce both no-wraps.

So if we convert e.g. @llvm.uadd.with.overflow() to `add nuw`,
we won't attempt to check whether it can be `add nuw nsw`.

This patch proposes to call `processBinOp()` on newly-created binop,
which is identical to what we do for div/rem already.

Reviewers: nikic, spatel, reames

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375273

More information about the All-commits mailing list