[SLSR] Fix crash on handling 128-bit integers.
authorJingyue Wu <jingyue@google.com>
Sat, 9 Jul 2016 19:13:18 +0000 (19:13 +0000)
committerJingyue Wu <jingyue@google.com>
Sat, 9 Jul 2016 19:13:18 +0000 (19:13 +0000)
commitdebce55ac3048eda31c2e97ab9eefc0d10c45fd2
tree2a69b2b84b0a3276a6c16d82e11bfba498a8081a
parent6170b4bebdcf3c9eae3eb0d88dbe855c98977a08
[SLSR] Fix crash on handling 128-bit integers.

ConstantInt::getSExtValue may fail on >64-bit integers. Add checks to call
getSExtValue only on narrow integers.

As a minor aside, simplify slsr-gep.ll to remove unnecessary load instructions.

llvm-svn: 274982
llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
llvm/test/Transforms/StraightLineStrengthReduce/slsr-add.ll
llvm/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll