mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 13:56:59 +01:00
shader: reuse initial SSA types
This commit is contained in:
@@ -123,46 +123,6 @@ struct DefTable {
|
|||||||
std::unordered_map<uint32_t, ValueMap> goto_variables;
|
std::unordered_map<uint32_t, ValueMap> goto_variables;
|
||||||
};
|
};
|
||||||
|
|
||||||
ValueOpcode UndefOpcode(ScalarReg) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(ThreadBitScalarReg) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(ScalarMaskTag) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(VectorReg) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(GotoVariable) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(SccTag) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(ExecTag) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(ExecLoTag) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(ExecHiTag) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(VccTag) {
|
|
||||||
return ValueOpcode::UndefU1;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(VccLoTag) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(VccHiTag) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
ValueOpcode UndefOpcode(M0Tag) {
|
|
||||||
return ValueOpcode::UndefU32;
|
|
||||||
}
|
|
||||||
|
|
||||||
Value InitialValue(ScalarReg) {
|
Value InitialValue(ScalarReg) {
|
||||||
return Value(0u);
|
return Value(0u);
|
||||||
}
|
}
|
||||||
@@ -248,7 +208,7 @@ public:
|
|||||||
state.result = def;
|
state.result = def;
|
||||||
} else if (!block->IsSsaSealed()) {
|
} else if (!block->IsSsaSealed()) {
|
||||||
auto& phi = *block->PrependNewInst(block->begin(), ValueOpcode::Phi);
|
auto& phi = *block->PrependNewInst(block->begin(), ValueOpcode::Phi);
|
||||||
phi.SetFlags(TypeOf(UndefOpcode(variable)));
|
phi.SetFlags(InitialValue(variable).GetType());
|
||||||
incomplete_phis[block][Variable(variable)] = φ
|
incomplete_phis[block][Variable(variable)] = φ
|
||||||
state.result = Value(&phi);
|
state.result = Value(&phi);
|
||||||
} else if (const auto predecessors = block->ImmPredecessors();
|
} else if (const auto predecessors = block->ImmPredecessors();
|
||||||
@@ -258,7 +218,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
auto& phi = *block->PrependNewInst(block->begin(), ValueOpcode::Phi);
|
auto& phi = *block->PrependNewInst(block->begin(), ValueOpcode::Phi);
|
||||||
phi.SetFlags(TypeOf(UndefOpcode(variable)));
|
phi.SetFlags(InitialValue(variable).GetType());
|
||||||
Write(variable, block, Value(&phi));
|
Write(variable, block, Value(&phi));
|
||||||
state.phi = φ
|
state.phi = φ
|
||||||
prepare_phi();
|
prepare_phi();
|
||||||
|
|||||||
Reference in New Issue
Block a user