Switch the pointer-difference simplification logic to only work with
authorChandler Carruth <chandlerc@gmail.com>
Sun, 25 Mar 2012 20:43:07 +0000 (20:43 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 25 Mar 2012 20:43:07 +0000 (20:43 +0000)
commit9d9e29b4a83818b066c09c8f832cec7641aa2115
treecba92b550738be6765b9571bba387862602a9e0a
parent805853bc59ecdae1746473d2b4178e9275a1b997
Switch the pointer-difference simplification logic to only work with
inbounds GEPs. This isn't really necessary for simplifying pointer
differences, but I'm planning to re-use the same code to simplify
pointer comparisons where it is necessary. Since real code almost
exclusively uses inbounds GEPs, it doesn't seem worth it to support the
extra complexity of turning it on and off. If anyone would like that
back, feel free to shout. Note that instcombine will still catch any of
these patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153418 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/ptr_diff.ll