summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2021-01-27 14:04:10 +0000
committerDylan Baker <dylan.c.baker@intel.com>2021-02-10 15:11:02 -0800
commitbb2aea8ded661a0481e5845689870a5cddb07937 (patch)
tree939bdf78b3fdf793ae60eb033911ea21e30c5de2
parent00b62f387c7977d9fcbc8222f2ca83d47041d4f5 (diff)
aco: always set exec_live=false
Register demand calculation for exec masks doesn't always match get_live_changes() and get_temp_registers(). For now, just set exec_live=false. fossil-db (GFX10.3): Totals from 108230 (77.64% of 139391) affected shaders: SGPRs: 5759658 -> 5756818 (-0.05%); split: -0.08%, +0.03% VGPRs: 4061104 -> 4061248 (+0.00%); split: -0.00%, +0.01% SpillSGPRs: 14114 -> 15198 (+7.68%); split: -0.10%, +7.78% CodeSize: 266548396 -> 266603288 (+0.02%); split: -0.01%, +0.03% MaxWaves: 1390885 -> 1390855 (-0.00%); split: +0.00%, -0.00% Instrs: 50983353 -> 50992972 (+0.02%); split: -0.02%, +0.04% Cycles: 1733042048 -> 1735443264 (+0.14%); split: -0.02%, +0.16% VMEM: 41933625 -> 41914722 (-0.05%); split: +0.04%, -0.09% SMEM: 7197675 -> 7197789 (+0.00%); split: +0.16%, -0.16% VClause: 1050885 -> 1050978 (+0.01%); split: -0.02%, +0.03% SClause: 2074913 -> 2071844 (-0.15%); split: -0.23%, +0.08% Copies: 3181464 -> 3188125 (+0.21%); split: -0.38%, +0.59% Branches: 1127526 -> 1127716 (+0.02%); split: -0.10%, +0.12% PreSGPRs: 3376687 -> 3586076 (+6.20%); split: -0.00%, +6.20% PreVGPRs: 3339740 -> 3339811 (+0.00%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8807> (cherry picked from commit d1f93261b17d73eceb16b7081000b5bb8f6608f2)
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/compiler/aco_live_var_analysis.cpp21
2 files changed, 2 insertions, 21 deletions
diff --git a/.pick_status.json b/.pick_status.json
index fd4af7035a8..45f0153d665 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2227,7 +2227,7 @@
"description": "aco: always set exec_live=false",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/amd/compiler/aco_live_var_analysis.cpp b/src/amd/compiler/aco_live_var_analysis.cpp
index bc713a1a188..44f47cab118 100644
--- a/src/amd/compiler/aco_live_var_analysis.cpp
+++ b/src/amd/compiler/aco_live_var_analysis.cpp
@@ -91,13 +91,6 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
block->register_demand = RegisterDemand();
IDSet live = lives.live_out[block->index];
- /* add the live_out_exec to live */
- bool exec_live = false;
- if (block->live_out_exec != Temp()) {
- live.insert(block->live_out_exec.id());
- exec_live = true;
- }
-
/* initialize register demand */
for (unsigned t : live)
new_demand += Temp(t, program->temp_rc[t]);
@@ -110,10 +103,7 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
if (is_phi(insn))
break;
- /* substract the 1 or 2 sgprs from exec */
- if (exec_live)
- assert(new_demand.sgpr >= (int16_t) program->lane_mask.size());
- register_demand[idx] = RegisterDemand(new_demand.vgpr, new_demand.sgpr - (exec_live ? program->lane_mask.size() : 0));
+ register_demand[idx] = RegisterDemand(new_demand.vgpr, new_demand.sgpr);
/* KILL */
for (Definition& definition : insn->definitions) {
@@ -133,9 +123,6 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
register_demand[idx] += temp;
definition.setKill(true);
}
-
- if (definition.isFixed() && definition.physReg() == exec)
- exec_live = false;
}
/* GEN */
@@ -169,9 +156,6 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
register_demand[idx] += temp;
new_demand += temp;
}
-
- if (operand.isFixed() && operand.physReg() == exec)
- exec_live = true;
}
}
@@ -179,9 +163,6 @@ void process_live_temps_per_block(Program *program, live& lives, Block* block,
}
/* update block's register demand for a last time */
- if (exec_live)
- assert(new_demand.sgpr >= (int16_t) program->lane_mask.size());
- new_demand.sgpr -= exec_live ? program->lane_mask.size() : 0;
block->register_demand.update(new_demand);
/* handle phi definitions */