Skip to content
  1. Dec 12, 2011
  2. 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
  3. Nov 14, 2011
  4. 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
  5. 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
  6. 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
  7. Sep 16, 2011
  8. 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
  9. 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
  10. 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
  11. Sep 01, 2011
  12. Aug 30, 2011
  13. 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
  14. 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
  15. 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
  16. Jun 30, 2011
  17. May 11, 2011
  18. May 05, 2011
  19. Apr 30, 2011
  20. Apr 21, 2011
  21. Apr 18, 2011
  22. Mar 31, 2011
    • Jakob Stoklund Olesen's avatar
      Pick a conservative register class when creating a small live range for remat. · ae044c06
      Jakob Stoklund Olesen authored
      The rematerialized instruction may require a more constrained register class
      than the register being spilled. In the test case, the spilled register has been
      inflated to the DPR register class, but we are rematerializing a load of the
      ssub_0 sub-register which only exists for DPR_VFP2 registers.
      
      The register class is reinflated after spilling, so the conservative choice is
      only temporary.
      
      llvm-svn: 128610
      ae044c06
  23. Mar 29, 2011
  24. Mar 26, 2011
  25. Mar 20, 2011
  26. Mar 18, 2011
    • Jakob Stoklund Olesen's avatar
      Hoist spills when the same value is known to be in less loopy sibling registers. · 27320cb8
      Jakob Stoklund Olesen authored
      Stack slot real estate is virtually free compared to registers, so it is
      advantageous to spill earlier even though the same value is now kept in both a
      register and a stack slot.
      
      Also eliminate redundant spills by extending the stack slot live range
      underneath reloaded registers.
      
      This can trigger a dead code elimination, removing copies and even reloads that
      were only feeding spills.
      
      llvm-svn: 127868
      27320cb8
  27. Mar 17, 2011
  28. Mar 15, 2011
    • Jakob Stoklund Olesen's avatar
      Trace back through sibling copies to hoist spills and find rematerializable defs. · a0d5ec10
      Jakob Stoklund Olesen authored
      After live range splitting, an original value may be available in multiple
      registers. Tracing back through the registers containing the same value, find
      the best place to insert a spill, determine if the value has already been
      spilled, or discover a reaching def that may be rematerialized.
      
      This is only the analysis part. The information is not used for anything yet.
      
      llvm-svn: 127698
      a0d5ec10
Loading