LLVM/project 9b128e8clang/include/clang/AST FormatString.h, clang/lib/AST FormatString.cpp PrintfFormatString.cpp

[Clang] add support for C23 'H', 'D', and 'DD' length modifiers (#201098)

This patch adds `-Wformat` support for the C23 `H`, `D`, and `DD` length
modifiers in `printf`/`scanf` format strings. #116962
DeltaFile
+61-4clang/lib/AST/FormatString.cpp
+57-0clang/test/Sema/format-strings-decimal.c
+23-0clang/lib/Sema/SemaChecking.cpp
+20-2clang/lib/AST/PrintfFormatString.cpp
+15-0clang/lib/AST/ScanfFormatString.cpp
+11-0clang/include/clang/AST/FormatString.h
+187-62 files not shown
+193-68 files

LLVM/project 34208ebllvm/unittests/ObjectYAML DXContainerYAMLTest.cpp

[ObjectYAML] Avoid comparison of compressed data (#202413)

The result of zlib compression isn't consistent across versions.
Downstream this test was failing due to our version giving slightly
different results. This version passes both upstream and downstream.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+44-24llvm/unittests/ObjectYAML/DXContainerYAMLTest.cpp
+44-241 files

LLVM/project f81222cflang/include/flang/Semantics symbol.h, flang/lib/Semantics type.cpp

[flang] Inline DerivedTypeSpec::GetScope to fix shared-lib link

FortranEvaluate referenced DerivedTypeSpec::GetScope(), defined out-of-line
in FortranSemantics, producing an undefined reference in libFortranEvaluate.so
under BUILD_SHARED_LIBS=ON. Make GetScope() inline in symbol.h so no
cross-library symbol is needed.

This is the fix missing from the original PR (#192651), which was reverted
in #202408.
DeltaFile
+6-0flang/include/flang/Semantics/symbol.h
+0-4flang/lib/Semantics/type.cpp
+6-42 files

LLVM/project 8596a89flang/include/flang/Parser parse-tree.h, flang/lib/Evaluate type.cpp

Reapply "[flang] Enumeration Type: (PR 1/5) Foundation types + Parser" (#202408)

This reverts commit 3ab997597e8a5f2920efdad01cf8c29673826ba0.
DeltaFile
+113-0flang/test/Parser/enumeration-type.f90
+34-4flang/include/flang/Parser/parse-tree.h
+29-0flang/lib/Parser/Fortran-parsers.cpp
+23-0flang/lib/Evaluate/type.cpp
+18-0flang/lib/Semantics/type.cpp
+14-0flang/lib/Parser/unparse.cpp
+231-49 files not shown
+281-715 files

LLVM/project 5eae7dcllvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPlan.h, llvm/test/Transforms/LoopVectorize as_cast.ll

Revert "[VPlan] Use VPInstructionWithType for uniform casts." (#202427)

Reverts llvm/llvm-project#140623

breaks https://lab.llvm.org/buildbot/#/builders/160/builds/39088 due to
visibility issues
DeltaFile
+13-16llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+6-14llvm/lib/Transforms/Vectorize/VPlan.h
+5-13llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+9-8llvm/test/Transforms/LoopVectorize/as_cast.ll
+0-17llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+6-6llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+39-748 files not shown
+53-9814 files

LLVM/project 1d7930allvm/utils/sanitizers ubsan_ignorelist.txt

[ubsan] Add [undefined] section to ignorelist (#202380)

`-fsanitize-blacklist` this files passed as which apply to any
sanitizers.
So if Ubsan is combined with Asan, as-is these suppressions apply to
Asan
which is clearly was not the intention.
DeltaFile
+2-0llvm/utils/sanitizers/ubsan_ignorelist.txt
+2-01 files

LLVM/project 9f73a97llvm/lib/Target/X86 X86SpeculativeLoadHardening.cpp

[X86] Fix typo in SLH statistic description. NFC (#202424)
DeltaFile
+1-1llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
+1-11 files

LLVM/project 7bf7d00clang/unittests/ScalableStaticAnalysisFramework/Analyses/PointerFlow PointerFlowTest.cpp

Update clang/unittests/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowTest.cpp

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+1-1clang/unittests/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlowTest.cpp
+1-11 files

LLVM/project 700febcllvm/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/test/Transforms/InstCombine select-ctlz-to-cttz.ll

[InstCombine] Fix incorrect is_zero_poison when folding select+ctlz to cttz (#202388)

foldSelectCtlzToCttz folds

    %lz = call i32 @llvm.ctlz.i32(i32 (x & -x), i1 is_zero_poison)
    %r  = select (icmp eq x, 0), i32 32, i32 (xor %lz, 31)

into

    %r = call i32 @llvm.cttz.i32(i32 x, i1 is_zero_poison)

The original select's result is defined when x is zero, even if
is_zero_poison is true.  Therefore in the new cttz call, we need to pass
false for the second param, we can't reuse is_zero_poison.
DeltaFile
+23-0llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
+4-4llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+27-42 files

LLVM/project 14baa81llvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine frexp.ll

[InstCombine] Fix invalid IR when folding frexp(frexp(x)) with mismatched exponent types (#202419)

Instcombine folds the idempotent frexp pattern

    %inner = call { double, i64 } @llvm.frexp.f64.i64(double %x)
    %f     = extractvalue { double, i64 } %inner, 0
    %outer = call { double, i32 } @llvm.frexp.f64.i32(double %f)

to `{ %f, 0 }`, because the fraction after the first frexp call is known
0.  It did this by reusing the inner frexp's result struct and
overwriting field 1 with zero.

But you can see in this example that reusing the inner frexp's
result struct is invalid, because that call returns { double, i64 },
whereas the second call returns { double, i32 }.

Fix this by building the new struct instead of modifying the old one.
DeltaFile
+11-11llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+18-0llvm/test/Transforms/InstCombine/frexp.ll
+29-112 files

LLVM/project c06483cllvm/lib/Target/ARM/MCTargetDesc ARMAsmBackend.cpp, llvm/test/MC/ARM bf-invalid-target.s

[ARM] Reject invalid BF encoding when target is next instruction (#201533)

When the BF instruction targets the immediately following label, the
encoded branch offset becomes zero, causing LLVM to emit invalid machine
code.

Add validation in the fixup_bf_branch path to reject this case and emit
an error instead.

Add MC regression test to cover new validation.

Assisted by ChatGPT. Human-verified, debugged, tested and validating by
author.
DeltaFile
+14-0llvm/test/MC/ARM/bf-invalid-target.s
+1-1llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+15-12 files

LLVM/project a8cb825flang/include/flang/Lower OpenACC.h, flang/include/flang/Semantics symbol.h

[flang][acc] Fix separate compilation for module !$acc declare create on allocatables. (#202409)

With separate compilation, a module defining `!$acc declare create` on
an allocatable and a using file that allocates it did not get
declare-action lowering in the using Translation Unit(TU):
`ACCDeclareActionConversion` could not resolve the post-alloc recipe
(defined only in the module .o), so no `fir.call` was emitted.

Add `acc.declare_action` for allocatable/pointer symbols under !$acc
declare.
* In the defining TU: Export module-global post-alloc/post-dealloc
recipes as linkable definitions and mark them with acc.declare_action at
creation.
* In the using TU: When declaring a USE-associated module global, emit
private external recipe stubs so the declare-action conversion pass can
insert fir.calls that link to the module definition.
DeltaFile
+43-8flang/lib/Lower/OpenACC.cpp
+37-0flang/test/Lower/OpenACC/acc-declare-use-associated-allocatable.f90
+2-2flang/test/Lower/OpenACC/acc-declare.f90
+3-1flang/include/flang/Semantics/symbol.h
+3-0flang/lib/Lower/ConvertVariable.cpp
+3-0flang/include/flang/Lower/OpenACC.h
+91-111 files not shown
+93-117 files

LLVM/project 046b7e9mlir/test/Integration/Dialect/XeGPU/WG simple_mxfp_gemm.mlir

[MLIR][XeGPU] Update Wg dpas_mx integration test. (#201680)

Make problem size smaller and add K loop.
Add host code to call gpu kernel.
Add test input and reference output.
Add comparison code to check output against reference output.
DeltaFile
+185-52mlir/test/Integration/Dialect/XeGPU/WG/simple_mxfp_gemm.mlir
+185-521 files

LLVM/project 790d7f6mlir/include/mlir/Dialect/OpenACC OpenACCCGOps.td, mlir/test/Dialect/OpenACC ops-cg.mlir invalid-cg.mlir

[mlir][acc] Format consistency for reduction accumulate (#202414)

Avoid use of parentheses so that format for
`acc.reduction_accumulate` is consistent with rest of acc reduction
operations.
DeltaFile
+9-9mlir/test/Dialect/OpenACC/ops-cg.mlir
+6-6mlir/test/Dialect/OpenACC/invalid-cg.mlir
+3-3mlir/include/mlir/Dialect/OpenACC/OpenACCCGOps.td
+18-183 files

LLVM/project 7556cf1mlir/lib/Conversion/XeGPUToXeVM XeGPUToXeVM.cpp, mlir/test/Conversion/XeGPUToXeVM loadstore_nd_transpose.mlir

[MLIR][XeGPU] Support transposed load_nd of sub-32-bit elements (#201636)

The 2D block load transpose feature is only available for 32-bit
elements. When a transposed load_nd is requested for a sub-32-bit
element type, the XeGPU-to-XeVM lowering now emulates it by
reinterpreting the tile as 32-bit elements: the element size is promoted
to 32 bits, the tile width is scaled down by (32 / elemBitSize), and the
column offset (offsetW) is right-shifted by log2(32 / elemBitSize) to
account for the wider element.

Add a conversion test (loadstore_nd_transpose.mlir) covering the f16
transposed load path.
DeltaFile
+46-0mlir/test/Conversion/XeGPUToXeVM/loadstore_nd_transpose.mlir
+12-0mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp
+58-02 files

LLVM/project cd87705llvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPlan.h, llvm/test/Transforms/LoopVectorize as_cast.ll

Revert "[VPlan] Use VPInstructionWithType for uniform casts. (#140623)"

This reverts commit 0672a177f71eb7e556c6c434425916e9b430fdac.
DeltaFile
+13-16llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+6-14llvm/lib/Transforms/Vectorize/VPlan.h
+5-13llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+9-8llvm/test/Transforms/LoopVectorize/as_cast.ll
+0-17llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+6-6llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+39-748 files not shown
+53-9814 files

LLVM/project 6c6338bclang/tools/clang-sycl-linker ClangSYCLLinker.cpp, llvm/lib/Frontend/Offloading ArchiveLinker.cpp

[Frontend][Offloading] Restore silent ignore for non-existing input files in nvlink (#202352) (#202403)

Partially revert commit
https://github.com/llvm/llvm-project/commit/a0ccab35110951afc9adc5d7dc733ba8c58cf3f9
to restore
the original behavior of silently skipping non-existent positional input
files
in resolveArchiveMembers(), while preserving strict validation in
clang-sycl-linker.

Background:
The original commit added error reporting for non-existent input files
in the
shared resolveArchiveMembers() function to catch genuine user errors.
However,
this broke clang-nvlink-wrapper when unrecognized options were misparsed
as
input files (e.g., "relro" from "-z relro" before the -z option was
properly

    [19 lines not shown]
DeltaFile
+10-0clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp
+2-4llvm/lib/Frontend/Offloading/ArchiveLinker.cpp
+12-42 files

LLVM/project d15d95d.github/workflows libc-shared-tests.yml

[libc] Add gcc-12-arm-linux-gnueabihf to libc-shared-tests CI. (#202421)

To prevent regression for arm-linux-gnueabihf target. See
https://github.com/llvm/llvm-project/issues/201678
DeltaFile
+7-9.github/workflows/libc-shared-tests.yml
+7-91 files

LLVM/project 3ca5b7dcompiler-rt/lib/interception interception_win.cpp

[ASan] add pattern 'cmp BYTE PTR [rdx], XX' to win instruction decoder (#202407)

**Context:** The ASan instruction decoder in `interception_win.cpp` has
a manual case-based list for each instruction pattern we expect to see
in function prologues.

Today, we have an instruction decoder for `cmp BYTE PTR [rcx], XX`, but
we do not have the equivalent for `cmp BYTE PTR [rdx], XX`. In recent
builds of Windows, that latter is now seen in `ucrtbase!strstr`.

**This PR** adds the missing case.
DeltaFile
+1-0compiler-rt/lib/interception/interception_win.cpp
+1-01 files

LLVM/project 1552e58clang/include/clang/ScalableStaticAnalysisFramework/Core/Model EntityLinkage.h, clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary TUSummaryExtractor.cpp

address comments
DeltaFile
+4-8clang/test/Analysis/Scalable/PointerFlow/external-inline-function-in-multi-tu.test
+1-2clang/include/clang/ScalableStaticAnalysisFramework/Core/Model/EntityLinkage.h
+1-1clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary/TUSummaryExtractor.cpp
+6-113 files

LLVM/project fffc591lldb/source/Plugins/SymbolFile/NativePDB PdbAstBuilderClang.cpp, lldb/test/Shell/SymbolFile/NativePDB invalid-type-refs.yaml

[lldb][NativePDB] Handle invalid type references gracefully (#202371)

Incrementally linked PDBs can contain semantically incorrect references
to types from the symbol streams and the IPI stream.
I can't reproduce it reliably, but as mentioned in #200452, at some
point the references become incorrect.

We should not crash if we receive such PDBs as input. Here I noticed two
issues:

1. `CVTagRecord` requires the passed type to be a type record
(union/struct/class). We should check that this is the case with
`IsTagRecord`.
2. After casting the return of `GetOrCreateClangType`, check that it's
the expected type (not null).

I added a test for both cases.
DeltaFile
+221-0lldb/test/Shell/SymbolFile/NativePDB/invalid-type-refs.yaml
+8-1lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilderClang.cpp
+229-12 files

LLVM/project ad33f2dllvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine assume-align.ll assume.ll

[InstCombine] Drop non-power-of-two alignment assumptions (#202396)

These assumptions aren't actually used anywhere, so we might as well
drop them. We might want consider emitting an assumption that the value
is zero at some point, but we don't have the bundles for that currently
and it seems rather low priority.
DeltaFile
+2-6llvm/test/Transforms/InstCombine/assume-align.ll
+8-0llvm/test/Transforms/InstCombine/assume.ll
+4-3llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+14-93 files

LLVM/project e7e5bb5llvm/lib/Target/AArch64 AArch64MacroFusion.cpp, llvm/test/CodeGen/AArch64 misched-fusion-aes-post-ra.mir misched-fusion-aes.ll

[AArch64][MacroFusion] Fuse only tied AES pairs post-RA (#201610)

This patch adds an ad-hoc check to macro fusion to only fuse AES pairs
that are tied post-RA as a guardrail.

Currently, ISel captures every RAW dependent AESE/D+AES[I]MC pair (by
data-dependence DAG), and applies a constraint that the pair must write
to the same dest, i.e the second instruction is tied (a thing that
cannot be expressed in SSA IR). So this is effectively a NFC in that
perspective, as AES is not really being lowered through other paths.
Here we add an appropriate check to macro fusion, if registers are
physical, to avoid pre-RA regression (maintaining the current status
where pre-RA fusion hides theoretical better schedules even if the pari
is not tied). Otherwise the tests in
llvm/test/CodeGen/AArch64/misched-fusion-aes.ll may not catch an ISel
change that would happen to pass, satisfying the register allocation
being filechecked.

If it appears in the future that a subtarget can fuse untied pairs, we

    [5 lines not shown]
DeltaFile
+73-0llvm/test/CodeGen/AArch64/misched-fusion-aes-post-ra.mir
+26-3llvm/lib/Target/AArch64/AArch64MacroFusion.cpp
+1-0llvm/test/CodeGen/AArch64/misched-fusion-aes.ll
+100-33 files

LLVM/project 5504751clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary TUSummaryExtractor.cpp

Update clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary/TUSummaryExtractor.cpp

Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
DeltaFile
+1-1clang/lib/ScalableStaticAnalysisFramework/Core/TUSummary/TUSummaryExtractor.cpp
+1-11 files

LLVM/project 2af629dlldb/tools/lldb-dap JSONUtils.cpp

[lldb] Fixup address in JSONUtils::ValuePointsToCode (#201951)

On platforms with metadata in pointers (i.e. arm64e), the address must
be fixed up before requesting a load address.

This fixes TestDAP_evaluate.py for arm64e.
DeltaFile
+1-0lldb/tools/lldb-dap/JSONUtils.cpp
+1-01 files

LLVM/project 68f38dbllvm/test/TableGen switch.td

[TableGen] Add list value test for switch(NFC) (#202327)
DeltaFile
+4-0llvm/test/TableGen/switch.td
+4-01 files

LLVM/project 50088e2.github/workflows release-doxygen.yml, bolt/docs CMakeLists.txt

Revert "[docs] update CI to use latest release of doxygen" (#202412)

Reverts llvm/llvm-project#191501 as cmake CI is having an issue with it:

```
-- Doxygen enabled (1.14.0).
CMake Error at /work/as-worker-4/publish-doxygen-docs/llvm-project/cmake/Modules/HandleDoxygen.cmake:29 (add_custom_target):
  add_custom_target cannot create target "doxygen" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory
  "/work/as-worker-4/publish-doxygen-docs/llvm-project/llvm".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  docs/CMakeLists.txt:59 (include)
```
DeltaFile
+1-17cmake/Modules/HandleDoxygen.cmake
+1-6.github/workflows/release-doxygen.yml
+2-2mlir/docs/CMakeLists.txt
+2-2clang/docs/CMakeLists.txt
+2-2openmp/docs/CMakeLists.txt
+2-2bolt/docs/CMakeLists.txt
+10-3114 files not shown
+20-5920 files

LLVM/project 5d2cc4dlibc/src/__support/math cos.h sin.h

[libc][math] Improve the performance of sin/cos for small inputs |x| < 2^-4. (#201748)

- Use a degree-9 polynomial for fast path for sin(x), generated by Sollya,
with errors bounded by `|x| * 2^-68 + 2* ulp(x^3 / 6)`.
- Use a degree-8 polynomial for fast path for cos(x), generated by Sollya,
with errors bounded by `2^-69 + ulp(x^2/ 2 )`.
DeltaFile
+82-37libc/src/__support/math/cos.h
+82-36libc/src/__support/math/sin.h
+164-732 files

LLVM/project 68ce9d3llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Transforms/LoopVectorize/AArch64 partial-reduce-dot-product-mixed.ll

[AArch64][TTI] Allow mixed-extension partial reductions with +dotprod  (#199762)

With the backend now lowering SUMLA via two udot products on targets
that have +dotprod (#199761), lower the cost on targets without +i8mm.


PR: https://github.com/llvm/llvm-project/pull/199762
DeltaFile
+36-36llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product-mixed.ll
+9-1llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+45-372 files

LLVM/project a360574flang/lib/Lower/OpenMP Utils.cpp ClauseProcessor.cpp, flang/lib/Optimizer/OpenMP MapInfoFinalization.cpp

[Flang][OpenMP] Support iterator modifiers in map and motion clauses

Support iterated array elements and array sections in map and motion clauses for
target data, target enter data, target exit data, and target update constructs.

Preserve mapper resolution for iterated entries, including explicit mappers,
user-defined default mappers, declare mapper entries, and implicit default
mappers.

This PR stacked on top of #197047 and #197752.

This patch is part of the feature work for #188061.

Assisted with copilot.
DeltaFile
+507-0flang/test/Lower/OpenMP/motion-iterator.f90
+183-0flang/lib/Lower/OpenMP/Utils.cpp
+96-12flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+25-0flang/test/Lower/OpenMP/declare-mapper-iterator.f90
+15-0flang/lib/Optimizer/OpenMP/MapInfoFinalization.cpp
+12-0flang/lib/Lower/OpenMP/Utils.h
+838-123 files not shown
+838-399 files