Mesa (staging/21.0): intel/fs/vec4: add missing dependency in write-on-write fixed GRFs
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Mar 18 16:39:24 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: b442f8cb7bc8b0be347eace65fc6c8e15b0f7d7e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b442f8cb7bc8b0be347eace65fc6c8e15b0f7d7e
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Wed Mar 17 21:30:52 2021 +0200
intel/fs/vec4: add missing dependency in write-on-write fixed GRFs
If we load constant data using pull constant SENDS, and we later load
that register with some other data, we can end up in a situation where
we don't track the initial fixed register write and therefore end up
using uninitialized registers.
This tracks write-on-write of fixed GRFs like we do for normal virtual
GRFs.
v2: Fix post_alloc_reg case (Jason)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9667>
(cherry picked from commit 8b6d22109f452b05ab1ce2028f7e18e50edcf325)
---
.pick_status.json | 2 +-
src/intel/compiler/brw_schedule_instructions.cpp | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index a0706f3dbc2..3f78c79a9e3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -373,7 +373,7 @@
"description": "intel/fs/vec4: add missing dependency in write-on-write fixed GRFs",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/intel/compiler/brw_schedule_instructions.cpp b/src/intel/compiler/brw_schedule_instructions.cpp
index 6207059dc82..dcef08ac041 100644
--- a/src/intel/compiler/brw_schedule_instructions.cpp
+++ b/src/intel/compiler/brw_schedule_instructions.cpp
@@ -1198,9 +1198,12 @@ fs_instruction_scheduler::calculate_deps()
}
} else if (inst->dst.file == FIXED_GRF) {
if (post_reg_alloc) {
- for (unsigned r = 0; r < regs_written(inst); r++)
+ for (unsigned r = 0; r < regs_written(inst); r++) {
+ add_dep(last_grf_write[inst->dst.nr + r], n);
last_grf_write[inst->dst.nr + r] = n;
+ }
} else {
+ add_dep(last_fixed_grf_write, n);
last_fixed_grf_write = n;
}
} else if (inst->dst.is_accumulator()) {
@@ -1428,6 +1431,7 @@ vec4_instruction_scheduler::calculate_deps()
add_dep(last_mrf_write[inst->dst.nr], n);
last_mrf_write[inst->dst.nr] = n;
} else if (inst->dst.file == FIXED_GRF) {
+ add_dep(last_fixed_grf_write, n);
last_fixed_grf_write = n;
} else if (inst->dst.is_accumulator()) {
add_dep(last_accumulator_write, n);
More information about the mesa-commit
mailing list