From a5a40beefaf82a822d3c10c32563c09b9a42755f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 6 Feb 2022 13:37:37 +0100 Subject: [PATCH] aco: don't emit WQM for bool_to_scalar_condition This was only necessary to ensure that the source is computed in WQM if the current exec mask is in WQM. Totals from 23170 (17.17% of 134913) affected shaders: (GFX10.3) VGPRs: 1384464 -> 1383400 (-0.08%); split: -0.08%, +0.01% SpillSGPRs: 7575 -> 7574 (-0.01%) CodeSize: 146444752 -> 146317104 (-0.09%); split: -0.13%, +0.04% MaxWaves: 429870 -> 429868 (-0.00%) Instrs: 27202586 -> 27170316 (-0.12%); split: -0.17%, +0.05% Latency: 379488313 -> 379335412 (-0.04%); split: -0.07%, +0.03% InvThroughput: 69500561 -> 69487704 (-0.02%); split: -0.03%, +0.01% VClause: 473080 -> 473038 (-0.01%); split: -0.02%, +0.01% SClause: 1080576 -> 1080571 (-0.00%); split: -0.06%, +0.06% Copies: 1492865 -> 1504604 (+0.79%); split: -0.40%, +1.19% Branches: 711295 -> 716849 (+0.78%); split: -0.01%, +0.79% PreSGPRs: 1331362 -> 1328402 (-0.22%) Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index b8b64fc1a00..b6de2c7d3b8 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -611,9 +611,8 @@ bool_to_scalar_condition(isel_context* ctx, Temp val, Temp dst = Temp(0, s1)) assert(dst.regClass() == s1); /* if we're currently in WQM mode, ensure that the source is also computed in WQM */ - Temp tmp = bld.tmp(s1); - bld.sop2(Builder::s_and, bld.def(bld.lm), bld.scc(Definition(tmp)), val, Operand(exec, bld.lm)); - return emit_wqm(bld, tmp, dst); + bld.sop2(Builder::s_and, bld.def(bld.lm), bld.scc(Definition(dst)), val, Operand(exec, bld.lm)); + return dst; } /**