aco: fix copy of uninitialized boolean
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 3 Apr 2020 16:44:47 +0000 (17:44 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jul 2020 19:38:43 +0000 (19:38 +0000)
This should be harmless but UBSan seems to complain.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6013>

src/amd/compiler/aco_insert_waitcnt.cpp

index 196b45fbb75c071c43826e6cd7f9b30ccbee5438..aedcad1b57384a3158513bfca3933f9b2d3aaa6e 100644 (file)
@@ -293,7 +293,8 @@ struct wait_ctx {
              max_exp_cnt(6),
              max_lgkm_cnt(program_->chip_class >= GFX10 ? 62 : 14),
              max_vs_cnt(program_->chip_class >= GFX10 ? 62 : 0),
-             unordered_events(event_smem | (program_->chip_class < GFX10 ? event_flat : 0)) {}
+             unordered_events(event_smem | (program_->chip_class < GFX10 ? event_flat : 0)),
+             collect_statistics(program_->collect_statistics) {}
 
    bool join(const wait_ctx* other, bool logical)
    {
@@ -847,8 +848,6 @@ void handle_block(Program *program, Block& block, wait_ctx& ctx)
 
    wait_imm queued_imm;
 
-   ctx.collect_statistics = program->collect_statistics;
-
    for (aco_ptr<Instruction>& instr : block.instructions) {
       bool is_wait = !parse_wait_instr(ctx, instr.get()).empty();