Skip to content
  1. May 16, 2013
    • Rafael Espindola's avatar
      Remove addFrameMove. · b08d2c2d
      Rafael Espindola authored
      Now that we have good testing, remove addFrameMove and create cfi
      instructions directly.
      
      llvm-svn: 182052
      b08d2c2d
    • Akira Hatanaka's avatar
      [mips] Factor out unaligned store lowering code. · d82ee940
      Akira Hatanaka authored
      llvm-svn: 182050
      d82ee940
    • Jack Carter's avatar
      Mips assembler: Add TwoOperandConstraint definitions · 03f0fd37
      Jack Carter authored
      This patch removes alias definition for addiu $rs,$imm 
      and instead uses the TwoOperandAliasConstraint field in 
      the ArithLogicI instruction class. 
      
      This way all instructions that inherit ArithLogicI class 
      have the same macro defined. 
      
      The usage examples are added to test files.
      
      Patch by Vladimir Medic
      
      llvm-svn: 182048
      03f0fd37
    • Jack Carter's avatar
      Mips td file formatting: white space and long lines · 59817110
      Jack Carter authored
      llvm-svn: 182047
      59817110
    • Hal Finkel's avatar
      Create an new preheader in PPCCTRLoops to avoid counter register clobbers · 5f587c59
      Hal Finkel authored
      Some IR-level instructions (such as FP <-> i64 conversions) are not chained
      w.r.t. the mtctr intrinsic and yet may become function calls that clobber the
      counter register. At the selection-DAG level, these might be reordered with the
      mtctr intrinsic causing miscompiles. To avoid this situation, if an existing
      preheader has instructions that might use the counter register, create a new
      preheader for the mtctr intrinsic. This extra block will be remerged with the
      old preheader at the MI level, but will prevent unwanted reordering at the
      selection-DAG level.
      
      llvm-svn: 182045
      5f587c59
    • Akira Hatanaka's avatar
      [mips] Test case for r182042. Add comment. · fce4dd79
      Akira Hatanaka authored
      llvm-svn: 182044
      fce4dd79
    • Akira Hatanaka's avatar
      [mips] Fix instruction selection pattern for sint_to_fp node to avoid emitting an · 39d40f7b
      Akira Hatanaka authored
      invalid instruction sequence.
      
      Rather than emitting an int-to-FP move instruction and an int-to-FP conversion
      instruction during instruction selection, we emit a pseudo instruction which gets
      expanded post-RA. Without this change, register allocation can possibly insert a
      floating point register move instruction between the two instructions, which is not
      valid according to the ISA manual.
      
      mtc1 $f4, $4         # int-to-fp move instruction.
      mov.s $f2, $f4       # move contents of $f4 to $f2.
      cvt.s.w $f0, $f2     # int-to-fp conversion.
      
      llvm-svn: 182042
      39d40f7b
    • Jack Carter's avatar
      Mips assembler: Add branch macro definitions · 51785c47
      Jack Carter authored
      This patch adds bnez and beqz instructions which represent alias definitions for bne and beq instructions as follows:
      bnez $rs,$imm => bne $rs,$zero,$imm
      beqz $rs,$imm => beq $rs,$zero,$imm
      
      The corresponding test cases are added.
      
      Patch by Vladimir Medic
      
      llvm-svn: 182040
      51785c47
    • Benjamin Kramer's avatar
      DAGCombine: Also shrink eq compares where the constant is exactly as large as the smaller type. · fc88c376
      Benjamin Kramer authored
      if ((x & 255) == 255)
      
      before: movzbl  %al, %eax
              cmpl  $255, %eax
      
      after:  cmpb  $-1, %al
      llvm-svn: 182038
      fc88c376
    • Akira Hatanaka's avatar
      [mips] Fix indentation. · 21bab5ba
      Akira Hatanaka authored
      llvm-svn: 182036
      21bab5ba
    • Akira Hatanaka's avatar
      [mips] Delete unused enum value. · 7b6e4f13
      Akira Hatanaka authored
      llvm-svn: 182035
      7b6e4f13
    • Jakob Stoklund Olesen's avatar
      Add TargetRegisterInfo::getCoveringLanes(). · 9ae96c7a
      Jakob Stoklund Olesen authored
      This lane mask provides information about which register lanes
      completely cover super-registers. See the block comment before
      getCoveringLanes().
      
      llvm-svn: 182034
      9ae96c7a
    • Ulrich Weigand's avatar
      · 9d980cbd
      Ulrich Weigand authored
      [PowerPC] Use true offset value in "memrix" machine operands
      
      This is the second part of the change to always return "true"
      offset values from getPreIndexedAddressParts, tackling the
      case of "memrix" type operands.
      
      This is about instructions like LD/STD that only have a 14-bit
      field to encode immediate offsets, which are implicitly extended
      by two zero bits by the machine, so that in effect we can access
      16-bit offsets as long as they are a multiple of 4.
      
      The PowerPC back end currently handles such instructions by
      carrying the 14-bit value (as it will get encoded into the
      actual machine instructions) in the machine operand fields
      for such instructions.  This means that those values are
      in fact not the true offset, but rather the offset divided
      by 4 (and then truncated to an unsigned 14-bit value).
      
      Like in the case fixed in r182012, this makes common code
      operations on such offset values not work as expected.
      Furthermore, there doesn't really appear to be any strong
      reason why we should encode machine operands this way.
      
      This patch therefore changes the encoding of "memrix" type
      machine operands to simply contain the "true" offset value
      as a signed immediate value, while enforcing the rules that
      it must fit in a 16-bit signed value and must also be a
      multiple of 4.
      
      This change must be made simultaneously in all places that
      access machine operands of this type.  However, just about
      all those changes make the code simpler; in many cases we
      can now just share the same code for memri and memrix
      operands.
      
      llvm-svn: 182032
      9d980cbd
    • Hal Finkel's avatar
      PPC32 cannot form counter loops around i64 FP conversions · 47db66d4
      Hal Finkel authored
      On PPC32, i64 FP conversions are implemented using runtime calls (which clobber
      the counter register). These must be excluded.
      
      llvm-svn: 182023
      47db66d4
    • Aaron Ballman's avatar
      Fixing a 64-bit conversion warning in MSVC. · b4284e6c
      Aaron Ballman authored
      llvm-svn: 182018
      b4284e6c
    • Rafael Espindola's avatar
      Remove dead calls to addFrameMove. · 63d2e0ad
      Rafael Espindola authored
      Without a PROLOG_LABEL present, the cfi instructions are never printed.
      
      llvm-svn: 182016
      63d2e0ad
    • Ulrich Weigand's avatar
      · 7aa76b6a
      Ulrich Weigand authored
      [PowerPC] Report true displacement value from getPreIndexedAddressParts
      
      DAGCombiner::CombineToPreIndexedLoadStore calls a target routine to
      decompose a memory address into a base/offset pair.  It expects the
      offset (if constant) to be the true displacement value in order to
      perform optional additional optimizations; in particular, to convert
      other uses of the original pointer into uses of the new base pointer
      after pre-increment.
      
      The PowerPC implementation of getPreIndexedAddressParts, however,
      simply calls SelectAddressRegImm, which returns a TargetConstant.
      This value is appropriate for encoding into the instruction, but
      it is not always usable as true displacement value:
      
      - Its type is always MVT::i32, even on 64-bit, where addresses
        ought to be i64 ... this causes the optimization to simply
        always fail on 64-bit due to this line in DAGCombiner:
      
            // FIXME: In some cases, we can be smarter about this.
            if (Op1.getValueType() != Offset.getValueType()) {
      
      - Its value is truncated to an unsigned 16-bit value if negative.
        This causes the above opimization to generate wrong code.
      
      This patch fixes both problems by simply returning the true
      displacement value (in its original type).  This doesn't
      affect any other user of the displacement.
      
      llvm-svn: 182012
      7aa76b6a
    • Richard Sandiford's avatar
      [SystemZ] Tweak register array comment · 7fdd268b
      Richard Sandiford authored
      llvm-svn: 182007
      7fdd268b
    • Evgeniy Stepanov's avatar
      [msan] Switch TLS globals to initial-exec model. · 1e764324
      Evgeniy Stepanov authored
      They are always defined in the main executable.
      
      llvm-svn: 181994
      1e764324
    • Patrik Hagglund's avatar
      Removed unused variable, detected by gcc · b3391b58
      Patrik Hagglund authored
      -Wunused-but-set-variable. Leftover from r181979.
      
      llvm-svn: 181993
      b3391b58
    • Rafael Espindola's avatar
      Delete dead code. · 7242186b
      Rafael Espindola authored
      llvm-svn: 181982
      7242186b
    • Rafael Espindola's avatar
      Don't call addFrameMove on XCore. · e3d5e535
      Rafael Espindola authored
      getExceptionHandlingType is not ExceptionHandling::DwarfCFI on xcore, so
      etFrameInstructions is never called. There is no point creating cfi
      instructions if they are never used.
      
      llvm-svn: 181979
      e3d5e535
    • Richard Smith's avatar
    • Rafael Espindola's avatar
      Removed dead code. · 6e8c0d94
      Rafael Espindola authored
      llvm-svn: 181975
      6e8c0d94
    • Reed Kotler's avatar
      Patch number 2 for mips16/32 floating point interoperability stubs. · 515e9376
      Reed Kotler authored
      This creates stubs that help Mips32 functions call Mips16 
      functions which have floating point parameters that are normally passed
      in floating point registers.
       
      
      llvm-svn: 181972
      515e9376
    • Derek Schuff's avatar
      Revert "Support unaligned load/store on more ARM targets" · 36f00d9f
      Derek Schuff authored
      This reverts r181898.
      
      llvm-svn: 181944
      36f00d9f
    • Eli Bendersky's avatar
      Remove dead code. · b8cd7a0d
      Eli Bendersky authored
      This method is not being used/tested anywhere.
      
      llvm-svn: 181943
      b8cd7a0d
    • Arnold Schwaighofer's avatar
      LoopVectorize: Move call of canHoistAllLoads to canVectorizeWithIfConvert · 88e7fddc
      Arnold Schwaighofer authored
      We only want to check this once, not for every conditional block in the loop.
      
      No functionality change (except that we don't perform a check redudantly
      anymore).
      
      llvm-svn: 181942
      88e7fddc
    • Rafael Espindola's avatar
      Delete dead code. · 84ee6c40
      Rafael Espindola authored
      llvm-svn: 181941
      84ee6c40
    • Hal Finkel's avatar
      undef setjmp in PPCCTRLoops · 80267a0a
      Hal Finkel authored
      Trying to unbreak the VS build by copying some undef code from
      Utils/LowerInvoke.cpp.
      
      llvm-svn: 181938
      80267a0a
    • David Majnemer's avatar
      X86: Remove redundant test instructions · 8f169742
      David Majnemer authored
      Increase the number of instructions LLVM recognizes as setting the ZF
      flag. This allows us to remove test instructions that redundantly
      recalculate the flag.
      
      llvm-svn: 181937
      8f169742
  2. May 15, 2013
    • Hal Finkel's avatar
      Implement PPC counter loops as a late IR-level pass · 25c1992b
      Hal Finkel authored
      The old PPCCTRLoops pass, like the Hexagon pass version from which it was
      derived, could only handle some simple loops in canonical form. We cannot
      directly adapt the new Hexagon hardware loops pass, however, because the
      Hexagon pass contains a fundamental assumption that non-constant-trip-count
      loops will contain a guard, and this is not always true (the result being that
      incorrect negative counts can be generated). With this commit, we replace the
      pass with a late IR-level pass which makes use of SE to calculate the
      backedge-taken counts and safely generate the loop-count expressions (including
      any necessary max() parts). This IR level pass inserts custom intrinsics that
      are lowered into the desired decrement-and-branch instructions.
      
      The most fragile part of this new implementation is that interfering uses of
      the counter register must be detected on the IR level (and, on PPC, this also
      includes any indirect branches in addition to function calls). Also, to make
      all of this work, we need a variant of the mtctr instruction that is marked
      as having side effects. Without this, machine-code level CSE, DCE, etc.
      illegally transform the resulting code. Hopefully, this can be improved
      in the future.
      
      This new pass is smaller than the original (and much smaller than the new
      Hexagon hardware loops pass), and can handle many additional cases correctly.
      In addition, the preheader-creation code has been copied from LoopSimplify, and
      after we decide on where it belongs, this code will be refactored so that it
      can be explicitly shared (making this implementation even smaller).
      
      The new test-case files ctrloop-{le,lt,ne}.ll have been adapted from tests for
      the new Hexagon pass. There are a few classes of loops that this pass does not
      transform (noted by FIXMEs in the files), but these deficiencies can be
      addressed within the SE infrastructure (thus helping many other passes as well).
      
      llvm-svn: 181927
      25c1992b
    • Hal Finkel's avatar
      Fix legalization of SETCC with promoted integer intrinsics · 1f6a7f53
      Hal Finkel authored
      If the input operands to SETCC are promoted, we need to make sure that we
      either use the promoted form of both operands (or neither); a mixture is not
      allowed. This can happen, for example, if a target has a custom promoted
      i1-returning intrinsic (where i1 is not a legal type). In this case, we need to
      use the promoted form of both operands.
      
      This change only augments the behavior of the existing logic in the case where
      the input types (which may or may not have already been legalized) disagree,
      and should not affect existing target code because this case would otherwise
      cause an assert in the SETCC operand promotion code.
      
      This will be covered by (essentially all of the) tests for the new PPCCTRLoops
      infrastructure.
      
      llvm-svn: 181926
      1f6a7f53
    • Derek Schuff's avatar
      Fix miscompile due to StackColoring incorrectly merging stack slots (PR15707) · d2c42d76
      Derek Schuff authored
      IR optimisation passes can result in a basic block that contains:
      
        llvm.lifetime.start(%buf)
        ...
        llvm.lifetime.end(%buf)
        ...
        llvm.lifetime.start(%buf)
      
      Before this change, calculateLiveIntervals() was ignoring the second
      lifetime.start() and was regarding %buf as being dead from the
      lifetime.end() through to the end of the basic block.  This can cause
      StackColoring to incorrectly merge %buf with another stack slot.
      
      Fix by removing the incorrect Starts[pos].isValid() and
      Finishes[pos].isValid() checks.
      
      Just doing:
            Starts[pos] = Indexes->getMBBStartIdx(MBB);
            Finishes[pos] = Indexes->getMBBEndIdx(MBB);
      unconditionally would be enough to fix the bug, but it causes some
      test failures due to stack slots not being merged when they were
      before.  So, in order to keep the existing tests passing, treat LiveIn
      and LiveOut separately rather than approximating the live ranges by
      merging LiveIn and LiveOut.
      
      This fixes PR15707.
      Patch by Mark Seaborn.
      
      llvm-svn: 181922
      d2c42d76
    • Rafael Espindola's avatar
      Cleanup relocation sorting for ELF. · 0f2a6fe6
      Rafael Espindola authored
      We want the order to be deterministic on all platforms. NAKAMURA Takumi
      fixed that in r181864. This patch is just two small cleanups:
      
      * Move the function to the cpp file. It is only passed to array_pod_sort.
      * Remove the ppc implementation which is now redundant
      
      llvm-svn: 181910
      0f2a6fe6
    • NAKAMURA Takumi's avatar
      PPCISelLowering.h: Escape \@ in comments. [-Wdocumentation] · dc9f013a
      NAKAMURA Takumi authored
      llvm-svn: 181907
      dc9f013a
    • NAKAMURA Takumi's avatar
      Whitespace. · dcc66456
      NAKAMURA Takumi authored
      llvm-svn: 181906
      dcc66456
    • Michael Gottesman's avatar
      [objc-arc] Fixed a spelling error and made the statistic descriptions be... · b4e7f4d8
      Michael Gottesman authored
      [objc-arc] Fixed a spelling error and made the statistic descriptions be consistent about their usage of periods.
      
      llvm-svn: 181901
      b4e7f4d8
    • Derek Schuff's avatar
      Support unaligned load/store on more ARM targets · 72ddaba7
      Derek Schuff authored
      This patch matches GCC behavior: the code used to only allow unaligned
      load/store on ARM for v6+ Darwin, it will now allow unaligned load/store for
      v6+ Darwin as well as for v7+ on other targets.
      
      The distinction is made because v6 doesn't guarantee support (but LLVM assumes
      that Apple controls hardware+kernel and therefore have conformant v6 CPUs),
      whereas v7 does provide this guarantee (and Linux behaves sanely).
      
      Overall this should slightly improve performance in most cases because of
      reduced I$ pressure.
      
      Patch by JF Bastien
      
      llvm-svn: 181897
      72ddaba7
    • Ulrich Weigand's avatar
      · 06840768
      Ulrich Weigand authored
      Remove MCELFObjectTargetWriter::adjustFixupOffset hack
      
      Now that PowerPC no longer uses adjustFixupOffset, and no other
      back-end (ever?) did, we can remove the infrastructure itself
      (incidentally addressing a FIXME to that effect).
      
      llvm-svn: 181895
      06840768
Loading