shader: Support SSA loops on IR
This commit is contained in:
parent
8af9297f09
commit
cbfb7d182a
12 changed files with 150 additions and 46 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue