[Split GEP] handle trunc() in separate-const-offset-from-gep pass.
authorArtem Belevich <tra@google.com>
Fri, 11 May 2018 21:13:19 +0000 (21:13 +0000)
committerArtem Belevich <tra@google.com>
Fri, 11 May 2018 21:13:19 +0000 (21:13 +0000)
commitc2cd5d5ce053b49c1a75216a8e9c7b4f298319ad
treefe4cdac48ccc2013e5052da5b6b206d9c3963ec7
parentf108a8fee10fb189faff4b2edbecbec8b6322a58
[Split GEP] handle trunc() in separate-const-offset-from-gep pass.

Let separate-const-offset-from-gep pass handle trunc() when it calculates
constant offset relative to base. The pass itself may insert trunc()
instructions when it canonicalises array indices to pointer-size integers
and needs to handle trunc() in order to evaluate the offset.

Differential Revision: https://reviews.llvm.org/D46732

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