1. Jan 19, 2022
    • Mark de Wever's avatar
      [libc++] Adds a test for std::fill_n. · 8f4a6187
      Mark de Wever authored
      The function `std::fill` requires a ForwardIterator, but `std::fill_n`
      only requires an OutputIterator. Adds a test to validate `std::fill_n`
      works with an OutputIterator.
      
      Noticed this while working on LWG3539
      format_to must not copy models of output_iterator<const charT&>
      
      Reviewed By: #libc, Quuxplusone, ldionne
      
      Differential Revision: https://reviews.llvm.org/D117395
      8f4a6187
    • Philip Reames's avatar
      Add test showing missed opt from pr53270 · a9f713f5
      Philip Reames authored
      a9f713f5
    • Chris Bieneman's avatar
      [NFC] Set gitattributes for line endings · 1c1b0027
      Chris Bieneman authored
      A clean checkout of LLVM using core.autocrlf=on for Windows cannot pass
      the LLVM test suite because several test input files rely on specific
      line endings.
      
      This change updates the line ending attributes for impacted tests and
      re-normalizes a CRLF test case that was committed as LF to the git
      index.
      1c1b0027
    • Arthur O'Dwyer's avatar
    • Joseph Huber's avatar
      [Libomptarget] Fix external visibility for internal variables · 0203ff19
      Joseph Huber authored
      After the changes in D117362 made variables declared inside of a target
      declare directive visible outside the plugin, some variables inside the
      runtime were given visiblity that conflicted with their address space
      type. This caused problems when shared or local memory was made
      externally visible. This patch fixes this issue by making these
      varialbes static within the module, therefore limiting their visibility
      to being internal.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D117526
      0203ff19
    • Joseph Huber's avatar
      [OpenMP] Remove hidden visibility for declare target variables · d081bfcd
      Joseph Huber authored
      This patch changes the visiblity of variables declared within a declare
      target directive. Variable declarations within a declare target
      directive need to be externally visible to the plugin for initialization
      or reading. Previously this would cause runtime errors where the named
      global could not be found because it was not included in the symbol
      table.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D117362
      d081bfcd
    • Joseph Huber's avatar
      [OpenMP] Mark device RTL variables as hidden · dcb83b23
      Joseph Huber authored
      This patch changes the visibility of the `__omp_rtl_debug_kind` variable
      to be hidden. These variables are only used by the plugin so they do not
      need to be read externally. Previously the default visibility prevented
      these variables from being completely eliminated in the module.
      
      Reviewed By: tianshilei1992
      
      Differential Revision: https://reviews.llvm.org/D117320
      dcb83b23
    • Craig Topper's avatar
      [RISCV] Make the operand order for RISCVISD::FSL(W)/FSR(W) match the... · b634f8a6
      Craig Topper authored
      [RISCV] Make the operand order for RISCVISD::FSL(W)/FSR(W) match the instruction register numbering.
      
      Previous we used the fshl/fshr operand ordering for simplicity. This
      made things confusing when D117468 proposed adding intrinsics for
      the instructions. We can't just use the generic funnel shifting
      intrinsics because fsl/fsr have different functionality that should
      be exposed to software.
      
      Now we use rs1, rs3, rs2/shamt order which matches the instruction
      printing order and the order used in this intrinsic header
      https://github.com/riscv/riscv-bitmanip/blob/main-history/cproofs/rvintrin.h
      b634f8a6
    • Mircea Trofin's avatar
      [mlgo][inline] Improve global state tracking · 3e8553aa
      Mircea Trofin authored
      The global state refers to the number of the nodes currently in the
      module, and the number of direct calls between nodes, across the
      module.
      
      Node counts are not a problem; edge counts are because we want strictly
      the kind of edges that affect inlining (direct calls), and that is not
      easily obtainable without iteration over the whole module.
      
      This patch avoids relying on analysis invalidation because it turned out
      to be too aggressive in some cases. It leverages the fact that Node
      objects are stable - they do not get deleted while cgscc passes are
      run over the module; and cgscc pass manager invariants.
      
      Reviewed By: aeubanks
      
      Differential Revision: https://reviews.llvm.org/D115847
      3e8553aa
    • Fraser Cormack's avatar
      [VP] Propagate align parameter attr on VP gather/scatter to ISel · c8e33978
      Fraser Cormack authored
      This patch fixes a case where the 'align' parameter attribute on the
      pointer operands to llvm.vp.gather and llvm.vp.scatter was being dropped
      during the conversion to the SelectionDAG. The default alignment equal
      to the ABI type alignment of the vector type was kept. It also updates
      the documentation to reflect the fact that the parameter attribute is
      now properly supported.
      
      The default alignment of these intrinsics was previously documented as
      being equal to the ABI alignment of the *scalar* type, when in fact that
      wasn't the case: the ABI alignment of the vector type was used instead.
      This has also been fixed in this patch.
      
      Reviewed By: simoll, craig.topper
      
      Differential Revision: https://reviews.llvm.org/D114423
      c8e33978
    • Tony Tye's avatar
      [AMDGPU][NFC] Add DWARF extension support for SIMD execution · 8ba5043d
      Tony Tye authored
      - Add current iteration to the context of a DWARF expression evaluation.
      - Add DW_AT_LLVM_iterations attribute to specify the number of
        iterations executing concurrently.
      - Add DF_OP_LLVM_push_iteration to support optimizations that result in
        multiple iterations executing concurrently.
      - Add DW_OP_LLVM_overlay and DW_OP_LLVM_bit_overlay to support
        expressing the location of arrays that are promoted to vector
        registers in SIMD vectorized loops.
      - Generally clarify the difference between SIMT and SIMD execution.
      - Change the DW_AT_LLVM_active_lane attribute to take location
        description expression so that a loclist can be used to express
        different vales at different program locations.
      
      Reviewed By: scott.linder
      
      Differential Revision: https://reviews.llvm.org/D117572
      8ba5043d
    • Mogball's avatar
      [mlir] NFC fix a typo in assembly format · d083a0e5
      Mogball authored
      d083a0e5
    • LLVM GN Syncbot's avatar
      [gn build] Port df51be85 · c2e8b54d
      LLVM GN Syncbot authored
      c2e8b54d
    • Louis Dionne's avatar
      [libc++] Refactor stride_counting_iterator · a9bfb4c4
      Louis Dionne authored
      Instead of storing the wrapped iterator inside the stride_counting_iterator,
      store its base so we can have e.g. a stride_counting_iterator of an
      input_iterator (which was previously impossible because input_iterators
      are not copyable). Also a few other simplifications in stride_counting_iterator.
      
      As a fly-by fix, remove the member base() functions, which are super
      confusing.
      
      Differential Revision: https://reviews.llvm.org/D116613
      a9bfb4c4
    • Louis Dionne's avatar
      [libc++] Split a few utilities out of __threading_support · df51be85
      Louis Dionne authored
      This change is the basis for a further refactoring where I'm going to
      split up the various implementations we have in __threading_support to
      make that code easier to understand.
      
      Note that I had to make __convert_to_timespec a template to break
      circular dependencies. Concretely, we never seem to use it with anything
      other than ::timespec, but I am wary of hardcoding that assumption as
      part of this change, since I suspect there's a reason for going through
      these hoops in the first place.
      
      Differential Revision: https://reviews.llvm.org/D116944
      df51be85
    • Jan Svoboda's avatar
      [llvm] Remove uses of `std::vector<bool>` · 5f4ae564
      Jan Svoboda authored
      LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.
      
      This patch does just that for llvm.
      
      Reviewed By: dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D117121
      5f4ae564
    • Mogball's avatar
      [mlir] Replace StrEnumAttr -> EnumAttr in core dialects · aae51255
      Mogball authored
      Removes uses of `StrEnumAttr` in core dialects
      
      Reviewed By: mehdi_amini, rriddle
      
      Differential Revision: https://reviews.llvm.org/D117514
      aae51255
    • Sanjay Patel's avatar
      [SDAG] remove duplicate functionality when getting shift type for demanded bits; NFCI · 87059120
      Sanjay Patel authored
      This was noted as a potential cleanup in D117508.
      getShiftAmountTy() has checks for vector, phase, etc. so it should
      handle anything that the caller was trying to account for.
      87059120
    • Sanjay Patel's avatar
      [InstCombine] reduce code duplication; NFC · 2d50630e
      Sanjay Patel authored
      2d50630e
    • Sanjay Patel's avatar
    • zhijian's avatar
      [AIX] Support of Big archive (read) · 4fae9329
      zhijian authored
      Summary:
      
      The patch is based on the EGuesnet's implement of the "Support of Big archive (read)
      the first commit of the patch is come from https://reviews.llvm.org/D100651.
      
      the rest of commits of the patch
      
      1  Addressed the comments on the https://reviews.llvm.org/D100651
      2  according to https://www.ibm.com/docs/en/aix/7.2?topic=formats-ar-file-format-big
      using the "fl_fstmoff" for the first object file number, using "char ar_nxtmem[20]" to get next object file ,
      using the "char fl_lstmoff[20]" for the last of the object file will fix the following problems:
         2.1 can not correct reading a archive files which has padding data between too object file
         2.2 can not correct reading a archive files from which some object file has be deleted
      
      3 introduce a new derived class BigArchive for big ar file.
      
      Reviewers: James Henderson
      Differential Revision: https://reviews.llvm.org/D111889
      4fae9329
    • Tres Popp's avatar
      262cc74e
    • Jan Svoboda's avatar
      [clangd][clang-tidy] Remove uses of `std::vector<bool>` · c6fb6366
      Jan Svoboda authored
      LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.
      
      This patch does just that for clangd and clang-tidy.
      
      Reviewed By: dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D117119
      c6fb6366
    • Aaron Ballman's avatar
      Fix a failed assertion on an invalid typename requirement · fa596fb0
      Aaron Ballman authored
      The parsing code for a typename requirement currently asserts when
      given something which is not a valid type-requirement
      (http://eel.is/c++draft/expr.prim.req.type#nt:type-requirement). This
      removes the assertion to continue on to the proper diagnostic.
      
      This resolves PR53057.
      
      Note that in that PR, it is using _BitInt(N) as a dependent type name.
      This patch does not attempt to support that as it is not clear that is
      a valid type requirement (it does not match the grammar production for
      one). The workaround in the PR, however, is definitely valid and works
      as expected.
      fa596fb0
    • Mogball's avatar
      [mlir] Drop the leading space when printing regions · 5c36ee8d
      Mogball authored
      The leading space that is always printed at the beginning of regions is not consistent with other parts of the printing API. Moreover, this leading space can lead to undesirable assembly formats:
      
      ```
      attr-dict-with-keyword $region
      ```
      
      Prints as:
      
      ```
      // Two spaces between `}` and `{`
      attributes {foo}  { ... }
      ```
      
      Moreover, the leading space results in the odd generic op format:
      
      ```
      "test.op"() ( {...}) : () -> ()
      ```
      
      Reviewed By: rriddle, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D117411
      5c36ee8d
    • Hans Wennborg's avatar
      Revert "[MemCpyOpt] Make capture check during call slot optimization more precise" · 53a51acc
      Hans Wennborg authored
      This casued a miscompile due to call slot optimization replacing a call
      argument without considering the call's !noalias metadata, see discussion on
      the code review.
      
      > Call slot optimization is currently supposed to be prevented if
      > the call can capture the source pointer. Due to an implementation
      > bug, this check currently doesn't trigger if a bitcast of the source
      > pointer is passed instead. I'm somewhat afraid of the fallout of
      > fixing this bug (due to heavy reliance on call slot optimization
      > in rust), so I'd like to strengthen the capture reasoning a bit first.
      >
      > In particular, I believe that the capture is fine as long as a)
      > the call itself cannot depend on the pointer identity, because
      > neither dest has been captured before/at nor src before the
      > call and b) there is no potential use of the captured pointer
      > before the lifetime of the source alloca ends, either due to
      > lifetime.end or a return from a function. At that point the
      > potentially captured pointer becomes dangling.
      >
      > Differential Revision: https://reviews.llvm.org/D115615
      
      Also reverting the dependent commit:
      
      > [MemCpyOpt] Look through pointer casts when checking capture
      >
      > The user scanning loop above looks through pointer casts, so we
      > also need to strip pointer casts in the capture check. Previously
      > the source was incorrectly considered not captured if a bitcast
      > was passed to the call.
      
      This reverts commit 487a34ed
      and 00e68694.
      53a51acc
    • Richard's avatar
      [clang-tidy] Force LF newlines when writing files · e598913a
      Richard authored
      The recommendation on Windows is to checkout from git with
      core.autolf=false in order to preserve LF line endings on
      test files.  However, when creating a new check this results
      in modified files as having switched all the line endings on
      Windows.  Write all files with explicit LF line endings to
      prevent this.
      
      Fixes #52968
      
      Differential Revision: https://reviews.llvm.org/D117535
      e598913a
    • Steven Wu's avatar
      [JITLink][ELF] Support duplicated section names from object file · 091e3648
      Steven Wu authored
      ELF object files can contain duplicated sections (thus section symbols
      as well), espeically when comdats/section groups are present. This patch
      adds support for generating LinkGraph from object files that have
      duplicated section names. This is the first step to properly model
      comdats/section groups.
      
      Reviewed By: lhames
      
      Differential Revision: https://reviews.llvm.org/D114753
      091e3648
    • Steven Wu's avatar
      [ADT] Fix Optional<> with llvm::is_trivially_move_constructible · 347d4d73
      Steven Wu authored
      Fix the compatibility of Optional<> with some GCC versions that it will fail
      to compile when T is getting checked for `is_trivially_move_constructible`
      as mentioned here: https://reviews.llvm.org/D93510#2538983
      
      Fix the problem by using `llvm::is_trivially_move_constructible`.
      
      Reviewed By: jplayer-nv, tatyana-krasnukha
      
      Differential Revision: https://reviews.llvm.org/D117254
      347d4d73
    • Matt Arsenault's avatar
      f5ff1cab
    • Nikita Popov's avatar
      0d51b6ab
    • Terry Wilmarth's avatar
      [OpenMP] Add use of TPAUSE · 2e02579a
      Terry Wilmarth authored
      Add use of TPAUSE (from WAITPKG) to the runtime for Intel hardware,
      with an envirable to turn it on in a particular C-state.  Always uses
      TPAUSE if it is selected and enabled by Intel hardware and presence of
      WAITPKG, and if not, falls back to old way of checking
      __kmp_use_yield, etc.
      
      Differential Revision: https://reviews.llvm.org/D115758
      2e02579a
    • Alex Zinenko's avatar
      [mlir] handle nested regions in llvm-legalize-for-export · 1ad48d6d
      Alex Zinenko authored
      The translation from the MLIR LLVM dialect to LLVM IR includes a mechanism that
      ensures the successors of a block to be different blocks in case block
      arguments are passed to them since the opposite cannot be expressed in LLVM IR.
      This mechanism previously only worked for functions because it was written
      prior to the introduction of other region-carrying operations such as the
      OpenMP dialect, which also translates directly to LLVM IR. Modify this
      mechanism to handle all regions in the module and not only functions.
      
      Reviewed By: wsmoses
      
      Differential Revision: https://reviews.llvm.org/D117548
      1ad48d6d
    • Alex Zinenko's avatar
      Revert "[mlir] fix crash in PybindAdaptors.h" · 7b1ceee6
      Alex Zinenko authored
      This reverts commit 289021a4.
      7b1ceee6
    • Nikita Popov's avatar
      [DebugInstrRef] Use DenseMap for ValueToLoc (NFC) · cbaae614
      Nikita Popov authored
      Just replacing std::map with DenseMap here is a major regression
      -- because this code used an identity hash for ValueIDNum.
      Because ValueIDNum is composed of multiple components, it is
      important that we use a reasonably good hash function here, so
      switch it to hash_value. DenseMapInfo::getHashValue<uint64_t>
      would not be sufficient.
      
      This gives a -0.8% geomean improvement on CTMark ReleaseLTO-g.
      cbaae614
  2. Jan 18, 2022