1. Aug 25, 2020
  2. Aug 24, 2020
    • Gongyu Deng's avatar
      [lldb] Remote disk file/directory completion for platform commands · 3cd8d7b1
      Gongyu Deng authored
      1. Extended the gdb-remote communication related classes with disk file/directory
         completion functions;
      2. Added two common completion functions RemoteDiskFiles and
         RemoteDiskDirectories based on the functions above;
      3. Added completion for these commands:
         A. platform get-file <remote-file> <local-file>;
         B. platform put-file <local-file> <remote-file>;
         C. platform get-size <remote-file>;
         D. platform settings -w <remote-dir>;
         E. platform open file <remote-file>.
      4. Added related tests for client and server;
      5. Updated docs/lldb-platform-packets.txt.
      
      Reviewed By: labath
      
      Differential Revision: https://reviews.llvm.org/D85284
      3cd8d7b1
    • Gongyu Deng's avatar
      [lldb] common completion for process pids and process names · 19311f5c
      Gongyu Deng authored
      1. Added two common completions: `ProcessIDs` and `ProcessNames`, which are
      refactored from their original dedicated option completions;
      2. Removed the dedicated option completion functions of `process attach` and
      `platform process attach`, so that they can use arg-type-bound common
      completions instead;
      3. Bound `eArgTypePid` to the pid completion, `eArgTypeProcessName` to the
      process name completion in `CommandObject.cpp`;
      4. Added a related test case.
      
      Reviewed By: teemperor
      
      Differential Revision: https://reviews.llvm.org/D80700
      19311f5c
    • Florian Hahn's avatar
      [DSE,MemorySSA] Do not use callCapturesBefore in isReadClobber. · d1a1cce5
      Florian Hahn authored
      Using callCapturesBefore potentially improves the precision and the
      number of stores we can remove. But in practice, it seems to have very
      little impact in terms of stores removed. For example, for
      SPEC2000/SPEC2006/MultiSource with -O3 -flto, ~50 more stores are
      removed (out of ~26900 stores removed). But in terms of compile-time, it
      is very expensive and the patch gives substantial compile-time
      improvements: Geomean O3 -0.24%, ReleaseThinLTO -0.47%, ReleaseLTO-g
      -0.39%.
      
      http://llvm-compile-time-tracker.com/compare.php?from=612a0bff88ed906c83b82f079d4c49e5fecfb9d0&to=e6c86b96d20d97dd88e903a409bd8d39b6114312&stat=instructions
      d1a1cce5
    • Raphael Isemann's avatar
      [clang][NFC] Fix a GCC warning in ASTImporterTest.cpp · c9b45ce1
      Raphael Isemann authored
      Apparently only overriding one of the two CompleteType overloads causes
      GCC to emit a warning with -Woverloaded-virtual .
      c9b45ce1
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Use unmerge instead of extract in addrspace queries · 62d1fb82
      Matt Arsenault authored
      This is a bit more consistent with regular operation legalization.
      62d1fb82
    • AndreyChurbanov's avatar
      [OpenMP] Check if _MSC_VER is defined before using it · d0f4f5a1
      AndreyChurbanov authored
      Patch by mati865@gmail.com
      
      Differential Revision: https://reviews.llvm.org/D86448
      d0f4f5a1
    • Dokyung Song's avatar
      [libFuzzer] Make msan.test:SimpleCmpTest succeed with less trials. · 9659b81b
      Dokyung Song authored
      Currently SimpleCmpTest passes after 9,831,994 trials on x86_64/Linux
      when the number of given trials is 10,000,000, just a little bigger than
      that. This patch modifies SimpleCmpTest.cpp so that the test passes with less
      trials, reducing its chances of future failures as libFuzzer evolves. More
      specifically, this patch changes a 32-bit equality check to a 8-bit equality
      check, making this test pass at 4,635,303 trials.
      
      Differential Revision: https://reviews.llvm.org/D86382
      9659b81b
    • Thomas Preud'homme's avatar
      Test all CHECK-NOT in a block even if one fails · 2c913166
      Thomas Preud'homme authored
      This commit makes FileCheck print all CHECK-NOT directive failure in a
      CHECK-NOT block even if one fails. Prior to that, it would stop trying
      to match CHECK-NOT directive as soon as one in the block fails.
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D86315
      2c913166
    • Baptiste Saleil's avatar
      [PowerPC] Add clang options to control MMA support · 512e256c
      Baptiste Saleil authored
      This patch adds frontend and backend options to enable and disable
      the PowerPC MMA operations added in ISA 3.1. Instructions using these
      options will be added in subsequent patches.
      
      Differential Revision: https://reviews.llvm.org/D81442
      512e256c
    • Eduardo Caldas's avatar
      235f9f7f
    • Eduardo Caldas's avatar
      4baa163c
    • Eduardo Caldas's avatar
      [SyntaxTree] Group tests related to `using` · 90f85dfc
      Eduardo Caldas authored
      Differential Revision: https://reviews.llvm.org/D86443
      90f85dfc
    • Eduardo Caldas's avatar
      a722d6a1
    • Eduardo Caldas's avatar
      [SyntaxTree] Split FreeStandingClass tests · b4093d66
      Eduardo Caldas authored
      Differential Revision: https://reviews.llvm.org/D86440
      b4093d66
    • Eduardo Caldas's avatar
    • Eduardo Caldas's avatar
      [SyntaxTree] Split array declarator tests · 4e8dd506
      Eduardo Caldas authored
      Differential Revision: https://reviews.llvm.org/D86437
      4e8dd506
    • dongAxis's avatar
      [coroutine] should disable inline before calling coro split · 2e43acfe
      dongAxis authored
      summary:
      When callee coroutine function is inlined into caller coroutine
      function before coro-split pass, llvm will emits "coroutine should
      have exactly one defining @llvm.coro.begin". It seems that coro-early
      pass can not handle this quiet well.
      So we believe that unsplited coroutine function should not be inlined.
      This patch fix such issue by not inlining function if it has attribute
      "coroutine.presplit" (it means the function has not been splited) to
      fix this issue
      
      TestPlan: check-llvm
      
      Reviewed By: wenlei
      
      Differential Revision: https://reviews.llvm.org/D85812
      2e43acfe
    • Matt Arsenault's avatar
      GlobalISel: Improve dead instruction debug printing · 517caca3
      Matt Arsenault authored
      This was printing the "Is dead" on a separate line from the
      instruction, which was harder to follow.
      517caca3
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Use different technique for sample v3s16 values · bdb25b3c
      Matt Arsenault authored
      Avoid relying on implicit_def values, and odd sized G_INSERT/G_EXTRACT
      bdb25b3c
    • Matt Arsenault's avatar
      9b3222d5
    • Alexey Bataev's avatar
      [OPENMP]Fix PR47158, case 3: allow devic_typein nested declare target region. · bedc841a
      Alexey Bataev authored
      OpenMP 5.0 supports nested declare target regions. So, in general,it is
      allow to mark a declarationas declare target with different device_type
      or link type. Patch adds support for such kind of nesting.
      
      Differential Revision: https://reviews.llvm.org/D86239
      bedc841a
    • Francesco Petrogalli's avatar
      [llvm][LV] Replace `unsigned VF` with `ElementCount VF` [NFCI] · 5a34b3ab
      Francesco Petrogalli authored
      Changes:
      
      * Change `ToVectorTy` to deal directly with `ElementCount` instances.
      * `VF == 1` replaced with `VF.isScalar()`.
      * `VF > 1` and `VF >=2` replaced with `VF.isVector()`.
      * `VF <=1` is replaced with `VF.isZero() || VF.isScalar()`.
      * Replaced the uses of `llvm::SmallSet<ElementCount, ...>` with
         `llvm::SmallSetVector<ElementCount, ...>`. This avoids the need of an
         ordering function for the `ElementCount` class.
      * Bits and pieces around printing the `ElementCount` to string streams.
      
      To guarantee that this change is a NFC, `VF.Min` and asserts are used
      in the following places:
      
      1. When it doesn't make sense to deal with the scalable property, for
      example:
         a. When computing unrolling factors.
         b. When shuffle masks are built for fixed width vector types
      In this cases, an
      assert(!VF.Scalable && "<mgs>") has been added to make sure we don't
      enter coepaths that don't make sense for scalable vectors.
      2. When there is a conscious decision to use `FixedVectorType`. These
      uses of `FixedVectorType` will likely be removed in favour of
      `VectorType` once the vectorizer is generic enough to deal with both
      fixed vector types and scalable vector types.
      3. When dealing with building constants out of the value of VF, for
      example when computing the vectorization `step`, or building vectors
      of indices. These operation _make sense_ for scalable vectors too,
      but changing the code in these places to be generic and make it work
      for scalable vectors is to be submitted in a separate patch, as it is
      a functional change.
      4. When building the potential VFs in VPlan. Making the VPlan generic
      enough to handle scalable vectorization factors is a functional change
      that needs a separate patch. See for example `void
      LoopVectorizationPlanner::buildVPlans(unsigned MinVF, unsigned
      MaxVF)`.
      5. The class `IntrinsicCostAttribute`: this class still uses `unsigned
      VF` as updating the field to use `ElementCount` woudl require changes
      that could result in changing the behavior of the compiler. Will be done
      in a separate patch.
      7. When dealing with user input for forcing the vectorization
      factor. In this case, adding support for scalable vectorization is a
      functional change that migh require changes at command line.
      
      Note that in some places the idiom
      
      ```
      unsigned VF = ...
      auto VTy = FixedVectorType::get(ScalarTy, VF)
      ```
      
      has been replaced with
      
      ```
      ElementCount VF = ...
      assert(!VF.Scalable && ...);
      auto VTy = VectorType::get(ScalarTy, VF)
      ```
      
      The assertion guarantees that the new code is (at least in debug mode)
      functionally equivalent to the old version. Notice that this change had been
      possible because none of the methods that are specific to `FixedVectorType`
      were used after the instantiation of `VTy`.
      
      Reviewed By: rengolin, ctetreau
      
      Differential Revision: https://reviews.llvm.org/D85794
      5a34b3ab
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Start implementing computeKnownBitsForTargetInstr · 70cd9f5b
      Matt Arsenault authored
      Handle workitem intrinsics. There isn't really away to adequately test
      this right now, since none of the known bits users are fine grained
      enough to test the edge conditions. This triggers a number of
      instances of the new 64-bit to 32-bit shift combine in the existing
      tests.
      70cd9f5b
    • Francesco Petrogalli's avatar
      Revert "[llvm][LV] Replace `unsigned VF` with `ElementCount VF` [NFCI]" · bad7d6b3
      Francesco Petrogalli authored
      Reverting because the commit message doesn't reflect the one agreed on
      phabricator at https://reviews.llvm.org/D85794.
      
      This reverts commit c8d2b065.
      bad7d6b3
    • Matt Arsenault's avatar
      GlobalISel: Reduce G_SHL width if source is extension · e1644a37
      Matt Arsenault authored
      shl ([sza]ext x, y) => zext (shl x, y).
      
      Turns expensive 64 bit shifts into 32 bit if it does not overflow the
      source type:
      
      This is a port of an AMDGPU DAG combine added in
      5fa289f0. InstCombine does this
      already, but we need to do it again here to apply it to shifts
      introduced for lowered getelementptrs. This will help matching
      addressing modes that use 32-bit offsets in a future patch.
      
      TableGen annoyingly assumes only a single match data operand, so
      introduce a reusable struct. However, this still requires defining a
      separate GIMatchData for every combine which is still annoying.
      
      Adds a morally equivalent function to the existing
      getShiftAmountTy. Without this, we would have to do try to repeatedly
      query the legalizer info and guess at what type to use for the shift.
      e1644a37
    • Francesco Petrogalli's avatar
      [llvm][LV] Replace `unsigned VF` with `ElementCount VF` [NFCI] · c8d2b065
      Francesco Petrogalli authored
      Changes:
      
      * Change `ToVectorTy` to deal directly with `ElementCount` instances.
      * `VF == 1` replaced with `VF.isScalar()`.
      * `VF > 1` and `VF >=2` replaced with `VF.isVector()`.
      * `VF <=1` is replaced with `VF.isZero() || VF.isScalar()`.
      * Add `<` operator to `ElementCount` to be able to use
      `llvm::SmallSetVector<ElementCount, ...>`.
      * Bits and pieces around printing the ElementCount to string streams.
      * Added a static method to `ElementCount` to represent a scalar.
      
      To guarantee that this change is a NFC, `VF.Min` and asserts are used
      in the following places:
      
      1. When it doesn't make sense to deal with the scalable property, for
      example:
         a. When computing unrolling factors.
         b. When shuffle masks are built for fixed width vector types
      In this cases, an
      assert(!VF.Scalable && "<mgs>") has been added to make sure we don't
      enter coepaths that don't make sense for scalable vectors.
      2. When there is a conscious decision to use `FixedVectorType`. These
      uses of `FixedVectorType` will likely be removed in favour of
      `VectorType` once the vectorizer is generic enough to deal with both
      fixed vector types and scalable vector types.
      3. When dealing with building constants out of the value of VF, for
      example when computing the vectorization `step`, or building vectors
      of indices. These operation _make sense_ for scalable vectors too,
      but changing the code in these places to be generic and make it work
      for scalable vectors is to be submitted in a separate patch, as it is
      a functional change.
      4. When building the potential VFs in VPlan. Making the VPlan generic
      enough to handle scalable vectorization factors is a functional change
      that needs a separate patch. See for example `void
      LoopVectorizationPlanner::buildVPlans(unsigned MinVF, unsigned
      MaxVF)`.
      5. The class `IntrinsicCostAttribute`: this class still uses `unsigned
      VF` as updating the field to use `ElementCount` woudl require changes
      that could result in changing the behavior of the compiler. Will be done
      in a separate patch.
      7. When dealing with user input for forcing the vectorization
      factor. In this case, adding support for scalable vectorization is a
      functional change that migh require changes at command line.
      
      Differential Revision: https://reviews.llvm.org/D85794
      c8d2b065
    • Valeriy Savchenko's avatar
      [analyzer][tests] Add a notion of project sizes · aec12c12
      Valeriy Savchenko authored
      Summary:
      Whith the number of projects growing, it is important to be able to
      filter them in a more convenient way than by names.  It is especially
      important for benchmarks, when it is not viable to analyze big
      projects 20 or 50 times in a row.
      
      Because of this reason, this commit adds a notion of sizes and a
      filtering interface that puts a limit on a maximum size of the project
      to analyze or benchmark.
      
      Sizes assigned to the projects in this commit, do not directly
      correspond to the number of lines or files in the project.  The key
      factor that is important for the developers of the analyzer is the
      time it takes to analyze the project.  And for this very reason,
      "size" basically helps to cluster projects based on their analysis
      time.
      
      Differential Revision: https://reviews.llvm.org/D83942
      aec12c12
    • Florian Hahn's avatar
      [DSE,MemorySSA] Delay PointerMayBeCaptured calls until actually needed. · b99a5eb6
      Florian Hahn authored
      Avoid computing InvisibleToCallerBefore/AfterRet up front. In most
      cases, this information is not really needed. Instead, introduce helper
      functions to compute and cache the result on demand.
      
      Notably, this also does not use PointerMayBeCapturedBefore for
      isInvisibleToCallerBeforeRet, as it requires the killing MemoryDef as
      starting instruction, making the caching ineffective. But it appears the
      use of PointerMayBeCapturedBefore has very limited benefits in practice
      (e.g. on SPEC2000/SPEC2006/MultiSource there are no binary changes with
      -O3 -flto). Refrain from using it for now, to limit-compile-time.
      
      This gives some nice compile-time improvements:
      http://llvm-compile-time-tracker.com/compare.php?from=db9345f6810f379a36752dc52caf5230585d0ebd&to=b4d091047e1b8a3d377d200137b79d03aca65663&stat=instructions
      b99a5eb6
    • Anna Welker's avatar
      [ARM][MVE] Allow tail predication for strides !=1 with gather/scatters · 8048068c
      Anna Welker authored
      If gather/scatters are enabled, ARMTargetTransformInfo now allows
      tail predication for loops with a much wider range of strides, up
      to anything that is loop invariant.
      
      Differential Revision: https://reviews.llvm.org/D85410
      8048068c
    • Raphael Isemann's avatar
      Reland "Correctly emit dwoIDs after ASTFileSignature refactoring (D81347)" · 105151ca
      Raphael Isemann authored
      The orignal patch with the missing 'REQUIRES: asserts' as there is a debug-only
      flag used in the test.
      
      Original summary:
      
      D81347 changes the ASTFileSignature to be an array of 20 uint8_t instead of 5
      uint32_t. However, it didn't update the code in ObjectFilePCHContainerOperations
      that creates the dwoID in the module from the ASTFileSignature
      (`Buffer->Signature` being the array subclass that is now `std::array<uint8_t,
      20>` instead of `std::array<uint32_t, 5>`).
      
      ```
        uint64_t Signature = [..] (uint64_t)Buffer->Signature[1] << 32 | Buffer->Signature[0]
      ```
      
      This code works with the old ASTFileSignature (where two uint32_t are enough to
      fill the uint64_t), but after the patch this only took two bytes from the
      ASTFileSignature and only partly filled the Signature uint64_t.
      
      This caused that the dwoID in the module ref and the dwoID in the actual module
      no longer match (which in turns causes that LLDB keeps warning about the dwoID's
      not matching when debugging -gmodules-compiled binaries).
      
      This patch just unifies the logic for turning the ASTFileSignature into an
      uint64_t which makes the dwoID match again (and should prevent issues like that
      in the future).
      
      Reviewed By: aprantl, dang
      
      Differential Revision: https://reviews.llvm.org/D84013
      105151ca
    • Bevin Hansson's avatar
      [Fixed Point] Add codegen for fixed-point shifts. · 577f8b15
      Bevin Hansson authored
      This patch adds codegen to Clang for fixed-point shift
      operations.
      
      Reviewed By: leonardchan
      
      Differential Revision: https://reviews.llvm.org/D83294
      577f8b15
    • Bevin Hansson's avatar
      [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR. · 808ac546
      Bevin Hansson authored
      This changes the methods in CGExprScalar to use
      FixedPointBuilder to generate IR for fixed-point
      conversions and operations.
      
      Since FixedPointBuilder emits padded operations slightly
      differently than the original code, some tests change.
      
      Reviewed By: leonardchan
      
      Differential Revision: https://reviews.llvm.org/D86282
      808ac546
    • Haojian Wu's avatar