Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/llvm-project
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 40618a2340ac2939b3dc320a9fe1133fa5caa345
Choose a base ref
...
head repository: rust-lang/llvm-project
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bbf96c9f18aa47770c4f571f714d8641ddbe86e9
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Mar 5, 2021

  1. [Loads] Extract helper frunction for available load/store (NFC)

    This contains the logic for extracting an available load/store
    from a given instruction, to be reused in a following patch.
    
    (cherry picked from commit 7c706aa)
    nikic committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    11ff00e View commit details
    Browse the repository at this point in the history
  2. [Loads] Add optimized FindAvailableLoadedValue() overload (NFCI)

    FindAvailableLoadedValue() accepts an iterator by reference. If no
    available value is found, then the iterator will either be left
    at a clobbering instruction or the beginning of the basic block.
    This allows using FindAvailableLoadedValue() across multiple blocks.
    
    If this functionality is not needed, as is the case in InstCombine,
    then we can use a much more efficient implementation: First try
    to find an available value, and only perform clobber checks if
    we actually found one. As this function only looks at a very small
    number of instructions (6 by default) and usually doesn't find an
    available value, this saves many expensive alias analysis queries.
    
    (cherry picked from commit e0615bc)
    nikic committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    ba1987d View commit details
    Browse the repository at this point in the history
  3. [LICM] Make promotion faster

    Even when MemorySSA-based LICM is used, an AST is still populated
    for scalar promotion. As the AST has quadratic complexity, a lot
    of time is spent in this step despite the existing access count
    limit. This patch optimizes the identification of promotable stores.
    
    The idea here is pretty simple: We're only interested in must-alias
    mod sets of loop invariant pointers. As such, only populate the AST
    with loop-invariant loads and stores (anything else is definitely
    not promotable) and then discard any sets which alias with any of
    the remaining, definitely non-promotable accesses.
    
    If we promoted something, check whether this has made some other
    accesses loop invariant and thus possible promotion candidates.
    
    This is much faster in practice, because we need to perform AA
    queries for O(NumPromotable^2 + NumPromotable*NumNonPromotable)
    instead of O(NumTotal^2), and NumPromotable tends to be small.
    Additionally, promotable accesses have loop invariant pointers,
    for which AA is cheaper.
    
    This has a signicant positive compile-time impact. We save ~1.8%
    geomean on CTMark at O3, with 6% on lencod in particular and 25%
    on individual files.
    
    Conceptually, this change is NFC, but may not be so in practice,
    because the AST is only an approximation, and can produce
    different results depending on the order in which accesses are
    added. However, there is at least no impact on the number of promotions
    (licm.NumPromoted) in test-suite O3 configuration with this change.
    
    Differential Revision: https://reviews.llvm.org/D89264
    
    (cherry picked from commit 3d8f842)
    nikic committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    a7c6317 View commit details
    Browse the repository at this point in the history
  4. [AST] Remove unused Loop member (NFC)

    To fix some build bots after D89264.
    
    (cherry picked from commit 29034f3)
    nikic committed Mar 5, 2021
    Configuration menu
    Copy the full SHA
    bbf96c9 View commit details
    Browse the repository at this point in the history
Loading