Bug 197398

Summary: [B3] Tails of size 1 can be safely duplicated regardless of their number of predecessors
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: RESOLVED INVALID    
Severity: Trivial CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch rmorisset: review-, rmorisset: commit-queue-

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.