Skip to content

Commit

Permalink
Merge pull request #34313 from JuliaLang/vc/llvm10
Browse files Browse the repository at this point in the history
Support LLVM 10 changes
  • Loading branch information
vchuravy authored Jan 21, 2020
2 parents c9940ed + 38675f8 commit 5c635ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,9 @@ static void jl_dump_asm_internal(
MCDisassembler::DecodeStatus S;
FuncMCView view = memoryObject.slice(Index);
S = DisAsm->getInstruction(Inst, insSize, view, 0,
#if JL_LLVM_VERSION < 100000
/*VStream*/ nulls(),
#endif
/*CStream*/ pass != 0 ? Streamer->GetCommentOS() : nulls());
if (pass != 0 && Streamer->GetCommentOS().tell() > 0)
Streamer->GetCommentOS() << '\n';
Expand Down
6 changes: 3 additions & 3 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ void JuliaOJIT::addModule(std::unique_ptr<Module> M)
{
#ifndef JL_NDEBUG
// validate the relocations for M
for (Module::global_object_iterator I = M->global_object_begin(), E = M->global_object_end(); I != E; ) {
for (Module::global_object_iterator I = M->global_objects().begin(), E = M->global_objects().end(); I != E; ) {
GlobalObject *F = &*I;
++I;
if (F->isDeclaration()) {
Expand Down Expand Up @@ -771,7 +771,7 @@ static void jl_merge_recursive(Module *m, Module *collector)
// since the declarations may get destroyed by the jl_merge_module call.
// this is also why we copy the Name string, rather than save a StringRef
SmallVector<std::string, 8> to_finalize;
for (Module::global_object_iterator I = m->global_object_begin(), E = m->global_object_end(); I != E; ++I) {
for (Module::global_object_iterator I = m->global_objects().begin(), E = m->global_objects().end(); I != E; ++I) {
GlobalObject *F = &*I;
if (!F->isDeclaration()) {
module_for_fname.erase(F->getName());
Expand Down Expand Up @@ -846,7 +846,7 @@ void jl_finalize_module(Module *m, bool shadow)
{
// record the function names that are part of this Module
// so it can be added to the JIT when needed
for (Module::global_object_iterator I = m->global_object_begin(), E = m->global_object_end(); I != E; ++I) {
for (Module::global_object_iterator I = m->global_objects().begin(), E = m->global_objects().end(); I != E; ++I) {
GlobalObject *F = &*I;
if (!F->isDeclaration()) {
if (isa<Function>(F)) {
Expand Down
4 changes: 4 additions & 0 deletions src/llvm-alloc-opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,11 @@ void Optimizer::splitOnStack(CallInst *orig_inst)
offset - slot.offset);
auto sub_size = std::min(slot.offset + slot.size, offset + size) -
std::max(offset, slot.offset);
#if JL_LLVM_VERSION >= 100000
builder.CreateMemSet(ptr8, val_arg, sub_size, MaybeAlign(0));
#else
builder.CreateMemSet(ptr8, val_arg, sub_size, 0);
#endif
}
call->eraseFromParent();
return;
Expand Down
15 changes: 0 additions & 15 deletions src/llvm-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,6 @@ extern "C" JL_DLLEXPORT LLVMContextRef LLVMExtraGetValueContext(LLVMValueRef V)
return wrap(&unwrap(V)->getContext());
}


#if JL_LLVM_VERSION < 80000
extern ModulePass *createNVVMReflectPass();
extern "C" JL_DLLEXPORT void LLVMExtraAddNVVMReflectPass(LLVMPassManagerRef PM)
{
unwrap(PM)->add(createNVVMReflectPass());
}
#else
FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
extern "C" JL_DLLEXPORT void LLVMExtraAddNVVMReflectFunctionPass(LLVMPassManagerRef PM, unsigned int SmVersion)
{
unwrap(PM)->add(createNVVMReflectPass(SmVersion));
}
#endif

extern "C" JL_DLLEXPORT void
LLVMExtraAddTargetLibraryInfoByTiple(const char *T, LLVMPassManagerRef PM)
{
Expand Down

2 comments on commit 5c635ad

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.