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
6 changes: 3 additions & 3 deletions clang/lib/CIR/CodeGen/CIRAsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,9 @@ mlir::LogicalResult CIRGenFunction::emitAsmStmt(const AsmStmt &S) {
operands.push_back(InArgs);
operands.push_back(InOutArgs);

auto IA = builder.create<cir::InlineAsmOp>(
getLoc(S.getAsmLoc()), ResultType, operands, AsmString, Constraints,
HasSideEffect, inferFlavor(CGM, S), mlir::ArrayAttr());
auto IA = cir::InlineAsmOp::create(
builder, getLoc(S.getAsmLoc()), ResultType, operands, AsmString,
Constraints, HasSideEffect, inferFlavor(CGM, S), mlir::ArrayAttr());

if (false /*IsGCCAsmGoto*/) {
assert(!cir::MissingFeatures::asmGoto());
Expand Down
30 changes: 15 additions & 15 deletions clang/lib/CIR/CodeGen/CIRGenAtomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ static bool isCstWeak(mlir::Value weakVal, bool &val) {
static void emitDefaultCase(CIRGenBuilderTy &builder, mlir::Location loc) {
auto EmptyArrayAttr = builder.getArrayAttr({});
mlir::OpBuilder::InsertPoint insertPoint;
builder.create<cir::CaseOp>(loc, EmptyArrayAttr, cir::CaseOpKind::Default,
insertPoint);
cir::CaseOp::create(builder, loc, EmptyArrayAttr, cir::CaseOpKind::Default,
insertPoint);
builder.restoreInsertionPoint(insertPoint);
}

Expand All @@ -392,8 +392,8 @@ static void emitSingleMemOrderCase(CIRGenBuilderTy &builder, mlir::Location loc,
cir::IntAttr::get(Type, static_cast<int>(Order))};
auto OneAttribute = builder.getArrayAttr(OneOrder);
mlir::OpBuilder::InsertPoint insertPoint;
builder.create<cir::CaseOp>(loc, OneAttribute, cir::CaseOpKind::Equal,
insertPoint);
cir::CaseOp::create(builder, loc, OneAttribute, cir::CaseOpKind::Equal,
insertPoint);
builder.restoreInsertionPoint(insertPoint);
}

Expand All @@ -408,8 +408,8 @@ static void emitDoubleMemOrderCase(CIRGenBuilderTy &builder, mlir::Location loc,
cir::IntAttr::get(Type, static_cast<int>(Order2))};
auto TwoAttributes = builder.getArrayAttr(TwoOrders);
mlir::OpBuilder::InsertPoint insertPoint;
builder.create<cir::CaseOp>(loc, TwoAttributes, cir::CaseOpKind::Anyof,
insertPoint);
cir::CaseOp::create(builder, loc, TwoAttributes, cir::CaseOpKind::Anyof,
insertPoint);
builder.restoreInsertionPoint(insertPoint);
}

Expand All @@ -424,18 +424,18 @@ static void emitAtomicCmpXchg(CIRGenFunction &CGF, AtomicExpr *E, bool IsWeak,
auto Expected = builder.createLoad(loc, Val1);
auto Desired = builder.createLoad(loc, Val2);
auto boolTy = builder.getBoolTy();
auto cmpxchg = builder.create<cir::AtomicCmpXchg>(
loc, Expected.getType(), boolTy, Ptr.getPointer(), Expected, Desired,
cir::MemOrderAttr::get(&CGF.getMLIRContext(), SuccessOrder),
auto cmpxchg = cir::AtomicCmpXchg::create(
builder, loc, Expected.getType(), boolTy, Ptr.getPointer(), Expected,
Desired, cir::MemOrderAttr::get(&CGF.getMLIRContext(), SuccessOrder),
cir::MemOrderAttr::get(&CGF.getMLIRContext(), FailureOrder),
cir::MemScopeKindAttr::get(&CGF.getMLIRContext(), Scope),
builder.getI64IntegerAttr(Ptr.getAlignment().getAsAlign().value()));
cmpxchg.setIsVolatile(E->isVolatile());
cmpxchg.setWeak(IsWeak);

auto cmp = builder.createNot(cmpxchg.getCmp());
builder.create<cir::IfOp>(
loc, cmp, false, [&](mlir::OpBuilder &, mlir::Location) {
cir::IfOp::create(
builder, loc, cmp, false, [&](mlir::OpBuilder &, mlir::Location) {
auto ptrTy = mlir::cast<cir::PointerType>(Val1.getPointer().getType());
if (Val1.getElementType() != ptrTy.getPointee()) {
Val1 = Val1.withPointer(builder.createPtrBitcast(
Expand Down Expand Up @@ -496,8 +496,8 @@ static void emitAtomicCmpXchgFailureSet(
// can't handle a runtime value; all memory orders must be hard coded.
// Generate a "switch" statement that converts the runtime value into a
// compile-time value.
CGF.getBuilder().create<cir::SwitchOp>(
FailureOrderVal.getLoc(), FailureOrderVal,
cir::SwitchOp::create(
CGF.getBuilder(), FailureOrderVal.getLoc(), FailureOrderVal,
[&](mlir::OpBuilder &b, mlir::Location loc, mlir::OperationState &os) {
auto &builder = CGF.getBuilder();

Expand Down Expand Up @@ -1268,8 +1268,8 @@ RValue CIRGenFunction::emitAtomicExpr(AtomicExpr *E) {
// can't handle runtime memory orders; the memory order must be hard coded.
// Generate a "switch" statement that converts a runtime value into a
// compile-time value.
builder.create<cir::SwitchOp>(
Order.getLoc(), Order,
cir::SwitchOp::create(
builder, Order.getLoc(), Order,
[&](mlir::OpBuilder &b, mlir::Location loc, mlir::OperationState &os) {
mlir::Block *switchBlock = builder.getBlock();

Expand Down
Loading
Loading