[llvm] 509fba7 - [llvm] Fix unused variable in non-debug configurations

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 15:38:29 PDT 2020


Could you roll the definition of TC into the use here in the LLVM_DEBUG -
it's the only place TC is used, and also removes the shadowing of TC in the
previous if block - makes the code easier to maintain, now if the
LLVM_DEBUG Is removed there's no leftover cleanup required to remove "TC".

On Mon, Sep 28, 2020 at 8:04 AM Tres Popp via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Tres Popp
> Date: 2020-09-28T17:04:08+02:00
> New Revision: 509fba75dff2382b867f5962e02fb0a899a5fa18
>
> URL:
> https://github.com/llvm/llvm-project/commit/509fba75dff2382b867f5962e02fb0a899a5fa18
> DIFF:
> https://github.com/llvm/llvm-project/commit/509fba75dff2382b867f5962e02fb0a899a5fa18.diff
>
> LOG: [llvm] Fix unused variable in non-debug configurations
>
> Added:
>
>
> Modified:
>     llvm/lib/Target/ARM/MVETailPredication.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Target/ARM/MVETailPredication.cpp
> b/llvm/lib/Target/ARM/MVETailPredication.cpp
> index a42f67e97aea..f01f485859b0 100644
> --- a/llvm/lib/Target/ARM/MVETailPredication.cpp
> +++ b/llvm/lib/Target/ARM/MVETailPredication.cpp
> @@ -435,6 +435,8 @@ bool
> MVETailPredication::IsSafeActiveMask(IntrinsicInst *ActiveLaneMask,
>      // Ceil = ElementCount + (VW-1) / VW
>      auto *Ceil = SE->getUDivExpr(ECPlusVWMinus1, VW);
>
> +    // Prevent unused variable warnings with TC
> +    (void)TC;
>      LLVM_DEBUG(
>        dbgs() << "ARM TP: Analysing overflow behaviour for:\n";
>        dbgs() << "ARM TP: - TripCount = "; TC->dump();
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://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/20200928/d4a0ac6a/attachment.html>


More information about the llvm-commits mailing list