From 7f0f151c071e0860d90c429748ab7ba012fc6896 Mon Sep 17 00:00:00 2001 From: Jan Rehders Date: Thu, 1 Feb 2024 15:43:45 +0000 Subject: [PATCH] Fix intrinsic name conflict --- example/ExampleDialect.td | 6 +++--- test/example/generated/ExampleDialect.cpp.inc | 12 ++++++------ test/example/generated/ExampleDialect.h.inc | 6 +++--- test/example/test-builder.test | 16 ++++++++-------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/example/ExampleDialect.td b/example/ExampleDialect.td index 79e03e9..58eb196 100644 --- a/example/ExampleDialect.td +++ b/example/ExampleDialect.td @@ -269,7 +269,7 @@ def HandleGetOp : ExampleOp<"handle.get", [Memory<[]>, NoUnwind, WillReturn]> { }]; } -def InstNameConflictOp : Op { +def InstNameConflictOp : Op { let results = (outs I32:$result); let arguments = (ins value:$instName); @@ -281,7 +281,7 @@ def InstNameConflictOp : Op { }]; } -def InstNameConflictDoubleOp : Op { +def InstNameConflictDoubleOp : Op { let results = (outs I32:$result); let arguments = (ins value:$instName, value:$instName_0); @@ -292,7 +292,7 @@ def InstNameConflictDoubleOp : Op }]; } -def InstNameConflictVarargsOp : Op { +def InstNameConflictVarargsOp : Op { let results = (outs I32:$result); let arguments = (ins varargs:$instName_0); diff --git a/test/example/generated/ExampleDialect.cpp.inc b/test/example/generated/ExampleDialect.cpp.inc index f2046cc..251608d 100644 --- a/test/example/generated/ExampleDialect.cpp.inc +++ b/test/example/generated/ExampleDialect.cpp.inc @@ -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(); @@ -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(); @@ -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(); @@ -2144,7 +2144,7 @@ data template <> const ::llvm_dialects::OpDescription & ::llvm_dialects::OpDescription::get() { - static const ::llvm_dialects::OpDescription desc{false, "xd.try.conflict"}; + static const ::llvm_dialects::OpDescription desc{false, "xd.inst.name.conflict.double"}; return desc; } @@ -2152,7 +2152,7 @@ data template <> const ::llvm_dialects::OpDescription & ::llvm_dialects::OpDescription::get() { - static const ::llvm_dialects::OpDescription desc{false, "xd.try.conflict"}; + static const ::llvm_dialects::OpDescription desc{false, "xd.inst.name.conflict"}; return desc; } @@ -2160,7 +2160,7 @@ data template <> const ::llvm_dialects::OpDescription & ::llvm_dialects::OpDescription::get() { - 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; } diff --git a/test/example/generated/ExampleDialect.h.inc b/test/example/generated/ExampleDialect.h.inc index 0a5fd14..4f7f5db 100644 --- a/test/example/generated/ExampleDialect.h.inc +++ b/test/example/generated/ExampleDialect.h.inc @@ -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) { @@ -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) { @@ -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) { diff --git a/test/example/test-builder.test b/test/example/test-builder.test index 52b4bc9..f8bf94e 100644 --- a/test/example/test-builder.test +++ b/test/example/test-builder.test @@ -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 ;