diff options
Diffstat (limited to 'src/shader_recompiler/ir_opt')
6 files changed, 12 insertions, 17 deletions
diff --git a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp index 3c72203ad..8dd6d6c2c 100644 --- a/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp +++ b/src/shader_recompiler/ir_opt/constant_propagation_pass.cpp | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <ranges> | ||
| 7 | #include <tuple> | 6 | #include <tuple> |
| 8 | #include <type_traits> | 7 | #include <type_traits> |
| 9 | 8 | ||
| @@ -599,7 +598,9 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) { | |||
| 599 | } // Anonymous namespace | 598 | } // Anonymous namespace |
| 600 | 599 | ||
| 601 | void ConstantPropagationPass(IR::Program& program) { | 600 | void ConstantPropagationPass(IR::Program& program) { |
| 602 | for (IR::Block* const block : program.post_order_blocks | std::views::reverse) { | 601 | const auto end{program.post_order_blocks.rend()}; |
| 602 | for (auto it = program.post_order_blocks.rbegin(); it != end; ++it) { | ||
| 603 | IR::Block* const block{*it}; | ||
| 603 | for (IR::Inst& inst : block->Instructions()) { | 604 | for (IR::Inst& inst : block->Instructions()) { |
| 604 | ConstantPropagation(*block, inst); | 605 | ConstantPropagation(*block, inst); |
| 605 | } | 606 | } |
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 1e4a3fdae..400836301 100644 --- a/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp +++ b/src/shader_recompiler/ir_opt/dead_code_elimination_pass.cpp | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <ranges> | ||
| 6 | |||
| 7 | #include "shader_recompiler/frontend/ir/basic_block.h" | 5 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 8 | #include "shader_recompiler/frontend/ir/value.h" | 6 | #include "shader_recompiler/frontend/ir/value.h" |
| 9 | #include "shader_recompiler/ir_opt/passes.h" | 7 | #include "shader_recompiler/ir_opt/passes.h" |
diff --git a/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp b/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp index 3d2c205c2..055ba9c54 100644 --- a/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp +++ b/src/shader_recompiler/ir_opt/dual_vertex_pass.cpp | |||
| @@ -2,12 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | #include <ranges> | ||
| 7 | |||
| 8 | #include "common/bit_cast.h" | ||
| 9 | #include "common/bit_util.h" | ||
| 10 | #include "shader_recompiler/exception.h" | ||
| 11 | #include "shader_recompiler/frontend/ir/ir_emitter.h" | 5 | #include "shader_recompiler/frontend/ir/ir_emitter.h" |
| 12 | #include "shader_recompiler/ir_opt/passes.h" | 6 | #include "shader_recompiler/ir_opt/passes.h" |
| 13 | 7 | ||
diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index f9de17b25..4197b0095 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <compare> | 6 | #include <compare> |
| 7 | #include <optional> | 7 | #include <optional> |
| 8 | #include <ranges> | ||
| 9 | #include <queue> | 8 | #include <queue> |
| 10 | 9 | ||
| 11 | #include <boost/container/flat_set.hpp> | 10 | #include <boost/container/flat_set.hpp> |
diff --git a/src/shader_recompiler/ir_opt/lower_int64_to_int32.cpp b/src/shader_recompiler/ir_opt/lower_int64_to_int32.cpp index abf7c87c7..e80d3d1d9 100644 --- a/src/shader_recompiler/ir_opt/lower_int64_to_int32.cpp +++ b/src/shader_recompiler/ir_opt/lower_int64_to_int32.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <ranges> | ||
| 6 | #include <utility> | 5 | #include <utility> |
| 7 | 6 | ||
| 8 | #include "shader_recompiler/exception.h" | 7 | #include "shader_recompiler/exception.h" |
| @@ -207,7 +206,9 @@ void Lower(IR::Block& block, IR::Inst& inst) { | |||
| 207 | } // Anonymous namespace | 206 | } // Anonymous namespace |
| 208 | 207 | ||
| 209 | void LowerInt64ToInt32(IR::Program& program) { | 208 | void LowerInt64ToInt32(IR::Program& program) { |
| 210 | for (IR::Block* const block : program.post_order_blocks | std::views::reverse) { | 209 | const auto end{program.post_order_blocks.rend()}; |
| 210 | for (auto it = program.post_order_blocks.rbegin(); it != end; ++it) { | ||
| 211 | IR::Block* const block{*it}; | ||
| 211 | for (IR::Inst& inst : block->Instructions()) { | 212 | for (IR::Inst& inst : block->Instructions()) { |
| 212 | Lower(*block, inst); | 213 | Lower(*block, inst); |
| 213 | } | 214 | } |
diff --git a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp index dcaced83f..53145fb5e 100644 --- a/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp +++ b/src/shader_recompiler/ir_opt/ssa_rewrite_pass.cpp | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | // https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6 | 14 | // https://link.springer.com/chapter/10.1007/978-3-642-37051-9_6 |
| 15 | // | 15 | // |
| 16 | 16 | ||
| 17 | #include <ranges> | ||
| 18 | #include <span> | 17 | #include <span> |
| 19 | #include <variant> | 18 | #include <variant> |
| 20 | #include <vector> | 19 | #include <vector> |
| @@ -243,7 +242,9 @@ public: | |||
| 243 | void SealBlock(IR::Block* block) { | 242 | void SealBlock(IR::Block* block) { |
| 244 | const auto it{incomplete_phis.find(block)}; | 243 | const auto it{incomplete_phis.find(block)}; |
| 245 | if (it != incomplete_phis.end()) { | 244 | if (it != incomplete_phis.end()) { |
| 246 | for (auto& [variant, phi] : it->second) { | 245 | for (auto& pair : it->second) { |
| 246 | auto& variant{pair.first}; | ||
| 247 | auto& phi{pair.second}; | ||
| 247 | std::visit([&](auto& variable) { AddPhiOperands(variable, *phi, block); }, variant); | 248 | std::visit([&](auto& variable) { AddPhiOperands(variable, *phi, block); }, variant); |
| 248 | } | 249 | } |
| 249 | } | 250 | } |
| @@ -373,8 +374,9 @@ void VisitBlock(Pass& pass, IR::Block* block) { | |||
| 373 | 374 | ||
| 374 | void SsaRewritePass(IR::Program& program) { | 375 | void SsaRewritePass(IR::Program& program) { |
| 375 | Pass pass; | 376 | Pass pass; |
| 376 | for (IR::Block* const block : program.post_order_blocks | std::views::reverse) { | 377 | const auto end{program.post_order_blocks.rend()}; |
| 377 | VisitBlock(pass, block); | 378 | for (auto block = program.post_order_blocks.rbegin(); block != end; ++block) { |
| 379 | VisitBlock(pass, *block); | ||
| 378 | } | 380 | } |
| 379 | } | 381 | } |
| 380 | 382 | ||