about summary refs log tree commit diff
path: root/src/rustllvm
AgeCommit message (Collapse)AuthorLines
2017-08-08Fix covered-switch-default warnings in PassWrapperkennytm-2/+4
(See #39063 for explanation)
2017-07-31Gate LLVMRustHasFeature on LLVM_RUSTLLVMJosh Stone-1/+1
Commit c4710203c098b in #43492 make `LLVMRustHasFeature` "more robust" by using `getFeatureTable()`. However, this function is specific to Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use `#if LLVM_RUSTLLVM` to guard this call.
2017-07-28Make LLVMRustHasFeature more robustLuca Barbato-13/+7
The function should accept feature strings that old LLVM might not support. Simplify the code using the same approach used by LLVMRustPrintTargetFeatures. Dummify the function for non 4.0 LLVM and update the tests accordingly.
2017-07-23Auto merge of #43387 - TimNN:rustllvm50, r=alexcrichtonbors-79/+154
Update Rust LLVM bindings for LLVM 5.0 This is the initial set of changes to update the rust llvm bindings for 5.0. The llvm commits necessitating these changes are linked from the tracking issue, #43370.
2017-07-21Fix archive member names on 5.0Alex Crichton-0/+4
2017-07-21update attributes API usageAlex Crichton-1/+26
2017-07-21rustllvm: split DebugLoc in UnpackOptimizationDiagnosticTim Neumann-3/+20
2017-07-21rustllvm: update to SyncScope::IDTim Neumann-0/+13
2017-07-21rustllvm: adjust usage of createNameSpaceTim Neumann-1/+5
2017-07-21rustllvm: adjust usage of createPointerTypeTim Neumann-1/+9
2017-07-21rustllvm: use LLVMMetadataRefTim Neumann-73/+75
2017-07-21rustllvm: define LLVM_VERSION_LTTim Neumann-0/+2
2017-07-18Fix LLVM assertion when a weak symbol is defined in global_asm.Vadzim Dambrouski-1/+1
This change will fix the issue from https://github.com/japaric/svd2rust/pull/130
2017-07-12[LLVM] Avoid losing the !nonnull attribute in SROAAriel Ben-Yehuda-5/+1
This still does not work on 32-bit archs because of an LLVM limitation, but this is only an optimization, so let's push it on 64-bit only for now. Fixes #37945
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-0/+4
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-0/+4
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-04Auto merge of #42993 - stepancheg:editorconfig, r=brsonbors-0/+6
Add .editorconfig to src/rustllvm ... which uses 2 space indent instead of common 4 spaces.
2017-07-01When writing LLVM IR output demangled fn name in commentsStepan Koltsov-2/+126
`--emit=llvm-ir` looks like this now: ``` ; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut ; Function Attrs: inlinehint uwtable define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 { start: ... ``` cc https://github.com/integer32llc/rust-playground/issues/15
2017-06-30Add .editorconfig to src/rustllvmStepan Koltsov-0/+6
... which uses 2 space indent instead of common 4 spaces.
2017-06-27Rebase LLVM on top of LLVM 4.0.1Ariel Ben-Yehuda-1/+1
Fixes #42893.
2017-06-19Update LLVM to pick StackColoring improvementAriel Ben-Yehuda-1/+1
Fixes #40883.
2017-06-19Backport fixes to LLVM 4.0 ARM codegen bugsAriel Ben-Yehuda-1/+1
So ARM had quite a few codegen bugs on LLVM 4.0 which are fixed on LLVM trunk. This backports 5 of them: r297871 - ARM: avoid clobbering register in v6 jump-table expansion. - fixes rust-lang/rust#42248 r294949 - [Thumb-1] TBB generation: spot redefinitions of index r295816 - [ARM] Fix constant islands pass. r300870 - [Thumb-1] Fix corner cases for compressed jump tables r302650 - [IfConversion] Add missing check in IfConversion/canFallThroughTo - unblocks rust-lang/rust#39409
2017-06-16Auto merge of #42410 - nagisa:llvmup, r=sanxiynbors-1/+1
Upgrade LLVM Includes https://github.com/rust-lang/llvm/pull/80
2017-06-08Upgrade LLVMSimonas Kazlauskas-1/+1
Includes https://github.com/rust-lang/llvm/pull/80 Includes https://github.com/rust-lang/llvm/pull/79 Also adds tests and thus fixes #24194
2017-06-04Merge branch 'profiling' of github.com:whitequark/rust into profilingMarco Castelluccio-0/+4
2017-05-28add NullOp::SizeOf and BinOp::OffsetAriel Ben-Yehuda-5/+9
2017-05-13LLVM: Add support for EABI-compliant libcalls on MSP430.Vadzim Dambrouski-1/+1
This change will allow rust code to have proper support for division and multiplication using libgcc libcalls.
2017-05-06trigger llvm rebuildTim Neumann-1/+1
2017-05-01Auto merge of #41560 - alevy:rwpi-ropi, r=eddybbors-23/+43
Add RWPI/ROPI relocation model support This PR adds support for using LLVM 4's ROPI and RWPI relocation models for ARM. ROPI (Read-Only Position Independence) and RWPI (Read-Write Position Independence) are two new relocation models in LLVM for the ARM backend ([LLVM changset](https://reviews.llvm.org/rL278015)). The motivation is that these are the specific strategies we use in userspace [Tock](https://www.tockos.org) apps, so supporting this is an important step (perhaps the final step, but can't confirm yet) in enabling userspace Rust processes. ## Explanation ROPI makes all code and immutable accesses PC relative, but not assumed to be overriden at runtime (so for example, jumps are always relative). RWPI uses a base register (`r9`) that stores the addresses of the GOT in memory so the runtime (e.g. a kernel) only adjusts r9 tell running code where the GOT is. ## Complications adding support in Rust While this landed in LLVM master back in August, the header files in `llvm-c` have not been updated yet to reflect it. Rust replicates that header file's version of the `LLVMRelocMode` enum as the Rust enum `llvm::RelocMode` and uses an implicit cast in the ffi to translate from Rust's notion of the relocation model to the LLVM library's notion. My workaround for this currently is to replace the `LLVMRelocMode` argument to `LLVMTargetMachineRef` with an int and using the hardcoded int representation of the `RelocMode` enum. This is A Bad Idea(tm), but I think very nearly the right thing. Would a better alternative be to patch rust-llvm to support these enum variants (also a fairly trivial change)?
2017-05-01Add profiling support, through the rustc -Z profile flag.whitequark-0/+4
When -Z profile is passed, the GCDAProfiling LLVM pass is added to the pipeline, which uses debug information to instrument the IR. After compiling with -Z profile, the $(OUT_DIR)/$(CRATE_NAME).gcno file is created, containing initial profiling information. After running the program built, the $(OUT_DIR)/$(CRATE_NAME).gcda file is created, containing branch counters. The created *.gcno and *.gcda files can be processed using the "llvm-cov gcov" and "lcov" tools. The profiling data LLVM generates does not faithfully follow the GCC's format for *.gcno and *.gcda files, and so it will probably not work with other tools (such as gcov itself) that consume these files.
2017-04-28Added LLVMRustRelocModeAmit Aryeh Levy-34/+43
Replaces the llvm-c exposed LLVMRelocMode, which does not include all relocation model variants, with a LLVMRustRelocMode modeled after LLVMRustCodeMode.
2017-04-27Update LLVM to fix incorrect codegen on MSP430.Vadzim Dambrouski-1/+1
The bug was reported by @akovaski here: https://github.com/rust-embedded/rfcs/issues/20#issuecomment-296482148
2017-04-26Add RWPI/ROPI relocation model supportAmit Aryeh Levy-4/+15
Adds support for using LLVM 4's ROPI and RWPI relocation models for ARM
2017-04-26Cherry pick LLVM hexagon fixesMichael Wu-1/+1
2017-04-25Add Hexagon supportMichael Wu-1/+8
This requires an updated LLVM with D31999 and D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator.
2017-04-12Expose LLVM appendModuleInlineAsmA.J. Gardner-0/+4
2017-03-24update LLVM with fix for PR32379Ariel Ben-Yehuda-1/+1
Fixes #40593.
2017-03-20Auto merge of #39628 - arielb1:shimmir, r=eddybbors-1/+1
Translate shims using MIR This removes one large remaining part of old trans.
2017-03-19update LLVMAriel Ben-Yehuda-1/+1
pick up a fix to LLVM PR29151.
2017-03-16add missing global metadataTim Neumann-3/+8
2017-03-16clang-formatTim Neumann-5/+2
2017-03-16isolate llvm 4.0 code pathTim Neumann-12/+6
2017-03-12rustbuild: Add option for enabling partial LLVM rebuildsVadim Petrochenkov-1/+1
2017-03-10LLVM: Update submodule to include SRet support patch for MSP430.Vadzim Dambrouski-1/+1
2017-03-02LLVM: Update submodule to include x86-interrupt ABI patchesPhilipp Oppermann-1/+1
2017-02-15rustc: Link statically to the MSVCRTAlex Crichton-1/+1
This commit changes all MSVC rustc binaries to be compiled with `-C target-feature=+crt-static` to link statically against the MSVCRT instead of dynamically (as it does today). This also necessitates compiling LLVM in a different fashion, ensuring it's compiled with `/MT` instead of `/MD`. cc #37406
2017-02-13Auto merge of #39456 - nagisa:mir-switchint-everywhere, r=nikomatsakisbors-0/+6
[MIR] SwitchInt Everywhere Something I've been meaning to do for a very long while. This PR essentially gets rid of 3 kinds of conditional branching and only keeps the most general one - `SwitchInt`. Primary benefits are such that dealing with MIR now does not involve dealing with 3 different ways to do conditional control flow. On the other hand, constructing a `SwitchInt` currently requires more code than what previously was necessary to build an equivalent `If` terminator. Something trivially "fixable" with some constructor methods somewhere (MIR needs stuff like that badly in general). Some timings (tl;dr: slightly faster^1 (unexpected), but also uses slightly more memory at peak (expected)): ^1: Not sure if the speed benefits are because of LLVM liking the generated code better or the compiler itself getting compiled better. Either way, its a net benefit. The CORE and SYNTAX timings done for compilation without optimisation. ``` AFTER: Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 31.50 secs Finished release [optimized] target(s) in 31.42 secs Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 439.56 secs Finished release [optimized] target(s) in 435.15 secs CORE: 99% (24.81 real, 0.13 kernel, 24.57 user); 358536k resident CORE: 99% (24.56 real, 0.15 kernel, 24.36 user); 359168k resident SYNTAX: 99% (49.98 real, 0.48 kernel, 49.42 user); 653416k resident SYNTAX: 99% (50.07 real, 0.58 kernel, 49.43 user); 653604k resident BEFORE: Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 31.84 secs Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 451.17 secs CORE: 99% (24.66 real, 0.20 kernel, 24.38 user); 351096k resident CORE: 99% (24.36 real, 0.17 kernel, 24.18 user); 352284k resident SYNTAX: 99% (52.24 real, 0.56 kernel, 51.66 user); 645544k resident SYNTAX: 99% (51.55 real, 0.48 kernel, 50.99 user); 646428k resident ``` cc @nikomatsakis @eddyb
2017-02-11[LLVM 4.0] Fix CreateCompileUnitMatt Ickstadt-3/+11
2017-02-10Fix intcast, use it where appropriateSimonas Kazlauskas-0/+6
2017-02-09Auto merge of #38109 - tromey:main-subprogram, r=michaelwoeristerbors-0/+6
Emit DW_AT_main_subprogram This changes rustc to emit DW_AT_main_subprogram on the "main" program. This lets gdb suitably stop at the user's main in response to "start" (rather than the library's main, which is what happens currently). Fixes #32620 r? michaelwoerister