Skip to content
  1. Sep 15, 2011
    • 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
    • Jakob Stoklund Olesen's avatar
      Speed up LiveIntervals::shrinkToUse with some caching. · b8b1d4c4
      Jakob Stoklund Olesen authored
      Blocks with multiple PHI successors only need to go on the worklist
      once.  Use a SmallPtrSet to track the live-out blocks that have already
      been handled.  This is a lot faster than the two live range check we
      would otherwise do.
      
      Also stop recomputing hasPHIKill flags.  Like RenumberValues(), it is
      conservatively correct to leave them in, and they are not used for
      anything important.
      
      llvm-svn: 139792
      b8b1d4c4
    • Jakob Stoklund Olesen's avatar
      Revert r139782, "RemoveCopyByCommutingDef doesn't need hasPHIKill()." · fb75d78d
      Jakob Stoklund Olesen authored
      It does, after all.
      
      RemoveCopyByCommutingDef rewrites the uses of one particular value
      number in A. It doesn't know how to rewrite phi uses, so there can't be
      any.
      
      llvm-svn: 139787
      fb75d78d
    • Jakob Stoklund Olesen's avatar
      Stop verifying hasPHIKill() flags. · 4c099551
      Jakob Stoklund Olesen authored
      There is only one legitimate use remaining, in addIntervalsForSpills().
      All other calls to hasPHIKill() are only used to update PHIKill flags.
      
      The addIntervalsForSpills() function is part of the old spilling
      framework, only used by linearscan.
      
      llvm-svn: 139783
      4c099551
    • Jakob Stoklund Olesen's avatar
      RemoveCopyByCommutingDef doesn't need hasPHIKill(). · 0499e7bb
      Jakob Stoklund Olesen authored
      Instead, let HasOtherReachingDefs() test for defs in B that overlap any
      phi-defs in A as well.  This test is slightly different, but almost
      identical.
      
      A perfectly precise test would only check those phi-defs in A that are
      reachable from AValNo.
      
      llvm-svn: 139782
      0499e7bb
    • Jakob Stoklund Olesen's avatar
      It is safe to remat a value killed by phis. · dca022e3
      Jakob Stoklund Olesen authored
      The source live range is recomputed using shrinkToUses() which does
      handle phis correctly.  The hasPHIKill() condition was relevant in the
      old days when ReMaterializeTrivialDef() tried to recompute the live
      range itself.
      
      The shrinkToUses() function will mark the original def as dead when no
      more uses and phi kills remain.  It is then removed by
      runOnMachineFunction().
      
      llvm-svn: 139781
      dca022e3
    • Jakob Stoklund Olesen's avatar
      Leave hasPHIKill flags alone in LiveInterval::RenumberValues. · e7ca8ecd
      Jakob Stoklund Olesen authored
      It is conservatively correct to keep the hasPHIKill flags, even after
      deleting PHI-defs.
      
      The calculation can be very expensive after taildup has created a
      quadratic number of indirectbr edges in the CFG, and the hasPHIKill flag
      isn't used for anything after RenumberValues().
      
      llvm-svn: 139780
      e7ca8ecd
    • Andrew Trick's avatar
      [regcoalescing] bug fix for RegistersDefinedFromSameValue. · 76a86d3d
      Andrew Trick authored
      An improper SlotIndex->VNInfo lookup was leading to unsafe copy removal.
      Fixes PR10920 401.bzip2 miscompile with no IV rewrite.
      
      llvm-svn: 139765
      76a86d3d
    • Devang Patel's avatar
      Add support to emit debug info for C++0x nullptr type. · 04d6d478
      Devang Patel authored
      llvm-svn: 139751
      04d6d478
  2. Sep 14, 2011
    • Jakob Stoklund Olesen's avatar
      Ignore the cloning of unknown registers. · 811b9c47
      Jakob Stoklund Olesen authored
      THe LRE_DidCloneVirtReg callback may be called with vitual registers
      that RAGreedy doesn't even know about yet.  In that case, there are no
      data structures to update.
      
      llvm-svn: 139702
      811b9c47
    • Jakob Stoklund Olesen's avatar
      Hoist back-copies to the least busy dominator. · a98af398
      Jakob Stoklund Olesen authored
      When a back-copy is hoisted to the nearest common dominator, keep
      looking up the dominator tree for a less loopy dominator, and place the
      back-copy there instead.
      
      Don't do this when a single existing back-copy dominates all the others.
      Assume the client knows what he is doing, and keep the dominating
      back-copy.
      
      This prevents us from hoisting back-copies into loops in most cases.  If
      a value is defined in a loop with multiple exits, we may still hoist
      back-copies into that loop.  That is the speed/size tradeoff.
      
      llvm-svn: 139698
      a98af398
    • Nadav Rotem's avatar
      Add integer promotion support for vselect · d748dbac
      Nadav Rotem authored
      llvm-svn: 139692
      d748dbac
    • Jakob Stoklund Olesen's avatar
      Distinguish complex mapped values from forced recomputation. · 5d4277dd
      Jakob Stoklund Olesen authored
      When a ParentVNI maps to multiple defs in a new interval, its live range
      may still be derived directly from RegAssign by transferValues().
      
      On the other hand, when instructions have been rematerialized or
      hoisted, it may be necessary to completely recompute live ranges using
      LiveRangeCalc::extend() to all uses.
      
      Use a bit in the value map to indicate that a live range must be
      recomputed.  Rename markComplexMapped() to forceRecompute().
      
      This fixes some live range verification errors when
      -split-spill-mode=size hoists back-copies by recomputing source ranges
      when RegAssign kills can't be moved.
      
      llvm-svn: 139660
      5d4277dd
    • Jakob Stoklund Olesen's avatar
      Implement -split-spill-mode=size. · a25330f0
      Jakob Stoklund Olesen authored
      Whenever the complement interval is defined by multiple copies of the
      same value, hoist those back-copies to the nearest common dominator.
      
      This ensures that at most one copy is inserted per value in the
      complement inteval, and no phi-defs are needed.
      
      llvm-svn: 139651
      a25330f0
    • Eli Friedman's avatar
      f78c6a83
  3. Sep 13, 2011
  4. Sep 12, 2011
    • Bill Wendling's avatar
      Introduce a bit of a hack. · ac5a8836
      Bill Wendling authored
      Splitting a landing pad takes considerable care because of PHIs and other
      nasties. The problem is that the jump table needs to jump to the landing pad
      block. However, the landing pad block can be jumped to only by an invoke
      instruction. So we clone the landingpad instruction into its own basic block,
      have the invoke jump to there. The landingpad instruction's basic block's
      successor is now the target for the jump table.
      
      But because of PHI nodes, we need to create another basic block for the jump
      table to jump to. This is definitely a hack, because the values for the PHI
      nodes may not be defined on the edge from the jump table. But that's okay,
      because the jump table is simply a construct to mimic what is happening in the
      CFG. So the values are mysteriously there, even though there is no value for the
      PHI from the jump table's edge (hence calling this a hack).
      
      llvm-svn: 139545
      ac5a8836
    • Jakob Stoklund Olesen's avatar
      Remove the -compact-regions flag. · 45df7e0f
      Jakob Stoklund Olesen authored
      It has been enabled by default for a while, it was only there to allow
      performance comparisons.
      
      llvm-svn: 139501
      45df7e0f
    • Jakob Stoklund Olesen's avatar
      Add an interface for SplitKit complement spill modes. · eecb2fb1
      Jakob Stoklund Olesen authored
      SplitKit always computes a complement live range to cover the places
      where the original live range was live, but no explicit region has been
      allocated.
      
      Currently, the complement live range is created to be as small as
      possible - it never overlaps any of the regions.  This minimizes
      register pressure, but if the complement is going to be spilled anyway,
      that is not very important.  The spiller will eliminate redundant
      spills, and hoist others by making the spill slot live range overlap
      some of the regions created by splitting.  Stack slots are cheap.
      
      This patch adds the interface to enable spill modes in SplitKit.  In
      spill mode, SplitKit will assume that the complement is going to spill,
      so it will allow it to overlap regions in order to avoid back-copies.
      By doing some of the spiller's work early, the complement live range
      becomes simpler.  In some cases, it can become much simpler because no
      extra PHI-defs are required.  This will speed up both splitting and
      spilling.
      
      This is only the interface to enable spill modes, no implementation yet.
      
      llvm-svn: 139500
      eecb2fb1
    • Jakob Stoklund Olesen's avatar
      Update comments to reflect some (not so) recent changes. · 72c0ddfb
      Jakob Stoklund Olesen authored
      llvm-svn: 139498
      72c0ddfb
  5. Sep 10, 2011
  6. Sep 09, 2011
    • Eli Friedman's avatar
      Make the SelectionDAG verify that all the operands of BUILD_VECTOR have the... · b7910b79
      Eli Friedman authored
      Make the SelectionDAG verify that all the operands of BUILD_VECTOR have the same type.  Teach DAGCombiner::visitINSERT_VECTOR_ELT not to make invalid BUILD_VECTORs.  Fixes PR10897.
      
      llvm-svn: 139407
      b7910b79
    • 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
    • Devang Patel's avatar
      Directly point debug info to the stack slot of the arugment, instead of trying... · 9d904e1a
      Devang Patel authored
      Directly point debug info to the stack slot of the arugment, instead of trying to keep track of vreg in which it the arugment is copied. The LiveDebugVariable can keep track of variable's ranges.
      
      llvm-svn: 139330
      9d904e1a
  7. Sep 07, 2011
Loading