Bug 123638 - FTL should use a simple optimization pipeline by default
Summary: FTL should use a simple optimization pipeline by default
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 112840
  Show dependency treegraph
 
Reported: 2013-11-01 14:58 PDT by Filip Pizlo
Modified: 2013-11-01 19:24 PDT (History)
8 users (show)

See Also:


Attachments
the patch (5.12 KB, patch)
2013-11-01 14:59 PDT, Filip Pizlo
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2013-11-01 14:58:59 PDT
My experiments show a 20% speed-up on imagine-gaussian-blur
Comment 1 Filip Pizlo 2013-11-01 14:59:56 PDT
Created attachment 215764 [details]
the patch
Comment 2 Nadav Rotem 2013-11-01 15:12:02 PDT
270        llvm->AddInstructionCombiningPass(modulePasses);
271        llvm->AddPromoteMemoryToRegisterPass(modulePasses);

I imagine that you are running instcombine and constantprop before mem2reg because the code you generate does not have too many allocas. Have you considered running earlyCSE instead of GVN ?

Have you considered adding LICM or JumpThreading ?
Comment 3 Geoffrey Garen 2013-11-01 15:13:36 PDT
Comment on attachment 215764 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=215764&action=review

r=me

> Source/JavaScriptCore/ftl/FTLCompile.cpp:271
> +        llvm->AddPromoteMemoryToRegisterPass(modulePasses);

Shouldn't mem2reg always go first? (My understanding is that it's a simple transformation that eliminates a lot of dummy code, and relies only on convention and not on any other optimizations.)
Comment 4 Nadav Rotem 2013-11-01 16:08:29 PDT
mem2reg should go first, unless we know that FTL generates all of its computations in registers. I know that this is the case for all of the arithmetic calculations but I am not sure about the other stuff.
Comment 5 Filip Pizlo 2013-11-01 19:21:41 PDT
(In reply to comment #4)
> mem2reg should go first, unless we know that FTL generates all of its computations in registers. I know that this is the case for all of the arithmetic calculations but I am not sure about the other stuff.

Y'all have a point.  LowerDFGToLLVM produces very few alloca's so it probably doesn't matter *too* much.  I'll changed it.
Comment 6 Filip Pizlo 2013-11-01 19:24:20 PDT
Landed in http://trac.webkit.org/changeset/158482