summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/ir
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-07-30 03:45:37 +0200
committerGitHub <noreply@github.com>2021-07-30 03:45:37 +0200
commita98f14e9b0e6834a78136d623d5d094a57a10d1d (patch)
tree4b96040bfb6714e3e6115f0094391e3f7ec1fb53 /src/shader_recompiler/frontend/ir
parentMerge pull request #6751 from Morph1984/languagecode (diff)
parentshader: Fold integer FMA from Nvidia's pattern (diff)
downloadyuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar.gz
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar.bz2
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar.lz
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar.xz
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.tar.zst
yuzu-a98f14e9b0e6834a78136d623d5d094a57a10d1d.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/frontend/ir/value.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/ir/value.h b/src/shader_recompiler/frontend/ir/value.h
index 795194d41..334bb47aa 100644
--- a/src/shader_recompiler/frontend/ir/value.h
+++ b/src/shader_recompiler/frontend/ir/value.h
@@ -57,6 +57,7 @@ public:
[[nodiscard]] IR::Inst* Inst() const;
[[nodiscard]] IR::Inst* InstRecursive() const;
+ [[nodiscard]] IR::Inst* TryInstRecursive() const;
[[nodiscard]] IR::Value Resolve() const;
[[nodiscard]] IR::Reg Reg() const;
[[nodiscard]] IR::Pred Pred() const;
@@ -308,6 +309,13 @@ inline IR::Inst* Value::InstRecursive() const {
return inst;
}
+inline IR::Inst* Value::TryInstRecursive() const {
+ if (IsIdentity()) {
+ return inst->Arg(0).TryInstRecursive();
+ }
+ return type == Type::Opaque ? inst : nullptr;
+}
+
inline IR::Value Value::Resolve() const {
if (IsIdentity()) {
return inst->Arg(0).Resolve();