summaryrefslogtreecommitdiff
path: root/src/passes/call-utils.h
Commit message (Collapse)AuthorAgeFilesLines
* [DebugInfo] Copy debug info in call-utils.h (#6652)Alon Zakai2024-06-121-5/+9
| | | | | | | | | | | | | | | | | | | | | | | We automatically copy debuginfo in replaceCurrent(), but there are a few places that do other operations than simple replacements. call-utils.h will turn a call_ref with a select target into two direct calls, and we were missing the logic to copy debuginfo from the call_ref to the calls. To make this work, refactor out the copying logic from wasm-traversal, into debuginfo.h, and use it in call-utils.h. debuginfo.h itself is renamed from debug.h (as now this needs to be included from wasm-traversal, which nearly everything does, and it turns out some files have internal stuff like a debug() helper that ends up conflicing with the old debug namespace). Also rename the old copyDebugInfo function to copyDebugInfoBetweenFunctions which is more explicit. That is also moved from the header to a cpp file because it depends on wasm-traversal (so we'd end up with recursive headers otherwise). That is fine, as that method is called after copying a function, which is not that frequent. The new copyDebugInfoToReplacement (which was refactored out of wasm-traversal) is in the header because it can be called very frequently (every single instruction we optimize) and we want it to get inlined.
* Fix handling of unreachable selects in Directize (#5098)Alon Zakai2022-09-301-1/+1
| | | | We ignored only unreachable conditions, but we must ignore the arms as well, or else we could error.
* OptimizeInstructions: Turn call_ref of a select into an if over two direct ↵Alon Zakai2022-05-271-0/+153
calls (#4660) This extends the existing call_indirect code to do the same for call_ref, basically. The shared code is added to a new helper utility.