Skip to content
  1. May 20, 2012
  2. May 19, 2012
    • Jakob Stoklund Olesen's avatar
      Remove the late DCE in RegisterCoalescer. · e59d0c32
      Jakob Stoklund Olesen authored
      Dead code and joined copies are now eliminated on the fly, and there is
      no need for a post pass.
      
      This makes the coalescer work like other modern register allocator
      passes: Code is changed on the fly, there is no pending list of changes
      to be committed.
      
      llvm-svn: 157132
      e59d0c32
    • Jakob Stoklund Olesen's avatar
      Erase joined copies immediately. · 25ced184
      Jakob Stoklund Olesen authored
      The late dead code elimination is no longer necessary.
      
      The test changes are cause by a register hint that can be either %rdi or
      %rax. The choice depends on the use list order, which this patch changes.
      
      llvm-svn: 157131
      25ced184
    • Jakob Stoklund Olesen's avatar
      Fix an ancient bug in removeCopyByCommutingDef(). · 1b707c88
      Jakob Stoklund Olesen authored
      Before rewriting uses of one value in A to register B, check that there
      are no tied uses. That would require multiple A values to be rewritten.
      
      This bug can't bite in the current version of the code for a fairly
      subtle reason: A tied use would have caused 2-addr to insert a copy
      before the use. If the copy has been coalesced, it will be found by the
      same loop changed by this patch, and the optimization is aborted.
      
      This was exposed by 400.perlbench and lua after applying a patch that
      deletes joined copies aggressively.
      
      llvm-svn: 157130
      1b707c88
    • Jakob Stoklund Olesen's avatar
      Collect inflatable virtual registers on the fly. · d05148ba
      Jakob Stoklund Olesen authored
      There is no reason to defer the collection of virtual registers whose
      register class may be replaced with a larger class.
      
      llvm-svn: 157125
      d05148ba
    • Jakob Stoklund Olesen's avatar
      Eliminate dead code after remat. · 900f5844
      Jakob Stoklund Olesen authored
      This will remove the original def once it has no more uses.
      
      llvm-svn: 157104
      900f5844
    • Jakob Stoklund Olesen's avatar
      Don't remat during updateRegDefsUses(). · dcffc626
      Jakob Stoklund Olesen authored
      Remaining virtreg->physreg copies were rematerialized during
      updateRegDefsUses(), but we already do the same thing in joinCopy() when
      visiting the physreg copy instruction.
      
      Eliminate the preserveSrcInt argument to reMaterializeTrivialDef(). It
      is now always true.
      
      llvm-svn: 157103
      dcffc626
    • Jakob Stoklund Olesen's avatar
      Immediately erase trivially useless copies. · 06dc7212
      Jakob Stoklund Olesen authored
      There is no need for these instructions to stick around since they are
      known to be not dead.
      
      llvm-svn: 157102
      06dc7212
    • Jakob Stoklund Olesen's avatar
      Run proper recursive dead code elimination during coalescing. · 82d77e81
      Jakob Stoklund Olesen authored
      Dead copies cause problems because they are trivial to coalesce, but
      removing them gived the live range a dangling end point. This patch
      enables full dead code elimination which trims live ranges to their uses
      so end points don't dangle.
      
      DCE may erase multiple instructions. Put the pointers in an ErasedInstrs
      set so we never risk visiting erased instructions in the work list.
      
      There isn't supposed to be any dead copies entering RegisterCoalescer,
      but they do slip by as evidenced by test/CodeGen/X86/coalescer-dce.ll.
      
      llvm-svn: 157101
      82d77e81
    • Jakob Stoklund Olesen's avatar
      Allow LiveRangeEdit to be created with a NULL parent. · e5bbe379
      Jakob Stoklund Olesen authored
      The dead code elimination with callbacks is still useful.
      
      llvm-svn: 157100
      e5bbe379
    • Jakob Stoklund Olesen's avatar
      Modernize naming convention for class members. · 3834dae6
      Jakob Stoklund Olesen authored
      No functional change.
      
      llvm-svn: 157079
      3834dae6
  3. May 18, 2012
    • Jakob Stoklund Olesen's avatar
      Move all work list processing to copyCoalesceWorkList(). · b686a2ce
      Jakob Stoklund Olesen authored
      This will make it possible to filter out erased instructions later.
      
      llvm-svn: 157073
      b686a2ce
    • Jim Grosbach's avatar
      Refactor data-in-code annotations. · 4b63d2ae
      Jim Grosbach authored
      Use a dedicated MachO load command to annotate data-in-code regions.
      This is the same format the linker produces for final executable images,
      allowing consistency of representation and use of introspection tools
      for both object and executable files.
      
      Data-in-code regions are annotated via ".data_region"/".end_data_region"
      directive pairs, with an optional region type.
      
      data_region_directive := ".data_region" { region_type }
      region_type := "jt8" | "jt16" | "jt32" | "jta32"
      end_data_region_directive := ".end_data_region"
      
      The previous handling of ARM-style "$d.*" labels was broken and has
      been removed. Specifically, it didn't handle ARM vs. Thumb mode when
      marking the end of the section.
      
      rdar://11459456
      
      llvm-svn: 157062
      4b63d2ae
    • Eric Christopher's avatar
      Remove duplicate code that we could just fallthrough to. · e2b36ce2
      Eric Christopher authored
      llvm-svn: 157060
      e2b36ce2
    • Jakob Stoklund Olesen's avatar
      Simplify RegisterCoalescer::copyCoalesceInMBB(). · b954b91a
      Jakob Stoklund Olesen authored
      It is no longer necessary to separate VirtCopies, PhysCopies, and
      ImpDefCopies. Implicitly defined copies are extremely rare after we
      added the ProcessImplicitDefs pass, and physical register copies are not
      joined any longer.
      
      llvm-svn: 157059
      b954b91a
    • Jakob Stoklund Olesen's avatar
      Remove support for PhysReg joining. · d78d7b05
      Jakob Stoklund Olesen authored
      This has been disabled for a while, and it is not a feature we want to
      support. Copies between physical and virtual registers are eliminated by
      good hinting support in the register allocator. Joining virtual and
      physical registers is really a form of register allocation, and the
      coalescer is not properly equipped to do that. In particular, it cannot
      backtrack coalescing decisions, and sometimes that would cause it to
      create programs that were impossible to register allocate, by exhausting
      a small register class.
      
      It was also very difficult to keep track of the live ranges of aliasing
      registers when extending the live range of a physreg. By disabling
      physreg joining, we can let fixed physreg live ranges remain constant
      throughout the register allocator super-pass.
      
      One type of physreg joining remains: A virtual register that has a
      single value which is a copy of a reserved register can be merged into
      the reserved physreg. This always lowers register pressure, and since we
      don't compute live ranges for reserved registers, there are no problems
      with aliases.
      
      llvm-svn: 157055
      d78d7b05
    • Stepan Dyatkovskiy's avatar
      Recommited reworked r156804: · b638ee0e
      Stepan Dyatkovskiy authored
      SelectionDAGBuilder::Clusterify : main functinality was replaced with CRSBuilder::optimize, so big part of Clusterify's code was reduced.
      
      llvm-svn: 157046
      b638ee0e
    • Evan Cheng's avatar
      Teach two-address pass to update the "source" map so it doesn't perform a · 22d405f5
      Evan Cheng authored
      non-profitable commute using outdated info. The test case would still fail
      because of poor pre-RA schedule. That will be fixed by MI scheduler.
      
      rdar://11472010
      
      llvm-svn: 157038
      22d405f5
    • Andrew Trick's avatar
      comments · 6a50baa2
      Andrew Trick authored
      llvm-svn: 157020
      6a50baa2
  4. May 17, 2012
  5. May 16, 2012
    • Jakob Stoklund Olesen's avatar
      Set sub-register <undef> flags more accurately. · ab482839
      Jakob Stoklund Olesen authored
      When widening an existing <def,reads-undef> operand to a super-register,
      it may be necessary to clear the <undef> flag because the wider register
      is now read-modify-write through the instruction.
      
      Conversely, it may be necessary to add an <undef> flag when the
      coalescer turns a full-register def into a sub-register def, but the
      larger register wasn't live before the instruction.
      
      This happens in test/CodeGen/ARM/coalesce-subregs.ll, but the test
      is too small for the <undef> flags to affect the generated code.
      
      llvm-svn: 156951
      ab482839
    • Duncan Sands's avatar
      Fix a thinko in DisintegrateMERGE_VALUES. Patch by Xiaoyi Guo. · 49080cd9
      Duncan Sands authored
      llvm-svn: 156909
      49080cd9
    • Jakob Stoklund Olesen's avatar
      Enable sub-sub-register copy coalescing. · 984997b3
      Jakob Stoklund Olesen authored
      It is now possible to coalesce weird skewed sub-register copies by
      picking a super-register class larger than both original registers. The
      included test case produces code like this:
      
        vld2.32 {d16, d17, d18, d19}, [r0]!
        vst2.32 {d18, d19, d20, d21}, [r0]
      
      We still perform interference checking as if it were a normal full copy
      join, so this is still quite conservative. In particular, the f1 and f2
      functions in the included test case still have remaining copies because
      of false interference.
      
      llvm-svn: 156878
      984997b3
    • Jakob Stoklund Olesen's avatar
      Teach RegisterCoalescer to handle symmetric sub-register copies. · a1626369
      Jakob Stoklund Olesen authored
      It is possible to coalesce two overlapping registers to a common
      super-register that it larger than both of the original registers.
      
      The important difference is that it may be necessary to rewrite DstReg
      operands as well as SrcReg operands because the sub-register index has
      changed.
      
      This behavior is still disabled by CoalescerPair.
      
      llvm-svn: 156869
      a1626369
    • Jakob Stoklund Olesen's avatar
      Handle NewReg==OldReg in renameRegister(). · 385970f2
      Jakob Stoklund Olesen authored
      This can happen when widening a virtual register to a super-register
      class.
      
      llvm-svn: 156867
      385970f2
    • Jakob Stoklund Olesen's avatar
      We never call adjustCopiesBackFrom() for partial copies. · 1c6a2223
      Jakob Stoklund Olesen authored
      There is no need to look at an always null SrcIdx.
      
      llvm-svn: 156866
      1c6a2223
  6. May 15, 2012
Loading