OSDN Git Service

aco: Don't skip combine_instruction when definitions[1] is used.
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 19 Nov 2019 12:38:34 +0000 (13:38 +0100)
committerTimur Kristóf <timur.kristof@gmail.com>
Tue, 14 Jan 2020 20:21:06 +0000 (21:21 +0100)
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_optimizer.cpp

index bf075b6..84c5e4b 100644 (file)
@@ -2150,7 +2150,7 @@ bool apply_omod_clamp(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
 
 void combine_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
 {
-   if (instr->definitions.empty() || !ctx.uses[instr->definitions[0].tempId()])
+   if (instr->definitions.empty() || is_dead(ctx.uses, instr.get()))
       return;
 
    if (instr->isVALU()) {