Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mlir/include/mlir/IR/Builders.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ class OpBuilder : public Builder {
public:
/// Create an operation of specific op type at the current insertion point.
template <typename OpTy, typename... Args>
[[deprecated("Use OpTy::create instead")]]
OpTy create(Location location, Args &&...args) {
OperationState state(location,
getCheckRegisteredInfo<OpTy>(location.getContext()));
Expand All @@ -517,9 +518,9 @@ class OpBuilder : public Builder {
/// the results of the operation.
///
/// Note: This performs opportunistic eager folding during IR construction.
/// The folders are designed to operate efficiently on canonical IR, which
/// The folders are designed to operate efficiently on canonical IR, which
/// this API does not enforce. Complete folding isn't only expected in the
/// context of canonicalization which intertwine folders with pattern
/// context of canonicalization which intertwine folders with pattern
/// rewrites until fixed-point.
template <typename OpTy, typename... Args>
void createOrFold(SmallVectorImpl<Value> &results, Location location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ class PrepareForOMPOffloadPrivatizationPass
assert(!region.empty() && "region cannot be empty");
LLVM::LLVMFuncOp func = createFuncOpForRegion(
loc, mod, region, funcName, rewriter, returnsValue);
auto call = rewriter.create<LLVM::CallOp>(loc, func, args);
auto call = LLVM::CallOp::create(rewriter, loc, func, args);
return call.getResult();
};

Value moldArg, newArg;
if (isPrivatizedByValue) {
moldArg = rewriter.create<LLVM::LoadOp>(loc, varType, varPtr);
newArg = rewriter.create<LLVM::LoadOp>(loc, varType, heapMem);
moldArg = LLVM::LoadOp::create(rewriter, loc, varType, varPtr);
newArg = LLVM::LoadOp::create(rewriter, loc, varType, heapMem);
} else {
moldArg = varPtr;
newArg = heapMem;
Expand All @@ -234,7 +234,7 @@ class PrepareForOMPOffloadPrivatizationPass
{moldArg, initializedVal}, /*returnsValue=*/true);

if (isPrivatizedByValue)
(void)rewriter.create<LLVM::StoreOp>(loc, initializedVal, heapMem);
(void)LLVM::StoreOp::create(rewriter, loc, initializedVal, heapMem);

// clone origOp, replace all uses of varPtr with heapMem and
// erase origOp.
Expand Down Expand Up @@ -275,8 +275,8 @@ class PrepareForOMPOffloadPrivatizationPass
// targetOp.
if (isPrivatizedByValue) {
rewriter.setInsertionPoint(targetOp);
auto newPrivVar = rewriter.create<LLVM::LoadOp>(mapInfoOp.getLoc(),
varType, heapMem);
auto newPrivVar = LLVM::LoadOp::create(rewriter, mapInfoOp.getLoc(),
varType, heapMem);
newPrivVars.push_back(newPrivVar);
}

Expand All @@ -294,7 +294,7 @@ class PrepareForOMPOffloadPrivatizationPass
cleanupTaskOp = omp::TaskOp::create(rewriter, loc, taskOperands);
Block *taskBlock = rewriter.createBlock(&cleanupTaskOp.getRegion());
rewriter.setInsertionPointToEnd(taskBlock);
rewriter.create<omp::TerminatorOp>(cleanupTaskOp.getLoc());
omp::TerminatorOp::create(rewriter, cleanupTaskOp.getLoc());
}
rewriter.setInsertionPointToStart(
&*cleanupTaskOp.getRegion().getBlocks().begin());
Expand All @@ -307,8 +307,8 @@ class PrepareForOMPOffloadPrivatizationPass
LLVM::lookupOrCreateFreeFn(rewriter, mod);
assert(llvm::succeeded(freeFunc) &&
"Could not find free in the module");
(void)rewriter.create<LLVM::CallOp>(loc, freeFunc.value(),
ValueRange{heapMem});
(void)LLVM::CallOp::create(rewriter, loc, freeFunc.value(),
ValueRange{heapMem});
}
}
assert(newPrivVars.size() == privateVars.size() &&
Expand Down Expand Up @@ -390,11 +390,11 @@ class PrepareForOMPOffloadPrivatizationPass
const DataLayout &dl = DataLayout(mod);
std::int64_t distance = getSizeInBytes(dl, varType);

Value sizeBytes = rewriter.create<LLVM::ConstantOp>(
loc, mallocFn.getFunctionType().getParamType(0), distance);
Value sizeBytes = LLVM::ConstantOp::create(
rewriter, loc, mallocFn.getFunctionType().getParamType(0), distance);

auto mallocCallOp =
rewriter.create<LLVM::CallOp>(loc, mallocFn, ValueRange{sizeBytes});
LLVM::CallOp::create(rewriter, loc, mallocFn, ValueRange{sizeBytes});
return mallocCallOp.getResult();
}

Expand Down