From 420982864634a5e52cea42c43f8623f75483fbcc Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Wed, 21 Apr 2021 00:27:55 -0300
Subject: shader: Intrusively store register values in block for SSA pass

---
 src/shader_recompiler/frontend/ir/basic_block.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'src/shader_recompiler/frontend/ir/basic_block.h')

diff --git a/src/shader_recompiler/frontend/ir/basic_block.h b/src/shader_recompiler/frontend/ir/basic_block.h
index 6a1d615d92..3a42307557 100644
--- a/src/shader_recompiler/frontend/ir/basic_block.h
+++ b/src/shader_recompiler/frontend/ir/basic_block.h
@@ -101,6 +101,13 @@ public:
         return branch_false;
     }
 
+    void SetSsaRegValue(IR::Reg reg, const Value& value) noexcept {
+        ssa_reg_values[RegIndex(reg)] = value;
+    }
+    const Value& SsaRegValue(IR::Reg reg) const noexcept {
+        return ssa_reg_values[RegIndex(reg)];
+    }
+
     [[nodiscard]] bool empty() const {
         return instructions.empty();
     }
@@ -182,6 +189,9 @@ private:
     /// Block immediate predecessors
     std::vector<Block*> imm_predecessors;
 
+    /// Intrusively store the value of a register in the block.
+    std::array<Value, NUM_REGS> ssa_reg_values;
+
     /// Intrusively stored host definition of this block.
     u32 definition{};
 };
-- 
cgit v1.2.3-70-g09d2