diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp --- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp @@ -187,15 +187,15 @@ } /// Process data operands from acc::EnterDataOp -static LogicalResult -processDataOperands(llvm::IRBuilderBase &builder, - LLVM::ModuleTranslation &moduleTranslation, - acc::EnterDataOp op, SmallVector &flags, - SmallVector &names, unsigned &index, - llvm::AllocaInst *argsBase, llvm::AllocaInst *args, - llvm::AllocaInst *argSizes) { +static LogicalResult processDataOperands( + llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, + acc::EnterDataOp op, SmallVector &flags, + SmallVector &names, llvm::AllocaInst *argsBase, + llvm::AllocaInst *args, llvm::AllocaInst *argSizes) { // TODO add `create_zero` and `attach` operands + unsigned index = 0; + // Create operands are handled as `alloc` call. if (failed(processOperands(builder, moduleTranslation, op, op.createOperands(), op.getNumDataOperands(), @@ -214,15 +214,15 @@ } /// Process data operands from acc::ExitDataOp -static LogicalResult -processDataOperands(llvm::IRBuilderBase &builder, - LLVM::ModuleTranslation &moduleTranslation, - acc::ExitDataOp op, SmallVector &flags, - SmallVector &names, unsigned &index, - llvm::AllocaInst *argsBase, llvm::AllocaInst *args, - llvm::AllocaInst *argSizes) { +static LogicalResult processDataOperands( + llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, + acc::ExitDataOp op, SmallVector &flags, + SmallVector &names, llvm::AllocaInst *argsBase, + llvm::AllocaInst *args, llvm::AllocaInst *argSizes) { // TODO add `detach` operands + unsigned index = 0; + // Delete operands are handled as `delete` call. if (failed(processOperands(builder, moduleTranslation, op, op.deleteOperands(), op.getNumDataOperands(), @@ -241,13 +241,12 @@ } /// Process data operands from acc::UpdateOp -static LogicalResult -processDataOperands(llvm::IRBuilderBase &builder, - LLVM::ModuleTranslation &moduleTranslation, - acc::UpdateOp op, SmallVector &flags, - SmallVector &names, unsigned &index, - llvm::AllocaInst *argsBase, llvm::AllocaInst *args, - llvm::AllocaInst *argSizes) { +static LogicalResult processDataOperands( + llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation, + acc::UpdateOp op, SmallVector &flags, + SmallVector &names, llvm::AllocaInst *argsBase, + llvm::AllocaInst *args, llvm::AllocaInst *argSizes) { + unsigned index = 0; // Host operands are handled as `from` call. if (failed(processOperands(builder, moduleTranslation, op, op.hostOperands(), @@ -305,10 +304,9 @@ SmallVector flags; SmallVector names; - unsigned index = 0; if (failed(processDataOperands(builder, moduleTranslation, op, flags, names, - index, argsBase, args, argSizes))) + argsBase, args, argSizes))) return failure(); llvm::GlobalVariable *maptypes =