summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/mir
AgeCommit message (Collapse)AuthorLines
2018-08-25rustc_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-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
2018-05-30rustc: rename mir::VisibilityScope to mir::SourceScope.Eduard-Mihai Burtescu-5/+5
2018-05-29rust-lang/rust#27282: Add `StatementKind::ReadForMatch` to MIR.Felix S. Klock II-0/+1
(This is just the data structure changes and some boilerplate match code that followed from it; the actual emission of these statements comes in a follow-up commit.)
2018-05-24Revert "Ensure llvm doesn't trigger an assert for crazy transmutes"Oliver Schneider-2/+5
This reverts commit 776c632e2a9a044fd134321a9d561e28994ff3ff.
2018-05-24Ensure llvm doesn't trigger an assert for crazy transmutesOliver Schneider-5/+2
2018-05-24primval -> scalar renameOliver Schneider-8/+8
2018-05-24change `Value::Bytes` to `Value::Bits`Oliver Schneider-4/+6
2018-05-24Rename MemoryPointer to PointerOliver Schneider-2/+2
2018-05-24Eliminate the `Pointer` wrapper typeOliver Schneider-1/+1
2018-05-24Differentiate between interpret::Scalar and layout::ScalarOliver Schneider-6/+6
2018-05-24Rename ByVal(Pair) to Scalar(Pair)Oliver Schneider-3/+3
2018-05-24Rename PrimVal to ScalarOliver Schneider-6/+6
2018-05-24Auto merge of #50949 - eddyb:debuginfo, r=mwbors-23/+3
rustc_codegen_llvm: remove some debuginfo cruft. (The second commit passes tests locally but might not on older LLVM versions) r? @nikomatsakis
2018-05-22Use SortedMap instead of BTreeMap for relocations in MIRI.Michael Woerister-1/+1
2018-05-22Introduce AllocType which indicates what AllocIds point toJohn Kåre Alsaker-26/+22
2018-05-21rustc_codegen_llvm: remove closure env alloca hack around upvar debuginfo.Eduard-Mihai Burtescu-22/+2
2018-05-21rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable.Eduard-Mihai Burtescu-1/+1
2018-05-20Auto merge of #50841 - oli-obk:promote_errors_to_panics, r=eddybbors-2/+2
Don't lint numeric overflows in promoteds in release mode r? @eddyb mitigates #50814
2018-05-20Auto merge of #50803 - varkor:never-transmute-never, r=eddybbors-3/+14
Fix an ICE when attempting to transmute an uninhabited type Fixes https://github.com/rust-lang/rust/issues/50570.
2018-05-19Use `Size` instead of `u64` in mir interpretationOliver Schneider-5/+6
2018-05-19Go through an allocation when accessing fields of constantsOliver Schneider-4/+10
2018-05-19Ensure that statics are always ByRefOliver Schneider-46/+3
2018-05-19Add a test showing the erroneous promoted bugOliver Schneider-2/+2
2018-05-17Make sure the type we think is uninhabited actually isvarkor-1/+2
2018-05-17Fix an ICE when attempting to transmute an uninhabited typevarkor-3/+13
2018-05-17Rename trans to codegen everywhere.Irina Popa-0/+4147