[llvm] r324605 - Fix unused variable warning.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 09:36:50 PST 2018


if 'match' doesn't actually need the type of the first arg to be
ConstantInt, perhaps the dyn_cast should be an isa instead?

On Thu, Feb 8, 2018 at 6:26 AM Simon Pilgrim via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rksimon
> Date: Thu Feb  8 06:24:26 2018
> New Revision: 324605
>
> URL: http://llvm.org/viewvc/llvm-project?rev=324605&view=rev
> Log:
> Fix unused variable warning.
>
> Modified:
>     llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
>
> Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp?rev=324605&r1=324604&r2=324605&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
> (original)
> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp Thu
> Feb  8 06:24:26 2018
> @@ -138,7 +138,7 @@ static bool IsMultiple(const APInt &C1,
>  static Constant *getLogBase2(Type *Ty, Constant *C) {
>    const APInt *IVal;
>    if (const auto *CI = dyn_cast<ConstantInt>(C))
> -    if (match(C, m_APInt(IVal)) && IVal->isPowerOf2())
> +    if (match(CI, m_APInt(IVal)) && IVal->isPowerOf2())
>        return ConstantInt::get(Ty, IVal->logBase2());
>
>    if (!Ty->isVectorTy())
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180212/995681ed/attachment.html>


More information about the llvm-commits mailing list