Bug 197398 - [B3] Tails of size 1 can be safely duplicated regardless of their number of predecessors
Summary: [B3] Tails of size 1 can be safely duplicated regardless of their number of p...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Trivial
Assignee: Robin Morisset
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-29 17:59 PDT by Robin Morisset
Modified: 2019-05-03 10:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.27 KB, patch)
2019-04-29 18:03 PDT, Robin Morisset
rmorisset: review-
rmorisset: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2019-04-29 17:59:21 PDT
Replacing a jump (one instruction) by a branch/switch/return (whatever the jump points to, also one instruction) cannot increase the number of instructions, and can be helpful to to things like foldPathConstants that run just after duplicateTails.

In most cases we already do this, as the block will have few predecessors, but we should do it unconditionally.
The benefit is almost certainly negligible (a quick experiment shows we only neglect to do this optimization 23 times on all of JetStream2), but the change is microscopic too (literally just one line).
Comment 1 Robin Morisset 2019-04-29 18:03:13 PDT
Created attachment 368524 [details]
Patch
Comment 2 Robin Morisset 2019-04-29 18:14:04 PDT
Comment on attachment 368524 [details]
Patch

Forget it, I got confused between successors and predecessors, this check does not do at all what I thought.