[Beignet] Another issue with the barrier call.

Zhigang Gong zhigang.gong at linux.intel.com
Fri Dec 20 01:40:10 PST 2013


Hi List,

 

Although I submitted a patch recently to set the barrier function to
noduplicate attribute, but it seems that it still has problem.

Considering the following type of code:

 

 

Label0:

  call barrier;

 

Label1:

  .

 br i1 %cmp0, label %label2, %label0

 

label2:

  .

  .

  br label0

 

Actually, on the end of label1 BB, the function call barrier is duplicate on
both the if and else branches from the CF view.

As we are using prediction, and we compare 16 channels on the same time, if
some channels goto the if.then branch and

the others goto the if.else branch, then the barrier will be called twice.
But if on the other thread, all the channels are going

into one branch, then the barrier will be called only once. Then we will
hang at the first thread's second call to barrier.

 

I don't have a very good idea currently. One idea come to my mind is to make
a joint of the if.then and the if.else branches,

Then at the joint point, we jump to the BB which hold the barrier function
call unconditionally. Then we can gurantte that the

barrier will be called only once. The side effect of this solution is that
it introduce one more jump instruction. Any other idea?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20131220/c0b239b3/attachment-0001.html>


More information about the Beignet mailing list