summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
AgeCommit message (Collapse)AuthorLines
2018-12-04Auto merge of #55871 - ljedrz:llvm_back_allocations, r=nagisabors-18/+19
codegen_llvm_back: improve allocations This commit was split out from https://github.com/rust-lang/rust/pull/54864. Last time it was causing an LLVM OOM, which was most probably caused by not collecting the globals. - preallocate vectors of known length - `extend` instead of `append` where the argument is consumable - turn 2 `push` loops into `extend`s - create a vector from a function producing one instead of using `extend_from_slice` on it - consume `modules` when no longer needed - ~~return an `impl Iterator` from `generate_lto_work`~~ - ~~don't `collect` `globals`, as they are iterated over and consumed right afterwards~~ While I'm hoping it won't cause an OOM anymore, I would still consider this a "high-risk" PR and not roll it up.
2018-12-03Auto merge of #55010 - tromey:Bug-9224-generic-parameters, r=michaelwoeristerbors-8/+65
Add template parameter debuginfo to generic types This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes #9224
2018-12-03codegen_llvm_back: improve allocationsljedrz-18/+19
2018-12-03Auto merge of #56358 - nikic:mergefunc-aliases, r=rkruppebors-4/+9
Enable -mergefunc-use-aliases If the Rust LLVM fork is used, enable the -mergefunc-use-aliases flag, which will create aliases for merged functions, rather than inserting a call from one to the other. A number of codegen tests needed to be adjusted, because functions that previously fell below the thunk limit are now being merged. Merging is prevented in various ways now. I expect that this is going to break something, somewhere, because it isn't able to deal with aliases properly, but we won't find out until we try :) This fixes #52651. r? @rkruppe
2018-12-02Auto merge of #56198 - bjorn3:cg_ssa_refactor, r=eddybbors-246/+349
Refactor rustc_codegen_ssa cc #56108 (not all things are done yet) This removes an unsafe method from cg_ssa. r? @eddyb cc @sunfishcode
2018-12-02Run name-anon-globals after all other passesNikita Popov-4/+5
name-anon-globals should always be run at the very end of the pass pipeline, as optimization passes (in particular mergefunc) may introduce new anonymous globals. I believe we did not run into this earlier because it requires the rather specific combination of a) mergefunc merging two weak functions b) compilation not using thinlto.
2018-12-01Rollup merge of #56341 - frewsxcv:frewsxcv-util-cstr, r=Mark-Simulacrumkennytm-23/+11
Rename conversion util; remove duplicate util in librustc_codegen_llvm.
2018-11-30Enable -mergefunc-use-aliasesNikita Popov-0/+4
If the Rust LLVM fork is used, enable the -mergefunc-use-aliases flag, which will create aliases for merged functions, rather than inserting a call from one to the other. A number of codegen tests needed to be adjusted, because functions that previously fell below the thunk limit are now being merged. Merging is prevented either using -C no-prepopulate-passes, or by making the functions non-identical. I expect that this is going to break something, somewhere, because it isn't able to deal with aliases properly, but we won't find out until we try :) This fixes #52651.
2018-11-29Add template parameter debuginfo to generic typesTom Tromey-8/+65
This changes debuginfo generation to add template parameters to generic types. With this change the DWARF now has DW_TAG_template_type_param for types, not just for functions, like: <2><40d>: Abbrev Number: 6 (DW_TAG_structure_type) <40e> DW_AT_name : (indirect string, offset: 0x375): Generic<i32> <412> DW_AT_byte_size : 4 <413> DW_AT_alignment : 4 ... <3><41f>: Abbrev Number: 8 (DW_TAG_template_type_param) <420> DW_AT_type : <0x42a> <424> DW_AT_name : (indirect string, offset: 0xa65e): T Closes #9224
2018-11-29Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddybbors-13/+215
libcore: Add VaList and variadic arg handling intrinsics ## Summary - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`. - Add `core::va_list::VaList` to `libcore`. Part 1 of (at least) 3 for #44930 Comments and critiques are very much welcomed 😄
2018-11-29Move get_static from CodegenCx to Builderbjorn3-29/+36
2018-11-29Use implicit deref instead of BuilderMethods::cx()bjorn3-166/+166
2018-11-29Require Deref to CodegenCx for HasCodegenbjorn3-1/+8
2018-11-29Rename static_bitcast to const_bitcastbjorn3-6/+6
2018-11-29Remove static_addr_of_mut from cg_ssabjorn3-3/+3
2018-11-29Rename StaticMethods::static_ptrcast to ConstMethods::const_ptrcastbjorn3-5/+5
2018-11-29Remove static_bitcast from cg_ssabjorn3-7/+8
2018-11-29Remove an unnecessary referencebjorn3-1/+1
2018-11-29Move IntrinsicCallMethods::call_overflow_intrinsics to ↵bjorn3-74/+74
BuilderMethods::checked_binop
2018-11-29Remove call_lifetime_intrinsic from cg_ssabjorn3-16/+18
2018-11-29Don't use llvm intrinsic names in cg_ssabjorn3-2/+91
2018-11-29Remove static_replace_all_uses and statics_to_rauw from cg_ssabjorn3-10/+7
2018-11-29Make ConstMethods and StaticMethods require BackendTypes instead of Backendbjorn3-1/+1
2018-11-29Some refactoringsbjorn3-16/+16
2018-11-29Rename conversion util; remove duplicate util in librustc_codegen_llvm.Corey Farwell-23/+11
2018-11-29Rollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakisGuillaume Gomez-1/+1
rustc-guide has moved to rust-lang/ r? @nikomatsakis
2018-11-29rustc_codegen_llvm: don't overalign loads of pair operands.Eduard-Mihai Burtescu-3/+9
2018-11-26libcore: Add va_list lang item and intrinsicsDan Robertson-13/+215
- Add the llvm intrinsics used to manipulate a va_list. - Add the va_list lang item in order to allow implementing VaList in libcore.
2018-11-26rustc-guide has movedMark Mansi-1/+1
2018-11-25Rollup merge of #56075 - alexcrichton:wasm-producer-section, r=estebankPietro Albini-0/+112
Encode a custom "producers" section in wasm files This commit implements WebAssembly/tool-conventions#65 for wasm files produced by the Rust compiler. This adds a bit of metadata to wasm modules to indicate that the file's language includes Rust and the file's "processed-by" tools includes rustc. The thinking with this section is to eventually have telemetry in browsers tracking all this.
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+1
2018-11-24Rollup merge of #56154 - petrhosek:fuchsia-linker-args, r=alexcrichtonkennytm-1/+9
Pass additional linker flags when targeting Fuchsia This is a follow up to 8aa9267 which changed the driver to use lld directly rather than invoking it through Clang. This change ensures we pass all the necessary flags to lld.
2018-11-24Rollup merge of #56048 - bjorn3:cg_ssa_sysroot, r=eddybkennytm-1/+0
Add rustc_codegen_ssa to sysroot Outside of rustc you are currently unable to use it. r? @nikomatsakis (because you r+'ed #55627)
2018-11-23Auto merge of #54071 - eddyb:alignsssss, r=oli-obkbors-77/+74
rustc_target: separate out an individual alignment quantity type from Align. Before this PR, `rustc_target::abi::Align` combined "power-of-two alignment quantity" semantics, with a distinction between ABI (required) and preferred alignment (by having two quantities). After this PR, `Align` is only *one* such quantity, and a new `AbiAndPrefAlign` type is introduced to hold the pair of ABI and preferred `Align` quantities. `Align` is used everywhere one quantity is necessary/sufficient, simplifying some of the code in codegen/miri, while `AbiAndPrefAlign` only in layout computation (to propagate preferred alignment). r? @oli-obk cc @nagisa @RalfJung @nikomatsakis
2018-11-22Add rustc_codegen_ssa to sysrootbjorn3-1/+0
2018-11-22Pass additional linker flags when targeting FuchsiaPetr Hosek-1/+9
This is a follow up to 8aa9267 which changed the driver to use lld directly rather than invoking it through Clang. This change ensures we pass all the necessary flags to lld.
2018-11-22rustc_target: avoid using AbiAndPrefAlign where possible.Eduard-Mihai Burtescu-84/+84
2018-11-22rustc_target: separate out an individual Align from AbiAndPrefAlign.Eduard-Mihai Burtescu-42/+42
2018-11-22rustc_target: rename abi::Align to AbiAndPrefAlign.Eduard-Mihai Burtescu-39/+36
2018-11-21rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.Eduard-Mihai Burtescu-1/+1
2018-11-19Encode a custom "producers" section in wasm filesAlex Crichton-0/+112
This commit implements WebAssembly/tool-conventions#65 for wasm files produced by the Rust compiler. This adds a bit of metadata to wasm modules to indicate that the file's language includes Rust and the file's "processed-by" tools includes rustc. The thinking with this section is to eventually have telemetry in browsers tracking all this.
2018-11-16[eddyb] rustc_codegen_llvm: remove unused parametrization of `CodegenCx` and ↵Eduard-Mihai Burtescu-18/+18
`Builder` over `Value`s.
2018-11-16[eddyb] rustc_codegen_ssa: rename `interfaces` to `traits`.Eduard-Mihai Burtescu-23/+23
2018-11-16[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.Eduard-Mihai Burtescu-12/+1
2018-11-16[eddyb] rustc_codegen_llvm: remove unnecessary `'a` from ↵Eduard-Mihai Burtescu-3/+3
`LlvmCodegenBackend` impls.
2018-11-16[eddyb] rustc_codegen_ssa: handle LLVM unsafety correctly.Eduard-Mihai Burtescu-16/+21
2018-11-16Separating the back folder between backend-agnostic and LLVM-specific codeDenis Merigoux-2351/+319
2018-11-16Added default impl for DerivedTypeMethods + empty impl for Cranelift ↵Denis Merigoux-120/+5
BaseTypeMethods
2018-11-16All Builder methods now take &mut self instead of &selfDenis Merigoux-264/+276
2018-11-16Added some docs + start to &mut self builder methodsDenis Merigoux-14/+14