OpenASIP 2.2
Loading...
Searching...
No Matches
PRegionAliasAnalyzer.cc
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 PRegionAliasAnalyzer.cc
26 *
27 * Implementation of PRegionAliasAnalyzer class.
28 *
29 * Too much copy-paste here.
30 *
31 * TODO: This should be handled by memory categories, not alias analyzers.
32 * This may cause too much ddg edges, slowing things down
33 *
34 * @author Faked Heikki Kultala 2007 (heikki.kultala-no.spam-tut.fi)
35 * Real auther from log: 1737 pekka.j
36 * @note rating: red
37 */
38
40
41#include "MoveNode.hh"
42#include "Move.hh"
44#include "Terminal.hh"
45
46using namespace TTAProgram;
47using namespace TTAMachine;
48
49bool
55
59 const ProgramOperation& pop1,
60 const ProgramOperation& pop2,
62
63 const MoveNode *rawSrc1 = addressOperandMove(pop1);
64 const MoveNode *rawSrc2 = addressOperandMove(pop2);
65 if (rawSrc1 == NULL || rawSrc2 == NULL ||
66 !rawSrc1->isMove() || !rawSrc2->isMove()) return ALIAS_UNKNOWN;
67
68 const TTAProgram::Move &m1 = rawSrc1->move();
69 const TTAProgram::Move &m2 = rawSrc2->move();
72 return ALIAS_UNKNOWN;
73
74 int pregion1 = m1.annotation(
76 int pregion2 = m2.annotation(
78
79 if (pregion1 != pregion2) {
80
81#if 0
83 << "### based on PREGION info, removed a memory edge between "
84 << m1.toString() << " (" << pregion1 << ") and "
85 << m2.toString() << " (" << pregion2 << ")" << std::endl;
87 << "### src lines: ";
88 if (m1.hasSourceLineNumber())
90 << m1.sourceLineNumber() << " ";
91 if (m2.hasSourceLineNumber())
93 << m2.sourceLineNumber() << " ";
94 Application::logStream() << std::endl;
95#endif
96 return ALIAS_FALSE;
97 }
98
99 return ALIAS_UNKNOWN;
100}
101
static std::ostream & logStream()
static const MoveNode * addressOperandMove(const ProgramOperation &po)
bool isMove() const
TTAProgram::Move & move()
virtual AliasingResult analyze(DataDependenceGraph &ddg, const ProgramOperation &pop1, const ProgramOperation &pop2, MoveNodeUse::BBRelation bbInfo)
virtual bool isAddressTraceable(DataDependenceGraph &ddg, const ProgramOperation &pop)
ProgramAnnotation annotation(int index, ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
bool hasAnnotations(ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
bool hasSourceLineNumber() const
Definition Move.cc:445
std::string toString() const
Definition Move.cc:436
int sourceLineNumber() const
Definition Move.cc:459
@ ANN_PARALLEL_REGION_ID
The ID from the _TCEPREGION_START(N) markers.