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. Mar 19, 2013
  3. 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
  4. 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
  5. Oct 17, 2012
    • Jakob Stoklund Olesen's avatar
      Avoid rematerializing a redef immediately after the old def. · 4df59a9f
      Jakob Stoklund Olesen authored
      PR14098 contains an example where we would rematerialize a MOV8ri
      immediately after the original instruction:
      
        %vreg7:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
        %vreg22:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
      
      Besides being pointless, it is also wrong since the original instruction
      only redefines part of the register, and the value read by the new
      instruction is wrong.
      
      The problem was the LiveRangeEdit::allUsesAvailableAt() didn't
      special-case OrigIdx == UseIdx and found the wrong SSA value.
      
      llvm-svn: 166068
      4df59a9f
  6. Oct 16, 2012
  7. Sep 27, 2012
  8. Aug 02, 2012
    • Jakob Stoklund Olesen's avatar
      Avoid creating dangling physreg live ranges during DCE. · 374071dd
      Jakob Stoklund Olesen authored
      LiveRangeEdit::eliminateDeadDefs() can delete a dead instruction that
      reads unreserved physregs. This would leave the corresponding regunit
      live interval dangling because we don't have shrinkToUses() for physical
      registers.
      
      Fix this problem by turning the instruction into a KILL instead of
      deleting it. This happens in a landing pad in
      test/CodeGen/X86/2012-05-19-CoalescerCrash.ll:
      
        %vreg27<def,dead> = COPY %EDX<kill>; GR32:%vreg27
      
      becomes:
      
        KILL %EDX<kill>
      
      An upcoming fix to the machine verifier will catch problems like this by
      verifying regunit live intervals.
      
      This fixes PR13498. I am not including the test case from the PR since
      we already have one exposing the problem once the verifier is fixed.
      
      llvm-svn: 161182
      374071dd
  9. Jul 20, 2012
  10. Jun 22, 2012
  11. May 22, 2012
  12. May 20, 2012
    • Jakob Stoklund Olesen's avatar
      Fix 12892. · a34a69ce
      Jakob Stoklund Olesen authored
      Dead code elimination during coalescing could cause a virtual register
      to be split into connected components. The following rewriting would be
      confused about the already joined copies present in the code, but
      without a corresponding value number in the live range.
      
      Erase all joined copies instantly when joining intervals such that the
      MI and LiveInterval representations are always in sync.
      
      llvm-svn: 157135
      a34a69ce
  13. May 19, 2012
  14. Apr 04, 2012
  15. Apr 03, 2012
  16. Feb 28, 2012
  17. Feb 17, 2012
  18. Dec 20, 2011
  19. Dec 12, 2011
  20. 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
  21. Nov 13, 2011
    • 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
  22. Aug 09, 2011
  23. 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
  24. May 05, 2011
  25. May 02, 2011
    • Jakob Stoklund Olesen's avatar
      Minimize the slot indexes spanned by register ranges created when splitting. · 7d406793
      Jakob Stoklund Olesen authored
      When an interfering live range ends at a dead slot index between two
      instructions, make sure that the inserted copy instruction gets a slot index
      after the dead ones. This makes it possible to avoid the interference.
      
      Ideally, there shouldn't be interference ending at a deleted instruction, but
      physical register coalescing can sometimes do that to sub-registers.
      
      This fixes PR9823.
      
      llvm-svn: 130687
      7d406793
  26. Apr 21, 2011
  27. Apr 15, 2011
  28. Apr 11, 2011
  29. Apr 05, 2011
  30. Mar 30, 2011
    • Jakob Stoklund Olesen's avatar
      Treat clones the same as their origin. · dd9a2ece
      Jakob Stoklund Olesen authored
      When DCE clones a live range because it separates into connected components,
      make sure that the clones enter the same register allocator stage as the
      register they were cloned from.
      
      For instance, clones may be split even when they where created during spilling.
      Other registers created during spilling are not candidates for splitting or even
      (re-)spilling.
      
      llvm-svn: 128524
      dd9a2ece
  31. Mar 29, 2011
  32. Mar 23, 2011
  33. Mar 17, 2011
  34. Mar 16, 2011
Loading