Skip to content

Commit

Permalink
Fix intrinsic name conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
JanRehders-AMD committed Feb 1, 2024
1 parent 01a8bdb commit 7f0f151
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions example/ExampleDialect.td
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def HandleGetOp : ExampleOp<"handle.get", [Memory<[]>, NoUnwind, WillReturn]> {
}];
}

def InstNameConflictOp : Op<ExampleDialect, "try.conflict", [WillReturn]> {
def InstNameConflictOp : Op<ExampleDialect, "inst.name.conflict", [WillReturn]> {
let results = (outs I32:$result);
let arguments = (ins value:$instName);

Expand All @@ -281,7 +281,7 @@ def InstNameConflictOp : Op<ExampleDialect, "try.conflict", [WillReturn]> {
}];
}

def InstNameConflictDoubleOp : Op<ExampleDialect, "try.conflict", [WillReturn]> {
def InstNameConflictDoubleOp : Op<ExampleDialect, "inst.name.conflict.double", [WillReturn]> {
let results = (outs I32:$result);
let arguments = (ins value:$instName, value:$instName_0);

Expand All @@ -292,7 +292,7 @@ def InstNameConflictDoubleOp : Op<ExampleDialect, "try.conflict", [WillReturn]>
}];
}

def InstNameConflictVarargsOp : Op<ExampleDialect, "try.conflict.type.suffix", [WillReturn]> {
def InstNameConflictVarargsOp : Op<ExampleDialect, "inst.name.conflict.varargs", [WillReturn]> {
let results = (outs I32:$result);
let arguments = (ins varargs:$instName_0);

Expand Down
12 changes: 6 additions & 6 deletions test/example/generated/ExampleDialect.cpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ index



const ::llvm::StringLiteral InstNameConflictDoubleOp::s_name{"xd.try.conflict"};
const ::llvm::StringLiteral InstNameConflictDoubleOp::s_name{"xd.inst.name.conflict.double"};

InstNameConflictDoubleOp* InstNameConflictDoubleOp::create(llvm_dialects::Builder& b, ::llvm::Value * instName, ::llvm::Value * instName_0, const llvm::Twine &instName_1) {
::llvm::LLVMContext& context = b.getContext();
Expand Down Expand Up @@ -1270,7 +1270,7 @@ instName_0



const ::llvm::StringLiteral InstNameConflictOp::s_name{"xd.try.conflict"};
const ::llvm::StringLiteral InstNameConflictOp::s_name{"xd.inst.name.conflict"};

InstNameConflictOp* InstNameConflictOp::create(llvm_dialects::Builder& b, ::llvm::Value * instName, const llvm::Twine &instName_0) {
::llvm::LLVMContext& context = b.getContext();
Expand Down Expand Up @@ -1344,7 +1344,7 @@ instName



const ::llvm::StringLiteral InstNameConflictVarargsOp::s_name{"xd.try.conflict.type.suffix"};
const ::llvm::StringLiteral InstNameConflictVarargsOp::s_name{"xd.inst.name.conflict.varargs"};

InstNameConflictVarargsOp* InstNameConflictVarargsOp::create(llvm_dialects::Builder& b, ::llvm::ArrayRef<::llvm::Value *> instName_0, const llvm::Twine &instName) {
::llvm::LLVMContext& context = b.getContext();
Expand Down Expand Up @@ -2144,23 +2144,23 @@ data
template <>
const ::llvm_dialects::OpDescription &
::llvm_dialects::OpDescription::get<xd::InstNameConflictDoubleOp>() {
static const ::llvm_dialects::OpDescription desc{false, "xd.try.conflict"};
static const ::llvm_dialects::OpDescription desc{false, "xd.inst.name.conflict.double"};
return desc;
}


template <>
const ::llvm_dialects::OpDescription &
::llvm_dialects::OpDescription::get<xd::InstNameConflictOp>() {
static const ::llvm_dialects::OpDescription desc{false, "xd.try.conflict"};
static const ::llvm_dialects::OpDescription desc{false, "xd.inst.name.conflict"};
return desc;
}


template <>
const ::llvm_dialects::OpDescription &
::llvm_dialects::OpDescription::get<xd::InstNameConflictVarargsOp>() {
static const ::llvm_dialects::OpDescription desc{false, "xd.try.conflict.type.suffix"};
static const ::llvm_dialects::OpDescription desc{false, "xd.inst.name.conflict.varargs"};
return desc;
}

Expand Down
6 changes: 3 additions & 3 deletions test/example/generated/ExampleDialect.h.inc
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bool verifier(::llvm::raw_ostream &errs);
};

class InstNameConflictDoubleOp : public ::llvm::CallInst {
static const ::llvm::StringLiteral s_name; //{"xd.try.conflict"};
static const ::llvm::StringLiteral s_name; //{"xd.inst.name.conflict.double"};

public:
static bool classof(const ::llvm::CallInst* i) {
Expand All @@ -324,7 +324,7 @@ bool verifier(::llvm::raw_ostream &errs);
};

class InstNameConflictOp : public ::llvm::CallInst {
static const ::llvm::StringLiteral s_name; //{"xd.try.conflict"};
static const ::llvm::StringLiteral s_name; //{"xd.inst.name.conflict"};

public:
static bool classof(const ::llvm::CallInst* i) {
Expand All @@ -347,7 +347,7 @@ bool verifier(::llvm::raw_ostream &errs);
};

class InstNameConflictVarargsOp : public ::llvm::CallInst {
static const ::llvm::StringLiteral s_name; //{"xd.try.conflict.type.suffix"};
static const ::llvm::StringLiteral s_name; //{"xd.inst.name.conflict.varargs"};

public:
static bool classof(const ::llvm::CallInst* i) {
Expand Down
16 changes: 8 additions & 8 deletions test/example/test-builder.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
; CHECK-NEXT: call void (...) @xd.write([[TMP1]] [[TMP17]])
; CHECK-NEXT: call void (...) @xd.write([[TMP2]] [[TMP18]])
; CHECK-NEXT: [[NAME_OF_LLVM_VALUE:%.*]] = call target("xd.handle") @xd.handle.get()
; CHECK-NEXT: [[TMP19:%.*]] = call i32 (...) @xd.try.conflict(i32 1)
; CHECK-NEXT: [[NAME_FOO:%.*]] = call i32 (...) @xd.try.conflict(i32 1)
; CHECK-NEXT: [[TMP20:%.*]] = call i32 (...) @xd.try.conflict(i32 1, i32 2)
; CHECK-NEXT: [[BAR:%.*]] = call i32 (...) @xd.try.conflict(i32 1, i32 2)
; CHECK-NEXT: [[TMP21:%.*]] = call i32 (...) @xd.try.conflict.type.suffix(ptr [[P1]], i8 [[P2]])
; CHECK-NEXT: [[TWO_VARARGS:%.*]] = call i32 (...) @xd.try.conflict.type.suffix(ptr [[P1]], i8 [[P2]])
; CHECK-NEXT: [[THREE_VARARGS:%.*]] = call i32 (...) @xd.try.conflict.type.suffix(ptr [[P1]], i8 [[P2]], i32 3)
; CHECK-NEXT: [[FOUR_VARARGS:%.*]] = call i32 (...) @xd.try.conflict.type.suffix(ptr [[P1]], i8 [[P2]], i32 3, i32 4)
; CHECK-NEXT: [[TMP19:%.*]] = call i32 (...) @xd.inst.name.conflict(i32 1)
; CHECK-NEXT: [[NAME_FOO:%.*]] = call i32 (...) @xd.inst.name.conflict(i32 1)
; CHECK-NEXT: [[TMP20:%.*]] = call i32 (...) @xd.inst.name.conflict.double(i32 1, i32 2)
; CHECK-NEXT: [[BAR:%.*]] = call i32 (...) @xd.inst.name.conflict.double(i32 1, i32 2)
; CHECK-NEXT: [[TMP21:%.*]] = call i32 (...) @xd.inst.name.conflict.varargs(ptr [[P1]], i8 [[P2]])
; CHECK-NEXT: [[TWO_VARARGS:%.*]] = call i32 (...) @xd.inst.name.conflict.varargs(ptr [[P1]], i8 [[P2]])
; CHECK-NEXT: [[THREE_VARARGS:%.*]] = call i32 (...) @xd.inst.name.conflict.varargs(ptr [[P1]], i8 [[P2]], i32 3)
; CHECK-NEXT: [[FOUR_VARARGS:%.*]] = call i32 (...) @xd.inst.name.conflict.varargs(ptr [[P1]], i8 [[P2]], i32 3, i32 4)
; CHECK-NEXT: ret void
;

0 comments on commit 7f0f151

Please sign in to comment.