[#llvm-LiveIntervals-getSpillWeight-05] = xref:llvm.adoc[llvm]::xref:llvm/LiveIntervals.adoc[LiveIntervals]::getSpillWeight :relfileprefix: ../../ :mrdocs: Calculate the spill weight to assign to a basic block. == Synopsis Declared in `<llvm/CodeGen/LiveIntervals.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static float getSpillWeight( bool isDef, bool isUse, xref:llvm/MachineBlockFrequencyInfo.adoc[MachineBlockFrequencyInfo] const* MBFI, xref:llvm/MachineBasicBlock.adoc[MachineBasicBlock] const* MBB, xref:llvm/ProfileSummaryInfo.adoc[ProfileSummaryInfo]* PSI = nullptr); ---- == Description If `PSI` is provided the calculation is altered for optsize functions. == Return Value Computed spill weight for the basic block. == Parameters [cols="1,4"] |=== | Name| Description | *isDef* | True if the register is defined in the block. | *isUse* | True if the register is used in the block. | *MBFI* | Block frequency info used to weight the spill cost. | *MBB* | Basic block whose spill weight is computed. | *PSI* | Optional profile summary used for size‐optimized functions. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#