Skip to content
  1. Oct 10, 2013
  2. Oct 08, 2013
  3. Sep 11, 2013
  4. Aug 15, 2013
    • Mark Lacey's avatar
      Track new virtual registers by register number. · f9ea8854
      Mark Lacey authored
      Track new virtual registers by register number, rather than by the live
      interval created for them. This is the first step in separating the
      creation of new virtual registers and new live intervals.  Eventually
      live intervals will be created and populated on demand after the virtual
      registers have been created and used in instructions.
      
      llvm-svn: 188434
      f9ea8854
  5. Jul 30, 2013
  6. Jul 25, 2013
    • Andrew Trick's avatar
      RegAllocGreedy comment. · f4b1ee34
      Andrew Trick authored
      llvm-svn: 187141
      f4b1ee34
    • Andrew Trick's avatar
      Evict local live ranges if they can be reassigned. · 8bb0a251
      Andrew Trick authored
      The previous change to local live range allocation also suppressed
      eviction of local ranges. In rare cases, this could result in more
      expensive register choices. This commit actually revives a feature
      that I added long ago: check if live ranges can be reassigned before
      eviction. But now it only happens in rare cases of evicting a local
      live range because another local live range wants a cheaper register.
      
      The benefit is improved code size for some benchmarks on x86 and armv7.
      
      I measured no significant compile time increase and performance
      changes are noise.
      
      llvm-svn: 187140
      8bb0a251
    • Andrew Trick's avatar
      Allocate local registers in order for optimal coloring. · 8485257d
      Andrew Trick authored
      Also avoid locals evicting locals just because they want a cheaper register.
      
      Problem: MI Sched knows exactly how many registers we have and assumes
      they can be colored. In cases where we have large blocks, usually from
      unrolled loops, greedy coloring fails. This is a source of
      "regressions" from the MI Scheduler on x86. I noticed this issue on
      x86 where we have long chains of two-address defs in the same live
      range. It's easy to see this in matrix multiplication benchmarks like
      IRSmk and even the unit test misched-matmul.ll.
      
      A fundamental difference between the LLVM register allocator and
      conventional graph coloring is that in our model a live range can't
      discover its neighbors, it can only verify its neighbors. That's why
      we initially went for greedy coloring and added eviction to deal with
      the hard cases. However, for singly defined and two-address live
      ranges, we can optimally color without visiting neighbors simply by
      processing the live ranges in instruction order.
      
      Other beneficial side effects:
      
      It is much easier to understand and debug regalloc for large blocks
      when the live ranges are allocated in order. Yes, global allocation is
      still very confusing, but it's nice to be able to comprehend what
      happened locally.
      
      Heuristics could be added to bias register assignment based on
      instruction locality (think late register pairing, banks...).
      
      Intuituvely this will make some test cases that are on the threshold
      of register pressure more stable.
      
      llvm-svn: 187139
      8485257d
    • Andrew Trick's avatar
      Dump LIS before regalloc. MI sched changes them. · 9706496b
      Andrew Trick authored
      llvm-svn: 187107
      9706496b
  7. Jul 16, 2013
    • Jakob Stoklund Olesen's avatar
      Remove floats from live range splitting costs. · efeb3a19
      Jakob Stoklund Olesen authored
      These floats all represented block frequencies anyway, so just use the
      BlockFrequency class directly.
      
      Some floating point computations remain in tryLocalSplit(). They are
      estimating spill weights which are still floats.
      
      llvm-svn: 186435
      efeb3a19
  8. 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
  9. 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
  10. Apr 12, 2013
  11. Mar 05, 2013
  12. Jan 12, 2013
  13. Dec 04, 2012
  14. 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
  15. 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
  16. Sep 21, 2012
  17. Sep 12, 2012
  18. Aug 22, 2012
  19. 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
  20. 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
  21. 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
  22. Jun 06, 2012
  23. 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
  24. 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
  25. May 24, 2012
  26. May 19, 2012
  27. Apr 03, 2012
  28. Mar 04, 2012
  29. 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
  30. Feb 15, 2012
  31. Feb 11, 2012
Loading