diff options
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 391 |
1 files changed, 279 insertions, 112 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index 41d2026bc..ae940a56d 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -17,35 +17,34 @@ #include <chrono> #include <sstream> -#include "support/colors.h" -#include "passes/passes.h" -#include "pass.h" -#include "wasm-validator.h" -#include "wasm-io.h" #include "ir/hashed.h" #include "ir/module-utils.h" +#include "pass.h" +#include "passes/passes.h" +#include "support/colors.h" +#include "wasm-io.h" +#include "wasm-validator.h" namespace wasm { // PassRegistry -PassRegistry::PassRegistry() { - registerPasses(); -} +PassRegistry::PassRegistry() { registerPasses(); } static PassRegistry singleton; -PassRegistry* PassRegistry::get() { - return &singleton; -} +PassRegistry* PassRegistry::get() { return &singleton; } -void PassRegistry::registerPass(const char* name, const char *description, Creator create) { +void PassRegistry::registerPass(const char* name, + const char* description, + Creator create) { assert(passInfos.find(name) == passInfos.end()); passInfos[name] = PassInfo(description, create); } Pass* PassRegistry::createPass(std::string name) { - if (passInfos.find(name) == passInfos.end()) return nullptr; + if (passInfos.find(name) == passInfos.end()) + return nullptr; auto ret = passInfos[name].create(); ret->name = name; return ret; @@ -67,87 +66,234 @@ std::string PassRegistry::getPassDescription(std::string name) { // PassRunner void PassRegistry::registerPasses() { - registerPass("dae", "removes arguments to calls in an lto-like manner", createDAEPass); - registerPass("dae-optimizing", "removes arguments to calls in an lto-like manner, and optimizes where we removed", createDAEOptimizingPass); - registerPass("coalesce-locals", "reduce # of locals by coalescing", createCoalesceLocalsPass); - registerPass("coalesce-locals-learning", "reduce # of locals by coalescing and learning", createCoalesceLocalsWithLearningPass); - registerPass("code-pushing", "push code forward, potentially making it not always execute", createCodePushingPass); - registerPass("code-folding", "fold code, merging duplicates", createCodeFoldingPass); - registerPass("const-hoisting", "hoist repeated constants to a local", createConstHoistingPass); - registerPass("dce", "removes unreachable code", createDeadCodeEliminationPass); - registerPass("directize", "turns indirect calls into direct ones", createDirectizePass); - registerPass("dfo", "optimizes using the DataFlow SSA IR", createDataFlowOptsPass); - registerPass("duplicate-function-elimination", "removes duplicate functions", createDuplicateFunctionEliminationPass); - registerPass("extract-function", "leaves just one function (useful for debugging)", createExtractFunctionPass); - registerPass("flatten", "flattens out code, removing nesting", createFlattenPass); - registerPass("fpcast-emu", "emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work", createFuncCastEmulationPass); - registerPass("func-metrics", "reports function metrics", createFunctionMetricsPass); - registerPass("generate-stack-ir", "generate Stack IR", createGenerateStackIRPass); - registerPass("inlining", "inline functions (you probably want inlining-optimizing)", createInliningPass); - registerPass("inlining-optimizing", "inline functions and optimizes where we inlined", createInliningOptimizingPass); - registerPass("legalize-js-interface", "legalizes i64 types on the import/export boundary", createLegalizeJSInterfacePass); - registerPass("legalize-js-interface-minimally", "legalizes i64 types on the import/export boundary in a minimal manner, only on things only JS will call", createLegalizeJSInterfaceMinimallyPass); - registerPass("local-cse", "common subexpression elimination inside basic blocks", createLocalCSEPass); - registerPass("log-execution", "instrument the build with logging of where execution goes", createLogExecutionPass); - registerPass("i64-to-i32-lowering", "lower all uses of i64s to use i32s instead", createI64ToI32LoweringPass); - registerPass("instrument-locals", "instrument the build with code to intercept all loads and stores", createInstrumentLocalsPass); - registerPass("instrument-memory", "instrument the build with code to intercept all loads and stores", createInstrumentMemoryPass); - registerPass("licm", "loop invariant code motion", createLoopInvariantCodeMotionPass); - registerPass("limit-segments", "attempt to merge segments to fit within web limits", createLimitSegmentsPass); - registerPass("memory-packing", "packs memory into separate segments, skipping zeros", createMemoryPackingPass); - registerPass("merge-blocks", "merges blocks to their parents", createMergeBlocksPass); - registerPass("merge-locals", "merges locals when beneficial", createMergeLocalsPass); + registerPass( + "dae", "removes arguments to calls in an lto-like manner", createDAEPass); + registerPass("dae-optimizing", + "removes arguments to calls in an lto-like manner, and " + "optimizes where we removed", + createDAEOptimizingPass); + registerPass("coalesce-locals", + "reduce # of locals by coalescing", + createCoalesceLocalsPass); + registerPass("coalesce-locals-learning", + "reduce # of locals by coalescing and learning", + createCoalesceLocalsWithLearningPass); + registerPass("code-pushing", + "push code forward, potentially making it not always execute", + createCodePushingPass); + registerPass( + "code-folding", "fold code, merging duplicates", createCodeFoldingPass); + registerPass("const-hoisting", + "hoist repeated constants to a local", + createConstHoistingPass); + registerPass( + "dce", "removes unreachable code", createDeadCodeEliminationPass); + registerPass( + "directize", "turns indirect calls into direct ones", createDirectizePass); + registerPass( + "dfo", "optimizes using the DataFlow SSA IR", createDataFlowOptsPass); + registerPass("duplicate-function-elimination", + "removes duplicate functions", + createDuplicateFunctionEliminationPass); + registerPass("extract-function", + "leaves just one function (useful for debugging)", + createExtractFunctionPass); + registerPass( + "flatten", "flattens out code, removing nesting", createFlattenPass); + registerPass("fpcast-emu", + "emulates function pointer casts, allowing incorrect indirect " + "calls to (sometimes) work", + createFuncCastEmulationPass); + registerPass( + "func-metrics", "reports function metrics", createFunctionMetricsPass); + registerPass( + "generate-stack-ir", "generate Stack IR", createGenerateStackIRPass); + registerPass("inlining", + "inline functions (you probably want inlining-optimizing)", + createInliningPass); + registerPass("inlining-optimizing", + "inline functions and optimizes where we inlined", + createInliningOptimizingPass); + registerPass("legalize-js-interface", + "legalizes i64 types on the import/export boundary", + createLegalizeJSInterfacePass); + registerPass("legalize-js-interface-minimally", + "legalizes i64 types on the import/export boundary in a minimal " + "manner, only on things only JS will call", + createLegalizeJSInterfaceMinimallyPass); + registerPass("local-cse", + "common subexpression elimination inside basic blocks", + createLocalCSEPass); + registerPass("log-execution", + "instrument the build with logging of where execution goes", + createLogExecutionPass); + registerPass("i64-to-i32-lowering", + "lower all uses of i64s to use i32s instead", + createI64ToI32LoweringPass); + registerPass( + "instrument-locals", + "instrument the build with code to intercept all loads and stores", + createInstrumentLocalsPass); + registerPass( + "instrument-memory", + "instrument the build with code to intercept all loads and stores", + createInstrumentMemoryPass); + registerPass( + "licm", "loop invariant code motion", createLoopInvariantCodeMotionPass); + registerPass("limit-segments", + "attempt to merge segments to fit within web limits", + createLimitSegmentsPass); + registerPass("memory-packing", + "packs memory into separate segments, skipping zeros", + createMemoryPackingPass); + registerPass( + "merge-blocks", "merges blocks to their parents", createMergeBlocksPass); + registerPass( + "merge-locals", "merges locals when beneficial", createMergeLocalsPass); registerPass("metrics", "reports metrics", createMetricsPass); - registerPass("minify-imports", "minifies import names (only those, and not export names), and emits a mapping to the minified ones", createMinifyImportsPass); - registerPass("minify-imports-and-exports", "minifies both import and export names, and emits a mapping to the minified ones", createMinifyImportsAndExportsPass); + registerPass("minify-imports", + "minifies import names (only those, and not export names), and " + "emits a mapping to the minified ones", + createMinifyImportsPass); + registerPass("minify-imports-and-exports", + "minifies both import and export names, and emits a mapping to " + "the minified ones", + createMinifyImportsAndExportsPass); registerPass("nm", "name list", createNameListPass); - registerPass("no-exit-runtime", "removes calls to atexit(), which is valid if the C runtime will never be exited", createNoExitRuntimePass); - registerPass("optimize-added-constants", "optimizes added constants into load/store offsets", createOptimizeAddedConstantsPass); - registerPass("optimize-added-constants-propagate", "optimizes added constants into load/store offsets, propagating them across locals too", createOptimizeAddedConstantsPropagatePass); - registerPass("optimize-instructions", "optimizes instruction combinations", createOptimizeInstructionsPass); - registerPass("optimize-stack-ir", "optimize Stack IR", createOptimizeStackIRPass); - registerPass("pick-load-signs", "pick load signs based on their uses", createPickLoadSignsPass); - registerPass("post-emscripten", "miscellaneous optimizations for Emscripten-generated code", createPostEmscriptenPass); - registerPass("precompute", "computes compile-time evaluatable expressions", createPrecomputePass); - registerPass("precompute-propagate", "computes compile-time evaluatable expressions and propagates them through locals", createPrecomputePropagatePass); + registerPass("no-exit-runtime", + "removes calls to atexit(), which is valid if the C runtime " + "will never be exited", + createNoExitRuntimePass); + registerPass("optimize-added-constants", + "optimizes added constants into load/store offsets", + createOptimizeAddedConstantsPass); + registerPass("optimize-added-constants-propagate", + "optimizes added constants into load/store offsets, propagating " + "them across locals too", + createOptimizeAddedConstantsPropagatePass); + registerPass("optimize-instructions", + "optimizes instruction combinations", + createOptimizeInstructionsPass); + registerPass( + "optimize-stack-ir", "optimize Stack IR", createOptimizeStackIRPass); + registerPass("pick-load-signs", + "pick load signs based on their uses", + createPickLoadSignsPass); + registerPass("post-emscripten", + "miscellaneous optimizations for Emscripten-generated code", + createPostEmscriptenPass); + registerPass("precompute", + "computes compile-time evaluatable expressions", + createPrecomputePass); + registerPass("precompute-propagate", + "computes compile-time evaluatable expressions and propagates " + "them through locals", + createPrecomputePropagatePass); registerPass("print", "print in s-expression format", createPrinterPass); - registerPass("print-minified", "print in minified s-expression format", createMinifiedPrinterPass); - registerPass("print-features", "print options for enabled features", createPrintFeaturesPass); - registerPass("print-full", "print in full s-expression format", createFullPrinterPass); - registerPass("print-call-graph", "print call graph", createPrintCallGraphPass); - registerPass("print-stack-ir", "print out Stack IR (useful for internal debugging)", createPrintStackIRPass); - registerPass("relooper-jump-threading", "thread relooper jumps (fastcomp output only)", createRelooperJumpThreadingPass); - registerPass("remove-non-js-ops", "removes operations incompatible with js", createRemoveNonJSOpsPass); - registerPass("remove-imports", "removes imports and replaces them with nops", createRemoveImportsPass); - registerPass("remove-memory", "removes memory segments", createRemoveMemoryPass); - registerPass("remove-unused-brs", "removes breaks from locations that are not needed", createRemoveUnusedBrsPass); - registerPass("remove-unused-module-elements", "removes unused module elements", createRemoveUnusedModuleElementsPass); - registerPass("remove-unused-nonfunction-module-elements", "removes unused module elements that are not functions", createRemoveUnusedNonFunctionModuleElementsPass); - registerPass("remove-unused-names", "removes names from locations that are never branched to", createRemoveUnusedNamesPass); - registerPass("reorder-functions", "sorts functions by access frequency", createReorderFunctionsPass); - registerPass("reorder-locals", "sorts locals by access frequency", createReorderLocalsPass); - registerPass("rereloop", "re-optimize control flow using the relooper algorithm", createReReloopPass); - registerPass("rse", "remove redundant local.sets", createRedundantSetEliminationPass); - registerPass("safe-heap", "instrument loads and stores to check for invalid behavior", createSafeHeapPass); - registerPass("simplify-locals", "miscellaneous locals-related optimizations", createSimplifyLocalsPass); - registerPass("simplify-locals-nonesting", "miscellaneous locals-related optimizations (no nesting at all; preserves flatness)", createSimplifyLocalsNoNestingPass); - registerPass("simplify-locals-notee", "miscellaneous locals-related optimizations (no tees)", createSimplifyLocalsNoTeePass); - registerPass("simplify-locals-nostructure", "miscellaneous locals-related optimizations (no structure)", createSimplifyLocalsNoStructurePass); - registerPass("simplify-locals-notee-nostructure", "miscellaneous locals-related optimizations (no tees or structure)", createSimplifyLocalsNoTeeNoStructurePass); + registerPass("print-minified", + "print in minified s-expression format", + createMinifiedPrinterPass); + registerPass("print-features", + "print options for enabled features", + createPrintFeaturesPass); + registerPass( + "print-full", "print in full s-expression format", createFullPrinterPass); + registerPass( + "print-call-graph", "print call graph", createPrintCallGraphPass); + registerPass("print-stack-ir", + "print out Stack IR (useful for internal debugging)", + createPrintStackIRPass); + registerPass("relooper-jump-threading", + "thread relooper jumps (fastcomp output only)", + createRelooperJumpThreadingPass); + registerPass("remove-non-js-ops", + "removes operations incompatible with js", + createRemoveNonJSOpsPass); + registerPass("remove-imports", + "removes imports and replaces them with nops", + createRemoveImportsPass); + registerPass( + "remove-memory", "removes memory segments", createRemoveMemoryPass); + registerPass("remove-unused-brs", + "removes breaks from locations that are not needed", + createRemoveUnusedBrsPass); + registerPass("remove-unused-module-elements", + "removes unused module elements", + createRemoveUnusedModuleElementsPass); + registerPass("remove-unused-nonfunction-module-elements", + "removes unused module elements that are not functions", + createRemoveUnusedNonFunctionModuleElementsPass); + registerPass("remove-unused-names", + "removes names from locations that are never branched to", + createRemoveUnusedNamesPass); + registerPass("reorder-functions", + "sorts functions by access frequency", + createReorderFunctionsPass); + registerPass("reorder-locals", + "sorts locals by access frequency", + createReorderLocalsPass); + registerPass("rereloop", + "re-optimize control flow using the relooper algorithm", + createReReloopPass); + registerPass( + "rse", "remove redundant local.sets", createRedundantSetEliminationPass); + registerPass("safe-heap", + "instrument loads and stores to check for invalid behavior", + createSafeHeapPass); + registerPass("simplify-locals", + "miscellaneous locals-related optimizations", + createSimplifyLocalsPass); + registerPass("simplify-locals-nonesting", + "miscellaneous locals-related optimizations (no nesting at all; " + "preserves flatness)", + createSimplifyLocalsNoNestingPass); + registerPass("simplify-locals-notee", + "miscellaneous locals-related optimizations (no tees)", + createSimplifyLocalsNoTeePass); + registerPass("simplify-locals-nostructure", + "miscellaneous locals-related optimizations (no structure)", + createSimplifyLocalsNoStructurePass); + registerPass( + "simplify-locals-notee-nostructure", + "miscellaneous locals-related optimizations (no tees or structure)", + createSimplifyLocalsNoTeeNoStructurePass); registerPass("souperify", "emit Souper IR in text form", createSouperifyPass); - registerPass("souperify-single-use", "emit Souper IR in text form (single-use nodes only)", createSouperifySingleUsePass); - registerPass("spill-pointers", "spill pointers to the C stack (useful for Boehm-style GC)", createSpillPointersPass); - registerPass("ssa", "ssa-ify variables so that they have a single assignment", createSSAifyPass); - registerPass("ssa-nomerge", "ssa-ify variables so that they have a single assignment, ignoring merges", createSSAifyNoMergePass); - registerPass("strip", "deprecated; same as strip-debug", createStripDebugPass); - registerPass("strip-debug", "strip debug info (including the names section)", createStripDebugPass); - registerPass("strip-producers", "strip the wasm producers section", createStripProducersPass); - registerPass("strip-target-features", "strip the wasm target features section", createStripTargetFeaturesPass); - registerPass("trap-mode-clamp", "replace trapping operations with clamping semantics", createTrapModeClamp); - registerPass("trap-mode-js", "replace trapping operations with js semantics", createTrapModeJS); - registerPass("untee", "removes local.tees, replacing them with sets and gets", createUnteePass); + registerPass("souperify-single-use", + "emit Souper IR in text form (single-use nodes only)", + createSouperifySingleUsePass); + registerPass("spill-pointers", + "spill pointers to the C stack (useful for Boehm-style GC)", + createSpillPointersPass); + registerPass("ssa", + "ssa-ify variables so that they have a single assignment", + createSSAifyPass); + registerPass( + "ssa-nomerge", + "ssa-ify variables so that they have a single assignment, ignoring merges", + createSSAifyNoMergePass); + registerPass( + "strip", "deprecated; same as strip-debug", createStripDebugPass); + registerPass("strip-debug", + "strip debug info (including the names section)", + createStripDebugPass); + registerPass("strip-producers", + "strip the wasm producers section", + createStripProducersPass); + registerPass("strip-target-features", + "strip the wasm target features section", + createStripTargetFeaturesPass); + registerPass("trap-mode-clamp", + "replace trapping operations with clamping semantics", + createTrapModeClamp); + registerPass("trap-mode-js", + "replace trapping operations with js semantics", + createTrapModeJS); + registerPass("untee", + "removes local.tees, replacing them with sets and gets", + createUnteePass); registerPass("vacuum", "removes obviously unneeded code", createVacuumPass); -// registerPass("lower-i64", "lowers i64 into pairs of i32s", createLowerInt64Pass); + // registerPass( + // "lower-i64", "lowers i64 into pairs of i32s", createLowerInt64Pass); } void PassRunner::addDefaultOptimizationPasses() { @@ -191,10 +337,13 @@ void PassRunner::addDefaultFunctionOptimizationPasses() { if (options.optimizeLevel >= 2 || options.shrinkLevel >= 2) { add("code-pushing"); } - add("simplify-locals-nostructure"); // don't create if/block return values yet, as coalesce can remove copies that that could inhibit + // don't create if/block return values yet, as coalesce can remove copies that + // that could inhibit + add("simplify-locals-nostructure"); add("vacuum"); // previous pass creates garbage add("reorder-locals"); - add("remove-unused-brs"); // simplify-locals opens opportunities for optimizations + // simplify-locals opens opportunities for optimizations + add("remove-unused-brs"); // if we are willing to work hard, also optimize copies before coalescing if (options.optimizeLevel >= 3 || options.shrinkLevel >= 2) { add("merge-locals"); // very slow on e.g. sqlite @@ -209,10 +358,10 @@ void PassRunner::addDefaultFunctionOptimizationPasses() { if (options.optimizeLevel >= 3 || options.shrinkLevel >= 1) { add("code-folding"); } - add("merge-blocks"); // makes remove-unused-brs more effective - add("remove-unused-brs"); // coalesce-locals opens opportunities + add("merge-blocks"); // makes remove-unused-brs more effective + add("remove-unused-brs"); // coalesce-locals opens opportunities add("remove-unused-names"); // remove-unused-brs opens opportunities - add("merge-blocks"); // clean up remove-unused-brs new blocks + add("merge-blocks"); // clean up remove-unused-brs new blocks // late propagation if (options.optimizeLevel >= 3 || options.shrinkLevel >= 2) { add("precompute-propagate"); @@ -237,10 +386,12 @@ void PassRunner::addDefaultGlobalOptimizationPostPasses() { if (options.optimizeLevel >= 2 || options.shrinkLevel >= 2) { add("inlining-optimizing"); } - add("duplicate-function-elimination"); // optimizations show more functions as duplicate + // optimizations show more functions as duplicate + add("duplicate-function-elimination"); add("remove-unused-module-elements"); add("memory-packing"); - add("directize"); // may allow more inlining/dae/etc., need --converge for that + // may allow more inlining/dae/etc., need --converge for that + add("directize"); // perform Stack IR optimizations here, at the very end of the // optimization pipeline if (options.optimizeLevel >= 2 || options.shrinkLevel >= 1) { @@ -266,7 +417,8 @@ static void dumpWast(Name name, Module* wasm) { void PassRunner::run() { static const int passDebug = getPassDebug(); if (!isNested && (options.debug || passDebug)) { - // for debug logging purposes, run each pass in full before running the other + // for debug logging purposes, run each pass in full before running the + // other auto totalTime = std::chrono::duration<double>(0); size_t padding = 0; WasmValidator::Flags validationFlags = WasmValidator::Minimal; @@ -281,7 +433,8 @@ void PassRunner::run() { dumpWast("before", wasm); } for (auto* pass : passes) { - // ignoring the time, save a printout of the module before, in case this pass breaks it, so we can print the before and after + // ignoring the time, save a printout of the module before, in case this + // pass breaks it, so we can print the before and after std::stringstream moduleBefore; if (passDebug == 2) { WasmPrinter::printModule(wasm, moduleBefore); @@ -294,9 +447,8 @@ void PassRunner::run() { auto before = std::chrono::steady_clock::now(); if (pass->isFunctionParallel()) { // function-parallel passes should get a new instance per function - ModuleUtils::iterDefinedFunctions(*wasm, [&](Function* func) { - runPassOnFunction(pass, func); - }); + ModuleUtils::iterDefinedFunctions( + *wasm, [&](Function* func) { runPassOnFunction(pass, func); }); } else { runPass(pass); } @@ -310,9 +462,14 @@ void PassRunner::run() { if (!WasmValidator().validate(*wasm, validationFlags)) { WasmPrinter::printModule(wasm); if (passDebug >= 2) { - std::cerr << "Last pass (" << pass->name << ") broke validation. Here is the module before: \n" << moduleBefore.str() << "\n"; + std::cerr << "Last pass (" << pass->name + << ") broke validation. Here is the module before: \n" + << moduleBefore.str() << "\n"; } else { - std::cerr << "Last pass (" << pass->name << ") broke validation. Run with BINARYEN_PASS_DEBUG=2 in the env to see the earlier state, or 3 to dump byn-* files for each pass\n"; + std::cerr << "Last pass (" << pass->name + << ") broke validation. Run with BINARYEN_PASS_DEBUG=2 " + "in the env to see the earlier state, or 3 to dump " + "byn-* files for each pass\n"; } abort(); } @@ -321,7 +478,8 @@ void PassRunner::run() { dumpWast(pass->name, wasm); } } - std::cerr << "[PassRunner] passes took " << totalTime.count() << " seconds." << std::endl; + std::cerr << "[PassRunner] passes took " << totalTime.count() << " seconds." + << std::endl; if (options.validate) { std::cerr << "[PassRunner] (final validation)\n"; if (!WasmValidator().validate(*wasm, validationFlags)) { @@ -331,14 +489,15 @@ void PassRunner::run() { } } } else { - // non-debug normal mode, run them in an optimal manner - for locality it is better - // to run as many passes as possible on a single function before moving to the next + // non-debug normal mode, run them in an optimal manner - for locality it is + // better to run as many passes as possible on a single function before + // moving to the next std::vector<Pass*> stack; auto flush = [&]() { if (stack.size() > 0) { // run the stack of passes on all the functions, in parallel size_t num = ThreadPool::get()->size(); - std::vector<std::function<ThreadWorkState ()>> doWorkers; + std::vector<std::function<ThreadWorkState()>> doWorkers; std::atomic<size_t> nextFunction; nextFunction.store(0); size_t numFunctions = wasm->functions.size(); @@ -380,7 +539,8 @@ void PassRunner::run() { void PassRunner::runOnFunction(Function* func) { if (options.debug) { - std::cerr << "[PassRunner] running passes on function " << func->name << std::endl; + std::cerr << "[PassRunner] running passes on function " << func->name + << std::endl; } for (auto* pass : passes) { runPassOnFunction(pass, func); @@ -425,14 +585,18 @@ struct AfterEffectFunctionChecker { if (beganWithStackIR && func->stackIR) { auto after = FunctionHasher::hashFunction(func); if (after != originalFunctionHash) { - Fatal() << "[PassRunner] PASS_DEBUG check failed: had Stack IR before and after the pass ran, and the pass modified the main IR, which invalidates Stack IR - pass should have been marked 'modifiesBinaryenIR'"; + Fatal() << "[PassRunner] PASS_DEBUG check failed: had Stack IR before " + "and after the pass ran, and the pass modified the main IR, " + "which invalidates Stack IR - pass should have been marked " + "'modifiesBinaryenIR'"; } } } }; // Runs checks on the entire module, in a non-function-parallel pass. -// In particular, in such a pass functions may be removed or renamed, track that. +// In particular, in such a pass functions may be removed or renamed, track +// that. struct AfterEffectModuleChecker { Module* module; @@ -473,7 +637,9 @@ struct AfterEffectModuleChecker { } void error() { - Fatal() << "[PassRunner] PASS_DEBUG check failed: had Stack IR before and after the pass ran, and the pass modified global function state - pass should have been marked 'modifiesBinaryenIR'"; + Fatal() << "[PassRunner] PASS_DEBUG check failed: had Stack IR before and " + "after the pass ran, and the pass modified global function " + "state - pass should have been marked 'modifiesBinaryenIR'"; } bool hasAnyStackIR() { @@ -530,7 +696,8 @@ void PassRunner::handleAfterEffects(Pass* pass, Function* func) { } int PassRunner::getPassDebug() { - static const int passDebug = getenv("BINARYEN_PASS_DEBUG") ? atoi(getenv("BINARYEN_PASS_DEBUG")) : 0; + static const int passDebug = + getenv("BINARYEN_PASS_DEBUG") ? atoi(getenv("BINARYEN_PASS_DEBUG")) : 0; return passDebug; } |