[OpenACC 1/11] UNIQUE internal function

Nathan Sidwell nathan@acm.org
Thu Oct 22 14:04:00 GMT 2015


On 10/22/15 04:07, Richard Biener wrote:

> Yeah, please make them either end or start a BB so we have to check
> at most a single stmt.  ECF_RETURNS_TWICE should achieve that,
> it also makes it a code motion barrier.

Just so I'm clear, you're not saying that RETURNS_TWICE will stop the call being 
duplicated though?

thinking a little further, a code motion barrier is stronger than I need (but 
conservatively safe).  For instance:

UNIQUE (HEAD)
for (...)
{
   a = <loop_invariant_expr>
}
UNIQUE (TAIL)

It would be safe and desirable to move that loop invariant to before the UNIQUE. 
  Perhaps it won't matter in practice -- after all having N physical threads 
calculate it in parallel (just after the HEAD marker, but before the loop) will 
probably take no longer than a single thread doing it while the others wait.[*]

nathan

[*] ut it will take more power.



More information about the Gcc-patches mailing list