[APInt] Add early outs for a division by 1 to udiv/urem/udivrem
authorCraig Topper <craig.topper@gmail.com>
Fri, 12 May 2017 21:45:50 +0000 (21:45 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 12 May 2017 21:45:50 +0000 (21:45 +0000)
commitb1a71cac4bd5798b9ebc106ef886f46eb4ae648a
tree63dfcc5ad30d0a0ec3498f3626aeab00b71f679b
parent2579c7c69f08330951d947c51f6f6938f0fdc737
[APInt] Add early outs for a division by 1 to udiv/urem/udivrem

We already counted the number of bits in the RHS so its pretty cheap to just check if the RHS is 1.

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

llvm-svn: 302953
llvm/lib/Support/APInt.cpp