OSDN Git Service

Fix a bug in the over-index constant folding. When over-indexing an
authorDan Gohman <gohman@apple.com>
Wed, 19 Aug 2009 22:46:59 +0000 (22:46 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 19 Aug 2009 22:46:59 +0000 (22:46 +0000)
commit3d01334e6fa5caba1361d088fabf728c64b23c58
tree9301c2cd7a3c0c64422b60f3c583de62f30c29ba
parent7bcec7e54163bfb2e3f3fda5254c1db1a403a3fb
Fix a bug in the over-index constant folding. When over-indexing an
array member of a struct, it's possible to land in an arbitrary position
inside that struct, such that attempting to find further getelementptr
indices will fail. In such cases, folding cannot be done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79485 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ConstantFolding.cpp
test/Transforms/InstCombine/constant-fold-gep-overindex.ll [new file with mode: 0644]