Changes

Summary

  1. [llvm-readobj] Add support for machine-independent NetBSD ELF core notes. (details)
  2. [ARM] Correct range in isLegalAddressImm (details)
  3. [LICM] Adding the test as a precommit for the D113289 (details)
  4. [DAG][PowerPC] Enable initial ISD::BITCAST SimplifyDemandedBits/SimplifyMultipleUseDemandedBits big-endian handling (details)
  5. [BasicAA] Add tests for memset_pattern{4,8,16}. (details)
  6. Reland "[LICM] Hoist LOAD without sinking the STORE" (details)
  7. [VE][Clang][NFC] Disable VE toolchain tests on Windows (details)
  8. [AArch64][SVE] Enable bf16 vector.insert (details)
  9. Expand testing of necessary features for print-changed=dot-cfg. (details)
  10. [fir] Declare test function inline (details)
  11. Add new clang-tidy check for string_view(nullptr) (details)
  12. Fix documentation for `forEachLambdaCapture` and `hasAnyCapture` (details)
  13. [HIPSPV] Add CUDA->SPIR-V address space mapping (details)
  14. [flang] GettingInvolved: update LLVM Alias Analysis Technical Call info (details)
  15. [gn build] Port 6a9487df73e9 (details)
  16. [MemoryLocation] Support memset_chk in getForArgument. (details)
  17. [PatternMatch] create and use matcher for 'not' that excludes undef elements (details)
  18. [libc] Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth). (details)
  19. [MemoryLocation] Support strncpy in getForArgument. (details)
  20. [VE][NFC] Cleanup redundant namespace wrapper (details)
  21. [AMDGPU] Test for in-order waitcnt insertion for bvh instructions (details)
  22. [AMDGPU] Add support for in-order bvh in waitcnt pass (details)
  23. [SLP][NFC]Add a test for extractelements with many uses vectorization, NFC. (details)
  24. [clang-tidy] Fix build broken by commit 6a9487df73e917c4faf5e060f2bb33c6ade3f967 (D113148) (details)
  25. [AnnotationRemarks] Support generating annotation remarks with -O0. (details)
Commit 878ff1f9f85f6c539efb9b8c00978011d381f278 by fred
[llvm-readobj] Add support for machine-independent NetBSD ELF core notes.

Notes generated in NetBSD core files provide additional information about
processes. These notes are described in core.5, which can be viewed here:
https://man.netbsd.org/core.5

Differential Revision: https://reviews.llvm.org/D114635
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
The file was addedllvm/test/tools/llvm-readobj/ELF/note-netbsd-core.test
The file was modifiedllvm/include/llvm/BinaryFormat/ELF.h
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit e62930255822f86c5b422a0d61bbfc77324de3a9 by david.green
[ARM] Correct range in isLegalAddressImm

The ranges in isLegalAddressImm were off by one, not allowing the
maximum values for unscaled offsets.

Differential Revision: https://reviews.llvm.org/D114636
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
The file was modifiedllvm/test/CodeGen/Thumb2/store-prepostinc.mir
Commit 8e757b2383c90d81bc9661fd4ac070931a679ace by djtodoro
[LICM] Adding the test as a precommit for the D113289
The file was addedllvm/test/Transforms/LICM/hoist-load-without-store.ll
Commit 6803d08c38af7e3235e6cd249761511704e0f88d by llvm-dev
[DAG][PowerPC] Enable initial ISD::BITCAST SimplifyDemandedBits/SimplifyMultipleUseDemandedBits big-endian handling

This patch begins extending handling for peeking through bitcast nodes to big-endian targets as well as the existing little-endian case.

Differential Revision: https://reviews.llvm.org/D114676
The file was modifiedllvm/test/CodeGen/PowerPC/vec_extract_p9.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/vec_conv_i16_to_fp32_elts.ll
Commit 47616c8855fd44abcbd7cad3f7d8153d28db347b by flo
[BasicAA] Add tests for memset_pattern{4,8,16}.

This also removes the existing memset_pattern.ll test, which was relying
on GVN. It is also covered by the new test directly.
The file was addedllvm/test/Analysis/BasicAA/libfuncs-darwin.ll
The file was removedllvm/test/Analysis/BasicAA/memset_pattern.ll
Commit 2cdc6f2ca62e83fec445114fbbe6276e9ab2a7d0 by djtodoro
Reland "[LICM] Hoist LOAD without sinking the STORE"

When doing load/store promotion within LICM, if we
cannot prove that it is safe to sink the store we won't
hoist the load, even though we can prove the load could
be dereferenced and moved outside the loop. This patch
implements the load promotion by moving it in the loop
preheader by inserting proper PHI in the loop. The store
is kept as is in the loop. By doing this, we avoid doing
the load from a memory location in each iteration.

Please consider this small example:

loop {
  var = *ptr;
  if (var) break;
  *ptr= var + 1;
}
After this patch, it will be:

var0 = *ptr;
loop {
  var1 = phi (var0, var2);
  if (var1) break;
  var2 = var1 + 1;
  *ptr = var2;
}
This addresses some problems from [0].

[0] https://bugs.llvm.org/show_bug.cgi?id=51193

Differential revision: https://reviews.llvm.org/D113289
The file was modifiedllvm/test/Transforms/LICM/promote-capture.ll
The file was modifiedllvm/include/llvm/Transforms/Utils/SSAUpdater.h
The file was modifiedllvm/test/Transforms/LICM/scalar-promote-memmodel.ll
The file was modifiedllvm/test/Transforms/LICM/hoist-load-without-store.ll
The file was modifiedllvm/test/Transforms/LICM/scalar-promote-opaque-ptrs.ll
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
The file was modifiedllvm/test/Transforms/LICM/scalar-promote.ll
The file was modifiedllvm/lib/Transforms/Utils/SSAUpdater.cpp
The file was modifiedllvm/test/Transforms/InstMerge/st_sink_bugfix_22613.ll
Commit 3b442644e278b53e351addf349c75b995b10f029 by simon.moll
[VE][Clang][NFC] Disable VE toolchain tests on Windows

VE hardware is unsupported under Windows. Disable the clang VE toolchain
tests here. Tests breaking because of non-POSIX path separators.
The file was modifiedclang/test/Driver/ve-toolchain.cpp
The file was modifiedclang/test/Driver/ve-toolchain.c
Commit 4244f95cc6ce73ab38fbb91929a0888309f3ca8d by matthew.devereau
[AArch64][SVE] Enable bf16 vector.insert

Allow passthrough bf16 registers for vector.insert

Differential revision: https://reviews.llvm.org/D114858
The file was modifiedllvm/test/CodeGen/AArch64/sve-insert-vector.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit 2a1bf9e0cf78a0582b62de8e78375394bb8f6711 by schmeise
Expand testing of necessary features for print-changed=dot-cfg.

Summary:
Expand the testing for whether the lit tests for print-changed=dot-cfg
are supported to include checking whether dot supports pdf output.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: hvdijk (Harald van Dijk)
Differential Revision: https://reviews.llvm.org/D113187
The file was modifiedllvm/test/Other/ChangePrinters/DotCfg/lit.local.cfg
Commit 99961b4f1c73f135e5022d7c09dca05eb867cf7b by clementval
[fir] Declare test function inline

Declare functions checkCallOp and checkCallOpFromResultBox inline due to buildbot failure flang-aarch64-latest-clang
The file was modifiedflang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h
Commit 6a9487df73e917c4faf5e060f2bb33c6ade3f967 by yitzhakm
Add new clang-tidy check for string_view(nullptr)

Checks for various ways that the `const CharT*` constructor of `std::basic_string_view` can be passed a null argument and replaces them with the default constructor in most cases. For the comparison operators, braced initializer list does not compile so instead a call to `.empty()` or the empty string literal are used, where appropriate.

This prevents code from invoking behavior which is unconditionally undefined. The single-argument `const CharT*` constructor does not check for the null case before dereferencing its input. The standard is slated to add an explicitly-deleted overload to catch some of these cases: wg21.link/p2166

https://reviews.llvm.org/D114823 is a companion change to prevent duplicate warnings from the `bugprone-string-constructor` check.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D113148
The file was addedclang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp
The file was addedclang-tools-extra/docs/clang-tidy/checks/bugprone-stringview-nullptr.rst
The file was modifiedclang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
The file was addedclang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.h
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was addedclang-tools-extra/test/clang-tidy/checkers/bugprone-stringview-nullptr.cpp
The file was modifiedclang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/list.rst
Commit 4e9e2f24178077d7055c0f667d13f887fef508d5 by yitzhakm
Fix documentation for `forEachLambdaCapture` and `hasAnyCapture`

Updates the return types of these matchers' definitions to use
`internal::Matcher<LambdaCapture>` instead of `LambdaCaptureMatcher`. This
ensures that they are categorized as traversal matchers, instead of narrowing
matchers.

Reviewed By: ymandel, tdl-g, aaron.ballman

Differential Revision: https://reviews.llvm.org/D114809
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
Commit f4d3cb4ca833d0b165d199e78ed8f1d59a8032eb by anastasia.stulova
[HIPSPV] Add CUDA->SPIR-V address space mapping

Add mapping for CUDA address spaces for HIP to SPIR-V
translation. This change allows HIP device code to be
emitted as valid SPIR-V by mapping unqualified pointers
to generic address space and by mapping __device__ and
__shared__ AS to their equivalent AS in SPIR-V
(CrossWorkgroup and Workgroup, respectively).

Cuda's __constant__ AS is handled specially. In HIP
unqualified pointers (aka "flat" pointers) can point to
__constant__ objects. Mapping this AS to ConstantMemory
would produce to illegal address space casts to
generic AS. Therefore, __constant__ AS is mapped to
CrossWorkgroup.

Patch by linjamaki (Henry Linjamäki)!

Differential Revision: https://reviews.llvm.org/D108621
The file was modifiedclang/lib/Basic/Targets/SPIR.h
The file was addedclang/test/CodeGenHIP/hipspv-addr-spaces.cpp
Commit 6f08b55213d8a7646b01b20d506bd7f2e170de83 by jeroen.dobbelaere
[flang] GettingInvolved: update LLVM Alias Analysis Technical Call info

The google doc was changed and the calls are now using teams.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D114145
The file was modifiedflang/docs/GettingInvolved.md
Commit a692c5492ad534c54ee283ac266e841d781cac90 by llvmgnsyncbot
[gn build] Port 6a9487df73e9
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn
Commit 9f9e8ba114ce091f375f7ea9316a65c7582d6882 by flo
[MemoryLocation] Support memset_chk in getForArgument.

The size argument for memset_chk is an upper bound for the size of the
pointer argument. memset_chk may write less than the specified length,
if it exceeds the specified max size and aborts.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D114870
The file was modifiedllvm/test/Analysis/BasicAA/libfuncs.ll
The file was modifiedllvm/lib/Analysis/MemoryLocation.cpp
Commit 97e921c81fbfa75d6863cf08268373983193d420 by spatel
[PatternMatch] create and use matcher for 'not' that excludes undef elements

We needed a stricter version of m_Not for D114462, but I wasn't
sure if that was going to be required anywhere else, so I didn't bother
to make that reusable.

It turns out we have one more existing simplification that needs
this (currently miscompiles):
https://alive2.llvm.org/ce/z/9-nTKi

And there's at least one more fold in that family that we could add.

Differential Revision: https://reviews.llvm.org/D114882
The file was modifiedllvm/unittests/IR/PatternMatch.cpp
The file was modifiedllvm/include/llvm/IR/PatternMatch.h
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 32568fc95e75b9c6cfaf6964bcf2d8db342f23ad by lntue
[libc] Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth).

Fix a bug in MPFRUtils making ULP values off by 2^(-mantissaWidth) and incorrect eps for denormal numbers.

Differential Revision: https://reviews.llvm.org/D114878
The file was modifiedlibc/utils/MPFRWrapper/MPFRUtils.cpp
Commit 639a78a4bf9da0a03dcd12c27f625a134a3ee6cc by flo
[MemoryLocation] Support strncpy in getForArgument.

The size argument of strncpy can be used as bound for the size of
its pointer arguments.

strncpy is guaranteed to write N bytes and reads up to N bytes.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D114871
The file was modifiedllvm/lib/Analysis/MemoryLocation.cpp
The file was modifiedllvm/test/Analysis/BasicAA/libfuncs.ll
Commit e92429d99b2c903952a7217228a3eaaa02609163 by simon.moll
[VE][NFC] Cleanup redundant namespace wrapper
The file was modifiedllvm/lib/Target/VE/MCTargetDesc/VEInstPrinter.cpp
Commit 17a3385c3538530dc06851559a62eb8ec15f88d1 by david.stuttard
[AMDGPU] Test for in-order waitcnt insertion for bvh instructions

In-order bvh instructions don't require a waitcnt as order is
guaranteed.

However, waitcnt IS required for other image instruction types vs
bvh.

Pre-commit test for new functionality in https://reviews.llvm.org/D114794

Differential Revision: https://reviews.llvm.org/D114792
The file was addedllvm/test/CodeGen/AMDGPU/waitcnt-bvh.mir
Commit 0e8590f065992418b1da7dd2c1cc4f93c7831278 by david.stuttard
[AMDGPU] Add support for in-order bvh in waitcnt pass

bvh should be handled separately from vmem and vmem with sampler instructions
for waitcnt handling.

Differential Revision: https://reviews.llvm.org/D114794
The file was modifiedllvm/test/CodeGen/AMDGPU/waitcnt-bvh.mir
The file was modifiedllvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Commit 75106413d0802982b208ab5adf22c4c45766f0c2 by a.bataev
[SLP][NFC]Add a test for extractelements with many uses vectorization, NFC.
The file was addedllvm/test/Transforms/SLPVectorizer/X86/extractelement-multiple-uses.ll
Commit c006ea6bde234153abadc8927557da9b8e0dc029 by yitzhakm
[clang-tidy] Fix build broken by commit 6a9487df73e917c4faf5e060f2bb33c6ade3f967 (D113148)
The file was modifiedclang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
Commit 770a50b28c00211f9a0ceb549da1f6fd9bb405a8 by flo
[AnnotationRemarks] Support generating annotation remarks with -O0.

This matches the legacy pass manager behavior. If remarks are not
enabled the pass is effectively a no-op.
The file was modifiedllvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
The file was modifiedllvm/test/Other/new-pm-O0-defaults.ll
The file was modifiedllvm/lib/Passes/PassBuilderPipelines.cpp