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)
commit438ffe5eac02270208529d29330eef76991af70f
tree136d17171c98fd25ffefd3822289642b765c442f
parent42b0148a49586d422d6600b4d4759f483d3b0958
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.

llvm-svn: 244684
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
llvm/test/CodeGen/NVPTX/bypass-div.ll [new file with mode: 0644]