]> granicus.if.org Git - llvm/commit
[SimplifyIndVar] Simplify non-overflowing saturating add/sub
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 15 Jun 2019 08:48:52 +0000 (08:48 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 15 Jun 2019 08:48:52 +0000 (08:48 +0000)
commitbf4a9f732581a6e85a904a7b3b612b658860ca7e
tree2c4f311f6e376a900f2d57e976d82d7d1341e39a
parent5eaae6c4c2b4364378dc8a2be3ca8993514f4edf
[SimplifyIndVar] Simplify non-overflowing saturating add/sub

If we can detect that saturating math that depends on an IV cannot
overflow, replace it with simple math. This is similar to the CVP
optimization from D62703, just based on a different underlying
analysis (SCEV vs LVI) that catches different cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363489 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyIndVar.cpp
test/Transforms/IndVarSimplify/eliminate-sat.ll