[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)
commit71fe4f0197dd6bcfd476a96d1cc65e119124009a
treeca78e3bf982dd040e351d7a1ff193dfe50fc6557
parent1f79facb0654ee4e2b9a8e6bc86847c5a7d2bd69
[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.

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