Example #1
0
/*
 * ??? 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;
			}
		}
	}