1. Dec 11, 2023
    • Adrian Kuegel's avatar
      [mlir][Python] Apply ClangTidy findings. · ea2e83af
      Adrian Kuegel authored
      move constructors should be marked noexcept
      ea2e83af
    • Victor Perez's avatar
      [MLIR][IntegerRangeAnalysis] Avoid crash reached when loop bound is uninitialized (#74832) · 13c648f6
      Victor Perez authored
      
      
      If the loop bound is not initialized, the analysis crashed, as it only checked for nullity. Also checking for initialization fixes the issue.
      
      Signed-off-by: default avatarVictor Perez <victor.perez@codeplay.com>
      Co-authored-by: default avatarTsang, Whitney <whitney.tsang@intel.com>
      13c648f6
    • Yingchi Long's avatar
      [BPF] use target triple for pattern predicates (#74998) · 75193b19
      Yingchi Long authored
      This is used for eliminate uses of "CurDAG", which is SelectionDAG-spec,
      and not compatible with GIsel algorithms.
      
      (NFC)
      75193b19
    • Jay Foad's avatar
      99430c58
    • Tobias Hieta's avatar
    • Chuanqi Xu's avatar
      Recommit [NFC] [Serialization] Packing more bits · 65b12a8a
      Chuanqi Xu authored
      This patch tries to reduce the size of the BMIs by packing more bits
      into an unsigned integer.
      
      This patch was reverted due to buildbot failure report. But it should be
      irrevelent after I took a double look. So I tried to recommit this NFC
      change again.
      65b12a8a
    • Quinton Miller's avatar
      [LLVM-C] Support operand bundles (#73914) · 86763a8c
      Quinton Miller authored
      Added the following functions for manipulating operand bundles, as well as
      building ``call`` and ``invoke`` instructions that use operand bundles:
      
        * LLVMBuildCallWithOperandBundles
        * LLVMBuildInvokeWithOperandBundles
        * LLVMCreateOperandBundle
        * LLVMDisposeOperandBundle
        * LLVMGetNumOperandBundles
        * LLVMGetOperandBundleAtIndex
        * LLVMGetNumOperandBundleArgs
        * LLVMGetOperandBundleArgAtIndex
        * LLVMGetOperandBundleTag
      
      Fixes #71873.
      86763a8c
    • Tobias Hieta's avatar
      code-format: Improve the code-format-helper to be able to run as a git hook (#73957) · bd3e8eb6
      Tobias Hieta authored
      As part of #73798 there was some discussion about using the format
      helper to run from a git-hook. That was not possible for a number of
      reasons, but with these changes it can now be installed as a hook and
      then run on the local cache in git instead of a diff between revisions.
      
      This also checks for two environment variables DARKER_FORMAT_PATH and
      CLANG_FORMAT_PATH where you can specify the path to the program you want
      to use.
      bd3e8eb6
    • Serge Pavlov's avatar
      18959c46
    • Thomas Raoux's avatar
      [MLIR][SCF] Add support for pipelining dynamic loops (#74350) · ef112833
      Thomas Raoux authored
      Support loops without static boundaries. Since the number of iteration
      is not known we need to predicate prologue and epilogue in case the
      number of iterations is smaller than the number of stages.
      
      This patch includes work from @chengjunlu
      ef112833
    • Chuanqi Xu's avatar
      Revert "[clang] Remove unused variable 'ExprDependenceBits' in ASTWriterDecl.cpp (NFC)" · 9a465186
      Chuanqi Xu authored
      This reverts commit 10951050.
      This should be part of 8c334627 to revert
      9406ea3f completely.
      9a465186
    • Chuanqi Xu's avatar
      Revert "[NFC] [Serialization] Packing more bits" · 8c334627
      Chuanqi Xu authored
      This reverts commit 9406ea3f.
      
      There are build bots complaining this. Revert it first to try to keep
      the bots green.
      8c334627
    • paperchalice's avatar
      [CodeGen] Rename `winehprepare` -> `win-eh-prepare` (#75024) · d1a83ff3
      paperchalice authored
      Forgot to rename `winehprepare` for legacy pass when port this pass to
      new passmanager.
      d1a83ff3
    • Ningning Shi(史宁宁)'s avatar
      [CodeGen][MachineScheduler][NFC]Update some comments of scheduler (#74705) · fc715e4c
      Ningning Shi(史宁宁) authored
      The member functions of ScheduleDAGMI are called back from
      PostMachineScheduler::runOnMachineFunction, instead of
      MachineScheduler::runOnMachineFunction.
      fc715e4c
    • Nathan Ridge's avatar
    • Shao-Ce SUN's avatar
      [NFC][VPlan] Simplify VPValue::removeUser (#74708) · d8607109
      Shao-Ce SUN authored
      Replaced explicit loops with find + erase.
      d8607109
    • Jie Fu's avatar
      [clang] Remove unused variable 'ExprDependenceBits' in ASTWriterDecl.cpp (NFC) · 10951050
      Jie Fu authored
      llvm-project/clang/lib/Serialization/ASTWriterDecl.cpp:2342:12:
       error: unused variable 'ExprDependenceBits' [-Werror,-Wunused-variable]
       2342 |   unsigned ExprDependenceBits = llvm::BitWidth<ExprDependence>;
            |            ^~~~~~~~~~~~~~~~~~
      1 error generated.
      10951050
    • Mircea Trofin's avatar
      Fix uninitialized field post PR #74970 · a52ac7f9
      Mircea Trofin authored
      a52ac7f9
    • sinan's avatar
      [BOLT] Fix local out-of-range stub issue in LongJmp (#73918) · fdb13cf5
      sinan authored
      If a local stub is out-of-range, at LongJmp we will try to find another
      local stub first. However, The original implementation do not work as
      expected and it leads to an infinite loop between replaceTargetWithStub
      and fixBranches.
      
      After this patch, we first convert the target of BB back to the target
      of the local stub, and then look up for other valid local stubs and so
      on.
      fdb13cf5
    • wanglei's avatar
      [LoongArch] Add codegen support for [X]VF{MSUB/NMADD/NMSUB}.{S/D} instructions (#74819) · af999c4b
      wanglei authored
      This is similar to single and double-precision floating-point
      instructions.
      af999c4b
    • Chuanqi Xu's avatar
      [NFC] [Serialization] Packing more bits · 9406ea3f
      Chuanqi Xu authored
      This patch tries to reduce the size of the BMIs by packing more bits
      into an unsigned integer.
      9406ea3f
    • Mircea Trofin's avatar
      [NFC][InstrProf] Refactor InstrProfiling lowering pass (#74970) · 1d608fc7
      Mircea Trofin authored
      Akin other passes - refactored the name to `InstrProfilingLoweringPass` to better communicate what it does, and split the pass part and the transformation part to avoid needing to initialize object state during `::run`.
      
      A subsequent PR will move `InstrLowering` to the .cpp file and rename it to `InstrLowerer`.
      1d608fc7
    • paperchalice's avatar
      [CodeGen] Update DwarfEHPreparePass references in `CodeGenPassBuilder.h` (#74068) · 9bd32d78
      paperchalice authored
      Forgot to update the counterpart in `CodeGenPassBuilder.h`. Also Rename `dwarfehprepare` -> `dwarf-eh-prepare`.
      9bd32d78
    • Stephan T. Lavavej's avatar
      [libc++][test] Fix more MSVC and Clang warnings (#74965) · b2cc4b99
      Stephan T. Lavavej authored
      Found while running libc++'s tests with MSVC's STL.
      
      *
      `libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/ranges_sort_heap.pass.cpp`
      + Fix Clang `-Wunused-variable`, because `LIBCPP_ASSERT` expands to
      nothing for MSVC's STL.
      + This is the same "always void-cast" change that #73437 applied to the
      neighboring `complexity.pass.cpp`. I missed that
      `ranges_sort_heap.pass.cpp` was also affected because we had disabled
      this test.
      *
      `libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/buffered_reads.pass.cpp`
      *
      `libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/buffered_writes.pass.cpp`
      + Fix MSVC "warning C4244: '`=`': conversion from '`__int64`' to
      '`_Ty`', possible loss of data".
      + This is a valid warning, possibly the best one that MSVC found in this
      entire saga. We're accumulating a `std::vector<std::streamsize>` and
      storing the result in `std::streamsize total_size` but we actually have
      to start with `std::streamsize{0}` or we'll truncate.
      *
      `libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp`
      + Fix Clang `-Wunused-local-typedef` because the following usage is
      libc++-only.
      + I'm just expanding it at the point of use, and using the dedicated
      `LIBCPP_STATIC_ASSERT` to keep the line length down.
      *
      `libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.assign/swap.pass.cpp`
      + Fix MSVC "warning C4242: 'argument': conversion from '`int`' to
      '`const _Elem`', possible loss of data".
      + This is a valid warning (possibly the second-best) as `sputc()`
      returns `int_type`. If `sputc()` returns something unexpected, we want
      to know, so we should separately say `expected.push_back(CharT('B'))`.
      *
      `libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size_align_nothrow.pass.cpp`
      *
      `libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size_nothrow.pass.cpp`
        + Fix MSVC "warning C6001: Using uninitialized memory '`x`'."
        + [N4964](https://wg21.link/N4964) \[new.delete.single\]/12:
      > *Effects:* The deallocation functions
      (\[basic.stc.dynamic.deallocation\]) called by a *delete-expression*
      (\[expr.delete\]) to render the value of `ptr` invalid.
        + \[basic.stc.general\]/4:
      > When the end of the duration of a region of storage is reached, the
      values of all pointers representing the address of any part of that
      region of storage become invalid pointer values (\[basic.compound\]).
      Indirection through an invalid pointer value and passing an invalid
      pointer value to a deallocation function have undefined behavior. Any
      other use of an invalid pointer value has implementation-defined
      behavior.
      + In certain configurations, after `delete x;` MSVC will consider `x` to
      be radioactive (and in other configurations, it'll physically null out
      `x` as a safety measure). We can copy it into `old_x` before deletion,
      which the implementation finds acceptable.
      *
      `libcxx/test/std/ranges/range.adaptors/range.elements/general.pass.cpp`
      *
      `libcxx/test/std/ranges/range.adaptors/range.elements/iterator/deref.pass.cpp`
      + Fix MSVC "warning C4242: 'initializing': conversion from '`_Ty`' to
      '`_Ty`', possible loss of data".
      + This was being emitted in `pair` and `tuple`'s perfect forwarding
      constructors. Passing `short{1}` allows MSVC to see that no truncation
      is happening.
      *
      `libcxx/test/std/ranges/range.adaptors/range.elements/iterator/member_types.compile.pass.cpp`
      + Fix MSVC "warning C4242: 'initializing': conversion from '`_Ty`' to
      '`_Ty2`', possible loss of data".
      + Similarly, this was being emitted in `pair`'s perfect forwarding
      constructor. After passing `short{1}`, I reduced repetition by relying
      on CTAD. (I can undo that cleanup if it's stylistically undesirable.)
      *
      `libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp`
      + Fix MSVC "warning C4930: '`std::reference_wrapper<int> purr(void)`':
      prototyped function not called (was a variable definition intended?)".
      + There's no reason for `purr()` to be locally declared (aside from
      isolating it to a narrow scope, which has minimal benefits); it can be
      declared like `meow()` above. 😸
      *
      `libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp`
      *
      `libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp`
        + Fix MSVC static analysis warnings when replacing `operator new`:
          ```
      warning C28196: The requirement that '(_Param_(1)>0)?(return!=0):(1)' is
      not satisfied. (The expression does not evaluate to true.)
      warning C6387: 'return' could be '0': this does not adhere to the
      specification for the function 'new'.
      warning C6011: Dereferencing NULL pointer 'reinterpret_cast<char
      *>ptr+i'.
          ```
      + All we need is a null check, which appears in other `operator new`
      replacements:
      https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new.size.replace.pass.cpp#L27-L28
      b2cc4b99
    • Stephan T. Lavavej's avatar
      [libc++][test] Fix MSVC warnings with `static_cast`s (#74962) · 774295ca
      Stephan T. Lavavej authored
      Found while running libc++'s tests with MSVC's STL.
      
      *
      `libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp`
        + Fix MSVC "warning C4389: '`==`': signed/unsigned mismatch".
      + This was x86-specific for me. The LHS is `int` and the RHS is
      `size_t`. We know the `array`'s size, so `static_cast<int>` is certainly
      safe, and this matches the following `numberOfProj` comparisons.
      *
      `libcxx/test/std/containers/sequences/insert_range_sequence_containers.h`
      + Fix MSVC "warning C4267: 'argument': conversion from '`size_t`' to
      '`const int`', possible loss of data".
      + `test_case.index` is `size_t`:
      https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/test/std/containers/insert_range_helpers.h#L65-L68
      + But the container's `difference_type` is `int`:
      https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/test/support/test_allocator.h#L65-L76
        + I introduced an alias `D` to make the long line more readable.
      *
      `libcxx/test/std/containers/unord/unord.map/eq.different_hash.pass.cpp`
      *
      `libcxx/test/std/containers/unord/unord.multimap/eq.different_hash.pass.cpp`
      *
      `libcxx/test/std/containers/unord/unord.multiset/eq.different_hash.pass.cpp`
      *
      `libcxx/test/std/containers/unord/unord.set/eq.different_hash.pass.cpp`
      + Fix MSVC "warning C6297: Arithmetic overflow. Results might not be an
      expected value."
      + This warning is almost annoying enough to outright disable, but we use
      similar `static_cast`s to deal with sign/truncation warnings elsewhere,
      because there's some value in ensuring that product code is clean with
      respect to these warnings. If there were many more occurrences, then
      disabling the warning would be appropriate.
      + Cleanup: Change 2 inconsistently unqualified occurrences of `size_t`
      to `std::size_t`.
      *
      `libcxx/test/std/containers/views/mdspan/layout_stride/index_operator.pass.cpp`
      + Fix MSVC "warning C4244: 'initializing': conversion from '`__int64`'
      to '`size_t`', possible loss of data".
      + This was x86-specific for me. The `args` are indeed `int64_t`, and
      we're storing the result in `size_t`, so we should cast.
      * `libcxx/test/std/ranges/range.utility/range.utility.conv/container.h`
      + Fix MSVC "warning C4244: 'initializing': conversion from '`ptrdiff_t`'
      to '`int`', possible loss of data".
      + Fix MSVC "warning C4267: 'initializing': conversion from '`size_t`' to
      '`int`', possible loss of data".
      + We're initializing `int size_`, so we should explicitly cast from
      pointer subtraction and `std::ranges::size`.
      *
      `libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp`
      *
      `libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp`
      *
      `libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp`
      + Fix MSVC "warning C4309: 'initializing': truncation of constant
      value".
      + MSVC emits this warning because `0xDE` is outside the range of `char`
      (signed by default in our implementation).
      * `libcxx/test/support/concat_macros.h`
      + Fix MSVC "warning C4244: 'argument': conversion from '`char16_t`' to
      '`const char`', possible loss of data".
      + Fix MSVC "warning C4244: 'argument': conversion from '`unsigned int`'
      to '`const char`', possible loss of data".
        + This code was very recently introduced by @mordante in #73395.
      774295ca
    • Daniil Kovalev's avatar
      [NFC][AArch64][ELF][PAC] Update AUTH relocation IDs (#74986) · 8410ee4f
      Daniil Kovalev authored
      https://github.com/ARM-software/abi-aa/pull/227 changes IDs of
      `R_AARCH64_AUTH_ABS64` and `R_AARCH64_AUTH_RELATIVE` in PAuth ABI
      specification from draft ones (`0xe100` and `0xe200`) to final ones
      (`0x244` and `0x411`).
      
      This patch changes the values in llvm correspondingly.
      8410ee4f
    • Nishant Mittal's avatar
    • Kazu Hirata's avatar
    • Kazu Hirata's avatar
      d57a26a7
    • Kazu Hirata's avatar
      2b019a78
    • Daniil Kovalev's avatar
      [NFC][test][llvm-readobj] Use single `#` for FileCheck directives (#74985) · fdd1da3f
      Daniil Kovalev authored
      Comments use `##`. Lit and FileCheck directives should use single `#`.
      See
      https://github.com/llvm/llvm-project/pull/72713#discussion_r1398788122.
      fdd1da3f
    • Kazu Hirata's avatar
      55531e71
    • Kazu Hirata's avatar
      8b118113
    • Animcogn's avatar
      [llvm][docs] Fix typo in `CoverageMappingFormat.rst` (#71189) · 00441733
      Animcogn authored
      A small typographical fix in `CoverageMappingFormat.rst`.
      00441733
  2. Dec 10, 2023