Lines Matching +full:loc +full:- +full:code

1 //===----- CGOpenMPRuntime.h - Interface to OpenMP Runtimes -----*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This provides a class for OpenMP runtime code generation.
11 //===----------------------------------------------------------------------===//
56 /// A basic class for pre|post-action for advanced codegen sequence for OpenMP
67 /// an advanced with possible pre|post-actions in codegen.
145 /// List of reduction-based clauses.
177 /// Emits the code for the variable-modified type, if required.
180 /// Emits the code for the variable-modified type, if required.
196 /// Emits cleanup code for the reduction item.
224 return cast<VarDecl>(cast<DeclRefExpr>(ClausesData[N].Private)->getDecl()) in getPrivateType()
225 ->getType(); in getPrivateType()
311 /// An OpenMP-IR-Builder instance.
343 llvm::Value *getThreadID(CodeGenFunction &CGF, SourceLocation Loc);
352 /// Emits \p Callee function call with arguments \p Args with location \p Loc.
353 void emitCall(CodeGenFunction &CGF, SourceLocation Loc,
359 virtual Address emitThreadIDAddress(CodeGenFunction &CGF, SourceLocation Loc);
416 /// Map from the user-defined mapper declaration to its corresponding
419 /// Map of functions and their local user-defined mappers.
436 /// An ordered map of auto-generated variables to their unique names.
458 /// Saved kmp_task_t for taskloop-based directive.
551 /// Emits initialization code for the threadprivate variables.
556 /// \param Loc Location of threadprivate declaration.
559 llvm::Value *Dtor, SourceLocation Loc);
561 /// Emit the array initialization or deletion portion for user-defined mapper
562 /// code generation.
585 /// TaskFunction(gtid, tt->part_id, tt->shareds);
600 TaskResultTy emitTaskInit(CodeGenFunction &CGF, SourceLocation Loc,
608 SourceLocation Loc);
616 SourceLocation Loc);
633 /// \param EmitLoc emit source location with debug-info is off.
635 llvm::Value *emitUpdateLocation(CodeGenFunction &CGF, SourceLocation Loc,
655 /// if-clause), store the condition in \p CondExpr. Similarly, a potential
700 /// Emits code for OpenMP 'if' clause using specified \a CodeGen
716 /// Get the platform-specific name separator.
719 /// Emit code for the specified user defined reduction construct.
722 /// Get combiner/initializer for the specified user-defined reduction, if any.
729 /// Get the function for the specified user-defined mapper. If it does not
741 /// is a directive itself, for combined - its innermost directive).
742 /// \param CodeGen Code generation sequence for the \a D directive.
755 /// is a directive itself, for combined - its innermost directive).
756 /// \param CodeGen Code generation sequence for the \a D directive.
771 /// is a directive itself, for combined - its innermost directive).
772 /// \param CodeGen Code generation sequence for the \a D directive.
787 /// Emits code for parallel or serial call of the \a OutlinedFn with
799 virtual void emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc,
811 SourceLocation Loc,
819 SourceLocation Loc);
826 SourceLocation Loc,
829 /// Emits code for a taskyield directive.
830 virtual void emitTaskyieldCall(CodeGenFunction &CGF, SourceLocation Loc);
833 /// extern void __kmpc_error(ident_t *loc, int severity, const char *message);
834 virtual void emitErrorCall(CodeGenFunction &CGF, SourceLocation Loc, Expr *ME,
842 SourceLocation Loc);
849 SourceLocation Loc,
860 SourceLocation Loc, bool IsThreads);
870 virtual void emitBarrierCall(CodeGenFunction &CGF, SourceLocation Loc,
875 /// Check if the specified \a ScheduleKind is static non-chunked.
883 /// Check if the specified \a ScheduleKind is static non-chunked.
898 /// Check if the specified \a ScheduleKind is static non-chunked.
935 /// \param Loc Clang source location.
944 virtual void emitForDispatchInit(CodeGenFunction &CGF, SourceLocation Loc,
953 /// \param Loc Clang source location.
955 virtual void emitForDispatchDeinit(CodeGenFunction &CGF, SourceLocation Loc);
996 /// \param Loc Clang source location.
1001 virtual void emitForStaticInit(CodeGenFunction &CGF, SourceLocation Loc,
1008 /// \param Loc Clang source location.
1013 SourceLocation Loc,
1021 /// \param Loc Clang source location.
1026 SourceLocation Loc, unsigned IVSize,
1033 /// \param Loc Clang source location.
1036 virtual void emitForStaticFinish(CodeGenFunction &CGF, SourceLocation Loc,
1040 /// ident_t *loc, kmp_int32 tid, kmp_int32 *p_lastiter,
1053 virtual llvm::Value *emitForNext(CodeGenFunction &CGF, SourceLocation Loc,
1058 /// Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
1059 /// global_tid, kmp_int32 num_threads) to generate code for 'num_threads'
1064 SourceLocation Loc);
1066 /// Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32
1067 /// global_tid, int proc_bind) to generate code for 'proc_bind' clause.
1070 SourceLocation Loc);
1076 /// \param Loc Location of the reference to threadprivate var.
1080 SourceLocation Loc);
1086 /// Emit a code for initialization of threadprivate variable. It emits
1092 /// \param Loc Location of threadprivate declaration.
1096 SourceLocation Loc, bool PerformInit,
1099 /// Emit code for handling declare target functions in the runtime.
1117 SourceLocation Loc, llvm::AtomicOrdering AO);
1126 /// TaskFunction(gtid, tt->part_id, tt->shareds);
1146 virtual void emitTaskCall(CodeGenFunction &CGF, SourceLocation Loc,
1159 /// TaskFunction(gtid, tt->part_id, tt->shareds);
1166 /// 4. Emit a call to void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t
1181 virtual void emitTaskLoopCall(CodeGenFunction &CGF, SourceLocation Loc,
1187 /// Emit code for the directive that does not require outlining.
1190 /// is a directive itself, for combined - its innermost directive).
1191 /// \param CodeGen Code generation sequence for the \a D directive.
1208 StringRef ReducerName, SourceLocation Loc, llvm::Type *ArgsElemType,
1224 /// Emit a code for reduction clause. Next code should be emitted for
1226 /// \code
1237 /// void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]};
1238 /// switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList),
1244 /// __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
1266 virtual void emitReduction(CodeGenFunction &CGF, SourceLocation Loc,
1273 /// Emit a code for initialization of task reduction clause. Next code
1275 /// \code
1290 /// \code
1302 /// void* tg1 = __kmpc_taskred_modifier_init(loc, gtid, is_worksharing, n,
1310 SourceLocation Loc,
1315 /// Emits the following code for reduction clause with task modifier:
1316 /// \code
1317 /// __kmpc_task_reduction_modifier_fini(loc, gtid, is_worksharing);
1319 virtual void emitTaskReductionFini(CodeGenFunction &CGF, SourceLocation Loc,
1327 virtual void emitTaskReductionFixups(CodeGenFunction &CGF, SourceLocation Loc,
1335 virtual Address getTaskReductionItem(CodeGenFunction &CGF, SourceLocation Loc,
1339 /// Emit code for 'taskwait' directive.
1340 virtual void emitTaskwaitCall(CodeGenFunction &CGF, SourceLocation Loc,
1343 /// Emit code for 'cancellation point' construct.
1348 SourceLocation Loc,
1351 /// Emit code for 'cancel' construct.
1356 virtual void emitCancelCall(CodeGenFunction &CGF, SourceLocation Loc,
1366 /// \param CodeGen Code generation sequence for the \a D directive.
1376 /// Emit the target offloading code associated with \a D. The emitted
1377 /// code attempts offloading the execution to the device, an the event of
1380 /// \param OutlinedFn Host version of the code to be offloaded.
1381 /// \param OutlinedFnID ID of host version of the code to be offloaded.
1386 /// \param SizeEmitter Callback to emit number of iterations for loop-based
1408 /// registers it when emitting code for the host.
1421 /// Emits code for teams call of the \a OutlinedFn with
1431 SourceLocation Loc, llvm::Function *OutlinedFn,
1434 /// Emits call to void __kmpc_push_num_teams(ident_t *loc, kmp_int32
1435 /// global_tid, kmp_int32 num_teams, kmp_int32 thread_limit) to generate code
1440 const Expr *ThreadLimit, SourceLocation Loc);
1442 /// Emits call to void __kmpc_set_thread_limit(ident_t *loc, kmp_int32
1443 /// global_tid, kmp_int32 thread_limit) to generate code for
1448 SourceLocation Loc);
1464 /// Emit the target data mapping code associated with \a D.
1478 /// Emit the data mapping/movement code associated with the directive
1498 /// \param D Loop-based construct used in doacross nesting construct.
1502 /// Emit code for doacross ordered directive with 'depend' clause.
1507 /// Emit code for doacross ordered directive with 'doacross' clause.
1522 /// target-specific parameter.
1524 /// \param TargetParam Corresponding target-specific parameter.
1542 /// translating these arguments to correct target-specific arguments.
1544 emitOutlinedFunctionCall(CodeGenFunction &CGF, SourceLocation Loc,
1548 /// Emits OpenMP-specific function prolog.
1552 /// Gets the OpenMP-specific address of the local variable.
1556 /// Marks the declaration as already emitted for the device code and returns
1563 /// Adjust some parameters for the target-based directives, like addresses of
1593 /// code to update the value of the original variable.
1594 /// \code
1610 /// \code
1639 SourceLocation Loc);
1647 SourceLocation Loc);
1655 SourceLocation Loc);
1657 /// Emits the code to destroy the dependency object provided in depobj
1660 SourceLocation Loc);
1666 OpenMPDependClauseKind NewDepKind, SourceLocation Loc);
1680 /// Class supports emissionof SIMD-only code.
1693 /// is a directive itself, for combined - its innermost directive).
1694 /// \param CodeGen Code generation sequence for the \a D directive.
1707 /// is a directive itself, for combined - its innermost directive).
1708 /// \param CodeGen Code generation sequence for the \a D directive.
1723 /// is a directive itself, for combined - its innermost directive).
1724 /// \param CodeGen Code generation sequence for the \a D directive.
1735 /// Emits code for parallel or serial call of the \a OutlinedFn with
1747 void emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc,
1759 SourceLocation Loc,
1767 SourceLocation Loc) override;
1773 const RegionCodeGenTy &MaskedOpGen, SourceLocation Loc,
1780 /// Emits code for a taskyield directive.
1781 void emitTaskyieldCall(CodeGenFunction &CGF, SourceLocation Loc) override;
1788 SourceLocation Loc) override;
1794 const RegionCodeGenTy &SingleOpGen, SourceLocation Loc,
1805 SourceLocation Loc, bool IsThreads) override;
1815 void emitBarrierCall(CodeGenFunction &CGF, SourceLocation Loc,
1826 /// \param Loc Clang source location.
1835 void emitForDispatchInit(CodeGenFunction &CGF, SourceLocation Loc,
1844 /// \param Loc Clang source location.
1846 void emitForDispatchDeinit(CodeGenFunction &CGF, SourceLocation Loc) override;
1858 /// \param Loc Clang source location.
1863 void emitForStaticInit(CodeGenFunction &CGF, SourceLocation Loc,
1870 /// \param Loc Clang source location.
1874 void emitDistributeStaticInit(CodeGenFunction &CGF, SourceLocation Loc,
1882 /// \param Loc Clang source location.
1886 void emitForOrderedIterationEnd(CodeGenFunction &CGF, SourceLocation Loc,
1893 /// \param Loc Clang source location.
1896 void emitForStaticFinish(CodeGenFunction &CGF, SourceLocation Loc,
1900 /// ident_t *loc, kmp_int32 tid, kmp_int32 *p_lastiter,
1913 llvm::Value *emitForNext(CodeGenFunction &CGF, SourceLocation Loc,
1917 /// Emits call to void __kmpc_push_num_threads(ident_t *loc, kmp_int32
1918 /// global_tid, kmp_int32 num_threads) to generate code for 'num_threads'
1922 SourceLocation Loc) override;
1924 /// Emit call to void __kmpc_push_proc_bind(ident_t *loc, kmp_int32
1925 /// global_tid, int proc_bind) to generate code for 'proc_bind' clause.
1928 SourceLocation Loc) override;
1934 /// \param Loc Location of the reference to threadprivate var.
1937 Address VDAddr, SourceLocation Loc) override;
1939 /// Emit a code for initialization of threadprivate variable. It emits
1945 /// \param Loc Location of threadprivate declaration.
1949 SourceLocation Loc, bool PerformInit,
1963 SourceLocation Loc, llvm::AtomicOrdering AO) override;
1972 /// TaskFunction(gtid, tt->part_id, tt->shareds);
1992 void emitTaskCall(CodeGenFunction &CGF, SourceLocation Loc,
2005 /// TaskFunction(gtid, tt->part_id, tt->shareds);
2012 /// 4. Emit a call to void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t
2027 void emitTaskLoopCall(CodeGenFunction &CGF, SourceLocation Loc,
2032 /// Emit a code for reduction clause. Next code should be emitted for
2034 /// \code
2045 /// void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]};
2046 /// switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList),
2052 /// __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
2074 void emitReduction(CodeGenFunction &CGF, SourceLocation Loc,
2081 /// Emit a code for initialization of task reduction clause. Next code
2083 /// \code
2098 /// \code
2110 /// void* tg1 = __kmpc_taskred_modifier_init(loc, gtid, is_worksharing, n,
2117 llvm::Value *emitTaskReductionInit(CodeGenFunction &CGF, SourceLocation Loc,
2122 /// Emits the following code for reduction clause with task modifier:
2123 /// \code
2124 /// __kmpc_task_reduction_modifier_fini(loc, gtid, is_worksharing);
2126 void emitTaskReductionFini(CodeGenFunction &CGF, SourceLocation Loc,
2136 void emitTaskReductionFixups(CodeGenFunction &CGF, SourceLocation Loc,
2144 Address getTaskReductionItem(CodeGenFunction &CGF, SourceLocation Loc,
2148 /// Emit code for 'taskwait' directive.
2149 void emitTaskwaitCall(CodeGenFunction &CGF, SourceLocation Loc,
2152 /// Emit code for 'cancellation point' construct.
2156 void emitCancellationPointCall(CodeGenFunction &CGF, SourceLocation Loc,
2159 /// Emit code for 'cancel' construct.
2164 void emitCancelCall(CodeGenFunction &CGF, SourceLocation Loc,
2174 /// \param CodeGen Code generation sequence for the \a D directive.
2184 /// Emit the target offloading code associated with \a D. The emitted
2185 /// code attempts offloading the execution to the device, an the event of
2188 /// \param OutlinedFn Host version of the code to be offloaded.
2189 /// \param OutlinedFnID ID of host version of the code to be offloaded.
2218 /// Emits code for teams call of the \a OutlinedFn with
2227 SourceLocation Loc, llvm::Function *OutlinedFn,
2230 /// Emits call to void __kmpc_push_num_teams(ident_t *loc, kmp_int32
2231 /// global_tid, kmp_int32 num_teams, kmp_int32 thread_limit) to generate code
2236 const Expr *ThreadLimit, SourceLocation Loc) override;
2238 /// Emit the target data mapping code associated with \a D.
2251 /// Emit the data mapping/movement code associated with the directive
2264 /// \param D Loop-based construct used in doacross nesting construct.
2268 /// Emit code for doacross ordered directive with 'depend' clause.
2273 /// Emit code for doacross ordered directive with 'doacross' clause.
2286 /// target-specific parameter.
2288 /// \param TargetParam Corresponding target-specific parameter.
2292 /// Gets the OpenMP-specific address of the local variable.
2310 return C->getDependencyKind() == OMPC_DEPEND_sink; in isSink()
2313 return C->getDependencyKind() == OMPC_DEPEND_source; in isSource()
2319 return C->getDependenceType() == OMPC_DOACROSS_source || in isSource()
2320 C->getDependenceType() == OMPC_DOACROSS_source_omp_cur_iteration; in isSource()
2323 return C->getDependenceType() == OMPC_DOACROSS_sink || in isSink()
2324 C->getDependenceType() == OMPC_DOACROSS_sink_omp_cur_iteration; in isSink()