本文整理汇总了C++中LBlock::address方法的典型用法代码示例。如果您正苦于以下问题:C++ LBlock::address方法的具体用法?C++ LBlock::address怎么用?C++ LBlock::address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LBlock
的用法示例。
在下文中一共展示了LBlock::address方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: worst
/*
* ??? This function really categorizes the lblock "line"... ???
* Annotates the "line" with ALWAYSMISS/ALWAYSHIT/FIRSTMISS/FIRSTHIT
* In the case of FIRSTMISS, also annotate with the loop-header of the most inner loop.
*/
void CATBuilder::worst(LBlock *line , ContextTree *node , LBlockSet *idset, int dec){
int number = idset->count();
BasicBlock *bb = line->bb();
LBlock *cacheline;
BitSet *in = new BitSet(number);
in = IN(bb);
//int count = 0;
bool nonconflitdetected = false;
bool continu = false;
unsigned long tagcachline,tagline;
//test if it's the lbloc which find in the same memory block
/*
* If the IN(line) = {LB} and cacheblock(line)==cacheblock(LB), then
* nonconflict (Always Hit)
*/
if (in->count() == 1){
for (int i=0;i < number;i++){
if (in->contains(i)){
cacheline = idset->lblock(i);
tagcachline = ((unsigned long)cacheline->address()) >> dec;
unsigned long tagline = ((unsigned long)line->address()) >> dec;
if (tagcachline == tagline )
nonconflitdetected = true;
}
}
}
示例2: processLBlockSet
void Builder::processLBlockSet(WorkSpace *fw, otawa::ccg::LBlockSet *lbset) {
ASSERT(fw);
ASSERT(lbset);
const hard::Cache *cache = hard::CACHE_CONFIGURATION(fw)->instCache();
// Create the CCG
Collection *ccgs = Graph::GRAPHS(fw);
if(!ccgs) {
ccgs = new Collection(cache->rowCount());
fw->addProp(new DeletableProperty<Collection *>(Graph::GRAPHS, ccgs));
}
Graph *ccg = new Graph;
ccgs->ccgs[lbset->line()] = ccg;
// Initialization
for(LBlockSet::Iterator lblock(*lbset); lblock; lblock++) {
Node *node = new Node(lblock);
ccg->add(node);
Graph::NODE(lblock) = node;
}
// Run the DFA
Problem prob(lbset, lbset->count(), cache, fw);
const CFGCollection *coll = INVOLVED_CFGS(fw);
dfa::XCFGVisitor<Problem> visitor(*coll, prob);
dfa::XIterativeDFA<dfa::XCFGVisitor<Problem> > engine(visitor);
engine.process();
// Add the annotations from the DFA result
for (CFGCollection::Iterator cfg(coll); cfg; cfg++) {
for (CFG::BBIterator block(*cfg); block; block++) {
dfa::XCFGVisitor<Problem>::key_t pair(*cfg, *block);
dfa::BitSet *bitset = engine.in(pair);
block->addProp(new DeletableProperty<dfa::BitSet *>(IN, new dfa::BitSet(*bitset)));
}
}
// Detecting the non conflict state of each lblock
BasicBlock *BB;
LBlock *line;
int length = lbset->count();
for(LBlockSet::Iterator lbloc(*lbset); lbloc; lbloc++)
if(lbloc->id() != 0 && lbloc->id() != length - 1) {
BB = lbloc->bb();
dfa::BitSet *inid = IN(BB);
for(dfa::BitSet::Iterator bit(*inid); bit; bit++)
line = lbset->lblock(*bit);
if(cache->block(line->address()) == cache->block(lbloc->address())
&& BB != line->bb())
NON_CONFLICT(lbloc) = true;
}
// Building the ccg edges using DFA
length = lbset->count();
address_t adinst;
LBlock *aux;
for (CFGCollection::Iterator cfg(coll); cfg; cfg++) {
for (CFG::BBIterator bb(*cfg); bb; bb++) {
if ((cfg != ENTRY_CFG(fw)) || (!bb->isEntry() && !bb->isExit())) {
dfa::BitSet *info = IN(bb);
ASSERT(info);
bool test = false;
bool visit;
for(BasicBlock::InstIter inst(bb); inst; inst++) {
visit = false;
adinst = inst->address();
for (LBlockSet::Iterator lbloc(*lbset); lbloc; lbloc++){
address_t address = lbloc->address();
// the first lblock in the BB it's a conflict
if(adinst == address && !test && bb == lbloc->bb()) {
for (int i = 0; i< length; i++)
if (info->contains(i)) {
LBlock *lblock = lbset->lblock(i);
Node *node = Graph::NODE(lblock);
new Edge (node, Graph::NODE(lbloc));
}
aux = lbloc;
test = true;
visit = true;
break;
}
if(adinst == address && !visit && bb == lbloc->bb()) {
new Edge(Graph::NODE(aux), Graph::NODE(lbloc));
aux = lbloc;
break;
}
}
}
}
}
}
// build edge to LBlock end
BasicBlock *exit = ENTRY_CFG(fw)->exit();
LBlock *end = lbset->lblock(length-1);
dfa::BitSet *info = IN(exit);
for (int i = 0; i< length; i++)
//.........这里部分代码省略.........