aco: error when block has no logical preds but VGPRs are live at the start
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 8 Jan 2020 16:13:03 +0000 (16:13 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Jan 2020 18:02:27 +0000 (18:02 +0000)
This would have caught the liveness error fixed in the previous commit.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257>

src/amd/compiler/aco_live_var_analysis.cpp

index c00325b92b7184886d821f9ae71ce7a7e475ed8c..1f02e67bc1ab49056b0e5423344cd04574e3eca2 100644 (file)
@@ -220,7 +220,8 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
       phi_idx--;
    }
 
-   if (!(block->index != 0 || (live_vgprs.empty() && live_sgprs.empty()))) {
+   if ((block->logical_preds.empty() && !live_vgprs.empty()) ||
+       (block->linear_preds.empty() && !live_sgprs.empty())) {
       aco_print_program(program, stderr);
       fprintf(stderr, "These temporaries are never defined or are defined after use:\n");
       for (Temp vgpr : live_vgprs)