1. Apr 14, 2014
    • NAKAMURA Takumi's avatar
      Whitespace. · 58ad0c87
      NAKAMURA Takumi authored
      llvm-svn: 206154
      58ad0c87
    • NAKAMURA Takumi's avatar
      Revert r206045, "Fix shift by constants for vector." · 26afa982
      NAKAMURA Takumi authored
      It broke some builders, at least, i686.
      
      llvm-svn: 206153
      26afa982
    • Chandler Carruth's avatar
      [Allocator] Hoist the external helper function into a namespace scope · 1cc9023e
      Chandler Carruth authored
      declaration. GCC 4.7 appears to get hopelessly confused by declaring
      this function within a member function of a class template. Go figure.
      
      llvm-svn: 206152
      1cc9023e
    • Chandler Carruth's avatar
      [cleanup] Normalize YAMLParser.h's doxygen markers with '\foo' instead · a2d4d6b4
      Chandler Carruth authored
      of '@foo'. The slash variant is prefered in LLVM and the file was
      already using a mixture. =/
      
      llvm-svn: 206151
      a2d4d6b4
    • Hal Finkel's avatar
      Don't assert in BasicTTI::getMemoryOpCost for non-simple types · 56bf297e
      Hal Finkel authored
      BasicTTI::getMemoryOpCost must explicitly check for non-simple types; setting
      AllowUnknown=true with TLI->getSimpleValueType is not sufficient because, for
      example, non-power-of-two vector types return non-simple EVTs (not MVT::Other).
      
      llvm-svn: 206150
      56bf297e
    • Chandler Carruth's avatar
      [Allocator] Make the underlying allocator a template instead of an · eed3466a
      Chandler Carruth authored
      abstract interface. The only user of this functionality is the JIT
      memory manager and it is quite happy to have a custom type here. This
      removes a virtual function call and a lot of unnecessary abstraction
      from the common case where this is just a *very* thin vaneer around
      a call to malloc.
      
      Hopefully still no functionality changed here. =]
      
      llvm-svn: 206149
      eed3466a
    • Chandler Carruth's avatar
      Fix the compile from r206147 in release builds by moving a variable · 6751e258
      Chandler Carruth authored
      declaration outside of #ifndef NDEBUG -- its used elsewhere. Sorry for
      the noise.
      
      llvm-svn: 206148
      6751e258
    • Chandler Carruth's avatar
      [Allocator] Switch the BumpPtrAllocator to use a vector of pointers to · f5babf97
      Chandler Carruth authored
      slabs rather than embedding a singly linked list in the slabs
      themselves. This has a few advantages:
      
      - Better utilization of the slab's memory by not wasting 16-bytes at the
        front.
      - Simpler allocation strategy by not having a struct packed at the
        front.
      - Avoids paging every allocated slab in just to traverse them for
        deallocating or dumping stats.
      
      The latter is the really nice part. Folks have complained from time to
      time bitterly that tearing down a BumpPtrAllocator, even if it doesn't
      run any destructors, pages in all of the memory allocated. Now it won't.
      =]
      
      Also resolves a FIXME with the scaling of the slab sizes. The scaling
      now disregards specially sized slabs for allocations larger than the
      threshold.
      
      llvm-svn: 206147
      f5babf97
    • Saleem Abdulrasool's avatar
      tools: simplify symbol handling in objdump · 7050eedb
      Saleem Abdulrasool authored
      Rather than switching behaviour on whether a previous symbol has an auxiliary
      symbol record for the next count of elements, simply iterate over the auxiliary
      symbols right after processing the current symbol entry.  This makes the
      behaviour much simpler to follow and similar to llvm-readobj and yaml2obj.
      
      llvm-svn: 206146
      7050eedb
    • Saleem Abdulrasool's avatar
      tools: address possible non-null terminated filenames · d38c6b1e
      Saleem Abdulrasool authored
      If a filename is a multiple of 18 characters, there will be no null-terminator.
      This will result in an invalid access by the constructed StringRef.  Add a test
      case to exercise this and fix that handling.  Address this same vulnerability in
      llvm-readobj as well.
      
      llvm-svn: 206145
      d38c6b1e
    • Serge Pavlov's avatar
      b5f3ddc7
    • Craig Topper's avatar
      Add back some typecasts I accidentally lost in r206142. · fe5bc7b1
      Craig Topper authored
      llvm-svn: 206143
      fe5bc7b1
    • Craig Topper's avatar
      [C++11] More 'nullptr' conversion. In some cases just using a boolean check... · c0196b1b
      Craig Topper authored
      [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
      
      llvm-svn: 206142
      c0196b1b
    • Hal Finkel's avatar
      [PowerPC] [Constant Hoisting] Enable constant hoisting on PPC · 0192cbac
      Hal Finkel authored
      Implements the various TTI functions to enable constant hoisting on PPC. The
      only significant test-suite change is this:
      
      MultiSource/Benchmarks/VersaBench/bmm/bmm - 20% speedup
      (which essentially reverses the slowdown from r206120).
      
      llvm-svn: 206141
      0192cbac
    • Saleem Abdulrasool's avatar
      tools: remove duplication of coff_aux_file · 38103706
      Saleem Abdulrasool authored
      Now that COFF::coff_aux_file is defined, use that rather than redefining the
      type locally.
      
      llvm-svn: 206140
      38103706
    • Saleem Abdulrasool's avatar
      tools: avoid a string duplication · 63a0dd65
      Saleem Abdulrasool authored
      The auxiliary file records are contiguous and only contain the filename.
      Construct a StringRef directly rather than copying to a temporary buffer.
      
      Suggested by majnemer on IRC!
      
      llvm-svn: 206139
      63a0dd65
    • Saleem Abdulrasool's avatar
      MC: check machine magic when applying offset adjustments · 2c08051c
      Saleem Abdulrasool authored
      The values for the relocation type can (and do) overlap across various
      architectures.  When performing an adjustment of the emitted relocation in the
      final object file, check that the file magic matches the target for which the
      relocation type is valid (e.g. a I386 relocation is only applied to an X86
      object file, and an AMD64 relocation is only applied to an X86_64 object file).
      This was noticed while adding support for ARM WinCOFF object file emission.
      
      A test case for this is not really possible as the values for REL32 do not
      overlap on I386 and AMD64, which is why this was never noticed in practice.  The
      ARM WinCOFF emission is not yet ready to merge into the tree.
      
      llvm-svn: 206138
      2c08051c
    • Serge Pavlov's avatar
      Recognize test for overflow in integer multiplication. · 4bb54d51
      Serge Pavlov authored
      If multiplication involves zero-extended arguments and the result is
      compared as in the patterns:
      
          %mul32 = trunc i64 %mul64 to i32
          %zext = zext i32 %mul32 to i64
          %overflow = icmp ne i64 %mul64, %zext
      or
          %overflow = icmp ugt i64 %mul64 , 0xffffffff
      
      then the multiplication may be replaced by call to umul.with.overflow.
      This change fixes PR4917 and PR4918.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2814
      
      llvm-svn: 206137
      4bb54d51
    • Hal Finkel's avatar
      [PowerPC] Fix rlwimi isel when mask is not constant · d9963c75
      Hal Finkel authored
      We had been using the known-zero values of the operand of the or to construct
      the mask for an rlwimi; this is not quite correct, but fine when the mask is
      constant. When the mask is constant, then the known zeros of the operand must
      be a superset of the zeros in the mask. However, when the mask is not a
      constant, then there might be bits in the operand that are not known to be zero
      that, at runtime, might be zero in the mask. Therefore, we check that any bits
      not known to be zero *are* known to be one in the mask. Otherwise, we can't
      fold the mask with the or and shift.
      
      This was revealed as a miscompile of
      MultiSource/Benchmarks/BitBench/drop3/drop3 when I started experimenting with
      constant hoisting.
      
      llvm-svn: 206136
      d9963c75
    • Serge Pavlov's avatar
      Improve error recovery around colon. · 6a7ffbed
      Serge Pavlov authored
      Parse of nested name spacifier is modified so that it properly recovers
      if colon is mistyped as double colon in case statement.
      This patch fixes PR15133.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2870
      
      llvm-svn: 206135
      6a7ffbed
    • Tobias Grosser's avatar
      Update isl to fix memory bugs · 8e5e78e1
      Tobias Grosser authored
      llvm-svn: 206134
      8e5e78e1
    • Logan Chien's avatar
      Fix diagnostics for C-style cast to function type. · af24ad94
      Logan Chien authored
      If the C-style type cast is applied to the overloaded
      function and the destination type is function type,
      then Clang will crash with assertion failure.  For example,
      
          void foo(int);
          void foo(int, int);
          void bar() {
              typedef void (ft)(int);
              ft p = (ft)foo;
          }
      
      In this case, the overloaded function foo will be cast to
      a function type, which should be considered as an error.
      But, unfortunately, since the function resolution is using
      canonical type, the matched function will be returned, and
      result in SEGV.
      
      This patch fixes this issue by removing the assertion and
      add some error diagnostics as the one in static_cast.
      
      llvm-svn: 206133
      af24ad94
  2. Apr 13, 2014