Skip to content
  1. Jun 17, 2013
    • Benjamin Kramer's avatar
      Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo. · e2a1d89e
      Benjamin Kramer authored
      The main advantages here are way better heuristics, taking into account not
      just loop depth but also __builtin_expect and other static heuristics and will
      eventually learn how to use profile info. Most of the work in this patch is
      pushing the MachineBlockFrequencyInfo analysis into the right places.
      
      This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
      unfortunate spilling decisions in its hottest loop in longest_match(). Other
      benchmarks I tried were mostly neutral.
      
      This changes register allocation in subtle ways, update the tests for it.
      2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
      it looked for was gone already (but the FileCheck pattern picked up unrelated
      stuff).
      
      llvm-svn: 184105
      e2a1d89e
  2. May 15, 2013
    • David Blaikie's avatar
      Use only explicit bool conversion operators · 041f1aa3
      David Blaikie authored
      BitVector/SmallBitVector::reference::operator bool remain implicit since
      they model more exactly a bool, rather than something else that can be
      boolean tested.
      
      The most common (non-buggy) case are where such objects are used as
      return expressions in bool-returning functions or as boolean function
      arguments. In those cases I've used (& added if necessary) a named
      function to provide the equivalent (or sometimes negative, depending on
      convenient wording) test.
      
      One behavior change (YAMLParser) was made, though no test case is
      included as I'm not sure how to reach that code path. Essentially any
      comparison of llvm::yaml::document_iterators would be invalid if neither
      iterator was at the end.
      
      This helped uncover a couple of bugs in Clang - test cases provided for
      those in a separate commit along with similar changes to `operator bool`
      instances in Clang.
      
      llvm-svn: 181868
      041f1aa3
  3. Apr 12, 2013
  4. Mar 05, 2013
  5. Jan 12, 2013
  6. Dec 04, 2012
  7. 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
  8. Nov 28, 2012
    • Jakob Stoklund Olesen's avatar
      Make the LiveRegMatrix analysis available to targets. · 26c9d70d
      Jakob Stoklund Olesen authored
      No functional change, just moved header files.
      
      Targets can inject custom passes between register allocation and
      rewriting. This makes it possible to tweak the register allocation
      before rewriting, using the full global interference checking available
      from LiveRegMatrix.
      
      llvm-svn: 168806
      26c9d70d
  9. Sep 21, 2012
  10. Sep 12, 2012
  11. Aug 22, 2012
  12. Aug 21, 2012
    • David Blaikie's avatar
      Remove unnecessary cast that was also unnecessarily casting away constness. · 9c7226b4
      David Blaikie authored
      Even looking at the revision history I couldn't quite piece together why this
      cast was ever written in the first place, but I assume it was because of some
      change in the inheritance, perhaps this function was reimplemented in a
      derived type & this caller was meant to get the base version (& it wasn't
      virtual)?
      
      llvm-svn: 162301
      9c7226b4
  13. Jun 21, 2012
    • Jakob Stoklund Olesen's avatar
      Remove LiveIntervalUnions from RegAllocBase. · 2d2dec96
      Jakob Stoklund Olesen authored
      They are living in LiveRegMatrix now.
      
      llvm-svn: 158868
      2d2dec96
    • Jakob Stoklund Olesen's avatar
      Convert RAGreedy to LiveRegMatrix interference checking. · 96eebf0b
      Jakob Stoklund Olesen authored
      Stop depending on the LiveIntervalUnions in RegAllocBase, they are about
      to be removed.
      
      The changes are mostly replacing register alias iterators with regunit
      iterators, and querying LiveRegMatrix instrad of RegAllocBase.
      
      InterferenceCache is converted to work with per-regunit
      LiveIntervalUnions, and it checks fixed regunit interference separately,
      using the fixed live intervals provided by LiveIntervalAnalysis.
      
      The local splitting helper calcGapWeights() is also considering fixed
      regunit interference which is kept on the side now.
      
      llvm-svn: 158867
      96eebf0b
  14. Jun 09, 2012
    • Jakob Stoklund Olesen's avatar
      Also compute MBB live-in lists in the new rewriter pass. · be336295
      Jakob Stoklund Olesen authored
      This deduplicates some code from the optimizing register allocators, and
      it means that it is now possible to change the register allocators'
      solutions simply by editing the VirtRegMap between the register
      allocator pass and the rewriter.
      
      llvm-svn: 158249
      be336295
    • Jakob Stoklund Olesen's avatar
      Reintroduce VirtRegRewriter. · 1224312f
      Jakob Stoklund Olesen authored
      OK, not really. We don't want to reintroduce the old rewriter hacks.
      
      This patch extracts virtual register rewriting as a separate pass that
      runs after the register allocator. This is possible now that
      CodeGen/Passes.cpp can configure the full optimizing register allocator
      pipeline.
      
      The rewriter pass uses register assignments in VirtRegMap to rewrite
      virtual registers to physical registers, and it inserts kill flags based
      on live intervals.
      
      These finalization steps are the same for the optimizing register
      allocators: RABasic, RAGreedy, and PBQP.
      
      llvm-svn: 158244
      1224312f
  15. Jun 06, 2012
  16. Jun 02, 2012
    • Jakob Stoklund Olesen's avatar
      Switch all register list clients to the new MC*Iterator interface. · 54038d79
      Jakob Stoklund Olesen authored
      No functional change intended.
      
      Sorry for the churn. The iterator classes are supposed to help avoid
      giant commits like this one in the future. The TableGen-produced
      register lists are getting quite large, and it may be necessary to
      change the table representation.
      
      This makes it possible to do so without changing all clients (again).
      
      llvm-svn: 157854
      54038d79
  17. May 30, 2012
    • Jakob Stoklund Olesen's avatar
      Prioritize smaller register classes for urgent evictions. · 05e2245f
      Jakob Stoklund Olesen authored
      It helps compile exotic inline asm. In the test case, normal GR32
      virtual registers use up eax-edx so the final GR32_ABCD live range has
      no registers left. Since all the live ranges were tiny, we had no way of
      prioritizing the smaller register class.
      
      This patch allows tiny unspillable live ranges to be evicted by tiny
      unspillable live ranges from a smaller register class.
      
      <rdar://problem/11542429>
      
      llvm-svn: 157715
      05e2245f
  18. May 24, 2012
  19. May 19, 2012
  20. Apr 03, 2012
  21. Mar 04, 2012
  22. Feb 21, 2012
    • Andrew Trick's avatar
      Clear virtual registers after they are no longer referenced. · da84e646
      Andrew Trick authored
      Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
      This makes sharing code for pre/postRA passes more robust.
      Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
      To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().
      
      PEI resets virtual regs when it's done scavenging.
      
      PTX will either have to provide its own PEI pass or assign physregs.
      
      llvm-svn: 151032
      da84e646
  23. Feb 15, 2012
  24. Feb 11, 2012
  25. Feb 10, 2012
    • Jakob Stoklund Olesen's avatar
      Add register mask support to InterferenceCache. · a16ae597
      Jakob Stoklund Olesen authored
      This makes global live range splitting behave identically with and
      without register mask operands.
      
      This is not necessarily the best way of using register masks for live
      range splitting.  It would be more efficient to first split global live
      ranges around calls (i.e., register masks), and reserve the fine grained
      per-physreg interference guidance for global live ranges that do not
      cross calls.
      
      For now the goal is to produce identical assembly when enabling register
      masks.
      
      llvm-svn: 150259
      a16ae597
    • Andrew Trick's avatar
      RegAlloc superpass: includes phi elimination, coalescing, and scheduling. · d3f8fe81
      Andrew Trick authored
      Creates a configurable regalloc pipeline.
      
      Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.
      
      When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.
      
      CodeGen transformation passes are never "required" as an analysis
      
      ProcessImplicitDefs does not require LiveVariables.
      
      We have a plan to massively simplify some of the early passes within the regalloc superpass.
      
      llvm-svn: 150226
      d3f8fe81
  26. Feb 09, 2012
  27. Jan 17, 2012
  28. Jan 13, 2012
  29. Jan 12, 2012
  30. Nov 13, 2011
  31. Nov 01, 2011
Loading