Skip to content

Commit

Permalink
Make SymCC compatible with LLVM 16
Browse files Browse the repository at this point in the history
Part of eng/toolchain/llvm-project#1.
  • Loading branch information
sebastianpoeplau committed May 12, 2023
1 parent 1e67ab6 commit 77bb971
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake from ${LLVM_DIR}")

if (${LLVM_VERSION_MAJOR} LESS 8 OR ${LLVM_VERSION_MAJOR} GREATER 15)
message(WARNING "The software has been developed for LLVM 8 through 15; \
if (${LLVM_VERSION_MAJOR} LESS 8 OR ${LLVM_VERSION_MAJOR} GREATER 16)
message(WARNING "The software has been developed for LLVM 8 through 16; \
it is unlikely to work with other versions!")
endif()

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ program. The actual computation happens through calls to the support library at
run time.

To build the pass and the support library, install LLVM (any version between 8
and 15) and Z3 (version 4.5 or later), as well as a C++ compiler with support
and 16) and Z3 (version 4.5 or later), as well as a C++ compiler with support
for C++17. LLVM lit is only needed to run the tests; if it's not packaged with
your LLVM, you can get it with `pip install lit`.

Expand Down
4 changes: 4 additions & 0 deletions compiler/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ using namespace llvm;
// Legacy pass registration (up to LLVM 13)
//

#if LLVM_VERSION_MAJOR <= 15

void addSymbolizeLegacyPass(const PassManagerBuilder & /* unused */,
legacy::PassManagerBase &PM) {
PM.add(createScalarizerPass());
Expand All @@ -57,6 +59,8 @@ static struct RegisterStandardPasses Y(PassManagerBuilder::EP_VectorizerStart,
static struct RegisterStandardPasses
Z(PassManagerBuilder::EP_EnabledOnOptLevel0, addSymbolizeLegacyPass);

#endif

//
// New pass registration (LLVM 13 and above)
//
Expand Down
4 changes: 4 additions & 0 deletions compiler/Pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ bool canLower(const CallInst *CI) {
case Intrinsic::roundeven:
#endif
case Intrinsic::copysign:
#if LLVM_VERSION_MAJOR < 16
case Intrinsic::flt_rounds:
#else
case Intrinsic::get_rounding:
#endif
case Intrinsic::invariant_start:
case Intrinsic::lifetime_start:
case Intrinsic::invariant_end:
Expand Down

0 comments on commit 77bb971

Please sign in to comment.