1. Sep 12, 2016
    • Pablo Barrio's avatar
      Fix the Thumb test for vfloat intrinsics · 0bebc38a
      Pablo Barrio authored
      Summary:
      This test was not testing the intrinsics. A function like this:
      
      define %v4f32 @test_v4f32.floor(%v4f32 %a){
      ...
              %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a)
      ...
      }
      
      is transformed into the following assembly:
      
      _test_v4f32.floor:              @ @test_v4f32.floor
      ...
              bl _floorf
      ...
      
      In each function tested, there are two CHECK: one that checked
      for the label and another one for the intrinsic that should be used
      inside the function (in our case, "floor"). However, although the
      first CHECK was matching the label, the second was not matching the
      intrinsic, but the second "floor" in the same line as the label.
      
      This is fixed by making the first CHECK match the entire line.
      
      Reviewers: jmolloy, rengolin
      
      Subscribers: rengolin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D24398
      
      llvm-svn: 281211
      0bebc38a
    • Rafael Espindola's avatar
      Store an ArrayRef for Data in InputSectionData. · c7e1e034
      Rafael Espindola authored
      llvm-svn: 281210
      c7e1e034
    • Rafael Espindola's avatar
      Revert "Revert "Compact InputSectionData from 64 to 48 bytes. NFC."" · 54f1614e
      Rafael Espindola authored
      This reverts commit r281096.
      
      The previous link errors should be fixed by r281208.
      
      llvm-svn: 281209
      54f1614e
    • Rafael Espindola's avatar
      Define a dummy zlib::uncompress when zlib is not available. · 74941239
      Rafael Espindola authored
      Should fix link errors in some bots when it is used.
      
      llvm-svn: 281208
      74941239
    • Tim Northover's avatar
      GlobalISel: support translation of global addresses. · 032548fc
      Tim Northover authored
      llvm-svn: 281207
      032548fc
    • Daniel Marjamaki's avatar
      [clang-tidy] readability-misplaced-array-index: add new check that warns when... · 03ea468a
      Daniel Marjamaki authored
      [clang-tidy] readability-misplaced-array-index: add new check that warns when array index is misplaced.
      
      Reviewers: alexfh
      
      Differential Revision: https://reviews.llvm.org/D21134
      
      llvm-svn: 281206
      03ea468a
    • Tim Northover's avatar
      GlobalISel: translate GEP instructions. · a7653b39
      Tim Northover authored
      Unlike SDag, we use a separate G_GEP instruction (much simplified, only taking
      a single byte offset) to preserve the pointer type information through
      selection.
      
      llvm-svn: 281205
      a7653b39
    • Tim Northover's avatar
      GlobalISel: disambiguate types when printing MIR · d28d3cc0
      Tim Northover authored
      Some generic instructions have multiple types. While in theory these always be
      discovered by inspecting the single definition of each generic vreg, in
      practice those definitions won't always be local and traipsing through a big
      function to find them will not be fun.
      
      So this changes MIRPrinter to print out the type of uses as well as defs, if
      they're known to be different or not known to be the same.
      
      On the parsing side, we're a little more flexible: provided each register is
      given a type in at least one place it's mentioned (and all types are
      consistent) we accept the MIR. This doesn't introduce ambiguity but makes
      writing tests manually a bit less painful.
      
      llvm-svn: 281204
      d28d3cc0
    • Daniel Jasper's avatar
      clang-format: Make emacs integration work with narrowed buffers. · c6a12311
      Daniel Jasper authored
      Use (call-process region nil ...) instead of (point-min) so that the
      call works in narrowed buffers.
      
      Patch by Philipp Stephani, thank you!
      
      llvm-svn: 281203
      c6a12311
    • Eugene Leviant's avatar
      [ELF/AArch64] Implement some UABS relocs · 99da7529
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D24403
      
      llvm-svn: 281202
      99da7529
    • Eric Liu's avatar
      Fix WebAssembly broken build related to interface change in r281172. · c7e5a9ce
      Eric Liu authored
      Reviewers: bkramer
      
      Subscribers: jfb, llvm-commits, dschuff
      
      Differential Revision: https://reviews.llvm.org/D24449
      
      llvm-svn: 281201
      c7e5a9ce
    • Martin Bohme's avatar
      [CFG] Add iterator_ranges to CFG and CFGBlock. · 0eb4403f
      Martin Bohme authored
      Summary: (Needed for D23353.)
      
      Reviewers: alexfh
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23842
      
      llvm-svn: 281200
      0eb4403f
    • Ilia K's avatar
      Add MiSyntaxTestCase.test_lldbmi_output_grammar test (MI) · 94df34f7
      Ilia K authored
      Summary: This patch adds a new test and fixes extra new-line before exit
      
      Reviewers: abidh
      
      Subscribers: ki.stfu, dawn, lldb-commits, abidh
      
      Differential Revision: https://reviews.llvm.org/D9740
      
      llvm-svn: 281199
      94df34f7
    • Richard Smith's avatar
      Add virtual destructor (necessary due to the switch to shared_ptr). · 67462ffc
      Richard Smith authored
      llvm-svn: 281198
      67462ffc
    • Richard Smith's avatar
      Attempt #3 to placate MSVC. · 94a2fe5c
      Richard Smith authored
      llvm-svn: 281197
      94a2fe5c
    • Elena Demikhovsky's avatar
      de1b4945
    • Richard Smith's avatar
      Attempt #2 to placate MSVC · c14994f2
      Richard Smith authored
      llvm-svn: 281195
      c14994f2
    • Richard Smith's avatar
      Attempt to placate MSVC. · cd608d1a
      Richard Smith authored
      llvm-svn: 281194
      cd608d1a
    • Tobias Grosser's avatar
      GPGPU: Bail out gracefully in case of invalid IR · 5857b701
      Tobias Grosser authored
      Instead of aborting, we now bail out gracefully in case the kernel IR we
      generate is invalid. This can currently happen in case the SCoP stores
      pointer values, which we model as arrays, as data values into other arrays. In
      this case, the original pointer value is not available on the device and can
      consequently not be stored. As detecting this ahead of time is not so easy, we
      detect these situations after the invalid IR has been generated and bail out.
      
      llvm-svn: 281193
      5857b701
    • Richard Smith's avatar
      Add a mode to clang-tblgen to generate reference documentation for warning and · b6a3b4ba
      Richard Smith authored
      remark flags. For now I'm checking in a copy of the built documentation, but we
      can replace this with a placeholder (as we do for the attributes reference
      documentation) once we enable building this server-side.
      
      llvm-svn: 281192
      b6a3b4ba
    • Ilia K's avatar
      Fix about a dozen compile warnings · 4f730dc7
      Ilia K authored
      Summary:
      It fixes the following compile warnings:
      1. '0' flag ignored with precision and ‘%d’ gnu_printf format
      2. enumeral and non-enumeral type in conditional expression
      3. format ‘%d’ expects argument of type ‘int’, but argument 4 has type ...
      4. enumeration value ‘...’ not handled in switch
      5. cast from type ‘const uint64_t* {aka ...}’ to type ‘int64_t* {aka ...}’ casts away qualifiers
      6. extra ‘;’
      7. comparison between signed and unsigned integer expressions
      8. variable ‘register_operand’ set but not used
      9. control reaches end of non-void function
      
      Reviewers: jingham, emaste, zturner, clayborg
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D24331
      
      llvm-svn: 281191
      4f730dc7
    • NAKAMURA Takumi's avatar
      llvm/test/CodeGen/AMDGPU/infinite-loop-evergreen.ll REQUIRES +Asserts. · cf6aaa9e
      NAKAMURA Takumi authored
      This might not *crash* with -Asserts. I saw it caused infinite loop in the codegen.
      
      llvm-svn: 281190
      cf6aaa9e
    • David Majnemer's avatar
      [MS ABI] Add /include directives for dynamic TLS · cb60a430
      David Majnemer authored
      MSVC emits /include directives in the .drective section for the
      __dyn_tls_init function (decorated as ___dyn_tls_init@12 for 32-bit).
      
      This fixes PR30347.
      
      llvm-svn: 281189
      cb60a430
    • Duncan P. N. Exon Smith's avatar
      MC: Move MCSection::begin/end to header, NFC · cd0fffb6
      Duncan P. N. Exon Smith authored
      llvm-svn: 281188
      cd0fffb6
    • Sanjay Patel's avatar
      60312bc4
    • Sanjay Patel's avatar
      [InstCombine] regenerate checks · f9ca7702
      Sanjay Patel authored
      llvm-svn: 281186
      f9ca7702
    • Sanjay Patel's avatar
      [InstCombine] regenerate checks · a2aabfcc
      Sanjay Patel authored
      llvm-svn: 281185
      a2aabfcc
    • Duncan P. N. Exon Smith's avatar
      ADT: Never allocate nodes in iplist<> and ilist<> · b5da0053
      Duncan P. N. Exon Smith authored
      Remove createNode() and any API that depending on it, and add
      HasCreateNode to the list of checks for HasObsoleteCustomizations.  Now
      an ilist *never* allocates (this was already true for iplist).
      
      This factors out all the differences between iplist and ilist.  I'll aim
      to rename both to "owning_ilist" eventually, to call out the interesting
      (not exactly intrusive) ownership semantics.  In the meantime, I've left
      both names around to reduce code churn.
      
      One of the deleted APIs is the ilist copy constructor.  I've lifted up
      and tested iplist::cloneFrom (ala simple_ilist::cloneFrom) as a
      replacement.
      
      Users of ilist<> and iplist<> that want the list to allocate nodes have
      a few options:
      - use std::list;
      - use AllocatorList or BumpPtrList (or build a similarly trivial list);
      - use cloneFrom (which is explicit at the call site); or
      - allocate at the call site.
      
      See r280573, r281177, r281181, and r281182 for examples of what to do if
      you're updating out-of-tree code.
      
      llvm-svn: 281184
      b5da0053
    • Duncan P. N. Exon Smith's avatar
      ADT: Fix build after r281182 · eaf28276
      Duncan P. N. Exon Smith authored
      Fix this bot:
        http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/20680
      
      which complained that a typedef of 'iterator_adaptor_base' changed
      meaning in AllocatorList::IteratorImpl.  Use 'base_type' there instead.
      
      llvm-svn: 281183
      eaf28276
    • Duncan P. N. Exon Smith's avatar
      ADT: Add AllocatorList, and use it for yaml::Token · 23d8306d
      Duncan P. N. Exon Smith authored
      - Add AllocatorList, a non-intrusive list that owns an LLVM-style
        allocator and provides a std::list-like interface (trivially built on
        top of simple_ilist),
      - add a typedef (and unit tests) for BumpPtrList, and
      - use BumpPtrList for the list of llvm::yaml::Token (i.e., TokenQueueT).
      
      TokenQueueT has no need for the complexity of an intrusive list.  The
      only reason to inherit from ilist was to customize the allocator.
      TokenQueueT was the only example in-tree of using ilist<> in a truly
      non-intrusive way.
      
      Moreover, this removes the final use of the non-intrusive
      ilist_traits<>::createNode (after r280573, r281177, and r281181).  I
      have a WIP patch that removes this customization point (and the API that
      relies on it) that I plan to commit soon.
      
      Note: AllocatorList owns the allocator, which limits the viable API
      (e.g., splicing must be on the same list).  For now I've left out
      any problematic API.  It wouldn't be hard to split AllocatorList into
      two layers: an Impl class that calls DerivedT::getAlloc (via CRTP), and
      derived classes that handle Allocator ownership/reference/etc semantics;
      and then implement splice with appropriate assertions; but TBH we should
      probably just customize the std::list allocators at that point.
      
      llvm-svn: 281182
      23d8306d
    • Duncan P. N. Exon Smith's avatar
      Analysis: Only allow the move-constructor for IVUsers · 3013ea1b
      Duncan P. N. Exon Smith authored
      Force IVUsers to be moved instead of copied, properly update Parent
      pointers in IVStrideUse when IVUsers is moved, and make sure we have
      move constructors available in iplist and ilist.
      
      I came across this in a WIP patch that deleted the copy constructors
      from ilist.  I was surprised to find that IVUsersAnalysis couldn't be
      registered in the new pass manager.
      
      It's not clear to me whether IVUsers was getting moved only when empty,
      but if it was being moved when it was non-empty then this fixes a
      pointer invalidation bug and should give some sort of speedup.  Note
      that the bugfix would be necessary even for a copy constructor.
      
      llvm-svn: 281181
      3013ea1b
    • Craig Topper's avatar
      [TwoAddressInstruction] When commuting an instruction don't assume that the... · 7600794d
      Craig Topper authored
      [TwoAddressInstruction] When commuting an instruction don't assume that the destination register is operand 0. Pass it from the caller.
      
      In practice it probably is 0 so this may not be a functional change.
      
      llvm-svn: 281180
      7600794d
    • Asiri Rathnayake's avatar
      [libcxx] Introduce an externally-threaded libc++ variant. · 8c2bf45d
      Asiri Rathnayake authored
      This patch further decouples libc++ from pthread, allowing libc++ to be built
      against other threading systems. There are two main use cases:
      
      - Building libc++ against a thread library other than pthreads.
      
      - Building libc++ with an "external" thread API, allowing a separate library to
        provide the implementation of that API.
      
      The two use cases are quite similar, the second one being sligtly more
      de-coupled than the first. The cmake option LIBCXX_HAS_EXTERNAL_THREAD_API
      enables both kinds of builds. One needs to place an <__external_threading>
      header file containing an implementation of the "libc++ thread API" declared
      in the <__threading_support> header.
      
      For the second use case, the implementation of the libc++ thread API can
      delegate to a custom "external" thread API where the implementation of this
      external API is provided in a seperate library. This mechanism allows toolchain
      vendors to distribute a build of libc++ with a custom thread-porting-layer API
      (which is the "external" API above), platform vendors (recipients of the
      toolchain/libc++) are then required to provide their implementation of this API
      to be linked with (end-user) C++ programs.
      
      Note that the second use case still requires establishing the basic types that
      get passed between the external thread library and the libc++ library
      (e.g. __libcpp_mutex_t). These cannot be opaque pointer types (libc++ sources
      won't compile otherwise). It should also be noted that the second use case can
      have a slight performance penalty; as all the thread constructs need to cross a
      library boundary through an additional function call.
      
      When the header <__external_threading> is omitted, libc++ is built with the
      "libc++ thread API" (declared in <__threading_support>) as the "external" thread
      API (basic types are pthread based). An implementation (pthread based) of this
      API is provided in test/support/external_threads.cpp, which is built into a
      separate DSO and linked in when running the libc++ test suite. A test run
      therefore demonstrates the second use case (less the intermediate custom API).
      
      Differential revision: https://reviews.llvm.org/D21968
      
      Reviewers: bcraig, compnerd, EricWF, mclow.lists
      llvm-svn: 281179
      8c2bf45d
    • Lang Hames's avatar
      [ORC] Update examples for header changes in r281171. · 958b6998
      Lang Hames authored
      llvm-svn: 281178
      958b6998
    • Duncan P. N. Exon Smith's avatar
      ScalarOpts: Use std::list for Candidates, NFC · 8b4e4af5
      Duncan P. N. Exon Smith authored
      There is nothing intrusive about the Candidate list; use std::list over
      llvm::ilist for simplicity.
      
      llvm-svn: 281177
      8b4e4af5
    • Duncan P. N. Exon Smith's avatar
      ScalarOpts: Sort includes, NFC · 077f5b41
      Duncan P. N. Exon Smith authored
      llvm-svn: 281176
      077f5b41
    • Duncan P. N. Exon Smith's avatar
      ADT: Remove ilist_iterator::reset(), NFC · 0e63013f
      Duncan P. N. Exon Smith authored
      ilist_iterator::reset was unnecessary API, and wasn't any clearer (or
      safer) at the call site than constructing a temporary and assigning it
      to the iterator.
      
      llvm-svn: 281175
      0e63013f
    • Lang Hames's avatar
      [ORC] Fix the RPC unit test for header changes in r281171. · 3e718e08
      Lang Hames authored
      llvm-svn: 281173
      3e718e08
    • Duncan P. N. Exon Smith's avatar
      CodeGen: Give MachineBasicBlock::reverse_iterator a handle to the current MI · 1872096f
      Duncan P. N. Exon Smith authored
      Now that MachineBasicBlock::reverse_instr_iterator knows when it's at
      the end (since r281168 and r281170), implement
      MachineBasicBlock::reverse_iterator directly on top of an
      ilist::reverse_iterator by adding an IsReverse template parameter to
      MachineInstrBundleIterator.  This replaces another hard-to-reason-about
      use of std::reverse_iterator on list iterators, matching the changes for
      ilist::reverse_iterator from r280032 (see the "out of scope" section at
      the end of that commit message).  MachineBasicBlock::reverse_iterator
      now has a handle to the current node and has obvious invalidation
      semantics.
      
      r280032 has a more detailed explanation of how list-style reverse
      iterators (invalidated when the pointed-at node is deleted) are
      different from vector-style reverse iterators like std::reverse_iterator
      (invalidated on every operation).  A great motivating example is this
      commit's changes to lib/CodeGen/DeadMachineInstructionElim.cpp.
      
      Note: If your out-of-tree backend deletes instructions while iterating
      on a MachineBasicBlock::reverse_iterator or converts between
      MachineBasicBlock::iterator and MachineBasicBlock::reverse_iterator,
      you'll need to update your code in similar ways to r280032.  The
      following table might help:
      
                        [Old]              ==>             [New]
              delete &*RI, RE = end()                   delete &*RI++
              RI->erase(), RE = end()                   RI++->erase()
            reverse_iterator(I)                 std::prev(I).getReverse()
            reverse_iterator(I)                          ++I.getReverse()
          --reverse_iterator(I)                            I.getReverse()
            reverse_iterator(std::next(I))                 I.getReverse()
                      RI.base()                std::prev(RI).getReverse()
                      RI.base()                         ++RI.getReverse()
                    --RI.base()                           RI.getReverse()
           std::next(RI).base()                           RI.getReverse()
      
      (For more details, have a look at r280032.)
      
      llvm-svn: 281172
      1872096f
    • Lang Hames's avatar
      [ORC] Rename RPCChannel to RPCByteChannel. NFC. · e98bc7af
      Lang Hames authored
      llvm-svn: 281171
      e98bc7af