Skip to content

Commit 6d7c733

Browse files
committed
Update to LLVM 18
1 parent 78a88c4 commit 6d7c733

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

expr2/reactor/LLVMJIT.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ __pragma(warning(push))
3434
#include "llvm/IR/PassManager.h"
3535
#include "llvm/Passes/PassBuilder.h"
3636
#include "llvm/Support/CommandLine.h"
37-
#include "llvm/Support/Host.h"
3837
#include "llvm/Support/TargetSelect.h"
38+
#include "llvm/TargetParser/Host.h"
3939
#include "llvm/Transforms/InstCombine/InstCombine.h"
4040
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
4141
#include "llvm/Transforms/Scalar/ADCE.h"
@@ -148,7 +148,7 @@ class JITGlobals
148148
private:
149149
JITGlobals(llvm::orc::JITTargetMachineBuilder &&jitTargetMachineBuilder, llvm::DataLayout &&dataLayout);
150150

151-
static llvm::CodeGenOpt::Level toLLVM(rr::Optimization::Level level);
151+
static llvm::CodeGenOptLevel toLLVM(rr::Optimization::Level level);
152152

153153
const llvm::orc::JITTargetMachineBuilder jitTargetMachineBuilder;
154154
const llvm::DataLayout dataLayout;
@@ -257,26 +257,26 @@ JITGlobals::JITGlobals(llvm::orc::JITTargetMachineBuilder &&jitTargetMachineBuil
257257
{
258258
}
259259

260-
llvm::CodeGenOpt::Level JITGlobals::toLLVM(rr::Optimization::Level level)
260+
llvm::CodeGenOptLevel JITGlobals::toLLVM(rr::Optimization::Level level)
261261
{
262262
// TODO(b/173257647): MemorySanitizer instrumentation produces IR which takes
263263
// a lot longer to process by the machine code optimization passes. Disabling
264264
// them has a negligible effect on code quality but compiles much faster.
265265
if(__has_feature(memory_sanitizer))
266266
{
267-
return llvm::CodeGenOpt::None;
267+
return llvm::CodeGenOptLevel::None;
268268
}
269269

270270
switch(level)
271271
{
272-
case rr::Optimization::Level::None: return llvm::CodeGenOpt::None;
273-
case rr::Optimization::Level::Less: return llvm::CodeGenOpt::Less;
274-
case rr::Optimization::Level::Default: return llvm::CodeGenOpt::Default;
275-
case rr::Optimization::Level::Aggressive: return llvm::CodeGenOpt::Aggressive;
272+
case rr::Optimization::Level::None: return llvm::CodeGenOptLevel::None;
273+
case rr::Optimization::Level::Less: return llvm::CodeGenOptLevel::Less;
274+
case rr::Optimization::Level::Default: return llvm::CodeGenOptLevel::Default;
275+
case rr::Optimization::Level::Aggressive: return llvm::CodeGenOptLevel::Aggressive;
276276
default: UNREACHABLE("Unknown Optimization Level %d", int(level));
277277
}
278278

279-
return llvm::CodeGenOpt::Default;
279+
return llvm::CodeGenOptLevel::Default;
280280
}
281281

282282
class MemoryMapper final : public llvm::SectionMemoryManager::MemoryMapper

expr2/reactor/LLVMReactor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4511,7 +4511,7 @@ RValue<Int4> pmovsxwd(RValue<Short8> x)
45114511
void VPrintf(const std::vector<Value *> &vals)
45124512
{
45134513
auto i32Ty = llvm::Type::getInt32Ty(*jit->context);
4514-
auto i8PtrTy = llvm::Type::getInt8PtrTy(*jit->context);
4514+
auto i8PtrTy = llvm::PointerType::getUnqual(*jit->context);
45154515
auto funcTy = llvm::FunctionType::get(i32Ty, { i8PtrTy }, true);
45164516
auto func = jit->module->getOrInsertFunction("rr::DebugPrintf", funcTy);
45174517
jit->builder->CreateCall(func, V(vals));
@@ -4580,7 +4580,7 @@ void promoteFunctionToCoroutine()
45804580
auto i1Ty = llvm::Type::getInt1Ty(*jit->context);
45814581
auto i8Ty = llvm::Type::getInt8Ty(*jit->context);
45824582
auto i32Ty = llvm::Type::getInt32Ty(*jit->context);
4583-
auto i8PtrTy = llvm::Type::getInt8PtrTy(*jit->context);
4583+
auto i8PtrTy = llvm::PointerType::getUnqual(*jit->context);
45844584
auto promiseTy = jit->coroutine.yieldType;
45854585
auto promisePtrTy = promiseTy->getPointerTo();
45864586

@@ -4745,7 +4745,7 @@ void Nucleus::createCoroutine(Type *YieldType, const std::vector<Type *> &Params
47454745
// coroutine.
47464746
auto voidTy = llvm::Type::getVoidTy(*jit->context);
47474747
auto i1Ty = llvm::Type::getInt1Ty(*jit->context);
4748-
auto i8PtrTy = llvm::Type::getInt8PtrTy(*jit->context);
4748+
auto i8PtrTy = llvm::PointerType::getUnqual(*jit->context);
47494749
auto handleTy = i8PtrTy;
47504750
auto boolTy = i1Ty;
47514751
auto promiseTy = T(YieldType);

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ if use_asmjit
8787
else
8888
sources = sources_common + sources_expr2
8989
incdir += include_directories('expr2/reactor')
90-
deps += dependency('llvm', version: ['>= 10.0', '< 18'], method: 'config-tool', static: get_option('static-llvm'),
90+
deps += dependency('llvm', version: ['>= 10.0', '< 19'], method: 'config-tool', static: get_option('static-llvm'),
9191
modules: [
9292
'asmprinter', 'executionengine', 'target', 'orcjit', 'native',
9393
])

0 commit comments

Comments
 (0)