[SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo
authorJingyue Wu <jingyue@google.com>
Sat, 25 Oct 2014 18:34:03 +0000 (18:34 +0000)
committerJingyue Wu <jingyue@google.com>
Sat, 25 Oct 2014 18:34:03 +0000 (18:34 +0000)
commitfe72fcebf697e18af1f8cfbc7a23761045897d9b
tree85d955abaa1b862f9c146529a3a2aa2e32883ce9
parentaa139573f69cf84dd3fa6e034149e10e9c0c1c6c
[SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo

The dividend in "signed % unsigned" is treated as unsigned instead of signed,
causing unexpected behavior such as -64 % (uint64_t)24 == 0.

Added a regression test in split-gep.ll

Patched by Hao Liu.

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