about summary refs log tree commit diff
path: root/src/rustllvm/rustllvm.def.in
AgeCommit message (Collapse)AuthorLines
2014-04-03rustllvm: Remove a no longer needed fileAlex Crichton-635/+0
The .def.in files haven't been necessary since the switch to static linking awhile back.
2014-03-27Initial support for emitting DWARF for static vars.gentlefolk-0/+1
Only supports crate level statics. No debug info is generated for function level statics. Closes #9227.
2013-12-09Implement LTOAlex Crichton-0/+3
This commit implements LTO for rust leveraging LLVM's passes. What this means is: * When compiling an rlib, in addition to insdering foo.o into the archive, also insert foo.bc (the LLVM bytecode) of the optimized module. * When the compiler detects the -Z lto option, it will attempt to perform LTO on a staticlib or binary output. The compiler will emit an error if a dylib or rlib output is being generated. * The actual act of performing LTO is as follows: 1. Force all upstream libraries to have an rlib version available. 2. Load the bytecode of each upstream library from the rlib. 3. Link all this bytecode into the current LLVM module (just using llvm apis) 4. Run an internalization pass which internalizes all symbols except those found reachable for the local crate of compilation. 5. Run the LLVM LTO pass manager over this entire module 6a. If assembling an archive, then add all upstream rlibs into the output archive. This ignores all of the object/bitcode/metadata files rust generated and placed inside the rlibs. 6b. If linking a binary, create copies of all upstream rlibs, remove the rust-generated object-file, and then link everything as usual. As I have explained in #10741, this process is excruciatingly slow, so this is *not* turned on by default, and it is also why I have decided to hide it behind a -Z flag for now. The good news is that the binary sizes are about as small as they can be as a result of LTO, so it's definitely working. Closes #10741 Closes #10740
2013-12-05Update LLVM and jettison jit supportAlex Crichton-3/+0
LLVM's JIT has been updated numerous times, and we haven't been tracking it at all. The existing LLVM glue code no longer compiles, and the JIT isn't used for anything currently. This also rebases out the FixedStackSegment support which we have added to LLVM. None of this is still in use by the compiler, and there's no need to keep this functionality around inside of LLVM. This is needed to unblock #10708 (where we're tripping an LLVM assertion).
2013-11-29Add generation of static libraries to rustcAlex Crichton-0/+2
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-10-28add support for the `cold` function attributeDaniel Micay-0/+1
This allows a function to marked as infrequently called, resulting in any branch calling it to be considered colder.
2013-10-11have LLVM print type strings for usDaniel Micay-0/+1
Example: void ({ i64, %tydesc*, i8*, i8*, i8 }*, i64*, %"struct.std::fmt::Formatter[#1]"*)* Before, we would print 20 levels deep due to recursion in the type definition.
2013-09-15debuginfo: Added LLVMDICompositeTypeSetTypeArray to rustllvm.def.inMichael Woerister-0/+1
2013-09-10debuginfo: Wrapped namespace facilities of llvm::DIBuilderMichael Woerister-0/+1
2013-09-09add `noalias` attribute to ~ return valuesDaniel Micay-0/+2
2013-09-04debuginfo: Added test cases for structs, tuples, enums, etc passed by value.Michael Woerister-0/+3
Also updated documentation comments in debuginfo and renamed DebugContext to CrateDebugContext.
2013-08-26Rewrite pass management with LLVMAlex Crichton-7/+12
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-20auto merge of #8328 : alexcrichton/rust/llvm-head, r=brsonbors-0/+1
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-0/+1
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/+1
Conflicts: src/librustc/lib/llvm.rs src/librustc/middle/trans/debuginfo.rs src/rustllvm/RustWrapper.cpp src/rustllvm/rustllvm.def.in
2013-08-09Implement an `address_insignificant` attributeAlex Crichton-0/+1
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-07-28Add an atomic fence intrinsicJames Miller-0/+1
2013-07-21Avoid blocks for static allocas and loading the closure environmentBjörn Steinbrink-0/+1
These blocks were required because previously we could only insert instructions at the end of blocks, but we wanted to have all allocas in one place, so they can be collapse. But now we have "direct" access the the LLVM IR builder and can position it freely. This allows us to use the same trick that clang uses, which means that we insert a dummy "marker" instruction to identify the spot at which we want to insert allocas. We can then later position the IR builder at that spot and insert the alloca instruction, without any dedicated block. The block for loading the closure environment can now also go away, because the function context now provides the toplevel block, and the translation of the loading happens first, so that's good enough. Makes the LLVM IR a bit more readable, saving a bunch of branches in the unoptimized code, which benefits unoptimized builds.
2013-07-19debuginfo: Fixed some merge falloutMichael Woerister-0/+3
2013-06-19rustc: Dispose of LLVM passes in test casesBrian Anderson-0/+1
2013-06-17Fixed remaining issues to pass debug-test/* tests.Vadim Chugunov-0/+1
Made debugger scripts source line insensitive.
2013-06-17Made the while DebugContext mutable, not just created_* hashesVadim Chugunov-17/+18
Disabled create_arg
2013-06-17Use DIBuilder in debuginfoVadim Chugunov-0/+17
2013-06-13Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""Alex Crichton-1/+3
This reverts commit 19adece68b00bd1873499cca6f1537750608d769.
2013-06-13Revert "Revert "Remove all usage of the global LLVMContextRef""Alex Crichton-2/+1
This reverts commit 541c657a738006d78171aa261125a6a46f283b35.
2013-06-13Revert "Remove all usage of the global LLVMContextRef"Brian Anderson-1/+2
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-3/+1
This reverts commit 5c5095d25e3652c434c8d4ec178e6844877e3c2d. Conflicts: src/librusti/rusti.rc
2013-06-10Have JIT execution take ownership of the LLVMContextRefAlex Crichton-1/+3
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-2/+1
This allows parallel usage of the rustc library
2013-05-29Further refactor optimization pass handlingJames Miller-98/+2
This refactors pass handling to use the argument names, so it can be used in a similar manner to `opt`. This may be slightly less efficient than the previous version, but it is much easier to maintain. It also adds in the ability to specify a custom pipeline on the command line, this overrides the normal passes, however. This should completely close #2396.
2013-05-29Remove extraneous defs from export fileJames Miller-3/+0
2013-05-29Refactor optimization pass handling.James Miller-0/+102
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-12Adds atomic_load, atomic_load_acq, atomic_store, and atomic_store_rel ↵Matthijs Hofstra-0/+2
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-04-10rustllvm: followup latest LLVMYoung-il Choi-2/+0
2013-03-12Parse inline assembly.Luqman Aden-0/+1
2013-03-03There is no function in LLVM called LLVMInitializeMipsAsmLexerBrian Anderson-1/+0
2013-03-03rustc: MIPS32 supportJyun-Yan You-0/+7
2013-01-13Support ARM and Androidkyeongwoon-7/+7
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-10-21rustc: add new intrinsics - atomic_cxchg{_acq,_rel}Luqman Aden-0/+1
2012-09-27jit: Separate JIT execution into two functions and load crates before main ↵Zack Corr-2/+3
lookup
2012-08-31jit: Add passes and cleanup codeZack Corr-2/+1
2012-08-31jit: Add custom memory manager (still segfaulting)Zack Corr-1/+3
2012-08-31Add experimental JIT compilerZack Corr-0/+2
2012-07-25Added debug flag to enable LLVM debug output.Elliott Slaughter-0/+1
2012-07-24Remove rustllvm functions which have moved upstream.Elliott Slaughter-1/+0
2012-07-24Only initialize targets that are actually supported / linked to in RustWrapperZack Corr-0/+2
2012-06-29Adding a bunch of atomic intrinsics.Eric Holk-0/+1
Adding a test cases for the atomic intrinsics.
2012-03-14Upgrade LLVM and add fix to PE/COFF relocation overflow handling.Graydon Hoare-1/+0
2011-12-18Remove rebase error.Josh Matthews-3/+0
2011-12-18Add debug info for local vars, basic fundamental types, and lexical blocks, ↵Josh Matthews-1/+6
along with source line information generation for individual instructions.