From dd45bf5bcec1eee94bdb0501896b8d41df009a75 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 27 May 2025 12:43:56 +0100 Subject: [PATCH] nir/load_store_vectorize: stabilize entry sort I think this was unlikely to cause issues, even if the qsort() implementation is unstable. Signed-off-by: Rhys Perry Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_opt_load_store_vectorize.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_load_store_vectorize.c b/src/compiler/nir/nir_opt_load_store_vectorize.c index be285e96767..1f930b2261e 100644 --- a/src/compiler/nir/nir_opt_load_store_vectorize.c +++ b/src/compiler/nir/nir_opt_load_store_vectorize.c @@ -241,8 +241,13 @@ sort_entries(const void *a_, const void *b_) return 1; else if (a->offset_signed < b->offset_signed) return -1; - else - return 0; + + if (a->index > b->index) + return 1; + else if (a->index < b->index) + return -1; + + return 0; } static unsigned