about summary refs log tree commit diff
path: root/compiler/rustc_query_impl
AgeCommit message (Collapse)AuthorLines
2023-06-05Update field-offset and enable unstable_offset_ofest31-1/+3
This enables usage of the offset_of!() macro in the compiler, through the wrappers in memoffset and then in field-offset.
2023-05-26deps: bump cratesklensy-1/+1
update iana-time-zone-haiku to drop bumch of cxx* deps cargo update -p iana-time-zone-haiku Updating crates.io index Updating cc v1.0.77 -> v1.0.79 Removing codespan-reporting v0.11.1 Removing cxx v1.0.94 Removing cxx-build v1.0.94 Removing cxxbridge-flags v1.0.94 Removing cxxbridge-macro v1.0.94 Updating iana-time-zone-haiku v0.1.1 -> v0.1.2 Removing link-cplusplus v1.0.8 Removing scratch v1.0.5 fixes known issue https://github.com/crossbeam-rs/crossbeam/pull/972 cargo update -p crossbeam-channel Updating crates.io index Updating crossbeam-channel v0.5.6 -> v0.5.8 dedupes memoffset versions cargo update -p crossbeam-epoch Updating crates.io index Updating crossbeam-epoch v0.9.13 -> v0.9.14 Removing memoffset v0.7.1 dedupes bstr versions cargo update -p ignore -p opener Updating crates.io index Removing bstr v0.2.17 Updating globset v0.4.9 -> v0.4.10 Updating ignore v0.4.18 -> v0.4.20 Updating opener v0.5.0 -> v0.5.2
2023-05-21Add commentJohn Kåre Alsaker-0/+2
2023-05-21Replace `QueryStruct` with arrays local to `rustc_query_impl`John Kåre Alsaker-69/+72
2023-05-19Merge some query impl modules into oneJohn Kåre Alsaker-143/+125
2023-05-18Merge query property modules into oneJohn Kåre Alsaker-25/+25
2023-05-18Auto merge of #108938 - chenyukang:yukang/fix-107910-shorten-ice, r=cjgillotbors-35/+58
Shorten backtraces for queries in ICEs r? `@jyn514` Fixes #107910
2023-05-17Fix #107910, Shorten backtraces in ICEsyukang-35/+58
2023-05-17Finish move of query.rsJohn Kåre Alsaker-4/+3
2023-05-16Auto merge of #108062 - Zoxc:spec-incr, r=cjgillotbors-7/+37
Specialize query execution for incremental and non-incremental This specializes query execution for incremental and non-incremental by passing in a separate `dyn QueryEngine` types, taking advantage of the virtual dispatch to avoid a branch. This ends up duplicating `try_execute_query`, hopefully the compile time cost of that is relatively low. This is a performance improvement for the non-incremental path: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8420s</td><td align="right">1.8331s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2652s</td><td align="right">0.2631s</td><td align="right"> -0.78%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0161s</td><td align="right">1.0062s</td><td align="right"> -0.98%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6408s</td><td align="right">1.6197s</td><td align="right">💚 -1.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3939s</td><td align="right">6.3558s</td><td align="right"> -0.60%</td></tr><tr><td>Total</td><td align="right">11.1580s</td><td align="right">11.0780s</td><td align="right"> -0.72%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9918s</td><td align="right"> -0.82%</td></tr></table> The incremental path is more neutral: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.2210s</td><td align="right">2.2227s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3441s</td><td align="right">0.3443s</td><td align="right"> 0.05%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2919s</td><td align="right">1.2877s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0749s</td><td align="right">2.0721s</td><td align="right"> -0.14%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.9266s</td><td align="right">7.9206s</td><td align="right"> -0.07%</td></tr><tr><td>Total</td><td align="right">13.8585s</td><td align="right">13.8474s</td><td align="right"> -0.08%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9992s</td><td align="right"> -0.08%</td></tr></table> r? `@cjgillot`
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-3/+3
2023-05-14Specialize query execution for incremental and non-incrementalJohn Kåre Alsaker-7/+37
2023-04-30Use dynamic dispatch for queriesJohn Kåre Alsaker-162/+289
2023-04-26Remove QueryEngine traitJohn Kåre Alsaker-205/+144
2023-04-26Move on_disk_cache.rsJohn Kåre Alsaker-1064/+0
2023-04-26Auto merge of #110634 - saethlin:pointy-decoder, r=cjgillotbors-44/+12
Rewrite MemDecoder around pointers not a slice This is basically https://github.com/rust-lang/rust/pull/109910 but I'm being a lot more aggressive. The pointer-based structure means that it makes a lot more sense to absorb more complexity into `MemDecoder`, most of the diff is just complexity moving from one place to another. The primary argument for this structure is that we only incur a single bounds check when doing multi-byte reads from a `MemDecoder`. With the slice-based implementation we need to do those with `data[position..position + len]` , which needs to account for `position + len` wrapping. It would be possible to dodge the first bounds check if we stored a slice that starts at `position`, but that would require updating the pointer and length on every read. This PR also embeds the failure path in a separate function, which means that this PR should subsume all the perf wins observed in https://github.com/rust-lang/rust/pull/109867.
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-23Rewrite MemDecoder around pointers not a sliceBen Kimock-44/+12
2023-04-21Rollup merge of #110632 - saethlin:panic-if-dep-graph-too-big, r=lcnrDylan DPC-1/+1
Panic instead of truncating if the incremental on-disk cache is too big It seems _unlikely_ that anyone would hit this truncation, but if this `as` does actually truncate, that seems incredibly bad.
2023-04-20Panic instead of truncating if the dep graph is too bigBen Kimock-1/+1
2023-04-20Remove WithOptconstParam.Camille GILLOT-32/+1
2023-04-19Rollup merge of #110498 - kylematsuda:earlybinder-rpitit-tys, r=compiler-errorsMatthias Krüger-1/+3
Switch to `EarlyBinder` for `collect_return_position_impl_trait_in_trait_tys` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `collect_return_position_impl_trait_in_trait_tys` query and removes `bound_return_position_impl_trait_in_trait_tys`. r? `@lcnr`
2023-04-18add EarlyBinder to return type of ↵Kyle Matsuda-1/+3
collect_return_position_impl_trait_in_trait_tys query; remove bound_X version
2023-04-18Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillotbors-4/+5
Encode hashes as bytes, not varint In a few places, we store hashes as `u64` or `u128` and then apply `derive(Decodable, Encodable)` to the enclosing struct/enum. It is more efficient to encode hashes directly than try to apply some varint encoding. This PR adds two new types `Hash64` and `Hash128` which are produced by `StableHasher` and replace every use of storing a `u64` or `u128` that represents a hash. Distribution of the byte lengths of leb128 encodings, from `x build --stage 2` with `incremental = true` Before: ``` ( 1) 373418203 (53.7%, 53.7%): 1 ( 2) 196240113 (28.2%, 81.9%): 3 ( 3) 108157958 (15.6%, 97.5%): 2 ( 4) 17213120 ( 2.5%, 99.9%): 4 ( 5) 223614 ( 0.0%,100.0%): 9 ( 6) 216262 ( 0.0%,100.0%): 10 ( 7) 15447 ( 0.0%,100.0%): 5 ( 8) 3633 ( 0.0%,100.0%): 19 ( 9) 3030 ( 0.0%,100.0%): 8 ( 10) 1167 ( 0.0%,100.0%): 18 ( 11) 1032 ( 0.0%,100.0%): 7 ( 12) 1003 ( 0.0%,100.0%): 6 ( 13) 10 ( 0.0%,100.0%): 16 ( 14) 10 ( 0.0%,100.0%): 17 ( 15) 5 ( 0.0%,100.0%): 12 ( 16) 4 ( 0.0%,100.0%): 14 ``` After: ``` ( 1) 372939136 (53.7%, 53.7%): 1 ( 2) 196240140 (28.3%, 82.0%): 3 ( 3) 108014969 (15.6%, 97.5%): 2 ( 4) 17192375 ( 2.5%,100.0%): 4 ( 5) 435 ( 0.0%,100.0%): 5 ( 6) 83 ( 0.0%,100.0%): 18 ( 7) 79 ( 0.0%,100.0%): 10 ( 8) 50 ( 0.0%,100.0%): 9 ( 9) 6 ( 0.0%,100.0%): 19 ``` The remaining 9 or 10 and 18 or 19 are `u64` and `u128` respectively that have the high bits set. As far as I can tell these are coming primarily from `SwitchTargets`.
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-4/+5
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-15fix clippy::{clone_on_copy, useless_conversion}Matthias Krüger-1/+1
2023-04-06Auto merge of #110012 - matthiaskrgr:rollup-sgmm5xv, r=matthiaskrgrbors-2/+0
Rollup of 7 pull requests Successful merges: - #109395 (Fix issue when there are multiple candidates for edit_distance_with_substrings) - #109755 (Implement support for `GeneratorWitnessMIR` in new solver) - #109782 (Don't leave a comma at the start of argument list when removing arguments) - #109977 (rustdoc: avoid including line numbers in Google SERP snippets) - #109980 (Derive String's PartialEq implementation) - #109984 (Remove f32 & f64 from MemDecoder/MemEncoder) - #110004 (add `dont_check_failure_status` option in the compiler test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-06Remove f32 & f64 from MemDecoder/MemEncoderScott McMurray-2/+0
2023-04-06Address commentsJohn Kåre Alsaker-21/+12
2023-04-06Don't rely on `Debug` impl for `Erased`John Kåre Alsaker-1/+6
2023-04-06Erase query cache valuesJohn Kåre Alsaker-18/+55
2023-03-29Stabilize a portion of 'once_cell'Trevor Gross-1/+0
Move items not part of this stabilization to 'lazy_cell' or 'once_cell_try'
2023-03-25Update indexmap and rayon cratesJohn Kåre Alsaker-1/+1
2023-03-21AsLocalKey traitMichael Goulet-1/+1
2023-03-21Use local key in providersMichael Goulet-9/+9
2023-03-11Ensure value is on the on-disk cache before returning.Camille GILLOT-3/+35
2023-03-07Auto merge of #108167 - Zoxc:query-config-instance-slim, r=cjgillotbors-44/+90
Make `rustc_query_system` take `QueryConfig` by instance. This allows for easy switching between virtual tables and specialized instances for queries. It also has the benefit of less turbofish. `QueryStorage` has also been merged with `QueryCache`. Split out from https://github.com/rust-lang/rust/pull/107937. r? `@cjgillot`
2023-03-03Match unmatched backticks in comments in compiler/est31-1/+1
2023-02-26Derive Default for query structsJohn Kåre Alsaker-9/+1
2023-02-26Avoid implementing Debug for QueryConfigJohn Kåre Alsaker-1/+1
2023-02-26Make `rustc_query_system` take `QueryConfig` by instance.John Kåre Alsaker-44/+98
2023-02-25Move `ensure_sufficient_stack` to `try_execute_query` callersJohn Kåre Alsaker-3/+1
2023-02-21Upgrade `thin-vec` from 0.2.9 to 0.2.12.Nicholas Nethercote-1/+1
Because 0.2.10 added supports for `ThinVec::splice`, and 0.2.12 is the latest release.
2023-02-17Auto merge of #108058 - Zoxc:query-ctxtx-byval, r=cjgillotbors-13/+13
Pass `DepContext` and `QueryContext` by value when practical This removes some indirections for a minor performance improvement. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8294s</td><td align="right">1.8255s</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2667s</td><td align="right">0.2669s</td><td align="right"> 0.07%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0080s</td><td align="right">1.0063s</td><td align="right"> -0.17%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6335s</td><td align="right">1.6295s</td><td align="right"> -0.24%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3633s</td><td align="right">6.3344s</td><td align="right"> -0.45%</td></tr><tr><td>Total</td><td align="right">11.1009s</td><td align="right">11.0627s</td><td align="right"> -0.34%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9980s</td><td align="right"> -0.20%</td></tr></table>
2023-02-16Move provider fields back to rustc_query_implJohn Kåre Alsaker-10/+17
2023-02-16Factor query arena allocation out from query cachesJohn Kåre Alsaker-31/+40
2023-02-14Pass `DepContext` and `QueryContext` by value when practicalJohn Kåre Alsaker-13/+13
2023-02-09Simplify `tls::enter_context`.Nicholas Nethercote-1/+1
2023-02-06remove unused importsklensy-1/+0