Bug 152223 - Move the API(s) from B3MathExtras.h into FTL::Output
Summary: Move the API(s) from B3MathExtras.h into FTL::Output
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks: 154319
  Show dependency treegraph
 
Reported: 2015-12-12 22:19 PST by Filip Pizlo
Modified: 2016-02-16 18:26 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-12-12 22:19:12 PST
We need to keep the layering to a minimum.  We already have a layer that is meant to help you generate low-level IR, and that's called FTL::Output.  So, anytime we are tempted to add helpers that generate B3 IR on behalf of a client, we should just put that into FTL::Output.

Also, anytime you create a helper that generates IR that consists of multiple basic blocks, you need to be mindful of where you insert those blocks.  It's not good to just put them at the end of the procedure, since that breaks any range-based analyses.  It also makes IR hard to read.  This is why FTL::Output has all of this functionality about "inserting blocks before".  So, in its current form, the API in B3MathExtras.h is suboptimal and produces weird-looking IR, and to fix that we would need to endow it with FTL::Output's smarts.  Seems better to just move it to FTL::Output.
Comment 1 Benjamin Poulain 2015-12-13 13:54:03 PST
As I wrote in the ChangeLog, that was about easier testing and perf work.

Point taken for the poor block layout though. I should definitely fix that.
Comment 2 Filip Pizlo 2015-12-13 14:27:13 PST
(In reply to comment #1)
> As I wrote in the ChangeLog, that was about easier testing and perf work.
> 
> Point taken for the poor block layout though. I should definitely fix that.

It would be great if FTL::Output was moved to B3, and became the default way to build B3 IR.  Then our tests could use it.

I think you can already instantiate FTL::Output from testb3, so we could start moving in that direction now.