Skip to content
  1. Apr 28, 2014
    • Chandler Carruth's avatar
      Fix rampant quadratic behavior in UpdatePHINodes. The operation of · 5bdf72ce
      Chandler Carruth authored
      mapping from a basic block to an incoming value, either for removal or
      just lookup, is linear in the number of predecessors, and we were doing
      this for every entry in the 'Preds' list which is in many cases almost
      all of them!
      
      Unfortunately, the fixes are quite ugly. PHI nodes just don't make this
      operation easy. The efficient way to fix this is to have a clever
      'remove_if' operation on PHI nodes that lets us do a single pass over
      all the incoming values of the original PHI node, extracting the ones we
      care about. Then we could quickly construct the new phi node from this
      list. This would remove the remaining underlying quadratic movement of
      unrelated incoming values and the need for silly backwards looping to
      "minimize" how often we hit the quadratic case.
      
      This is the last obvious fix for PR19499. It shaves another 20% off the
      compile time for me, and while UpdatePHINodes remains in the profile,
      most of the time is now stemming from the well known inefficiencies of
      LVI and jump threading.
      
      llvm-svn: 207409
      5bdf72ce
    • Craig Topper's avatar
      [C++] Use 'nullptr'. · e73658dd
      Craig Topper authored
      llvm-svn: 207394
      e73658dd
  2. Apr 25, 2014
  3. Mar 19, 2014
  4. Mar 04, 2014
  5. 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
  6. Dec 23, 2013
  7. Dec 19, 2013
  8. Oct 05, 2013
    • Hal Finkel's avatar
      UpdatePHINodes in BasicBlockUtils should not crash on duplicate predecessors · f5a3eaea
      Hal Finkel authored
      UpdatePHINodes has an optimization to reuse an existing PHI node, where it
      first deletes all of its entries and then replaces them. Unfortunately, in the
      case where we had duplicate predecessors (which are allowed so long as the
      associated PHI entries have the same value), the loop removing the existing PHI
      entries from the to-be-reused PHI would assert (if that PHI was not the one
      which had the duplicates).
      
      llvm-svn: 192001
      f5a3eaea
  9. Oct 01, 2013
  10. Aug 06, 2013
  11. Jul 27, 2013
  12. Jul 04, 2013
  13. Jan 15, 2013
  14. 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
  15. 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
  16. Oct 19, 2012
  17. Oct 08, 2012
  18. Aug 29, 2012
    • Benjamin Kramer's avatar
      Make MemoryBuiltins aware of TargetLibraryInfo. · 8bcc9711
      Benjamin Kramer authored
      This disables malloc-specific optimization when -fno-builtin (or -ffreestanding)
      is specified. This has been a problem for a long time but became more severe
      with the recent memory builtin improvements.
      
      Since the memory builtin functions are used everywhere, this required passing
      TLI in many places. This means that functions that now have an optional TLI
      argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead
      mallocs anymore if the TLI argument is missing. I've updated most passes to do
      the right thing.
      
      Fixes PR13694 and probably others.
      
      llvm-svn: 162841
      8bcc9711
  19. Jul 27, 2012
  20. Jun 25, 2012
  21. Jan 17, 2012
  22. Dec 09, 2011
  23. Aug 24, 2011
  24. Aug 20, 2011
  25. Aug 19, 2011
    • Bill Wendling's avatar
      Add SplitLandingPadPredecessors(). · ca7d3096
      Bill Wendling authored
      SplitLandingPadPredecessors is similar to SplitBlockPredecessors in that it
      splits the current block and attaches a set of predecessors to the new basic
      block. However, it differs from SplitBlockPredecessors in that it's specifically
      designed to handle landing pad blocks.
      
      Two new basic blocks are created: one that is has the vector of predecessors as
      its predecessors and one that has the remaining predecessors as its
      predecessors. Those two new blocks then receive a cloned copy of the landingpad
      instruction from the original block. The landingpad instructions are joined in a
      PHI, etc. Like SplitBlockPredecessors, it updates the LLVM IR, AliasAnalysis,
      DominatorTree, DominanceFrontier, LoopInfo, and LCCSA analyses.
      
      llvm-svn: 138014
      ca7d3096
  26. Aug 18, 2011
  27. Aug 17, 2011
  28. Jun 23, 2011
  29. Jun 21, 2011
  30. 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
  31. May 02, 2011
  32. Apr 30, 2011
  33. Mar 30, 2011
Loading