projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64acc57
)
Handle more cases in APInt::getLowBitsSet's fast path.
author
Benjamin Kramer
<benny.kra@googlemail.com>
Mon, 28 Nov 2011 16:56:38 +0000
(16:56 +0000)
committer
Benjamin Kramer
<benny.kra@googlemail.com>
Mon, 28 Nov 2011 16:56:38 +0000
(16:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145249
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/APInt.h
b/include/llvm/ADT/APInt.h
index 707e0dbb6b91e5fd5ef821620d652c926e64d571..78119bce2ac4a64b545145cb6bddd307fa4b54ab 100644
(file)
--- a/
include/llvm/ADT/APInt.h
+++ b/
include/llvm/ADT/APInt.h
@@
-497,8
+497,8
@@
public:
if (loBitsSet == APINT_BITS_PER_WORD)
return APInt(numBits, -1ULL);
// For small values, return quickly.
- if (
numBits <
APINT_BITS_PER_WORD)
- return APInt(numBits,
(1ULL << loBitsSet) - 1
);
+ if (
loBitsSet <=
APINT_BITS_PER_WORD)
+ return APInt(numBits,
-1ULL >> (APINT_BITS_PER_WORD - loBitsSet)
);
return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
}