[SeparateConstOffsetFromGEP] inbounds zext => sext for better splitting
authorJingyue Wu <jingyue@google.com>
Sun, 8 Jun 2014 23:49:34 +0000 (23:49 +0000)
committerJingyue Wu <jingyue@google.com>
Sun, 8 Jun 2014 23:49:34 +0000 (23:49 +0000)
commit09d6a9040c9572056bb57a57d903fd397be07bb9
tree7e01ae95b387e26bdef256fa1c77022cd826e23d
parent66a3b9049bccbc09b8a578b07e2cad6cf131c32e
[SeparateConstOffsetFromGEP] inbounds zext => sext for better splitting

For each array index that is in the form of zext(a), convert it to sext(a)
if we can prove zext(a) <= max signed value of typeof(a). The conversion
helps to split zext(x + y) into sext(x) + sext(y).

Reviewed in http://reviews.llvm.org/D4060

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll
test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll