[LLVMdev] PBQP & CalcSpillWeights
Lang Hames
lhames at gmail.com
Fri Mar 23 10:42:50 PDT 2012
Hi Arnaud,
LiveInterval::markNotSpillable() sets the live interval's spill weight
to infinity. For well-formed PBQP graphs (i.e. ones that have some
finite-cost solution), PBQP should never chose to spill such an
interval. The two possibilities for this crash are that the input
graph has no finite-cost solution, or that you've exposed a bug in the
PBQP solver.
>From memory your target is not public, so I won't be able to reproduce
the crash myself. Is that correct?
If that's the case, I could add functionality to dump the PBQP graphs
during allocation. I think they should give me enough information to
debug the issue. Would you be able to share the PBQP graphs?
Cheers,
Lang.
On Wed, Mar 21, 2012 at 8:40 AM, Arnaud de Grandmaison
<arnaud.allarddegrandmaison at parrot.com> wrote:
>
> Hi All,
>
> I finally had a chance to get back to my pbqp trials, now using the 3.0
> release. I still hit the same assert : "Attempting to spill already spilled
> value."
>
> This is triggered because in RegAllocPBQP::mapPBQPToRegAlloc, a vreg node is
> either :
> - a physical register (problem.isPRegOption(vreg, alloc)),
> - or a spill (problem.isSpillOption(vreg, alloc))
>
> The problem is that pass CalcSpillWeights can 'hint' that it is a poor
> idea to spill this specific register with :
>
> CalcSpillWeights.cpp / VirtRegAuxInfo::CalculateWeightAndHint :
> // Mark li as unspillable if all live ranges are tiny.
> if (li.isZeroLength(LIS.getSlotIndexes())) {
> li.markNotSpillable();
> ...
>
> This hint makes the register non spillable at all for the spiller (that's the
> assert above), not just a bad-idea-to-spill-but-feasible. The pbqp allocator
> does not cope with this distinction and allways attempts to spill it.
>
> I would need some guidance on how to modify the pbqp to handle this case
> properly.
>
> Best regards,
> --
> Arnaud de Grandmaison
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list