jtb20 wrote:

> > Can you explain why the critical section version of the code is safe, and 
> > why it is an improvement over simply not collapsing the loop?
> 
> 1. I'm not saying it is safe, I'm just saying that something like this might 
> be safe
> 2. Without properly collapsing the loops, the compiler won't be able to 
> properly schedule the execution per programmer's request

Yes, OK.

The trouble is, I'm still not sure that there **is** "something like this" that 
lets the collapsed loop execute correctly with independent iterations. (There 
might be declarations in the "imperfect" part of the loop -- that's probably 
the most likely thing to be there, in fact. That makes conditionalising those 
bits or putting them inside other synthesised directives more complicated). 
Maybe I'll think about it some more.

https://github.com/llvm/llvm-project/pull/96087
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to