|
From: David G. <dav...@gm...> - 2011-07-13 00:30:24
|
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? Can anybody help me with this? Thank you very much, David |
|
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 |
|
From: David G. <dav...@gm...> - 2011-07-15 00:15:25
|
Thanks for the answer! I'm currently developing a simple profiling tool on top of lackey. I will use the output for a given execution on a simulator I've created. What I would like is some kind of execution cost to be associated with each superblock. Is there any way to get the cost of each block? (maybe in terms of instructions executed?) 2011/7/14 Josef Weidendorfer <Jos...@gm...>: > 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 > |
|
From: Josef W. <Jos...@gm...> - 2011-07-15 13:33:05
|
On Friday 15 July 2011, David Granchinho wrote: > Thanks for the answer! I'm currently developing a simple profiling > tool on top of lackey. I will use the output for a given execution on > a simulator I've created. What I would like is some kind of execution > cost to be associated with each superblock. As superblocks can have multiple exits, there is not really a good way to predefine a cost per block. Josef > Is there any way to get > the cost of each block? (maybe in terms of instructions executed?) > > 2011/7/14 Josef Weidendorfer <Jos...@gm...>: > > 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 > > > > |