1. Oct 16, 2019
    • Sam Parker's avatar
      [ARM][ParallelDSP] Change smlad insertion order · 1c3ca612
      Sam Parker authored
      Instead of inserting everything after the 'root' of the reduction,
      insert all instructions as close to their operands as possible. This
      can help reduce register pressure.
      
      Differential Revision: https://reviews.llvm.org/D67392
      
      llvm-svn: 374981
      1c3ca612
    • Sjoerd Meijer's avatar
      [HardwareLoops] Optimisation remarks · ad763751
      Sjoerd Meijer authored
      This adds the initial plumbing to support optimisation remarks in
      the IR hardware-loop pass.
      
      I have left a todo in a comment where we can improve the reporting,
      and will iterate on that now that we have this initial support in.
      
      Differential Revision: https://reviews.llvm.org/D68579
      
      llvm-svn: 374980
      ad763751
    • Orlando Cazalet-Hyams's avatar
      [NFC] Replace a linked list in LiveDebugVariables pass with a DenseMap · 8af5ada0
      Orlando Cazalet-Hyams authored
      In LiveDebugVariables.cpp:
      Prior to this patch, UserValues were grouped into linked list chains. Each
      chain was the union of two sets: { A: Matching Source variable } or
      { B: Matching virtual register }. A ptr to the heads (or 'leaders')
      of each of these chains were kept in a map with the { Source variable } used
      as the key (set A predicate) and another with { Virtual register } as key
      (set B predicate).
      
      There was a search through the chains in the function getUserValue looking for
      UserValues with matching { Source variable, Complex expression, Inlined-at
      location }. Essentially searching for a subset of A through two interleaved
      linked lists of set A and B. Importantly, by design, the subset will only
      contain one or zero elements here. That is to say a UserValue can be uniquely
      identified by the tuple { Source variable, Complex expression, Inlined-at
       location } if it exists.
      
      This patch removes the linked list and instead uses a DenseMap to map
      the tuple { Source variable, Complex expression, Inlined-at location }
      to UserValue ptrs so that the getUserValue search predicate is this map key.
      The virtual register map now maps a vreg to a SmallVector<UserVal *> so that
      set B is still available for quick searches.
      
      Reviewers: aprantl, probinson, vsk, dblaikie
      
      Reviewed By: aprantl
      
      Subscribers: russell.gallop, gbedwell, bjope, hiraditya, llvm-commits
      
      Tags: #debug-info, #llvm
      
      Differential Revision: https://reviews.llvm.org/D68816
      
      llvm-svn: 374979
      8af5ada0
    • Dan Liew's avatar
      [CMake] Disable building all Darwin libraries (except builtins) for macOS i386... · 8a5bfbe6
      Dan Liew authored
      [CMake] Disable building all Darwin libraries (except builtins) for macOS i386 when the SDK is >= 10.15.
      
      Summary:
      In the macOS 10.15 SDK the ability to link i386 binaries was removed and
      in the corresponding OS it is not possible to run macOS i386 binaries.
      
      The consequence of these changes meant that targets like `check-asan`
      would fail because:
      
      * Unit tests could not be linked for i386
      * Lit tests for i386 would fail due to not being able to execute
        compiled binaries.
      
      The simplest fix to this is to simply disable building for i386 for
      macOS when using the 10.15 SDK (or newer). This disables building the
      i386 slice for most compiler-rt libraries and consequently disables the
      unit and lit tests for macOS i386.
      
      Note that because the `DARWIN_osx_ARCHS` CMake variable is a cache
      variable this patch will have no affect on existing builds unless
      the existing cache variable is deleted. The simplest way to deal with
      this is delete existing builds and just do a fresh configure.
      
      Note this should not affect the builtins which are managed with
      the `DARWIN_osx_BUILTIN_ARCHS` CMake cache variable.
      
      For those who wish to force using a particular set of architectures when
      using newer SDKs passing `-DDARWIN_osx_ARCHS=i386;x86_64;x86_64h` to
      CMake should provide a usable (but completely unsupported) workaround.
      
      rdar://problem/55668535
      rdar://problem/47939978
      
      Reviewers: kubamracek, yln, azhar, kcc, dvyukov, vitalybuka, cryptoad, eugenis, thakis, phosek
      
      Subscribers: mgorny, #sanitizers, llvm-commits
      
      Tags: #llvm, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D68292
      
      llvm-svn: 374977
      8a5bfbe6
    • Craig Topper's avatar
      [LegalizeTypes] Don't use PromoteTargetBoolean in WidenVecOp_SETCC. · 8995daaf
      Craig Topper authored
      Similar to r374970, but I don't have a test for this.
      
      PromoteTargetBoolean is intended to be use for legalizing an
      operand that needs to be promoted. It picks its type based on
      the return from getSetccResultType and is intended to be used
      when we have freedom to pick the new type. But the return type
      we need for WidenVecOp_SETCC is completely determined by the
      type of the input node.
      
      llvm-svn: 374972
      8995daaf
    • Saar Raz's avatar
      Fix failing mangle-concept.cpp test. · 1e3e77e0
      Saar Raz authored
      llvm-svn: 374971
      1e3e77e0
    • Craig Topper's avatar
      [LegalizeTypes] Don't call PromoteTargetBoolean from SplitVecOp_VSETCC. · 7b49e8ac
      Craig Topper authored
      PromoteTargetBoolean calls getSetccResultType to get the return
      type. But we were passing it the setcc result type rather than the
      setcc input type. This causes an issue on X86 with avx512vl where
      the setcc result type for vXf16 vectors is vXi16 while the
      result type for vXi16 vectors is vXi1.
      
      There's really no guarantee that getSetccResultType is the type
      we need here. So now we just grab the extend type from
      getExtendForContent and extend to the original result VT of the
      node we're splitting.
      
      llvm-svn: 374970
      7b49e8ac
    • Ryan Prichard's avatar
      [libunwind][Android] Improve workaround for PIE zero-dlpi_addr bug · 8200dbbc
      Ryan Prichard authored
      Summary:
      The workaround added in https://reviews.llvm.org/rL299575 appears to be
      working around a bug in Android JB 4.1.x and 4.2.x (API 16 and 17).
      
      Starting in API 16, Android added support for PIE binaries, but the
      dynamic linker failed to initialize dlpi_addr to the address that the
      executable was loaded at. The bug was fixed in Android JB 4.3.x (API 18).
      
      Improve the true load bias calculation:
      
       * The code was assuming that the first segment would be the PT_PHDR
         segment. I think it's better to be explicit and search for PT_PHDR. (It
         will be almost as fast in practice.)
      
       * It's more correct to use p_vaddr rather than p_offset. If a PIE
         executable is linked with a non-zero image base (e.g. lld's
         -Wl,--image-base=xxxx), then we must use p_vaddr here.
      
      The "phdr->p_vaddr < image_base" condition seems unnecessary and maybe
      slightly wrong. If the OS were to load a binary at an address smaller than
      a vaddr in the binary, we would still want to do this workaround.
      
      The workaround is safe when the linker bug isn't present, because it
      should calculate an image_base equal to dlpi_addr. Note that with API 21
      and up, this workaround should never activate for dynamically-linked
      objects, because non-PIE executables aren't allowed.
      
      Consolidate the fix into a single block of code that calculates the true
      image base, and make it clear that the fix no longer applies after API 18.
      
      See https://github.com/android/ndk/issues/505 for details.
      
      Reviewers: mclow.lists, srhines, danalbert, compnerd
      
      Reviewed By: compnerd
      
      Subscribers: srhines, krytarowski, christof, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D68971
      
      llvm-svn: 374969
      8200dbbc
    • Saar Raz's avatar
      [Concepts] ConceptSpecializationExprs mangling · 5e34ad10
      Saar Raz authored
      Implement mangling for CSEs to match regular template-ids.
      Reviewed as part of D41569.
      
      llvm-svn: 374967
      5e34ad10
    • Julian Lettner's avatar
      Revert "[ASan] Refine diagnoses messages" · ecc4680c
      Julian Lettner authored
      This reverts commit 4d1ecadd.
      
      llvm-svn: 374965
      ecc4680c
    • Lawrence D'Anna's avatar
      update ScriptInterpreterPython to use File, not FILE* · b07823f3
      Lawrence D'Anna authored
      Summary:
      ScriptInterpreterPython needs to save and restore sys.stdout and
      friends when LLDB runs a python script.
      
      It currently does this using FILE*, which is not optimal.  If
      whatever was in sys.stdout can not be represented as a FILE*, then
      it will not be restored correctly when the script is finished.
      
      It also means that if the debugger's own output stream is not
      representable as a file, ScriptInterpreterPython will not be able
      to redirect python's  output correctly.
      
      This patch updates ScriptInterpreterPython to represent files with
      lldb_private::File, and to represent whatever the user had in
      sys.stdout as simply a PythonObject.
      
      This will make lldb interoperate better with other scripts or programs
      that need to manipulate sys.stdout.
      
      Reviewers: JDevlieghere, jasonmolenda, labath
      
      Reviewed By: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D68962
      
      llvm-svn: 374964
      b07823f3
    • Aditya Kumar's avatar
      CodeExtractor: NFC: Use Range based loop · 9d10b9d9
      Aditya Kumar authored
      Reviewers: vsk, tejohnson, fhahn
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68924
      
      llvm-svn: 374963
      9d10b9d9
    • Yitzhak Mandelbaum's avatar
      [libTooling] Put all Transformer declarations in a single namespace. · 8bb47cd8
      Yitzhak Mandelbaum authored
      Summary:
      This revision introduces a new namespace, `clang::transformer`, to hold
      the declarations for the Transformer library.
      
      Reviewers: gribozavr
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D68876
      
      llvm-svn: 374962
      8bb47cd8
    • David L. Jones's avatar
      Fix an unused variable introduced in rL374955 / rG21703543. · a3378063
      David L. Jones authored
      Even though this is a unit test, it still may be run under optimization.
      
      llvm-svn: 374961
      a3378063
    • Julian Lettner's avatar
      [ASan] Refine diagnoses messages · 4d1ecadd
      Julian Lettner authored
      The provided PC is not reliable in every case, so don't suggest
      something that does not make sense.
      
      llvm-svn: 374959
      4d1ecadd
    • Jonas Devlieghere's avatar
      [dsymutil] Support and relocate base address selection entries for debug_loc · 20c692a4
      Jonas Devlieghere authored
      Since r374600 clang emits base address selection entries. Currently
      dsymutil does not support these entries and incorrectly interprets them
      as location list entries.
      
      This patch adds support for base address selection entries in dsymutil
      and makes sure they are relocated correctly.
      
      Thanks to Dave for coming up with the test case!
      
      Differential revision: https://reviews.llvm.org/D69005
      
      llvm-svn: 374957
      20c692a4
    • Jonas Devlieghere's avatar
      [Reland][VirtualFileSystem] Support virtual working directory in the RedirectingFS · 21703543
      Jonas Devlieghere authored
      Before this patch, changing the working directory of the RedirectingFS
      would just forward to its external file system. This prevented us from
      having a working directory that only existed in the VFS mapping.
      
      This patch adds support for a virtual working directory in the
      RedirectingFileSystem. It now keeps track of its own WD in addition to
      updating the WD of the external file system. This ensures that we can
      still fall through for relative paths.
      
      This change was originally motivated by the reproducer infrastructure in
      LLDB where we want to deal transparently with relative paths.
      
      Differential revision: https://reviews.llvm.org/D65677
      
      llvm-svn: 374955
      21703543
    • Richard Smith's avatar
      PR43674: fix incorrect constant evaluation of 'switch' where no case · 61dadfc8
      Richard Smith authored
      label corresponds to the condition.
      
      llvm-svn: 374954
      61dadfc8
    • Haibo Huang's avatar
      [lldb] Creates _liblldb symlink from cmake · 208e9c01
      Haibo Huang authored
      Summary:
      This is another attempt of D67993.
      
      This change removed hard coded relative paths. This way we can generate correct result when get_python_lib() returns a different path, or LLDB_PYTHON_RELATIVE_PATH is specified directly.
      
      By moving things out of python, we are also able to correctly process more cross compile situations. E.g. .pyd vs .so for Windows.
      
      Subscribers: lldb-commits, mgorny
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D68858
      
      llvm-svn: 374953
      208e9c01
    • Richard Smith's avatar
      Remove unnecessary and inappropriate forward-declaration of Sema from · 666f9771
      Richard Smith authored
      AST.
      
      llvm-svn: 374952
      666f9771
    • Lang Hames's avatar
      [Orc] Add a method for ObjectLinkingLayer to return ownership of object buffers. · a98546eb
      Lang Hames authored
      RTDyldObjectLinkingLayer allowed clients to register a NotifyEmitted function to
      reclaim ownership of object buffers once they had been linked. This patch adds
      similar functionality to ObjectLinkingLayer: Clients can now optionally call the
      ObjectLinkingLayer::setReturnObjectBuffer method to register a function that
      will be called when discarding object buffers. If set, this function will be
      called to return ownership of the object regardless of whether the link
      succeeded or failed.
      
      Use cases for this function include debug dumping (it provides a way to dump
      all objects linked into JIT'd code) and object re-use (e.g. storing an
      object in a cache).
      
      llvm-svn: 374951
      a98546eb
    • DeForest Richards's avatar
      [Docs] Updates sidebar links and sets max-width property for div.body · 75b991eb
      DeForest Richards authored
      Updates the sidebar links for Getting Started. Also sets max-width on div.body to 1000px.
      
      llvm-svn: 374949
      75b991eb
    • Lang Hames's avatar
      [JITLink] Switch to slab allocation for InProcessMemoryManager, re-enable test. · c85d0aaa
      Lang Hames authored
      InProcessMemoryManager used to make separate memory allocation calls for each
      permission level (RW, RX, RO), which could lead to target-out-of-range errors
      if data and code were placed too far apart (this was the source of failures in
      the JITLink/AArch64 testcase when it was first landed).
      
      This patch updates InProcessMemoryManager to allocate a single slab which is
      subdivided between text and data. This should guarantee that accesses remain
      in-range provided that individual object files do not exceed 1Mb in size.
      This patch also re-enables the JITLink/AArch64 testcase.
      
      llvm-svn: 374948
      c85d0aaa
    • Julian Lettner's avatar
      [lit] Add back LitTestCase · 74b285ee
      Julian Lettner authored
      This essentially reverts a commit [1] that removed the adaptor for
      Python unittests.  The code has been slightly refactored to make it more
      additive: all code is contained in LitTestCase.py.
      
      Usage sites will require a small adaption:
      ```
      [old]
        import lit.discovery
        ...
        test_suite = lit.discovery.load_test_suite(...)
      
      [new]
        import lit.LitTestCase
        ...
        test_suite = lit.LitTestCase.load_test_suite(...)
      ```
      
      This was put back on request by Daniel Dunbar, since I wrongly assumed
      that the functionality is unused.  At least llbuild still uses this [2].
      
      [1] 70ca752c
      [2] https://github.com/apple/swift-llbuild/blob/master/utils/Xcode/LitXCTestAdaptor/LitTests.py#L16
      
      Reviewed By: ddunbar
      
      Differential Revision: https://reviews.llvm.org/D69002
      
      llvm-svn: 374947
      74b285ee
    • Digger Lin's avatar
      [XCOFF]implement parsing relocation information for 32-bit xcoff object file · 34d4bff3
      Digger Lin authored
      Summary:
          Parsing the relocation entry information for 32-bit xcoff object file
      including deal with the relocation overflow.
      
      Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue.
      
      Subscribers: hiraditya, rupprecht, seiya
      
      Differential Revision: https://reviews.llvm.org/D67008
      
      llvm-svn: 374946
      34d4bff3
    • Alexander Shaposhnikov's avatar
      [llvm-lipo] Add missing cast · 4f2f9c00
      Alexander Shaposhnikov authored
      Add missing cast (to correctly sum 32-bit integers).
      
      Test plan: make check-all
      
      llvm-svn: 374945
      4f2f9c00
    • Austin Kerbow's avatar
      AMDGPU: Fix infinite searches in SIFixSGPRCopies · 527e9f9a
      Austin Kerbow authored
      Summary:
      Two conditions could lead to infinite loops when processing PHI nodes in
      SIFixSGPRCopies.
      
      The first condition involves a REG_SEQUENCE that uses registers defined by both
      a PHI and a COPY.
      
      The second condition arises when a physical register is copied to a virtual
      register which is then used in a PHI node. If the same virtual register is
      copied to the same physical register, the result is an endless loop.
      
      %0:sgpr_64 = COPY $sgpr0_sgpr1
      %2 = PHI %0, %bb.0, %1, %bb.1
      $sgpr0_sgpr1 = COPY %0
      
      Reviewers: alex-t, rampitec, arsenm
      
      Reviewed By: rampitec
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68970
      
      llvm-svn: 374944
      527e9f9a
    • Alexey Bataev's avatar
      [OPENMP]Fix comments/params, NFC. · d498d606
      Alexey Bataev authored
      llvm-svn: 374943
      d498d606
    • Alexey Bataev's avatar
      [OPENMP]Allow final clause in combined task-based directives. · 3a842ec3
      Alexey Bataev authored
      The condition of the final clause must be captured in the combined
      task-based directives, like 'parallel master taskloop' directive.
      
      llvm-svn: 374942
      3a842ec3
    • Digger Lin's avatar
      [llvm-readobj][xcoff] implement parsing overflow section header. · 1875dcc4
      Digger Lin authored
      SUMMARY:
      in the xcoff, if the number of relocation entries or line number entries is
      overflow(large than or equal 65535) , there will be overflow section for it.
      The interpret of overflow section is different with generic section header,
      the patch implement parsing the overflow section.
      
      Reviewers: hubert.reinterpretcast,sfertile,jasonliu
      Subscribers: rupprecht, seiya
      
      Differential Revision: https://reviews.llvm.org/D68575
      
      llvm-svn: 374941
      1875dcc4
    • Thomas Lively's avatar
      [WebAssembly] Elide data segments for .bss sections · 190dacc3
      Thomas Lively authored
      Summary:
      WebAssembly memories are zero-initialized, so when module does not
      import its memory initializing .bss sections is guaranteed to be a
      no-op. To reduce binary size and initialization time, .bss sections
      are simply not emitted into the final binary unless the memory is
      imported.
      
      Reviewers: sbc100
      
      Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68965
      
      llvm-svn: 374940
      190dacc3
    • Saar Raz's avatar
      [Concept] Associated Constraints Infrastructure · 0330fba6
      Saar Raz authored
      Add code to correctly calculate the associated constraints of a template (no enforcement yet).
      D41284 on Phabricator.
      
      llvm-svn: 374938
      0330fba6
    • Sergey Dmitriev's avatar
      [Clang][OpenMP Offload] Move offload registration code to the wrapper · 5836c356
      Sergey Dmitriev authored
      The final list of OpenMP offload targets becomes known only at the link time and since offload registration code depends on the targets list it makes sense to delay offload registration code generation to the link time instead of adding it to the host part of every fat object. This patch moves offload registration code generation from clang to the offload wrapper tool.
      
      This is the last part of the OpenMP linker script elimination patch https://reviews.llvm.org/D64943
      
      Differential Revision: https://reviews.llvm.org/D68746
      
      llvm-svn: 374937
      5836c356
    • Reid Kleckner's avatar
      Fix as-w-option.c on Windows where no assembler exists · 215a8d94
      Reid Kleckner authored
      llvm-svn: 374936
      215a8d94
    • Jonas Devlieghere's avatar
      Revert "[VirtualFileSystem] Support virtual working directory in the RedirectingFS" · 409b4b5f
      Jonas Devlieghere authored
      This reverts the original commit and the follow up:
      
      Revert "[VirtualFileSystem] Support virtual working directory in the  RedirectingFS"
      Revert "[test] Update YAML mapping in VirtualFileSystemTest"
      
      llvm-svn: 374935
      409b4b5f
    • Dmitry Mikulin's avatar
      Added support for "#pragma clang section relro=<name>" · f14642f2
      Dmitry Mikulin authored
      Differential Revision: https://reviews.llvm.org/D68806
      
      llvm-svn: 374934
      f14642f2
    • Thomas Lively's avatar
      [WebAssembly] Allow multivalue types in block signature operands · 2cb27072
      Thomas Lively authored
      Summary:
      Renames `ExprType` to the more apt `BlockType` and adds a variant for
      multivalue blocks. Currently non-void blocks are only generated at the
      end of functions where the block return type needs to agree with the
      function return type, and that remains true for multivalue
      blocks. That invariant means that the actual signature does not need
      to be stored in the block signature `MachineOperand` because it can be
      inferred by `WebAssemblyMCInstLower` from the return type of the
      parent function. `WebAssemblyMCInstLower` continues to lower block
      signature operands to immediates when possible but lowers multivalue
      signatures to function type symbols. The AsmParser and Disassembler
      are updated to handle multivalue block types as well.
      
      Reviewers: aheejin, dschuff, aardappel
      
      Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68889
      
      llvm-svn: 374933
      2cb27072
    • Jian Cai's avatar
      [clang] refactor -Wa,-W test cases. · 0650355c
      Jian Cai authored
      Remove REQUIRES and only keep the clang driver tests, since the
      assembler are already tested with -Wa,--no-warn. This way we could run
      the test on non-linux platforms and catch breaks on them.
      
      llvm-svn: 374932
      0650355c
    • Jordan Rupprecht's avatar
      [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index. · eb501b1f
      Jordan Rupprecht authored
      Summary:
      When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).
      
      While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.
      
      Reviewers: grimar, jhenderson, espindola
      
      Reviewed By: grimar
      
      Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68848
      
      llvm-svn: 374931
      eb501b1f
    • Jonas Devlieghere's avatar
      [test] Update YAML mapping in VirtualFileSystemTest · 621ce379
      Jonas Devlieghere authored
      The 'bar' directory should be part of the root rather than the file
      itself.
      
      llvm-svn: 374930
      621ce379