shader: Intrusively store register values in block for SSA pass

This commit is contained in:
ReinUsesLisp 2021-04-21 00:27:55 -03:00 committed by ameerj
parent 6944cabb89
commit 4209828646
2 changed files with 53 additions and 21 deletions

View file

@ -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{};
};