[llvm] r238094 - Fix an unused variable warning in release builds.

Justin Bogner mail at justinbogner.com
Sat May 23 22:17:12 PDT 2015


Craig Topper <craig.topper at gmail.com> writes:
> Author: ctopper
> Date: Sat May 23 03:20:33 2015
> New Revision: 238094
>
> URL: http://llvm.org/viewvc/llvm-project?rev=238094&view=rev
> Log:
> Fix an unused variable warning in release builds.
>
> Modified:
>     llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=238094&r1=238093&r2=238094&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sat May 23 03:20:33 2015
> @@ -4847,6 +4847,7 @@ LSRInstance::LSRInstance(Loop *L, Pass *
>    unsigned NumUsers = 0;
>    for (const IVStrideUse &U : IU) {
>      if (++NumUsers > MaxIVUsers) {
> +      (void)U;

This warning seems like a bit of a false positive - we're iterating for
effect here. Is this clang or other compilers warning? Should we file a
bug that it isn't useful to warn on this?

>        DEBUG(dbgs() << "LSR skipping loop, too many IV Users in " << U << "\n");
>        return;
>      }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list