OpenASIP
2.0
|
#include <MemoryAliasAnalyzer.hh>
Classes | |
struct | TwoPartAddressOperandDetection |
Public Types | |
enum | AliasingResult { ALIAS_FALSE = 0, ALIAS_TRUE = 1, ALIAS_UNKNOWN = 2, ALIAS_PARTIAL = 3 } |
Public Member Functions | |
virtual void | initProcedure (TTAProgram::Procedure &) |
virtual AliasingResult | analyze (DataDependenceGraph &ddg, const ProgramOperation &pop1, const ProgramOperation &pop2, MoveNodeUse::BBRelation bbInfo)=0 |
virtual bool | isAddressTraceable (DataDependenceGraph &ddg, const ProgramOperation &pop)=0 |
virtual | ~MemoryAliasAnalyzer () |
Protected Member Functions | |
AliasingResult | compareIndeces (int index1, int index2, const ProgramOperation &pop1, const ProgramOperation &pop2) |
Static Protected Member Functions | |
static const MoveNode * | addressOperandMove (const ProgramOperation &po) |
static TwoPartAddressOperandDetection | findTwoPartAddressOperands (const ProgramOperation &po) |
static const MoveNode * | searchLoopIndexBasedIncrement (DataDependenceGraph &ddg, const MoveNode &mn, long &loopIncrement) |
static const MoveNode * | findIncrement (const MoveNode &mn, long &increment) |
static const MoveNode * | detectConstantScale (const MoveNode &mn, int &shiftAmount) |
Private Member Functions | |
unsigned int | mausOfOperation (const Operation &op) |
Definition at line 47 of file MemoryAliasAnalyzer.hh.
Enumerator | |
---|---|
ALIAS_FALSE | |
ALIAS_TRUE | |
ALIAS_UNKNOWN | |
ALIAS_PARTIAL |
Definition at line 50 of file MemoryAliasAnalyzer.hh.
|
inlinevirtual |
Definition at line 75 of file MemoryAliasAnalyzer.hh.
|
staticprotected |
Gets the direct address-writing move of a ProgramOperation which is a memory operation.
If none found, return null
po | programOperation whose address write move is being searched. |
Definition at line 147 of file MemoryAliasAnalyzer.cc.
References MoveNodeSet::at(), MoveNodeSet::count(), Operation::input(), ProgramOperation::inputNode(), Operand::isAddress(), Operation::numberOfInputs(), ProgramOperation::operation(), and Operation::usesMemory().
|
pure virtual |
Implemented in OffsetAliasAnalyzer, FalseAliasAnalyzer, LLVMAliasAnalyzer, StackAliasAnalyzer, ConstantAliasAnalyzer, PRegionAliasAnalyzer, and GlobalVsStackAA.
Referenced by DataDependenceGraphBuilder::analyzeMemoryAlias().
|
protected |
Compares two indeces (memory addresses or part of memory address). Checks memory operand size and return unknown for partial alias.
This methods takes care of checking memory access size and handling partial aliasing (returning unknown for those)
index1 | first index to compare |
index2 | second index to compare |
mn1 | first node |
mn2 | second node |
Definition at line 62 of file MemoryAliasAnalyzer.cc.
References ALIAS_FALSE, ALIAS_TRUE, ALIAS_UNKNOWN, mausOfOperation(), and ProgramOperation::operation().
|
staticprotected |
Definition at line 389 of file MemoryAliasAnalyzer.cc.
References MoveNodeSet::at(), MoveNodeSet::count(), ProgramOperation::inputNode(), SimValue::intValue(), MoveNode::isSourceConstant(), MoveNode::isSourceOperation(), MoveNode::isSourceVariable(), MoveNode::move(), Operation::name(), ProgramOperation::operation(), TTAProgram::Move::source(), MoveNode::sourceOperation(), and TTAProgram::Terminal::value().
Referenced by searchLoopIndexBasedIncrement().
|
staticprotected |
Definition at line 273 of file MemoryAliasAnalyzer.cc.
References MoveNodeSet::at(), MoveNodeSet::count(), ProgramOperation::inputNode(), SimValue::intValue(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediate(), MoveNode::isSourceOperation(), MoveNode::move(), Operation::name(), ProgramOperation::operation(), TTAProgram::Move::source(), MoveNode::sourceOperation(), and TTAProgram::Terminal::value().
Referenced by OffsetAliasAnalyzer::analyzeLoopPtrIncrease(), and searchLoopIndexBasedIncrement().
|
staticprotected |
Definition at line 175 of file MemoryAliasAnalyzer.cc.
References MemoryAliasAnalyzer::TwoPartAddressOperandDetection::ADD, MemoryAliasAnalyzer::TwoPartAddressOperandDetection::clear(), Operation::dag(), Operation::dagCount(), OperationDAGEdge::dstOperand(), OperationDAG::endNodes(), BoostGraph< GraphNode, GraphEdge >::inDegree(), BoostGraph< GraphNode, GraphEdge >::inEdge(), Operation::input(), Operand::isAddress(), Operation::name(), MemoryAliasAnalyzer::TwoPartAddressOperandDetection::NOT_FOUND, Operation::numberOfInputs(), MemoryAliasAnalyzer::TwoPartAddressOperandDetection::offsetOperation, MemoryAliasAnalyzer::TwoPartAddressOperandDetection::operand1, MemoryAliasAnalyzer::TwoPartAddressOperandDetection::operand2, TerminalNode::operandIndex(), ProgramOperation::operation(), BoostGraph< GraphNode, GraphEdge >::predecessors(), OperationNode::referencedOperation(), MemoryAliasAnalyzer::TwoPartAddressOperandDetection::SUB, BoostGraph< GraphNode, GraphEdge >::tailNode(), and Operation::usesMemory().
|
inlinevirtual |
Definition at line 57 of file MemoryAliasAnalyzer.hh.
|
pure virtual |
Checks whether the analyzer knows anything about the address.
ie. if it can return true or false to some query concerning this address.
Implemented in FalseAliasAnalyzer, LLVMAliasAnalyzer, OffsetAliasAnalyzer, StackAliasAnalyzer, ConstantAliasAnalyzer, PRegionAliasAnalyzer, and GlobalVsStackAA.
|
private |
Returns the size of memory operation memory access in mau's. if unknown, returns 0.
Definition at line 100 of file MemoryAliasAnalyzer.cc.
References __func__, Operation::dag(), Operation::dagCount(), OperationDAG::endNodes(), Operation::input(), Operand::isAddress(), Operand::memoryUnits(), Operation::numberOfInputs(), OperationNode::referencedOperation(), and Operation::usesMemory().
Referenced by compareIndeces().
|
staticprotected |
Definition at line 321 of file MemoryAliasAnalyzer.cc.
References MoveNodeSet::at(), MoveNodeSet::count(), detectConstantScale(), findIncrement(), ProgramOperation::inputNode(), SimValue::intValue(), MoveNode::isSourceConstant(), MoveNode::isSourceVariable(), MoveNode::move(), Operation::name(), DataDependenceGraph::onlyRegisterRawSource(), ProgramOperation::operation(), TTAProgram::Move::source(), MoveNode::sourceOperation(), and TTAProgram::Terminal::value().