1. Mar 08, 2018
    • Gheorghe-Teodor Bercea's avatar
      [OpenMP] Remove implicit data sharing using device shared memory from libomptarget · 7a5fa21a
      Gheorghe-Teodor Bercea authored
      Summary:
      This patch reverts the changes to libomptarget that were coupled with the changes to Clang code gen for data sharing using shared memory. A similar patch exists for Clang: D43625
      
      Shared memory is meant to be used as an optimization on top of a more general scheme. So far we didn't have a global memory implementation ready so shared memory was a solution which applied to the current level of OpenMP complexity supported by trunk on GPU devices (due to the missing NVPTX backend patch this functionality has never been exercised). Now that we have a global memory solution this patch is "in the way" and needs to be removed (for now). This patch (or an equivalent version of it) will be put out for review once the global memory scheme is in place.
      
      
      Reviewers: ABataev, grokos, carlo.bertolli, caomhin
      
      Reviewed By: grokos
      
      Subscribers: Hahnfeld, guansong, openmp-commits
      
      Differential Revision: https://reviews.llvm.org/D43626
      
      llvm-svn: 326950
      7a5fa21a
    • Sebastian Pop's avatar
      [AArch64] add missing pattern for insert_subvector undef · 33bdb3e0
      Sebastian Pop authored
      The attached testcase started failing after the patch to define
      isExtractSubvectorCheap with the following pattern mismatch:
      
      ISEL: Starting pattern match
        Initial Opcode index to 85068
          Match failed at index 85076
          LLVM ERROR: Cannot select: t47: v8i16 = insert_subvector undef:v8i16, t43, Constant:i64<0>
      
      The code generated from llvm/lib/Target/AArch64/AArch64InstrInfo.td
      
      def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i32 0)),
                (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;
      
      is in ninja/lib/Target/AArch64/AArch64GenDAGISel.inc
      At the location of the error it is:
      /* 85076*/    OPC_CheckChild2Type, MVT::i32,
      
      And it failed to match the type of operand 2.
      Adding another def-pat for i64 fixes the failed def-pat error:
      
      def : Pat<(insert_subvector undef, (v4i16 FPR64:$src), (i64 0)),
                (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), FPR64:$src, dsub)>;
      
      llvm-svn: 326949
      33bdb3e0
    • Gheorghe-Teodor Bercea's avatar
      [OpenMP] Remove implicit data sharing code gen that aims to use device shared memory · 7d80da15
      Gheorghe-Teodor Bercea authored
      Summary: Remove this scheme for now since it will be covered by another more generic scheme using global memory. This code will be worked into an optimization for the generic data sharing scheme. Removing this completely and then adding it via future patches will make all future data sharing patches cleaner.
      
      Reviewers: ABataev, carlo.bertolli, caomhin
      
      Reviewed By: ABataev
      
      Subscribers: jholewinski, guansong, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D43625
      
      llvm-svn: 326948
      7d80da15
    • Simon Marchi's avatar
      [clangd] Remove unused field in HandlerRegisterer · 6e8eb9d2
      Simon Marchi authored
      Summary: Tested by rebuilding.
      
      Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D44213
      
      llvm-svn: 326947
      6e8eb9d2
    • Yaxun Liu's avatar
      CodeGen: Fix address space of indirect function argument · 06dd8114
      Yaxun Liu authored
      The indirect function argument is in alloca address space in LLVM IR. However,
      during Clang codegen for C++, the address space of indirect function argument
      should match its address space in the source code, i.e., default addr space, even
      for indirect argument. This is because destructor of the indirect argument may
      be called in the caller function, and address of the indirect argument may be
      taken, in either case the indirect function argument is expected to be in default
      addr space, not the alloca address space.
      
      Therefore, the indirect function argument should be mapped to the temp var
      casted to default address space. The caller will cast it to alloca addr space
      when passing it to the callee. In the callee, the argument is also casted to the
      default address space and used.
      
      CallArg is refactored to facilitate this fix.
      
      Differential Revision: https://reviews.llvm.org/D34367
      
      llvm-svn: 326946
      06dd8114
    • Krasimir Georgiev's avatar
      [clang-format] Break consecutive string literals in text protos · 9ad7af64
      Krasimir Georgiev authored
      Summary:
      This patch fixes a bug where consecutive string literals in text protos were
      put on the same line.
      
      Reviewers: alexfh
      
      Reviewed By: alexfh
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D44204
      
      llvm-svn: 326945
      9ad7af64
    • Fangrui Song's avatar
      [ELF] Update test/ELF/eh-frame-hdr-augmentation.s · d8139348
      Fangrui Song authored
      llvm-svn: 326944
      d8139348
    • Zachary Turner's avatar
      Revert "Write a hash of the executable into the PE timestamp fields." · 0b4af043
      Zachary Turner authored
      This is breaking a couple of tests, so I'm reverting temporarily
      until I can get everything resolved properly.
      
      llvm-svn: 326943
      0b4af043
    • Matthew Voss's avatar
      0a6a701f
    • Jake Ehrlich's avatar
      Revert "[llvm-objcopy] Add support for large indexes" · 8b831c1d
      Jake Ehrlich authored
      Not all build bots have unzip which I used in a test.
      
      This reverts commit 0b1f26d39ea42dd3716b525fbc8c78d8c7bb4479.
      
      llvm-svn: 326941
      8b831c1d
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add support for large indexes · 0a151bd6
      Jake Ehrlich authored
      Because of -ffunction-sections (and maybe other use cases I'm not aware of?) it
      can occur that we need more than 0xfeff sections but ELF dosn't support that
      many sections. To solve this problem SHN_XINDEX exists and with it come a whole
      host of changes for section indexes everywhere. This change adds support for
      those cases which should allow llvm-objcopy to copy binaries that have an
      arbitrary number of sections.
      
      Differential Revision: https://reviews.llvm.org/D42516
      
      llvm-svn: 326940
      0a151bd6
    • Craig Topper's avatar
      [X86] Remove unused function argument. NFC · 80ec0c31
      Craig Topper authored
      llvm-svn: 326939
      80ec0c31
    • Vitaly Buka's avatar
      1732ee75
    • Yaxun Liu's avatar
      [OpenCL] Remove block invoke function from emitted block literal struct · cb35e9fa
      Yaxun Liu authored
      OpenCL runtime tracks the invoke function emitted for
      any block expression. Due to restrictions on blocks in
      OpenCL (v2.0 s6.12.5), it is always possible to know the
      block invoke function when emitting call of block expression
      or __enqueue_kernel builtin functions. Since __enqueu_kernel
      already has an argument for the invoke function, it is redundant
      to have invoke function member in the llvm block literal structure.
      
      This patch removes invoke function from the llvm block literal
      structure. It also removes the bitcast of block invoke function
      to the generic block literal type which is useless for OpenCL.
      
      This will save some space for the kernel argument, and also
      eliminate some store instructions.
      
      Differential Revision: https://reviews.llvm.org/D43783
      
      llvm-svn: 326937
      cb35e9fa
    • Daniel Sanders's avatar
      Fix cmake's multi-config generators after r326738 · 6cf299cf
      Daniel Sanders authored
      LLVM_ENABLE_STATS isn't known at configure-time in these generators so we must
      defer it to build-time.
      
      llvm-svn: 326936
      6cf299cf
    • George Karpenkov's avatar
      [analyzer] [NFC] Minor refactoring of NonNullParamChecker · 65e64917
      George Karpenkov authored
      Differential Revision: https://reviews.llvm.org/D43917
      
      llvm-svn: 326935
      65e64917
    • Rui Ueyama's avatar
      Use exact uint32_t for uint32_t ELF field. NFC. · 301305fd
      Rui Ueyama authored
      llvm-svn: 326934
      301305fd
    • Rui Ueyama's avatar
      Initialize a member in C++11 style. NFC. · 5aa2db1e
      Rui Ueyama authored
      llvm-svn: 326933
      5aa2db1e
    • Rafael Auler's avatar
      [DebugInfo] Support DWARF expressions in eh_frame · 7fdf4444
      Rafael Auler authored
      This patch enhances DWARFDebugFrame with the capability of parsing and
      printing DWARF expressions in CFI instructions. It also makes FDEs and
      CIEs accessible to lib users, so they can process them in client tools
      that rely on LLVM. To make it self-contained with a test case, it
      teaches llvm-readobj to be able to dump EH frames and checks they are
      correct in a unit test. The llvm-readobj code is Maksim Panchenko's work
      (maksfb).
      
      Reviewers: JDevlieghere, espindola
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D43313
      
      llvm-svn: 326932
      7fdf4444
    • Matt Morehouse's avatar
      [lld] Attempt to appease buildbot. · 915b4dbf
      Matt Morehouse authored
      r326903 broke the conflict-debug-variable.s test.
      
      llvm-svn: 326931
      915b4dbf
    • Simon Pilgrim's avatar
      [X86][SSE] Regenerate float maxnum/minnum tests · dc1a0385
      Simon Pilgrim authored
      llvm-svn: 326930
      dc1a0385
    • Zachary Turner's avatar
      Fix a bug regarding a mis-identified file type in pdbutil. · 49f8674c
      Zachary Turner authored
      llvm-svn: 326929
      49f8674c
    • Yan Zhang's avatar
      do not register matcher for objc-only checks when analyzing non-objc sources to save resources · c7faee73
      Yan Zhang authored
      Summary: I did not put lang opt check in AvoidSpinlockCheck since OSSpinLock is not objc specific. We won't want to skip it when analyzing some C++ target used by other ObjC sources.
      
      Reviewers: hokein, benhamilton
      
      Reviewed By: benhamilton
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D44174
      
      llvm-svn: 326928
      c7faee73
    • Zachary Turner's avatar
      Update a few switch statements to handle file_magic::pdb. · aac28f31
      Zachary Turner authored
      This fixes a couple of warnings.
      
      llvm-svn: 326927
      aac28f31
    • Reid Kleckner's avatar
      Push a function scope when parsing function bodies without a declaration · b2da0861
      Reid Kleckner authored
      Summary:
      This is PR36536.
      
      There are a few ways to reach Sema::ActOnStartOfFunctionDef with a null
      Decl. Currently, the parser continues on to attempt to parse the
      statements in the function body without pushing a function scope or
      declaration context. However, lots of statement parsing logic relies on
      getCurFunction() returning something reasonable. It turns out that
      getCurFunction() will never return null today because of an optimization
      where Sema pre-allocates one FunctionScopeInfo and reuses it when
      possible. This goes wrong when something inside the function body causes
      us to push another function scope, such as requiring an implicit
      definition of a special member function. Reusing the state clears it
      out, which will lead to bugs. In PR36536, we found that the SwitchStack
      gets unbalanced, because we push a switch, clear out the stack, and then
      try to pop a switch that isn't there.
      
      As a follow-up, I plan to move the pre-allocated FunctionScopeInfo out
      of the FunctionScopes stack. This means the FunctionScopes stack will
      often be empty, and callers of getCurFunction() will need to check for
      null.
      
      Reviewers: thakis
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D43980
      
      llvm-svn: 326926
      b2da0861
    • Roorda, Jan-Willem's avatar
      [Pipeliner] Fixed node order issue related to zero latency edges · 4b8bcf00
      Roorda, Jan-Willem authored
      Summary:
      A desired property of the node order in Swing Modulo Scheduling is
      that for nodes outside circuits the following holds: none of them is
      scheduled after both a successor and a predecessor. We call
      node orders that meet this property valid.
      
      Although invalid node orders do not lead to the generation of incorrect
      code, they can cause the pipeliner not being able to find a pipelined schedule
      for arbitrary II. The reason is that after scheduling the successor and the
      predecessor of a node, no room may be left to schedule the node itself.
      
      For data flow graphs with 0-latency edges, the node ordering algorithm
      of Swing Modulo Scheduling can generate such undesired invalid node orders.
      This patch fixes that.
      
      In the remainder of this commit message, I will give an example
      demonstrating the issue, explain the fix, and explain how the the fix is tested.
      
      Consider, as an example, the following data flow graph with all
      edge latencies 0 and all edges pointing downward.
      
      ```
         n0
        /  \
      n1    n3
        \  /
         n2
          |
         n4
      ```
      
      Consider the implemented node order algorithm in top-down mode. In that mode,
      the algorithm orders the nodes based on greatest Height and in case of equal
      Height on lowest Movability. Finally, in case of equal Height and
      Movability, given two nodes with an edge between them, the algorithm prefers
      the source-node.
      
      In the graph, for every node, the Height and Movability are equal to 0.
      As will be explained below, the algorithm can generate the order n0, n1, n2, n3, n4.
      So, node n3 is scheduled after its predecessor n0 and after its successor n2.
      
      The reason that the algorithm can put node n2 in the order before node n3,
      even though they have an edge between them in which node n3 is the source,
      is the following: Suppose the algorithm has constructed the partial node
      order n0, n1. Then, the nodes left to be ordered are nodes n2, n3, and n4. Suppose
      that the while-loop in the implemented algorithm considers the nodes in
      the order n4, n3, n2. The algorithm will start with node n4, and look for
      more preferable nodes. First, node n4 will be compared with node n3. As the nodes
      have equal Height and Movability and have no edge between them, the algorithm
      will stick with node n4. Then node n4 is compared with node n2. Again the
      Height and Movability are equal. But, this time, there is an edge between
      the two nodes, and the algorithm will prefer the source node n2.
      As there are no nodes left to compare, the algorithm will add node n2 to
      the node order, yielding the partial node order n0, n1, n2. In this way node n2
      arrives in the node-order before node n3.
      
      To solve this, this patch introduces the ZeroLatencyHeight (ZLH) property
      for nodes. It is defined as the maximum unweighted length of a path from the
      given node to an arbitrary node in which each edge has latency 0.
      So, ZLH(n0)=3, ZLH(n1)=ZLH(n3)=2, ZLH(n2)=1, and ZLH(n4)=0
      
      In this patch, the preference for a greater ZeroLatencyHeight
      is added in the top-down mode of the node ordering algorithm, after the
      preference for a greater Height, and before the preference for a
      lower Movability.
      
      Therefore, the two allowed node-orders are n0, n1, n3, n2, n4 and n0, n3, n1, n2, n4.
      Both of them are valid node orders.
      
      In the same way, the bottom-up mode of the node ordering algorithm is adapted
      by introducing the ZeroLatencyDepth property for nodes.
      
      The patch is tested by adding extra checks to the following existing
      lit-tests:
      test/CodeGen/Hexagon/SUnit-boundary-prob.ll
      test/CodeGen/Hexagon/frame-offset-overflow.ll
      test/CodeGen/Hexagon/vect/vect-shuffle.ll
      
      Before this patch, the pipeliner failed to pipeline the loops in these tests
      due to invalid node-orders. After the patch, the pipeliner successfully
      pipelines all these loops.
      
      Reviewers: bcahoon
      
      Reviewed By: bcahoon
      
      Subscribers: Ayal, mgrang, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D43620
      
      llvm-svn: 326925
      4b8bcf00
    • Zachary Turner's avatar
      Teach identify_file_magic to identify PDB files. · d860fa64
      Zachary Turner authored
      llvm-svn: 326924
      d860fa64
    • Stefan Pintilie's avatar
      [PowerPC] Move test to correct location. · f8c2dce2
      Stefan Pintilie authored
      Test was added in r326906 to an incorrect location.
      Moving the test to PPC CodeGen directory as the test is PPC specific.
      
      llvm-svn: 326923
      f8c2dce2
    • Alexey Bataev's avatar
      [OPENMP] Fix lifetime of the loop counters. · ab4ea225
      Alexey Bataev authored
      We may emit incorrect lifetime info during codegen for loop counters in
      OpenMP constructs because of automatic scope cleanup when we needed
      temporarily locations for private loop counters.
      
      llvm-svn: 326922
      ab4ea225
    • Petr Hosek's avatar
      [Fuzzer] Avoid the unnecessary rebuild of the custom libc++ · 2d19f903
      Petr Hosek authored
      This changes the add_custom_libcxx macro to resemble the
      llvm_ExternalProject_Add. The primary motivation is to avoid
      unnecessary libFuzzer rebuilds that are being done on every
      Ninja/Make invocation. The libc++ should be only rebuilt whenever
      the libc++ source itself changes.
      
      Differential Revision: https://reviews.llvm.org/D43213
      
      llvm-svn: 326921
      2d19f903
    • Zachary Turner's avatar
      Write a hash of the executable into the PE timestamp fields. · 69f3347b
      Zachary Turner authored
      Windows tools treats the timestamp fields as sort of a build id,
      using it to archive executables on a symbol server, as well as
      for matching executables to PDBs.  We were writing 0 for these
      fields, which would cause symbol servers to break as they are
      indexed in the symbol server based on this value.
      
      Although the field is called timestamp, it can really be any
      value that is unique per build, so to support reproducible builds
      we use a hash of the executable here.
      
      Differential Revision: https://reviews.llvm.org/D43978
      
      llvm-svn: 326920
      69f3347b
    • Davide Italiano's avatar
      [lldbtestsuite] llvm-objcopy is now required to run the lit tests. · c0311fe1
      Davide Italiano authored
      There's now a test using llvm-objcopy in lit/.
      This doesn't fail on the bot(s) because `llvm-objcopy` is probably
      already available there, but if you get a fresh checkout and run
      `ninja check-lldb` you'll observe the failure as it's not tracking
      the dependency correctly. This fixes the problem on my machine,
      and probably everywhere else.
      
      llvm-svn: 326919
      c0311fe1
    • George Rimar's avatar
      [ELF] - Adjust rangeToString to report ranges in a different format. · bf3c3846
      George Rimar authored
      It was raised during the review of D43819.
      
      LLD usually use [X, Y] for reporting ranges, like below:
      "relocation R_386_16 out of range: 65536 is not in [0, 65535]"
      
      Patch changes rangeToString() to do the same.
      
      Differential revision: https://reviews.llvm.org/D44207
      
      llvm-svn: 326918
      bf3c3846
    • Craig Topper's avatar
      [X86] Make the MUL->VPMADDWD work before op legalization on AVX1 targets.... · c3c15dd6
      Craig Topper authored
      [X86] Make the MUL->VPMADDWD work before op legalization on AVX1 targets. Simplify feature checks by using isTypeLegal.
      
      The v8i32 conversion on AVX1 targets was only working after LowerMUL splits 256-bit vectors.
      
      While I was there I've also made it so we don't have to check for AVX2 and BWI directly and instead just ask if the type is legal.
      
      Differential Revision: https://reviews.llvm.org/D44190
      
      llvm-svn: 326917
      c3c15dd6
    • Craig Topper's avatar
      [Support] Stop passing StringRefs by const reference in some of the... · 8665f59e
      Craig Topper authored
      [Support] Stop passing StringRefs by const reference in some of the getHostCPUname implementations. NFC
      
      llvm-svn: 326916
      8665f59e
    • Krzysztof Parzyszek's avatar
      [Hexagon] Rewrite non-HVX unaligned loads as pairs of aligned ones · 2c3edf05
      Krzysztof Parzyszek authored
      This is a follow-up to r325169, this time for all types, not just HVX
      vector types.
      
      Disable this by default, since it's not always safe. 
      
      llvm-svn: 326915
      2c3edf05
    • Rui Ueyama's avatar
      Revert r326911: Improve --warn-symbol-ordering. · b0084a0e
      Rui Ueyama authored
      This reverts commit r326911 because it was committed by accident.
      
      llvm-svn: 326914
      b0084a0e
    • Sanjay Patel's avatar
      [LangRef] fix formatting in FP descriptions; NFC · 7b722405
      Sanjay Patel authored
      This is a clean-up step to reduce diffs ahead of real
      changes to the FP semantics as discussed on llvm-dev:
      http://lists.llvm.org/pipermail/llvm-dev/2018-February/121444.html
      
      llvm-svn: 326913
      7b722405
    • Rui Ueyama's avatar
      Rename Indent{1,2} -> Indent{8,16}. · e1847da9
      Rui Ueyama authored
      llvm-svn: 326912
      e1847da9
    • Rui Ueyama's avatar
      Improve --warn-symbol-ordering. · ebfab927
      Rui Ueyama authored
      Summary:
      I originally tried to simplify code and then noticed that lld doesn't
      do what it tells to the user by warn(). It says "unable to order
      discarded symbol" but it actually can for sections eliminated by ICF.
      With this patch, lld doesn't sort such sections.
      
      Reviewers: jhenderson, rafael
      
      Subscribers: emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D44180
      
      llvm-svn: 326911
      ebfab927