This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc] Translate ExitDataop to LLVM IR
ClosedPublic

Authored by clementval on May 12 2021, 5:19 PM.

Details

Summary

Translate ExitDataOp with delete and copyout operands to runtime call.
This is done in a similar way as D101504.

Diff Detail

Event Timeline

clementval created this revision.May 12 2021, 5:19 PM
clementval requested review of this revision.May 12 2021, 5:19 PM

A few questions.

mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
89–95

Can this also be a typeswitch?

mlir/test/Target/LLVMIR/openacc-llvm.mlir
71–76

Can this (%0,%1,%2,%3,%4,%5) be removed to make the testcase simpler? Can %5 come in as an argument?

80

Is getting a pointer with offset from NULL what is expected or is this just a syntactic example?

clementval marked an inline comment as done.May 13 2021, 7:18 AM
clementval added inline comments.
mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
89–95

Sure. I'll update that.

mlir/test/Target/LLVMIR/openacc-llvm.mlir
71–76

Sure I can do that. Let me update the test case.

80

That is expected.

This is the direct LLVM IR version of what is done in the std-to-llvm conversion. Comment from this conversion.

// Compute the size of an individual element. This emits the MLIR equivalent
// of the following sizeof(...) implementation in LLVM IR:
//   %0 = getelementptr %elementType* null, %indexType 1
//   %1 = ptrtoint %elementType* %0 to %indexType
// which is a common pattern of getting the size of a type in bytes.
clementval marked an inline comment as done.

Address review comments

clementval marked 2 inline comments as done.May 13 2021, 7:39 AM

Simplify TypeSwitch

LGTM. Please wait a day to see whether others have comments.

This revision is now accepted and ready to land.May 14 2021, 4:42 PM
This revision was automatically updated to reflect the committed changes.