summaryrefslogtreecommitdiff
path: root/src/ir/drop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Extend drop.h and use it in Directize (#5713)Alon Zakai2023-05-101-30/+24
| | | | | | | | | | | | | | | | | | | | | This adds an option to ignore effects in the parent in getDroppedChildrenAndAppend. With that, this becomes usable in more places, like Directize, basically in situations where we know we can ignore effects in the parent (since we've inferred they are not needed). This lets us get rid of some boilerplate code in Directize. Diff without whitespace is a lot smaller. A large other part of the diff is a rename of curr => parent which I think it makes it more readable as then parent/children is a clear contrast, and then the new parameter "ignore/ notice parent effects" is obviously connected to "parent". The top comment in drop.cpp is removed as it just duplicated the top comment in the header drop.h. This is basically NFC but using drop.h does bring the advantage of emitting less code, see the test changes, so it is noticeable in the IR. This is a refactoring PR in preparation for a larger improvement to Directize that will also benefit from this new drop capability.
* Fix OptimizeInstructions on null trap of struct.set (#5449)Alon Zakai2023-01-241-3/+7
| | | StructSet cannot be dropped.
* [NFC] Refactor getDroppedChildrenAndAppend (#4849)Max Graey2022-08-011-3/+3
|
* Fix unreachable handling in getDroppedChildrenAndAppend (#4834)Heejin Ahn2022-07-261-1/+1
| | | | | | | The previous code assumes if `last`'s type is unreachable it traps. But it's not always the case because it can be other instructions like `br` whose type is unreachable but doesn't necessarily trap. Context: https://github.com/WebAssembly/binaryen/pull/4827#discussion_r929395477
* Move method implementations to drop.cpp (#4823)Heejin Ahn2022-07-251-0/+87
Now that we have `getDroppedUnconditionalChildrenAndAppend`, all passes need to use it rather than the old `getDroppedChildrenAndAppend`, which is used within the new method `getDroppedUnconditionalChildrenAndAppend`. This creates `drop.cpp` and move method implementations in drop.h there, and merge two methods given that the old method is not supposed to be used from outside anyway, and drops `Unconditional` from the new method name because this is the only method and doesn't have to be specific about that.