LLVM/project e3db5e0clang/lib/Sema SemaLoongArch.cpp, clang/test/Sema builtin-loongarch-check-target-feature.cpp

[clang][LoongArch] Check target features in CheckLoongArchBuiltinFunctionCall (#191811)

Add target features check in `CheckLoongArchBuiltinFunctionCall`, thus
we could through an error
when pass the `-mno-lsx` to clang while using the builtin LSX intrinsics
for global variables instead of
trigger an ICE.

Minimal Example:
```
// clang-20 --march=loongarch64 -mno-lsx -S -o - "x.cc"
__attribute__((__vector_size__(16))) long foo = __builtin_lsx_vinsgr2vr_w(foo, 0, 0);
```
and the compiler will output
```
x.cc:1:49: error: builtin needs target feature lsx
    1 | __attribute__((__vector_size__(16))) long foo = __builtin_lsx_vinsgr2vr_w(foo, 0, 0);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

    [2 lines not shown]
DeltaFile
+16-0clang/lib/Sema/SemaLoongArch.cpp
+5-0clang/test/Sema/builtin-loongarch-check-target-feature.cpp
+21-02 files

LLVM/project 36f8b96llvm/lib/Passes PassBuilderPipelines.cpp, llvm/test/Other new-pm-defaults.ll new-pm-thinlto-postlink-pgo-defaults.ll

Reapply "[JTS][Passes] Enable JTS By Default" (#192884)

Reverts llvm/llvm-project#192737

Reapplies https://github.com/llvm/llvm-project/pull/190674

The one remaining issue should have been fixed by
https://github.com/llvm/llvm-project/pull/192877.
DeltaFile
+1-5llvm/test/Other/new-pm-defaults.ll
+2-2llvm/lib/Passes/PassBuilderPipelines.cpp
+1-0llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
+7-72 files not shown
+9-78 files

LLVM/project d8e9862clang/lib/Driver/ToolChains Gnu.cpp, clang/test/Driver linux-ld-args.c

[Driver] Gnu: Move -s/-t/-u emission to match GCC order (#192883)

GCC places -s, -t, and -u sym in one contiguous group just before
Scrt1.o / crt1.o, with -L paths after the CRT files.

Match that ordering by dropping the early `push_back("-s")` and rolling
-s, -t, and -u into one addAllArgs call placed immediately after -o
output. This keeps -Wl,... after -s/-t/-u so that user overrides like
-Wl,--strip-debug still take precedence. Update linux-ld-args.c to

-T remains at the end so earlier -L paths take precedence.
DeltaFile
+12-8clang/test/Driver/linux-ld-args.c
+7-5clang/lib/Driver/ToolChains/Gnu.cpp
+19-132 files

LLVM/project cbd802bmlir/lib/Dialect/Vector/Transforms VectorDistribute.cpp, mlir/test/Dialect/Vector warp-distribute-scf-for-block-args.mlir

[MLIR][Vector] Fix `scf.for` block-argument yields in warp distribution (#192247)

Teach WarpOpScfForOp to remap yielded `scf.for` body block arguments
through `argMapping` before creating the replacement `gpu.yield`.

Handle yielded loop-carried values and other `scf.for` body block
arguments when moving the loop body into the new inner warp op, instead
of reusing the pre-merge values.

Add a regression test for yielding a loop-carried block argument during
warp distribution.

Fix #186573
DeltaFile
+22-0mlir/test/Dialect/Vector/warp-distribute-scf-for-block-args.mlir
+7-1mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
+29-12 files

LLVM/project 638c566llvm/lib/Passes PassBuilderPipelines.cpp, llvm/test/Other new-pm-defaults.ll new-pm-thinlto-postlink-defaults.ll

Revert "Revert "[JTS][Passes] Enable JTS By Default" (#192737)"

This reverts commit 184edc1b7d2816c1e43eb2d740ff3e7831e97eb6.
DeltaFile
+1-5llvm/test/Other/new-pm-defaults.ll
+2-2llvm/lib/Passes/PassBuilderPipelines.cpp
+1-0llvm/test/Other/new-pm-thinlto-postlink-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-prelink-defaults.ll
+7-72 files not shown
+9-78 files

LLVM/project 9542cfallvm/lib/Transforms/Scalar JumpTableToSwitch.cpp, llvm/test/Transforms/JumpTableToSwitch profile-no-guid-metadata.ll

[JumpTableToSwitch] Fix wrong function used for GUID computation (#192877)

The FuncToGuid lambda's fallback path (when target functions lack !guid
metadata) was using 'F' (the caller) instead of 'Fct' (the callee) in
getIRPGOFuncName, causing all GUID lookups to resolve to the caller's
GUID.
DeltaFile
+61-0llvm/test/Transforms/JumpTableToSwitch/profile-no-guid-metadata.ll
+3-2llvm/lib/Transforms/Scalar/JumpTableToSwitch.cpp
+64-22 files

LLVM/project 837f7e9.github/workflows commit-access-review.yml issue-write.yml, .github/workflows/unprivileged-download-artifact action.yml

Update [Github] Update GHA Dependencies (major) (#192881)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[actions/create-github-app-token](https://redirect.github.com/actions/create-github-app-token)
| action | major | `v2.2.1` → `v3.1.1` |
|
[actions/github-script](https://redirect.github.com/actions/github-script)
| action | major | `v8.0.0` → `v9.0.0` |
DeltaFile
+1-1.github/workflows/commit-access-review.yml
+1-1.github/workflows/issue-write.yml
+1-1.github/workflows/llvm-bugs.yml
+1-1.github/workflows/release-asset-audit.yml
+1-1.github/workflows/unprivileged-download-artifact/action.yml
+5-55 files

LLVM/project 257706fllvm/tools/llvm-profgen PerfReader.cpp ProfiledBinary.cpp

[llvm-profgen] Add branch/target validation (#188620)

Add extra branch source and target validation checks for LBR samples.
This is to check whether there are branch source samples that do not
match a call/branch/ret instruction in the binary, and branch target
samples that do not match a resolved Imm target address, or a function
start address (in case of an indirect call).

Example output:
```
# X86
warning: 0.01%(27/376876) of sampled target addresses do not match the binary.
# AArch64
warning: 0.01%(63782/795824826) of branch samples do not match the binary.
warning: 0.01%(70468/795824826) of branch targets do not match the binary.
```
Run time overhead:
```
Before:

    [8 lines not shown]
DeltaFile
+43-0llvm/tools/llvm-profgen/PerfReader.cpp
+13-0llvm/tools/llvm-profgen/ProfiledBinary.cpp
+10-0llvm/tools/llvm-profgen/ProfiledBinary.h
+2-0llvm/tools/llvm-profgen/PerfReader.h
+68-04 files

LLVM/project 1b2ccf9llvm/lib/Target/AMDGPU SIInstrInfo.cpp SIInstrInfo.h, llvm/test/CodeGen/AMDGPU tail-call-inreg-arguments.waterfall.ll call-args-inreg-no-sgpr-for-csrspill.ll

[AMDGPU] Generate waterfall for calls with SGPR(inreg) argument (#146997)

Fixing issue https://github.com/llvm/llvm-project/issues/140780

Generate waterfall loop for call using SGPR(inreg) argument but result
from divergent source (e.g. VGPR).
DeltaFile
+446-0llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.waterfall.ll
+164-61llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+59-50llvm/test/CodeGen/AMDGPU/call-args-inreg-no-sgpr-for-csrspill.ll
+0-78llvm/test/CodeGen/AMDGPU/tail-call-inreg-arguments.error.ll
+27-2llvm/lib/Target/AMDGPU/SIInstrInfo.h
+11-5llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
+707-1966 files

LLVM/project 89f1856clang-tools-extra/test/clang-tidy/checkers/readability redundant-typename.cpp

[clang-tidy][NFC] Add test case confirming #190944 is fixed (#192707)

Closes #190944.

This issue is already fixed, and this change just adds a test case to
confirm that.
DeltaFile
+12-0clang-tools-extra/test/clang-tidy/checkers/readability/redundant-typename.cpp
+12-01 files

LLVM/project cea56f6llvm/test/Transforms/LoopVectorize predicated-inductions.ll

[LV] Add additional test cases with predicated inductions. (NFC) (#192875)

Extend test coverage with predicated IVs both with and without
additional predicates from LoopAccessInfo.
DeltaFile
+719-0llvm/test/Transforms/LoopVectorize/predicated-inductions.ll
+719-01 files

LLVM/project e08ec62llvm/lib/CodeGen SelectOptimize.cpp

[SelectOptimize] Emit Fatal Error instead of Asserting on null PSI (#192871)

SelectOptimize expects to have PSI available which will normally be
available if the pipeline is set up correctly to require
ProfileSummaryInfo at the beginning. However, we do not want to assert
if someone sets up the pipeline incorrectly, instead reporting a fatal
usage error.

Fixes #192759.
DeltaFile
+3-1llvm/lib/CodeGen/SelectOptimize.cpp
+3-11 files

LLVM/project cac7fe5llvm/lib/Transforms/Vectorize VPlan.h VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/VPlan vplan-printing-reductions.ll

[VPlan] Make canonical IV part of the region (#156262)

The canonical IV is directly tied to a loop region. To directly ensure
there's a single, unique canonical IV, directly define it by the region.

Depends on https://github.com/llvm/llvm-project/pull/161589.

PR: https://github.com/llvm/llvm-project/pull/156262
DeltaFile
+81-101llvm/lib/Transforms/Vectorize/VPlan.h
+50-62llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+70-20llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+67-15llvm/lib/Transforms/Vectorize/VPlan.cpp
+28-32llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
+38-19llvm/test/Transforms/LoopVectorize/VPlan/vplan-printing-reductions.ll
+334-24953 files not shown
+786-54059 files

LLVM/project abc37e6llvm/utils/gn/secondary/clang/lib/Headers BUILD.gn

[gn build] Port 4b0dd87d3a29 (#192869)
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+1-01 files

LLVM/project 4bd6175llvm/lib/Target/AArch64 AArch64SMEAttributes.h, llvm/unittests/Target/AArch64 SMEAttributesTest.cpp

[AArch64][SME] Remove a couple of unused functions (NFC) (#192649)

Follow up to https://github.com/llvm/llvm-project/pull/190950
DeltaFile
+9-14llvm/unittests/Target/AArch64/SMEAttributesTest.cpp
+0-9llvm/lib/Target/AArch64/AArch64SMEAttributes.h
+9-232 files

LLVM/project e7cdce4llvm/lib/Bitcode/Reader BitcodeReader.cpp

[BitcodeReader] Simplify CST_CODE_DATA constant parsing (NFC) (#190846)

Cleanup boilerplate in the CST_CODE_DATA case for bitcode parser. This
is generally an aesthetic improvement and can significantly reduce stack
usage on some compilers (such as MSVC) where each SmallVector previously
was allocated it's own individual space.
DeltaFile
+16-78llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+16-781 files

LLVM/project c12a3bbclang/test/Driver linux-ld-args.c linux-ld.c

[test] Improve driver option coverage (#192861)

Split the Linux GNU-linker assertions into a dedicated file and extend
them with previously-untested passthrough flags handled by
gnutools::Linker::ConstructJob: -s, -u sym, -rdynamic (-export-dynamic),
-Wl,-z keyword pairs.

LoongArch on Linux previously had no test for -X / --no-relax, which are
emitted by Gnu.cpp for LoongArch and RISC-V.
DeltaFile
+25-0clang/test/Driver/linux-ld-args.c
+7-7clang/test/Driver/linux-ld.c
+9-0clang/test/Driver/loongarch-toolchain.c
+7-0clang/test/Driver/freebsd.c
+1-6clang/test/Driver/Xlinker-args.c
+49-135 files

LLVM/project d34661bllvm/lib/Analysis LoopPass.cpp

[LPM][LegacyPM] Reenable LCSSA Verification

This was disabled about a decade ago due to issues with LoopSink.
LoopSink has since had its LegacyPM version removed and is now a
function pass due to not needing too much loop infrastructure. So we can
try enabling this again to prevent backsliding on important cases while
we work on switching to the NewPM which does enforce these things.

Eventually we will want to add assertions here for LoopStrengthReduce,
but given it does not correctly preserve LCSSA, postpone that for now.

Reviewers: arsenm, Meinersbur, nikic, fhahn

Pull Request: https://github.com/llvm/llvm-project/pull/191667
DeltaFile
+2-4llvm/lib/Analysis/LoopPass.cpp
+2-41 files

LLVM/project d1a0d04clang/lib/CIR/CodeGen CIRGenBuiltin.cpp, clang/test/CIR/CodeGenBuiltins builtin-bit-clz-ctz-target.cpp

[CIR] Fix __builtin_clz/__builtin_ctz poison_zero to respect target

CIR was hardcoding poisonZero=true for all clz/ctz builtins, ignoring
the target's isCLZForZeroUndef(). This caused incorrect UB on targets
like AArch64 where clz/ctz of zero is well-defined.

Also add support for __builtin_c[lt]zg fallback (2-arg) variants with
compare+select, and add NYI stubs for elementwise variants.
DeltaFile
+104-0clang/test/CIR/CodeGenBuiltins/builtin-bit-clz-ctz-target.cpp
+45-19clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
+149-192 files

LLVM/project 9086be2llvm/test/CodeGen/AMDGPU/NextUseAnalysis spill-vreg-many-lanes.mir acyclic-770bb.mir

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+275,101-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/spill-vreg-many-lanes.mir
+144,679-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/acyclic-770bb.mir
+57,682-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/double-nested-loops-complex-cfg.mir
+41,844-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills2.mir
+40,613-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills1.mir
+37,209-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills3.mir
+597,128-01,715 files not shown
+875,193-22,8011,721 files

LLVM/project 5492150llvm/lib/Analysis ConstantFolding.cpp, llvm/lib/IR ConstantFold.cpp

[ConstantFold] Support byte values in `bitcast` constant folding (#188030)

Add support for constant folding `bitcast` instructions including
`ConstantByte` values. This patch handles bitcasts between byte types
and integer, FP, and other byte types in both directions.

`poison` source bytes are preserved, rather than letting the generic
integer fold refine them to `undef` or zero. This is because some
threading optimizations just compare the result of constant folding
(e.g., https://github.com/llvm/llvm-project/pull/114280).

Folds are skipped for byte `bitcast`s where element counts don't divide
evenly and the source contains `poison` values. Some of these casts can
be folded. However, this is left for a future PR.
DeltaFile
+347-0llvm/test/Transforms/InstSimplify/bitcast-vector-fold.ll
+122-7llvm/lib/Analysis/ConstantFolding.cpp
+44-12llvm/lib/IR/ConstantFold.cpp
+513-193 files

LLVM/project e93f7e5llvm/include/llvm/Support GenericLoopInfoImpl.h

[NFC][Loop] Remove unused verbose loop debug output

This has been defined out using the preprocessor for ~14 years. Given it
doesn't look like it has gotten any use since then, just remove it to
clean the code up a bit.

Reviewers: nikic

Pull Request: https://github.com/llvm/llvm-project/pull/192830
DeltaFile
+0-6llvm/include/llvm/Support/GenericLoopInfoImpl.h
+0-61 files

LLVM/project f5e2b8blldb/packages/Python/lldbsuite/test dotest_args.py, lldb/packages/Python/lldbsuite/test/builders darwin.py builder.py

[lldb] Rally around triple rather than arch in the API tests (#192818)

This PR removes as much uses of arch as possible, in favor of using
triple directly. Most of the changes are in the builder, which no longer
passes ARCH to Make, and of course in Makefile.rules.

This significantly simplifies the remote Darwin test suite, as it
previously had to try and piece together the triple from the platform
and the arch. As an added benefit, we now go through the same code path
for host and remote test runs.

I have tested this on Darwin and Linux and made the changes with the
remote test suites in mind, but it's possible I missed something not
caught by my local testing.
DeltaFile
+33-81lldb/packages/Python/lldbsuite/test/builders/darwin.py
+24-86lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+11-15lldb/packages/Python/lldbsuite/test/builders/builder.py
+6-16lldb/packages/Python/lldbsuite/test/dotest_args.py
+12-5lldb/test/API/commands/expression/ptrauth-objc/TestPtrAuthObjectiveC.py
+11-4lldb/test/API/commands/expression/ptrauth/TestPtrAuthExpressions.py
+97-20715 files not shown
+146-23621 files

LLVM/project 9e5a9a6llvm/test/CodeGen/AMDGPU/NextUseAnalysis spill-vreg-many-lanes.mir acyclic-770bb.mir

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+275,101-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/spill-vreg-many-lanes.mir
+144,679-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/acyclic-770bb.mir
+57,682-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/double-nested-loops-complex-cfg.mir
+41,844-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills2.mir
+40,613-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills1.mir
+37,209-0llvm/test/CodeGen/AMDGPU/NextUseAnalysis/test_ers_multiple_spills3.mir
+597,128-01,696 files not shown
+875,056-22,6901,702 files

LLVM/project b6a4fdbllvm/test/Transforms/LoopStrengthReduce pr25541.ll, llvm/test/Transforms/LoopStrengthReduce/X86 bin_power.ll 2011-12-04-loserreg.ll

[LSR] Autogenerate some tests

pr25541.ll - Was a regression test for a crash. Make a note and
autogenerate the tests.
bin_power.ll - Was essentially doing what UTC would do already, minus
one test where the assembly output is somewhat large, but the large
assembly output shouldn't be an issue with an autoupdate script and
isn't big enough to justify not including in my opinion.

This makes updating some tests easier for planned changes to LCSSA
preservation.

Reviewers: fhahn, nikic

Pull Request: https://github.com/llvm/llvm-project/pull/191664
DeltaFile
+251-94llvm/test/Transforms/LoopStrengthReduce/X86/bin_power.ll
+81-5llvm/test/Transforms/LoopStrengthReduce/X86/2011-12-04-loserreg.ll
+32-6llvm/test/Transforms/LoopStrengthReduce/pr25541.ll
+364-1053 files

LLVM/project e427518llvm/lib/CodeGen MachineBlockHashInfo.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+27-10llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+27-101 files

LLVM/project 3d909fbllvm/lib/CodeGen MachineBlockHashInfo.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+24-10llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+24-101 files

LLVM/project 342fb34llvm/lib/CodeGen MachineBlockHashInfo.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+24-10llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+24-101 files

LLVM/project f5358f8llvm/lib/CodeGen MachineBlockHashInfo.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+20-5llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+20-51 files

LLVM/project b0a029fllvm/lib/CodeGen MachineBlockHashInfo.cpp

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+4-2llvm/lib/CodeGen/MachineBlockHashInfo.cpp
+4-21 files