We have a good comment on TEE transformation in RegStackify:
https://github.com/llvm/llvm-project/blob/547e3456660000a16fc5c2a2f819f1a2b5d35b5d/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp#L613-L632
And I think it can be helpful to have some more comments on how the
TEEs created in RegStackify are converted into LOCAL_TEEs.
Variable OldReg is changed to DefReg to be consistent with
RegStackify's comment.