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
8 changes: 4 additions & 4 deletions flang/lib/Optimizer/Builder/CUFCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ mlir::gpu::GPUModuleOp cuf::getOrCreateGPUModule(mlir::ModuleOp mod,
mlir::UnitAttr::get(ctx));

mlir::OpBuilder builder(ctx);
auto gpuMod = builder.create<mlir::gpu::GPUModuleOp>(mod.getLoc(),
cudaDeviceModuleName);
auto gpuMod = mlir::gpu::GPUModuleOp::create(builder, mod.getLoc(),
cudaDeviceModuleName);
mlir::Block::iterator insertPt(mod.getBodyRegion().front().end());
symTab.insert(gpuMod, insertPt);
return gpuMod;
Expand Down Expand Up @@ -84,8 +84,8 @@ void cuf::genPointerSync(const mlir::Value box, fir::FirOpBuilder &builder) {
if (auto globalOp =
mod.lookupSymbol<fir::GlobalOp>(addrOfOp.getSymbol())) {
if (cuf::isRegisteredDeviceGlobal(globalOp)) {
builder.create<cuf::SyncDescriptorOp>(box.getLoc(),
addrOfOp.getSymbol());
cuf::SyncDescriptorOp::create(builder, box.getLoc(),
addrOfOp.getSymbol());
}
}
}
Expand Down
155 changes: 78 additions & 77 deletions flang/lib/Optimizer/Builder/Character.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion flang/lib/Optimizer/Builder/Complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mlir::Type fir::factory::Complex::getComplexPartType(mlir::Value cplx) const {
mlir::Value fir::factory::Complex::createComplex(mlir::Type cplxTy,
mlir::Value real,
mlir::Value imag) {
mlir::Value und = builder.create<fir::UndefOp>(loc, cplxTy);
mlir::Value und = fir::UndefOp::create(builder, loc, cplxTy);
return insert<Part::Imag>(insert<Part::Real>(und, real), imag);
}

Expand Down
4 changes: 2 additions & 2 deletions flang/lib/Optimizer/Builder/DoLoopHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fir::factory::DoLoopHelper::createLoop(mlir::Value lb, mlir::Value ub,
auto ubi = builder.convertToIndexType(loc, ub);
assert(step && "step must be an actual Value");
auto inc = builder.convertToIndexType(loc, step);
auto loop = builder.create<fir::DoLoopOp>(loc, lbi, ubi, inc);
auto loop = fir::DoLoopOp::create(builder, loc, lbi, ubi, inc);
auto insertPt = builder.saveInsertionPoint();
builder.setInsertionPointToStart(loop.getBody());
auto index = loop.getInductionVar();
Expand All @@ -43,6 +43,6 @@ fir::factory::DoLoopHelper::createLoop(mlir::Value count,
auto indexType = builder.getIndexType();
auto zero = builder.createIntegerConstant(loc, indexType, 0);
auto one = builder.createIntegerConstant(loc, count.getType(), 1);
auto up = builder.create<mlir::arith::SubIOp>(loc, count, one);
auto up = mlir::arith::SubIOp::create(builder, loc, count, one);
return createLoop(zero, up, one, bodyGenerator);
}
145 changes: 74 additions & 71 deletions flang/lib/Optimizer/Builder/FIRBuilder.cpp

Large diffs are not rendered by default.

181 changes: 90 additions & 91 deletions flang/lib/Optimizer/Builder/HLFIRTools.cpp

Large diffs are not rendered by default.

1,679 changes: 852 additions & 827 deletions flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Large diffs are not rendered by default.

128 changes: 65 additions & 63 deletions flang/lib/Optimizer/Builder/MutableBox.cpp

Large diffs are not rendered by default.

250 changes: 127 additions & 123 deletions flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions flang/lib/Optimizer/Builder/TemporaryStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fir::factory::Counter::Counter(mlir::Location loc, fir::FirOpBuilder &builder,
one = builder.createIntegerConstant(loc, type, 1);
if (canCountThroughLoops) {
index = builder.createTemporary(loc, type);
builder.create<fir::StoreOp>(loc, initialValue, index);
fir::StoreOp::create(builder, loc, initialValue, index);
} else {
index = initialValue;
}
Expand All @@ -38,21 +38,21 @@ mlir::Value
fir::factory::Counter::getAndIncrementIndex(mlir::Location loc,
fir::FirOpBuilder &builder) {
if (canCountThroughLoops) {
mlir::Value indexValue = builder.create<fir::LoadOp>(loc, index);
mlir::Value indexValue = fir::LoadOp::create(builder, loc, index);
mlir::Value newValue =
builder.create<mlir::arith::AddIOp>(loc, indexValue, one);
builder.create<fir::StoreOp>(loc, newValue, index);
mlir::arith::AddIOp::create(builder, loc, indexValue, one);
fir::StoreOp::create(builder, loc, newValue, index);
return indexValue;
}
mlir::Value indexValue = index;
index = builder.create<mlir::arith::AddIOp>(loc, indexValue, one);
index = mlir::arith::AddIOp::create(builder, loc, indexValue, one);
return indexValue;
}

void fir::factory::Counter::reset(mlir::Location loc,
fir::FirOpBuilder &builder) {
if (canCountThroughLoops)
builder.create<fir::StoreOp>(loc, initialValue, index);
fir::StoreOp::create(builder, loc, initialValue, index);
else
index = initialValue;
}
Expand Down Expand Up @@ -103,7 +103,7 @@ void fir::factory::HomogeneousScalarStack::pushValue(mlir::Location loc,
// below should not get hit but is added as a remainder/safety.
if (!entity.hasIntrinsicType())
TODO(loc, "creating inlined temporary stack for derived types");
builder.create<hlfir::AssignOp>(loc, value, tempElement);
hlfir::AssignOp::create(builder, loc, value, tempElement);
}

void fir::factory::HomogeneousScalarStack::resetFetchPosition(
Expand All @@ -125,14 +125,14 @@ void fir::factory::HomogeneousScalarStack::destroy(mlir::Location loc,
if (allocateOnHeap) {
auto declare = temp.getDefiningOp<hlfir::DeclareOp>();
assert(declare && "temp must have been declared");
builder.create<fir::FreeMemOp>(loc, declare.getMemref());
fir::FreeMemOp::create(builder, loc, declare.getMemref());
}
}

hlfir::Entity fir::factory::HomogeneousScalarStack::moveStackAsArrayExpr(
mlir::Location loc, fir::FirOpBuilder &builder) {
mlir::Value mustFree = builder.createBool(loc, allocateOnHeap);
auto hlfirExpr = builder.create<hlfir::AsExprOp>(loc, temp, mustFree);
auto hlfirExpr = hlfir::AsExprOp::create(builder, loc, temp, mustFree);
return hlfir::Entity{hlfirExpr};
}

Expand All @@ -147,14 +147,14 @@ fir::factory::SimpleCopy::SimpleCopy(mlir::Location loc,
// Use hlfir.as_expr and hlfir.associate to create a copy and leave
// bufferization deals with how best to make the copy.
if (source.isVariable())
source = hlfir::Entity{builder.create<hlfir::AsExprOp>(loc, source)};
source = hlfir::Entity{hlfir::AsExprOp::create(builder, loc, source)};
copy = hlfir::genAssociateExpr(loc, builder, source,
source.getFortranElementType(), tempName);
}

void fir::factory::SimpleCopy::destroy(mlir::Location loc,
fir::FirOpBuilder &builder) {
builder.create<hlfir::EndAssociateOp>(loc, copy);
hlfir::EndAssociateOp::create(builder, loc, copy);
}

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -279,7 +279,7 @@ mlir::Value fir::factory::AnyVariableStack::fetch(mlir::Location loc,
mlir::Value indexValue = counter.getAndIncrementIndex(loc, builder);
fir::runtime::genDescriptorAt(loc, builder, opaquePtr, indexValue,
retValueBox);
hlfir::Entity retBox{builder.create<fir::LoadOp>(loc, retValueBox)};
hlfir::Entity retBox{fir::LoadOp::create(builder, loc, retValueBox)};
// The runtime always tracks variable as address, but the form of the variable
// that was saved may be different (raw address, fir.boxchar), ensure
// the returned variable has the same form of the one that was saved.
Expand Down Expand Up @@ -326,7 +326,7 @@ void fir::factory::AnyVectorSubscriptStack::pushShape(
hlfir::getFortranElementOrSequenceType(*boxType));
mlir::Value null = builder.createNullConstant(loc, refType);
mlir::Value descriptor =
builder.create<fir::EmboxOp>(loc, *boxType, null, shape);
fir::EmboxOp::create(builder, loc, *boxType, null, shape);
shapeTemp->pushValue(loc, builder, descriptor);
return;
}
Expand Down Expand Up @@ -372,7 +372,7 @@ void fir::factory::AnyAddressStack::pushValue(mlir::Location loc,
mlir::Value cast = variable;
if (auto boxProcType = llvm::dyn_cast<fir::BoxProcType>(variable.getType())) {
cast =
builder.create<fir::BoxAddrOp>(loc, boxProcType.getEleTy(), variable);
fir::BoxAddrOp::create(builder, loc, boxProcType.getEleTy(), variable);
}
cast = builder.createConvert(loc, builder.getIntPtrType(), cast);
static_cast<AnyValueStack *>(this)->pushValue(loc, builder, cast);
Expand All @@ -383,7 +383,7 @@ mlir::Value fir::factory::AnyAddressStack::fetch(mlir::Location loc,
mlir::Value addr = static_cast<AnyValueStack *>(this)->fetch(loc, builder);
if (auto boxProcType = llvm::dyn_cast<fir::BoxProcType>(addressType)) {
mlir::Value cast = builder.createConvert(loc, boxProcType.getEleTy(), addr);
return builder.create<fir::EmboxProcOp>(loc, boxProcType, cast);
return fir::EmboxProcOp::create(builder, loc, boxProcType, cast);
}
return builder.createConvert(loc, addressType, addr);
}
Loading