Skip to content
  1. May 20, 2016
    • Quentin Colombet's avatar
      [RegBankSelect] Get rid of a now dead method: setSafeInsertPoint. · 4f147a54
      Quentin Colombet authored
      This is now encapsulated in the RepairingPlacement class.
      
      llvm-svn: 270247
      4f147a54
    • Quentin Colombet's avatar
      [RegBankSelect] Take advantage of a potential best cost information in · 6e80dbcd
      Quentin Colombet authored
      computeMapping.
      
      Computing the cost of a mapping takes some time.
      Since in Fast mode, the cost is irrelevant, just spare some cycles by not
      computing it.
      In Greedy mode, we need to choose the best cost, that means that when
      the local cost gets more expensive than the best cost, we can stop
      computing the repairing and cost for the current mapping.
      
      llvm-svn: 270245
      6e80dbcd
    • Quentin Colombet's avatar
      [RegBankSelect] Use frequency and probability information to compute · 25fcef73
      Quentin Colombet authored
      more precise cost in Greedy mode.
      
      In Fast mode the cost is irrelevant so do not bother requiring that
      those passes get scheduled.
      
      llvm-svn: 270244
      25fcef73
    • Quentin Colombet's avatar
      a5530128
    • Quentin Colombet's avatar
      [RegBankSelect] Specify different optimization mode for the pass. · 46df722e
      Quentin Colombet authored
      The mode should be choose by the target when instantiating the pass.
      
      llvm-svn: 270235
      46df722e
    • Krzysztof Parzyszek's avatar
      Fix error reporting in register scavenger (lack of emergency spill slot) · 64439ac7
      Krzysztof Parzyszek authored
      - Do not store Twine objects.
      - Remove report_fatal_error, since llvm_unreachable does terminate the
        program in release mode.
      
      llvm-svn: 270233
      64439ac7
    • Quentin Colombet's avatar
      [RegBankSelect] Add a method to avoid splitting while repairing. · f75c2bfc
      Quentin Colombet authored
      The previous choice of the insertion points for repairing was
      straightfoward but may introduce some basic block or edge splitting. In
      some situation this is something we can avoid.
      For instance, when repairing a phi argument, instead of placing the
      repairing on the related incoming edge, we may move it to the previous
      block, before the terminators. This is only possible when the argument
      is not defined by one of the terminator.
      
      llvm-svn: 270232
      f75c2bfc
    • Krzysztof Parzyszek's avatar
      Correction to r270219: fix detection of invalid frame index · ce6f3bde
      Krzysztof Parzyszek authored
      llvm-svn: 270220
      ce6f3bde
    • Krzysztof Parzyszek's avatar
    • Diana Picus's avatar
      Fix some comment typos in SelectionDAGBuilder. NFC · 86f1f4ca
      Diana Picus authored
      llvm-svn: 270190
      86f1f4ca
    • Quentin Colombet's avatar
      [RegBankSelect] Refactor the code to split the repairing and mapping of · d84d00ba
      Quentin Colombet authored
      an instruction.
      
      Use the previously introduced RepairingPlacement class to split the code
      computing the repairing placement from the code doing the actual
      placement. That way, we will be able to consider different placement and
      then, only apply the best one.
      
      llvm-svn: 270168
      d84d00ba
    • Quentin Colombet's avatar
      [RegBankSelect] Add helper class for repairing code placement. · 55650754
      Quentin Colombet authored
      When assigning the register banks we may have to insert repairing code
      to move already assigned values accross register banks.
      
      Introduce a few helper classes to keep track of what is involved in the
      repairing of an operand:
      - InsertPoint and its derived classes record the positions, in the CFG,
        where repairing has to be inserted.
      - RepairingPlacement holds all the insert points for the repairing of an
        operand plus the kind of action that is required to do the repairing.
      
      This is going to be used to keep track of how the repairing should be
      done, while comparing different solutions for an instruction. Indeed, we
      will need the repairing placement to capture the cost of a solution and
      we do not want to compute it a second time when we do the actual
      repairing.
      
      llvm-svn: 270167
      55650754
    • Quentin Colombet's avatar
      [RegBankSelect] Refactor assignmentMatch to avoid testing the current · 0d77da4e
      Quentin Colombet authored
      register bank twice.
      
      Prior to this change, we were checking if the assignment for the current
      machine operand was matching, then we would check if the mismatch
      requires to insert repair code.
      We actually already have this information from the first check, so just
      pass it along.
      
      NFCI.
      
      llvm-svn: 270166
      0d77da4e
    • Rafael Espindola's avatar
      Fix pr27728. · 78d947b4
      Rafael Espindola authored
      Sorry for the lack testcase. There is one in the pr, but it depends on
      std::sort and the .ll version is 110 lines, so I don't think it is
      wort it.
      
      The bug was that we were sorting after adding a terminator, and the
      sorting algorithm could end up putting the terminator in the middle of
      the List vector.
      
      With that we would create a Spans map entry keyed on nullptr which would
      then be added to CUs and fail in that sorting.
      
      llvm-svn: 270165
      78d947b4
    • Quentin Colombet's avatar
      [RegBankSelect] Introduce MappingCost helper class. · cfd97b93
      Quentin Colombet authored
      This helper class will be used to represent the cost of mapping an
      instruction to a specific register bank.
      The particularity of these costs is that they are mostly local, thus the
      frequency of the basic block is irrelevant. However, for few
      instructions (e.g., phis and terminators), the cost may be non-local and
      then, we need to account for the frequency of the involved basic blocks.
      
      This will be used by the greedy mode I am working on.
      
      llvm-svn: 270163
      cfd97b93
    • Rafael Espindola's avatar
      clang-format. NFC. · 0a78f8c4
      Rafael Espindola authored
      llvm-svn: 270156
      0a78f8c4
    • Quentin Colombet's avatar
      Reapply r263460: [SpillPlacement] Fix a quadratic behavior in spill placement. · b926bdac
      Quentin Colombet authored
      Using Chandler's words from r265331:
      This commit was greatly exacerbating PR17409 and effectively regressed
      build time for lot of (very large) code when compiled with ASan or MSan.
      
      PR17409 is fixed by r269249, so this is fine to reapply r263460.
      
      Original commit message:
      The bad behavior happens when we have a function with a long linear
      chain of basic blocks, and have a live range spanning most of this
      chain, but with very few uses.
      
      Let say we have only 2 uses.
      
      The Hopfield network is only seeded with two active blocks where the
      uses are, and each iteration of the outer loop in
      `RAGreedy::growRegion()` only adds two new nodes to the network due to
      the completely linear shape of the CFG.  Meanwhile,
      `SpillPlacer->iterate()` visits the whole set of discovered nodes, which
      adds up to a quadratic algorithm.
      
      This is an historical accident effect from r129188.
      
      When the Hopfield network is expanding, most of the action is happening
      on the frontier where new nodes are being added. The internal nodes in
      the network are not likely to be flip-flopping much, or they will at
      least settle down very quickly. This means that while
      `SpillPlacer->iterate()` is recomputing all the nodes in the network, it
      is probably only the two frontier nodes that are changing their output.
      
      Instead of recomputing the whole network on each iteration, we can
      maintain a SparseSet of nodes that need to be updated:
      
      - `SpillPlacement::activate()` adds the node to the todo list.
      - When a node changes value (i.e., `update()` returns true), its
        neighbors are added to the todo list.
      - `SpillPlacement::iterate()` only updates the nodes in the list.
      
      The result of Hopfield iterations is not necessarily exact. It should
      converge to a local minimum, but there is no guarantee that it will find
      a global minimum. It is possible that updating nodes in a different
      order will cause us to switch to a different local minimum. In other
      words, this is not NFC, but although I saw a few runtime improvements
      and regressions when I benchmarked this change, those were side effects
      and actually the performance change is in the noise as expected.
      
      Huge thanks to Jakob Stoklund Olesen <stoklund@2pi.dk> for his
      feedbacks, guidance and time for the review.
      
      llvm-svn: 270149
      b926bdac
  2. May 19, 2016
  3. May 18, 2016
  4. May 17, 2016
  5. May 16, 2016
    • Rafael Espindola's avatar
      Fail early on unknown appending linkage variables. · e64619ce
      Rafael Espindola authored
      In practice only a few well known appending linkage variables work.
      
      Currently if codegen sees an unknown appending linkage variable it will
      just print it as a regular global. That is wrong as the symbol in the
      produced object file has different semantics as the one provided by the
      appending linkage.
      
      This just errors early instead of producing a broken .o.
      
      llvm-svn: 269706
      e64619ce
    • Matt Arsenault's avatar
      SelectionDAG: Select min/max when both are used · c31a9d06
      Matt Arsenault authored
      Allow two users of the condition if the other user
      is also a min/max select. i.e.
      
      %c = icmp slt i32 %x, %y
      %min = select i1 %c, i32 %x, i32 %y
      %max = select i1 %c, i32 %y, i32 %x
      
      llvm-svn: 269699
      c31a9d06
    • Chad Rosier's avatar
      Remove extra whitespace. NFC. · 1cb56a18
      Chad Rosier authored
      llvm-svn: 269685
      1cb56a18
Loading