summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/ir/value.h
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-26 15:41:53 -0300
committerGravatar ameerj2021-07-22 21:51:33 -0400
commit586c785366307cb3c648bd33345b431b8312612d (patch)
tree69992ad1ddc8bb5c86f91b48b39c311bda605a26 /src/shader_recompiler/frontend/ir/value.h
parentglasm: Implement undef instructions (diff)
downloadyuzu-586c785366307cb3c648bd33345b431b8312612d.tar.gz
yuzu-586c785366307cb3c648bd33345b431b8312612d.tar.xz
yuzu-586c785366307cb3c648bd33345b431b8312612d.zip
glasm: Skip phi moves on undefined instructions
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/value.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 0c6bf684d..090cc1739 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -395,4 +395,17 @@ inline f64 Value::F64() const {
395 return inst.GetOpcode() == Opcode::Phi; 395 return inst.GetOpcode() == Opcode::Phi;
396} 396}
397 397
398[[nodiscard]] inline bool IsUndef(const Inst& inst) {
399 switch (inst.GetOpcode()) {
400 case Opcode::UndefU1:
401 case Opcode::UndefU8:
402 case Opcode::UndefU16:
403 case Opcode::UndefU32:
404 case Opcode::UndefU64:
405 return true;
406 default:
407 return false;
408 }
409}
410
398} // namespace Shader::IR 411} // namespace Shader::IR