aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PBQP/Solution.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2010-09-02 05:37:52 +0000
committerLang Hames <lhames@gmail.com>2010-09-02 05:37:52 +0000
commit3522e1f08bb1dc8fdc9f687ff09443808e32915c (patch)
treef07f2a02c965ab67e66f7783d5a293b385b0597d /lib/CodeGen/PBQP/Solution.h
parentad5c8c66258210cc2a61967fff7011f6e70b1204 (diff)
downloadexternal_llvm-3522e1f08bb1dc8fdc9f687ff09443808e32915c.zip
external_llvm-3522e1f08bb1dc8fdc9f687ff09443808e32915c.tar.gz
external_llvm-3522e1f08bb1dc8fdc9f687ff09443808e32915c.tar.bz2
Added counters for PBQP reduction rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PBQP/Solution.h')
-rw-r--r--lib/CodeGen/PBQP/Solution.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/CodeGen/PBQP/Solution.h b/lib/CodeGen/PBQP/Solution.h
index 294b537..047fd04 100644
--- a/lib/CodeGen/PBQP/Solution.h
+++ b/lib/CodeGen/PBQP/Solution.h
@@ -26,15 +26,46 @@ namespace PBQP {
/// To get the selection for each node in the problem use the getSelection method.
class Solution {
private:
+
typedef std::map<Graph::NodeItr, unsigned, NodeItrComparator> SelectionsMap;
SelectionsMap selections;
+ unsigned r0Reductions, r1Reductions, r2Reductions, rNReductions;
+
public:
/// \brief Number of nodes for which selections have been made.
/// @return Number of nodes for which selections have been made.
unsigned numNodes() const { return selections.size(); }
+ /// \brief Records a reduction via the R0 rule. Should be called from the
+ /// solver only.
+ void recordR0() { ++r0Reductions; }
+
+ /// \brief Returns the number of R0 reductions applied to solve the problem.
+ unsigned numR0Reductions() const { return r0Reductions; }
+
+ /// \brief Records a reduction via the R1 rule. Should be called from the
+ /// solver only.
+ void recordR1() { ++r1Reductions; }
+
+ /// \brief Returns the number of R1 reductions applied to solve the problem.
+ unsigned numR1Reductions() const { return r1Reductions; }
+
+ /// \brief Records a reduction via the R2 rule. Should be called from the
+ /// solver only.
+ void recordR2() { ++r2Reductions; }
+
+ /// \brief Returns the number of R2 reductions applied to solve the problem.
+ unsigned numR2Reductions() const { return r2Reductions; }
+
+ /// \brief Records a reduction via the RN rule. Should be called from the
+ /// solver only.
+ void recordRN() { ++ rNReductions; }
+
+ /// \brief Returns the number of RN reductions applied to solve the problem.
+ unsigned numRNReductions() const { return rNReductions; }
+
/// \brief Set the selection for a given node.
/// @param nItr Node iterator.
/// @param selection Selection for nItr.