1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

[InstCombine] Simplify getLogBase2 case for scalar/splats. NFCI.

llvm-svn: 325003
This commit is contained in:
Simon Pilgrim 2018-02-13 13:16:26 +00:00
parent 8156315329
commit ffe07d27cb

View File

@ -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;