Skip to content
  1. Oct 27, 2011
  2. Oct 26, 2011
    • Duncan Sands's avatar
      Simplify SplitVecRes_UnaryOp by removing all the code that is · dce448c6
      Duncan Sands authored
      trying to legalize the operand types when only the result type
      is required to be legalized - the type legalization machinery
      will get round to the operands later if they need legalizing.
      There can be a point to legalizing operands in parallel with
      the result: when this saves compile time or results in better
      code.  There was only one case in which this was true: when
      the operand is also split, so keep the logic for that bit.
      As a result of this change, additional operand legalization
      methods may need to be introduced to handle nodes where the
      result and operand types can differ, like SIGN_EXTEND, but
      the testsuite doesn't contain any tests where this is the case.
      In any case, it seems better to require such methods (and die
      with an assert if they doesn't exist) than to quietly produce
      wrong code if we forgot to special case the node in
      SplitVecRes_UnaryOp.
      
      llvm-svn: 143026
      dce448c6
    • Jakob Stoklund Olesen's avatar
      Don't use floating point to do an integer's job. · e8261a22
      Jakob Stoklund Olesen authored
      This code makes different decisions when compiled into x87 instructions
      because of different rounding behavior.  That caused phase 2/3
      miscompares on 32-bit Linux when the phase 1 compiler was built with gcc
      (using x87), and the phase 2 compiler was built with clang (using SSE).
      
      This fixes PR11200.
      
      llvm-svn: 143006
      e8261a22
    • Evan Cheng's avatar
      Disable LICM speculation in high register pressure situation again now that... · 7313337c
      Evan Cheng authored
      Disable LICM speculation in high register pressure situation again now that Devang has fixed other issues.
      
      llvm-svn: 143003
      7313337c
    • Bill Wendling's avatar
      Reapply r142920 with fix: · 9b993222
      Bill Wendling authored
      An MBB which branches to an EH landing pad shouldn't be considered for tail merging.
      
      In SjLj EH, the jump to the landing pad is not done explicitly through a branch
      statement. The EH landing pad is added as a successor to the throwing
      BB. Because of that however, the branch folding pass could mistakenly think that
      it could merge the throwing BB with another BB. This isn't safe to do.
      <rdar://problem/10334833>
      
      llvm-svn: 143001
      9b993222
  3. Oct 25, 2011
  4. Oct 24, 2011
  5. Oct 23, 2011
    • Chandler Carruth's avatar
      Now that we have comparison on probabilities, add some static functions · fd7475e9
      Chandler Carruth authored
      to get important constant branch probabilities and use them for finding
      the best branch out of a set of possibilities.
      
      llvm-svn: 142762
      fd7475e9
    • Chandler Carruth's avatar
      Remove a commented out line of code that snuck by my auditing. · 446210b6
      Chandler Carruth authored
      llvm-svn: 142761
      446210b6
    • Chandler Carruth's avatar
      Completely re-write the algorithm behind MachineBlockPlacement based on · bd1be4d0
      Chandler Carruth authored
      discussions with Andy. Fundamentally, the previous algorithm is both
      counter productive on several fronts and prioritizing things which
      aren't necessarily the most important: static branch prediction.
      
      The new algorithm uses the existing loop CFG structure information to
      walk through the CFG itself to layout blocks. It coalesces adjacent
      blocks within the loop where the CFG allows based on the most likely
      path taken. Finally, it topologically orders the block chains that have
      been formed. This allows it to choose a (mostly) topologically valid
      ordering which still priorizes fallthrough within the structural
      constraints.
      
      As a final twist in the algorithm, it does violate the CFG when it
      discovers a "hot" edge, that is an edge that is more than 4x hotter than
      the competing edges in the CFG. These are forcibly merged into
      a fallthrough chain.
      
      Future transformations that need te be added are rotation of loop exit
      conditions to be fallthrough, and better isolation of cold block chains.
      I'm also planning on adding statistics to model how well the algorithm
      does at laying out blocks based on the probabilities it receives.
      
      The old tests mostly still pass, and I have some new tests to add, but
      the nested loops are still behaving very strangely. This almost seems
      like working-as-intended as it rotated the exit branch to be
      fallthrough, but I'm not convinced this is actually the best layout. It
      is well supported by the probabilities for loops we currently get, but
      those are pretty broken for nested loops, so this may change later.
      
      llvm-svn: 142743
      bd1be4d0
  6. Oct 22, 2011
  7. Oct 21, 2011
    • Nadav Rotem's avatar
      Fix pr11194. When promoting and splitting integers we need to use · 5e00bb5f
      Nadav Rotem authored
      ZExtPromotedInteger and SExtPromotedInteger based on the operation we legalize.
      
      SetCC return type needs to be legalized via PromoteTargetBoolean.
      
      llvm-svn: 142660
      5e00bb5f
    • Nadav Rotem's avatar
      1. Fix the widening of SETCC in WidenVecOp_SETCC. Use the correct return CC type. · d315157f
      Nadav Rotem authored
      2. Fix a typo in CONCAT_VECTORS which exposed the bug in #1.
      
      llvm-svn: 142648
      d315157f
    • Chandler Carruth's avatar
      Add loop aligning to MachineBlockPlacement based on review discussion so · 8b9737cb
      Chandler Carruth authored
      it's a bit more plausible to use this instead of CodePlacementOpt. The
      code for this was shamelessly stolen from CodePlacementOpt, and then
      trimmed down a bit. There doesn't seem to be much utility in returning
      true/false from this pass as we may or may not have rewritten all of the
      blocks. Also, the statistic of counting how many loops were aligned
      doesn't seem terribly important so I removed it. If folks would like it
      to be included, I'm happy to add it back.
      
      This was probably the most egregious of the missing features, and now
      I'm going to start gathering some performance numbers and looking at
      specific loop structures that have different layout between the two.
      
      Test is updated to include both basic loop alignment and nested loop
      alignment.
      
      llvm-svn: 142645
      8b9737cb
    • Chandler Carruth's avatar
      Implement a block placement pass based on the branch probability and · 10281425
      Chandler Carruth authored
      block frequency analyses. This differs substantially from the existing
      block-placement pass in LLVM:
      
      1) It operates on the Machine-IR in the CodeGen layer. This exposes much
         more (and more precise) information and opportunities. Also, the
         results are more stable due to fewer transforms ocurring after the
         pass runs.
      2) It uses the generalized probability and frequency analyses. These can
         model static heuristics, code annotation derived heuristics as well
         as eventual profile loading. By basing the optimization on the
         analysis interface it can work from any (or a combination) of these
         inputs.
      3) It uses a more aggressive algorithm, both building chains from tho
         bottom up to maximize benefit, and using an SCC-based walk to layout
         chains of blocks in a profitable ordering without O(N^2) iterations
         which the old pass involves.
      
      The pass is currently gated behind a flag, and not enabled by default
      because it still needs to grow some important features. Most notably, it
      needs to support loop aligning and careful layout of loop structures
      much as done by hand currently in CodePlacementOpt. Once it supports
      these, and has sufficient testing and quality tuning, it should replace
      both of these passes.
      
      Thanks to Nick Lewycky and Richard Smith for help authoring & debugging
      this, and to Jakob, Andy, Eric, Jim, and probably a few others I'm
      forgetting for reviewing and answering all my questions. Writing
      a backend pass is *sooo* much better now than it used to be. =D
      
      llvm-svn: 142641
      10281425
    • Chandler Carruth's avatar
      Remove a now dead function, fixing -Wunused-function warnings from · 00115378
      Chandler Carruth authored
      Clang.
      
      llvm-svn: 142631
      00115378
  8. Oct 20, 2011
  9. Oct 19, 2011
Loading