[Truffle] Loop count propagation
Stefan Marr
java at stefan-marr.de
Wed May 28 13:21:36 UTC 2014
Hi Chris:
While skimming through your JRuby changes I saw something I haven’t noticed before:
Pass loop counts up to the first call target for a method that is not a block.
https://github.com/jruby/jruby/commit/74934f06299f896170e37cd538c594f6dd27fb35
What’s the idea behind that change? I don’t know enough about the corresponding compiler heuristics, so, it is not directly obvious to me why you propagate the loop count up to the enclosing methods.
If a method has a high loop count, does it mean it gets more attention by the optimizer?
Or is the idea to move the start point, for where and when to optimizer stars optimizing, up to the outer lexical scope to avoid optimizing only inner blocks? I guess, if that would happen, these inner blocks would access the outer lexical scope and thereby crossing the boundary between units of optimization?
Also, you added branch probability to your while nodes and if nodes, what kind of impact do you see for that?
(one of the relevant commits was: Using CompilerDirectives.injectBranchProbability in the DoWhile nodes
https://github.com/jruby/jruby/commit/3845bbb106313bf7c4b0624a7fe8ac71940708b4)
Thanks
Stefan
--
Stefan Marr
INRIA Lille - Nord Europe
http://stefan-marr.de/research/
More information about the graal-dev
mailing list