Skip to content

Commit 764b906

Browse files
committed
Improve the explanatory comment
1 parent 966d466 commit 764b906

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ bool WebAssemblyDebugFixup::runOnMachineFunction(MachineFunction &MF) {
123123
}
124124
} else {
125125

126-
// There is a WebAssembly Peephole optimisation can remove instructions
127-
// before and after a wasm unreachable. This is a valid transformation
128-
// because unreachable is "stack polymorphic", but stack polymorphism is
129-
// not modeled in the llvm wasm backend. In current codegen, unreachable
130-
// can only appear at the end of a basic block, and the stack is empty
131-
// at the end of every basic block.
132-
// So we can assume unreachable has stack-type [t*] -> [], and simply
133-
// clear the stack.
126+
// There is a WebAssembly peephole optimisation can remove drop
127+
// instructions before a wasm unreachable. This is a valid
128+
// transformation because unreachable is "stack polymorphic", but stack
129+
// polymorphism is not modeled in the llvm wasm backend.
130+
// In current codegen, virtual registers can only be stackified within
131+
// a basic block, and cannot be stackified across an UNREACHABLE
132+
// because it is marked as having unmodeled side effects.
133+
// So we can assume the operand stack is empty after an UNREACHABLE.
134134
if (MI.getOpcode() == WebAssembly::UNREACHABLE) {
135135
Stack.clear();
136136
break;

0 commit comments

Comments
 (0)