• Manos Koukoutos's avatar
    [turbofan] Optimize traps after Merge/IfTrue/IfFalse · 29afe1e5
    Manos Koukoutos authored
    We implement two optimizations for trap conditionals for patterns that
    come up in wasm-gc.
    In case of a Merge followed by a trap, where the path conditions of all
    branches of the Merge contain the trap condition, we lift the trap into
    the branches of the Merge.
    In case of a Branch whose IfTrue branch is followed by a TrapIf with the
    same condition, we replace it with the trap followed by the IfFalse
    branch. Symmetrically for IfFalse and TrapUnless.
    
    Bug: v8:7748
    Change-Id: I43040aebe60eab7b2230fc3130e3b8250e8b2f45
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3190109Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
    Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#77181}
    29afe1e5
branch-elimination.h 5.22 KB