summaryrefslogtreecommitdiff
path: root/src/passes/LocalCSE.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-26 14:49:45 +0000
committerGitHub <noreply@github.com>2021-01-26 06:49:45 -0800
commit89164cdf1403a21a3d79ada0f0cf529d526c9de6 (patch)
tree0d503efd77225cffc44e54ea57d1b26091fa4bbd /src/passes/LocalCSE.cpp
parent9b6817c7e1b6436217b1c2acfd02c8dec74317bb (diff)
downloadbinaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.tar.gz
binaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.tar.bz2
binaryen-89164cdf1403a21a3d79ada0f0cf529d526c9de6.zip
Warn when running a pass not compatible with DWARF (#3506)
Previously the addDefault* methods would avoid adding opt passes that we know are incompatible with DWARF. However, that didn't handle the case of passes that are added in other ways. For example, when running Asyncify, emcc will run --flatten before, and that pass is not compatible with DWARF. This PR lets us warn on that by annotating the passes themselves. Then we use those annotation to either not run a pass at all (matching the previous behavior) or to show a warning when necessary. Fixes emscripten-core/emscripten#13288 . That is, concretely after this PR running asyncify + DWARF will show a warning to the user.
Diffstat (limited to 'src/passes/LocalCSE.cpp')
-rw-r--r--src/passes/LocalCSE.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/passes/LocalCSE.cpp b/src/passes/LocalCSE.cpp
index f5cf323ec..7435687ae 100644
--- a/src/passes/LocalCSE.cpp
+++ b/src/passes/LocalCSE.cpp
@@ -52,6 +52,10 @@ namespace wasm {
struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> {
bool isFunctionParallel() override { return true; }
+ // CSE adds and reuses locals.
+ // FIXME DWARF updating does not handle local changes yet.
+ bool invalidatesDWARF() override { return true; }
+
Pass* create() override { return new LocalCSE(); }
struct Usable {