<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Ok, thanks. I'll fix it ASAP.<br>
<pre class="moz-signature" cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team</pre>
10.03.2015 7:44, Rafael Espíndola пишет:<br>
</div>
<blockquote
cite="mid:CAG3jReL3YKwdPr-15CkEyBJNWNFwRnEKQ2SBg9oDU48rLa4Jxw@mail.gmail.com"
type="cite">
<div dir="ltr">Sorry, this was failing to link with cmake and I
reverted it.
<div><br>
</div>
<div>Example of a failed log:</div>
<div><a moz-do-not-send="true"
href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-debian-fast/builds/24088/steps/build/logs/stdio">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-debian-fast/builds/24088/steps/build/logs/stdio</a><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 10 March 2015 at 00:22, Alexey
Bataev <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Author:
abataev<br>
Date: Mon Mar 9 23:22:11 2015<br>
New Revision: 231752<br>
<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project?rev=231752&view=rev"
target="_blank">http://llvm.org/viewvc/llvm-project?rev=231752&view=rev</a><br>
Log:<br>
[OPENMP] Improved code for generating debug info +
generation of all OpenMP regions in termination scope<br>
Patch adds proper generation of debug info for all OpenMP
regions. Also, all OpenMP regions are generated in a
termination scope, because standard does not allow to throw
exceptions out of structured blocks, associated with the
OpenMP regions<br>
Differential Revision: <a moz-do-not-send="true"
href="http://reviews.llvm.org/D7935" target="_blank">http://reviews.llvm.org/D7935</a><br>
<br>
Added:<br>
cfe/trunk/test/OpenMP/atomic_codegen.cpp (with props)<br>
Modified:<br>
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp<br>
cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp<br>
cfe/trunk/test/OpenMP/critical_codegen.cpp<br>
cfe/trunk/test/OpenMP/for_codegen.cpp<br>
cfe/trunk/test/OpenMP/master_codegen.cpp<br>
cfe/trunk/test/OpenMP/parallel_codegen.cpp<br>
cfe/trunk/test/OpenMP/simd_codegen.cpp<br>
cfe/trunk/test/OpenMP/single_codegen.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1047,9 +1047,16 @@
InlinedOpenMPRegionRAII::InlinedOpenMPRe<br>
CodeGenFunction &CGF, const OMPExecutableDirective
&D)<br>
: CGF(CGF) {<br>
CGF.CapturedStmtInfo = new CGOpenMPInlinedRegionInfo(D,
CGF.CapturedStmtInfo);<br>
+ // 1.2.2 OpenMP Language Terminology<br>
+ // Structured block - An executable statement with a
single entry at the<br>
+ // top and a single exit at the bottom.<br>
+ // The point of exit cannot be a branch out of the
structured block.<br>
+ // longjmp() and throw() must not violate the entry/exit
criteria.<br>
+ CGF.EHStack.pushTerminate();<br>
}<br>
<br>
InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII() {<br>
+ CGF.EHStack.popTerminate();<br>
auto *OldCSI =<br>
cast<CGOpenMPInlinedRegionInfo>(CGF.CapturedStmtInfo)->getOldCSI();<br>
delete CGF.CapturedStmtInfo;<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Mon Mar 9 23:22:11
2015<br>
@@ -2186,6 +2186,8 @@
CodeGenFunction::GenerateCapturedStmtFun<br>
llvm::Function::Create(FuncLLVMTy,
llvm::GlobalValue::InternalLinkage,<br>
CapturedStmtInfo->getHelperName(), &CGM.getModule());<br>
CGM.SetInternalFunctionAttributes(CD, F, FuncInfo);<br>
+ if (CD->isNothrow())<br>
+ F->addFnAttr(llvm::Attribute::NoUnwind);<br>
<br>
// Generate the function.<br>
StartFunction(CD, Ctx.VoidTy, F, FuncInfo, Args,<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp Mon Mar 9
23:22:11 2015<br>
@@ -23,6 +23,20 @@ using namespace CodeGen;<br>
//===----------------------------------------------------------------------===//<br>
// OpenMP Directive Emission<br>
//===----------------------------------------------------------------------===//<br>
+namespace {<br>
+/// \brief RAII for inlined OpenMP regions (like 'omp for',
'omp simd', 'omp<br>
+/// critical' etc.). Helps to generate proper debug info
and provides correct<br>
+/// code generation for such constructs.<br>
+class InlinedOpenMPRegionScopeRAII {<br>
+ InlinedOpenMPRegionRAII Region;<br>
+ CodeGenFunction::LexicalScope DirectiveScope;<br>
+<br>
+public:<br>
+ InlinedOpenMPRegionScopeRAII(CodeGenFunction &CGF,<br>
+ const OMPExecutableDirective
&D)<br>
+ : Region(CGF, D), DirectiveScope(CGF,
D.getSourceRange()) {}<br>
+};<br>
+} // namespace<br>
<br>
/// \brief Emits code for OpenMP 'if' clause using
specified \a CodeGen<br>
/// function. Here is the logic:<br>
@@ -417,12 +431,7 @@ void
CodeGenFunction::EmitOMPSimdDirecti<br>
}<br>
}<br>
<br>
- InlinedOpenMPRegionRAII Region(*this, S);<br>
- RunCleanupsScope DirectiveScope(*this);<br>
-<br>
- CGDebugInfo *DI = getDebugInfo();<br>
- if (DI)<br>
- DI->EmitLexicalBlockStart(Builder,
S.getSourceRange().getBegin());<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
<br>
// Emit the loop iteration variable.<br>
const Expr *IVExpr = S.getIterationVariable();<br>
@@ -466,9 +475,6 @@ void CodeGenFunction::EmitOMPSimdDirecti<br>
}<br>
EmitOMPSimdFinal(S);<br>
}<br>
-<br>
- if (DI)<br>
- DI->EmitLexicalBlockEnd(Builder,
S.getSourceRange().getEnd());<br>
}<br>
<br>
void
CodeGenFunction::EmitOMPForOuterLoop(OpenMPScheduleClauseKind
ScheduleKind,<br>
@@ -650,20 +656,13 @@ void
CodeGenFunction::EmitOMPWorksharing<br>
}<br>
<br>
void CodeGenFunction::EmitOMPForDirective(const
OMPForDirective &S) {<br>
- InlinedOpenMPRegionRAII Region(*this, S);<br>
- RunCleanupsScope DirectiveScope(*this);<br>
-<br>
- CGDebugInfo *DI = getDebugInfo();<br>
- if (DI)<br>
- DI->EmitLexicalBlockStart(Builder,
S.getSourceRange().getBegin());<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
<br>
EmitOMPWorksharingLoop(S);<br>
<br>
// Emit an implicit barrier at the end.<br>
CGM.getOpenMPRuntime().emitBarrierCall(*this,
S.getLocStart(),<br>
/*IsExplicit*/
false);<br>
- if (DI)<br>
- DI->EmitLexicalBlockEnd(Builder,
S.getSourceRange().getEnd());<br>
}<br>
<br>
void CodeGenFunction::EmitOMPForSimdDirective(const
OMPForSimdDirective &) {<br>
@@ -680,8 +679,7 @@ void CodeGenFunction::EmitOMPSectionDire<br>
<br>
void CodeGenFunction::EmitOMPSingleDirective(const
OMPSingleDirective &S) {<br>
CGM.getOpenMPRuntime().emitSingleRegion(*this, [&]()
-> void {<br>
- InlinedOpenMPRegionRAII Region(*this, S);<br>
- RunCleanupsScope Scope(*this);<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());<br>
EnsureInsertPoint();<br>
}, S.getLocStart());<br>
@@ -689,8 +687,7 @@ void CodeGenFunction::EmitOMPSingleDirec<br>
<br>
void CodeGenFunction::EmitOMPMasterDirective(const
OMPMasterDirective &S) {<br>
CGM.getOpenMPRuntime().emitMasterRegion(*this, [&]()
-> void {<br>
- InlinedOpenMPRegionRAII Region(*this, S);<br>
- RunCleanupsScope Scope(*this);<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());<br>
EnsureInsertPoint();<br>
}, S.getLocStart());<br>
@@ -699,8 +696,7 @@ void CodeGenFunction::EmitOMPMasterDirec<br>
void CodeGenFunction::EmitOMPCriticalDirective(const
OMPCriticalDirective &S) {<br>
CGM.getOpenMPRuntime().emitCriticalRegion(<br>
*this, S.getDirectiveName().getAsString(), [&]()
-> void {<br>
- InlinedOpenMPRegionRAII Region(*this, S);<br>
- RunCleanupsScope Scope(*this);<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());<br>
EnsureInsertPoint();<br>
}, S.getLocStart());<br>
@@ -898,6 +894,7 @@ void CodeGenFunction::EmitOMPAtomicDirec<br>
break;<br>
}<br>
}<br>
+ InlinedOpenMPRegionScopeRAII Region(*this, S);<br>
EmitOMPAtomicExpr(*this, Kind, IsSeqCst, S.getX(),
S.getV(), S.getExpr(),<br>
S.getLocStart());<br>
}<br>
<br>
Added: cfe/trunk/test/OpenMP/atomic_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_codegen.cpp?rev=231752&view=auto"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/atomic_codegen.cpp?rev=231752&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/atomic_codegen.cpp (added)<br>
+++ cfe/trunk/test/OpenMP/atomic_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -0,0 +1,30 @@<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
+// expected-no-diagnostics<br>
+<br>
+int a;<br>
+int &foo() { return a; }<br>
+<br>
+// TERM_DEBUG-LABEL: parallel_atomic<br>
+void parallel_atomic() {<br>
+#pragma omp parallel<br>
+ {<br>
+#pragma omp atomic read<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: invoke {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG: load atomic i32, i32* @{{.+}}
monotonic, {{.*}}!dbg [[READ_LOC:![0-9]+]]<br>
+ foo() = a;<br>
+#pragma omp atomic write<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: invoke {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: store atomic i32 {{%.+}}, i32*
@{{.+}} monotonic, {{.*}}!dbg [[WRITE_LOC:![0-9]+]]<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
+ a = foo();<br>
+ }<br>
+}<br>
+// TERM_DEBUG-DAG: [[READ_LOC]] = !MDLocation(line: 11,<br>
+// TERM_DEBUG-DAG: [[WRITE_LOC]] = !MDLocation(line: 17,<br>
<br>
Propchange: cfe/trunk/test/OpenMP/atomic_codegen.cpp<br>
------------------------------------------------------------------------------<br>
<a class="moz-txt-link-freetext" href="svn:eol-style">svn:eol-style</a> = native<br>
<br>
Propchange: cfe/trunk/test/OpenMP/atomic_codegen.cpp<br>
------------------------------------------------------------------------------<br>
<a class="moz-txt-link-freetext" href="svn:keywords">svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange: cfe/trunk/test/OpenMP/atomic_codegen.cpp<br>
------------------------------------------------------------------------------<br>
<a class="moz-txt-link-freetext" href="svn:mime-type">svn:mime-type</a> = text/plain<br>
<br>
Modified: cfe/trunk/test/OpenMP/critical_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/critical_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/critical_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/critical_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/critical_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1,6 +1,7 @@<br>
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++
-emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck
%s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-emit-pch -o %t %s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
// expected-no-diagnostics<br>
<br>
#ifndef HEADER<br>
@@ -15,6 +16,7 @@<br>
void foo() {}<br>
<br>
// CHECK-LABEL: @main<br>
+// TERM_DEBUG-LABEL: @main<br>
int main() {<br>
// CHECK: [[A_ADDR:%.+]] = alloca i8<br>
char a;<br>
@@ -26,8 +28,8 @@ int main() {<br>
#pragma omp critical<br>
a = 2;<br>
// CHECK: call void @__kmpc_critical([[IDENT_T_TY]]*
[[DEFAULT_LOC]], i32 [[GTID]], [8 x i32]* [[THE_NAME_LOCK]])<br>
-// CHECK-NEXT: call void [[FOO]]()<br>
-// CHECK-NEXT: call void
@__kmpc_end_critical([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]], [8 x i32]* [[THE_NAME_LOCK]])<br>
+// CHECK-NEXT: invoke void [[FOO]]()<br>
+// CHECK: call void
@__kmpc_end_critical([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]], [8 x i32]* [[THE_NAME_LOCK]])<br>
#pragma omp critical(the_name)<br>
foo();<br>
// CHECK-NOT: call void @__kmpc_critical<br>
@@ -35,13 +37,22 @@ int main() {<br>
return a;<br>
}<br>
<br>
-// CHECK-LABEL: parallel_critical<br>
-void parallel_critical(float *a) {<br>
+// CHECK-LABEL: parallel_critical<br>
+// TERM_DEBUG-LABEL: parallel_critical<br>
+void parallel_critical() {<br>
#pragma omp parallel<br>
#pragma omp critical<br>
- // CHECK-NOT: __kmpc_global_thread_num<br>
- for (unsigned i = 131071; i <= 2147483647; i += 127)<br>
- a[i] += i;<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void @__kmpc_critical({{.+}}),
!dbg [[DBG_LOC_START:![0-9]+]]<br>
+ // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void
@__kmpc_end_critical({{.+}}), !dbg [[DBG_LOC_END:![0-9]+]]<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
+ foo();<br>
}<br>
-<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line:
44,<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 44,<br>
#endif<br>
<br>
Modified: cfe/trunk/test/OpenMP/for_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/for_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/for_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1,6 +1,7 @@<br>
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -emit-llvm %s -fexceptions
-fcxx-exceptions -o - | FileCheck %s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-emit-pch -o %t %s<br>
-// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
//<br>
// expected-no-diagnostics<br>
#ifndef HEADER<br>
@@ -146,13 +147,28 @@ void static_chunked(float *a, float
*b,<br>
// CHECK: ret void<br>
}<br>
<br>
+// TERM_DEBUG-LABEL: foo<br>
+int foo() {return 0;};<br>
+<br>
+// TERM_DEBUG-LABEL: parallel_for<br>
void parallel_for(float *a) {<br>
#pragma omp parallel<br>
#pragma omp for schedule(static, 5)<br>
- // CHECK-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void
@__kmpc_for_static_init_4u({{.+}}), !dbg
[[DBG_LOC_START:![0-9]+]]<br>
+ // TERM_DEBUG: invoke i32 {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void
@__kmpc_for_static_fini({{.+}}), !dbg
[[DBG_LOC_END:![0-9]+]]<br>
+ // TERM_DEBUG: call {{.+}}
@__kmpc_cancel_barrier({{.+}}), !dbg
[[DBG_LOC_CANCEL:![0-9]+]]<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
for (unsigned i = 131071; i <= 2147483647; i += 127)<br>
- a[i] += i;<br>
+ a[i] += foo();<br>
}<br>
-<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line:
156,<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 156,<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_CANCEL]] = !MDLocation(line:
156,<br>
#endif // HEADER<br>
<br>
<br>
Modified: cfe/trunk/test/OpenMP/master_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/master_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/master_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/master_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/master_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1,6 +1,7 @@<br>
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++
-emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck
%s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-emit-pch -o %t %s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
// expected-no-diagnostics<br>
<br>
#ifndef HEADER<br>
@@ -13,6 +14,7 @@<br>
void foo() {}<br>
<br>
// CHECK-LABEL: @main<br>
+// TERM_DEBUG-LABEL: @main<br>
int main() {<br>
// CHECK: [[A_ADDR:%.+]] = alloca i8<br>
char a;<br>
@@ -32,8 +34,8 @@ int main() {<br>
// CHECK-NEXT: [[IS_MASTER:%.+]] = icmp ne i32 [[RES]], 0<br>
// CHECK-NEXT: br i1 [[IS_MASTER]], label
{{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]<br>
// CHECK: [[THEN]]<br>
-// CHECK-NEXT: call void [[FOO]]()<br>
-// CHECK-NEXT: call void
@__kmpc_end_master([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]])<br>
+// CHECK-NEXT: invoke void [[FOO]]()<br>
+// CHECK: call void
@__kmpc_end_master([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]])<br>
// CHECK-NEXT: br label {{%?}}[[EXIT]]<br>
// CHECK: [[EXIT]]<br>
#pragma omp master<br>
@@ -43,13 +45,23 @@ int main() {<br>
return a;<br>
}<br>
<br>
-// CHECK-LABEL: parallel_master<br>
-void parallel_master(float *a) {<br>
+// CHECK-LABEL: parallel_master<br>
+// TERM_DEBUG-LABEL: parallel_master<br>
+void parallel_master() {<br>
#pragma omp parallel<br>
#pragma omp master<br>
- // CHECK-NOT: __kmpc_global_thread_num<br>
- for (unsigned i = 131071; i <= 2147483647; i += 127)<br>
- a[i] += i;<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call i32 @__kmpc_master({{.+}}), !dbg
[[DBG_LOC_START:![0-9]+]]<br>
+ // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void @__kmpc_end_master({{.+}}),
!dbg [[DBG_LOC_END:![0-9]+]]<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
+ foo();<br>
}<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line:
52,<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 52,<br>
<br>
#endif<br>
<br>
Modified: cfe/trunk/test/OpenMP/parallel_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/parallel_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/parallel_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -62,6 +62,7 @@ int main (int argc, char **argv) {<br>
// CHECK-DEBUG-NEXT: }<br>
<br>
// CHECK-LABEL: define internal void @.omp_outlined.(i32*
%.global_tid., i32* %.bound_tid., %struct.anon* %__context)<br>
+// CHECK: #[[FN_ATTRS:[0-9]+]]<br>
// CHECK: [[CONTEXT_ADDR:%.+]] = alloca %struct.anon*<br>
// CHECK: store %struct.anon* %__context,
%struct.anon** [[CONTEXT_ADDR]]<br>
// CHECK: [[CONTEXT_PTR:%.+]] = load %struct.anon*,
%struct.anon** [[CONTEXT_ADDR]]<br>
@@ -74,6 +75,7 @@ int main (int argc, char **argv) {<br>
// CHECK-NEXT: unreachable<br>
// CHECK-NEXT: }<br>
// CHECK-DEBUG-LABEL: define internal void
@.omp_outlined.(i32* %.global_tid., i32* %.bound_tid.,
%struct.anon* %__context)<br>
+// CHECK-DEBUG: #[[FN_ATTRS:[0-9]+]]<br>
// CHECK-DEBUG: [[CONTEXT_ADDR:%.+]] = alloca
%struct.anon*<br>
// CHECK-DEBUG: store %struct.anon* %__context,
%struct.anon** [[CONTEXT_ADDR]]<br>
// CHECK-DEBUG: [[CONTEXT_PTR:%.+]] = load
%struct.anon*, %struct.anon** [[CONTEXT_ADDR]]<br>
@@ -142,4 +144,7 @@ int main (int argc, char **argv) {<br>
// CHECK: define linkonce_odr void [[FOO1]](i8** %argc)<br>
// CHECK-DEBUG: define linkonce_odr void [[FOO1]](i8**
%argc)<br>
<br>
+// CHECK: attributes #[[FN_ATTRS]] = {{.+}} nounwind<br>
+// CHECK-DEBUG: attributes #[[FN_ATTRS]] = {{.+}} nounwind<br>
+<br>
#endif<br>
<br>
Modified: cfe/trunk/test/OpenMP/simd_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/simd_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/simd_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/simd_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1,6 +1,7 @@<br>
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++
-emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck
%s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-emit-pch -o %t %s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
//<br>
// expected-no-diagnostics<br>
#ifndef HEADER<br>
@@ -261,8 +262,8 @@ void iter_simple(IterDouble ia, IterDoub<br>
//<br>
// CHECK: store i32 0, i32* [[IT_OMP_IV:%[^,]+]]<br>
// Calculate number of iterations before the loop body.<br>
-// CHECK: [[DIFF1:%.+]] = call {{.*}}i32
@{{.*}}IterDouble{{.*}}<br>
-// CHECK-NEXT: [[DIFF2:%.+]] = sub nsw i32 [[DIFF1]], 1<br>
+// CHECK: [[DIFF1:%.+]] = invoke {{.*}}i32
@{{.*}}IterDouble{{.*}}<br>
+// CHECK: [[DIFF2:%.+]] = sub nsw i32 [[DIFF1]], 1<br>
// CHECK-NEXT: [[DIFF3:%.+]] = add nsw i32 [[DIFF2]], 1<br>
// CHECK-NEXT: [[DIFF4:%.+]] = sdiv i32 [[DIFF3]], 1<br>
// CHECK-NEXT: [[DIFF5:%.+]] = sub nsw i32 [[DIFF4]], 1<br>
@@ -279,12 +280,12 @@ void iter_simple(IterDouble ia,
IterDoub<br>
// Start of body: calculate i from index:<br>
// CHECK: [[IV1:%.+]] = load i32, i32*
[[IT_OMP_IV]]{{.+}}!llvm.mem.parallel_loop_access
![[ITER_LOOP_ID]]<br>
// Call of operator+ (i, IV).<br>
-// CHECK: {{%.+}} = call {{.+}}
@{{.*}}IterDouble{{.*}}!llvm.mem.parallel_loop_access
![[ITER_LOOP_ID]]<br>
+// CHECK: {{%.+}} = invoke {{.+}} @{{.*}}IterDouble{{.*}}<br>
// ... loop body ...<br>
*i = *ic * 0.5;<br>
// Float multiply and save result.<br>
// CHECK: [[MULR:%.+]] = fmul double {{%.+}}, 5.000000e-01<br>
-// CHECK-NEXT: call {{.+}} @{{.*}}IterDouble{{.*}}<br>
+// CHECK-NEXT: invoke {{.+}} @{{.*}}IterDouble{{.*}}<br>
// CHECK: store double [[MULR:%.+]], double*
[[RESULT_ADDR:%.+]], !llvm.mem.parallel_loop_access
![[ITER_LOOP_ID]]<br>
++ic;<br>
//<br>
@@ -403,13 +404,23 @@ void widened(float *a, float *b, float
*<br>
// CHECK: ret void<br>
}<br>
<br>
+// TERM_DEBUG-LABEL: bar<br>
+int bar() {return 0;};<br>
+<br>
+// TERM_DEBUG-LABEL: parallel_simd<br>
void parallel_simd(float *a) {<br>
#pragma omp parallel<br>
#pragma omp simd<br>
- // CHECK-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: invoke i32 {{.*}}bar{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
for (unsigned i = 131071; i <= 2147483647; i += 127)<br>
- a[i] += i;<br>
+ a[i] += bar();<br>
}<br>
-<br>
+// TERM_DEBUG: !{{[0-9]+}} = !MDLocation(line: 413,<br>
#endif // HEADER<br>
<br>
<br>
Modified: cfe/trunk/test/OpenMP/single_codegen.cpp<br>
URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff"
target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/single_codegen.cpp?rev=231752&r1=231751&r2=231752&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/single_codegen.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/single_codegen.cpp Mon Mar 9
23:22:11 2015<br>
@@ -1,6 +1,7 @@<br>
// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -x c++
-emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck
%s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-emit-pch -o %t %s<br>
// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -triple
x86_64-unknown-unknown -fexceptions -fcxx-exceptions
-std=c++11 -include-pch %t -verify %s -emit-llvm -o - |
FileCheck %s<br>
+// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10
-fopenmp=libiomp5 -fexceptions -fcxx-exceptions
-gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s
--check-prefix=TERM_DEBUG<br>
// expected-no-diagnostics<br>
<br>
#ifndef HEADER<br>
@@ -13,6 +14,7 @@<br>
void foo() {}<br>
<br>
// CHECK-LABEL: @main<br>
+// TERM_DEBUG-LABEL: @main<br>
int main() {<br>
// CHECK: [[A_ADDR:%.+]] = alloca i8<br>
char a;<br>
@@ -32,8 +34,8 @@ int main() {<br>
// CHECK-NEXT: [[IS_SINGLE:%.+]] = icmp ne i32 [[RES]], 0<br>
// CHECK-NEXT: br i1 [[IS_SINGLE]], label
{{%?}}[[THEN:.+]], label {{%?}}[[EXIT:.+]]<br>
// CHECK: [[THEN]]<br>
-// CHECK-NEXT: call void [[FOO]]()<br>
-// CHECK-NEXT: call void
@__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]])<br>
+// CHECK-NEXT: invoke void [[FOO]]()<br>
+// CHECK: call void
@__kmpc_end_single([[IDENT_T_TY]]* [[DEFAULT_LOC]], i32
[[GTID]])<br>
// CHECK-NEXT: br label {{%?}}[[EXIT]]<br>
// CHECK: [[EXIT]]<br>
#pragma omp single<br>
@@ -43,13 +45,23 @@ int main() {<br>
return a;<br>
}<br>
<br>
-// CHECK-LABEL: parallel_single<br>
-void parallel_single(float *a) {<br>
+// CHECK-LABEL: parallel_single<br>
+// TERM_DEBUG-LABEL: parallel_single<br>
+void parallel_single() {<br>
#pragma omp parallel<br>
#pragma omp single<br>
- // CHECK-NOT: __kmpc_global_thread_num<br>
- for (unsigned i = 131071; i <= 2147483647; i += 127)<br>
- a[i] += i;<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call i32 @__kmpc_single({{.+}}), !dbg
[[DBG_LOC_START:![0-9]+]]<br>
+ // TERM_DEBUG: invoke void {{.*}}foo{{.*}}()<br>
+ // TERM_DEBUG: unwind label %[[TERM_LPAD:.+]],<br>
+ // TERM_DEBUG-NOT: __kmpc_global_thread_num<br>
+ // TERM_DEBUG: call void @__kmpc_end_single({{.+}}),
!dbg [[DBG_LOC_END:![0-9]+]]<br>
+ // TERM_DEBUG: [[TERM_LPAD]]:<br>
+ // TERM_DEBUG: call void @__clang_call_terminate<br>
+ // TERM_DEBUG: unreachable<br>
+ foo();<br>
}<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_START]] = !MDLocation(line:
52,<br>
+// TERM_DEBUG-DAG: [[DBG_LOC_END]] = !MDLocation(line: 52,<br>
<br>
#endif<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>