[Mlir-commits] [mlir] cf84670 - [mlir][openacc][NFC] move index in processDataOperands

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 9 07:28:38 PDT 2021


Author: Valentin Clement
Date: 2021-06-09T10:28:30-04:00
New Revision: cf8467057947e019f7fe45d00836dfb629715064

URL: https://github.com/llvm/llvm-project/commit/cf8467057947e019f7fe45d00836dfb629715064
DIFF: https://github.com/llvm/llvm-project/commit/cf8467057947e019f7fe45d00836dfb629715064.diff

LOG: [mlir][openacc][NFC] move index in processDataOperands

Move the index variable used to track variables inside of the specific
processDataOperands functions.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D103924

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
index cbdf64f7966b8..4fbd051b65390 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
@@ -187,15 +187,15 @@ processOperands(llvm::IRBuilderBase &builder,
 }
 
 /// Process data operands from acc::EnterDataOp
-static LogicalResult
-processDataOperands(llvm::IRBuilderBase &builder,
-                    LLVM::ModuleTranslation &moduleTranslation,
-                    acc::EnterDataOp op, SmallVector<uint64_t> &flags,
-                    SmallVector<llvm::Constant *> &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<uint64_t> &flags,
+    SmallVector<llvm::Constant *> &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 @@ processDataOperands(llvm::IRBuilderBase &builder,
 }
 
 /// Process data operands from acc::ExitDataOp
-static LogicalResult
-processDataOperands(llvm::IRBuilderBase &builder,
-                    LLVM::ModuleTranslation &moduleTranslation,
-                    acc::ExitDataOp op, SmallVector<uint64_t> &flags,
-                    SmallVector<llvm::Constant *> &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<uint64_t> &flags,
+    SmallVector<llvm::Constant *> &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 @@ processDataOperands(llvm::IRBuilderBase &builder,
 }
 
 /// Process data operands from acc::UpdateOp
-static LogicalResult
-processDataOperands(llvm::IRBuilderBase &builder,
-                    LLVM::ModuleTranslation &moduleTranslation,
-                    acc::UpdateOp op, SmallVector<uint64_t> &flags,
-                    SmallVector<llvm::Constant *> &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<uint64_t> &flags,
+    SmallVector<llvm::Constant *> &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 @@ convertStandaloneDataOp(OpTy &op, llvm::IRBuilderBase &builder,
 
   SmallVector<uint64_t> flags;
   SmallVector<llvm::Constant *> names;
-  unsigned index = 0;
 
   if (failed(processDataOperands(builder, moduleTranslation, op, flags, names,
-                                 index, argsBase, args, argSizes)))
+                                 argsBase, args, argSizes)))
     return failure();
 
   llvm::GlobalVariable *maptypes =


        


More information about the Mlir-commits mailing list