ShaderCache: Order Phi Arguments from farthest away to nearest.

This commit is contained in:
Fernando Sahmkow 2021-10-31 17:46:46 +01:00
parent a3a353edf2
commit c50ad56bf5
5 changed files with 37 additions and 0 deletions

View file

@ -378,6 +378,13 @@ void SsaRewritePass(IR::Program& program) {
for (auto block = program.post_order_blocks.rbegin(); block != end; ++block) {
VisitBlock(pass, *block);
}
for (auto block = program.post_order_blocks.rbegin(); block != end; ++block) {
for (IR::Inst& inst : (*block)->Instructions()) {
if (inst.GetOpcode() == IR::Opcode::Phi) {
inst.OrderPhiArgs();
}
}
}
}
} // namespace Shader::Optimization