-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rework the queries for the MIR pipeline #41625
rework the queries for the MIR pipeline #41625
Commits on May 2, 2017
-
Each MIR key is a DefId that has MIR associated with it
Configuration menu - View commit details
-
Copy full SHA for 0e5e2f3 - Browse repository at this point
Copy the full SHA 0e5e2f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11b6b06 - Browse repository at this point
Copy the full SHA 11b6b06View commit details -
simplify the MirPass traits and passes dramatically
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).
Configuration menu - View commit details
-
Copy full SHA for 46b342f - Browse repository at this point
Copy the full SHA 46b342fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9e6ccc - Browse repository at this point
Copy the full SHA e9e6cccView commit details -
rewrite
Passes
to have sets of passesAlso, store the completed set of passes in the tcx.
Configuration menu - View commit details
-
Copy full SHA for 668886a - Browse repository at this point
Copy the full SHA 668886aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f23a7bc - Browse repository at this point
Copy the full SHA f23a7bcView commit details -
The new setup is as follows. There is a pipeline of MIR passes that each run **per def-id** to optimize a particular function. You are intended to request MIR at whatever stage you need it. At the moment, there is only one stage you can request: - `optimized_mir(def_id)` This yields the final product. Internally, it pulls the MIR for the given def-id through a series of steps. Right now, these are still using an "interned ref-cell" but they are intended to "steal" from one another: - `mir_build` -- performs the initial construction for local MIR - `mir_pass_set` -- performs a suite of optimizations and transformations - `mir_pass` -- an individual optimization within a suite So, to construct the optimized MIR, we invoke: mir_pass_set((MIR_OPTIMIZED, def_id)) which will build up the final MIR.
Configuration menu - View commit details
-
Copy full SHA for 2b32cb9 - Browse repository at this point
Copy the full SHA 2b32cb9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e89a321 - Browse repository at this point
Copy the full SHA e89a321View commit details -
introduce idea of "stealable" MIR
This is a more principled version of the `RefCell` we were using before. We now allocate a `Steal<Mir<'tcx>>` for each intermediate MIR pass; when the next pass steals the entry, any later attempts to use it will panic (there is no way to *test* if MIR is stolen, you're just supposed to *know*).
Configuration menu - View commit details
-
Copy full SHA for 29263fd - Browse repository at this point
Copy the full SHA 29263fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for ecc8ff9 - Browse repository at this point
Copy the full SHA ecc8ff9View commit details -
introduce
IntoKeyValues
trait to prepare for multi-queriesThe idea is that such queries will return `FxHashMap`
Configuration menu - View commit details
-
Copy full SHA for 3d1095c - Browse repository at this point
Copy the full SHA 3d1095cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1d675ce - Browse repository at this point
Copy the full SHA 1d675ceView commit details -
convert the
inline
pass to use the new multi resultThis involves changing various details about that system, though the basic shape remains the same.
Configuration menu - View commit details
-
Copy full SHA for a26e966 - Browse repository at this point
Copy the full SHA a26e966View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d045d7 - Browse repository at this point
Copy the full SHA 0d045d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d9c8a2b - Browse repository at this point
Copy the full SHA d9c8a2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 532439f - Browse repository at this point
Copy the full SHA 532439fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c1ff104 - Browse repository at this point
Copy the full SHA c1ff104View commit details -
Configuration menu - View commit details
-
Copy full SHA for c2cfdbb - Browse repository at this point
Copy the full SHA c2cfdbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 69c8f9d - Browse repository at this point
Copy the full SHA 69c8f9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c253df5 - Browse repository at this point
Copy the full SHA c253df5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c154a6 - Browse repository at this point
Copy the full SHA 9c154a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 669d316 - Browse repository at this point
Copy the full SHA 669d316View commit details -
support inlining by asking for optimizer mir for callees
I tested this with it enabled 100% of the time, and we were able to run mir-opt tests successfully.
Configuration menu - View commit details
-
Copy full SHA for 1dd9c3e - Browse repository at this point
Copy the full SHA 1dd9c3eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 851a880 - Browse repository at this point
Copy the full SHA 851a880View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2fa1ba3 - Browse repository at this point
Copy the full SHA 2fa1ba3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74b2783 - Browse repository at this point
Copy the full SHA 74b2783View commit details -
Configuration menu - View commit details
-
Copy full SHA for c7023d1 - Browse repository at this point
Copy the full SHA c7023d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 393fa4f - Browse repository at this point
Copy the full SHA 393fa4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b0092e8 - Browse repository at this point
Copy the full SHA b0092e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0afcfce - Browse repository at this point
Copy the full SHA 0afcfceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 15bc2f4 - Browse repository at this point
Copy the full SHA 15bc2f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for e6793ac - Browse repository at this point
Copy the full SHA e6793acView commit details -
Configuration menu - View commit details
-
Copy full SHA for afc5acd - Browse repository at this point
Copy the full SHA afc5acdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 25be798 - Browse repository at this point
Copy the full SHA 25be798View commit details -
1
Configuration menu - View commit details
-
Copy full SHA for 488b2a3 - Browse repository at this point
Copy the full SHA 488b2a3View commit details