OpenASIP 2.2
Loading...
Searching...
No Matches
PRegionMarkerAnalyzer.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2012 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file PRegionMarkerAnalyzer.hh
26 *
27 * Helper class for analyzing the PREGION_START/PREGION_END markers.
28 *
29 * @author Pekka Jääskeläinen 2012
30 */
31
32#ifndef TCE_PREGION_MARKER_ANALYZER_HH
33#define TCE_PREGION_MARKER_ANALYZER_HH
34
35#include <map>
36
37namespace llvm {
38 class MachineFunction;
39 class MachineInstr;
40}
41
43public:
44 PRegionMarkerAnalyzer(const llvm::MachineFunction& MF_);
46
47 bool markersFound() const;
48 unsigned pregion(const llvm::MachineInstr &I) const;
49
50private:
51 bool isPregionEndMarker(const llvm::MachineInstr &I) const;
52 bool isPregionStartMarker(const llvm::MachineInstr &I) const;
53 unsigned parsePregionID(const llvm::MachineInstr &I) const;
54
55 void findPregions();
57 const llvm::MachineInstr& start, unsigned id);
58
59 // The machine function we are analyzing with this instance.
60 const llvm::MachineFunction& MF;
62 std::map<const llvm::MachineInstr*, unsigned> pregionIDs_;
63};
64
65#endif
unsigned parsePregionID(const llvm::MachineInstr &I) const
void propagatePregionID(const llvm::MachineInstr &start, unsigned id)
bool isPregionStartMarker(const llvm::MachineInstr &I) const
std::map< const llvm::MachineInstr *, unsigned > pregionIDs_
unsigned pregion(const llvm::MachineInstr &I) const
bool isPregionEndMarker(const llvm::MachineInstr &I) const
const llvm::MachineFunction & MF