//===- SpillPlacement.h - Optimal Spill Code Placement ---------*- C++ -*--===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This analysis computes the optimal spill code placement between basic blocks. // // The runOnMachineFunction() method only precomputes some profiling information // about the CFG. The real work is done by prepare(), addConstraints(), and // finish() which are called by the register allocator. // // Given a variable that is live across multiple basic blocks, and given // constraints on the basic blocks where the variable is live, determine which // edge bundles should have the variable in a register and which edge bundles // should have the variable in a stack slot. // // The returned bit vector can be used to place optimal spill code at basic // block entries and exits. Spill code placement inside a basic block is not // considered. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_CODEGEN_SPILLPLACEMENT_H #define LLVM_LIB_CODEGEN_SPILLPLACEMENT_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SparseSet.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Support/BlockFrequency.h" namespace llvm { class BitVector; class EdgeBundles; class MachineBlockFrequencyInfo; class MachineFunction; class SpillPlacement : public MachineFunctionPass { … }; } // end namespace llvm #endif // LLVM_LIB_CODEGEN_SPILLPLACEMENT_H