summaryrefslogtreecommitdiff
path: root/src/amd/compiler/aco_builder_h.py
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2019-10-15 17:25:57 +0100
committerMarge Bot <eric+marge@anholt.net>2020-07-21 18:25:35 +0000
commit2694a34aa2c32aeb32d7d70af91db56c6eaaa23b (patch)
treea095a984b49cd46ceaffc2f3946752eda825075c /src/amd/compiler/aco_builder_h.py
parent3a4847179b95d1f2a03e575ef9f0e5c71631de65 (diff)
downloadmesa-2694a34aa2c32aeb32d7d70af91db56c6eaaa23b.tar.gz
aco: add NUW flag
This (combined with a pass to actually set the corresponding NIR flags) should help fix a lot of the regressions from the SMEM addition combining change. fossil-db (Navi): Totals from 12 (0.01% of 135946) affected shaders: CodeSize: 12376 -> 12304 (-0.58%) Instrs: 2436 -> 2422 (-0.57%) VMEM: 1105 -> 1096 (-0.81%) SClause: 133 -> 130 (-2.26%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2720>
Diffstat (limited to 'src/amd/compiler/aco_builder_h.py')
-rw-r--r--src/amd/compiler/aco_builder_h.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_builder_h.py b/src/amd/compiler/aco_builder_h.py
index e10358a1cc3..b3adb14dc8e 100644
--- a/src/amd/compiler/aco_builder_h.py
+++ b/src/amd/compiler/aco_builder_h.py
@@ -176,6 +176,7 @@ public:
std::vector<aco_ptr<Instruction>> *instructions;
std::vector<aco_ptr<Instruction>>::iterator it;
bool is_precise = false;
+ bool is_nuw = false;
Builder(Program *pgm) : program(pgm), use_iterator(false), start(false), lm(pgm->lane_mask), instructions(NULL) {}
Builder(Program *pgm, Block *block) : program(pgm), use_iterator(false), start(false), lm(pgm ? pgm->lane_mask : s2), instructions(&block->instructions) {}
@@ -187,6 +188,12 @@ public:
return res;
};
+ Builder nuw() const {
+ Builder res = *this;
+ res.is_nuw = true;
+ return res;
+ }
+
void moveEnd(Block *block) {
instructions = &block->instructions;
}
@@ -572,6 +579,7 @@ formats = [(f if len(f) == 5 else f + ('',)) for f in formats]
% for i in range(num_definitions):
instr->definitions[${i}] = def${i};
instr->definitions[${i}].setPrecise(is_precise);
+ instr->definitions[${i}].setNUW(is_nuw);
% endfor
% for i in range(num_operands):
instr->operands[${i}] = op${i}.op;