Constant-fold ptrtoint+add+inttoptr to gep when the pointer is an
authorDan Gohman <gohman@apple.com>
Thu, 7 May 2009 14:24:56 +0000 (14:24 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 7 May 2009 14:24:56 +0000 (14:24 +0000)
commit704b6980b8d45d5b6b981850bd82634d2d91e4c4
tree8cbb099520398571d7f9fd7db1af5f30c86325ae
parentecb403a9d3a340009c266d05cfca2bd778c7b156
Constant-fold ptrtoint+add+inttoptr to gep when the pointer is an
array and the add is within range. This helps simplify expressions
expanded by ScalarEvolutionExpander.

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