Teach CorrelatedValuePropagation to mark adds as no wrap
authorArtur Pilipenko <apilipenko@azulsystems.com>
Wed, 10 Aug 2016 13:08:34 +0000 (13:08 +0000)
committerArtur Pilipenko <apilipenko@azulsystems.com>
Wed, 10 Aug 2016 13:08:34 +0000 (13:08 +0000)
commite171ea8a33198c3b257c110a5fecc97acdbb5b52
treed10fcd7614d9ed04a7270751c5feb03e83b16ef9
parentdfc1b900aca0fd4aa4b8ccf45f407ea96c5bdaff
Teach CorrelatedValuePropagation to mark adds as no wrap

This is a resubmission of previously reverted r277592. It was hitting overly strong assertion in getConstantRange which was relaxed in r278217.

Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem.

Reviewed By: sanjoy

Differential Revision: http://reviews.llvm.org/D23059

llvm-svn: 278220
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
llvm/test/Transforms/CorrelatedValuePropagation/add.ll [new file with mode: 0644]