Skip to content
  1. May 16, 2013
  2. May 15, 2013
    • Bill Wendling's avatar
      Use proper syntax. · 598123ed
      Bill Wendling authored
      llvm-svn: 181930
      598123ed
    • 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
    • Bill Wendling's avatar
      Add lldb and polly to the projects to tag. · c6e238c6
      Bill Wendling authored
      llvm-svn: 181925
      c6e238c6
    • 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
Loading