aco: always update orig_names in get_reg_phi()
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 23 Feb 2023 17:09:40 +0000 (17:09 +0000)
committerMarge Bot <emma+marge@anholt.net>
Mon, 27 Feb 2023 15:10:22 +0000 (15:10 +0000)
No idea why this wasn't done if pc.first was a renamed temporary.

Fixes navi10 RA validation error with
dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_geom_buffers1_sets3_imm_samplers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8349
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21501>

src/amd/compiler/aco_register_allocation.cpp

index f5091ce..e8a1095 100644 (file)
@@ -2082,11 +2082,8 @@ get_reg_phi(ra_ctx& ctx, IDSet& live_in, RegisterFile& register_file,
 
       /* rename */
       std::unordered_map<unsigned, Temp>::iterator orig_it = ctx.orig_names.find(pc.first.tempId());
-      Temp orig = pc.first.getTemp();
-      if (orig_it != ctx.orig_names.end())
-         orig = orig_it->second;
-      else
-         ctx.orig_names[pc.second.tempId()] = orig;
+      Temp orig = orig_it != ctx.orig_names.end() ? orig_it->second : pc.first.getTemp();
+      ctx.orig_names[pc.second.tempId()] = orig;
       ctx.renames[block.index][orig.id()] = pc.second.getTemp();
 
       /* otherwise, this is a live-in and we need to create a new phi