summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
AgeCommit message (Collapse)AuthorLines
2013-08-26Rewrite pass management with LLVMAlex Crichton-143/+4
Beforehand, it was unclear whether rust was performing the "recommended set" of optimizations provided by LLVM for code. This commit changes the way we run passes to closely mirror that of clang, which in theory does it correctly. The notable changes include: * Passes are no longer explicitly added one by one. This would be difficult to keep up with as LLVM changes and we don't guaranteed always know the best order in which to run passes * Passes are now managed by LLVM's PassManagerBuilder object. This is then used to populate the various pass managers run. * We now run both a FunctionPassManager and a module-wide PassManager. This is what clang does, and I presume that we *may* see a speed boost from the module-wide passes just having to do less work. I have no measured this. * The codegen pass manager has been extracted to its own separate pass manager to not get mixed up with the other passes * All pass managers now include passes for target-specific data layout and analysis passes Some new features include: * You can now print all passes being run with `-Z print-llvm-passes` * When specifying passes via `--passes`, the passes are now appended to the default list of passes instead of overwriting them. * The output of `--passes list` is now generated by LLVM instead of maintaining a list of passes ourselves * Loop vectorization is turned on by default as an optimization pass and can be disabled with `-Z no-vectorize-loops`
2013-08-24rustllvm: Specify hard floats for gnueabihf.Luqman Aden-3/+7
2013-08-22make: stop disabling frame pointer eliminationDaniel Micay-2/+0
We currently have no need for the frame pointers on any platform. They may eventually be needed on platforms without an equivalent to the DWARF call frame information to walk the stack in the garbage collector. Closes #7477
2013-08-20auto merge of #8328 : alexcrichton/rust/llvm-head, r=brsonbors-3/+7
The first commit message is pretty good, but whomever reviews this should probably also at least glance at the changes I made in LLVM. I basically reorganized our pending patch queue to be a bit more organized and clearer in what needs to go where. After this, our queue would be: * Add the `no-split-stack` attribute * Add the `fixedstacksegment` attribute * Add split-stacks for arm android * Add split-stacks for arm linux * Add split stacks for mips Then there's a patch which I added to get rust to build at all on LLVM-head, and I'm not quite sure why it's there, but nothing seems to be crashing for now! (famous last words). Otherwise, I just updated code to reflect the changes I made in LLVM with the only major change being the advent of the new `no_split_stack` attribute. This is work towards #1226, but someone more familiar with the code should probably actually assign the attribute to the appropriate functions. Also as a bonus, I've verified that this closes #5774
2013-08-20Fix LLVM compilation issues and use the new attrsAlex Crichton-3/+7
This implements #[no_split_stack] and also changes #[fast_ffi] to using the new "fixedstacksegment" string attribute instead of integer attribute.
2013-08-16debuginfo: Generate template type parameters for generic functions.Michael Woerister-0/+18
Conflicts: src/librustc/lib/llvm.rs src/librustc/middle/trans/debuginfo.rs src/rustllvm/RustWrapper.cpp src/rustllvm/rustllvm.def.in
2013-08-11auto merge of #8410 : luqmana/rust/mcpu, r=sanxiynbors-1/+2
Adds `--target-cpu` flag which lets you choose a more specific target cpu instead of just passing the default, `generic`. It's more or less akin to `-mcpu`/`-mtune` in clang/gcc.
2013-08-10rustc: Add --target-cpu flag to select a more specific processor instead of ↵Luqman Aden-1/+2
the default, 'generic'.
2013-08-09Implement an `address_insignificant` attributeAlex Crichton-0/+4
This can be applied to statics and it will indicate that LLVM will attempt to merge the constant in .data with other statics. I have preliminarily applied this to all of the statics generated by the new `ifmt!` syntax extension. I compiled a file with 1000 calls to `ifmt!` and a separate file with 1000 calls to `fmt!` to compare the sizes, and the results were: fmt 310k ifmt (before) 529k ifmt (after) 202k This now means that ifmt! is both faster and smaller than fmt!, yay!
2013-08-04Fix build issues once LLVM has been upgradedAlex Crichton-10/+1
* LLVM now has a C interface to LLVMBuildAtomicRMW * The exception handling support for the JIT seems to have been dropped * Various interfaces have been added or headers have changed
2013-07-28Add an atomic fence intrinsicJames Miller-1/+4
2013-07-19debuginfo: Support for tuple-style enums (WIP)Michael Woerister-42/+66
2013-07-19debuginfo: Added support for c-style enums.Michael Woerister-0/+30
2013-06-17Fixed rebase fallout .Vadim Chugunov-1/+3
2013-06-17Fixed remaining issues to pass debug-test/* tests.Vadim Chugunov-0/+11
Made debugger scripts source line insensitive.
2013-06-17Made the while DebugContext mutable, not just created_* hashesVadim Chugunov-17/+28
Disabled create_arg
2013-06-17Use DIBuilder in debuginfoVadim Chugunov-0/+201
2013-06-13Don't run passes again on JIT codeAlex Crichton-14/+0
These passes are already run beforehand, no need to do them twice.
2013-06-13Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""Alex Crichton-18/+12
This reverts commit 19adece68b00bd1873499cca6f1537750608d769.
2013-06-13Revert "Revert "Remove all usage of the global LLVMContextRef""Alex Crichton-5/+24
This reverts commit 541c657a738006d78171aa261125a6a46f283b35.
2013-06-13Revert "Remove all usage of the global LLVMContextRef"Brian Anderson-24/+5
This reverts commit 779191cd4b8719e8efdf69fb6da93e2a8905ca1d. Conflicts: src/librustc/middle/trans/base.rs src/librustc/middle/trans/common.rs
2013-06-13Revert "Have JIT execution take ownership of the LLVMContextRef"Brian Anderson-12/+18
This reverts commit 5c5095d25e3652c434c8d4ec178e6844877e3c2d. Conflicts: src/librusti/rusti.rc
2013-06-10Have JIT execution take ownership of the LLVMContextRefAlex Crichton-18/+12
Also stop leaking the ExecutionEngine created for jit code by forcibly disposing of it after the JIT code has finished executing
2013-06-10Remove all usage of the global LLVMContextRefAlex Crichton-5/+24
This allows parallel usage of the rustc library
2013-05-29Refactor optimization pass handling.James Miller-45/+3
Refactor the optimization passes to explicitly use the passes. This commit just re-implements the same passes as were already being run. It also adds an option (behind `-Z`) to run the LLVM lint pass on the unoptimized IR.
2013-05-20rustllvm: Use target alignment for atomic load/storeBrian Anderson-6/+8
2013-05-17Fix AtomicLoad builder codeJames Miller-1/+1
2013-05-12Adds atomic_load, atomic_load_acq, atomic_store, and atomic_store_rel ↵Matthijs Hofstra-0/+22
intrinsics. The default versions (atomic_load and atomic_store) are sequentially consistent. The atomic_load_acq intrinsic acquires as described in [1]. The atomic_store_rel intrinsic releases as described in [1]. [1]: http://llvm.org/docs/Atomics.html
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-11/+11
2013-04-22Choose target featuresSeo Sanghyeon-1/+2
2013-04-19llvm: Fixes for RustWrapper.Patrick Walton-6/+0
2013-04-19rustllvm: Fix RustWrapper.cppPatrick Walton-7/+16
2013-04-19librustc: Implement fast-ffi and use it in various placesPatrick Walton-0/+1
2013-04-10rustllvm: Initialize target analysis passesBrian Anderson-1/+4
Without this the target info for certain optimizations will not be created and the compiler will sometimes crash
2013-04-10rustllvm: followup latest LLVMYoung-il Choi-7/+13
2013-04-05rustllvm: Only initialize command-line arguments onceTim Chevalier-4/+12
In my WIP on rustpkg, I was calling driver code that calls LLVMRustWriteOutputFile more than once. This was making LLVM unhappy, since that function has code that initializes the command-line options for LLVM, and I guess you can't do that more than once. So, check if they've already been initialized.
2013-03-19Enable arm error handling abi 2ILyoan-2/+3
2013-03-19Enable arm error handling abiILyoan-0/+5
2013-03-15Normalize target triple so that llvm can recognize target os correctlyILyoan-2/+2
2013-03-13Revamp foreign code not to consider the Rust modes. This requiresNiko Matsakis-2/+2
adjusting a few foreign functions that were declared with by-ref mode. This also allows us to remove by-val mode in the near future. With copy mode, though, we have to be careful because Rust will implicitly pass somethings by pointer but this may not be the C ABI rules. For example, rust will pass a struct Foo as a Foo*. So I added some code into the adapters to fix this (though the C ABI rules may put the pointer back, oh well). This patch also includes a lint mode for the use of by-ref mode in foreign functions as the semantics of this have changed.
2013-03-12Wrap llvm::InlineAsm::AsmDialectLuqman Aden-3/+3
2013-03-12Parse inline assembly.Luqman Aden-0/+12
2013-03-03rustc: MIPS32 supportJyun-Yan You-0/+12
2013-01-13Support ARM and Androidkyeongwoon-0/+12
Conflicts: src/libcore/os.rs src/librustc/back/link.rs src/librustc/driver/driver.rs src/librustc/metadata/loader.rs src/librustc/middle/trans/base.rs
2012-12-28Replace much of the REPL run code with a call to compile_uptoBrian Leibig-1/+1
2012-12-22rustllvm: Fix symbol resolution on Mac for rusti. rs=bugfixPatrick Walton-0/+7
2012-12-10Add license boilerplate to more files.Graydon Hoare-6/+9
2012-10-21rustc: add new intrinsics - atomic_cxchg{_acq,_rel}Luqman Aden-0/+8
2012-10-11Conditional usage of LLVM DebugFlagLuca Bruno-0/+2
DebugFlag is conditionally exported by LLVM in llvm/Support/Debug.h in-between an #ifndef NDEBUG block; RustWrapper should not unconditionally use it. This closes #3701. Signed-off-by: Luca Bruno <lucab@debian.org>
2012-09-28jit: Remove old crate loading code and don't search through loaded crates ↵Zack Corr-11/+2
(use llvm default instead)