My experiments show a 20% speed-up on imagine-gaussian-blur
Created attachment 215764 [details] the patch
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 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.)
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.
(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.
Landed in http://trac.webkit.org/changeset/158482