Mesa (master): nir/copy_prop: use nir_{instr,if}_rewrite_{src,condition}_ssa

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 1 18:09:37 UTC 2021


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Fri Jan 29 17:42:36 2021 +0000

nir/copy_prop: use nir_{instr,if}_rewrite_{src,condition}_ssa

Compile-time (nir_copy_prop):
Difference at 95.0% confidence
	-2470.88 +/- 19.8762
	-35.7461% +/- 0.247259%
	(Student's t, pooled s = 23.4747)

Compile-time (overall):
Difference at 95.0% confidence
	-2175.72 +/- 178.786
	-1.73627% +/- 0.140826%
	(Student's t, pooled s = 211.155)

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8784>

---

 src/compiler/nir/nir_opt_copy_propagate.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/compiler/nir/nir_opt_copy_propagate.c b/src/compiler/nir/nir_opt_copy_propagate.c
index bba4ed94c86..757facccb9c 100644
--- a/src/compiler/nir/nir_opt_copy_propagate.c
+++ b/src/compiler/nir/nir_opt_copy_propagate.c
@@ -127,7 +127,7 @@ copy_propagate_alu(nir_function_impl *impl, nir_alu_src *src, nir_alu_instr *cop
          src->swizzle[i] = copy->src[src->swizzle[i]].swizzle[0];
    }
 
-   nir_instr_rewrite_src(&user->instr, &src->src, nir_src_for_ssa(def));
+   nir_instr_rewrite_src_ssa(src->src.parent_instr, &src->src, def);
 
    return true;
 }
@@ -138,7 +138,7 @@ copy_propagate(nir_src *src, nir_alu_instr *copy)
    if (!is_swizzleless_move(copy))
       return false;
 
-   nir_instr_rewrite_src(src->parent_instr, src, nir_src_for_ssa(copy->src[0].src.ssa));
+   nir_instr_rewrite_src_ssa(src->parent_instr, src, copy->src[0].src.ssa);
 
    return true;
 }
@@ -149,8 +149,7 @@ copy_propagate_if(nir_src *src, nir_alu_instr *copy)
    if (!is_swizzleless_move(copy))
       return false;
 
-   nir_if *parent_if = container_of(src, nir_if, condition);
-   nir_if_rewrite_condition(parent_if, nir_src_for_ssa(copy->src[0].src.ssa));
+   nir_if_rewrite_condition_ssa(src->parent_if, src, copy->src[0].src.ssa);
 
    return true;
 }



More information about the mesa-commit mailing list