diff options
| author | 2021-04-21 00:27:55 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:28 -0400 | |
| commit | 420982864634a5e52cea42c43f8623f75483fbcc (patch) | |
| tree | 5433936232c2819713e69581641ce271c4e0e68f /src/shader_recompiler/frontend | |
| parent | shader: Inline common Opcode and Inst functions (diff) | |
| download | yuzu-420982864634a5e52cea42c43f8623f75483fbcc.tar.gz yuzu-420982864634a5e52cea42c43f8623f75483fbcc.tar.xz yuzu-420982864634a5e52cea42c43f8623f75483fbcc.zip | |
shader: Intrusively store register values in block for SSA pass
Diffstat (limited to 'src/shader_recompiler/frontend')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/basic_block.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/basic_block.h b/src/shader_recompiler/frontend/ir/basic_block.h index 6a1d615d9..3a4230755 100644 --- a/src/shader_recompiler/frontend/ir/basic_block.h +++ b/src/shader_recompiler/frontend/ir/basic_block.h | |||
| @@ -101,6 +101,13 @@ public: | |||
| 101 | return branch_false; | 101 | return branch_false; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | void SetSsaRegValue(IR::Reg reg, const Value& value) noexcept { | ||
| 105 | ssa_reg_values[RegIndex(reg)] = value; | ||
| 106 | } | ||
| 107 | const Value& SsaRegValue(IR::Reg reg) const noexcept { | ||
| 108 | return ssa_reg_values[RegIndex(reg)]; | ||
| 109 | } | ||
| 110 | |||
| 104 | [[nodiscard]] bool empty() const { | 111 | [[nodiscard]] bool empty() const { |
| 105 | return instructions.empty(); | 112 | return instructions.empty(); |
| 106 | } | 113 | } |
| @@ -182,6 +189,9 @@ private: | |||
| 182 | /// Block immediate predecessors | 189 | /// Block immediate predecessors |
| 183 | std::vector<Block*> imm_predecessors; | 190 | std::vector<Block*> imm_predecessors; |
| 184 | 191 | ||
| 192 | /// Intrusively store the value of a register in the block. | ||
| 193 | std::array<Value, NUM_REGS> ssa_reg_values; | ||
| 194 | |||
| 185 | /// Intrusively stored host definition of this block. | 195 | /// Intrusively stored host definition of this block. |
| 186 | u32 definition{}; | 196 | u32 definition{}; |
| 187 | }; | 197 | }; |