From 514a6b07eedace58b4a0c95282bdfc729623d1d9 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Tue, 30 Mar 2021 03:19:50 -0300
Subject: shader: Store type of phi nodes in flags

This is needed because pseudo-instructions where invalidated.
---
 src/shader_recompiler/frontend/ir/value.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/shader_recompiler/frontend/ir/value.cpp')

diff --git a/src/shader_recompiler/frontend/ir/value.cpp b/src/shader_recompiler/frontend/ir/value.cpp
index e8e4662e7b..837c1b487f 100644
--- a/src/shader_recompiler/frontend/ir/value.cpp
+++ b/src/shader_recompiler/frontend/ir/value.cpp
@@ -56,7 +56,11 @@ bool Value::IsLabel() const noexcept {
 }
 
 IR::Type Value::Type() const noexcept {
-    if (IsIdentity() || IsPhi()) {
+    if (IsPhi()) {
+        // The type of a phi node is stored in its flags
+        return inst->Flags<IR::Type>();
+    }
+    if (IsIdentity()) {
         return inst->Arg(0).Type();
     }
     if (type == Type::Opaque) {
-- 
cgit v1.2.3-70-g09d2