summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-04-20 16:56:25 +0000
committerCraig Topper <craig.topper@gmail.com>2017-04-20 16:56:25 +0000
commitbcfd2d1789e6709dfd585521ac599ae49091a6e8 (patch)
tree1b6909c06a2be947e3583c44ba16be0d8e5ee75f /llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp
parent20f2b01222a1e56b360a80d78a371fa063abfdbf (diff)
downloadbcm5719-llvm-bcfd2d1789e6709dfd585521ac599ae49091a6e8.tar.gz
bcm5719-llvm-bcfd2d1789e6709dfd585521ac599ae49091a6e8.zip
[APInt] Rename getSignBit to getSignMask
getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask. Differential Revision: https://reviews.llvm.org/D32108 llvm-svn: 300856
Diffstat (limited to 'llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp b/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp
index 60ae3745c83..9f4d9c7e398 100644
--- a/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp
+++ b/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp
@@ -73,17 +73,17 @@ bool llvm::decomposeBitTestICmp(const ICmpInst *I, CmpInst::Predicate &Pred,
default:
return false;
case ICmpInst::ICMP_SLT:
- // X < 0 is equivalent to (X & SignBit) != 0.
+ // X < 0 is equivalent to (X & SignMask) != 0.
if (!C->isZero())
return false;
- Y = ConstantInt::get(I->getContext(), APInt::getSignBit(C->getBitWidth()));
+ Y = ConstantInt::get(I->getContext(), APInt::getSignMask(C->getBitWidth()));
Pred = ICmpInst::ICMP_NE;
break;
case ICmpInst::ICMP_SGT:
- // X > -1 is equivalent to (X & SignBit) == 0.
+ // X > -1 is equivalent to (X & SignMask) == 0.
if (!C->isAllOnesValue())
return false;
- Y = ConstantInt::get(I->getContext(), APInt::getSignBit(C->getBitWidth()));
+ Y = ConstantInt::get(I->getContext(), APInt::getSignMask(C->getBitWidth()));
Pred = ICmpInst::ICMP_EQ;
break;
case ICmpInst::ICMP_ULT:
OpenPOWER on IntegriCloud