summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-02-15 00:15:42 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:22 +0200
commitcbfb7d182a4e90e4e263696d1fca35e47d3eabb4 (patch)
treea8d384aa0daefdfafd9b61330e06b1cf7ac40ea6 /src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp
parentshader: Misc fixes (diff)
downloadyuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.gz
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.bz2
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.lz
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.xz
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.tar.zst
yuzu-cbfb7d182a4e90e4e263696d1fca35e47d3eabb4.zip
Diffstat (limited to 'src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp')
-rw-r--r--src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp b/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp
index bbaa412f6..132b2012a 100644
--- a/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp
+++ b/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp
@@ -13,7 +13,7 @@ namespace Shader::Optimization {
void DeadCodeEliminationPass(IR::Block& block) {
// We iterate over the instructions in reverse order.
// This is because removing an instruction reduces the number of uses for earlier instructions.
- for (IR::Inst& inst : std::views::reverse(block)) {
+ for (IR::Inst& inst : block | std::views::reverse) {
if (!inst.HasUses() && !inst.MayHaveSideEffects()) {
inst.Invalidate();
}