Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-24 Thread Hans Wennborg via cfe-commits
Oops, it did. Thanks for reminding me; I've merged that in r296139.

On Thu, Feb 23, 2017 at 11:13 PM, Hahnfeld, Jonas
<hahnf...@itc.rwth-aachen.de> wrote:
> Hi Hans,
>
> Did r295474 fall off your radar? Sorry that I asked for both commits in one 
> email, should I reply to the other original commit?
>
> Thanks,
> Jonas
>
>> -Original Message-
>> From: hwennb...@google.com [mailto:hwennb...@google.com] On Behalf
>> Of Hans Wennborg
>> Sent: Thursday, February 23, 2017 7:46 PM
>> To: Alexey Bataev
>> Cc: Hahnfeld, Jonas; cfe-commits@lists.llvm.org
>> Subject: Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation
>> point
>>
>> Thanks! r296000.
>>
>> On Wed, Feb 22, 2017 at 8:15 PM, Alexey Bataev <a.bat...@hotmail.com>
>> wrote:
>> > Yes, approved
>> >
>> > Best regards,
>> > Alexey Bataev
>> >
>> >> 23 февр. 2017 г., в 1:00, Hans Wennborg <h...@chromium.org>
>> написал(а):
>> >>
>> >> Alexey: ping?
>> >>
>> >>> On Tue, Feb 21, 2017 at 11:07 AM, Hans Wennborg
>> <h...@chromium.org> wrote:
>> >>> I'm Ok with it if Alexey approves.
>> >>>
>> >>> On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
>> >>> <hahnf...@itc.rwth-aachen.de> wrote:
>> >>>> Hi Hans, Alexey,
>> >>>>
>> >>>> can we merge this commit and r295474 for the 4.0 release or is it
>> >>>> already too late for that? I will totally understand that and can
>> >>>> apply these commits locally prior to installing.
>> >>>> However, I think that these changes are quite focussed and bear
>> >>>> minimal possibility of introducing regressions.
>> >>>>
>> >>>> Thanks,
>> >>>> Jonas
>> >>>>
>> >>>> Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
>> >>>> cfe-commits:
>> >>>>
>> >>>> Author: hahnfeld
>> >>>> Date: Fri Feb 17 12:32:51 2017
>> >>>> New Revision: 295473
>> >>>>
>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
>> >>>> Log:
>> >>>> [OpenMP] Remove barriers at cancel and cancellation point
>> >>>>
>> >>>> This resolves a deadlock with the cancel directive when there is no
>> >>>> explicit cancellation point. In that case, the implicit barrier
>> >>>> acts as cancellation point. After removing the barrier after
>> >>>> cancel, the now unmatched barrier for the explicit cancellation
>> >>>> point has to go as well.
>> >>>>
>> >>>> This has probably worked before rL255992: With the calls for the
>> >>>> explicit barrier, it was sure that all threads passed a barrier before
>> exiting.
>> >>>>
>> >>>> Reported by Simon Convent and Joachim Protze!
>> >>>>
>> >>>> Differential Revision: https://reviews.llvm.org/D30088
>> >>>>
>> >>>> Modified:
>> >>>>cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
>> >>>>cfe/trunk/test/OpenMP/cancel_codegen.cpp
>> >>>>cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


RE: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-23 Thread Hahnfeld, Jonas via cfe-commits
Hi Hans,

Did r295474 fall off your radar? Sorry that I asked for both commits in one 
email, should I reply to the other original commit?

Thanks,
Jonas

> -Original Message-
> From: hwennb...@google.com [mailto:hwennb...@google.com] On Behalf
> Of Hans Wennborg
> Sent: Thursday, February 23, 2017 7:46 PM
> To: Alexey Bataev
> Cc: Hahnfeld, Jonas; cfe-commits@lists.llvm.org
> Subject: Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation
> point
> 
> Thanks! r296000.
> 
> On Wed, Feb 22, 2017 at 8:15 PM, Alexey Bataev <a.bat...@hotmail.com>
> wrote:
> > Yes, approved
> >
> > Best regards,
> > Alexey Bataev
> >
> >> 23 февр. 2017 г., в 1:00, Hans Wennborg <h...@chromium.org>
> написал(а):
> >>
> >> Alexey: ping?
> >>
> >>> On Tue, Feb 21, 2017 at 11:07 AM, Hans Wennborg
> <h...@chromium.org> wrote:
> >>> I'm Ok with it if Alexey approves.
> >>>
> >>> On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
> >>> <hahnf...@itc.rwth-aachen.de> wrote:
> >>>> Hi Hans, Alexey,
> >>>>
> >>>> can we merge this commit and r295474 for the 4.0 release or is it
> >>>> already too late for that? I will totally understand that and can
> >>>> apply these commits locally prior to installing.
> >>>> However, I think that these changes are quite focussed and bear
> >>>> minimal possibility of introducing regressions.
> >>>>
> >>>> Thanks,
> >>>> Jonas
> >>>>
> >>>> Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
> >>>> cfe-commits:
> >>>>
> >>>> Author: hahnfeld
> >>>> Date: Fri Feb 17 12:32:51 2017
> >>>> New Revision: 295473
> >>>>
> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
> >>>> Log:
> >>>> [OpenMP] Remove barriers at cancel and cancellation point
> >>>>
> >>>> This resolves a deadlock with the cancel directive when there is no
> >>>> explicit cancellation point. In that case, the implicit barrier
> >>>> acts as cancellation point. After removing the barrier after
> >>>> cancel, the now unmatched barrier for the explicit cancellation
> >>>> point has to go as well.
> >>>>
> >>>> This has probably worked before rL255992: With the calls for the
> >>>> explicit barrier, it was sure that all threads passed a barrier before
> exiting.
> >>>>
> >>>> Reported by Simon Convent and Joachim Protze!
> >>>>
> >>>> Differential Revision: https://reviews.llvm.org/D30088
> >>>>
> >>>> Modified:
> >>>>cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> >>>>cfe/trunk/test/OpenMP/cancel_codegen.cpp
> >>>>cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp


smime.p7s
Description: S/MIME cryptographic signature
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-23 Thread Hans Wennborg via cfe-commits
Thanks! r296000.

On Wed, Feb 22, 2017 at 8:15 PM, Alexey Bataev  wrote:
> Yes, approved
>
> Best regards,
> Alexey Bataev
>
>> 23 февр. 2017 г., в 1:00, Hans Wennborg  написал(а):
>>
>> Alexey: ping?
>>
>>> On Tue, Feb 21, 2017 at 11:07 AM, Hans Wennborg  wrote:
>>> I'm Ok with it if Alexey approves.
>>>
>>> On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
>>>  wrote:
 Hi Hans, Alexey,

 can we merge this commit and r295474 for the 4.0 release or is it already
 too late for that? I will totally understand that and can apply these
 commits locally prior to installing.
 However, I think that these changes are quite focussed and bear minimal
 possibility of introducing regressions.

 Thanks,
 Jonas

 Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
 cfe-commits:

 Author: hahnfeld
 Date: Fri Feb 17 12:32:51 2017
 New Revision: 295473

 URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
 Log:
 [OpenMP] Remove barriers at cancel and cancellation point

 This resolves a deadlock with the cancel directive when there is no 
 explicit
 cancellation point. In that case, the implicit barrier acts as cancellation
 point. After removing the barrier after cancel, the now unmatched barrier
 for
 the explicit cancellation point has to go as well.

 This has probably worked before rL255992: With the calls for the explicit
 barrier, it was sure that all threads passed a barrier before exiting.

 Reported by Simon Convent and Joachim Protze!

 Differential Revision: https://reviews.llvm.org/D30088

 Modified:
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
cfe/trunk/test/OpenMP/cancel_codegen.cpp
cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-22 Thread Alexey Bataev via cfe-commits
Yes, approved

Best regards,
Alexey Bataev

> 23 февр. 2017 г., в 1:00, Hans Wennborg  написал(а):
> 
> Alexey: ping?
> 
>> On Tue, Feb 21, 2017 at 11:07 AM, Hans Wennborg  wrote:
>> I'm Ok with it if Alexey approves.
>> 
>> On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
>>  wrote:
>>> Hi Hans, Alexey,
>>> 
>>> can we merge this commit and r295474 for the 4.0 release or is it already
>>> too late for that? I will totally understand that and can apply these
>>> commits locally prior to installing.
>>> However, I think that these changes are quite focussed and bear minimal
>>> possibility of introducing regressions.
>>> 
>>> Thanks,
>>> Jonas
>>> 
>>> Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
>>> cfe-commits:
>>> 
>>> Author: hahnfeld
>>> Date: Fri Feb 17 12:32:51 2017
>>> New Revision: 295473
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
>>> Log:
>>> [OpenMP] Remove barriers at cancel and cancellation point
>>> 
>>> This resolves a deadlock with the cancel directive when there is no explicit
>>> cancellation point. In that case, the implicit barrier acts as cancellation
>>> point. After removing the barrier after cancel, the now unmatched barrier
>>> for
>>> the explicit cancellation point has to go as well.
>>> 
>>> This has probably worked before rL255992: With the calls for the explicit
>>> barrier, it was sure that all threads passed a barrier before exiting.
>>> 
>>> Reported by Simon Convent and Joachim Protze!
>>> 
>>> Differential Revision: https://reviews.llvm.org/D30088
>>> 
>>> Modified:
>>>cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
>>>cfe/trunk/test/OpenMP/cancel_codegen.cpp
>>>cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-22 Thread Hans Wennborg via cfe-commits
Alexey: ping?

On Tue, Feb 21, 2017 at 11:07 AM, Hans Wennborg  wrote:
> I'm Ok with it if Alexey approves.
>
> On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
>  wrote:
>> Hi Hans, Alexey,
>>
>> can we merge this commit and r295474 for the 4.0 release or is it already
>> too late for that? I will totally understand that and can apply these
>> commits locally prior to installing.
>> However, I think that these changes are quite focussed and bear minimal
>> possibility of introducing regressions.
>>
>> Thanks,
>> Jonas
>>
>> Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
>> cfe-commits:
>>
>> Author: hahnfeld
>> Date: Fri Feb 17 12:32:51 2017
>> New Revision: 295473
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
>> Log:
>> [OpenMP] Remove barriers at cancel and cancellation point
>>
>> This resolves a deadlock with the cancel directive when there is no explicit
>> cancellation point. In that case, the implicit barrier acts as cancellation
>> point. After removing the barrier after cancel, the now unmatched barrier
>> for
>> the explicit cancellation point has to go as well.
>>
>> This has probably worked before rL255992: With the calls for the explicit
>> barrier, it was sure that all threads passed a barrier before exiting.
>>
>> Reported by Simon Convent and Joachim Protze!
>>
>> Differential Revision: https://reviews.llvm.org/D30088
>>
>> Modified:
>> cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
>> cfe/trunk/test/OpenMP/cancel_codegen.cpp
>> cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-21 Thread Hans Wennborg via cfe-commits
I'm Ok with it if Alexey approves.

On Fri, Feb 17, 2017 at 10:52 AM, Hahnfeld, Jonas
 wrote:
> Hi Hans, Alexey,
>
> can we merge this commit and r295474 for the 4.0 release or is it already
> too late for that? I will totally understand that and can apply these
> commits locally prior to installing.
> However, I think that these changes are quite focussed and bear minimal
> possibility of introducing regressions.
>
> Thanks,
> Jonas
>
> Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via
> cfe-commits:
>
> Author: hahnfeld
> Date: Fri Feb 17 12:32:51 2017
> New Revision: 295473
>
> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
> Log:
> [OpenMP] Remove barriers at cancel and cancellation point
>
> This resolves a deadlock with the cancel directive when there is no explicit
> cancellation point. In that case, the implicit barrier acts as cancellation
> point. After removing the barrier after cancel, the now unmatched barrier
> for
> the explicit cancellation point has to go as well.
>
> This has probably worked before rL255992: With the calls for the explicit
> barrier, it was sure that all threads passed a barrier before exiting.
>
> Reported by Simon Convent and Joachim Protze!
>
> Differential Revision: https://reviews.llvm.org/D30088
>
> Modified:
> cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> cfe/trunk/test/OpenMP/cancel_codegen.cpp
> cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r295473 - [OpenMP] Remove barriers at cancel and cancellation point

2017-02-17 Thread Hahnfeld, Jonas via cfe-commits
Hi Hans, Alexey,

can we merge this commit and r295474 for the 4.0 release or is it
already too late for that? I will totally understand that and can apply
these commits locally prior to installing.
However, I think that these changes are quite focussed and bear minimal
possibility of introducing regressions.

Thanks,
Jonas

Am Freitag, den 17.02.2017, 18:32 + schrieb Jonas Hahnfeld via cfe-
commits:
> Author: hahnfeld
> Date: Fri Feb 17 12:32:51 2017
> New Revision: 295473
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=295473=rev
> Log:
> [OpenMP] Remove barriers at cancel and cancellation point
> 
> This resolves a deadlock with the cancel directive when there is no explicit
> cancellation point. In that case, the implicit barrier acts as cancellation
> point. After removing the barrier after cancel, the now unmatched barrier for
> the explicit cancellation point has to go as well.
> 
> This has probably worked before rL255992: With the calls for the explicit
> barrier, it was sure that all threads passed a barrier before exiting.
> 
> Reported by Simon Convent and Joachim Protze!
> 
> Differential Revision: https://reviews.llvm.org/D30088
> 
> Modified:
> cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> cfe/trunk/test/OpenMP/cancel_codegen.cpp
> cfe/trunk/test/OpenMP/cancellation_point_codegen.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=295473=295472=295473=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Fri Feb 17 12:32:51 2017
> @@ -4724,7 +4724,6 @@ void CGOpenMPRuntime::emitCancellationPo
>auto *Result = CGF.EmitRuntimeCall(
>createRuntimeFunction(OMPRTL__kmpc_cancellationpoint), Args);
>// if (__kmpc_cancellationpoint()) {
> -  //  __kmpc_cancel_barrier();
>//   exit from construct;
>// }
>auto *ExitBB = CGF.createBasicBlock(".cancel.exit");
> @@ -4732,8 +4731,6 @@ void CGOpenMPRuntime::emitCancellationPo
>auto *Cmp = CGF.Builder.CreateIsNotNull(Result);
>CGF.Builder.CreateCondBr(Cmp, ExitBB, ContBB);
>CGF.EmitBlock(ExitBB);
> -  // __kmpc_cancel_barrier();
> -  emitBarrierCall(CGF, Loc, OMPD_unknown, /*EmitChecks=*/false);
>// exit from construct;
>auto CancelDest =
>CGF.getOMPCancelDestination(OMPRegionInfo->getDirectiveKind());
> @@ -4762,7 +4759,6 @@ void CGOpenMPRuntime::emitCancelCall(Cod
>auto *Result = CGF.EmitRuntimeCall(
>RT.createRuntimeFunction(OMPRTL__kmpc_cancel), Args);
>// if (__kmpc_cancel()) {
> -  //  __kmpc_cancel_barrier();
>//   exit from construct;
>// }
>auto *ExitBB = CGF.createBasicBlock(".cancel.exit");
> @@ -4770,8 +4766,6 @@ void CGOpenMPRuntime::emitCancelCall(Cod
>auto *Cmp = CGF.Builder.CreateIsNotNull(Result);
>CGF.Builder.CreateCondBr(Cmp, ExitBB, ContBB);
>CGF.EmitBlock(ExitBB);
> -  // __kmpc_cancel_barrier();
> -  RT.emitBarrierCall(CGF, Loc, OMPD_unknown, /*EmitChecks=*/false);
>// exit from construct;
>auto CancelDest =
>CGF.getOMPCancelDestination(OMPRegionInfo->getDirectiveKind());
> 
> Modified: cfe/trunk/test/OpenMP/cancel_codegen.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/cancel_codegen.cpp?rev=295473=295472=295473=diff
> ==
> --- cfe/trunk/test/OpenMP/cancel_codegen.cpp (original)
> +++ cfe/trunk/test/OpenMP/cancel_codegen.cpp Fri Feb 17 12:32:51 2017
> @@ -12,6 +12,8 @@ int main (int argc, char **argv) {
>  {
>  #pragma omp cancel parallel if(flag)
>argv[0][0] = argc;
> +#pragma omp barrier
> +  argv[0][0] += argc;
>  }
>  // CHECK: call void (%ident_t*, i32, void (i32*, i32*, ...)*, ...) 
> @__kmpc_fork_call(
>  #pragma omp sections
> @@ -20,7 +22,6 @@ int main (int argc, char **argv) {
>  }
>  // CHECK: call void @__kmpc_for_static_init_4(
>  // CHECK: call i32 @__kmpc_cancel(
> -// CHECK: call i32 @__kmpc_cancel_barrier(%ident_t*
>  // CHECK: call void @__kmpc_for_static_fini(
>  // CHECK: call void @__kmpc_barrier(%ident_t*
>  #pragma omp sections
> @@ -36,7 +37,6 @@ int main (int argc, char **argv) {
>  // CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
>  // CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
>  // CHECK: [[EXIT]]
> -// CHECK: call i32 @__kmpc_cancel_barrier(%ident_t*
>  // CHECK: br label
>  // CHECK: [[CONTINUE]]
>  // CHECK: br label
> @@ -44,7 +44,6 @@ int main (int argc, char **argv) {
>  // CHECK: [[CMP:%.+]] = icmp ne i32 [[RES]], 0
>  // CHECK: br i1 [[CMP]], label %[[EXIT:[^,].+]], label %[[CONTINUE:.+]]
>  // CHECK: [[EXIT]]
> -// CHECK: call i32 @__kmpc_cancel_barrier(%ident_t*
>  // CHECK: br label
>  //