77//
88// ===----------------------------------------------------------------------===//
99
10- #include " mlir/Analysis/SliceAnalysis.h"
1110#include " mlir/Dialect/LLVMIR/Transforms/OpenMPOffloadPrivatizationPrepare.h"
11+ #include " mlir/Analysis/SliceAnalysis.h"
1212#include " mlir/Dialect/Func/IR/FuncOps.h"
1313#include " mlir/Dialect/LLVMIR/FunctionCallUtils.h"
1414#include " mlir/Dialect/LLVMIR/LLVMDialect.h"
@@ -244,9 +244,8 @@ class OMPTargetPrepareDelayedPrivatizationPattern
244244 for (auto repl : replRecord) {
245245 Operation *origOp = repl.first ;
246246 Operation *clonedOp = repl.second ;
247- rewriter.modifyOpInPlace (clonedOp, [&]() {
248- clonedOp->replaceUsesOfWith (varPtr, heapMem);
249- });
247+ rewriter.modifyOpInPlace (
248+ clonedOp, [&]() { clonedOp->replaceUsesOfWith (varPtr, heapMem); });
250249 rewriter.eraseOp (origOp);
251250 }
252251 }
@@ -312,7 +311,7 @@ class OMPTargetPrepareDelayedPrivatizationPattern
312311 // Get the (compile-time constant) size of varType as per the
313312 // given DataLayout dl.
314313 std::int64_t getSizeInBytes (const mlir::DataLayout &dl,
315- mlir::Type varType) const {
314+ mlir::Type varType) const {
316315 llvm::TypeSize size = dl.getTypeSize (varType);
317316 unsigned short alignment = dl.getTypeABIAlignment (varType);
318317 return llvm::alignTo (size, alignment);
@@ -350,7 +349,8 @@ class OMPTargetPrepareDelayedPrivatizationPattern
350349 LLVM::LLVMFuncOp getMalloc (ModuleOp mod, PatternRewriter &rewriter) const {
351350 llvm::FailureOr<mlir::LLVM::LLVMFuncOp> mallocCall =
352351 LLVM::lookupOrCreateMallocFn (rewriter, mod, rewriter.getI64Type ());
353- assert (llvm::succeeded (mallocCall) && " Could not find malloc in the module" );
352+ assert (llvm::succeeded (mallocCall) &&
353+ " Could not find malloc in the module" );
354354 return mallocCall.value ();
355355 }
356356
@@ -372,8 +372,8 @@ class OMPTargetPrepareDelayedPrivatizationPattern
372372 mlir::Value sizeBytes = rewriter.create <LLVM::ConstantOp>(
373373 loc, mallocFn.getFunctionType ().getParamType (0 ), distance);
374374
375- auto mallocCallOp = rewriter. create <LLVM::CallOp>(loc, mallocFn,
376- ValueRange{sizeBytes});
375+ auto mallocCallOp =
376+ rewriter. create <LLVM::CallOp>(loc, mallocFn, ValueRange{sizeBytes});
377377 return mallocCallOp.getResult ();
378378 }
379379
@@ -409,7 +409,7 @@ struct PrepareForOMPOffloadPrivatizationPass
409409
410410 RewritePatternSet patterns (&context);
411411 patterns.add <OMPTargetPrepareDelayedPrivatizationPattern>(&context);
412- LLVM_DEBUG ( llvm::dbgs () << " Module before : " << mod << " \n " );
412+
413413 if (mlir::failed (
414414 applyPatternsGreedily (func, std::move (patterns),
415415 GreedyRewriteConfig ().setStrictness (
@@ -418,8 +418,6 @@ struct PrepareForOMPOffloadPrivatizationPass
418418 " error in preparing targetOps for delayed privatization." );
419419 signalPassFailure ();
420420 }
421- LLVM_DEBUG (llvm::dbgs () << " Module after : " << mod << " \n " );
422-
423421 }
424422};
425423} // namespace
0 commit comments