<div>Hello,<br /><br />Now Clang's (GCC too) inliner is not so clever and relate on <br />set of predefined constants. I <br />think these constants are not optimal in many cases. I can say more - in <br />Clang sources you can find a FIXME comment about "We should base our <br />constants for inliner on something more sciencetific". Of course for <br />different applications there are different optimal sets of these <br />predefined constants, but I think it's possible to optimize current <br />constants by testing several sets of constants on some train dataset and measure efficiency of inline constants.</div><div>With this we can find better constants and potentially improve performance.<br /><br />I found some related papers: <br />1) <a target="_blank" href="https://arxiv.org/pdf/1801.04405.pdf">https://arxiv.org/pdf/1801.04405.pdf</a> - Good survey about <br />machine-learning based optimizations for compilers in general <br /><br />2) <a target="_blank" href="http://www.cresco.enea.it/SC05/schedule/pdf/pap274.pdf">http://www.cresco.enea.it/SC05/schedule/pdf/pap274.pdf</a> - optimizing <br />inlining constants for Java <br /><br />3) <a target="_blank" href="https://scholarship.rice.edu/bitstream/handle/1911/18991/3216796.PDF">https://scholarship.rice.edu/bitstream/handle/1911/18991/3216796.PDF</a> <br />- didn't read it yet, butt looks promising <br /><br /><br />So I have several questions: <br /><br />1) What do you think about the idea? <br /><br />2) Can you recommend anything related? Probably somebody already done <br />this kind of research for Clang/GCC earlier and I didn't find it. <br /> </div><div> </div><div>-- </div><div>Best regards, Alexander Zaitsev</div><div> </div>