about summary refs log tree commit diff
path: root/src/librustc_index
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-2453/+0
2020-08-15Auto merge of #75537 - tmiasko:match-branch-simplify, r=oli-obkbors-0/+11
MatchBranchSimplification: fix equal const bool assignments The match branch simplification is applied when target blocks contain statements that are either equal or perform a const bool assignment with different values to the same place. Previously, when constructing new statements, only statements from a single block had been examined. This lead to a misoptimization when statements are equal because the assign the *same* const bool value to the same place. Fix the issue by examining statements from both blocks when deciding on replacement. Additionally: * Copy discriminant instead of moving it since it might be necessary to use its value more than once. * Optimize when switching on copy operand Based on #75508. r? @oli-obk / @JulianKnodt
2020-08-15MatchBranchSimplification: avoid intermediate vec allocationTomasz Miąsko-0/+11
2020-08-14Rework `rustc_serialize`Matthew Jasper-15/+29
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-08-04mir: use `FiniteBitSet<u32>` in polymorphizationDavid Wood-0/+24
This commit changes polymorphization to return a `FiniteBitSet<u32>` rather than a `FiniteBitSet<u64>` because most functions do not use anywhere near sixty-four generic parameters so keeping a `u64` around is unnecessary in most cases. Signed-off-by: David Wood <david@davidtw.co>
2020-07-21Auto merge of #69749 - davidtwco:issue-46477-polymorphization, r=eddybbors-0/+136
Polymorphization This PR implements an analysis to detect when functions could remain polymorphic during code generation. Fixes #46477 r? @eddyb cc @rust-lang/wg-mir-opt @nikomatsakis @pnkfelix
2020-07-20index: introduce and use `FiniteBitSet`David Wood-0/+136
This commit introduces a `FiniteBitSet` type which replaces the manual bit manipulation which was being performed in polymorphization. Signed-off-by: David Wood <david@davidtw.co>
2020-07-20Auto merge of #74010 - pierwill:pierwill-o-notation, r=GuillaumeGomezbors-1/+1
Use italics for O notation In documentation, I think it makes sense to italicize O notation (*O(n)*) as opposed to using back-ticks (`O(n)`). Visually, back-ticks focus the reader on the literal characters being used, making them ideal for representing code. Using italics, as far I can tell, more closely follows typographic conventions in mathematics and computer science. Just a suggestion, of course! 😇
2020-07-19Use italics for O notationpierwill-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-07-16apply bootstrap cfgsMark Rousskov-1/+0
2020-07-14Use `ArrayVec` in `SparseBitSet`.Nicholas Nethercote-7/+6
Instead of `SmallVec`, because the maximum size is known.
2020-06-29add spans to injected coverage countersRich Kadel-1/+2
added regions with counter expressions and counters. Added codegen_llvm/coverageinfo mod for upcoming coverage map Move coverage region collection to CodegenCx finalization Moved from `query coverageinfo` (renamed from `query coverage_data`), as discussed in the PR at: https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503 Address merge conflict in MIR instrument_coverage test The MIR test output format changed for int types. moved debug messages out of block.rs This makes the block.rs calls to add coverage mapping data to the CodegenCx much more concise and readable. move coverage intrinsic handling into llvm impl I realized that having half of the coverage intrinsic handling in `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any non-llvm backend would be bound to the same decisions about how the coverage-related MIR terminators should be handled. To fix this, I moved the non-codegen portion of coverage intrinsic handling into its own trait, and implemented it in `rustc_codegen_llvm` alongside `codegen_intrinsic_call`. I also added the (required?) stubs for the new intrinsics to `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do not fail if called with these new but known intrinsics. address PR Feedback on 28 June 2020 2:48pm PDT
2020-06-28Remove `const_if_match` feature gate from librariesDylan MacKenzie-1/+1
2020-06-24Improve GeneratorLayout debug outputTyler Mandry-1/+17
2020-06-02Make things build againVadim Petrochenkov-1/+1
2020-05-29Add Extend::{extend_one,extend_reserve}Josh Stone-0/+11
This adds new optional methods on `Extend`: `extend_one` add a single element to the collection, and `extend_reserve` pre-allocates space for the predicted number of incoming elements. These are used in `Iterator` for `partition` and `unzip` as they shuffle elements one-at-a-time into their respective collections.
2020-04-08Redesign the Step traitCAD97-26/+6
2020-04-07Use assoc integer constants in librustc_*Linus Färnstrand-1/+1
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+0
2020-03-17Add requisite feature gates for const assertDylan MacKenzie-0/+3
2020-03-17Rename `from_u32_const` -> `from_u32`Dylan MacKenzie-1/+1
2020-03-17Make `newtype_index` methods constDylan MacKenzie-24/+6
2020-02-29mem::zeroed/uninit: panic on types that do not permit zero-initializationRalf Jung-1/+1
2020-02-06index ReEmpty by universeNiko Matsakis-0/+8
We now make `'empty` indexed by a universe index, resulting in a region lattice like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` Therefore, `exists<A> { forall<B> { B: A } }` is now unprovable, because A must be at least Empty(U1) and B is placeholder(U2), and hence the two regions are unrelated.
2020-01-06Improve hygiene of `newtype_index`Matthew Jasper-20/+74
Also add unit tests
2019-12-22Format the worldMark Rousskov-85/+73
2019-11-04bump smallvec to 1.0Ralf Jung-1/+1
2019-10-18doc: make BitSet intro more shortTshepang Lekhonkhobe-2/+5
Also, add a link to the growable type
2019-10-16Optimize `BitSet` iteration.Nicholas Nethercote-13/+31
This commit removes an `Option` check in `BitIter::next()`, avoids calling `trailing_zeros()` when it's not necessary, and avoids the need for `enumerate()`. This gives a tiny (0.2%) instruction count win on a couple of benchmarks. The commit also adds some comments, which is good because this iteration code is moderately complex.
2019-10-16Add `BitIter::new()`.Nicholas Nethercote-10/+13
This factors out some duplicated code.
2019-10-01Fix clippy warningsYuki Okushi-1/+1
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-2/+2
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-0/+1
2019-09-29move bit_set into rustc_indexcsmoe-0/+1355
2019-09-29move index_vec into rustc_indexcsmoe-0/+836
2019-09-29init librustc_index cratecsmoe-0/+12