summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-02-13 13:16:26 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-02-13 13:16:26 +0000
commitbe0dd72620c3c7a6679727c68539f5a54660da2c (patch)
tree808e40bcc0dbf1a0dd1cfc813b664b0d43ea514f /llvm/lib/Transforms
parent6c69732c05ca107451f6279ddd4c509201fbe37e (diff)
downloadbcm5719-llvm-be0dd72620c3c7a6679727c68539f5a54660da2c.tar.gz
bcm5719-llvm-be0dd72620c3c7a6679727c68539f5a54660da2c.zip
[InstCombine] Simplify getLogBase2 case for scalar/splats. NFCI.
llvm-svn: 325003
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index b1cad6ba009..7654c34cc4c 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -102,9 +102,8 @@ static Value *simplifyValueKnownNonZero(Value *V, InstCombiner &IC,
/// Return a null pointer otherwise.
static Constant *getLogBase2(Type *Ty, Constant *C) {
const APInt *IVal;
- if (const auto *CI = dyn_cast<ConstantInt>(C))
- if (match(CI, m_APInt(IVal)) && IVal->isPowerOf2())
- return ConstantInt::get(Ty, IVal->logBase2());
+ if (match(C, m_APInt(IVal)) && IVal->isPowerOf2())
+ return ConstantInt::get(Ty, IVal->logBase2());
if (!Ty->isVectorTy())
return nullptr;
OpenPOWER on IntegriCloud