|
From: Josef W. <Jos...@gm...> - 2011-07-14 16:40:45
|
On Wednesday 13 July 2011, David Granchinho wrote: > Hi! I couldn't find anywhere in the documentation what is the meaning > of the cost of a basic block: bb->cost_count. It measures the cost of > the execution of this block in terms of what? This is the number of 64bit counters that have to be allocated for a given BB. The BB structure does not store costs itself, but only information to be able to allocate space for holding cost values (part of a BBCC struct in array bbcc->cost). The reason is that you want to maintain multiple cost counters for the same BB, e.g. for each thread. The counters store some cost, therefore the name "cost_counters". To see what kind of cost is stored in which 64bit value, there is a array of InstrInfo (bb->instr[]), which gives you for every guest instruction of the BB the start offset for cost counters and the set of cost types that is stored for each guest instruction. This set depends on the instruction type and simulation requested. E.g. for a guest instruction doing no memory access and cache simulation is requested, the set includes event types "Ir/I1mr/ILmr". Not sure this description was helpful for you. Why are you interested in that? Josef |