OSDN Git Service

[APInt] In operator!, handle single word case by comparing VAL to 0 directly and...
authorCraig Topper <craig.topper@gmail.com>
Mon, 1 May 2017 21:56:05 +0000 (21:56 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 1 May 2017 21:56:05 +0000 (21:56 +0000)
commit4d051558e484ab270d87635842802c6cecb6212c
tree41fe7412bbf9598f115d5f64b226f07317834843
parentb4e4acec445e65c774607f571c88b6f123831df6
[APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.

We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301842 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/APInt.h