1. 16 7月, 2018 1 次提交
  2. 12 7月, 2018 1 次提交
  3. 17 5月, 2018 1 次提交
  4. 26 12月, 2017 2 次提交
  5. 06 12月, 2017 1 次提交
  6. 08 10月, 2017 1 次提交
    • A
      rustc: Don't inline in CGUs at -O0 · 4b2bdf7b
      Alex Crichton 提交于
      This commit tweaks the behavior of inlining functions into multiple codegen
      units when rustc is compiling in debug mode. Today rustc will unconditionally
      treat `#[inline]` functions by translating them into all codegen units that
      they're needed within, marking the linkage as `internal`. This commit changes
      the behavior so that in debug mode (compiling at `-O0`) rustc will instead only
      translate `#[inline]` functions into *one* codegen unit, forcing all other
      codegen units to reference this one copy.
      
      The goal here is to improve debug compile times by reducing the amount of
      translation that happens on behalf of multiple codegen units. It was discovered
      in #44941 that increasing the number of codegen units had the adverse side
      effect of increasing the overal work done by the compiler, and the suspicion
      here was that the compiler was inlining, translating, and codegen'ing more
      functions with more codegen units (for example `String` would be basically
      inlined into all codegen units if used). The strategy in this commit should
      reduce the cost of `#[inline]` functions to being equivalent to one codegen
      unit, which is only translating and codegen'ing inline functions once.
      
      Collected [data] shows that this does indeed improve the situation from [before]
      as the overall cpu-clock time increases at a much slower rate and when pinned to
      one core rustc does not consume significantly more wall clock time than with one
      codegen unit.
      
      One caveat of this commit is that the symbol names for inlined functions that
      are only translated once needed some slight tweaking. These inline functions
      could be translated into multiple crates and we need to make sure the symbols
      don't collideA so the crate name/disambiguator is mixed in to the symbol name
      hash in these situations.
      
      [data]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334880911
      [before]: https://github.com/rust-lang/rust/issues/44941#issuecomment-334583384
      4b2bdf7b
  7. 07 10月, 2017 1 次提交
    • A
      rustc: Implement ThinLTO · 4ca1b19f
      Alex Crichton 提交于
      This commit is an implementation of LLVM's ThinLTO for consumption in rustc
      itself. Currently today LTO works by merging all relevant LLVM modules into one
      and then running optimization passes. "Thin" LTO operates differently by having
      more sharded work and allowing parallelism opportunities between optimizing
      codegen units. Further down the road Thin LTO also allows *incremental* LTO
      which should enable even faster release builds without compromising on the
      performance we have today.
      
      This commit uses a `-Z thinlto` flag to gate whether ThinLTO is enabled. It then
      also implements two forms of ThinLTO:
      
      * In one mode we'll *only* perform ThinLTO over the codegen units produced in a
        single compilation. That is, we won't load upstream rlibs, but we'll instead
        just perform ThinLTO amongst all codegen units produced by the compiler for
        the local crate. This is intended to emulate a desired end point where we have
        codegen units turned on by default for all crates and ThinLTO allows us to do
        this without performance loss.
      
      * In anther mode, like full LTO today, we'll optimize all upstream dependencies
        in "thin" mode. Unlike today, however, this LTO step is fully parallelized so
        should finish much more quickly.
      
      There's a good bit of comments about what the implementation is doing and where
      it came from, but the tl;dr; is that currently most of the support here is
      copied from upstream LLVM. This code duplication is done for a number of
      reasons:
      
      * Controlling parallelism means we can use the existing jobserver support to
        avoid overloading machines.
      * We will likely want a slightly different form of incremental caching which
        integrates with our own incremental strategy, but this is yet to be
        determined.
      * This buys us some flexibility about when/where we run ThinLTO, as well as
        having it tailored to fit our needs for the time being.
      * Finally this allows us to reuse some artifacts such as our `TargetMachine`
        creation, where all our options we used today aren't necessarily supported by
        upstream LLVM yet.
      
      My hope is that we can get some experience with this copy/paste in tree and then
      eventually upstream some work to LLVM itself to avoid the duplication while
      still ensuring our needs are met. Otherwise I fear that maintaining these
      bindings may be quite costly over the years with LLVM updates!
      4ca1b19f
  8. 18 3月, 2017 1 次提交
    • A
      translate drop glue using MIR · f2c79174
      Ariel Ben-Yehuda 提交于
      Drop of arrays is now translated in trans::block in an ugly way that I
      should clean up in a later PR, and does not handle panics in the middle
      of an array drop, but this commit & PR are growing too big.
      f2c79174
  9. 29 4月, 2016 1 次提交
  10. 15 4月, 2016 1 次提交
  11. 26 3月, 2016 1 次提交
  12. 26 1月, 2016 1 次提交
    • M
      Implement the translation item collector. · 862911df
      Michael Woerister 提交于
      The purpose of the translation item collector is to find all monomorphic instances of functions, methods and statics that need to be translated into LLVM IR in order to compile the current crate.
      So far these instances have been discovered lazily during the trans path. For incremental compilation we want to know the set of these instances in advance, and that is what the trans::collect module provides.
      In the future, incremental and regular translation will be driven by the collector implemented here.
      862911df