[ConstantFold] Don't skip the first gep index when folding geps
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 4 Jun 2015 07:01:56 +0000 (07:01 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 4 Jun 2015 07:01:56 +0000 (07:01 +0000)
commitbcca6160292c1446bfcd6c8d222217329ae6de8b
tree22c1186f559dda726c2059676f2af3a60ea0ceb7
parent693d40eec0cb91c02d336c0559e7c0266997e60d
[ConstantFold] Don't skip the first gep index when folding geps

We neglected to check if the first index made the GEP ineligible for
'inbounds'.

This fixes PR23753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239015 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/ConstantFold.cpp
test/Transforms/LoopStrengthReduce/pr23753.ll [new file with mode: 0644]