Skip to content
  1. Jul 28, 2013
  2. Jul 26, 2013
  3. Jul 25, 2013
    • Justin Holewinski's avatar
      Fix a bug in TableGen where the intrinsic function name recognizer could... · b3d630ca
      Justin Holewinski authored
      Fix a bug in TableGen where the intrinsic function name recognizer could mis-identify names if one was a prefix substring of the other
      
      For two intrinsics 'llvm.nvvm.texsurf.handle' and 'llvm.nvvm.texsurf.handle.internal',
      TableGen was emitting matching code like:
      
        if (Name.startswith("llvm.nvvm.texsurf.handle")) ...
        if (Name.startswith("llvm.nvvm.texsurf.handle.internal")) ...
      
      We can never match "llvm.nvvm.texsurf.handle.internal" here because it will
      always be erroneously matched by the first condition.
      
      The fix is to sort the intrinsic names and emit them in reverse order.
      
      llvm-svn: 187119
      b3d630ca
    • Andrew Trick's avatar
      RegPressure: Order the "pressure sets" by number of regunits per set. · 3aacca46
      Andrew Trick authored
      This lets heuristics easily pick the most important set to follow.
      
      llvm-svn: 187108
      3aacca46
  4. Jul 24, 2013
  5. Jul 23, 2013
  6. Jul 16, 2013
  7. Jul 15, 2013
  8. Jul 14, 2013
  9. Jul 06, 2013
  10. Jul 04, 2013
  11. Jun 27, 2013
    • Chad Rosier's avatar
      Improve the compression of the tablegen DiffLists by introducing a new sort · ccd06643
      Chad Rosier authored
      algorithm when assigning EnumValues to the synthesized registers.
      
      The current algorithm, LessRecord, uses the StringRef compare_numeric
      function.  This function compares strings, while handling embedded numbers.
      For example, the R600 backend registers are sorted as follows:
      
        T1
        T1_W
        T1_X
        T1_XYZW
        T1_Y
        T1_Z
        T2
        T2_W
        T2_X
        T2_XYZW
        T2_Y
        T2_Z
      
      In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2
      have an EnumValue offset of 6 from one another.  However, in other parts
      of the register bank, the scaling factors are different:
      
      dEnum/dN = 5:
        KC0_128_W
        KC0_128_X
        KC0_128_XYZW
        KC0_128_Y
        KC0_128_Z
        KC0_129_W
        KC0_129_X
        KC0_129_XYZW
        KC0_129_Y
        KC0_129_Z
      
      The diff lists do not work correctly because different kinds of registers have
      different 'scaling factors'.  This new algorithm, LessRecordRegister, tries to
      enforce a scaling factor of 1.  For example, the registers are now sorted as
      follows:
      
        T1
        T2
        T3
        ...
        T0_W
        T1_W
        T2_W
        ...
        T0_X
        T1_X
        T2_X
        ...
        KC0_128_W
        KC0_129_W
        KC0_130_W
        ...
      
      For the Mips and R600 I see a 19% and 6% reduction in size, respectively.  I
      did see a few small regressions, but the differences were on the order of a
      few bytes (e.g., AArch64 was 16 bytes).  I suspect there will be even
      greater wins for targets with larger register files.
      
      Patch reviewed by Jakob.
      rdar://14006013
      
      llvm-svn: 185094
      ccd06643
  12. Jun 25, 2013
    • Tom Stellard's avatar
      TableGen: Generate a function for getting operand indices based on their defined names · b162d948
      Tom Stellard authored
      This patch modifies TableGen to generate a function in
      ${TARGET}GenInstrInfo.inc called getNamedOperandIdx(), which can be used
      to look up indices for operands based on their names.
      
      In order to activate this feature for an instruction, you must set the
      UseNamedOperandTable bit.
      
      For example, if you have an instruction like:
      
      def ADD : TargetInstr <(outs GPR:$dst), (ins GPR:$src0, GPR:$src1)>;
      
      You can look up the operand indices using the new function, like this:
      
      Target::getNamedOperandIdx(Target::ADD, Target::OpName::dst)  => 0
      Target::getNamedOperandIdx(Target::ADD, Target::OpName::src0) => 1
      Target::getNamedOperandIdx(Target::ADD, Target::OpName::src1) => 2
      
      The operand names are case sensitive, so $dst and $DST are considered
      different operands.
      
      This change is useful for R600 which has instructions with a large number
      of operands, many of which model single bit instruction configuration
      values.  These configuration bits are common across most instructions,
      but may have a different operand index depending on the instruction type.
      It is useful to have a convenient way to look up the operand indices,
      so these bits can be generically set on any instruction.
      
      llvm-svn: 184879
      b162d948
  13. Jun 18, 2013
  14. Jun 15, 2013
  15. Jun 10, 2013
  16. Jun 09, 2013
  17. Jun 07, 2013
  18. Jun 06, 2013
  19. Jun 05, 2013
  20. Jun 01, 2013
  21. May 31, 2013
    • Ahmed Bougacha's avatar
      Add a way to define the bit range covered by a SubRegIndex. · f1ed334d
      Ahmed Bougacha authored
      NOTE: If this broke your out-of-tree backend, in *RegisterInfo.td, change
      the instances of SubRegIndex that have a comps template arg to use the
      ComposedSubRegIndex class instead.
      
      In TableGen land, this adds Size and Offset attributes to SubRegIndex,
      and the ComposedSubRegIndex class, for which the Size and Offset are
      computed by TableGen. This also adds an accessor in MCRegisterInfo, and
      Size/Offsets for the X86 and ARM subreg indices.
      
      llvm-svn: 183020
      f1ed334d
  22. May 28, 2013
    • Chad Rosier's avatar
      Remove the MCRegAliasIterator tables and compute the aliases dynamically. · 1bbbb312
      Chad Rosier authored
      The size reduction in the RegDiffLists are rather dramatic.  Here are a few
      size differences for MCTargetDesc.o files (before and after) in bytes:
      R600 - 36160B - 11184B - 69% reduction
      ARM - 28480B - 8368B - 71% reduction
      Mips - 816B - 576B - 29% reduction
      
      One side effect of dynamically computing the aliases is that the iterator does
      not guarantee that the entries are ordered or that duplicates have been removed.
      The documentation implies this is a safe assumption and I found no clients that
      requires these attributes (i.e., strict ordering and uniqueness).
      
      My local LNT tester results showed no execution-time failures or significant
      compile-time regressions (i.e., beyond what I would consider noise) for -O0g,
      -O2 and -O3 runs on x86_64 and i386 configurations.
      rdar://12906217
      
      llvm-svn: 182783
      1bbbb312
  23. May 22, 2013
    • Bill Schmidt's avatar
      Recognize ValueType operands in source patterns for fast-isel. · 9b703f9c
      Bill Schmidt authored
      Currently the fast-isel table generator recognizes registers, register
      classes, and immediates for source pattern operands.  ValueType
      operands are not recognized.  This is not a problem for existing
      targets with fast-isel support, but will not work for targets like
      PowerPC and SPARC that use types in source patterns.
      
      The proposed patch allows ValueType operands and treats them in the
      same manner as register classes.  There is no convenient way to map
      from a ValueType to a register class, but there's no need to do so.
      The table generator already requires that all types in the source
      pattern be identical, and we know the register class of the output
      operand already.  So we just assign that register class to any
      ValueType operands we encounter.
      
      No functional effect on existing targets.  Testing deferred until the
      PowerPC target implements fast-isel.
      
      llvm-svn: 182512
      9b703f9c
  24. May 16, 2013
  25. Apr 27, 2013
    • Ulrich Weigand's avatar
      · e037a492
      Ulrich Weigand authored
      Handle tied sub-operands in AsmMatcherEmitter
      
      The problem this patch addresses is the handling of register tie
      constraints in AsmMatcherEmitter, where one operand is tied to a
      sub-operand of another operand.  The typical scenario for this to
      happen is the tie between the "write-back" register of a pre-inc
      instruction, and the base register sub-operand of the memory address
      operand of that instruction.
      
      The current AsmMatcherEmitter code attempts to handle tied
      operands by emitting the operand as usual first, and emitting
      a CVT_Tied node when handling the second (tied) operand.  However,
      this really only works correctly if the tied operand does not
      have sub-operands (and isn't a sub-operand itself).  Under those
      circumstances, a wrong MC operand list is generated.
      
      In discussions with Jim Grosbach, it turned out that the MC operand
      list really ought not to contain tied operands in the first place;
      instead, it ought to consist of exactly those operands that are
      named in the AsmString.  However, getting there requires significant
      rework of (some) targets.
      
      This patch fixes the immediate problem, and at the same time makes
      one (small) step in the direction of the long-term solution, by
      implementing two changes:
      
      1. Restricts the AsmMatcherEmitter handling of tied operands to
         apply solely to simple operands (not complex operands or
         sub-operand of such).
      
      This means that at least we don't get silently corrupt MC operand
      lists as output.  However, if we do have tied sub-operands, they
      would now no longer be handled at all, except for:
      
      2. If we have an operand that does not occur in the AsmString,
         and also isn't handled as tied operand, simply emit a dummy
         MC operand (constant 0).
      
      This works as long as target code never attempts to access
      MC operands that do no not occur in the AsmString (and are
      not tied simple operands), which happens to be the case for
      all targets where this situation can occur (ARM and PowerPC).
      
      [ Note that this change means that many of the ARM custom
        converters are now superfluous, since the implement the
        same "hack" now performed already by common code. ]
      
      Longer term, we ought to fix targets to never access *any*
      MC operand that does not occur in the AsmString (including
      tied simple operands), and then finally completely remove
      all such operands from the MC operand list.
      
      Patch approved by Jim Grosbach.
      
      llvm-svn: 180677
      e037a492
  26. Apr 24, 2013
  27. Apr 19, 2013
  28. Apr 11, 2013
Loading