aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-05-22 23:02:11 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-05-22 23:02:11 +0000
commit4c3753c4d483f8115df78507117a105438b42ec9 (patch)
tree0ab5abf1241e0f189dd74055eadecb47a40ffd2a /clang/lib/Frontend/CompilerInvocation.cpp
parent25f82aae57d2ce48ad9cff8cb34a6c3dc10ad519 (diff)
downloadllvm-4c3753c4d483f8115df78507117a105438b42ec9.zip
llvm-4c3753c4d483f8115df78507117a105438b42ec9.tar.gz
llvm-4c3753c4d483f8115df78507117a105438b42ec9.tar.bz2
[InstCombine] Don't eagerly propagate nsw for A*B+A*C => A*(B+C)
InstCombine transforms A *nsw B +nsw A *nsw C to A *nsw (B + C). This is incorrect -- e.g. if A = -1, B = 1, C = INT_SMAX. Then nothing in the LHS overflows, but the multiplication in RHS overflows. We need to first make sure that we won't multiple by INT_SMAX + 1. Test case `add_of_mul` contributed by Sanjoy Das. This fixes PR23635. Differential Revision: http://reviews.llvm.org/D9629 llvm-svn: 238066
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions