[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-18 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D81031#2160281 , @jhuber6 wrote:

> In D81031#2159943 , @jdoerfert wrote:
>
> > In D81031#2159895 , @jhuber6 wrote:
> >
> > > Fixing errors caused by unused attribute sets. Adding missing attributes 
> > > to barrier_codegen.cpp.
> > >
> > > Should I go ahead and commit this considering the previous was 
> > > temporarily reverted? Or should I just wait a bit to see if it fails 
> > > testing again.
> >
> >
> > If you only did minor modifications and no major problem showed up, the 
> > previous LGTM still stands. You should (always) run a full make check-all 
> > locally (or better on a server) to verify no other issues are known.
> >
> > FWIW, it happens that we break bots and patches get reverted. That is not 
> > great but also not too bad.
>
>
> I did run a check-all but apparently the last build I did didn't build clang 
> for some reason so it wasn't included in the tests. I ran cmake again with 
> the same options and it seemed to build clang this time so I don't know what 
> that was about.
>
> After that I ran the tests again and I passed everything except these four. I 
> reverted my commit and pulled from master and still failed the same test so 
> I'm assuming it's a problem with my CUDA installation rather than the patch.
>
>   libomp :: env/kmp_set_dispatch_buf.c
>   libomp :: worksharing/for/kmp_set_dispatch_buf.c
>   libomptarget :: mapping/declare_mapper_target_update.cpp
>   libomptarget :: offloading/target_depend_nowait.cpp
>   


They might be flaky, incompatible with your environment, or broken by something 
else. You should not assume master is always working ;)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-18 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

In D81031#2159943 , @jdoerfert wrote:

> In D81031#2159895 , @jhuber6 wrote:
>
> > Fixing errors caused by unused attribute sets. Adding missing attributes to 
> > barrier_codegen.cpp.
> >
> > Should I go ahead and commit this considering the previous was temporarily 
> > reverted? Or should I just wait a bit to see if it fails testing again.
>
>
> If you only did minor modifications and no major problem showed up, the 
> previous LGTM still stands. You should (always) run a full make check-all 
> locally (or better on a server) to verify no other issues are known.
>
> FWIW, it happens that we break bots and patches get reverted. That is not 
> great but also not too bad.


I did run a check-all but apparently the last build I did didn't build clang 
for some reason so it wasn't included in the tests. I ran cmake again with the 
same options and it seemed to build clang this time so I don't know what that 
was about.

After that I ran the tests again and I passed everything except these four. I 
reverted my commit and pulled from master and still failed the same test so I'm 
assuming it's a problem with my CUDA installation rather than the patch.

  libomp :: env/kmp_set_dispatch_buf.c
  libomp :: worksharing/for/kmp_set_dispatch_buf.c
  libomptarget :: mapping/declare_mapper_target_update.cpp
  libomptarget :: offloading/target_depend_nowait.cpp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In D81031#2159895 , @jhuber6 wrote:

> Fixing errors caused by unused attribute sets. Adding missing attributes to 
> barrier_codegen.cpp.
>
> Should I go ahead and commit this considering the previous was temporarily 
> reverted? Or should I just wait a bit to see if it fails testing again.


If you only did minor modifications and no major problem showed up, the 
previous LGTM still stands. You should (always) run a full make check-all 
locally (or better on a server) to verify no other issues are known.

FWIW, it happens that we break bots and patches get reverted. That is not great 
but also not too bad.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 278949.
jhuber6 added a comment.

Fixing errors caused by unused attribute sets. Adding missing attributes to 
barrier_codegen.cpp.

Should I go ahead and commit this considering the previous was temporarily 
reverted? Or should I just wait a bit to see if it fails testing again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031

Files:
  clang/test/OpenMP/barrier_codegen.cpp
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/test/Transforms/OpenMP/add_attributes.ll
  llvm/test/Transforms/OpenMP/parallel_deletion.ll

Index: llvm/test/Transforms/OpenMP/parallel_deletion.ll
===
--- llvm/test/Transforms/OpenMP/parallel_deletion.ll
+++ llvm/test/Transforms/OpenMP/parallel_deletion.ll
@@ -393,7 +393,7 @@
 
 define internal void @.omp.reduction.reduction_func(i8* %arg, i8* %arg1) {
 ; CHECK-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
-; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #10
+; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #{{[0-9]+}}
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:[[TMP:%.*]] = bitcast i8* [[ARG1]] to i32**
 ; CHECK-NEXT:[[TMP2:%.*]] = load i32*, i32** [[TMP]], align 8
Index: llvm/test/Transforms/OpenMP/add_attributes.ll
===
--- llvm/test/Transforms/OpenMP/add_attributes.ll
+++ llvm/test/Transforms/OpenMP/add_attributes.ll
@@ -890,373 +890,373 @@
 ; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare dso_local i32 @omp_get_supported_active_levels() #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_barrier(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_flush(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_flush(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: 

[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 added a comment.

In D81031#2159796 , @leonardchan wrote:

> In D81031#2159646 , @sstefan1 wrote:
>
> > Just in case you haven't seen already, 
> > `clang/test/OpenMP/barrier_codegen.cpp` needs to be updated as well.
>
>
> Also chiming in to say we're seeing these failures on our bots 
> (https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8874490785658285184/+/steps/clang/0/steps/test/0/stdout?format=raw).
>  Could you send out an update?


Very sorry, in an earlier version I had that fixed but for whatever reason it 
got lost somewhere when I did a pull and I didn't notice. What's bizarre is 
that I ran a check-all and it didn't seem to catch it on my end. I'll push an 
update with that fixed and removing the unused attributes ASAP.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment.

In D81031#2159646 , @sstefan1 wrote:

> Just in case you haven't seen already, 
> `clang/test/OpenMP/barrier_codegen.cpp` needs to be updated as well.


Also chiming in to say we're seeing these failures on our bots 
(https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8874490785658285184/+/steps/clang/0/steps/test/0/stdout?format=raw).
 Could you send out an update?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Stefan Stipanovic via Phabricator via cfe-commits
sstefan1 added a comment.

Just in case you haven't seen already, `clang/test/OpenMP/barrier_codegen.cpp` 
needs to be updated as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Joseph Huber via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG09fe0c5ab9ca: [OpenMP] Add Additional Function Attribute 
Information to OMPKinds.def (authored by jhuber6).

Changed prior to commit:
  https://reviews.llvm.org/D81031?vs=278905=278908#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031

Files:
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/test/Transforms/OpenMP/add_attributes.ll
  llvm/test/Transforms/OpenMP/parallel_deletion.ll

Index: llvm/test/Transforms/OpenMP/parallel_deletion.ll
===
--- llvm/test/Transforms/OpenMP/parallel_deletion.ll
+++ llvm/test/Transforms/OpenMP/parallel_deletion.ll
@@ -393,7 +393,7 @@
 
 define internal void @.omp.reduction.reduction_func(i8* %arg, i8* %arg1) {
 ; CHECK-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
-; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #10
+; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #{{[0-9]+}}
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:[[TMP:%.*]] = bitcast i8* [[ARG1]] to i32**
 ; CHECK-NEXT:[[TMP2:%.*]] = load i32*, i32** [[TMP]], align 8
Index: llvm/test/Transforms/OpenMP/add_attributes.ll
===
--- llvm/test/Transforms/OpenMP/add_attributes.ll
+++ llvm/test/Transforms/OpenMP/add_attributes.ll
@@ -890,373 +890,373 @@
 ; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare dso_local i32 @omp_get_supported_active_levels() #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_barrier(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_flush(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_flush(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void 

[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-17 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 278905.
jhuber6 added a comment.

Removed usage of alignment and deference attributes and changed several 
functions to use barrier attributes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031

Files:
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/test/Transforms/OpenMP/add_attributes.ll
  llvm/test/Transforms/OpenMP/parallel_deletion.ll

Index: llvm/test/Transforms/OpenMP/parallel_deletion.ll
===
--- llvm/test/Transforms/OpenMP/parallel_deletion.ll
+++ llvm/test/Transforms/OpenMP/parallel_deletion.ll
@@ -393,7 +393,7 @@
 
 define internal void @.omp.reduction.reduction_func(i8* %arg, i8* %arg1) {
 ; CHECK-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func
-; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #10
+; CHECK-SAME: (i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], i8* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #{{[0-9]+}}
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:[[TMP:%.*]] = bitcast i8* [[ARG1]] to i32**
 ; CHECK-NEXT:[[TMP2:%.*]] = load i32*, i32** [[TMP]], align 8
Index: llvm/test/Transforms/OpenMP/add_attributes.ll
===
--- llvm/test/Transforms/OpenMP/add_attributes.ll
+++ llvm/test/Transforms/OpenMP/add_attributes.ll
@@ -890,373 +890,373 @@
 ; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare dso_local i32 @omp_get_supported_active_levels() #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_barrier(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_flush(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_flush(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*) #0
 
-; CHECK: Function Attrs: nounwind
-; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32) #0
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
-; CHECK-NEXT: declare void @__kmpc_end_master(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void 

[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-07-16 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

Apologies for the wait. I think with the comments below this is good to go. If 
you have questions or concerns, let me know. Thanks for these changes!




Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:587
+? AttributeSet(EnumAttr(NoUnwind), EnumAttr(WillReturn))
 : AttributeSet(EnumAttr(NoUnwind)))
 

I think (for now) we should even remove willreturn here. I'm not sure we have 
forward progress guarantees for C + OpenMP :(



Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:621
+? AttributeSet(EnumAttr(WriteOnly), EnumAttr(NoFree))
+: AttributeSet())
+

Here and above, `nocapture`.



Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:632
+   EnumAttrInt(DereferenceableOrNull, 8))
+: AttributeSet())
+

I guess this means the attribute is returned, right? If we are sure it is, we 
can add the `returned` attribute. I checked `__kmpc_threadprivate_cached` and I 
wasn't sure the argument is actually returned, maybe I misunderstand what this 
means. We could add a comment here.

We should also not go for alignment or dereferenceability for now.



Comment at: llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:729
+__OMP_RTL_ATTRS(__kmpc_end_critical, BarrierAttrs, AttributeSet(),
+ParamAttrs(ReadOnlyPtrAttrs, AttributeSet(), AttributeSet()))
+

I think this will mitigate PR46210, which is good! 



Comment at: llvm/test/Transforms/OpenMP/add_attributes.ll:1542
+; OPTIMISTIC: ; Function Attrs: inaccessiblemem_or_argmemonly nofree nosync 
nounwind willreturn
+; OPTIMISTIC-NEXT: declare void @__kmpc_end_single(%struct.ident_t* nofree 
readonly, i32)
+

the `single` ones should be barrier like



Comment at: llvm/test/Transforms/OpenMP/add_attributes.ll:1551
+; OPTIMISTIC: ; Function Attrs: nofree nosync nounwind willreturn
+; OPTIMISTIC-NEXT: declare void @__kmpc_end_taskgroup(%struct.ident_t* nofree 
readonly, i32)
+

barrier like



Comment at: llvm/test/Transforms/OpenMP/add_attributes.ll:1614
+; OPTIMISTIC: ; Function Attrs: nofree nosync nounwind willreturn
+; OPTIMISTIC-NEXT: declare void @__kmpc_omp_wait_deps(%struct.ident_t* nofree 
readonly, i32, i32, i8* nofree readonly, i32, i8*)
+

barrier like, probably all `wait` functions



Comment at: llvm/test/Transforms/OpenMP/add_attributes.ll:1653
+; OPTIMISTIC: ; Function Attrs: nofree nosync nounwind willreturn
+; OPTIMISTIC-NEXT: declare void @__kmpc_doacross_wait(%struct.ident_t* nofree 
readonly, i32, i64* nofree readonly)
+

this is a barrier like directive. Let's just mark all doacross as such for now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D81031: [OpenMP] Add Additional Function Attribute Information to OMPKinds.def

2020-06-11 Thread Joseph Huber via Phabricator via cfe-commits
jhuber6 updated this revision to Diff 270239.
jhuber6 added a comment.
Herald added subscribers: cfe-commits, aaron.ballman.
Herald added a project: clang.

Adding parameter and return attributes for pointers. There are some arguments I 
wasn't sure how they should be classified, like if every argument should be 
`NoCapture` because the lifetime of the memory isn't visible to the caller. For 
returned void pointers I assumed that they were aligned by eight in cases I 
found that the return value was a pointer to an OpenMP Runtime struct, 
otherwise I set it to one. I might need to double check some of the attributes 
to make sure they make sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81031

Files:
  clang/test/OpenMP/barrier_codegen.cpp
  llvm/include/llvm/Frontend/OpenMP/OMPKinds.def
  llvm/test/Transforms/OpenMP/add_attributes.ll

Index: llvm/test/Transforms/OpenMP/add_attributes.ll
===
--- llvm/test/Transforms/OpenMP/add_attributes.ll
+++ llvm/test/Transforms/OpenMP/add_attributes.ll
@@ -663,6 +663,8 @@
 
 declare void @__kmpc_proxy_task_completed_ooo(i8*)
 
+declare i32 @__kmpc_omp_reg_task_with_affinity(%struct.ident_t*, i32, i8*, i32, i8*)
+
 ; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare dso_local void @omp_set_num_threads(i32)
 
@@ -888,370 +890,373 @@
 ; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare dso_local i32 @omp_get_supported_active_levels() #0
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare void @__kmpc_barrier(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: Function Attrs: nounwind
 ; CHECK-NEXT: declare i32 @__kmpc_cancel(%struct.ident_t*, i32, i32)
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_cancel_barrier(%struct.ident_t*, i32)
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare void @__kmpc_flush(%struct.ident_t*)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-Next: declare void @__kmpc_flush(%struct.ident_t*)
 
-; CHECK: Function Attrs: nounwind
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare i32 @__kmpc_global_thread_num(%struct.ident_t*)
 
-; CHECK: Function Attrs: nounwind
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...)
 
-; CHECK-NOT: Function Attrs
-; CHECK: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32)
+; CHECK: ; Function Attrs: nounwind
+; CHECK-NEXT: declare i32 @__kmpc_omp_taskwait(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare i32 @__kmpc_omp_taskyield(%struct.ident_t*, i32, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_push_num_threads(%struct.ident_t*, i32, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_push_proc_bind(%struct.ident_t*, i32, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_serialized_parallel(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_end_serialized_parallel(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare i32 @__kmpc_master(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_end_master(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_critical(%struct.ident_t*, i32, [8 x i32]*)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_critical_with_hint(%struct.ident_t*, i32, [8 x i32]*, i32)
 
-; CHECK: Function Attrs: inaccessiblemem_or_argmemonly
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_end_critical(%struct.ident_t*, i32, [8 x i32]*)
 
-; CHECK: Function Attrs: nounwind
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_begin(%struct.ident_t*, i32)
 
-; CHECK: Function Attrs: nounwind
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare void @__kmpc_end(%struct.ident_t*)
 
-; CHECK: Function Attrs: nounwind
+; CHECK: ; Function Attrs: nounwind
 ; CHECK-NEXT: declare i32 @__kmpc_reduce(%struct.ident_t*, i32, i32,