diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-25 07:34:08 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:33 +0200 |
commit | 379b305b4bc09799d53981fa6e5d9cbe6be99561 (patch) | |
tree | ad68c6c457f76ba38249fdb39abbdb7b5cdbea26 /src/shader_recompiler/backend | |
parent | glasm: Catch more register leaks (diff) | |
download | yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar.gz yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar.bz2 yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar.lz yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar.xz yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.tar.zst yuzu-379b305b4bc09799d53981fa6e5d9cbe6be99561.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 3 | ||||
-rw-r--r-- | src/shader_recompiler/backend/glasm/reg_alloc.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 4aa3682c2..0e9dc06a6 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp @@ -271,6 +271,9 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { break; } } + if (!ctx.reg_alloc.IsEmpty()) { + throw LogicError("Register allocator is not empty"); + } } void SetupOptions(const IR::Program& program, const Profile& profile, diff --git a/src/shader_recompiler/backend/glasm/reg_alloc.h b/src/shader_recompiler/backend/glasm/reg_alloc.h index b97c84146..019e1bc0f 100644 --- a/src/shader_recompiler/backend/glasm/reg_alloc.h +++ b/src/shader_recompiler/backend/glasm/reg_alloc.h @@ -128,6 +128,10 @@ public: return num_used_long_registers; } + [[nodiscard]] bool IsEmpty() const noexcept { + return register_use.none() && long_register_use.none(); + } + /// Returns true if the instruction is expected to be aliased to another static bool IsAliased(const IR::Inst& inst); |