[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)
commit5c7b1aed5db9749f0af83320dcb2bc3d412e1821
tree59dcbcfb0485b594f4ab4e014e01130120ff8037
parent2d173b5302889fa5ca7d3093f164814a3363283e
[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

llvm-svn: 210444
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll
llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll