MLIR 24.0.0git
ACCDataDirectivePatterns.cpp
Go to the documentation of this file.
1//===- ACCDataDirectivePatterns.cpp - ACC data to LLVM ----------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Lowering of the OpenACC data constructs - data, enter data, exit data,
10// update and declare - to the data entry points of the OpenACC runtime. Each
11// construct becomes one call per point where it establishes or tears down its
12// mappings, which carries the argument arrays its operands are packed into,
13// the queue its async clause selects and, before them, the wait its wait
14// clause asks for. An if clause guards the calls it applies to, and the body
15// of a structured construct is left in place of the construct.
16//
17//===----------------------------------------------------------------------===//
18
22
29
30using namespace mlir;
31using namespace mlir::acc;
32
33/// Emits the call to the mapping entry point \p fn for \p mappingOperands, the
34/// data-clause operands of a data construct, paired with their type converted
35/// values in \p convertedOperands.
36static LogicalResult emitDataRuntimeCall(
37 Location loc, RuntimeFunction fn, ValueRange mappingOperands,
38 ValueRange convertedOperands, ACCDataCallKind callKind,
39 ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport,
40 Region &globalSymbolRegion, SymbolTable &symbolTable,
41 const ACCRuntimeCallConfig &config, ArrayRef<Value> trailingArguments) {
43 options.callKind = callKind;
45 loc, fn, mappingOperands, convertedOperands, rewriter, accSupport,
46 globalSymbolRegion, symbolTable, config, trailingArguments, options);
47}
48
49/// Returns the action that the declare-action recipe holding \p op carries
50/// out, which the recipe states by naming itself in the matching slot of its
51/// `acc.declare_action` attribute. Returns a null attribute when \p op is not
52/// in such a recipe.
53static DeclareActionAttr getEnclosingDeclareAction(Operation *op) {
54 auto func = dyn_cast<FunctionOpInterface>(op);
55 if (!func)
56 func = op->getParentOfType<FunctionOpInterface>();
57 if (!func)
58 return {};
59 return func->getAttrOfType<DeclareActionAttr>(getDeclareActionAttrName());
60}
61
63 ConversionPatternRewriter &rewriter,
64 const ACCRuntimeCallConfig &config) {
65 return LLVM::ConstantOp::create(rewriter, loc, rewriter.getI64Type(),
67}
68
69namespace {
70template <typename OpTy>
71struct ACCDataDirectivePattern : public ConvertOpToLLVMPattern<OpTy> {
72 ACCDataDirectivePattern(const LLVMTypeConverter &converter,
73 OpenACCSupport &accSupport,
74 Region &globalSymbolRegion, SymbolTable &symbolTable,
75 const ACCRuntimeCallConfig &config,
76 DeviceType clauseDeviceType,
77 PatternBenefit benefit = 1)
78 : ConvertOpToLLVMPattern<OpTy>(converter, benefit),
79 accSupport(accSupport), globalSymbolRegion(globalSymbolRegion),
80 symbolTable(symbolTable), config(config),
81 clauseDeviceType(clauseDeviceType) {}
82
83 /// Returns the queue that the mapping calls of \p op run on.
84 Value getAsyncQueue(OpTy op, ConversionPatternRewriter &rewriter) const {
85 return acc::getAsyncQueue(op, clauseDeviceType, rewriter, config);
86 }
87
88 /// Emits the wait that a wait clause on \p op asks for before its mapping
89 /// calls.
90 LogicalResult emitWaitClause(OpTy op, Value asyncQueue,
91 ConversionPatternRewriter &rewriter) const {
92 return acc::emitWaitClause(op, clauseDeviceType, asyncQueue, rewriter,
93 accSupport, globalSymbolRegion, symbolTable,
94 config);
95 }
96
97 /// Emits one mapping call for the data-clause operands of \p op.
98 LogicalResult emitMappingCall(OpTy op, ValueRange convertedOperands,
99 Location loc, RuntimeFunction fn,
100 ACCDataCallKind callKind, Value asyncQueue,
101 ConversionPatternRewriter &rewriter) const {
102 return emitDataRuntimeCall(loc, fn, op.getDataClauseOperands(),
103 convertedOperands, callKind, rewriter,
104 accSupport, globalSymbolRegion, symbolTable,
105 config, {asyncQueue});
106 }
107
108 OpenACCSupport &accSupport;
109 Region &globalSymbolRegion;
110 SymbolTable &symbolTable;
111 ACCRuntimeCallConfig config;
112 DeviceType clauseDeviceType;
113};
114
115struct DataOpLowering : public ACCDataDirectivePattern<DataOp> {
116 using ACCDataDirectivePattern<DataOp>::ACCDataDirectivePattern;
117
118 LogicalResult
119 matchAndRewrite(DataOp op, DataOp::Adaptor adaptor,
120 ConversionPatternRewriter &rewriter) const override {
121 // The mappings are established where the clause operations are, and torn
122 // down where the exit operations of the construct were.
123 ValueRange mappingOperands = op.getDataClauseOperands();
124 Location beginLoc = mappingOperands.empty()
125 ? op.getLoc()
126 : mappingOperands.front().getLoc();
127 Location endLoc =
128 acc::getMappingExitLoc(mappingOperands).value_or(beginLoc);
129 Value asyncQueue = getAsyncQueue(op, rewriter);
130 if (failed(emitWaitClause(op, asyncQueue, rewriter)))
131 return failure();
132
133 auto emitBegin = [&]() {
134 return emitMappingCall(op, adaptor.getDataClauseOperands(), beginLoc,
135 RuntimeFunction::ACCRTL_tgt_acc_data_begin,
136 ACCDataCallKind::DataEnter, asyncQueue, rewriter);
137 };
138 if (failed(acc::emitGuardedByIfCond(beginLoc, adaptor.getIfCond(), rewriter,
139 emitBegin)))
140 return failure();
141
142 rewriter.setInsertionPointAfter(op);
143 auto emitEnd = [&]() {
144 return emitMappingCall(op, adaptor.getDataClauseOperands(), endLoc,
145 RuntimeFunction::ACCRTL_tgt_acc_data_end,
146 ACCDataCallKind::DataExit, asyncQueue, rewriter);
147 };
148 if (failed(acc::emitGuardedByIfCond(endLoc, adaptor.getIfCond(), rewriter,
149 emitEnd)))
150 return failure();
151
152 acc::spliceConstructRegion(op, op.getRegion(), rewriter);
153 rewriter.eraseOp(op);
154 return success();
155 }
156};
157
158/// Lowering shared by the directives that map their operands with a single
159/// call: enter data, exit data and update.
160template <typename OpTy, RuntimeFunction fn, ACCDataCallKind callKind>
161struct ACCDataCallLowering : public ACCDataDirectivePattern<OpTy> {
162 using ACCDataDirectivePattern<OpTy>::ACCDataDirectivePattern;
163
164 LogicalResult
165 matchAndRewrite(OpTy op, typename OpTy::Adaptor adaptor,
166 ConversionPatternRewriter &rewriter) const override {
167 Location loc = op.getLoc();
168 Value asyncQueue = this->getAsyncQueue(op, rewriter);
169 if (failed(this->emitWaitClause(op, asyncQueue, rewriter)))
170 return failure();
171
172 auto emit = [&]() {
173 return this->emitMappingCall(op, adaptor.getDataClauseOperands(), loc, fn,
174 callKind, asyncQueue, rewriter);
175 };
176 if (failed(
177 acc::emitGuardedByIfCond(loc, adaptor.getIfCond(), rewriter, emit)))
178 return failure();
179 rewriter.eraseOp(op);
180 return success();
181 }
182};
183
184using EnterDataOpLowering =
185 ACCDataCallLowering<EnterDataOp, RuntimeFunction::ACCRTL_tgt_acc_data_enter,
187using ExitDataOpLowering =
188 ACCDataCallLowering<ExitDataOp, RuntimeFunction::ACCRTL_tgt_acc_data_exit,
190using UpdateOpLowering =
191 ACCDataCallLowering<UpdateOp, RuntimeFunction::ACCRTL_tgt_acc_data_update,
193
194/// Structured `acc.declare_enter` (token used by a matching exit) maps like
195/// `acc.data` enter. In a declare-action recipe the object the directive
196/// names is allocated by the host, so only the device mirror of it is
197/// allocated here. An unstructured enter registers the objects it names with
198/// `__tgt_acc_declare`.
199struct DeclareEnterOpLowering : public ConvertOpToLLVMPattern<DeclareEnterOp> {
200 DeclareEnterOpLowering(const LLVMTypeConverter &converter,
201 OpenACCSupport &accSupport, Region &globalSymbolRegion,
202 SymbolTable &symbolTable,
203 const ACCRuntimeCallConfig &config,
204 PatternBenefit benefit = 1)
205 : ConvertOpToLLVMPattern<DeclareEnterOp>(converter, benefit),
206 accSupport(accSupport), globalSymbolRegion(globalSymbolRegion),
207 symbolTable(symbolTable), config(config) {}
208
209 LogicalResult
210 matchAndRewrite(DeclareEnterOp op, DeclareEnterOp::Adaptor adaptor,
211 ConversionPatternRewriter &rewriter) const override {
212 Location loc = op.getLoc();
213 ValueRange mappingOperands = op.getDataClauseOperands();
214 ValueRange convertedOperands = adaptor.getDataClauseOperands();
215 Value asyncQueue = getDeclareAsyncQueue(loc, rewriter, config);
216
217 LogicalResult emitted = success();
219 emitted = emitDataRuntimeCall(
220 loc, RuntimeFunction::ACCRTL_tgt_acc_mirror_alloc, mappingOperands,
221 convertedOperands, ACCDataCallKind::DataEnter, rewriter, accSupport,
222 globalSymbolRegion, symbolTable, config, {});
223 } else if (!op.getToken().use_empty()) {
224 emitted = emitDataRuntimeCall(
225 loc, RuntimeFunction::ACCRTL_tgt_acc_data_begin, mappingOperands,
226 convertedOperands, ACCDataCallKind::DataEnter, rewriter, accSupport,
227 globalSymbolRegion, symbolTable, config, {asyncQueue});
228 } else {
229 Value binaryDescriptor =
230 config.createDeclareBinaryDescriptor(loc, rewriter);
231 emitted = emitDataRuntimeCall(
232 loc, RuntimeFunction::ACCRTL_tgt_acc_declare, mappingOperands,
233 convertedOperands, ACCDataCallKind::DataEnter, rewriter, accSupport,
234 globalSymbolRegion, symbolTable, config,
235 {asyncQueue, binaryDescriptor});
236 }
237 if (failed(emitted))
238 return failure();
239
240 if (op.getToken().use_empty()) {
241 rewriter.eraseOp(op);
242 } else {
243 // The token only ties a structured enter to its exit. Keep a converted
244 // placeholder until the exit is erased; it carries no runtime state.
245 Type tokenTy = getTypeConverter()->convertType(op.getToken().getType());
246 rewriter.replaceOp(op, LLVM::ZeroOp::create(rewriter, loc, tokenTy));
247 }
248 return success();
249 }
250
251 OpenACCSupport &accSupport;
252 Region &globalSymbolRegion;
253 SymbolTable &symbolTable;
254 ACCRuntimeCallConfig config;
255};
256
257/// A recipe that runs before the host object is deallocated frees the device
258/// mirror of it, as the mapping is torn down once the host storage is gone.
259/// Every other `acc.declare_exit` ends the mapping with `__tgt_acc_data_end`.
260struct DeclareExitOpLowering : public ConvertOpToLLVMPattern<DeclareExitOp> {
261 DeclareExitOpLowering(const LLVMTypeConverter &converter,
262 OpenACCSupport &accSupport, Region &globalSymbolRegion,
263 SymbolTable &symbolTable,
264 const ACCRuntimeCallConfig &config,
265 PatternBenefit benefit = 1)
266 : ConvertOpToLLVMPattern<DeclareExitOp>(converter, benefit),
267 accSupport(accSupport), globalSymbolRegion(globalSymbolRegion),
268 symbolTable(symbolTable), config(config) {}
269
270 LogicalResult
271 matchAndRewrite(DeclareExitOp op, DeclareExitOp::Adaptor adaptor,
272 ConversionPatternRewriter &rewriter) const override {
273 Location loc = op.getLoc();
274 ValueRange mappingOperands = op.getDataClauseOperands();
275 ValueRange convertedOperands = adaptor.getDataClauseOperands();
276 Value asyncQueue = getDeclareAsyncQueue(loc, rewriter, config);
277
278 LogicalResult emitted = success();
279 DeclareActionAttr action = getEnclosingDeclareAction(op);
280 if (action && action.getPreDealloc()) {
281 emitted = emitDataRuntimeCall(
282 loc, RuntimeFunction::ACCRTL_tgt_acc_mirror_dealloc, mappingOperands,
283 convertedOperands, ACCDataCallKind::DataEnter, rewriter, accSupport,
284 globalSymbolRegion, symbolTable, config, {});
285 } else {
286 emitted = emitDataRuntimeCall(
287 loc, RuntimeFunction::ACCRTL_tgt_acc_data_end, mappingOperands,
288 convertedOperands, ACCDataCallKind::DataExit, rewriter, accSupport,
289 globalSymbolRegion, symbolTable, config, {asyncQueue});
290 }
291 if (failed(emitted))
292 return failure();
293 rewriter.eraseOp(op);
294 return success();
295 }
296
297 OpenACCSupport &accSupport;
298 Region &globalSymbolRegion;
299 SymbolTable &symbolTable;
300 ACCRuntimeCallConfig config;
301};
302
303/// A data clause operation only describes a mapping; the runtime calls of the
304/// construct carry everything it said, so the operation itself goes away once
305/// they are in place. Whatever else referred to the mapped object is given the
306/// address of that object, which is what the clause result stood for.
307template <typename OpTy>
308struct DataEntryOpLowering : public ConvertOpToLLVMPattern<OpTy> {
309 using ConvertOpToLLVMPattern<OpTy>::ConvertOpToLLVMPattern;
310 using OpAdaptor = typename OpTy::Adaptor;
311
312 LogicalResult
313 matchAndRewrite(OpTy op, OpAdaptor adaptor,
314 ConversionPatternRewriter &rewriter) const override {
315 rewriter.replaceOp(op, adaptor.getVar());
316 return success();
317 }
318};
319
320/// An `acc.getdeviceptr` clause stands for the device address of an object
321/// whose mapping was established elsewhere. Where it names the object of a
322/// data exit operation, the runtime call of that construct carries the host
323/// address and looks the device one up itself, so the clause is replaced by
324/// the address of the object as any other data entry clause is. Read as a
325/// value, it is the runtime that has to be asked for the address.
326struct GetDevicePtrOpLowering
327 : public ConvertOpToLLVMPattern<acc::GetDevicePtrOp> {
328 GetDevicePtrOpLowering(const LLVMTypeConverter &converter,
329 OpenACCSupport &accSupport, Region &globalSymbolRegion,
330 SymbolTable &symbolTable,
331 const ACCRuntimeCallConfig &config,
332 PatternBenefit benefit = 1)
333 : ConvertOpToLLVMPattern<acc::GetDevicePtrOp>(converter, benefit),
334 accSupport(accSupport), globalSymbolRegion(globalSymbolRegion),
335 symbolTable(symbolTable), config(config) {}
336
337 /// Returns whether \p user only states the mapping the clause describes,
338 /// which is what a data exit operation and the construct holding the clause
339 /// do.
340 static bool isMappingUse(Operation *user) {
342 acc::KernelEnvironmentOp>(user);
343 }
344
345 LogicalResult
346 matchAndRewrite(acc::GetDevicePtrOp op, OpAdaptor adaptor,
347 ConversionPatternRewriter &rewriter) const override {
348 bool readAsValue = llvm::any_of(
349 op->getUsers(), [](Operation *user) { return !isMappingUse(user); });
350 if (!readAsValue) {
351 rewriter.replaceOp(op, adaptor.getVar());
352 return success();
353 }
354 // The mapping hands the host address of the object to the runtime call of
355 // the construct, so the clause cannot stand for the device address at the
356 // same time.
357 if (llvm::any_of(op->getUsers(), isMappingUse)) {
358 (void)accSupport.emitNYI(
359 op.getLoc(), "device address read from a clause that also states a "
360 "mapping of the object");
361 return failure();
362 }
363
364 FailureOr<Value> devicePtr = acc::emitGetDevicePtrCall(
365 op, adaptor.getVar(), /*ifPresent=*/false, rewriter, globalSymbolRegion,
366 symbolTable, config);
367 if (failed(devicePtr))
368 return failure();
369 rewriter.replaceOp(op, *devicePtr);
370 return success();
371 }
372
373 OpenACCSupport &accSupport;
374 Region &globalSymbolRegion;
375 SymbolTable &symbolTable;
376 ACCRuntimeCallConfig config;
377};
378
379/// A data exit operation and the bounds of a mapping have no result to stand
380/// in for, so they are simply removed with the construct that used them.
381template <typename OpTy>
382struct EraseDataClauseOp : public ConvertOpToLLVMPattern<OpTy> {
383 using ConvertOpToLLVMPattern<OpTy>::ConvertOpToLLVMPattern;
384 using OpAdaptor = typename OpTy::Adaptor;
385
386 LogicalResult
387 matchAndRewrite(OpTy op, OpAdaptor,
388 ConversionPatternRewriter &rewriter) const override {
389 rewriter.eraseOp(op);
390 return success();
391 }
392};
393
394} // namespace
395
398 // The map entries themselves stay legal: a construct removes the ones it
399 // consumes, and the ones describing a construct that is lowered elsewhere
400 // have to survive this conversion. An `acc.getdeviceptr` read as a value is
401 // the exception, as the address it stands for is only known to the runtime,
402 // so leaving it behind would state a mapping that nothing carries out.
403 target.addIllegalOp<acc::DataOp, acc::EnterDataOp, acc::ExitDataOp,
404 acc::UpdateOp, acc::DeclareEnterOp, acc::DeclareExitOp,
405 acc::GetDevicePtrOp>();
406}
407
409 LLVMTypeConverter &converter, RewritePatternSet &patterns,
410 acc::OpenACCSupport &accSupport, Region &globalSymbolRegion,
411 SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config) {
412 // Bounds describe a mapping rather than data, and they are removed together
413 // with the clause operations holding them, so their type only has to survive
414 // this conversion.
415 converter.addConversion(
416 [](acc::DataBoundsType type) -> Type { return type; });
417
418 patterns.add<
419 DataEntryOpLowering<acc::MapInfoOp>, DataEntryOpLowering<acc::CopyinOp>,
420 DataEntryOpLowering<acc::CreateOp>, DataEntryOpLowering<acc::PresentOp>,
421 DataEntryOpLowering<acc::NoCreateOp>, DataEntryOpLowering<acc::AttachOp>,
422 DataEntryOpLowering<acc::DevicePtrOp>,
423 DataEntryOpLowering<acc::UpdateDeviceOp>,
424 DataEntryOpLowering<acc::PrivateOp>,
425 DataEntryOpLowering<acc::FirstprivateOp>,
426 DataEntryOpLowering<acc::FirstprivateMapInitialOp>,
427 DataEntryOpLowering<acc::DeclareDeviceResidentOp>,
428 DataEntryOpLowering<acc::DeclareLinkOp>,
429 EraseDataClauseOp<acc::CopyoutOp>, EraseDataClauseOp<acc::DeleteOp>,
430 EraseDataClauseOp<acc::DetachOp>, EraseDataClauseOp<acc::UpdateHostOp>,
431 EraseDataClauseOp<acc::DataBoundsOp>>(converter);
432 patterns.add<GetDevicePtrOpLowering>(converter, accSupport,
433 globalSymbolRegion, symbolTable, config);
434}
435
437 LLVMTypeConverter &converter, RewritePatternSet &patterns,
438 acc::OpenACCSupport &accSupport, Region &globalSymbolRegion,
439 SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config,
440 acc::DeviceType clauseDeviceType) {
441 converter.addConversion([](acc::DeclareTokenType type) -> Type {
442 return LLVM::LLVMPointerType::get(type.getContext());
443 });
444
445 patterns.add<DataOpLowering, EnterDataOpLowering, ExitDataOpLowering,
446 UpdateOpLowering>(converter, accSupport, globalSymbolRegion,
447 symbolTable, config, clauseDeviceType);
448 patterns.add<DeclareEnterOpLowering, DeclareExitOpLowering>(
449 converter, accSupport, globalSymbolRegion, symbolTable, config);
450}
static DeclareActionAttr getEnclosingDeclareAction(Operation *op)
Returns the action that the declare-action recipe holding op carries out, which the recipe states by ...
static LogicalResult emitDataRuntimeCall(Location loc, RuntimeFunction fn, ValueRange mappingOperands, ValueRange convertedOperands, ACCDataCallKind callKind, ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config, ArrayRef< Value > trailingArguments)
Emits the call to the mapping entry point fn for mappingOperands, the data-clause operands of a data ...
static Value getDeclareAsyncQueue(Location loc, ConversionPatternRewriter &rewriter, const ACCRuntimeCallConfig &config)
return success()
static llvm::ManagedStatic< PassManagerOptions > options
static LogicalResult emit(SolverOp solver, const SMTEmissionOptions &options, mlir::raw_indented_ostream &stream)
Emit the SMT operations in the given 'solver' to the 'stream'.
Utility class for operation conversions targeting the LLVM dialect that match exactly one source oper...
Definition Pattern.h:233
Conversion from types to the LLVM IR dialect.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition Location.h:76
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
OpTy getParentOfType()
Return the closest surrounding parent operation that is of type 'OpTy'.
Definition Operation.h:255
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Definition Region.h:26
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
This class allows for representing and managing the symbol table used by operations with the 'SymbolT...
Definition SymbolTable.h:25
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition Types.h:74
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:389
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
Configuration for OpenACC to LLVM runtime lowering.
#define ACC_COMPUTE_AND_DATA_CONSTRUCT_OPS
Definition OpenACC.h:75
#define ACC_DATA_EXIT_OPS
Definition OpenACC.h:60
std::optional< Location > getMappingExitLoc(ValueRange dataClauseOperands)
Returns where the mappings of dataClauseOperands end, taken from the first of them that says.
LogicalResult emitWaitClause(OpTy op, DeviceType deviceType, Value asyncQueue, ConversionPatternRewriter &rewriter, OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config)
Emits the wait that a wait clause on op asks for before the runtime calls of the construct,...
Value getAsyncQueue(Location loc, Value asyncOperand, bool asyncOnly, OpBuilder &builder, const ACCRuntimeCallConfig &config)
Returns the queue an async clause selects: the value of the clause when it has one,...
RuntimeFunction
IDs for OpenACC compiler-to-runtime entry points (__tgt_acc_*).
LogicalResult emitGuardedByIfCond(Location loc, Value ifCond, RewriterBase &rewriter, function_ref< LogicalResult()> emitFn)
Runs emitFn guarded by a branch on ifCond, or unguarded when there is no condition.
static constexpr StringLiteral getDeclareActionAttrName()
Definition OpenACC.h:200
void spliceConstructRegion(Operation *op, Region &region, RewriterBase &rewriter)
Splices region, the body of a structured construct, into the block holding op, so that the construct ...
FailureOr< Value > emitGetDevicePtrCall(Operation *clauseOp, Value hostPtr, bool ifPresent, OpBuilder &builder, Region &globalSymbolRegion, SymbolTable &symbolTable, const ACCRuntimeCallConfig &config)
Emits the runtime call that asks for the device address the object of the data clause clauseOp is map...
detail::InFlightRemark failed(Location loc, RemarkOpts opts)
Report an optimization remark that failed.
Definition Remarks.h:734
Include the generated interface declarations.
void populateACCDataClauseOpPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns, acc::OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config={})
Populate the patterns that remove OpenACC data clause operations once the constructs holding them hav...
void populateACCDataDirectivePatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns, acc::OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config={}, acc::DeviceType clauseDeviceType=acc::DeviceType::None)
Populate patterns that lower OpenACC data directives (acc.data, enter_data, exit_data,...
FailureOr< SmallVector< Value > > emitACCDataRuntimeCall(Location loc, acc::RuntimeFunction fn, ValueRange mappingOperands, ValueRange convertedOperands, ConversionPatternRewriter &rewriter, acc::OpenACCSupport &accSupport, Region &globalSymbolRegion, SymbolTable &symbolTable, const acc::ACCRuntimeCallConfig &config, ArrayRef< Value > trailingArguments, const ACCDataCallOptions &options={})
Emit the call to the mapping entry point fn for mappingOperands, followed by trailingArguments.
ACCDataCallKind
Identifies how data runtime arguments will be consumed.
void configureACCDataDirectiveConversionLegality(ConversionTarget &target)
Configure conversion legality for OpenACC data directives.
What a data runtime call is asked for besides mapping its operands.