本文整理汇总了C++中BitSet::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ BitSet::contains方法的具体用法?C++ BitSet::contains怎么用?C++ BitSet::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitSet
的用法示例。
在下文中一共展示了BitSet::contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: postDominates
/**
* Test if the first basic block postdominates the second one.
* @param bb1 Dominator BB.
* @param bb2 Dominated BB.
* @return True if bb1 postdominates bb2.
*/
bool PostDominance::postDominates(BasicBlock *bb1, BasicBlock *bb2) {
ASSERTP(bb1, "null BB 1");
ASSERTP(bb2, "null BB 2");
ASSERTP(bb1->cfg() == bb2->cfg(), "both BB are not owned by the same CFG");
int index = bb1->number();
ASSERTP(index >= 0, "no index for BB 1");
BitSet *set = REVERSE_POSTDOM(bb2);
ASSERTP(set, "no index for BB 2");
ASSERTP(bb1 == bb2
|| !REVERSE_POSTDOM(bb1)->contains(bb2->number())
|| !REVERSE_POSTDOM(bb2)->contains(bb1->number()),
"CFG with disconnected nodes");
return set->contains(index);
}
示例3: setCATEGORISATION
/*
* This function categorize the l-blocks in the ContextTree S (and its children)
*
* @param lineset The l-block list
* @param S The root context tree
* @param dec In an address, the number of bits representing the offset in a cache block.
*/
void CATBuilder::setCATEGORISATION(LBlockSet *lineset ,ContextTree *S ,int dec){
int size = lineset->count();
int ident;
BitSet *u = new BitSet(size);
LBlock *cachelin;
/*
* Categorize first all the l-blocks in the children ContextTree
*/
for(ContextTree::ChildrenIterator fils(S); fils; fils++){
setCATEGORISATION(lineset,fils,dec);
}
/* Now categorize the l-blocks in this ContextTree */
if(S->kind() == ContextTree::LOOP){
/*
* Call worst() on each l-block of the loop.
*/
u = SET(S);
for (int a = 0; a < size; a++){
if (u->contains(a)){
cachelin = lineset->lblock(a);
worst(cachelin ,S,lineset,dec);
}
}
}
else {
/*
* Call worst() on each l-block of this ContextTree.
*/
for(ContextTree::BBIterator bk(S); bk; bk++){
for(BasicBlock::InstIter inst(bk); inst; inst++) {
address_t adlbloc = inst->address();
for (LBlockSet::Iterator lbloc(*lineset); lbloc; lbloc++){
if ((adlbloc == (lbloc->address()))&&(bk == lbloc->bb())){
ident = lbloc->id();
cachelin = lineset->lblock(ident);
worst(cachelin ,S , lineset,dec);
}
}
}
}
}
}
示例4: reg
//.........这里部分代码省略.........
if (!ins->isCall() && safepoint)
AddRegisterToSafepoint(safepoint, reg, *vregs[use].def());
} else {
to = use->usedAtStart() ? inputOf(*ins) : outputOf(*ins);
}
} else {
to = (use->usedAtStart() || ins->isCall())
? inputOf(*ins) : outputOf(*ins);
if (use->isFixedRegister()) {
LAllocation reg(AnyRegister::FromCode(use->registerCode()));
for (size_t i = 0; i < ins->numDefs(); i++) {
LDefinition *def = ins->getDef(i);
if (def->policy() == LDefinition::PRESET && *def->output() == reg)
to = inputOf(*ins);
}
}
}
LiveInterval *interval = vregs[use].getInterval(0);
if (!interval->addRangeAtHead(inputOf(block->firstId()), forLSRA ? to : to.next()))
return false;
interval->addUse(new(alloc()) UsePosition(use, to));
live->insert(use->virtualRegister());
}
}
}
// Phis have simultaneous assignment semantics at block begin, so at
// the beginning of the block we can be sure that liveIn does not
// contain any phi outputs.
for (unsigned int i = 0; i < block->numPhis(); i++) {
LDefinition *def = block->getPhi(i)->getDef(0);
if (live->contains(def->virtualRegister())) {
live->remove(def->virtualRegister());
} else {
// This is a dead phi, so add a dummy range over all phis. This
// can go away if we have an earlier dead code elimination pass.
if (!vregs[def].getInterval(0)->addRangeAtHead(inputOf(block->firstId()),
outputOf(block->firstId())))
{
return false;
}
}
}
if (mblock->isLoopHeader()) {
// A divergence from the published algorithm is required here, as
// our block order does not guarantee that blocks of a loop are
// contiguous. As a result, a single live interval spanning the
// loop is not possible. Additionally, we require liveIn in a later
// pass for resolution, so that must also be fixed up here.
MBasicBlock *loopBlock = mblock->backedge();
while (true) {
// Blocks must already have been visited to have a liveIn set.
JS_ASSERT(loopBlock->id() >= mblock->id());
// Add an interval for this entire loop block
CodePosition from = inputOf(loopBlock->lir()->firstId());
CodePosition to = outputOf(loopBlock->lir()->lastId()).next();
for (BitSet::Iterator liveRegId(*live); liveRegId; liveRegId++) {
if (!vregs[*liveRegId].getInterval(0)->addRange(from, to))
return false;
}