aco/optimizer: disallow can_eliminate_and_exec() with s_not

Totals from 295 (0.22% of 134913) affected shaders: (GFX10.3)
CodeSize: 1016564 -> 1016896 (+0.03%); split: -0.05%, +0.09%
Instrs: 187659 -> 187724 (+0.03%); split: -0.08%, +0.11%
Latency: 2839516 -> 2839541 (+0.00%); split: -0.01%, +0.01%
Copies: 12301 -> 12305 (+0.03%); split: -0.01%, +0.04%
PreSGPRs: 10266 -> 10268 (+0.02%)

Closes: #7024
Cc: mesa-stable
Tested-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18722>
(cherry picked from commit 98e3c446d8)
This commit is contained in:
Daniel Schürmann
2022-08-24 12:55:12 +02:00
committed by Dylan Baker
parent 6e4ff8b3a8
commit b133496b10
2 changed files with 6 additions and 6 deletions

View File

@@ -2740,7 +2740,7 @@
"description": "aco/optimizer: disallow can_eliminate_and_exec() with s_not",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -1215,12 +1215,12 @@ can_eliminate_and_exec(opt_ctx& ctx, Temp tmp, unsigned pass_flags)
}
if (ctx.info[tmp.id()].is_bitwise()) {
Instruction* instr = ctx.info[tmp.id()].instr;
if (instr->pass_flags != pass_flags)
if (instr->operands.size() != 2 || instr->pass_flags != pass_flags)
return false;
return std::all_of(
instr->operands.begin(), instr->operands.end(),
[&](const Operand& op)
{ return op.isTemp() && can_eliminate_and_exec(ctx, op.getTemp(), pass_flags); });
if (!(instr->operands[0].isTemp() && instr->operands[1].isTemp()))
return false;
return can_eliminate_and_exec(ctx, instr->operands[0].getTemp(), pass_flags) &&
can_eliminate_and_exec(ctx, instr->operands[1].getTemp(), pass_flags);
}
return false;
}