From 9ebe893a61f30c2b1bb24e7870a2ba314356a4fd Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 30 Sep 2022 15:27:13 +0200 Subject: [PATCH] nir_lower_to_source_mods: Don't sneek in an abs modifier from parent If the abs source modifiers is not supported for the current instruction because it is an instruction with three sources we may still see a parent mov that has the `abs` modifier. In this case we must not propagate that abs modifier from that parent instructions. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7350 Fixes: cd73b6174b093b75f581c3310bf784bed7c74c1f nir/lower_to_source_mods: Stop turning add, sat, and neg into mov Signed-off-by: Gert Wollny Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir_lower_to_source_mods.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_to_source_mods.c b/src/compiler/nir/nir_lower_to_source_mods.c index b44189db5ab..fa84be0f053 100644 --- a/src/compiler/nir/nir_lower_to_source_mods.c +++ b/src/compiler/nir/nir_lower_to_source_mods.c @@ -106,7 +106,8 @@ nir_lower_to_source_mods_block(nir_block *block, continue; if (!lower_abs && (parent->op == nir_op_fabs || - parent->op == nir_op_iabs)) + parent->op == nir_op_iabs || + parent->src[0].abs)) continue; nir_instr_rewrite_src(instr, &alu->src[i].src, parent->src[0].src);