1. Feb 14, 2020
    • Alexey Bataev's avatar
      [OPENMP50]Add cancellation support in taskloop-based directives. · e0ca4792
      Alexey Bataev authored
      According to OpenMP 5.0, cancel and cancellation point constructs are
      supported in taskloop directive. Added support for cancellation in
      taskloop, master taskloop and parallel master taskloop.
      e0ca4792
    • Fangrui Song's avatar
      [ELF] Fix a null pointer dereference when --emit-relocs and --strip-debug are used together · 6c732461
      Fangrui Song authored
      Fixes https://bugs.llvm.org//show_bug.cgi?id=44878
      
      When --strip-debug is specified, .debug* are removed from inputSections
      while .rel[a].debug* (incorrectly) remain.
      
      LinkerScript::addOrphanSections() requires the output section of a relocated
      InputSectionBase to be created first.
      
      .debug* are not in inputSections ->
      output sections .debug* are not created ->
      getOutputSectionName(.rel[a].debug*) dereferences a null pointer.
      
      Fix the null pointer dereference by deleting .rel[a].debug* from inputSections as well.
      
      Reviewed By: grimar, nickdesaulniers
      
      Differential Revision: https://reviews.llvm.org/D74510
      6c732461
    • Tatyana Krasnukha's avatar
      [lldb-vscode] Ensure that target matches the executable file · 21d09ccf
      Tatyana Krasnukha authored
      This commit fixes an issue with lldb-vscode failing to run programs that
      use different architecture/platform than the "empty" in the target.
      Original implementation was creating a default target without specifying
      the target architecture, platform or program, and then would set
      executable file through SBLaunchInfo, assuming that this would update
      architecture and platform accordingly. However this wasn't really
      happening, and architecture and platform would remain at whatever values
      were in the "empty" target. The simple solution is to create target
      already for a desired architecture and platform.
      
      Function request_attach is updated in a similar fashion.
      
      This commit also adds new JSON properties to "launch" and "attach"
      packets to allow user to override desired platform and architecture.
      This might be especially important for cases where information in ELF is
      not enough to derive those values correctly.
      
      New code has a behavior similar to LLDB MI [1], where typically IDE would
      specify target file with -file-exec-and-symbols, and then only do -exec-run
      command that would launch the process. In lldb-vscode those two actions are
      merged into one request_launch function. Similarly in the interpreter
      session, user would first do "file" command, then "process launch"
      
      Differential Revision: https://reviews.llvm.org/D70847
      
      
      Signed-off-by: default avatarAnton Kolesov <anton.kolesov@synopsys.com>
      21d09ccf
    • Greg Clayton's avatar
      Stop emitting a breakpoint for each location in a breakpoint when responding... · 9cb227f5
      Greg Clayton authored
      Stop emitting a breakpoint for each location in a breakpoint when responding to breakpoint commands.
      
      Summary: The VS Code DAP expects on response for each breakpoint that was requested. If we responsd with multiple entries for one breakpoint the VS Code UI gets out of date. Currently the VS code DAP doesn't handle one breakpoint with multiple locations. If this ever gets fixed we can modify our code.
      
      Reviewers: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D73665
      9cb227f5
    • John Brawn's avatar
      [ARM] Fix infinite loop when lowering STRICT_FP_EXTEND · 0ec57972
      John Brawn authored
      If the target has FP64 but not FP16 then we have custom lowering for FP_EXTEND
      and STRICT_FP_EXTEND with type f64. However if the extend is from f32 to f64 the
      current implementation will cause in infinite loop for STRICT_FP_EXTEND due to
      emitting a merge_values of the original node which after replacement becomes a
      merge_values of itself.
      
      Fix this by not doing anything for f32 to f64 extend when we have FP64, though
      for STRICT_FP_EXTEND we have to do the strict-to-nonstrict mutation as that
      doesn't happen automatically for opcodes with custom lowering.
      
      Differential Revision: https://reviews.llvm.org/D74559
      0ec57972
    • Alexey Bataev's avatar
      [OPENMP50]Fix handling of clauses in parallel master taskloop directive. · 18789bfe
      Alexey Bataev authored
      We need to capture correctly the value of num_tasks clause and should
      not try to emit the if clause at all in the task region.
      18789bfe
  2. Feb 13, 2020
    • Stephan Herhut's avatar
      [MLIR][GPU] Implement initial mapping from loop.parallel to gpu.launch. · 715783d4
      Stephan Herhut authored
      Summary:
      To unblock other work, this implements basic lowering based on mapping
      attributes that have to be provided on all loop.parallel. The lowering
      does not yet support reduce.
      
      Differential Revision: https://reviews.llvm.org/D73893
      715783d4
    • Sanjay Patel's avatar
      [VectorCombine] adjust tests for extract-binop; NFC · d3551516
      Sanjay Patel authored
      We want the extra-use tests to be consistent with the
      earlier single-use tests and be as cheap as possible
      in vector form to show cost model edge cases. So use
      i8 and extract from element 0 since that should be
      cheap for all x86 targets.
      d3551516
    • Alexey Bataev's avatar
      [OPENMP]Fix the test, NFC. · 578c13d1
      Alexey Bataev authored
      578c13d1
    • Sanjay Patel's avatar
      [VectorCombine] add more extract-binop tests; NFC · 5b08eaf2
      Sanjay Patel authored
      See D74495.
      5b08eaf2
    • Francesco Petrogalli's avatar
    • Sean Fertile's avatar
      [PowerPC][NFC] Small cleanup to restore CR field code in PPCFrameLowering. · b2d1e002
      Sean Fertile authored
      Skip the loop over the CalleSavedInfos in 'restoreCalleeSavedRegisters' when
      the register is a CR field and we are not targeting 32-bit ELF. This is safe
      because:
      1) The helper function 'restoreCRs' returns if the target is not 32-bit ELF,
         making all the code in the loop related to CR fields dead for every other
         subtarget. This code is only called on ELF right now, but the patch
         to extend it for AIX also needs to skip 'restoreCRs'.
      2) The loop will not otherwise modify the iterator, so the iterator
         manipulations at the bottom of the loop end up setting 'I' to its
         current value.
      
      This simplifciation allows us to remove one argument from 'restoreCRs'.
      
      Also add a helper function to determine if a register is one of the
      callee saved condition register fields.
      b2d1e002
    • Nico Weber's avatar
      a41550cf
    • Pavel Labath's avatar
      [lldb] Introduce "RegInfoBasedABI" · 12e32d32
      Pavel Labath authored
      Summary:
      This patch creates a new subclass of the ABI class in order to abstract away the
      mechanism in which we "augment" register information. This enables alternate
      augmentation strategies to be introduced.
      
      All existing ABI classes have been modified to inherit from RegInfoBasedABI, but
      they will be refactored in subsequent patches.
      
      Reviewers: JDevlieghere, jasonmolenda
      
      Subscribers: sdardis, nemanjai, kbarton, jrtc27, atanasyan, jsji, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D74243
      12e32d32
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
      22430c9d
    • Nico Weber's avatar
      [gn build] Fix sync script on renames like "Foo.cpp" -> "LLVMFoo.cpp" · 0bd6be9c
      Nico Weber authored
      Before, the script used `git log -SFoo.cpp` to find a commit where
      the number of occurrences of "Foo.cpp" changed -- but since
      a patch with
      
        + LLVMFoo.cpp
        - Foo.cpp
      
      contains the same number of instances of "Foo.cpp", the script
      incorrectly skipped this type of rename.
      
      As fix, look for '\bFoo\.cpp\b' instead and pass --pickaxe-regex
      so that we can grep for word boundaries.
      
      To test, check out 7531a503 (which renamed in llvm/lib/IR
      RemarkStreamer.cpp to LLVMRemarkStreamer.cpp) and look at the output of
      the script.  Before this change, it correctly assigned the addition
      of LLVMRemarkStreamer.cpp to 7531a503 but incorrectly assigned
      the removal of RemarkStreamer.cpp to b8a847c0.  With this, it
      correctly assigns both to 7531a503.
      0bd6be9c
    • Jeremy Morse's avatar
      [debuginfo-tests][Dexter] Fix some Windows-unfriendly Dexter behaviours · 5ee4a03b
      Jeremy Morse authored
      These are some minor things that I've run into on Windows, largely in
      error handling paths:
      
       * Giving --lldb-executable on Windows triggers a "useless option" code
         path, which touches an attribute that only exists in the
         list_debuggers tool. Switch this to use hasattr, which will work in
         all subtools.
       * We were over-decoding some text reporting errors, but only in an
         exception path
       * The path to lldb on Windows needs to be quoted (even though dexter
         isn't making use of it).
      
      Differential Revision: https://reviews.llvm.org/D74546
      5ee4a03b
    • Kirill Bobyrev's avatar
      [clangd] Expose Code Completion score to the client · ff7b5bac
      Kirill Bobyrev authored
      Summary:
      Make it possible for the client to adjust the ranking by using the score Clangd
      calculates for the completion items.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D74547
      ff7b5bac
    • Raphael Isemann's avatar
      [lldb] Replace assertTrue(a == b, "msg") with assertEquals(a, b, "msg") in the test suite · b3a0c4d7
      Raphael Isemann authored
      Summary:
      The error message from the construct `assertTrue(a == b, "msg") ` are nearly always completely useless for actually debugging the issue.
      This patch is just replacing this construct (and similar ones like `assertTrue(a != b, ...)` with the proper call to assertEqual or assertNotEquals.
      
      This patch was mostly written by a shell script with some manual verification afterwards:
      ```
      lang=python
      import sys
      
      def sanitize_line(line):
        if line.strip().startswith("self.assertTrue(") and " == " in line:
          line = line.replace("self.assertTrue(", "self.assertEquals(")
          line = line.replace(" == ", ", ", 1)
        if line.strip().startswith("self.assertTrue(") and " != " in line:
          line = line.replace("self.assertTrue(", "self.assertNotEqual(")
          line = line.replace(" != ", ", ", 1)
        return line
      
      for a in sys.argv[1:]:
        with open(a, "r") as f:
          lines = f.readlines()
        with open(a, "w") as f:
          for line in lines:
            f.write(sanitize_line(line))
      ```
      
      Reviewers: labath, JDevlieghere
      
      Reviewed By: labath
      
      Subscribers: abidh, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D74475
      b3a0c4d7
    • Alexander Belyaev's avatar
      Add '#include <functional>` to PassManager.h. · 70e6ed1d
      Alexander Belyaev authored
      Summary:
      On some platforms the build fails "std::function is not found". The include is used in
      PassManager::IRPrinterConfig::enableIRPrinting.
      
      Differential Revision: https://reviews.llvm.org/D74469
      70e6ed1d
    • Pavel Labath's avatar
      [lldb] Fix lldb-dotest · 91e0c258
      Pavel Labath authored
      to account for the new location of test files from 99451b44.
      91e0c258
    • serge-sans-paille's avatar
      Fix integration of pass plugins with llvm dylib · d21664cc
      serge-sans-paille authored
      Call llvm_process_pass_plugin from clang when in standalone mode.
      
      Differential Revision: https://reviews.llvm.org/D74464
      d21664cc
    • serge-sans-paille's avatar
      Rework go bindings so that validation works fine · e8f8873d
      serge-sans-paille authored
      Basically change the layout to please `go build` and remove references to
      `llvm-go`.
      
      Update llvm/test/Bindings/Go/ to use the system go compiler
      
      Differential Revision: https://reviews.llvm.org/D74540
      e8f8873d
    • Qiu Chaofan's avatar
      [PowerPC] Exploit VSX rounding instrs for rint · 87c77308
      Qiu Chaofan authored
      Exploit native VSX rounding instruction, x(v|s)r(d|s)pic, which does
      rounding using current rounding mode.
      
      According to C standard library, rint may raise INEXACT exception while
      nearbyint won't.
      
      Reviewed By: lkail
      
      Differential Revision: https://reviews.llvm.org/D72685
      87c77308
    • Gabor Marton's avatar
      [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax · 536456a7
      Gabor Marton authored
      Summary:
      Both EOF and the max value of unsigned char is platform dependent. In this
      patch we try our best to deduce the value of EOF from the Preprocessor,
      if we can't we fall back to -1.
      
      Reviewers: Szelethus, NoQ
      
      Subscribers: whisperity, xazax.hun, kristof.beyls, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalh
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D74473
      536456a7
    • Jeremy Morse's avatar
      [debuginfo-tests] Fix Dexter process creation failure on Windows · 26f6aa9e
      Jeremy Morse authored
      When writing the Windows dbgeng driver for Dexter, I couldn't work out why it
      would either launch a process and leave it free running, or if I started the
      process suspended, never do anything with it. The result was a hack to create
      and attach processes manually. This has been flaking out on Reids Windows
      buildbot, and clearly wasn't a good solution.
      
      Digging into this, it turns out that the "normal" cdb / windbg behaviour of
      breaking whenever we attach to a process is not the default: it has to be
      explicitly requested from the debug engine. This patch does so (by setting
      DEBUG_ENGOPT_INITIAL_BREAK in the engine options), after which we can simply
      call "CreateProcessAndAttach2" and everything automagically works.
      
      No test for this behaviour: everything was just broken before.
      
      Differential Revision: https://reviews.llvm.org/D74409
      26f6aa9e
    • Haojian Wu's avatar
      [clangd] Print the Spelled RefKind. · b1309a18
      Haojian Wu authored
      b1309a18
    • stozer's avatar
      Re-revert: Recover debug intrinsics when killing duplicated/empty blocks · 9bda7ab8
      stozer authored
      This reverts commit 61b35e41.
      
      This commit causes a timeout in chromium builds; likely to have a
      similar cause to the previous timeout issue caused by this commit (see
      6ded69f2 for more details). It is possible that there is no way to
      fix this bug that will not cause this issue; further investigations as
      to the efficiency of handling large amounts of debug info will be
      necessary.
      9bda7ab8
    • Haojian Wu's avatar
      Fix the mac buildbot failure. · 9f63255a
      Haojian Wu authored
      9f63255a
    • Christof Douma's avatar
      [clang] stop baremetal driver to append .a to lib · c49866ac
      Christof Douma authored
      When the clang baremetal driver selects the rt.builtins static library
      it prefix with "-l" and appends ".a". The result is a nonsense option
      which lld refuses to accept.
      
      Differential Revision: https://reviews.llvm.org/D73904
      
      Change-Id: Ic753b6104e259fbbdc059b68fccd9b933092d828
      c49866ac
    • Daniel Kiss's avatar
      [AArch64] Fix BTI landing pad generation. · d5a186a6
      Daniel Kiss authored
      In some cases BTI landing pad is inserted even compatible instruction
      was there already. Meta instruction does not count in this case
      therefore skip them in the check for first instructions in the function.
      
      Differential revision: https://reviews.llvm.org/D74492
      d5a186a6
    • Kerry McLaughlin's avatar
      [AArch64][SVE] Add mul/mla/mls lane & dup intrinsics · 671cbc1f
      Kerry McLaughlin authored
      Summary:
      Implements the following intrinsics:
       - @llvm.aarch64.sve.dup
       - @llvm.aarch64.sve.mul.lane
       - @llvm.aarch64.sve.mla.lane
       - @llvm.aarch64.sve.mls.lane
      
      Reviewers: c-rhodes, sdesmalen, dancgr, efriedma, rengolin
      
      Reviewed By: sdesmalen
      
      Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74222
      671cbc1f
    • Guillaume Chatelet's avatar
      Fix unneeded semi column · 961aeb7a
      Guillaume Chatelet authored
      961aeb7a
    • David Green's avatar
      [ARM] Fix ReconstructShuffle for bigendian · 9d4c5975
      David Green authored
      Simon pointed out that this function is doing a bitcast, which can be
      incorrect for big endian. That makes the lowering of VMOVN in MVE
      wrong, but the function is shared between Neon and MVE so both can
      be incorrect.
      
      This attempts to fix things by using the newly added VECTOR_REG_CAST
      instead of the BITCAST. As it may now be used on Neon, I've added the
      relevant patterns for it there too. I've also added a quick dag combine
      for it to remove them where possible.
      
      Differential Revision: https://reviews.llvm.org/D74485
      9d4c5975
    • David Green's avatar
      6505124a
    • Roman Lebedev's avatar
    • Peter Smith's avatar
      [LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols. · 29c13615
      Peter Smith authored
      Recommit of 0b4a047b
      (reverted in c2900381) to incorporate
      subsequent fix and add a warning when LLD's interworking behavior has
      changed.
      
      D73474 disabled the generation of interworking thunks for branch
      relocations to non STT_FUNC symbols. This patch handles the case of BL and
      BLX instructions to non STT_FUNC symbols. LLD would normally look at the
      state of the caller and the callee and write a BL if the states are the
      same and a BLX if the states are different.
      
      This patch disables BL/BLX substitution when the destination symbol does
      not have type STT_FUNC. This brings our behavior in line with GNU ld which
      may prevent difficult to diagnose runtime errors when switching to lld.
      
      This change does change how LLD handles interworking of symbols that do not
      have type STT_FUNC from previous versions including the 10.0 release. This
      brings LLD in line with ld.bfd but there may be programs that have not been
      linked with ld.bfd that depend on LLD's previous behavior. We emit a warning
      when the behavior changes.
      
      A summary of the difference between 10.0 and 11.0 is that for symbols
      that do not have a type of STT_FUNC LLD will not change a BL to a BLX or
      vice versa. The table below enumerates the changes
      | relocation     | STT_FUNC | bit(0) | in  | 10.0- out | 11.0+ out |
      | R_ARM_CALL     | no       | 1      | BL  | BLX       | BL        |
      | R_ARM_CALL     | no       | 0      | BLX | BL        | BLX       |
      | R_ARM_THM_CALL | no       | 1      | BLX | BL        | BLX       |
      | R_ARM_THM_CALL | no       | 0      | BL  | BLX       | BL        |
      
      Differential Revision: https://reviews.llvm.org/D73542
      29c13615
    • Pavel Labath's avatar
      [lldb] Clean up ProcessGDBRemote::DidLaunchOrAttach · 5d3926a5
      Pavel Labath authored
      - reduce indentation by removing the defensive
        GetID()!=INVALID_PROCESS_ID check -- this function is only called when
        an attach or launch succeeds
      - replace LLDB_LOGF with LLDB_LOG
      5d3926a5
    • Haojian Wu's avatar
      [clangd] Query constructors in the index during rename. · 2c5ee78d
      Haojian Wu authored
      Summary:
      Though this is not needed when using clangd's own index, other indexes
      (e.g. kythe) need it, as classes and their constructors are different
      symbols, otherwise we will miss renaming constructors.
      
      Reviewers: kbobyrev
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D74411
      2c5ee78d