forked from google/autofdo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathllvm_propeller_code_layout_scorer.h
More file actions
28 lines (22 loc) · 969 Bytes
/
Copy pathllvm_propeller_code_layout_scorer.h
File metadata and controls
28 lines (22 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef AUTOFDOLLVM_PROPELLER_CODE_LAYOUT_SCORER_H_
#define AUTOFDOLLVM_PROPELLER_CODE_LAYOUT_SCORER_H_
#include "llvm_propeller_cfg.h"
#include "llvm_propeller_options.pb.h"
namespace devtools_crosstool_autofdo {
// This class is used to calculate the layout's extended TSP score as described
// in https://ieeexplore.ieee.org/document/9050435. Specifically, it calculates
// the contribution of a single edge with a given distance based on the
// specified code layout parameters.
class PropellerCodeLayoutScorer {
public:
explicit PropellerCodeLayoutScorer(
const PropellerCodeLayoutParameters ¶ms);
double GetEdgeScore(const CFGEdge &edge, int src_sink_distance) const;
const PropellerCodeLayoutParameters &code_layout_params() const {
return code_layout_params_;
}
private:
const PropellerCodeLayoutParameters code_layout_params_;
};
} // namespace devtools_crosstool_autofdo
#endif // AUTOFDOLLVM_PROPELLER_CODE_LAYOUT_SCORER_H_