>The maximum scratch size is known, then we can initialize the set to contains 
>all elements in [0 - (max_scratch_size/32 - 1))]. Then each time to allocate, 
>we just call set.begin()/erase to extract one from the set. And at 
>deallocation, we just call set.insert() to insert a virtual scratch register 
>to the set. 
What do you think?
[Ruiling] Your idea sound interesting. But if we use a set like you mentioned, 
Is it easy to allocate contiguous scratch memory of size 32*2 or 32*4 after 
some allocation/deallocation?
       And consider that we may choose to spill some registers in a 
SelectionVector in one spill instruction. We need contiguous scratch memory.

> +      if(exp->maxID <= cur->minID) {
It should be exp->maxID < cur->minID. If the exp->maxID == cur->minID, then it 
is still alive and we should not expire it.
[Ruiling] oh, I previously thought maxID always maps to 'src'. And src & dst 
can use same scratch memory. You are right. I will change this.

Thanks!
Ruiling
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to