Use 32-bit divides instead of 64-bit divides where possible.
authorMark Heffernan <meheff@google.com>
Tue, 11 Aug 2015 22:16:34 +0000 (22:16 +0000)
committerMark Heffernan <meheff@google.com>
Tue, 11 Aug 2015 22:16:34 +0000 (22:16 +0000)
commit67278b1774c364930a0cb834100dfda12c6c080a
tree5212fe6b2fc0f884689a6532a9734c1c969b8aab
parentbbf32bd275fb1ab0a18824924437de5966f73832
Use 32-bit divides instead of 64-bit divides where possible.

For NVPTX, try to use 32-bit division instead of 64-bit division when the dividend and divisor
fit in 32 bits. This speeds up some internal benchmarks significantly. The underlying reason
is that many index computations are carried out in 64-bits but never actually exceed the
capacity of a 32-bit word.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244684 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/NVPTX/NVPTXISelLowering.cpp
test/CodeGen/NVPTX/bypass-div.ll [new file with mode: 0644]