On 6/18/19 12:07 PM, Segher Boessenkool wrote: > On Tue, Jun 18, 2019 at 11:34:03AM +0200, Martin Liška wrote: >> I've got it. So it's situation where you have distribution equal to 50% and >> 50%. Note that it's >> the only valid situation where both edges with be >= 50%. That's the >> threshold for which >> we speculatively devirtualize edges. > > But that 50% is a magic number, isn't it?
Yes :) Apparently LLVM does that for probability >= 30%: https://code.woboq.org/llvm/llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp.html#36 > Maybe 20% works better, and > then you need a top5 (in the worst case). I would then generalize to N, for now I'm waiting for Honza. Martin > > > Segher >