[llvm-dev] Spill Weight In InlineSpiller
Quentin Colombet via llvm-dev
llvm-dev at lists.llvm.org
Wed Sep 20 09:44:35 PDT 2017
> On Sep 19, 2017, at 11:29 PM, Kerbow, Austin Michael via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> I'm trying to compute and print a weighted spill cost based upon the execution frequency of the basic block where the spill is inserted. My goal is to analyse what effect scheduling changes have on the sum of this weighted spill cost in some benchmarks. I've experimented doing this directly before a spill is inserted in InlineSpiller.cpp using MBFI.getBlockFreq() and LiveIntervals::getSpillWeight. My question is why are these functions sometimes indicating that the frequency of a block, or the weight of a spill is 0? A frequency of 0 doesn't make sense to me.
I don’t know how PGO is implemented in that respect so take it with a grain of salt, but if you’re using PGO, I am guessing that if something is not executed in your training run, you may end up with a 0 frequency.
That being said, I thought we had mechanism to prevent that for happening. Therefore, that sounds like a bug (or you’re looking at an unreachable block?)
> Austin Kerbow
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
More information about the llvm-dev