summaryrefslogtreecommitdiff
path: root/src/passes/StackIR.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/StackIR.cpp')
-rw-r--r--src/passes/StackIR.cpp36
1 files changed, 1 insertions, 35 deletions
diff --git a/src/passes/StackIR.cpp b/src/passes/StackIR.cpp
index 84e19428d..e896af0f5 100644
--- a/src/passes/StackIR.cpp
+++ b/src/passes/StackIR.cpp
@@ -69,41 +69,7 @@ public:
if (passOptions.optimizeLevel >= 3 || passOptions.shrinkLevel >= 1) {
local2Stack();
}
- // Removing unneeded blocks is dangerous with GC, as if we do this:
- //
- // (call
- // (struct.new)
- // (block
- // (nop)
- // (i32)
- // )
- // )
- // === remove inner block ==>
- // (call
- // (struct.new)
- // (nop)
- // (i32)
- // )
- //
- // Then we end up with a nop that forces us to emit this during load:
- //
- // (call
- // (block
- // (local.set
- // (struct.new)
- // )
- // (nop)
- // (local.get)
- // )
- // (i32)
- // )
- //
- // However, that is not valid as an non-nullable reference cannot be set to
- // a local. TODO: double check that this is still true now that we don't
- // have RTTs.
- if (!features.hasGC()) {
- removeUnneededBlocks();
- }
+ removeUnneededBlocks();
dce();
}