Skip to content
  1. Jul 22, 2015
  2. Jun 23, 2015
  3. Jun 19, 2015
  4. Jan 19, 2015
    • Chandler Carruth's avatar
      [PM] Remove the Pass argument from all of the critical edge splitting · 37df2cfb
      Chandler Carruth authored
      APIs and replace it and numerous booleans with an option struct.
      
      The critical edge splitting API has a really large surface of flags and
      so it seems worth burning a small option struct / builder. This struct
      can be constructed with the various preserved analyses and then flags
      can be flipped in a builder style.
      
      The various users are now responsible for directly passing along their
      analysis information. This should be enough for the critical edge
      splitting to work cleanly with the new pass manager as well.
      
      This API is still pretty crufty and could be cleaned up a lot, but I've
      focused on this change just threading an option struct rather than
      a pass through the API.
      
      llvm-svn: 226456
      37df2cfb
    • Chandler Carruth's avatar
      [PM] Relax asserts and always try to reconstruct loop simplify form when · ad34d913
      Chandler Carruth authored
      we can while splitting critical edges.
      
      The only code which called this and didn't require simplified loops to
      be preserved is polly, and the code behaves correctly there anyways.
      Without this change, it becomes really hard to share this code with the
      new pass manager where things like preserving loop simplify form don't
      make any sense.
      
      If anyone discovers this code behaving incorrectly, what it *should* be
      testing for is whether the loops it needs to be in simplified form are
      in fact in that form. It should always be trying to preserve that form
      when it exists.
      
      llvm-svn: 226443
      ad34d913
  5. Jan 18, 2015
    • Chandler Carruth's avatar
      [PM] Pull the analyses used for another utility routine into its API · b5797b65
      Chandler Carruth authored
      rather than relying on the pass object.
      
      This one is a bit annoying, but will pay off. First, supporting this one
      will make the next one much easier, and for utilities like LoopSimplify,
      this is moving them (slowly) closer to not having to pass the pass
      object around throughout their APIs.
      
      llvm-svn: 226396
      b5797b65
    • Chandler Carruth's avatar
      [PM] Now that LoopInfo isn't in the Pass type hierarchy, it is much · 691addc2
      Chandler Carruth authored
      cleaner to derive from the generic base.
      
      Thise removes a ton of boiler plate code and somewhat strange and
      pointless indirections. It also remove a bunch of the previously needed
      friend declarations. To fully remove these, I also lifted the verify
      logic into the generic LoopInfoBase, which seems good anyways -- it is
      generic and useful logic even for the machine side.
      
      llvm-svn: 226385
      691addc2
  6. Jan 17, 2015
  7. Nov 19, 2014
    • Kostya Serebryany's avatar
      Introduce llvm::SplitAllCriticalEdges · e5ea424a
      Kostya Serebryany authored
      Summary:
      move the code from BreakCriticalEdges::runOnFunction()
      into a separate utility function llvm::SplitAllCriticalEdges()
      so that it can be used independently.
      No functionality change intended.
      
      Test Plan: check-llvm
      
      Reviewers: nlewycky
      
      Reviewed By: nlewycky
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6313
      
      llvm-svn: 222288
      e5ea424a
  8. Jul 21, 2014
  9. Jul 20, 2014
  10. Apr 25, 2014
  11. Apr 22, 2014
    • Chandler Carruth's avatar
      [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE · 964daaaf
      Chandler Carruth authored
      definition below all of the header #include lines, lib/Transforms/...
      edition.
      
      This one is tricky for two reasons. We again have a couple of passes
      that define something else before the includes as well. I've sunk their
      name macros with the DEBUG_TYPE.
      
      Also, InstCombine contains headers that need DEBUG_TYPE, so now those
      headers #define and #undef DEBUG_TYPE around their code, leaving them
      well formed modular headers. Fixing these headers was a large motivation
      for all of these changes, as "leaky" macros of this form are hard on the
      modules implementation.
      
      llvm-svn: 206844
      964daaaf
  12. Mar 05, 2014
  13. Mar 04, 2014
  14. Jan 29, 2014
    • Chandler Carruth's avatar
      [LPM] Fix PR18643, another scary place where loop transforms failed to · d4be9dc0
      Chandler Carruth authored
      preserve loop simplify of enclosing loops.
      
      The problem here starts with LoopRotation which ends up cloning code out
      of the latch into the new preheader it is buidling. This can create
      a new edge from the preheader into the exit block of the loop which
      breaks LoopSimplify form. The code tries to fix this by splitting the
      critical edge between the latch and the exit block to get a new exit
      block that only the latch dominates. This sadly isn't sufficient.
      
      The exit block may be an exit block for multiple nested loops. When we
      clone an edge from the latch of the inner loop to the new preheader
      being built in the outer loop, we create an exiting edge from the outer
      loop to this exit block. Despite breaking the LoopSimplify form for the
      inner loop, this is fine for the outer loop. However, when we split the
      edge from the inner loop to the exit block, we create a new block which
      is in neither the inner nor outer loop as the new exit block. This is
      a predecessor to the old exit block, and so the split itself takes the
      outer loop out of LoopSimplify form. We need to split every edge
      entering the exit block from inside a loop nested more deeply than the
      exit block in order to preserve all of the loop simplify constraints.
      
      Once we try to do that, a problem with splitting critical edges
      surfaces. Previously, we tried a very brute force to update LoopSimplify
      form by re-computing it for all exit blocks. We don't need to do this,
      and doing this much will sometimes but not always overlap with the
      LoopRotate bug fix. Instead, the code needs to specifically handle the
      cases which can start to violate LoopSimplify -- they aren't that
      common. We need to see if the destination of the split edge was a loop
      exit block in simplified form for the loop of the source of the edge.
      For this to be true, all the predecessors need to be in the exact same
      loop as the source of the edge being split. If the dest block was
      originally in this form, we have to split all of the deges back into
      this loop to recover it. The old mechanism of doing this was
      conservatively correct because at least *one* of the exiting blocks it
      rewrote was the DestBB and so the DestBB's predecessors were fixed. But
      this is a much more targeted way of doing it. Making it targeted is
      important, because ballooning the set of edges touched prevents
      LoopRotate from being able to split edges *it* needs to split to
      preserve loop simplify in a coherent way -- the critical edge splitting
      would sometimes find the other edges in need of splitting but not
      others.
      
      Many, *many* thanks for help from Nick reducing these test cases
      mightily. And helping lots with the analysis here as this one was quite
      tricky to track down.
      
      llvm-svn: 200393
      d4be9dc0
  15. Jan 13, 2014
    • Chandler Carruth's avatar
      [PM] Split DominatorTree into a concrete analysis result object which · 73523021
      Chandler Carruth authored
      can be used by both the new pass manager and the old.
      
      This removes it from any of the virtual mess of the pass interfaces and
      lets it derive cleanly from the DominatorTreeBase<> template. In turn,
      tons of boilerplate interface can be nuked and it turns into a very
      straightforward extension of the base DominatorTree interface.
      
      The old analysis pass is now a simple wrapper. The names and style of
      this split should match the split between CallGraph and
      CallGraphWrapperPass. All of the users of DominatorTree have been
      updated to match using many of the same tricks as with CallGraph. The
      goal is that the common type remains the resulting DominatorTree rather
      than the pass. This will make subsequent work toward the new pass
      manager significantly easier.
      
      Also in numerous places things became cleaner because I switched from
      re-running the pass (!!! mid way through some other passes run!!!) to
      directly recomputing the domtree.
      
      llvm-svn: 199104
      73523021
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
  16. Oct 02, 2013
    • Chandler Carruth's avatar
      Remove the very substantial, largely unmaintained legacy PGO · ea564946
      Chandler Carruth authored
      infrastructure.
      
      This was essentially work toward PGO based on a design that had several
      flaws, partially dating from a time when LLVM had a different
      architecture, and with an effort to modernize it abandoned without being
      completed. Since then, it has bitrotted for several years further. The
      result is nearly unusable, and isn't helping any of the modern PGO
      efforts. Instead, it is getting in the way, adding confusion about PGO
      in LLVM and distracting everyone with maintenance on essentially dead
      code. Removing it paves the way for modern efforts around PGO.
      
      Among other effects, this removes the last of the runtime libraries from
      LLVM. Those are being developed in the separate 'compiler-rt' project
      now, with somewhat different licensing specifically more approriate for
      runtimes.
      
      llvm-svn: 191835
      ea564946
  17. Jul 27, 2013
  18. Jan 02, 2013
    • Chandler Carruth's avatar
      Move all of the header files which are involved in modelling the LLVM IR · 9fb823bb
      Chandler Carruth authored
      into their new header subdirectory: include/llvm/IR. This matches the
      directory structure of lib, and begins to correct a long standing point
      of file layout clutter in LLVM.
      
      There are still more header files to move here, but I wanted to handle
      them in separate commits to make tracking what files make sense at each
      layer easier.
      
      The only really questionable files here are the target intrinsic
      tablegen files. But that's a battle I'd rather not fight today.
      
      I've updated both CMake and Makefile build systems (I think, and my
      tests think, but I may have missed something).
      
      I've also re-sorted the includes throughout the project. I'll be
      committing updates to Clang, DragonEgg, and Polly momentarily.
      
      llvm-svn: 171366
      9fb823bb
  19. Dec 03, 2012
    • Chandler Carruth's avatar
      Use the new script to sort the includes of every file under lib. · ed0881b2
      Chandler Carruth authored
      Sooooo many of these had incorrect or strange main module includes.
      I have manually inspected all of these, and fixed the main module
      include to be the nearest plausible thing I could find. If you own or
      care about any of these source files, I encourage you to take some time
      and check that these edits were sensible. I can't have broken anything
      (I strictly added headers, and reordered them, never removed), but they
      may not be the headers you'd really like to identify as containing the
      API being implemented.
      
      Many forward declarations and missing includes were added to a header
      files to allow them to parse cleanly when included first. The main
      module rule does in fact have its merits. =]
      
      llvm-svn: 169131
      ed0881b2
  20. Sep 27, 2012
  21. Apr 30, 2012
    • Bill Wendling's avatar
      Second attempt at PR12573: · bf4b9afb
      Bill Wendling authored
      Allow the "SplitCriticalEdge" function to split the edge to a landing pad. If
      the pass is *sure* that it thinks it knows what it's doing, then it may go ahead
      and specify that the landing pad can have its critical edge split. The loop
      unswitch pass is one of these passes. It will split the critical edges of all
      edges coming from a loop to a landing pad not within the loop. Doing so will
      retain important loop analysis information, such as loop simplify.
      
      llvm-svn: 155817
      bf4b9afb
    • Bill Wendling's avatar
      Use an ArrayRef instead of explicit vector type. · 325e6cd9
      Bill Wendling authored
      llvm-svn: 155816
      325e6cd9
  22. Dec 09, 2011
  23. Oct 04, 2011
  24. Sep 21, 2011
    • Bill Wendling's avatar
      Relax this condition. · a6e1c51e
      Bill Wendling authored
      Some passes require breaking critical edges before they're called. Don't
      segfault because of that.
      
      llvm-svn: 140196
      a6e1c51e
  25. Aug 17, 2011
  26. Jul 20, 2011
  27. Jun 23, 2011
  28. Jun 21, 2011
  29. Jun 20, 2011
    • Jay Foad's avatar
      Change how PHINodes store their operands. · e03c05c3
      Jay Foad authored
      Change PHINodes to store simple pointers to their incoming basic blocks,
      instead of full-blown Uses.
      
      Note that this loses an optimization in SplitCriticalEdge(), because we
      can no longer walk the use list of a BasicBlock to find phi nodes. See
      the comment I removed starting "However, the foreach loop is slow for
      blocks with lots of predecessors".
      
      Extend replaceAllUsesWith() on a BasicBlock to also update any phi
      nodes in the block's successors. This mimics what would have happened
      when PHINodes were proper Users of their incoming blocks. (Note that
      this only works if OldBB->replaceAllUsesWith(NewBB) is called when
      OldBB still has a terminator instruction, so it still has some
      successors.)
      
      llvm-svn: 133435
      e03c05c3
  30. May 17, 2011
  31. Apr 15, 2011
  32. Mar 30, 2011
Loading