summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-21 06:07:10 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:39 +0200
commit808ef97a086e7cc58a3ceded1de516ad6a6be5d3 (patch)
treeb79be02801ddadb44940d2c77fa0ae5c571dc557 /src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
parentgl_graphics_pipeline: Fix assembly shaders check for transform feedbacks (diff)
downloadyuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar.gz
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar.bz2
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar.lz
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar.xz
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.tar.zst
yuzu-808ef97a086e7cc58a3ceded1de516ad6a6be5d3.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
index fff25c4a2..dcaced83f 100644
--- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
+++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp
@@ -48,22 +48,12 @@ struct GotoVariable : FlagTag {
u32 index;
};
-struct LoopSafetyVariable {
- LoopSafetyVariable() = default;
- explicit LoopSafetyVariable(u32 index_) : index{index_} {}
-
- auto operator<=>(const LoopSafetyVariable&) const noexcept = default;
-
- u32 index;
-};
-
struct IndirectBranchVariable {
auto operator<=>(const IndirectBranchVariable&) const noexcept = default;
};
-using Variant =
- std::variant<IR::Reg, IR::Pred, ZeroFlagTag, SignFlagTag, CarryFlagTag, OverflowFlagTag,
- GotoVariable, LoopSafetyVariable, IndirectBranchVariable>;
+using Variant = std::variant<IR::Reg, IR::Pred, ZeroFlagTag, SignFlagTag, CarryFlagTag,
+ OverflowFlagTag, GotoVariable, IndirectBranchVariable>;
using ValueMap = boost::container::flat_map<IR::Block*, IR::Value>;
struct DefTable {
@@ -88,13 +78,6 @@ struct DefTable {
goto_vars[variable.index].insert_or_assign(block, value);
}
- const IR::Value& Def(IR::Block* block, LoopSafetyVariable variable) {
- return loop_safety_vars[variable.index][block];
- }
- void SetDef(IR::Block* block, LoopSafetyVariable variable, const IR::Value& value) {
- loop_safety_vars[variable.index].insert_or_assign(block, value);
- }
-
const IR::Value& Def(IR::Block* block, IndirectBranchVariable) {
return indirect_branch_var[block];
}
@@ -132,7 +115,6 @@ struct DefTable {
std::array<ValueMap, IR::NUM_USER_PREDS> preds;
boost::container::flat_map<u32, ValueMap> goto_vars;
- boost::container::flat_map<u32, ValueMap> loop_safety_vars;
ValueMap indirect_branch_var;
ValueMap zero_flag;
ValueMap sign_flag;
@@ -152,10 +134,6 @@ IR::Opcode UndefOpcode(const FlagTag&) noexcept {
return IR::Opcode::UndefU1;
}
-IR::Opcode UndefOpcode(const LoopSafetyVariable&) noexcept {
- return IR::Opcode::UndefU32;
-}
-
IR::Opcode UndefOpcode(IndirectBranchVariable) noexcept {
return IR::Opcode::UndefU32;
}
@@ -337,9 +315,6 @@ void VisitInst(Pass& pass, IR::Block* block, IR::Inst& inst) {
case IR::Opcode::SetGotoVariable:
pass.WriteVariable(GotoVariable{inst.Arg(0).U32()}, block, inst.Arg(1));
break;
- case IR::Opcode::SetLoopSafetyVariable:
- pass.WriteVariable(LoopSafetyVariable{inst.Arg(0).U32()}, block, inst.Arg(1));
- break;
case IR::Opcode::SetIndirectBranchVariable:
pass.WriteVariable(IndirectBranchVariable{}, block, inst.Arg(0));
break;
@@ -368,9 +343,6 @@ void VisitInst(Pass& pass, IR::Block* block, IR::Inst& inst) {
case IR::Opcode::GetGotoVariable:
inst.ReplaceUsesWith(pass.ReadVariable(GotoVariable{inst.Arg(0).U32()}, block));
break;
- case IR::Opcode::GetLoopSafetyVariable:
- inst.ReplaceUsesWith(pass.ReadVariable(LoopSafetyVariable{inst.Arg(0).U32()}, block));
- break;
case IR::Opcode::GetIndirectBranchVariable:
inst.ReplaceUsesWith(pass.ReadVariable(IndirectBranchVariable{}, block));
break;