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. Jun 16, 2013
    • David Blaikie's avatar
      Debug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions · 0252265b
      David Blaikie authored
      Rather than using the full power of target-specific addressing modes in
      DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This
      reduces the complexity of debug info handling down to two
      representations of values (reg+offset and frame index+offset) rather
      than three or four.
      
      Ideally we could ensure that frame indicies had been eliminated by the
      time we reached an assembly or dwarf generation, but I haven't spent the
      time to figure out where the FIs are leaking through into that & whether
      there's a good place to convert them. Some FI+offset=>reg+offset
      conversion is done (see PrologEpilogInserter, for example) which is
      necessary for some SelectionDAG assumptions about registers, I believe,
      but it might be possible to make this a more thorough conversion &
      ensure there are no remaining FIs no matter how instruction selection
      is performed.
      
      llvm-svn: 184066
      0252265b
  3. May 23, 2013
  4. May 05, 2013
  5. 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
  6. 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
  7. Sep 12, 2012
  8. Sep 01, 2012
  9. Jul 14, 2012
  10. Jun 16, 2012
  11. Jun 06, 2012
  12. May 20, 2012
  13. Apr 03, 2012
  14. Mar 01, 2012
    • Jakob Stoklund Olesen's avatar
      Make InlineSpiller bundle-aware. · abe8c09b
      Jakob Stoklund Olesen authored
      Simply treat bundles as instructions. Spill code is inserted between
      bundles, never inside a bundle.  Rewrite all operands in a bundle at
      once.
      
      Don't attempt and memory operand folding inside bundles.
      
      llvm-svn: 151787
      abe8c09b
  15. Feb 04, 2012
    • Jakob Stoklund Olesen's avatar
      Don't store COPY pointers in VNInfo. · ad6b22eb
      Jakob Stoklund Olesen authored
      If a value is defined by a COPY, that instuction can easily and cheaply
      be found by getInstructionFromIndex(VNI->def).
      
      This reduces the size of VNInfo from 24 to 16 bytes, and improves
      llc compile time by 3%.
      
      llvm-svn: 149763
      ad6b22eb
  16. Dec 12, 2011
  17. Dec 07, 2011
    • Evan Cheng's avatar
      Add bundle aware API for querying instruction properties and switch the code · 7f8e563a
      Evan Cheng authored
      generator to it. For non-bundle instructions, these behave exactly the same
      as the MC layer API.
      
      For properties like mayLoad / mayStore, look into the bundle and if any of the
      bundled instructions has the property it would return true.
      For properties like isPredicable, only return true if *all* of the bundled
      instructions have the property.
      For properties like canFoldAsLoad, isCompare, conservatively return false for
      bundles.
      
      llvm-svn: 146026
      7f8e563a
  18. Nov 14, 2011
  19. Nov 13, 2011
    • Jakob Stoklund Olesen's avatar
      Terminate all dead defs at the dead slot instead of the 'next' slot. · d8f2405e
      Jakob Stoklund Olesen authored
      This makes no difference for normal defs, but early clobber dead defs
      now look like:
      
        [Slot_EarlyClobber; Slot_Dead)
      
      instead of:
      
        [Slot_EarlyClobber; Slot_Register).
      
      Live ranges for normal dead defs look like:
      
        [Slot_Register; Slot_Dead)
      
      as before.
      
      llvm-svn: 144512
      d8f2405e
    • Jakob Stoklund Olesen's avatar
      Rename SlotIndexes to match how they are used. · 90b5e565
      Jakob Stoklund Olesen authored
      The old naming scheme (load/use/def/store) can be traced back to an old
      linear scan article, but the names don't match how slots are actually
      used.
      
      The load and store slots are not needed after the deferred spill code
      insertion framework was deleted.
      
      The use and def slots don't make any sense because we are using
      half-open intervals as is customary in C code, but the names suggest
      closed intervals.  In reality, these slots were used to distinguish
      early-clobber defs from normal defs.
      
      The new naming scheme also has 4 slots, but the names match how the
      slots are really used.  This is a purely mechanical renaming, but some
      of the code makes a lot more sense now.
      
      llvm-svn: 144503
      90b5e565
    • Jakob Stoklund Olesen's avatar
      Stop tracking spill slot uses in VirtRegMap. · 28df7ef8
      Jakob Stoklund Olesen authored
      Nobody cared, StackSlotColoring scans the instructions to find used stack
      slots.
      
      llvm-svn: 144485
      28df7ef8
  20. Nov 10, 2011
    • Jakob Stoklund Olesen's avatar
      Strip old implicit operands after foldMemoryOperand. · eef48b69
      Jakob Stoklund Olesen authored
      The TII.foldMemoryOperand hook preserves implicit operands from the
      original instruction.  This is not what we want when those implicit
      operands refer to the register being spilled.
      
      Implicit operands referring to other registers are preserved.
      
      This fixes PR11347.
      
      llvm-svn: 144247
      eef48b69
  21. Oct 14, 2011
    • Jakob Stoklund Olesen's avatar
      Add value numbers when spilling dead defs. · 7fb5632e
      Jakob Stoklund Olesen authored
      When spilling around an instruction with a dead def, remember to add a
      value number for the def.
      
      The missing value number wouldn't normally create problems since there
      would be an incoming live range as well.  However, due to another bug
      we could spill a dead V_SET0 instruction which doesn't read any values.
      
      The missing value number caused an empty live range to be created which
      is dangerous since it doesn't interfere with anything.
      
      This fixes part of PR11125.
      
      llvm-svn: 141923
      7fb5632e
  22. Sep 16, 2011
  23. Sep 15, 2011
    • Jakob Stoklund Olesen's avatar
      Add an option to disable spill hoisting. · bceb9e5c
      Jakob Stoklund Olesen authored
      When -split-spill-mode is enabled, spill hoisting is performed by
      SplitKit instead of by InlineSpiller.  This hidden command line option
      is for testing the splitter spill mode.
      
      llvm-svn: 139845
      bceb9e5c
    • Jakob Stoklund Olesen's avatar
      Count correctly when a COPY turns into a spill or reload. · c94c9676
      Jakob Stoklund Olesen authored
      The number of spills could go negative since a folded COPY is just a
      spill, and it may be eliminated.
      
      llvm-svn: 139815
      c94c9676
    • Jakob Stoklund Olesen's avatar
      Count inserted spills and reloads more accurately. · 37eb6962
      Jakob Stoklund Olesen authored
      Adjust counters when removing spill and reload instructions.
      
      We still don't account for reloads being removed by eliminateDeadDefs().
      
      llvm-svn: 139806
      37eb6962
    • Jakob Stoklund Olesen's avatar
      Trace through sibling PHIs in bulk. · 07b3503f
      Jakob Stoklund Olesen authored
      When traceSiblingValue() encounters a PHI-def value created by live
      range splitting, don't look at all the predecessor blocks.  That can be
      very expensive in a complicated CFG.
      
      Instead, consider that all the non-PHI defs jointly dominate all the
      PHI-defs.  Tracing directly to all the non-PHI defs is much faster that
      zipping around in the CFG when there are many PHIs with many
      predecessors.
      
      This significantly improves compile time for indirectbr interpreters.
      
      llvm-svn: 139797
      07b3503f
  24. Sep 09, 2011
    • Jakob Stoklund Olesen's avatar
      Reapply r139247: Cache intermediate results during traceSiblingValue. · 278bf025
      Jakob Stoklund Olesen authored
      In some cases such as interpreters using indirectbr, the CFG can be very
      complicated, and live range splitting may be forced to insert a large
      number of phi-defs.  When that happens, traceSiblingValue can spend a
      lot of time zipping around in the CFG looking for defs and reloads.
      
      This patch causes more information to be cached in SibValues, and the
      cached values are used to terminate searches early.  This speeds up
      spilling by 20x in one interpreter test case.  For more typical code,
      this is just a 10% speedup of spilling.
      
      The previous version had bugs that caused miscompilations. They have
      been fixed.
      
      llvm-svn: 139378
      278bf025
  25. Sep 07, 2011
    • Jakob Stoklund Olesen's avatar
      Revert r139247 "Cache intermediate results during traceSiblingValue." · 946e0a46
      Jakob Stoklund Olesen authored
      It broke the self host and clang-x86_64-darwin10-RA.
      
      llvm-svn: 139259
      946e0a46
    • Jakob Stoklund Olesen's avatar
      Cache intermediate results during traceSiblingValue. · b77d5c14
      Jakob Stoklund Olesen authored
      In some cases such as interpreters using indirectbr, the CFG can be very
      complicated, and live range splitting may be forced to insert a large
      number of phi-defs.  When that happens, traceSiblingValue can spend a
      lot of time zipping around in the CFG looking for defs and reloads.
      
      This patch causes more information to be cached in SibValues, and the
      cached values are used to terminate searches early.  This speeds up
      spilling by 20x in one interpreter test case.  For more typical code,
      this is just a 10% speedup of spilling.
      
      llvm-svn: 139247
      b77d5c14
  26. Sep 01, 2011
  27. Aug 30, 2011
  28. Jul 18, 2011
    • Jakob Stoklund Olesen's avatar
      Fix PR10387. · c0dd3da9
      Jakob Stoklund Olesen authored
      When trying to rematerialize a value before an instruction that has an
      early-clobber redefine of the virtual register, make sure to look up the
      correct value number.
      
      Early-clobber defs are moved one slot back, so getBaseIndex is needed to
      find the used value number.
      
      Bugpoint was unable to reduce the test case for this, see PR10388.
      
      llvm-svn: 135378
      c0dd3da9
  29. Jul 09, 2011
    • Jakob Stoklund Olesen's avatar
      Oops, didn't mean to commit that. · 780db902
      Jakob Stoklund Olesen authored
      Spills should be hoisted out of loops, but we don't want to hoist them
      to dominating blocks at the same loop depth. That could cause the spills
      to be executed more often.
      
      llvm-svn: 134782
      780db902
    • Jakob Stoklund Olesen's avatar
      Hoist spills within a basic block. · bf6afec3
      Jakob Stoklund Olesen authored
      Try to move spills as early as possible in their basic block. This can
      help eliminate interferences by shortening the live range being
      spilled.
      
      This fixes PR10221.
      
      llvm-svn: 134776
      bf6afec3
  30. Jul 05, 2011
    • Jakob Stoklund Olesen's avatar
      Fix PR10277. · bbad3bce
      Jakob Stoklund Olesen authored
      Remat during spilling triggers dead code elimination. If a phi-def
      becomes unused, that may also cause live ranges to split into separate
      connected components.
      
      This type of splitting is different from normal live range splitting. In
      particular, there may not be a common original interval.
      
      When the split range is its own original, make sure that the new
      siblings are also their own originals. The range being split cannot be
      used as an original since it doesn't cover the new siblings.
      
      llvm-svn: 134413
      bbad3bce
  31. Jun 30, 2011
  32. May 11, 2011
Loading