Mesa (master): aco: don't CSE v_readlane_b32/v_readfirstlane_b32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 26 12:46:43 UTC 2019


Module: Mesa
Branch: master
Commit: 86ecf92c23ccd4a5493a27104e9c85b8fa41f3a3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=86ecf92c23ccd4a5493a27104e9c85b8fa41f3a3

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Sat Sep 21 16:00:45 2019 +0100

aco: don't CSE v_readlane_b32/v_readfirstlane_b32

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>

---

 src/amd/compiler/aco_opt_value_numbering.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/compiler/aco_opt_value_numbering.cpp b/src/amd/compiler/aco_opt_value_numbering.cpp
index 8071ace1f97..100537fd47a 100644
--- a/src/amd/compiler/aco_opt_value_numbering.cpp
+++ b/src/amd/compiler/aco_opt_value_numbering.cpp
@@ -82,6 +82,10 @@ struct InstrPred {
          return false;
       if (a->operands.size() != b->operands.size() || a->definitions.size() != b->definitions.size())
          return false; /* possible with pseudo-instructions */
+      /* We can't value number v_readlane_b32 across control flow or discards
+       * because of the possibility of live-range splits. */
+      if (a->opcode == aco_opcode::v_readfirstlane_b32 || a->opcode == aco_opcode::v_readlane_b32)
+         return false;
       for (unsigned i = 0; i < a->operands.size(); i++) {
          if (a->operands[i].isConstant()) {
             if (!b->operands[i].isConstant())




More information about the mesa-commit mailing list