Changes

Summary

  1. Warn if using `elifdef` & `elifndef` in not C2x & C++2b mode (details)
  2. [mlir][vector] Add lowering pattern for vector.warp_execute_on_lane_0 op (details)
  3. Reland "[analyzer] Canonicalize SymIntExpr so the RHS is positive when possible" (details)
  4. [AArch64] Preserve chain when lowering fixed length load to SVE (PR55281) (details)
  5. [openmp] Fix strict aliasing issue in cmpxchg routine (details)
  6. [clang] add -fmodule-file-home-is-cwd (details)
  7. [clang] serialize SUBMODULE_TOPHEADER relative to BaseDirectory (details)
  8. [clang] serialize ORIGINAL_PCH_DIR relative to BaseDirectory (details)
  9. [ArgPromotion] Make a non-byval promotion attempt first (details)
  10. [DebugInfo][InstrRef] Describe value sizes when spilt to stack (details)
  11. [CodeGen][NFC] Move some comments from the end of lines to above them (details)
  12. Fixes a performance problem with lowering of forall loops and creating (details)
  13. [DenseElementAttr] Simplify the public API for creating these. (details)
  14. Various improvements suggested by river NFC. (details)
  15. [DeadArgElim] Re-apply: Set unused arguments for internal functions (details)
  16. [DenseElementAttr] Silence warning in -DNDEBUG builds. NFC. (details)
  17. [libcxx] Switch __cxx_contention_t to int32_t on 32 bit AIX (details)
  18. [clang]Silence warning in MicrosoftCXXABI.cpp (details)
  19. [RISCV] Use tail agnostic policy when selecting riscv_fma_vl to instructions (details)
  20. [TypePromotion] Promote undef by converting to 0. (details)
  21. [CSSPGO][llvm-profgen] Do not duplicate context profiles into base profile when converting CS flat profile to nested. (details)
  22. [Headers][MSVC] Define wchar_t in stddef.h like MSVC if not using the builtin type (details)
  23. [CostModel][X86] Auto generate gather/scatter LV costs using UTC_ARGS --filter control (details)
  24. [CostModel][X86] Auto generate masked load/store LV costs using UTC_ARGS --filter control (details)
  25. [CostModel][X86] Auto generate partial interleaved load LV costs using UTC_ARGS --filter control (details)
  26. [libc++abi] Refactor exception type demangling into a separate function (details)
  27. Check for resource exhaustion when recursively parsing declarators (details)
  28. [libc++abi][NFC] Add comment on long reaching #if (details)
  29. [RISCV] Extend dataflow workaround from D119518 to fallthrough blocks (details)
  30. [InstCombine] freeze operand in div+mul fold (details)
  31. [Sanitizers][Darwin] Add READ/WRITE detection on arm64 for darwin. (details)
  32. [llvm-profgen] Filter out oversized LBR ranges. (details)
  33. [ELF] Align the end of PT_GNU_RELRO to max-page-size instead of common-page-size (details)
  34. [clang] Allow all string types for all attribute(format) styles (details)
  35. [libc] add uint128 implementation (details)
  36. [SLP][NFC] Added test to exercise the cause of a crash caused by reordering. (details)
  37. [LAA] Initial support for runtime checks with pointer selects. (details)
  38. [libc] fix uint includes and libc bazel (details)
  39. [libc++] Mark <stdatomic.h> as requiring C++23 (details)
  40. [mlir] translate memref.reshape ops that have static shapes (details)
  41. [runtimes] [cmake] Fix -Werror detection in common build configs (details)
  42. We don't require users to type out the full context of a function, for (details)
  43. [llvm-readobj] [COFF] Fix the printout for ARM64 packed homed parameters (details)
  44. [RISCV] Add extra space into error message about unsupported extension version. (details)
  45. [libc][docs] Add doc for libc stdio functions (details)
Commit a1545f51a9ef299ca6c6716bd80b862f360453ab by aaron
Warn if using `elifdef` & `elifndef` in not C2x & C++2b mode

This adds an extension warning when using the preprocessor conditionals
in a language mode they're not officially supported in, and an opt-in
warning for compatibility with previous standards.

Fixes #55306
Differential Revision: https://reviews.llvm.org/D125178
The file was modifiedclang/test/Lexer/Inputs/unsafe-macro-2.h
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/test/Preprocessor/macro_misc.c
The file was modifiedclang/lib/Lex/PPDirectives.cpp
The file was modifiedclang/test/Preprocessor/macro_vaopt_check.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticLexKinds.td
The file was addedclang/test/Preprocessor/ext-pp-directive.c
The file was modifiedclang/test/Preprocessor/if_warning.c
The file was modifiedclang/test/Preprocessor/ifdef-recover.c
The file was modifiedclang/test/Lexer/deprecate-macro.c
The file was modifiedclang/test/Preprocessor/elifdef.c
Commit d02f10d96d4506cfe2777e410570a47d83de214e by thomasraoux
[mlir][vector] Add lowering pattern for vector.warp_execute_on_lane_0 op

Add lowering of the vector.warp_execute_on_lane_0 into scf.if plus memory
transfer for the operands and yield values.

This also add an integration test running on GPU warp. The same tests can be
later re-used with different comment lines to tests distribution
transformations.

This is mostly from @springerm contribution.

Differential Revision: https://reviews.llvm.org/D125430
The file was addedmlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
The file was addedmlir/test/Integration/Dialect/Vector/GPU/CUDA/lit.local.cfg
The file was modifiedmlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
The file was modifiedmlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
The file was addedmlir/test/Dialect/Vector/vector-warp-distribute.mlir
The file was addedmlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h
The file was modifiedutils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
The file was modifiedmlir/test/lib/Dialect/Vector/CMakeLists.txt
The file was addedmlir/test/Integration/Dialect/Vector/GPU/CUDA/test-warp-distribute.mlir
Commit 14742443a25826547e480189657b16c7a11664e7 by balazs.benics
Reland "[analyzer] Canonicalize SymIntExpr so the RHS is positive when possible"

This PR changes the `SymIntExpr` so the expression that uses a
negative value as `RHS`, for example: `x +/- (-N)`, is modeled as
`x -/+ N` instead.

This avoids producing a very large `RHS` when the symbol is cased to
an unsigned number, and as consequence makes the value more robust in
presence of casts.

Note that this change is not applied if `N` is the lowest negative
value for which negation would not be representable.

Reviewed By: steakhal

Patch By: tomasz-kaminski-sonarsource!

Differential Revision: https://reviews.llvm.org/D124658
The file was addedclang/test/Analysis/additive-op-on-sym-int-expr.c
The file was modifiedclang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
The file was modifiedclang/test/Analysis/expr-inspection.c
Commit 44d85259d0187c4674e91bd888ed0ccddd4a5ab5 by npopov
[AArch64] Preserve chain when lowering fixed length load to SVE (PR55281)

When a fixed length load is lowered to an SVE masked load, the
result chain is currently set to the input chain of the old load,
rather than the result chain of the new load. This may cause stores
to be incorrectly reordered.

Fixes https://github.com/llvm/llvm-project/issues/55281.

Differential Revision: https://reviews.llvm.org/D125464
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-frame-offests.ll
Commit 40d3a0ba4d9e5452c0a68cfdaa8e88eb8ed5c63d by sguelton
[openmp] Fix strict aliasing issue in cmpxchg routine

Avoid warning under -fstrict-aliasing by using a call to memcpy to perform type
punning.

Differential Revision: https://reviews.llvm.org/D125467
The file was modifiedopenmp/runtime/src/kmp_os.h
Commit 646e502de0d854cb3ecaca90ab52bebfe59a40cd by rhow
[clang] add -fmodule-file-home-is-cwd

This diff adds a new frontend flag `-fmodule-file-home-is-cwd`.
The behavior of this flag is similar to
`-fmodule-map-file-home-is-cwd` but does not require the module
map files to be modified to have inputs relative to the cwd.
Instead the output modules will have their `BaseDirectory` set
to the cwd and will try and resolve paths relative to that.

The motiviation for this change is to support relocatable pcm
files that are built on different machines with different paths
without having to alter module map files, which is sometimes not
possible as they are provided by 3rd parties.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D124874
The file was modifiedclang/include/clang/Lex/HeaderSearchOptions.h
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was addedclang/test/Modules/module-file-home-is-cwd.m
The file was modifiedclang/include/clang/Driver/Options.td
Commit f11056943e56a32d81bb36d11fb5ce8d2b2ce79b by rhow
[clang] serialize SUBMODULE_TOPHEADER relative to BaseDirectory

This diff changes the serialization of the `SUBMODULE_TOPHEADER`
entry in module files to be serialized relative to the module's
`BaseDirectory`. This matches the behavior of the
`SUBMODULE_HEADER` entry and will allow for the module to be
relocatable across machines.

The path is restored relative to the module's `BaseDirectory` on
deserialization.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D124938
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was addedclang/test/Modules/relative-submodule-topheader.m
Commit ee51e9795a31e1280e30179215c27e09927230e2 by rhow
[clang] serialize ORIGINAL_PCH_DIR relative to BaseDirectory

This diff changes the serialization of the `ORIGINAL_PCH_DIR`
entry in module files to be serialized relative to the module's
`BaseDirectory`. This will allow for the module to be relocatable
across machines.

The path is restored relative to the module's BaseDirectory on
deserialization.

Reviewed By: urnathan

Differential Revision: https://reviews.llvm.org/D124946
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was addedclang/test/Modules/relative-original-dir.m
Commit 098afdb0a0f9254f84733fb1987018528a89accc by npopov
[ArgPromotion] Make a non-byval promotion attempt first

It makes sense to make a non-byval promotion attempt first and then
fall back to the byval one. The non-byval ('usual') promotion is
generally better, for example it does promotion even when a structure
has more elements than 'MaxElements' but not all of them are actually
used in the function.

Differential Revision: https://reviews.llvm.org/D124514
The file was modifiedllvm/test/Transforms/ArgumentPromotion/fp80.ll
The file was addedllvm/test/Transforms/ArgumentPromotion/byval-through-pointer-promotion.ll
The file was modifiedllvm/test/Transforms/ArgumentPromotion/dbg.ll
The file was modifiedllvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Commit a975472fa6972bced6a6075fe248bffedeecd96d by jeremy.morse
[DebugInfo][InstrRef] Describe value sizes when spilt to stack

This is a re-apply of D123599, which was reverted in 4fe2ab5279408, now
with a more appropriate assertion. Original commit message follow:

InstrRefBasedLDV can track and describe variable values that are spilt to
the stack -- however it does not current describe the size of the value on
the stack. This can cause uninitialized bytes to be read from the stack if
a small register is spilt for a larger variable, or theoretically on
big-endian machines if a large value on the stack is used for a small
variable.

Fix this by using DW_OP_deref_size to specify the amount of data to load
from the stack, if there's any possibility for ambiguity. There are a few
scenarios where this can be omitted (such as when using DW_OP_piece and a
non-DW_OP_stack_value location), see deref-spills-with-size.mir for an
explicit table of inputs flavours and output expressions.

Differential Revision: https://reviews.llvm.org/D123599
The file was modifiedllvm/test/DebugInfo/MIR/X86/livedebugvalues_load_in_loop.mir
The file was modifiedllvm/test/DebugInfo/MIR/X86/live-debug-values-restore.mir
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
The file was addedllvm/test/DebugInfo/MIR/InstrRef/deref-spills-with-size.mir
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
The file was addedllvm/test/DebugInfo/MIR/InstrRef/follow-spill-of-indir-value.mir
Commit 1106bc208c663fad5ded5592bb5fee84984bb35a by fraser
[CodeGen][NFC] Move some comments from the end of lines to above them

This avoids wrapping the line itself awkwardly when it exceeds 80 chars.
It also better matches our style most other places.
The file was modifiedllvm/lib/CodeGen/PrologEpilogInserter.cpp
Commit 6822ed035f188aa55f9ac283d2eb20dcc7a9ca07 by eschweitz
Fixes a performance problem with lowering of forall loops and creating
too many temporaries.

Fix clang-format errors.

Differential Revision: https://reviews.llvm.org/D125336
The file was modifiedflang/test/Lower/forall/test9.f90
The file was modifiedflang/test/Lower/forall/forall-construct-3.f90
The file was addedflang/test/Lower/forall/array-constructor.f90
The file was modifiedflang/lib/Lower/ConvertExpr.cpp
The file was modifiedflang/test/Lower/forall/forall-2.f90
The file was modifiedflang/test/Lower/forall/forall-construct.f90
The file was modifiedflang/test/Lower/forall/forall-ranked.f90
The file was modifiedflang/test/Lower/forall/forall-construct-2.f90
The file was modifiedflang/test/Lower/forall/forall-slice.f90
Commit f21896f2c6dc6f4c2c3d0f192f7fefd178f5d5f7 by clattner
[DenseElementAttr] Simplify the public API for creating these.

Instead of requiring the client to compute the "isSplat" bit,
compute it internally.  This makes the logic more consistent
and defines away a lot of "elements.size()==1" in the clients.

This addresses Issue #55185

Differential Revision: https://reviews.llvm.org/D125447
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.td
The file was modifiedmlir/lib/CAPI/IR/BuiltinAttributes.cpp
The file was modifiedmlir/lib/IR/BuiltinAttributes.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.h
The file was modifiedmlir/lib/Parser/AttributeParser.cpp
The file was modifiedmlir/lib/Dialect/Tensor/IR/TensorOps.cpp
Commit 3cce374ee66373488e7b4c3e113cf4e65b20319b by clattner
Various improvements suggested by river NFC.

Differential Revision: https://reviews.llvm.org/D125471
The file was modifiedmlir/lib/IR/BuiltinAttributes.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.td
Commit 9766fed9c10e8ba2f67fad0a3e8b509a8064f7b3 by qcolombet
[DeadArgElim] Re-apply: Set unused arguments for internal functions

The re-apply includes fixes to clang tests that were missed in
the original commit.

Original message:
Prior to this patch we would only set to undef the unused arguments of the
external functions. The rationale was that unused arguments of internal
functions wouldn't need to be turned into undef arguments because they
should have been simply eliminated by the time we reach that code.

This is actually not true because there are plenty of cases where we can't
remove unused arguments. For instance, if the internal function is used in
an indirect call, it may not be possible to change the function signature.
Yet, for statically known call-sites we would still like to mark the unused
arguments as undef.

This patch enables the "set undef arguments" optimization on internal
functions when we encounter cases where internal functions cannot be
optimized. I.e., whenever an internal function is marked "live".

Differential Revision: https://reviews.llvm.org/D124699
The file was modifiedclang/test/CodeGen/debug-info-block-vars.c
The file was modifiedclang/test/CodeGenObjCXX/nrvo.mm
The file was addedllvm/test/Transforms/DeadArgElim/fct_ptr.ll
The file was modifiedllvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
Commit 434385ba4104e240adcc2303a1800c5855e1c384 by benny.kra
[DenseElementAttr] Silence warning in -DNDEBUG builds. NFC.
The file was modifiedmlir/lib/IR/BuiltinAttributes.cpp
Commit 39328a658181d7dcd1d54428bece7998ff6acdd3 by martin
[libcxx] Switch __cxx_contention_t to int32_t on 32 bit AIX

I guess this is an ABI break for the 32 bit AIX configuration, but I'm
not sure if that one is meant to be ABI stable yet or not.

Previously, this used int32_t for this type on linux, but int64_t
on all other platforms. This was added in D68480 /
54fa9ecd3088508b05b0c5b5cb52da8a3c188655, but I don't really see
any discussion around this detail there.

Switching this to 32 bit on 32 bit AIX silences these libcxx build
warnings:

```
In file included from /scratch/powerllvm/cpap8006/llvm-project/libcxx-ci/libcxx/src/atomic.cpp:12:
/scratch/powerllvm/cpap8006/llvm-project/libcxx-ci/build/aix/include/c++/v1/atomic:1005:12: warning: large atomic operation may incur significant performance penalty; the access size (8 bytes) exceeds the max lock-free size (4  bytes) [-Watomic-alignment]
    return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
           ^
/scratch/powerllvm/cpap8006/llvm-project/libcxx-ci/build/aix/include/c++/v1/atomic:948:12: warning: large atomic operation may incur significant performance penalty; the access size (8 bytes) exceeds the max lock-free size (4  bytes) [-Watomic-alignment]
    return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
           ^
/scratch/powerllvm/cpap8006/llvm-project/libcxx-ci/build/aix/include/c++/v1/atomic:1000:12: warning: large atomic operation may incur significant performance penalty; the access size (8 bytes) exceeds the max lock-free size (4  bytes) [-Watomic-alignment]
    return __c11_atomic_fetch_add(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
           ^
/scratch/powerllvm/cpap8006/llvm-project/libcxx-ci/build/aix/include/c++/v1/atomic:1022:12: warning: large atomic operation may incur significant performance penalty; the access size (8 bytes) exceeds the max lock-free size (4  bytes) [-Watomic-alignment]
    return __c11_atomic_fetch_sub(&__a->__a_value, __delta, static_cast<__memory_order_underlying_t>(__order));
           ^
4 warnings generated.
```

Differential Revision: https://reviews.llvm.org/D124519
The file was modifiedlibcxx/include/atomic
Commit 0f292141aadb0489231de31de966c239486e019d by Yaxun.Liu
[clang]Silence warning in MicrosoftCXXABI.cpp

Silence warning with gcc 9.3 about:

[1/351] Building CXX object tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/MicrosoftCXXABI.cpp.o
../../clang/lib/AST/MicrosoftCXXABI.cpp:57:12: warning: 'virtual unsigned int {anonymous}::MicrosoftNumberingContext::getManglingNumber(const clang::VarDecl*, unsigned int)' was hidden [-Woverloaded-virtual]
   57 |   unsigned getManglingNumber(const VarDecl *VD,
      |            ^~~~~~~~~~~~~~~~~
../../clang/lib/AST/MicrosoftCXXABI.cpp:80:12: warning:   by 'virtual unsigned int {anonymous}::MSHIPNumberingContext::getManglingNumber(const clang::TagDecl*, unsigned int)' [-Woverloaded-virtual]
   80 |   unsigned getManglingNumber(const TagDecl *TD,
      |            ^~~~~~~~~~~~~~~~~

Change-Id: Ia519e77c6454eb020228478dd6498eaf7864dae8
The file was modifiedclang/lib/AST/MicrosoftCXXABI.cpp
Commit 40e965451151dadc46c3f41249edf4651015fda4 by craig.topper
[RISCV] Use tail agnostic policy when selecting riscv_fma_vl to instructions

riscv_fma_vl doesn't have a tail, so use the tail_agnostic policy.

We were already doing this for some patterns. I think the patterns
with fneg and mask were added later and I copied the tail policy
from the unmasked patterns.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D125424
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfma-vp.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
The file was modifiedllvm/test/CodeGen/RISCV/rvv/sink-splat-operands.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vfma-vp.ll
Commit cec249c60dad84574fd53d2fbf158bfeef226777 by craig.topper
[TypePromotion] Promote undef by converting to 0.

If we're promoting an undef I think that means that we expect the
upper bits are zero. undef doesn't guarantee that.

This patch replaces undef with 0 to ensure this. This matches how
a zext or sext of undef would be folded by InstCombine/InstSimplify.

I haven't found a failure from this was just thinking through the code.

Differential Revision: https://reviews.llvm.org/D123174
The file was modifiedllvm/lib/CodeGen/TypePromotion.cpp
The file was modifiedllvm/test/Transforms/TypePromotion/ARM/phis-ret.ll
The file was modifiedllvm/test/CodeGen/AArch64/typepromotion-phisret.ll
The file was modifiedllvm/test/Transforms/TypePromotion/AArch64/trunc-zext-chain.ll
Commit 23191a4ffee999f764215daf4efc9e18eca291bb by hoy
[CSSPGO][llvm-profgen] Do not duplicate context profiles into base profile when converting CS flat profile to nested.

Recent experiments with our two large internal services showed that duplicating context profiles into base profile caused code size inflation and didn't deliver good performance compared to no such duplication. It was a trick we made to catch up with the CS flat profile and I'm now turning it off by default.

The code size inflation mainly comes from the enriched based profiles. A base profile for a function represents the uninlined (or outlined) portion of the whole function running time. Such portion could be very small if a function is inlined into most of its hot callsites. Duplicating context profiles of the function into its base profiles could cause the outlined body to be hot enough and in turn get many of its callees inlined, thus increases the code size. The size inflation could further cause perf regression.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D124796
The file was modifiedllvm/lib/ProfileData/SampleProf.cpp
The file was modifiedllvm/test/tools/llvm-profgen/cs-preinline.test
Commit 7f9837cfa63663ccd51da3e5de73acec8f776ee8 by steplong
[Headers][MSVC] Define wchar_t in stddef.h like MSVC if not using the builtin type

MSVC expects wchar_t to be defined in stddef.h if /Zc:wchar_t- is specified

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D124026
The file was addedclang/test/Headers/ms-no-wchar.cpp
The file was modifiedclang/lib/Headers/stddef.h
Commit a5c45c4dc12c14cf3a657726ab04a025d6ea924b by llvm-dev
[CostModel][X86] Auto generate gather/scatter LV costs using UTC_ARGS --filter control

Also fix a sse42 -> sse4.2 typo so that we actually test costs for sse4.2
The file was modifiedllvm/test/Analysis/CostModel/X86/gather-i16-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-gather-i32-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/scatter-i8-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/gather-i32-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/gather-i8-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-gather-i64-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/scatter-i16-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-scatter-i64-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/scatter-i32-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/scatter-i64-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/gather-i64-with-i8-index.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-scatter-i32-with-i8-index.ll
Commit 14e83ada16b3944a4431617ed4ce7088f7f7cd9a by llvm-dev
[CostModel][X86] Auto generate masked load/store LV costs using UTC_ARGS --filter control

Also fix a sse42 -> sse4.2 typo so that we actually test costs for sse4.2
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-store-i32.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-load-i8.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-interleaved-store-i16.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-store-i16.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-interleaved-load-i16.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-store-i8.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-load-i16.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-load-i64.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-store-i64.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/masked-load-i32.ll
Commit 47be07074a73bd469b16af440923e3cf3b6b3f10 by llvm-dev
[CostModel][X86] Auto generate partial interleaved load LV costs using UTC_ARGS --filter control
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-4-indices-01uu.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-4-indices-012u.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-3-indices-01u.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-2-indices-0u.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-3-indices-0uu.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/interleaved-load-i32-stride-4-indices-0uuu.ll
Commit 6089fd6c0b1cca4fd16583b25954c132a9b58ebd by Louis Dionne
[libc++abi] Refactor exception type demangling into a separate function

As a fly-by fix, also let `__cxa_demangle` allocate its buffer alone,
since we are not allowed to pass a non-malloc'd buffer to it.

Differential Revision: https://reviews.llvm.org/D125268
The file was modifiedlibcxxabi/src/cxa_default_handlers.cpp
Commit c671041720347c9deb35b1165ee6b6bb88abf07a by aaron
Check for resource exhaustion when recursively parsing declarators

With sufficiently tortured code, it's possible to cause a stack
overflow when parsing declarators. Thus, we now check for resource
exhaustion when recursively parsing declarators so that we can at least
warn the user we're about to crash before we actually crash.

Fixes #51642

Differential Revision: https://reviews.llvm.org/D124915
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/lib/Parse/ParseDecl.cpp
Commit 2f21f5b06a490396af10359b32c6313521e526a1 by Louis Dionne
[libc++abi][NFC] Add comment on long reaching #if
The file was modifiedlibcxxabi/src/cxa_default_handlers.cpp
Commit 52b5f1f7d41097e8059fac97f3c91dd4012d3df3 by preames
[RISCV] Extend dataflow workaround from D119518 to fallthrough blocks

We've got a lurking problem with our data flow implementation where different phases disagree, resulting in possible miscompiles. D119518 introduced a workaround, but failed to consider blocks without terminators (e.g. fallthroughs).

I have a deeper rework of the algorithm in flight over in D125232, but this patch is specifically a minimal fix for an active miscompile. That change can be reworked over this once landed.

Differential Revision: https://reviews.llvm.org/D125408
The file was modifiedllvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.mir
Commit 2fa8fc3d0afa00a96c11bdf655fa3e8d6707942c by spatel
[InstCombine] freeze operand in div+mul fold

As discussed in issue #37809, this transform is not safe
if the input is an undefined value.

This is similar to recent changes for urem and sdiv:
d428f09b2c9d
99ef341ce943

There is no difference in codegen on the basic examples,
but this could lead to regressions. We may need to
improve freeze analysis or lowering if that happens.

Presumably, in real cases that are similar to the tests
where a subsequent transform removes the rem, we
will also be able to remove the freeze by seeing that
the parameter has 'noundef'.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
The file was modifiedllvm/test/Transforms/InstCombine/add4.ll
The file was modifiedllvm/test/Transforms/InstCombine/exact.ll
The file was modifiedllvm/test/Transforms/InstCombine/rem.ll
Commit 9145cb8b7c9acd6e7980047e048007bc58b7fab9 by bgaston2
[Sanitizers][Darwin] Add READ/WRITE detection on arm64 for darwin.

On arm64 the read/write flag is set on the esr register.
Adding this flag check for arm64 enables a more accurate
print out for sanitizer signal reports and matches the
behavior on x86.

Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=27543 https://github.com/google/sanitizers/issues/653

These tests are now passing:
SanitizerCommon-asan-arm64-Darwin :: Posix/illegal_read_test.cpp
SanitizerCommon-asan-arm64-Darwin :: Posix/illegal_write_test.cpp
SanitizerCommon-asan-arm64e-Darwin :: Posix/illegal_read_test.cpp
  SanitizerCommon-asan-arm64e-Darwin :: Posix/illegal_write_test.cpp
  SanitizerCommon-tsan-arm64-Darwin :: Posix/illegal_read_test.cpp
  SanitizerCommon-tsan-arm64-Darwin :: Posix/illegal_write_test.cpp
  SanitizerCommon-tsan-arm64e-Darwin :: Posix/illegal_read_test.cpp
  SanitizerCommon-tsan-arm64e-Darwin :: Posix/illegal_write_test.cpp
  SanitizerCommon-ubsan-arm64-Darwin :: Posix/illegal_read_test.cpp
  SanitizerCommon-ubsan-arm64-Darwin :: Posix/illegal_write_test.cpp
  SanitizerCommon-ubsan-arm64e-Darwin :: Posix/illegal_read_test.cpp
  SanitizerCommon-ubsan-arm64e-Darwin :: Posix/illegal_write_test.cpp

rdar://92104440

Differential Revision: https://reviews.llvm.org/D125416
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
Commit 9f732af583c0dba58847b753a87cc5432ec33f09 by wlei
[llvm-profgen] Filter out oversized LBR ranges.

As a follow up to {D123271}, LBR ranges that are too big should also be considered as invalid.

For example, the last two pairs in the following trace form a range [0x0d7b02b0, 0x368ba706] that covers a ton of functions in the binary. Such oversized range should also be ignored.

   0x0c74505f/0x368b99a0 **0x368ba706**/0x0c745040  0x0d7b1c3f/**0x0d7b02b0**

Add a defensive check to filter out those ranges based that the valid range should not cross the unconditional branch(Call, return, unconditional jmp).

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D125448
The file was modifiedllvm/tools/llvm-profgen/PerfReader.h
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.cpp
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
The file was modifiedllvm/test/tools/llvm-profgen/invalid-range.test
The file was modifiedllvm/test/tools/llvm-profgen/Inputs/invalid-range.perfscript
Commit ebdb9d635a077274e38baa8584f5b0e631b4b1d3 by i
[ELF] Align the end of PT_GNU_RELRO to max-page-size instead of common-page-size

We picked common-page-size to match GNU ld. Recently, the resolution to GNU ld
https://sourceware.org/bugzilla/show_bug.cgi?id=28824 (milestone: 2.39) switched
to max-page-size so that the last page can be protected by RELRO in case the
system page size is larger than common-page-size.

Thanks to our two RW PT_LOAD scheme (D58892), switching to max-page-size does
not change file size (while GNU ld's scheme may increase file size).

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D125410
The file was modifiedlld/docs/ReleaseNotes.rst
The file was modifiedlld/test/ELF/aarch64-relro.s
The file was modifiedlld/test/ELF/basic-ppc64.s
The file was modifiedlld/ELF/Writer.cpp
Commit 91ed7e19418181ae385c2626cedd3b08b6ba43a6 by fcloutier
[clang] Allow all string types for all attribute(format) styles

This allows using any recognized kind of string for any
__attribute__((format)) archetype. Before this change, for instance,
the printf archetype would only accept char pointer types and the
NSString archetype would only accept NSString pointers. This is
more restrictive than necessary as there exist functions to
convert between string types that can be annotated with
__attribute__((format_arg)) to transfer format information.

Reviewed By: ahatanak

Differential Revision: https://reviews.llvm.org/D125254

rdar://89060618
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was modifiedclang/test/SemaObjC/format-strings-objc.m
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
Commit 1170951c737773e22b686cac195e0d13b2441374 by michaelrj
[libc] add uint128 implementation

Some platforms don't support proper 128 bit integers, but some
algorithms use them, such as any that use long doubles. This patch
modifies the existing UInt class to support the necessary operators.
This does not put this new class into use, that will be in followup
patches.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D124959
The file was modifiedlibc/utils/UnitTest/LibcTest.cpp
The file was modifiedlibc/src/__support/CPP/TypeTraits.h
The file was modifiedlibc/test/src/__support/CMakeLists.txt
The file was modifiedlibc/src/__support/FPUtil/XFloat.h
The file was modifiedlibc/src/math/generic/CMakeLists.txt
The file was addedlibc/test/src/__support/uint128_test.cpp
The file was addedlibc/src/__support/CPP/UInt.h
The file was modifiedlibc/src/__support/FPUtil/CMakeLists.txt
The file was removedlibc/src/__support/FPUtil/UInt.h
The file was modifiedlibc/src/__support/CPP/CMakeLists.txt
Commit 76775bde8ad4c03e4f9d527e5fc1f75ebae266fe by vporpodas
[SLP][NFC] Added test to exercise the cause of a crash caused by reordering.

This is to support 0950d4060cd916a1d08da657db2513d2ce3e38fa.
External users that can affect reordering, with range == VL.size() but
non consecutive (like stores to A[0],A[0],A[3],A[3]) would escape the check
for consecutive accesses and would cause a crash.
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/reorder_with_external_users.ll
Commit 5890b30105999a137e72e42f3760bebfd77001ca by flo
[LAA] Initial support for runtime checks with pointer selects.

Scaffolding support for generating runtime checks for multiple SCEV expressions
per pointer. The initial version just adds support for looking through
a single pointer select.

The more sophisticated logic for analyzing forks is in D108699

Reviewed By: huntergr

Differential Revision: https://reviews.llvm.org/D114487
The file was modifiedllvm/include/llvm/Analysis/LoopAccessAnalysis.h
The file was modifiedllvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll
The file was modifiedllvm/lib/Analysis/LoopAccessAnalysis.cpp
Commit dd7f30464bbf28e9d650b1a2cf2abade14bbb8a1 by michaelrj
[libc] fix uint includes and libc bazel

This patch fixes the includes for the new UInt class so that the api
test now passes, additionally it fixes the bazel files to account for
the new dependencies.

Differential Revision: https://reviews.llvm.org/D125490
The file was modifiedlibc/src/__support/CPP/UInt.h
The file was modifiedutils/bazel/llvm-project-overlay/libc/BUILD.bazel
Commit 4128a4a6c219a6c83483d4538a59ed8f523868a5 by Louis Dionne
[libc++] Mark <stdatomic.h> as requiring C++23

Otherwise, we might get errors with modules in pre-C++23 when mixing
<atomic> and <stdatomic.h>. This should fix breakage on Green Dragon.
The file was modifiedlibcxx/include/module.modulemap
Commit 5380e30e047bbac9b2cceb69162eb8db1e1a7abf by ashay
[mlir] translate memref.reshape ops that have static shapes

This patch references code for translating memref.reinterpret_cast ops
to add translation rules for memref.reshape ops that have a static shape
argument.  Since reshape ops don't have offsets, sizes, or strides, this
patch simply sets the allocated and aligned pointers of the MemRef
descriptor.

Reviewed By: ftynse, cathyzhyi

Differential Revision: https://reviews.llvm.org/D125039
The file was modifiedmlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
The file was modifiedmlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir
Commit f8da28f5228857e905eedb248ac82c939777f9df by martin
[runtimes] [cmake] Fix -Werror detection in common build configs

We add `--unwindlib=none` to `CMAKE_REQUIRED_FLAGS`
to make sure that builds with a yet-incomplete toolchain succeed,
to avoid linker failures about missing unwindlib.

When this option is added to `CMAKE_REQUIRED_FLAGS`, it gets added to
both compile and link commands in CMake compile tests. If
`--unwindlib=none` is included in compilation commands, it causes
warnings about unused arguments, as the flag only is relevant for
linking.

Due to the warnings in CMake tests, the later CMake test for the
`-Werror` option failed (as the tested `-Werror` option caused the
preexisting warning due to unused `--unwindlib=none` to become a
hard error). Therefore, most CI configurations that build with
`LIBCXX_ENABLE_WERROR` didn't actually end up enabling `-Werror`
after all.

When looking at the CI build log of recent CI builds, they do
end up printing:

    -- Performing Test LIBCXX_SUPPORTS_WERROR_FLAG
    -- Performing Test LIBCXX_SUPPORTS_WERROR_FLAG - Failed
    -- Performing Test LIBCXX_SUPPORTS_WX_FLAG
    -- Performing Test LIBCXX_SUPPORTS_WX_FLAG - Failed

Thus while the configurations are meant to error out on warnings,
they actually haven't done that, due to the interaction of these
options.

To fix this, remove the individual cases of adding `--unwindlib=none`
into `CMAKE_REQUIRED_FLAGS` in libcxx and libunwind.
`runtimes/CMakeLists.txt` still adds `--unwindlib=none` if needed, but
not otherwise. (The same issue with enabling `-Werror` does remain
if `--unwindlib=none` strictly is needed though - that can be fixed
separately afterwards.)

These individual cases in libunwind and libcxx were added while
standalone builds of the runtimes still were supported - but no longer
are necessary now.

Differential Revision: https://reviews.llvm.org/D124375
The file was modifiedlibunwind/cmake/config-ix.cmake
The file was modifiedlibcxx/cmake/config-ix.cmake
Commit 3339000e0bda696c2e29173d15958c0a4978a143 by jingham
We don't require users to type out the full context of a function, for
symbol name matches. Instead, we extract the incoming path's base
name, look up all the symbols with that base name, and then compare
the rest of the context that the user provided to make sure it
matches. However, we do this comparison using just a strstr. So for
instance:

break set -n foo::bar

will match not only "a::foo::bar" but "notherfoo::bar". The former is
pretty clearly the user's intent, but I don't think the latter is, and
results in breakpoints picking up too many matches.

This change adds a Language::DemangledNameContainsPath API which can
do a language aware match against the path provided. If the language
doesn't provide this we fall back to the strstr (though that's changed
to StringRef::contains in the patch).

Differential Revision: https://reviews.llvm.org/D124579
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
The file was modifiedlldb/test/API/macosx/indirect_symbol/TestIndirectSymbols.py
The file was modifiedlldb/source/Target/Language.cpp
The file was modifiedlldb/test/API/functionalities/return-value/TestReturnValue.py
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
The file was modifiedlldb/include/lldb/Target/Language.h
The file was modifiedlldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
The file was modifiedlldb/test/API/functionalities/breakpoint/cpp/main.cpp
The file was modifiedlldb/source/Core/Module.cpp
The file was modifiedlldb/test/API/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
Commit 0187bb28db73fc743ff8316be7ba6c357a8ff6ce by martin
[llvm-readobj] [COFF] Fix the printout for ARM64 packed homed parameters

If the function has homed parameters but the number of saved registers
is odd, the homed parameters are aligned at the top of the stack (so
they line up with later varargs on the stack), not tightly after the
other saved registers.

Differential Revision: https://reviews.llvm.org/D125462
The file was modifiedllvm/test/MC/AArch64/seh-packed-unwind.s
The file was modifiedllvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
The file was modifiedllvm/test/tools/llvm-readobj/COFF/arm64-packed-unwind.s
Commit 232c00ba5bd1dc6ba69598170f57cba7b20d2635 by craig.topper
[RISCV] Add extra space into error message about unsupported extension version.

Differential Revision: https://reviews.llvm.org/D125491
The file was modifiedclang/test/Driver/riscv-arch.c
The file was modifiedllvm/lib/Support/RISCVISAInfo.cpp
Commit 12aae7d9a685dfdc5c59b2003d13d088c20e697c by michaelrj
[libc][docs] Add doc for libc stdio functions

This patch adds a document describing the status of the string functions
in LLVM-libc.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D123823
The file was addedlibc/docs/stdio.rst
The file was modifiedlibc/docs/index.rst
The file was modifiedlibc/docs/strings.rst