[WebAssembly] Do nothing when sinking to same place
authorHeejin Ahn <aheejin@gmail.com>
Fri, 24 Mar 2023 18:49:08 +0000 (11:49 -0700)
committerHeejin Ahn <aheejin@gmail.com>
Wed, 29 Mar 2023 19:50:39 +0000 (12:50 -0700)
commita4e32ae4cd97ce460e8695281f60ddb10cf510b2
treecef03acb53a3cebdb4d54d81de4e83f3afa1db8a
parent5a55c9507b6961ba4fb6acbeb2ffa1dba0d13969
[WebAssembly] Do nothing when sinking to same place

In `DebugValueManager`, if a `Def` is requested to be sunk to the same
place (i.e., `Insert` is right after `Def`, not counting `DBG_VALUE`s)
currently we still do the sink. This can result in unnecessary creation
of `DBG_VALUE $noreg`. See comments for details. This CL detects this
case and do nothing and return, so we don't end up creating unnecessary
undef `DBG_VALUE`s.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D146860
llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.cpp
llvm/lib/Target/WebAssembly/WebAssemblyDebugValueManager.h
llvm/test/DebugInfo/WebAssembly/dbg-value-reg-stackify.mir