Mesa (master): aco: don't value-number instructions from within a loop with ones after the loop.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 26 16:05:16 UTC 2019


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Nov 26 15:28:54 2019 +0100

aco: don't value-number instructions from within a loop with ones after the loop.

Fixes:
Wolfenstein:Youngblood (w/o shader_ballot)
dEQP-VK.descriptor_indexing.combined_image_sampler_in_loop_with_lod

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>

---

 src/amd/compiler/aco_opt_value_numbering.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_opt_value_numbering.cpp b/src/amd/compiler/aco_opt_value_numbering.cpp
index 40823da3c36..6b4eaa8b5f0 100644
--- a/src/amd/compiler/aco_opt_value_numbering.cpp
+++ b/src/amd/compiler/aco_opt_value_numbering.cpp
@@ -256,9 +256,14 @@ struct vn_ctx {
    vn_ctx(Program* program) : program(program) {}
 };
 
+
+/* dominates() returns true if the parent block dominates the child block and
+ * if the parent block is part of the same loop or has a smaller loop nest depth.
+ */
 bool dominates(vn_ctx& ctx, uint32_t parent, uint32_t child)
 {
-   while (parent < child)
+   unsigned parent_loop_nest_depth = ctx.program->blocks[parent].loop_nest_depth;
+   while (parent < child && parent_loop_nest_depth <= ctx.program->blocks[child].loop_nest_depth)
       child = ctx.program->blocks[child].logical_idom;
 
    return parent == child;




More information about the mesa-commit mailing list