[Openmp-commits] [PATCH] D56274: [OPENMP][NVPTX]Fix incompatibility of __syncthreads with LLVM, NFC.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 28 08:21:06 PDT 2019


ABataev added a comment.

In D56274#1519272 <https://reviews.llvm.org/D56274#1519272>, @arsenm wrote:

> In D56274#1519176 <https://reviews.llvm.org/D56274#1519176>, @ABataev wrote:
>
> > In D56274#1519039 <https://reviews.llvm.org/D56274#1519039>, @arsenm wrote:
> >
> > > In D56274#1517067 <https://reviews.llvm.org/D56274#1517067>, @arsenm wrote:
> > >
> > > > Is OpenMP not marking all functions as convergent?
> > >
> > >
> > > ping
> >
> >
> > Marks,but some of the optimizations ignore this attribute. I don't remebet which one exactly, something like critical edge splitting.
>
>
> I think critical edge splitting handles convergent correctly, since it is one of the motivating examples. I just looked at a random example in test/OpenMP,  and this doesn't look correct to me:
>
> __kmpc_barrier is declared as convergent, but the callers are not:
>
>   declare void @__kmpc_barrier(%struct.ident_t*, i32) #3
>   define internal void @__omp_outlined__78(i32* noalias %.global_tid., i32* noalias %.bound_tid.) #0 {
>   attributes #0 = { noinline norecurse nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="+ptx32,+sm_20" "unsafe-fp-math"="false" "use-soft-float"="false" }
>   attributes #1 = { nounwind readnone }
>   attributes #2 = { argmemonly nounwind }
>
>
> *All* functions need to be assumed convergent, not just the convergent barrier leafs.


The problem is not in the OpenMP code, it is in Cuda code. It appears only when we inline the runtime written in Cuda, where everything is marked correctly. For OpenMP code it is not necessary to mark all the functions as convergent, all required functions are marked by Cuda.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56274/new/

https://reviews.llvm.org/D56274





More information about the Openmp-commits mailing list