Upgrade LLVM

This upgrade brings commit by @eddyb to help optimizations of virtual calls in
a few places (https://github.com/llvm-mirror/llvm/commit/6d2bd95) as well as a
commit by @c-a to *greatly* improve the runtime of the optimization passes
(https://github.com/rust-lang/llvm/pull/3).

Nice work to these guys!
This commit is contained in:
Alex Crichton 2014-01-27 12:45:48 -08:00
parent d6d7812da8
commit 8cd935f52a
8 changed files with 26 additions and 16 deletions

4
configure vendored
View file

@ -916,6 +916,10 @@ do
LLVM_OPTS="$LLVM_OPTS --disable-terminfo" LLVM_OPTS="$LLVM_OPTS --disable-terminfo"
# Try to have LLVM pull in as few dependencies as possible (#9397) # Try to have LLVM pull in as few dependencies as possible (#9397)
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi" LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
# LLVM says it needs a "new" clang/gcc, but we seem to get by ok with
# older versions on the bots. Get by for a little longer by asking it to
# not do version detection
LLVM_OPTS="$LLVM_OPTS --disable-compiler-version-checks"
# Use win32 native thread/lock apis instead of pthread wrapper. # Use win32 native thread/lock apis instead of pthread wrapper.
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.) # (llvm's configure tries to find pthread first, so we have to disable it explicitly.)

View file

@ -1762,6 +1762,8 @@ pub fn LLVMRustRunRestrictionPass(M: ModuleRef,
pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char, pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char,
out_len: *mut size_t) -> *c_char; out_len: *mut size_t) -> *c_char;
pub fn LLVMRustDestroyArchive(AR: ArchiveRef); pub fn LLVMRustDestroyArchive(AR: ArchiveRef);
pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
} }
} }

View file

@ -2531,12 +2531,12 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
llvm::LLVMAddGlobal(llmod, maptype.to_ref(), buf) llvm::LLVMAddGlobal(llmod, maptype.to_ref(), buf)
} }
}); });
lib::llvm::SetLinkage(map, lib::llvm::ExternalLinkage);
// On windows we'd like to export the toplevel cratemap // On windows we'd like to export the toplevel cratemap
// such that we can find it from libstd. // such that we can find it from libstd.
if targ_cfg.os == OsWin32 && is_top { if targ_cfg.os == OsWin32 && is_top {
lib::llvm::SetLinkage(map, lib::llvm::DLLExportLinkage); unsafe { llvm::LLVMRustSetDLLExportStorageClass(map) }
} else {
lib::llvm::SetLinkage(map, lib::llvm::ExternalLinkage);
} }
return (sym_name, map); return (sym_name, map);

@ -1 +1 @@
Subproject commit 535989a92ce1f6f6488c94a2c8f4ed438349f162 Subproject commit e1dabb48f0f898d1a808b3de3a26f5ee3735c7dd

View file

@ -185,7 +185,7 @@ LLVMRustPrintModule(LLVMPassManagerRef PMR,
std::string ErrorInfo; std::string ErrorInfo;
raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_Binary); raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_Binary);
formatted_raw_ostream FOS(OS); formatted_raw_ostream FOS(OS);
PM->add(createPrintModulePass(&FOS)); PM->add(createPrintModulePass(FOS));
PM->run(*unwrap(M)); PM->run(*unwrap(M));
} }

View file

@ -537,15 +537,15 @@ extern "C" bool
LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) { LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) {
Module *Dst = unwrap(dst); Module *Dst = unwrap(dst);
MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len)); MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len));
std::string Err; ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext());
Module *Src = llvm::getLazyBitcodeModule(buf, Dst->getContext(), &Err); if (!Src) {
if (Src == NULL) { LLVMRustError = Src.getError().message().c_str();
LLVMRustError = Err.c_str();
delete buf; delete buf;
return false; return false;
} }
if (Linker::LinkModules(Dst, Src, Linker::DestroySource, &Err)) { std::string Err;
if (Linker::LinkModules(Dst, *Src, Linker::DestroySource, &Err)) {
LLVMRustError = Err.c_str(); LLVMRustError = Err.c_str();
return false; return false;
} }
@ -570,8 +570,8 @@ LLVMRustOpenArchive(char *path) {
extern "C" const char* extern "C" const char*
LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) { LLVMRustArchiveReadSection(Archive *ar, char *name, size_t *size) {
for (Archive::child_iterator child = ar->begin_children(), for (Archive::child_iterator child = ar->child_begin(),
end = ar->end_children(); end = ar->child_end();
child != end; ++child) { child != end; ++child) {
StringRef sect_name; StringRef sect_name;
error_code err = child->getName(sect_name); error_code err = child->getName(sect_name);
@ -589,3 +589,9 @@ extern "C" void
LLVMRustDestroyArchive(Archive *ar) { LLVMRustDestroyArchive(Archive *ar) {
delete ar; delete ar;
} }
extern "C" void
LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) {
GlobalValue *V = unwrap<GlobalValue>(Value);
V->setDLLStorageClass(GlobalValue::DLLExportStorageClass);
}

View file

@ -1,4 +1,4 @@
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt. # If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
# The actual contents of this file do not matter, but to trigger a change on the # The actual contents of this file do not matter, but to trigger a change on the
# build bots then the contents should be changed so git updates the mtime. # build bots then the contents should be changed so git updates the mtime.
2014-01-22 2014-01-27

View file

@ -16,14 +16,12 @@
#include "llvm/PassManager.h" #include "llvm/PassManager.h"
#include "llvm/IR/InlineAsm.h" #include "llvm/IR/InlineAsm.h"
#include "llvm/IR/LLVMContext.h" #include "llvm/IR/LLVMContext.h"
#include "llvm/Analysis/Verifier.h" #include "llvm/IR/IRPrintingPasses.h"
#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/Lint.h" #include "llvm/Analysis/Lint.h"
#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Triple.h" #include "llvm/ADT/Triple.h"
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseSet.h"
#include "llvm/Assembly/Parser.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h" #include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Timer.h" #include "llvm/Support/Timer.h"