2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

shader: Fix constant propagation to use reverse post order

This commit is contained in:
ReinUsesLisp 2021-03-31 19:46:38 -03:00 committed by ameerj
parent eaafd53cfe
commit 5f22cd89e2

View file

@ -5,6 +5,7 @@
#include <algorithm> #include <algorithm>
#include <tuple> #include <tuple>
#include <type_traits> #include <type_traits>
#include <ranges>
#include "common/bit_cast.h" #include "common/bit_cast.h"
#include "common/bit_util.h" #include "common/bit_util.h"
@ -424,7 +425,7 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
} // Anonymous namespace } // Anonymous namespace
void ConstantPropagationPass(IR::Program& program) { void ConstantPropagationPass(IR::Program& program) {
for (IR::Block* const block : program.post_order_blocks) { for (IR::Block* const block : program.post_order_blocks | std::views::reverse) {
for (IR::Inst& inst : block->Instructions()) { for (IR::Inst& inst : block->Instructions()) {
ConstantPropagation(*block, inst); ConstantPropagation(*block, inst);
} }