[2/2] nir: Remove unused variable unroll_loc

Submitted by Alyssa Rosenzweig on March 12, 2019, 2:30 a.m.

Details

Message ID 20190312023051.11402-2-alyssa@rosenzweig.io
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig March 12, 2019, 2:30 a.m.
Fixes a gcc warning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 src/compiler/nir/nir_opt_loop_unroll.c | 4 ----
 1 file changed, 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c
index 9ab0a924c82..41f7a834164 100644
--- a/src/compiler/nir/nir_opt_loop_unroll.c
+++ b/src/compiler/nir/nir_opt_loop_unroll.c
@@ -488,12 +488,8 @@  complex_unroll_single_terminator(nir_loop *loop)
     * vars for the last iteration (they are inside the following ifs break
     * branch). We leave other passes to clean up this redundant if.
     */
-   unsigned num_times_to_clone = loop->info->max_trip_count + 1;
 
    nir_cf_list lp_body;
-   nir_cf_node *unroll_loc =
-      complex_unroll_loop_body(loop, terminator, &lp_header, &lp_body,
-                               remap_table, num_times_to_clone);
 
    /* Delete the original loop header and body */
    nir_cf_delete(&lp_header);

Comments

On 12/3/19 1:30 pm, Alyssa Rosenzweig wrote:
> Fixes a gcc warning.
> 
> Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
> ---
>   src/compiler/nir/nir_opt_loop_unroll.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c
> index 9ab0a924c82..41f7a834164 100644
> --- a/src/compiler/nir/nir_opt_loop_unroll.c
> +++ b/src/compiler/nir/nir_opt_loop_unroll.c
> @@ -488,12 +488,8 @@ complex_unroll_single_terminator(nir_loop *loop)
>       * vars for the last iteration (they are inside the following ifs break
>       * branch). We leave other passes to clean up this redundant if.
>       */
> -   unsigned num_times_to_clone = loop->info->max_trip_count + 1;
>   
>      nir_cf_list lp_body;
> -   nir_cf_node *unroll_loc =
> -      complex_unroll_loop_body(loop, terminator, &lp_header, &lp_body,
> -                               remap_table, num_times_to_clone);

A better fix might be to delete the Mesa src tree, that should fix up 
any warnings :P

I can only assume this was sent out by mistake?

>   
>      /* Delete the original loop header and body */
>      nir_cf_delete(&lp_header);
>
> A better fix might be to delete the Mesa src tree, that should fix up any
> warnings :P

Huh, so it does!

No regressions on dEQP, possibly since all the tests were failing to
begin with on Panfrost.

> I can only assume this was sent out by mistake?

This was sent out by "I don't know what I'm doing but there was a
warning so I thought I'd nudge someone who knows".

I guess really the RHS should still be evaluated and just not stored
anywhere?
On 12/3/19 2:09 pm, Alyssa Rosenzweig wrote:
>> A better fix might be to delete the Mesa src tree, that should fix up any
>> warnings :P
> 
> Huh, so it does!
> 
> No regressions on dEQP, possibly since all the tests were failing to
> begin with on Panfrost.
> 
>> I can only assume this was sent out by mistake?
> 
> This was sent out by "I don't know what I'm doing but there was a
> warning so I thought I'd nudge someone who knows".

:)

> 
> I guess really the RHS should still be evaluated and just not stored
> anywhere?
> 

The value is evaluated but only in debug builds. The correct fix is to 
use MAYBE_UNUSED see [1]

[1] https://patchwork.freedesktop.org/patch/291616/
> [1] https://patchwork.freedesktop.org/patch/291616/

Ah-ha, somebody who knows what they're doing. That's good; ignore this
series then :)

---

So is this a "no" for the deleting ~/mesa/src idea?
On March 11, 2019 22:17:38 Alyssa Rosenzweig <alyssa@rosenzweig.io> wrote:

>> [1] https://patchwork.freedesktop.org/patch/291616/
>
> Ah-ha, somebody who knows what they're doing. That's good; ignore this
> series then :)

The first patch was fine. Just not the second.

> ---
>
>
> So is this a "no" for the deleting ~/mesa/src idea?
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> The first patch was fine. Just not the second.

First patch is a duplicate of the linked patch.