diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-29 17:46:13 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-29 17:46:13 +0000 |
commit | 335597f31b7359b17a9429f049589226db523398 (patch) | |
tree | 9e7614b4aee0718525ceb2ef0e3ced140c64bbcd /llvm/lib | |
parent | 685327dd99fbbc08c9243ca41e874eccf31778e4 (diff) | |
download | bcm5719-llvm-335597f31b7359b17a9429f049589226db523398.tar.gz bcm5719-llvm-335597f31b7359b17a9429f049589226db523398.zip |
[ConstantRange] Replace getMaxValue+zext with getLowBitsSet. Replace zero-init+setBit with getOneBitSet. NFC
llvm-svn: 301752
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/ConstantRange.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp index 754844e371a..8b595a69ad3 100644 --- a/llvm/lib/IR/ConstantRange.cpp +++ b/llvm/lib/IR/ConstantRange.cpp @@ -569,9 +569,8 @@ ConstantRange ConstantRange::truncate(uint32_t DstTySize) const { if (isFullSet()) return ConstantRange(DstTySize, /*isFullSet=*/true); - APInt MaxValue = APInt::getMaxValue(DstTySize).zext(getBitWidth()); - APInt MaxBitValue(getBitWidth(), 0); - MaxBitValue.setBit(DstTySize); + APInt MaxValue = APInt::getLowBitsSet(getBitWidth(), DstTySize); + APInt MaxBitValue = APInt::getOneBitSet(getBitWidth(), DstTySize); APInt LowerDiv(Lower), UpperDiv(Upper); ConstantRange Union(DstTySize, /*isFullSet=*/false); |