Skip to content
  1. Jan 05, 2015
    • Karthik Bhat's avatar
      Select lower fsub,fabs pattern to fabd on AArch64 · 93f27ce8
      Karthik Bhat authored
      This patch lowers patterns such as-
        fsub   v0.4s, v0.4s, v1.4s
        fabs   v0.4s, v0.4s
      to
        fabd  v0.4s, v0.4s, v1.4s
      on AArch64.
      
      Review: http://reviews.llvm.org/D6791
      llvm-svn: 225169
      93f27ce8
    • Charlie Turner's avatar
      Parse Tag_compatibility correctly. · 6632d1f6
      Charlie Turner authored
      Tag_compatibility takes two arguments, but before this patch it would
      erroneously accept just one, it now produces an error in that case.
      
      Change-Id: I530f918587620d0d5dfebf639944d6083871ef7d
      llvm-svn: 225167
      6632d1f6
    • Charlie Turner's avatar
      Emit the build attribute Tag_conformance. · 8b2caa45
      Charlie Turner authored
      Claim conformance to version 2.09 of the ARM ABI.
      
      This build attribute must be emitted first amongst the build attributes when
      written to an object file. This is to simplify conformance detection by
      consumers.
      
      Change-Id: If9eddcfc416bc9ad6e5cc8cdcb05d0031af7657e
      llvm-svn: 225166
      8b2caa45
    • Karthik Bhat's avatar
      Select lower sub,abs pattern to sabd on AArch64 · 8ec742c2
      Karthik Bhat authored
      This patch lowers patterns such as-
        sub	v0.4s, v0.4s, v1.4s
        abs	v0.4s, v0.4s
      to
        sabd	v0.4s, v0.4s, v1.4s
      on AArch64.
      
      Review: http://reviews.llvm.org/D6781
      llvm-svn: 225165
      8ec742c2
    • Michael Kuperstein's avatar
      Fix broken test from r225159. · 6ae456b0
      Michael Kuperstein authored
      llvm-svn: 225164
      6ae456b0
    • Chandler Carruth's avatar
      [PM] Don't run the machinery of invalidating all the analysis passes · 539dc4b9
      Chandler Carruth authored
      when all are being preserved.
      
      We want to short-circuit this for a couple of reasons. One, I don't
      really want passes to grow a dependency on actually receiving their
      invalidate call when they've been preserved. I'm thinking about removing
      this entirely. But more importantly, preserving everything is likely to
      be the common case in a lot of scenarios, and it would be really good to
      bypass all of the invalidation and preservation machinery there.
      Avoiding calling N opaque functions to try to invalidate things that are
      by definition still valid seems important. =]
      
      This wasn't really inpsired by much other than seeing the spam in the
      logging for analyses, but it seems better ot get it checked in rather
      than forgetting about it.
      
      llvm-svn: 225163
      539dc4b9
    • Chandler Carruth's avatar
      [PM] Add names and debug logging for analysis passes to the new pass · e5e8fb3b
      Chandler Carruth authored
      manager.
      
      This starts to allow us to test analyses more easily, but it's really
      only the beginning. Some of the code here is still untestable without
      manual changes to create analysis passes, but I wanted to factor it into
      a small of chunks as possible.
      
      Next up in order to be able to test things are, in no particular order:
      - No-op analyses passes so we don't have to use real ones to exercise
        the pass maneger itself.
      - Automatic way of generating dummy passes that require an analysis be
        run, including a variant that calls a 'print' method on a pass to make
        it even easier to print out the results of an analysis.
      - Dummy passes that invalidate all analyses for their IR unit so we can
        test invalidation and re-runs.
      - Automatic way to print each analysis pass as it is re-run.
      - Automatic but optional verification of analysis passes everywhere
        possible.
      
      I'm not claiming I'll get to all of these immediately, but that's what
      is in the pipeline at some stage. I'm fleshing out exactly what I need
      and what to prioritize by working on converting analyses and then trying
      to test the conversion. =]
      
      llvm-svn: 225162
      e5e8fb3b
    • Craig Topper's avatar
    • Jiangning Liu's avatar
      Fixed a bug in memory dependence checking module of loop vectorization. The... · 40c1b352
      Jiangning Liu authored
      Fixed a bug in memory dependence checking module of loop vectorization. The following loop should not be vectorized with current algorithm.
      
      {code}
      // loop body
         ... = a[i]          (1)
          ... = a[i+1]       (2)
       .......
      a[i+1] = ....          (3)
         a[i] = ...          (4)
      {code}
      
      The algorithm tries to collect memory access candidates from AliasSetTracker, and then check memory dependences one another. The memory accesses are unique in AliasSetTracker, and a single memory access in AliasSetTracker may map to multiple entries in AccessAnalysis, which could cover both 'read' and 'write'. Originally the algorithm only checked 'write' entry in Accesses if only 'write' exists. This is incorrect and the consequence is it ignored all read access, and finally some RAW and WAR dependence are missed.
      
      For the case given above, if we ignore two reads, the dependence between (1) and (3) would not be able to be captured, and finally this loop will be incorrectly vectorized.
      
      The fix simply inserts a new loop to find all entries in Accesses. Since it will skip most of all other memory accesses by checking the Value pointer at the very beginning of the loop, it should not increase compile-time visibly.
      
      llvm-svn: 225159
      40c1b352
    • Michael Gottesman's avatar
      Convert SmallMapVector from a class to a struct. · 9e674942
      Michael Gottesman authored
      llvm-svn: 225158
      9e674942
    • Craig Topper's avatar
      [X86] Remove the predicates from the register forms of the 2-byte inc and dec... · dc2fc803
      Craig Topper authored
      [X86] Remove the predicates from the register forms of the 2-byte inc and dec instructions. Remove the 32-bit mode only versions that existed for the disassembler. Move the patterns out of the instructions so they can still be qualified with predicates.
      
      llvm-svn: 225157
      dc2fc803
    • Craig Topper's avatar
    • Craig Topper's avatar
      [X86] Remove unnecessary redeclaration of a variable with the same assignment... · 859677ed
      Craig Topper authored
      [X86] Remove unnecessary redeclaration of a variable with the same assignment as the beginning of the function. NFC.
      
      llvm-svn: 225155
      859677ed
    • Craig Topper's avatar
      [X86] Remove a strange fixme referring to a hack that doesn't seem to exist... · 9cf67c6f
      Craig Topper authored
      [X86] Remove a strange fixme referring to a hack that doesn't seem to exist since the code is in a comment. Can't figure out what the body of the 'if' was supposed to be anyway.
      
      llvm-svn: 225154
      9cf67c6f
    • Craig Topper's avatar
      [x86] Reduce text duplication for similar operand class declarations in... · e9e081cd
      Craig Topper authored
      [x86] Reduce text duplication for similar operand class declarations in tablegen instruction info. No functional change intended.
      
      llvm-svn: 225153
      e9e081cd
    • Craig Topper's avatar
      [X86] Fix the immediate size to match the address size in the operand types... · 21f98496
      Craig Topper authored
      [X86] Fix the immediate size to match the address size in the operand types for the move to/from absolute memory instructions.
      
      llvm-svn: 225152
      21f98496
    • Craig Topper's avatar
      [X86] Remove unused operand type from disassembler handling. NFC · 62c0525b
      Craig Topper authored
      llvm-svn: 225151
      62c0525b
    • Hal Finkel's avatar
      [PowerPC] Enable speculation of cttz/ctlz · 9bb61de1
      Hal Finkel authored
      PPC has an instruction for ctlz with defined zero behavior, and our lowering of
      cttz (provided by DAGCombine) is also efficient and branchless, so speculating
      these makes sense.
      
      llvm-svn: 225150
      9bb61de1
    • Chandler Carruth's avatar
      [SROA] Apply a somewhat heavy and unpleasant hammer to fix PR22093, an · 73b0164f
      Chandler Carruth authored
      assert out of the new pre-splitting in SROA.
      
      This fix makes the code do what was originally intended -- when we have
      a store of a load both dealing in the same alloca, we force them to both
      be pre-split with identical offsets. This is really quite hard to do
      because we can keep discovering problems as we go along. We have to
      track every load over the current alloca which for any resaon becomes
      invalid for pre-splitting, and go back to remove all stores of those
      loads. I've included a couple of test cases derived from PR22093 that
      cover the different ways this can happen. While that PR only really
      triggered the first of these two, its the same fundamental issue.
      
      The other challenge here is documented in a FIXME now. We end up being
      quite a bit more aggressive for pre-splitting when loads and stores
      don't refer to the same alloca. This aggressiveness comes at the cost of
      introducing potentially redundant loads. It isn't clear that this is the
      right balance. It might be considerably better to require that we only
      do pre-splitting when we can presplit every load and store involved in
      the entire operation. That would give more consistent if conservative
      results. Unfortunately, it requires a non-trivial change to the actual
      pre-splitting operation in order to correctly handle cases where we end
      up pre-splitting stores out-of-order. And it isn't 100% clear that this
      is the right direction, although I'm starting to suspect that it is.
      
      llvm-svn: 225149
      73b0164f
    • Hal Finkel's avatar
      [LangRef] Correct a typo · 5dd8278f
      Hal Finkel authored
      llvm-svn: 225148
      5dd8278f
    • Hal Finkel's avatar
      [PowerPC] Materialize i64 constants using rotation with masking · 2f61879f
      Hal Finkel authored
      r225135 added the ability to materialize i64 constants using rotations in order
      to reduce the instruction count. Sometimes we can use a rotation only with some
      extra masking, so that we take advantage of the fact that generating a bunch of
      extra higher-order 1 bits is easy using li/lis.
      
      llvm-svn: 225147
      2f61879f
    • Chandler Carruth's avatar
      [PM] Cleanup a place where I forgot to update the header guards when · cd17f8fc
      Chandler Carruth authored
      renaming a file from AssumptionTracker.h to AssumptionCache.h.
      
      Thanks to Philip Reames for noticing and pointing it out in code review!
      
      llvm-svn: 225146
      cd17f8fc
    • Chandler Carruth's avatar
      [PM] Switch the new pass manager to use a reference-based API for IR · d174ce4a
      Chandler Carruth authored
      units.
      
      This was debated back and forth a bunch, but using references is now
      clearly cleaner. Of all the code written using pointers thus far, in
      only one place did it really make more sense to have a pointer. In most
      cases, this just removes immediate dereferencing from the code. I think
      it is much better to get errors on null IR units earlier, potentially
      at compile time, than to delay it.
      
      Most notably, the legacy pass manager uses references for its routines
      and so as more and more code works with both, the use of pointers was
      likely to become really annoying. I noticed this when I ported the
      domtree analysis over and wrote the entire thing with references only to
      have it fail to compile. =/ It seemed better to switch now than to
      delay. We can, of course, revisit this is we learn that references are
      really problematic in the API.
      
      llvm-svn: 225145
      d174ce4a
    • Chandler Carruth's avatar
      [PM] Wire up support for explicitly running the verifier pass. · 9c31db4f
      Chandler Carruth authored
      The required functionality has been there for some time, but I never
      managed to actually wire it into the command line registry of passes.
      Let's do that.
      
      llvm-svn: 225144
      9c31db4f
    • Chandler Carruth's avatar
      [PM] Cleanup a const_cast and other machinery left over in this code · 75c11b88
      Chandler Carruth authored
      from before I removed thet non-const use of the function.
      
      The unused variable that held the const_cast was already kindly removed
      by Michael.
      
      llvm-svn: 225143
      75c11b88
  2. Jan 04, 2015
    • Simon Pilgrim's avatar
      [X86][SSE] Added vector packing test for pr12412 · b65a6ee8
      Simon Pilgrim authored
      llvm-svn: 225138
      b65a6ee8
    • Simon Pilgrim's avatar
      [X86][SSE] Added vector integer truncation tests - based off pr15524 · a1540c11
      Simon Pilgrim authored
      llvm-svn: 225137
      a1540c11
    • Hal Finkel's avatar
      [PowerPC] Materialize i64 constants using rotation · 241ba79f
      Hal Finkel authored
      Materializing full 64-bit constants on PPC64 can be expensive, requiring up to
      5 instructions depending on the locations of the non-zero bits. Sometimes
      materializing a rotated constant, and then applying the inverse rotation, requires
      fewer instructions than the direct method. If so, do that instead.
      
      In r225132, I added support for forming constants using bit inversion. In
      effect, this reverts that commit and replaces it with rotation support. The bit
      inversion is useful for turning constants that are mostly ones into ones that
      are mostly zeros (thus enabling a more-efficient shift-based materialization),
      but the same effect can be obtained by using negative constants and a rotate,
      and that is at least as efficient, if not more.
      
      llvm-svn: 225135
      241ba79f
    • Michael Kuperstein's avatar
      Fix unused variable warning for non-asserts builds. NFC. · 58c3f6cc
      Michael Kuperstein authored
      llvm-svn: 225133
      58c3f6cc
    • Hal Finkel's avatar
      [PowerPC] Materialize i64 constants using bit inversion · ca6375fb
      Hal Finkel authored
      Materializing full 64-bit constants on PPC64 can be expensive, requiring up to
      5 instructions depending on the locations of the non-zero bits. Sometimes
      materializing the bit-reversed constant, and then flipping the bits, requires
      fewer instructions than the direct method. If so, do that instead.
      
      llvm-svn: 225132
      ca6375fb
    • Chandler Carruth's avatar
      [PM] Split the AssumptionTracker immutable pass into two separate APIs: · 66b3130c
      Chandler Carruth authored
      a cache of assumptions for a single function, and an immutable pass that
      manages those caches.
      
      The motivation for this change is two fold. Immutable analyses are
      really hacks around the current pass manager design and don't exist in
      the new design. This is usually OK, but it requires that the core logic
      of an immutable pass be reasonably partitioned off from the pass logic.
      This change does precisely that. As a consequence it also paves the way
      for the *many* utility functions that deal in the assumptions to live in
      both pass manager worlds by creating an separate non-pass object with
      its own independent API that they all rely on. Now, the only bits of the
      system that deal with the actual pass mechanics are those that actually
      need to deal with the pass mechanics.
      
      Once this separation is made, several simplifications become pretty
      obvious in the assumption cache itself. Rather than using a set and
      callback value handles, it can just be a vector of weak value handles.
      The callers can easily skip the handles that are null, and eventually we
      can wrap all of this up behind a filter iterator.
      
      For now, this adds boiler plate to the various passes, but this kind of
      boiler plate will end up making it possible to port these passes to the
      new pass manager, and so it will end up factored away pretty reasonably.
      
      llvm-svn: 225131
      66b3130c
    • David Majnemer's avatar
      InstCombine: match can find ConstantExprs, don't assume we have a Value · 087dc8b8
      David Majnemer authored
      We assumed the output of a match was a Value, this would cause us to
      assert because we would fail a cast<>.  Instead, use a helper in the
      Operator family to hide the distinction between Value and Constant.
      
      This fixes PR22087.
      
      llvm-svn: 225127
      087dc8b8
    • David Majnemer's avatar
      ValueTracking: ComputeNumSignBits should tolerate misshapen phi nodes · 6ee8d17b
      David Majnemer authored
      PHI nodes can have zero operands in the middle of a transform.  It is
      expected that utilities in Analysis don't freak out when this happens.
      
      Note that it is considered invalid to allow these misshapen phi nodes to
      make it to another pass.
      
      This fixes PR22086.
      
      llvm-svn: 225126
      6ee8d17b
    • Lang Hames's avatar
      [APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero. · 12b12e80
      Lang Hames authored
      This patch adds a check for underflow when truncating results back to lower
      precision at the end of an FMA. The additional sign handling logic in
      APFloat::fusedMultiplyAdd should only be performed when the result of the
      addition step of the FMA (in full precision) is exactly zero, not when the
      result underflows to zero.
      
      Unit tests for this case and related signed zero FMA results are included.
      
      Fixes <rdar://problem/18925551>.
      
      llvm-svn: 225123
      12b12e80
  3. Jan 03, 2015
    • Saleem Abdulrasool's avatar
      llvm-readobj: add support to dump COFF export tables · ddd92644
      Saleem Abdulrasool authored
      This enhances llvm-readobj to print out the COFF export table, similar to the
      -coff-import option.  This is useful for testing in lld.
      
      llvm-svn: 225120
      ddd92644
    • Saleem Abdulrasool's avatar
      ARM: permit tail calls to weak externals on COFF · 67f72993
      Saleem Abdulrasool authored
      Weak externals are resolved statically, so we can actually generate the tail
      call on PE/COFF targets without breaking the requirements.  It is questionable
      whether we want to propagate the current behaviour for MachO as the requirements
      are part of the ARM ELF specifications, and it seems that prior to the SVN
      r215890, we would have tail'ed the call.  For now, be conservative and only
      permit it on PE/COFF where the call will always be fully resolved.
      
      llvm-svn: 225119
      67f72993
    • Hal Finkel's avatar
      [PowerPC/BlockPlacement] Allow target to provide a per-loop alignment preference · 5772566e
      Hal Finkel authored
      The existing code provided for specifying a global loop alignment preference.
      However, the preferred loop alignment might depend on the loop itself. For
      recent POWER cores, loops between 5 and 8 instructions should have 32-byte
      alignment (while the others are better with 16-byte alignment) so that the
      entire loop will fit in one i-cache line.
      
      To support this, getPrefLoopAlignment has been made virtual, and can be
      provided with an optional MachineLoop* so the target can inspect the loop
      before answering the query. The default behavior, as before, is to return the
      value set with setPrefLoopAlignment. MachineBlockPlacement now queries the
      target for each loop instead of only once per function. There should be no
      functional change for other targets.
      
      llvm-svn: 225117
      5772566e
    • Hal Finkel's avatar
      [PowerPC] Use 16-byte alignment for modern cores for functions/loops · d73bfba7
      Hal Finkel authored
      Most modern PowerPC cores prefer that functions and loops start on
      16-byte-aligned boundaries (*), so instruct block placement, etc. to make this
      happen. The branch selector has also been adjusted so account for the extra
      nops that might now be inserted before loop headers.
      
      (*) Some cores actually prefer other alignments for small loops, but that will
          be addressed in a follow-up commit.
      
      llvm-svn: 225115
      d73bfba7
    • Craig Topper's avatar
      Minor cleanup to all the switches after MatchInstructionImpl in all the AsmParsers. · 589ceee7
      Craig Topper authored
      Make sure they all have llvm_unreachable on the default path out of the switch. Remove unnecessary "default: break". Remove a 'return' after unreachable. Fix some indentation.
      
      llvm-svn: 225114
      589ceee7
    • Craig Topper's avatar
      Fix some formatting in tablegen output. · a5754e6e
      Craig Topper authored
      llvm-svn: 225113
      a5754e6e
Loading