Canonicalize indices in a constantexpr GEP. If Indices exceed the
authorDan Gohman <gohman@apple.com>
Wed, 19 Aug 2009 18:18:36 +0000 (18:18 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 19 Aug 2009 18:18:36 +0000 (18:18 +0000)
commitde0e587e63f71afb2ac53c9880c262089fe798bb
tree624e0cddf4b8c1f4a1dcbca4d0bcbf3240fa650a
parent6a402dc952ccad3f8fd0d9e272dbdd261f50854e
Canonicalize indices in a constantexpr GEP. If Indices exceed the
static extents of the static array type, it causes GlobalOpt and
other passes to be more conservative. This canonicalization also
allows the constant folder to add "inbounds" to GEPs.

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