diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-02-13 13:16:26 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-02-13 13:16:26 +0000 |
commit | be0dd72620c3c7a6679727c68539f5a54660da2c (patch) | |
tree | 808e40bcc0dbf1a0dd1cfc813b664b0d43ea514f /llvm/lib/Transforms | |
parent | 6c69732c05ca107451f6279ddd4c509201fbe37e (diff) | |
download | bcm5719-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.cpp | 5 |
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; |