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
2 changes: 1 addition & 1 deletion mlir/include/mlir/IR/Builders.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class OpBuilder : public Builder {
explicit OpBuilder(Region *region, Listener *listener = nullptr)
: OpBuilder(region->getContext(), listener) {
if (!region->empty())
setInsertionPoint(&region->front(), region->front().begin());
setInsertionPointToStart(&region->front());
}
explicit OpBuilder(Region &region, Listener *listener = nullptr)
: OpBuilder(&region, listener) {}
Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ void GPUToSPIRVPass::runOnOperation() {
// module inside the original GPU module, as that's the expectaion of the
// normal GPU compilation pipeline.
if (targetEnvSupportsKernelCapability(moduleOp)) {
builder.setInsertionPoint(moduleOp.getBody(),
moduleOp.getBody()->begin());
builder.setInsertionPointToStart(moduleOp.getBody());
} else {
builder.setInsertionPoint(moduleOp.getOperation());
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ class ExecutionModePattern
Block *block = rewriter.createBlock(&region);

// Initialize the struct and set the execution mode value.
rewriter.setInsertionPoint(block, block->begin());
rewriter.setInsertionPointToStart(block);
Value structValue = rewriter.create<LLVM::UndefOp>(loc, structType);
Value executionMode = rewriter.create<LLVM::ConstantOp>(
loc, llvmI32Type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ handleInlinedAllocas(Operation *call,
stackPtr = builder.create<LLVM::StackSaveOp>(
call->getLoc(), LLVM::LLVMPointerType::get(call->getContext()));
}
builder.setInsertionPoint(callerEntryBlock, callerEntryBlock->begin());
builder.setInsertionPointToStart(callerEntryBlock);
for (auto &[allocaOp, arraySize, shouldInsertLifetime] : allocasToMove) {
auto newConstant = builder.create<LLVM::ConstantOp>(
allocaOp->getLoc(), allocaOp.getArraySize().getType(), arraySize);
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static std::optional<Value> allocateSubviewGPUMemoryInAddressSpace(
shape.push_back(value.getSExtValue());
}

builder.setInsertionPoint(&funcOp.front(), funcOp.front().begin());
builder.setInsertionPointToStart(&funcOp.front());
auto type = MemRefType::get(
shape, subview.getType().getElementType(), MemRefLayoutAttrInterface{},
gpu::AddressSpaceAttr::get(builder.getContext(), addressSpace));
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/SCF/IR/SCF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ mlir::scf::replaceAndCastForOpIterArg(RewriterBase &rewriter, scf::ForOp forOp,
// 3. Inject an incoming cast op at the beginning of the block for the bbArg
// corresponding to the `replacement` value.
OpBuilder::InsertionGuard g(rewriter);
rewriter.setInsertionPoint(&newBlock, newBlock.begin());
rewriter.setInsertionPointToStart(&newBlock);
BlockArgument newRegionIterArg = newForOp.getTiedLoopRegionIterArg(
&newForOp->getOpOperand(operand.getOperandNumber()));
Value castIn = castFn(rewriter, newForOp.getLoc(), oldType, newRegionIterArg);
Expand Down
3 changes: 1 addition & 2 deletions mlir/lib/Dialect/SCF/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,7 @@ FailureOr<UnrolledLoopInfo> mlir::loopUnrollByFactor(
// Create epilogue clean up loop starting at 'upperBoundUnrolled'.
if (generateEpilogueLoop) {
OpBuilder epilogueBuilder(forOp->getContext());
epilogueBuilder.setInsertionPoint(forOp->getBlock(),
std::next(Block::iterator(forOp)));
epilogueBuilder.setInsertionPointAfter(forOp);
auto epilogueForOp = cast<scf::ForOp>(epilogueBuilder.clone(*forOp));
epilogueForOp.setLowerBound(upperBoundUnrolled);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ createFuncFromCluster(OpBuilder &b, const SmallVector<Operation *, 8> &cluster,
: b.getFunctionType(ValueRange(inputs).getTypes(), shape.getType());
shape::FuncOp fnOp = b.create<shape::FuncOp>(loc, fnName, fnType);
Block *block = fnOp.addEntryBlock();
b.setInsertionPoint(block, block->end());
b.setInsertionPointToEnd(block);
IRMapping bvm;
if (cluster.empty()) {
bvm.map(shape, fnOp.getArgument(0));
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ struct WarpOpScfForOp : public OpRewritePattern<WarpExecuteOnLane0Op> {
auto newForOp = rewriter.create<scf::ForOp>(
forOp.getLoc(), forOp.getLowerBound(), forOp.getUpperBound(),
forOp.getStep(), newOperands);
rewriter.setInsertionPoint(newForOp.getBody(), newForOp.getBody()->begin());
rewriter.setInsertionPointToStart(newForOp.getBody());

SmallVector<Value> warpInput(newForOp.getRegionIterArgs().begin(),
newForOp.getRegionIterArgs().end());
Expand All @@ -1747,7 +1747,7 @@ struct WarpOpScfForOp : public OpRewritePattern<WarpExecuteOnLane0Op> {
yieldOperands.push_back(operand);
rewriter.eraseOp(forOp.getBody()->getTerminator());
rewriter.mergeBlocks(forOp.getBody(), innerWarp.getBody(), argMapping);
rewriter.setInsertionPoint(innerWarp.getBody(), innerWarp.getBody()->end());
rewriter.setInsertionPointToEnd(innerWarp.getBody());
rewriter.create<vector::YieldOp>(innerWarp.getLoc(), yieldOperands);
rewriter.setInsertionPointAfter(innerWarp);
if (!innerWarp.getResults().empty())
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Target/LLVMIR/ModuleImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ LogicalResult ModuleImport::processFunction(llvm::Function *func) {

// Insert the function at the end of the module.
OpBuilder::InsertionGuard guard(builder);
builder.setInsertionPoint(mlirModule.getBody(), mlirModule.getBody()->end());
builder.setInsertionPointToEnd(mlirModule.getBody());

Location loc = debugImporter->translateFuncLocation(func);
LLVMFuncOp funcOp = builder.create<LLVMFuncOp>(
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Transforms/Utils/FoldUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Value OperationFolder::getOrCreateConstant(Block *block, Dialect *dialect,
// Find an insertion point for the constant.
auto *insertRegion = getInsertionRegion(interfaces, block);
auto &entry = insertRegion->front();
rewriter.setInsertionPoint(&entry, entry.begin());
rewriter.setInsertionPointToStart(&entry);

// Get the constant map for the insertion region of this operation.
// Use erased location since the op is being built at the front of block.
Expand Down Expand Up @@ -242,7 +242,7 @@ OperationFolder::processFoldResults(Operation *op,
// insertion region.
auto *insertRegion = getInsertionRegion(interfaces, op->getBlock());
auto &entry = insertRegion->front();
rewriter.setInsertionPoint(&entry, entry.begin());
rewriter.setInsertionPointToStart(&entry);

// Get the constant map for the insertion region of this operation.
auto &uniquedConstants = foldScopes[insertRegion];
Expand Down
Loading