aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/ConstantRange.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-07-11 16:05:50 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-07-11 16:05:50 +0000
commit0a230e0d985625a3909cb78fd867a3abaf434565 (patch)
tree5781d89cdddab939dca31f5f5a62c2a1f825b22f /lib/Support/ConstantRange.cpp
parent1b3e3eef1fb51ace32b32e5ca217dacb03333b13 (diff)
downloadexternal_llvm-0a230e0d985625a3909cb78fd867a3abaf434565.zip
external_llvm-0a230e0d985625a3909cb78fd867a3abaf434565.tar.gz
external_llvm-0a230e0d985625a3909cb78fd867a3abaf434565.tar.bz2
Don't use a potentially expensive shift if all we want is one set bit.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/ConstantRange.cpp')
-rw-r--r--lib/Support/ConstantRange.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp
index d770381..bb38cd1 100644
--- a/lib/Support/ConstantRange.cpp
+++ b/lib/Support/ConstantRange.cpp
@@ -433,7 +433,7 @@ ConstantRange ConstantRange::zeroExtend(uint32_t DstTySize) const {
APInt LowerExt(DstTySize, 0);
if (!Upper) // special case: [X, 0) -- not really wrapping around
LowerExt = Lower.zext(DstTySize);
- return ConstantRange(LowerExt, APInt(DstTySize, 1).shl(SrcTySize));
+ return ConstantRange(LowerExt, APInt::getOneBitSet(DstTySize, SrcTySize));
}
return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize));