about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/mir
AgeCommit message (Collapse)AuthorLines
2018-08-22Remove Ty prefix from ↵varkor-16/+16
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-22miri/CTFE refactorRalf Jung-3/+3
* Value gets renamed to Operand, so that now interpret::{Place, Operand} are the "dynamic" versions of mir::{Place, Operand}. * Operand and Place share the data for their "stuff is in memory"-base in a new type, MemPlace. This also makes it possible to give some more precise types in other areas. Both Operand and MemPlace have methods available to project into fields (and other kinds of projections) without causing further allocations. * The type for "a Scalar or a ScalarPair" is called Value, and again used to give some more precise types. * All of these have versions with an attached layout, so that we can more often drag the layout along instead of recomputing it. This lets us get rid of `PlaceExtra::Downcast`. MPlaceTy and PlaceTy can only be constructed in place.rs, making sure the layout is handled properly. (The same should eventually be done for ValTy and OpTy.) * All the high-level functions to write typed memory take a Place, and live in place.rs. All the high-level typed functions to read typed memory take an Operand, and live in operands.rs.
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-1/+1
Fix typos found by codespell.
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-19Integrate OperandValue::UnsizedRef into OperandValue::Ref.Masaki Hara-39/+23
2018-08-19Integrate PassMode::UnsizedIndirect into PassMode::Indirect.Masaki Hara-6/+4
2018-08-19Implement simple codegen for unsized rvalues.Masaki Hara-18/+167
2018-08-18Auto merge of #53286 - nagisa:cast-assumes, r=eddybbors-1/+3
Do not generate assumes for plain integer casts I gave up on making anything more elegant for now. r? @eddyb
2018-08-12Do not generate assumes for plain integer castsSimonas Kazlauskas-1/+3
2018-08-09rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.Josh Stone-2/+24
This hack was removed in #50949, but without it I found that building `std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` errors, then die `LLVM ERROR: Failed to strip malformed debug info`. It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack just for older LLVM. This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. Fixes #53204. r? @eddyb
2018-08-07Auto merge of #51007 - AstralSorcerer:master, r=nagisabors-5/+5
Make globals with private linkage unnamed. Fixes #50862. cc @oli-obk @nagisa
2018-08-04Simplify some handling of target_pointer_widthMark Rousskov-12/+2
2018-08-04Normalize DebugInfoLevel to standard styleMark Rousskov-3/+3
2018-08-03Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJungbors-11/+17
Reintroduce `Undef` and properly check constant value sizes r? @RalfJung cc @eddyb basically all kinds of silent failures that never occurred are assertions now
2018-08-02Second field of ScalarPair can be undef in some casesOliver Schneider-7/+11
2018-08-01Reintroduce `Undef` and properly check constant value sizesOliver Schneider-4/+6
2018-08-01Split out growth functionality into BitVector typeMark Rousskov-7/+7
2018-07-31Make globals with private linkage unnamed. Fixes #50862.Colin Pronovost-5/+5
2018-07-30rustc_codegen_llvm: fix tidy errors.Irina Popa-1/+6
2018-07-30rustc_codegen_llvm: use safe references for BasicBlock.Irina Popa-11/+11
2018-07-30rustc_codegen_llvm: use safe references for Value.Irina Popa-168/+160
2018-07-30rustc_codegen_llvm: use safe references for Metadata and DI*.Irina Popa-14/+13
2018-07-30rustc_codegen_llvm: use safe references for Type.Irina Popa-84/+85
2018-07-30rustc_codegen_llvm: move from empty enums to extern types.Irina Popa-20/+18
2018-07-26Auto merge of #52488 - nikomatsakis:nll-issue-48071-universe-and-sub, r=pnkfelixbors-7/+7
introduce universes to NLL type check This branch aims to fix #48071 and also advance chalk integration a bit at the same time. It re-implements the subtyping/type-equating check so that NLL doesn't "piggy back" on the subtyping code of the old type checker. This new code uses the "universe-based" approach to handling higher-ranked lifetimes, which sidesteps some of the limitations of the current "leak-based" scheme. This avoids the ICE in #48071. At the same time, I aim for this to potentially be a kind of optimization. This NLL code is (currently) not cached, but it also generates constraints without doing as much instantiation, substitution, and folding. Right now, though, it still piggy backs on the `relate_tys` trait, which is a bit unfortunate -- it means we are doing more hashing and things than we have to. I want to measure the see the perf. Refactoring that trait is something I'd prefer to leave for follow-up work. r? @pnkfelix -- but I want to measure perf etc first
2018-07-25parameterize `BitVector` and `BitMatrix` by their index typesNiko Matsakis-7/+7
2018-07-24Rollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichtonMark Rousskov-0/+4
Add unaligned volatile intrinsics Surprisingly enough, it turns out that unaligned volatile loads are actually useful for certain (very niche) types of lock-free code. I included unaligned volatile stores for completeness, but I currently do not know of any use cases for them. These are only exposed as intrinsics for now. If they turn out to be useful in practice, we can work towards stabilizing them. r? @alexcrichton
2018-07-23Fix tidyOliver Schneider-1/+2
2018-07-23Explain promoted extraction for simd shuffleOliver Schneider-0/+3
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-52/+91
2018-07-20Abort instead of UB if promotion failsOliver Schneider-3/+8
2018-07-14Add unaligned volatile intrinsicsAmanieu d'Antras-0/+4
2018-07-13Auto merge of #51987 - nikomatsakis:nll-region-infer-scc, r=pnkfelixbors-1/+1
nll experiment: compute SCCs instead of iterative region solving This is an attempt to speed up region solving by replacing the current iterative dataflow with a SCC computation. The idea is to detect cycles (SCCs) amongst region constraints and then compute just one value per cycle. The graph with all cycles removed is of course a DAG, so we can then solve constraints "bottom up" once the liveness values are known. I kinda ran out of time this morning so the last commit is a bit sloppy but I wanted to get this posted, let travis run on it, and maybe do a perf run, before I clean it up.
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-1/+1
2018-07-10Auto merge of #51583 - cuviper:packed_pair-bool, r=Mark-Simulacrumbors-22/+15
Store scalar pair bools as i8 in memory We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates, to optimize IR for checked operators and the like. With this patch, we still do so when the pair is an immediate value, but we use the `i8` memory type when the value is loaded or stored as an LLVM aggregate. So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }` in memory. When a pair is a direct function argument, `PassMode::Pair`, it is still passed using the immediate `i1` type, but as a return value it will use the `i8` memory type. Also, `bool`-like` enum tags will now use scalar pairs when possible, where they were previously excluded due to optimization issues. Fixes #51516. Closes #51566. r? @eddyb cc @nox
2018-07-09bump minimum LLVM version to 5.0gnzlbg-18/+4
2018-07-05Update scalar pairs per review commentsJosh Stone-10/+2
2018-07-05Store scalar pair bools as i8 in memoryJosh Stone-16/+17
We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates, to optimize IR for checked operators and the like. With this patch, we still do so when the pair is an immediate value, but we use the `i8` memory type when the value is loaded or stored as an LLVM aggregate. So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }` in memory. When a pair is a direct function argument, `PassMode::Pair`, it is still passed using the immediate `i1` type, but as a return value it will use the `i8` memory type. Also, `bool`-like` enum tags will now use scalar pairs when possible, where they were previously excluded due to optimization issues.
2018-06-30Do not allow LLVM to increase a TLS's alignment on macOS.kennytm-2/+2
2018-06-28Merge `ConstVal` and `ConstValue`Oliver Schneider-22/+20
2018-06-28Move everything over from `middle::const_val` to `mir::interpret`Oliver Schneider-2/+2
2018-06-28Move the Lrc outside the error type and name the fieldsOliver Schneider-5/+7
2018-06-16rustc_codegen_llvm: don't treat i1 as signed, even for #[repr(i8)] enums.Eduard-Mihai Burtescu-2/+10
2018-06-05Refactor the const eval diagnostic APIOliver Schneider-2/+8
2018-06-02Generate br for all two target SwitchIntsNikita Popov-5/+14
Instead of only for booleans. This means that if let also becomes a br. Apart from making the IR slightly simpler, this is supported by FastISel.
2018-05-30rustc: rename mir::LocalDecl's syntactic_source_info to source_info.Eduard-Mihai Burtescu-1/+1
2018-05-30rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.Eduard-Mihai Burtescu-2/+5
2018-05-30rustc: rename mir::LocalDecl's source_info to visibility_source_info.Eduard-Mihai Burtescu-2/+2