- IgnoreSet ignoreSet;
-
- //! Builds a PBQP cost vector.
- template <typename Container>
- PBQPVector* buildCostVector(const Container &allowed,
- PBQPNum spillCost) const;
-
- //! \brief Builds a PBQP interference matrix.
- //!
- //! @return Either a pointer to a non-zero PBQP matrix representing the
- //! allocation option costs, or a null pointer for a zero matrix.
- //!
- //! Expects allowed sets for two interfering LiveIntervals. These allowed
- //! sets should contain only allocable registers from the LiveInterval's
- //! register class, with any interfering pre-colored registers removed.
- template <typename Container>
- PBQPMatrix* buildInterferenceMatrix(const Container &allowed1,
- const Container &allowed2) const;
-
- //!
- //! Expects allowed sets for two potentially coalescable LiveIntervals,
- //! and an estimated benefit due to coalescing. The allowed sets should
- //! contain only allocable registers from the LiveInterval's register
- //! classes, with any interfering pre-colored registers removed.
- template <typename Container>
- PBQPMatrix* buildCoalescingMatrix(const Container &allowed1,
- const Container &allowed2,
- PBQPNum cBenefit) const;
-
- //! \brief Helper function for constructInitialPBQPProblem().
- //!
- //! This function iterates over the Function we are about to allocate for
- //! and computes spill costs.
- void calcSpillCosts();
-
- //! \brief Scans the MachineFunction being allocated to find coalescing
- // opportunities.
- void findCoalescingOpportunities();
-
- //! \brief Constructs a PBQP problem representation of the register
- //! allocation problem for this function.
- //!
- //! @return a PBQP solver object for the register allocation problem.
- pbqp* constructPBQPProblem();
-
- //! \brief Given a solved PBQP problem maps this solution back to a register
- //! assignment.
- bool mapPBQPToRegAlloc(pbqp *problem);
+ LiveIntervalSet vregIntervalsToAlloc,
+ emptyVRegIntervals;
+ NodeVector problemNodes;
+
+
+ /// Builds a PBQP cost vector.
+ template <typename RegContainer>
+ PBQP::Vector buildCostVector(unsigned vReg,
+ const RegContainer &allowed,
+ const CoalesceMap &cealesces,
+ PBQP::PBQPNum spillCost) const;
+
+ /// \brief Builds a PBQP interference matrix.
+ ///
+ /// @return Either a pointer to a non-zero PBQP matrix representing the
+ /// allocation option costs, or a null pointer for a zero matrix.
+ ///
+ /// Expects allowed sets for two interfering LiveIntervals. These allowed
+ /// sets should contain only allocable registers from the LiveInterval's
+ /// register class, with any interfering pre-colored registers removed.
+ template <typename RegContainer>
+ PBQP::Matrix* buildInterferenceMatrix(const RegContainer &allowed1,
+ const RegContainer &allowed2) const;
+
+ ///
+ /// Expects allowed sets for two potentially coalescable LiveIntervals,
+ /// and an estimated benefit due to coalescing. The allowed sets should
+ /// contain only allocable registers from the LiveInterval's register
+ /// classes, with any interfering pre-colored registers removed.
+ template <typename RegContainer>
+ PBQP::Matrix* buildCoalescingMatrix(const RegContainer &allowed1,
+ const RegContainer &allowed2,
+ PBQP::PBQPNum cBenefit) const;
+
+ /// \brief Finds coalescing opportunities and returns them as a map.
+ ///
+ /// Any entries in the map are guaranteed coalescable, even if their
+ /// corresponding live intervals overlap.
+ CoalesceMap findCoalesces();
+
+ /// \brief Finds the initial set of vreg intervals to allocate.
+ void findVRegIntervalsToAlloc();
+
+ /// \brief Constructs a PBQP problem representation of the register
+ /// allocation problem for this function.
+ ///
+ /// @return a PBQP solver object for the register allocation problem.
+ PBQP::Graph constructPBQPProblem();
+
+ /// \brief Adds a stack interval if the given live interval has been
+ /// spilled. Used to support stack slot coloring.
+ void addStackInterval(const LiveInterval *spilled,MachineRegisterInfo* mri);
+
+ /// \brief Given a solved PBQP problem maps this solution back to a register
+ /// assignment.
+ bool mapPBQPToRegAlloc(const PBQP::Solution &solution);
+
+ /// \brief Postprocessing before final spilling. Sets basic block "live in"
+ /// variables.
+ void finalizeAlloc() const;