From 443854ecec97ae45f9bb7f31007dbc8b207dbbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 14 May 2021 15:33:02 +0200 Subject: [PATCH] radv: call nir_copy_prop() after load-store vectorization The load-store vectorizer can create a large amount of unnecessary nir_op_vec and nir_op_mov instructions. This prevents nir_opt_move from stalling to much and potentially also helps other passes. Closes: #4778 Fixes: 1958381c9ae15dc252bcab8612f39fdca45d4843 ('radv: Reorder some NIR optimizations in preparation for the I/O changes.') Reviewed-by: Rhys Perry Part-of: (cherry picked from commit b3eb87aa6547ba2921c1bf2553c6558f99d459c7) --- .pick_status.json | 2 +- src/amd/vulkan/radv_pipeline.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index fdfaecca0b9..b70b7cb6e20 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -112,7 +112,7 @@ "description": "radv: call nir_copy_prop() after load-store vectorization", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "1958381c9ae15dc252bcab8612f39fdca45d4843" }, diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index e8561b3a5f2..33b04955fb5 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3299,6 +3299,7 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_device *device, } if (nir_opt_load_store_vectorize(nir[i], &vectorize_opts)) { + NIR_PASS_V(nir[i], nir_copy_prop); lower_to_scalar = true; /* Gather info again, to update whether 8/16-bit are used. */