diff options
author | Craig Topper <craig.topper@intel.com> | 2017-09-20 18:49:29 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-09-20 18:49:29 +0000 |
commit | a0c897f634d5fc7916a66acdf686af0b92f28617 (patch) | |
tree | c00ac4e4c85c19d5b3d309b61de9f7b80dbbc9bd /llvm/lib | |
parent | 432b88e5f45aa69f63d73a7e86a0b330d955e98c (diff) | |
download | bcm5719-llvm-a0c897f634d5fc7916a66acdf686af0b92f28617.tar.gz bcm5719-llvm-a0c897f634d5fc7916a66acdf686af0b92f28617.zip |
[InstCombine] Use APInt::getActiveBits() to avoid creating an APInt from a trailing zero count to do a comparison. NFCI
llvm-svn: 313792
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index b51d7bc4034..980519bcf9c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1718,7 +1718,7 @@ Instruction *InstCombiner::foldICmpAndConstConst(ICmpInst &Cmp, // result greater than C1. unsigned NumTZ = C2->countTrailingZeros(); if (Cmp.getPredicate() == ICmpInst::ICMP_UGT && NumTZ < C2->getBitWidth() && - APInt::getOneBitSet(C2->getBitWidth(), NumTZ).ugt(*C1)) { + NumTZ >= C1->getActiveBits()) { Constant *Zero = Constant::getNullValue(And->getType()); return new ICmpInst(ICmpInst::ICMP_NE, And, Zero); } |