Skip to content
  1. Dec 22, 2012
  2. Dec 20, 2012
  3. Dec 19, 2012
  4. Dec 18, 2012
    • Jakob Stoklund Olesen's avatar
      Don't allow the automatically updated MI flags to be set directly. · a33f504b
      Jakob Stoklund Olesen authored
      The bundle-related MI flags need to be kept in sync with the neighboring
      instructions. Don't allow the bulk flag-setting setFlags() function to
      change them.
      
      Also don't copy MI flags when cloning an instruction. The clone's bundle
      flags will be set when it is explicitly inserted into a bundle.
      
      llvm-svn: 170459
      a33f504b
    • Jakob Stoklund Olesen's avatar
      Tighten up the erase/remove API for bundled instructions. · ccfb5fb4
      Jakob Stoklund Olesen authored
      Most code is oblivious to bundles and uses the MBB::iterator which only
      visits whole bundles. MBB::erase() operates on whole bundles at a time
      as before.
      
      MBB::remove() now refuses to remove bundled instructions. It is not safe
      to remove all instructions in a bundle without deleting them since there
      is no way of returning pointers to all the removed instructions.
      
      MBB::remove_instr() and MBB::erase_instr() will now update bundle flags
      correctly, lifting individual instructions out of bundles while leaving
      the remaining bundle intact.
      
      The MachineInstr convenience functions are updated so
      
        eraseFromParent() erases a whole bundle as before
        eraseFromBundle() erases a single instruction, leaving the rest of its bundle.
        removeFromParent() refuses to operate on bundled instructions, and
        removeFromBundle() lifts a single instruction out of its bundle.
      
      These functions will no longer accidentally split or coalesce bundles -
      bundle flags are updated to preserve the existing bundling, and explicit
      bundleWith* / unbundleFrom* functions should be used to change the
      instruction bundling.
      
      This API update is still a work in progress. I am going to update APIs
      first so they maintain bundle flags automatically when possible. Then
      I'll add stricter verification of the bundle flags.
      
      llvm-svn: 170384
      ccfb5fb4
  5. Dec 07, 2012
    • Jakob Stoklund Olesen's avatar
      Add higher-level API for dealing with bundled MachineInstrs. · fead62d4
      Jakob Stoklund Olesen authored
      This is still a work in progress. The purpose is to make bundling and
      unbundling operations explicit, and to catch errors where bundles are
      broken or created inadvertently.
      
      The old IsInsideBundle flag is replaced by two MI flags: BundledPred
      which has the same meaning as IsInsideBundle, and BundledSucc which is
      set on instructions that are bundled with a successor. Having two flags
      provdes redundancy to detect when a bundle is inadvertently torn by a
      splice() or insert(), and it makes it possible to write bundle iterators
      that don't need to peek at adjacent instructions.
      
      The new flags can't be manipulated directly (once setIsInsideBundle is
      gone). Instead there are MI functions to make and break bundle bonds.
      
      The setIsInsideBundle function will be removed in a future commit. It
      should be replaced by bundleWithPred().
      
      llvm-svn: 169583
      fead62d4
  6. Dec 05, 2012
  7. 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
  8. Oct 31, 2012
  9. Oct 08, 2012
  10. Sep 12, 2012
    • Michael Liao's avatar
      Fix PR11985 · abb87d48
      Michael Liao authored
          
      - BlockAddress has no support of BA + offset form and there is no way to
        propagate that offset into machine operand;
      - Add BA + offset support and a new interface 'getTargetBlockAddress' to
        simplify target block address forming;
      - All targets are modified to use new interface and X86 backend is enhanced to
        support BA + offset addressing.
      
      llvm-svn: 163743
      abb87d48
    • Manman Ren's avatar
      Release build: guard dump functions with · 19f49ac6
      Manman Ren authored
      "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"
      
      No functional change. Update r163339.
      
      llvm-svn: 163653
      19f49ac6
  11. Sep 06, 2012
  12. Sep 05, 2012
  13. Sep 04, 2012
    • Jakob Stoklund Olesen's avatar
      Typo. · d92e2bc2
      Jakob Stoklund Olesen authored
      llvm-svn: 163154
      d92e2bc2
    • Jakob Stoklund Olesen's avatar
      Actually use the MachineOperand field for isRegTiedToDefOperand(). · 9fceda74
      Jakob Stoklund Olesen authored
      The MachineOperand::TiedTo field was maintained, but not used.
      
      This patch enables it in isRegTiedToDefOperand() and
      isRegTiedToUseOperand() which are the actual functions use by the
      register allocator.
      
      llvm-svn: 163153
      9fceda74
    • Jakob Stoklund Olesen's avatar
      Allow tied uses and defs in different orders. · 0a09da83
      Jakob Stoklund Olesen authored
      After much agonizing, use a full 4 bits of precious MachineOperand space
      to encode this. This uses existing padding, and doesn't grow
      MachineOperand beyond its current 32 bytes.
      
      This allows tied defs among the first 15 operands on a normal
      instruction, just like the current MCInstrDesc constraint encoding.
      Inline assembly needs to be able to tie more than the first 15 operands,
      and gets special treatment.
      
      Tied uses can appear beyond 15 operands, as long as they are tied to a
      def that's in range.
      
      llvm-svn: 163151
      0a09da83
  14. Aug 31, 2012
    • Jakob Stoklund Olesen's avatar
      Add MachineInstr::tieOperands, remove setIsTied(). · 5c8eda0e
      Jakob Stoklund Olesen authored
      Manage tied operands entirely internally to MachineInstr. This makes it
      possible to change the representation of tied operands, as I will do
      shortly.
      
      The constraint that tied uses and defs must be in the same order was too
      restrictive.
      
      llvm-svn: 163021
      5c8eda0e
  15. Aug 30, 2012
    • Jakob Stoklund Olesen's avatar
      Don't use MCInstrDesc flags for implicit operands. · 0eecbbeb
      Jakob Stoklund Olesen authored
      When a MachineInstr is constructed, its implicit operands are added
      first, then the explicit operands are inserted before the implicits.
      
      MCInstrDesc has oprand flags like early clobber and operand ties that
      apply to the explicit operands.
      
      Don't look at those flags when the implicit operands are first added in
      the explicit operands's positions.
      
      llvm-svn: 162910
      0eecbbeb
  16. Aug 29, 2012
  17. Aug 28, 2012
    • Jakob Stoklund Olesen's avatar
      Add a MachineOperand::isTied() flag. · e56c60c5
      Jakob Stoklund Olesen authored
      While in SSA form, a MachineInstr can have pairs of tied defs and uses.
      The tied operands are used to represent read-modify-write operands that
      must be assigned the same physical register.
      
      Previously, tied operand pairs were computed from fixed MCInstrDesc
      fields, or by using black magic on inline assembly instructions.
      
      The isTied flag makes it possible to add tied operands to any
      instruction while getting rid of (some of) the inlineasm magic.
      
      Tied operands on normal instructions are needed to represent predicated
      individual instructions in SSA form. An extra <tied,imp-use> operand is
      required to represent the output value when the instruction predicate is
      false.
      
      Adding a predicate to:
      
        %vreg0<def> = ADD %vreg1, %vreg2
      
      Will look like:
      
        %vreg0<tied,def> = ADD %vreg1, %vreg2, pred:3, %vreg7<tied,imp-use>
      
      The virtual register %vreg7 is the value given to %vreg0 when the
      predicate is false. It will be assigned the same physreg as %vreg0.
      
      This commit adds the isTied flag and sets it based on MCInstrDesc when
      building an instruction. The flag is not used for anything yet.
      
      llvm-svn: 162774
      e56c60c5
    • Jakob Stoklund Olesen's avatar
      Don't allow TargetFlags on MO_Register MachineOperands. · dba99d0d
      Jakob Stoklund Olesen authored
      Register operands are manipulated by a lot of target-independent code,
      and it is not always possible to preserve target flags. That means it is
      not safe to use target flags on register operands.
      
      None of the targets in the tree are using register operand target flags.
      External targets should be using immediate operands to annotate
      instructions with operand modifiers.
      
      llvm-svn: 162770
      dba99d0d
  18. Aug 10, 2012
  19. Aug 07, 2012
    • Jakob Stoklund Olesen's avatar
      Add a new kind of MachineOperand: MO_TargetIndex. · 84689b0d
      Jakob Stoklund Olesen authored
      A target index operand looks a lot like a constant pool reference, but
      it is completely target-defined. It contains the 8-bit TargetFlags, a
      32-bit index, and a 64-bit offset. It is preserved by all code generator
      passes.
      
      TargetIndex operands can be used to carry target-specific information in
      cases where immediate operands won't suffice.
      
      llvm-svn: 161441
      84689b0d
  20. Jul 05, 2012
    • Chandler Carruth's avatar
      Finish fixing the MachineOperand hashing, providing a nice modern · 264854f9
      Chandler Carruth authored
      hash_value overload for MachineOperands. This addresses a FIXME
      sufficient for me to remove it, and cleans up the code nicely too.
      
      The important changes to the hashing logic:
      - TargetFlags are now included in all of the hashes. These were complete
        missed.
      - Register operands have their subregisters and whether they are a def
        included in the hash.
      - We now actually hash all of the operand types. Previously, many
        operand types were simply *dropped on the floor*. For example:
        - Floating point immediates
        - Large integer immediates (>64-bit)
        - External globals!
        - Register masks
        - Metadata operands
      - It removes the offset from the block-address hash; I'm a bit
        suspicious of this, but isIdenticalTo doesn't consider the offset for
        black addresses.
      
      Any patterns involving these entities could have triggered extreme
      slowdowns in MachineCSE or PHIElimination. Let me know if there are PRs
      you think might be closed now... I'm looking myself, but I may miss
      them.
      
      llvm-svn: 159743
      264854f9
    • Chandler Carruth's avatar
      The hash function for MI expressions, used by MachineCSE, is really · 1d5d2310
      Chandler Carruth authored
      broken. This patch fixes the superficial problems which lead to the
      intractably slow compile times reported in PR13225.
      
      The specific issue is that we were failing to include the *offset* of
      a global variable in the hash code. Oops. This would in turn cause all
      MIs which were only distinguishable due to operating on different
      offsets of a global variable to produce identical hash functions. In
      some of the test cases attached to the PR I saw hash table activity
      where there were O(1000) probes-per-lookup *on average*. A very few
      entries were responsible for most of these probes.
      
      There is still quite a bit more to do here. The ad-hoc layering of data
      in MachineOperands makes them *extremely* brittle to hash correctly.
      We're missing quite a few other cases, the only ones I've fixed here are
      the specific MO types which were allowed through the assert() in
      getOffset().
      
      llvm-svn: 159741
      1d5d2310
    • Jakob Stoklund Olesen's avatar
      Allow trailing physreg RegisterSDNode operands on non-variadic instructions. · c300ef0e
      Jakob Stoklund Olesen authored
      Also allow trailing register mask operands on non-variadic both
      MachineSDNodes and MachineInstrs.
      
      The extra physreg RegisterSDNode operands are added to the MI as
      <imp-use> operands. This makes it possible to have non-variadic call
      instructions.
      
      Call and return instructions really are non-variadic, the argument
      registers should only be used implicitly - they are not part of the
      encoding.
      
      llvm-svn: 159727
      c300ef0e
  21. Jun 28, 2012
  22. Jun 05, 2012
  23. Jun 02, 2012
    • Jakob Stoklund Olesen's avatar
      Switch all register list clients to the new MC*Iterator interface. · 54038d79
      Jakob Stoklund Olesen authored
      No functional change intended.
      
      Sorry for the churn. The iterator classes are supposed to help avoid
      giant commits like this one in the future. The TableGen-produced
      register lists are getting quite large, and it may be necessary to
      change the table representation.
      
      This makes it possible to do so without changing all clients (again).
      
      llvm-svn: 157854
      54038d79
Loading