summaryrefslogtreecommitdiff
path: root/test/gtest/stringify.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use the new wat parser in tests (#6556)Thomas Lively2024-04-291-51/+73
| | | | | | | Some of the example and gtest tests parse wat. Update them to use the new wat parser, fixing problems with their text input. In one case, comment out an outlining test entirely for now because the new parser produces different IR that changes the test output, but it is not obvious how to understand and fix the test.
* Require `then` and `else` with `if` (#6201)Thomas Lively2024-01-041-8/+8
| | | | | | | | | | | | We previously supported (and primarily used) a non-standard text format for conditionals in which the condition, if-true expression, and if-false expression were all simply s-expression children of the `if` expression. The standard text format, however, requires the use of `then` and `else` forms to introduce the if-true and if-false arms of the conditional. Update the legacy text parser to require the standard format and update all tests to match. Update the printer to print the standard format as well. The .wast and .wat test inputs were mechanically updated with this script: https://gist.github.com/tlively/85ae7f01f92f772241ec994c840ccbb1
* [Outlining] Adding more tests (#6117)Ashley Nelson2023-11-151-1/+1
| | | | | | Checking a couple of testing TODOs off and adding more tests of the outlining pass for outlining: - a sequence at the beginning of an existing function - a sequence that is outlined into a function that takes no arguments - multiple sequences from the same source function into different outlined functions
* [Outlining] Adds Outlining pass (#6110)Ashley Nelson2023-11-131-26/+6
| | | Adds an outlining pass that performs outlining on a module end to end, and two tests.
* [Outlining] Filter branches & returns (#6024)Ashley Nelson2023-10-181-56/+95
| | | Adds a function to filter branch and return instructions from being included in potential outlining candidates.
* [Outlining] Filter Local Set (#6018)Ashley Nelson2023-10-181-1/+42
| | | | | Adds a general purpose walker named FilterStringifyWalker, intended to walk control flow and take note of whether any of the expressions satisfy the condition. Also includes an << overload for SuffixTree::RepeatedSubstring to make debugging easier.
* Added type to fix template deduction failure (#6014)Ashley Nelson2023-10-171-2/+1
| | | Fixes #6003
* [Outlining] Adds separator context (#5977)Ashley Nelson2023-10-041-39/+67
| | | Adds a std::variant to represent the context of why a unique symbol was inserted in the stringified module. This allows us to pass necessary contextual data to subclasses of StringifyWalker in a structured manner.
* [Outlining] Adds SuffixTree::RepeatSubstring dedupe test (#5972)Ashley Nelson2023-10-041-0/+17
| | | This PR adds a StringProcessor struct intended to hold functions that filter vectors of SuffixTree::RepeatedSubstring, and a test of its first functionality, removing overlapping repeated substrings.
* Outlining Test Improvements (#5971)Ashley Nelson2023-09-251-13/+21
| | | Abstracts repeat code
* [Outlining] Integration test for suffix_tree and stringify (#5839)Ashley Nelson2023-08-031-3/+40
| | | Adds an integration test that identifies the substrings of a stringified wasm module using the suffix_tree.
* [Outlining] Changing stringify values to 32-bit (#5832)Ashley Nelson2023-07-211-45/+45
| | | | | The LLVM suffix tree expects to be provided with a vector of 32-bit unsigned integers. This PR makes it easier to integrate our wasm program string with the suffix tree. Because the range of possible values is reduced from 2^64 to 2^32, a signed integer was added to manage the next separator value and ensure we're using every possible negative number.
* [Outlining] HashStringifyWalker (#5810)Ashley Nelson2023-07-131-2/+93
| | | | | This PR is part of the effort to bring Outlining to Binaryen. HashStringifyWalker is a subclass of StringifyWalker #5772, and used to encode a wasm module as a "string". Our "string" is a vector and each symbol is a uint64_t, providing us with a capacity of 2^64 symbols.
* [Outlining] StringifyWalker (#5772)Ashley Nelson2023-06-301-0/+127
StringifyWalker is a new Walker with UnifiedExpressionVisitor. This walker performs a shallow visit of control-flow (try, if, block, loop) expressions and their simple expression siblings before then visiting the children of each control-flow expression in postorder. As a result, this walker un-nests nested control flow structures, so the expression visit order does not correspond to a normal postorder traversal of the function.