Question about JIT Peephole optimizations

Andrew Haley aph-open at littlepinkcloud.com
Sat Sep 18 08:53:19 UTC 2021


On 9/18/21 8:34 AM, Yi Yang wrote:
> I want to know why we do not add more rules to allow merging more instructions by using peephole(Like llvm/lib/CodeGen/PeepholeOptimizer.cpp). And I noticed that many rules have been commented out. Is there any reason for that? Is it because XXNode::Ideal does most of the work? Or has profiling proved that peepholes are not profitable/balanced between compilation time and their outcome? Or it's difficult to do peepholes by rule-based approach? Are we worthy of continuing to work on it?

It's not very likely that you'll be able to find a peephole rule that
isn't handled better in other ways. I don't think I've ever found one.
The closest we ever got was the LDP optimization, and that's much
happier in the assembler.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-compiler-dev mailing list