Merge pull request #7262 from FernandoS27/Buffalo-buffalo-Buffalo-buffalo-buffalo

ShaderCache: Order Phi Arguments from farthest away to nearest.
This commit is contained in:
bunnei 2021-11-02 16:34:03 -07:00 committed by GitHub
commit 7ce29ea74e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 3 deletions

View file

@ -18,7 +18,7 @@ namespace Shader::Backend::GLASM {
#define NotImplemented() throw NotImplementedException("GLASM instruction {}", __LINE__)
static void DefinePhi(EmitContext& ctx, IR::Inst& phi) {
switch (phi.Arg(0).Type()) {
switch (phi.Type()) {
case IR::Type::U1:
case IR::Type::U32:
case IR::Type::F32:

View file

@ -68,7 +68,7 @@ void EmitPhi(EmitContext& ctx, IR::Inst& phi) {
}
if (!phi.Definition<Id>().is_valid) {
// The phi node wasn't forward defined
ctx.var_alloc.PhiDefine(phi, phi.Arg(0).Type());
ctx.var_alloc.PhiDefine(phi, phi.Type());
}
}
@ -80,7 +80,7 @@ void EmitReference(EmitContext& ctx, const IR::Value& value) {
void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value& value) {
IR::Inst& phi{*phi_value.InstRecursive()};
const auto phi_type{phi.Arg(0).Type()};
const auto phi_type{phi.Type()};
if (!phi.Definition<Id>().is_valid) {
// The phi node wasn't forward defined
ctx.var_alloc.PhiDefine(phi, phi_type);