OpenASIP 2.2
Loading...
Searching...
No Matches
MemoryAliasAnalyzer.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 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 MemoryAliasAnalyzer.hh
26 *
27 * Declaration of Memory Alias Analyzer interface
28 *
29 * @author Heikki Kultala 2006-2009 (heikki.kultala-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_MEMORY_ALIAS_ANALYZER_HH
34#define TTA_MEMORY_ALIAS_ANALYZER_HH
35
36namespace TTAProgram {
37 class Procedure;
38}
39
42class Operation;
43class MoveNode;
44
45#include "MoveNodeUse.hh"
46
48public:
49
51 // Only Use ALIAS_TRUE if they really fully alias.
52 // It's used for transitivity optimizations.
56
58
60 DataDependenceGraph& ddg, const ProgramOperation& pop1,
61 const ProgramOperation& pop2, MoveNodeUse::BBRelation bbInfo) = 0;
62
63 /**
64 * Checks whether the analyzer knows anything about the address.
65 *
66 * ie. if it can return true or false to some query
67 * concerning this address.
68 *
69 * @return true if analyzer can know something about the address.
70 */
71 virtual bool isAddressTraceable(
73 const ProgramOperation& pop) = 0;
74
76protected:
78 int index1,
79 int index2,
80 const ProgramOperation& pop1,
81 const ProgramOperation& pop2);
82 static const MoveNode* addressOperandMove(const ProgramOperation&po);
83
98
99 static TwoPartAddressOperandDetection findTwoPartAddressOperands(
100 const ProgramOperation& po);
101
103 DataDependenceGraph& ddg, const MoveNode &mn, long& loopIncrement);
104
105 static const MoveNode* findIncrement(const MoveNode& mn, long& increment);
106
107 static const MoveNode* detectConstantScale(const MoveNode& mn, int &shiftAmount);
108private:
109 unsigned int mausOfOperation(const Operation& op);
110};
111
112#endif
virtual AliasingResult analyze(DataDependenceGraph &ddg, const ProgramOperation &pop1, const ProgramOperation &pop2, MoveNodeUse::BBRelation bbInfo)=0
static const MoveNode * findIncrement(const MoveNode &mn, long &increment)
AliasingResult compareIndeces(int index1, int index2, const ProgramOperation &pop1, const ProgramOperation &pop2)
static const MoveNode * searchLoopIndexBasedIncrement(DataDependenceGraph &ddg, const MoveNode &mn, long &loopIncrement)
virtual bool isAddressTraceable(DataDependenceGraph &ddg, const ProgramOperation &pop)=0
static const MoveNode * detectConstantScale(const MoveNode &mn, int &shiftAmount)
static const MoveNode * addressOperandMove(const ProgramOperation &po)
static TwoPartAddressOperandDetection findTwoPartAddressOperands(const ProgramOperation &po)
unsigned int mausOfOperation(const Operation &op)
virtual void initProcedure(TTAProgram::Procedure &)