Skip to content

Commit 061669f

Browse files
Add some more comments and fix a typo
1 parent 72a769f commit 061669f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mlir/lib/Dialect/OpenMP/Transforms/OpenMPOffloadPrivatizationPrepare.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class PrepareForOMPOffloadPrivatizationPass
119119
// simply record the newly allocated malloc location as the
120120
// new private variable. If, however, the type is not a pointer
121121
// then, we need to load the value from the newly allocated
122-
// location. We'll inser that load later after we have updated
122+
// location. We'll insert that load later after we have updated
123123
// the malloc'd location with the contents of the original
124124
// variable.
125125
if (!isPrivatizedByValue)
@@ -360,6 +360,10 @@ class PrepareForOMPOffloadPrivatizationPass
360360
return mallocCallOp.getResult();
361361
}
362362

363+
// Create a function for srcRegion and attribute it to be always_inline.
364+
// The big assumption here is that srcRegion is one of init or copy regions
365+
// of a omp::PrivateClauseop. Accordingly, the return type is assumed
366+
// to be the same as the types of the two arguments of the region itself.
363367
LLVM::LLVMFuncOp createFuncOpForRegion(Location loc, ModuleOp mod,
364368
Region &srcRegion,
365369
llvm::StringRef funcName,
@@ -377,7 +381,6 @@ class PrepareForOMPOffloadPrivatizationPass
377381
LLVM::LLVMFunctionType funcType =
378382
LLVM::LLVMFunctionType::get(resultType, paramTypes);
379383

380-
LDBG() << "funcType is " << funcType << "\n";
381384
LLVM::LLVMFuncOp func =
382385
LLVM::LLVMFuncOp::create(rewriter, loc, funcName, funcType);
383386
func.setAlwaysInline(true);
@@ -392,8 +395,6 @@ class PrepareForOMPOffloadPrivatizationPass
392395
yieldOp.getOperands());
393396
}
394397
}
395-
LDBG() << funcName << " is \n" << func << "\n";
396-
LLVM_DEBUG(llvm::dbgs() << "Module is \n" << mod << "\n");
397398
return func;
398399
}
399400
};

0 commit comments

Comments
 (0)