InstCombine: Don't turn -(x/INT_MIN) -> x/INT_MIN
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 2 Jul 2014 06:07:09 +0000 (06:07 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 2 Jul 2014 06:07:09 +0000 (06:07 +0000)
commit5f5939c14c7933d3a5295906a82497f7a14f6dfd
tree52aee5a1aebde8e2372c7ec9d22816258d7f382f
parent90fdedc064a473b7206d0ff8c8db2ed79a9af135
InstCombine: Don't turn -(x/INT_MIN) -> x/INT_MIN

It is not safe to negate the smallest signed integer, doing so yields
the same number back.

This fixes PR20186.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212164 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Constant.h
lib/IR/Constants.cpp
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/sub.ll