Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LLVM15 #69

Merged
merged 3 commits into from
Oct 26, 2023
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(llvm-dialects)

# Options intended for configuration by the user:
# - CMAKE_BUILD_TYPE
# - LLVM_DIR
# - LLVM_ROOT
#
# The build system is intended to be usable both as an external subproject of
# the llvm-project build tree, and as a separate subdirectory / subproject.
Expand Down
18 changes: 15 additions & 3 deletions lib/Dialect/OpDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,37 @@ template <> const OpDescription &OpDescription::get<BinaryOperator>() {
// ============================================================================
// Descriptions of intrinsic facades implemented in LLVM


#if HAVE_LLVM_VERSION_MAJOR >= 16
HANDLE_INTRINSIC_DESC_OPCODE_SET(LifetimeIntrinsic, Intrinsic::lifetime_start,
Intrinsic::lifetime_end)
#endif

// Add Intrinsic::dbg_addr back for sufficiently recent LLVM
HANDLE_INTRINSIC_DESC_OPCODE_SET(DbgInfoIntrinsic, Intrinsic::dbg_declare,
Intrinsic::dbg_value, Intrinsic::dbg_label,
Intrinsic::dbg_assign)
Intrinsic::dbg_value, Intrinsic::dbg_label
#if HAVE_LLVM_VERSION_MAJOR >= 16
,Intrinsic::dbg_assign
#endif
)

// Add Intrinsic::dbg_addr back for sufficiently recent LLVM
HANDLE_INTRINSIC_DESC_OPCODE_SET(DbgVariableIntrinsic, Intrinsic::dbg_declare,
Intrinsic::dbg_value, Intrinsic::dbg_assign)
Intrinsic::dbg_value
#if HAVE_LLVM_VERSION_MAJOR >= 16
,Intrinsic::dbg_assign
#endif
)

HANDLE_INTRINSIC_DESC(DbgDeclareInst, dbg_declare)
HANDLE_INTRINSIC_DESC(DbgValueInst, dbg_value)

// Add this back for sufficiently recent LLVM
// HANDLE_INTRINSIC_DESC(DbgAddrIntrinsic, dbg_addr)

#if HAVE_LLVM_VERSION_MAJOR >= 16
HANDLE_INTRINSIC_DESC(DbgAssignIntrinsic, dbg_assign)
#endif
HANDLE_INTRINSIC_DESC(DbgLabelInst, dbg_label)

HANDLE_INTRINSIC_DESC_OPCODE_SET(AtomicMemIntrinsic,
Expand Down
4 changes: 4 additions & 0 deletions lib/Dialect/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ using namespace llvm;
using namespace llvm_dialects;

bool llvm_dialects::areTypesEqual(ArrayRef<Type *> types) {
#if HAVE_LLVM_VERSION_MAJOR >= 16
return llvm::all_equal(types);
#else
return llvm::is_splat(types);
#endif
}

// The following function is copied verbatim from
Expand Down
Loading