LLVM/project 08932ddclang-tools-extra/clang-tidy/modernize UseStdBitCheck.cpp UseStdBitCheck.h, clang-tools-extra/docs/clang-tidy/checks/modernize use-std-bit.rst

[clang-tidy] Detect std::rot[lr] pattern within modernize.use-std-bit (#186324)

Basically turning `x << N | x >> (64 - N)` into `std::rotl(x, N)`.
DeltaFile
+108-1clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-bit.cpp
+71-2clang-tools-extra/clang-tidy/modernize/UseStdBitCheck.cpp
+27-0clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-bit.rst
+1-0clang-tools-extra/clang-tidy/modernize/UseStdBitCheck.h
+207-34 files

LLVM/project 4d33826flang/lib/Optimizer/Transforms LoopInvariantCodeMotion.cpp, flang/test/Transforms/CUF cuf-kernel-licm.fir

[flang] Fixed issues in nested LICM. (#192117)

First change is to check the hoisting safety for all nested
operations of the candidate. This prevents hoistings of
region operations as in the added test.

When hoisting operations from nested regions we have to
check every parent region for `canMoveOutOf`, otherwise,
illegal hoisting may happen. This second change is NFC,
because all operations that support `OperationMoveOpInterface`
currently also support `LoopLikeOpInterface` and their regions
are not considered for nested hoisting. Anyway, it is worth
fixing it.
DeltaFile
+36-1flang/lib/Optimizer/Transforms/LoopInvariantCodeMotion.cpp
+34-0flang/test/Transforms/CUF/cuf-kernel-licm.fir
+70-12 files

LLVM/project 1733c13llvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize/VPlan vplan-print-after-all.ll

[NFC][VPlan] Split `makeMemOpWideningDecisions` into subpasses

The idea is to have handling of strided memory operations (either from
https://github.com/llvm/llvm-project/pull/147297 or for VPlan-based
multiversioning for unit-strided accesses) done after some mandatory
processing has been performed (e.g., some types **must** be scalarized)
but before legacy CM's decision to widen (gather/scatter) or scalarize
has been committed.

And in longer term, we can uplift all other memory widening decision to
be done here directly at VPlan level. I expect this structure would also
be beneficial for that.
DeltaFile
+72-30llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+0-10llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+10-0llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+3-0llvm/test/Transforms/LoopVectorize/VPlan/vplan-print-after-all.ll
+85-404 files

LLVM/project 214f2declang/docs ReleaseNotes.rst, clang/lib/Sema SemaTemplateDeductionGuide.cpp

[clang] Fix assertion crash in CTAD for alias templates with non-dependent type (#191885)

When building deduction guides, clang assumes that the return type of
the deduction guide would always be a dependent type
(`TemplateSpecializationType`), but this is not true for invalid case,
where the alias RHS is a non-dependent class template specialization, it
is represented as a `RecordType` instead.

Fixes #190517.
DeltaFile
+13-2clang/lib/Sema/SemaTemplateDeductionGuide.cpp
+10-0clang/test/SemaCXX/cxx20-ctad-type-alias.cpp
+1-0clang/docs/ReleaseNotes.rst
+24-23 files

LLVM/project 152592bflang/lib/Semantics definable.cpp, flang/test/Semantics cuf26.cuf

[flang][cuda] Allow host variables to be defined in device subprograms under -gpu=unified (#192118)

When `-gpu=unified` (or `-gpu=mem:unified`) is enabled, host variables
should be definable in device subprograms because HMM/ATS makes all host
memory accessible from the GPU.

The definability check in `WhyNotDefinableBase` was unconditionally
rejecting host variables in device contexts. This fix skips that check
when `CudaUnified` is enabled.
DeltaFile
+15-0flang/test/Semantics/cuf26.cuf
+3-1flang/lib/Semantics/definable.cpp
+18-12 files

LLVM/project 6cf19c6clang/cmake/caches Fuchsia.cmake Fuchsia-stage2-instrumented.cmake

[clang][cmake] Add check-clang-extra to bootstrap targets for Fuchsia (#192104)

Not having these prevents us from testing the clang-tool-extra targets
in our CI and multi stage builds.
DeltaFile
+2-0clang/cmake/caches/Fuchsia.cmake
+1-0clang/cmake/caches/Fuchsia-stage2-instrumented.cmake
+3-02 files

LLVM/project 1a81469clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

address comment
DeltaFile
+1-2clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+1-21 files

LLVM/project 13d67bfclang/test/CodeGen amdgpu-builtin-processor-is.c amdgpu-builtin-is-invocable.c, clang/test/CodeGenCXX dynamic-cast-address-space.cpp

[NFC][SPIRV] Re-factor feature map initialisation for AMDGCN flavoured SPIR-V (#192067)

AMDGCN flavoured SPIR-V must support the union of all AMDGCN features,
as we cannot early adjudicate on this or that feature's availability. We
were hand filling in the feature map, which was error prone and led to
constant grind as new features were added. This patch moves to a
programmatic approach where we iterate through all AMDGCN GPUs and
collect features, thus establishing the union. With this change AMDGCN
flavoured SPIR-V will automatically pick up new features as they come
along.
DeltaFile
+11-63llvm/lib/TargetParser/TargetParser.cpp
+2-2clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
+1-1clang/test/CodeGen/amdgpu-builtin-processor-is.c
+1-1clang/test/CodeGen/amdgpu-builtin-is-invocable.c
+15-674 files

LLVM/project a3d643dflang/lib/Optimizer/CodeGen CodeGen.cpp, flang/test/Fir/CUDA cuda-code-gen.mlir

[flang][cuda] Fix invalid address space in addressof op conversion (#192111)

The change in lowering order introduced in
https://github.com/llvm/llvm-project/pull/183268 exposed an issue when
converting addressof op pointing to globals with different address
space. Look at the fir::GlobalOp when it has not been converted.
DeltaFile
+32-0flang/test/Fir/CUDA/cuda-code-gen.mlir
+19-3flang/lib/Optimizer/CodeGen/CodeGen.cpp
+51-32 files

LLVM/project f62b138clang/include/clang/CIR/Dialect/IR CIRTypes.td, clang/lib/CIR/CodeGen CIRGenTypes.cpp

[CIR] Raise IntType max bitwidth to match LLVM IR (#191499)

Follow-up to #188113 per @erichkeane's feedback about the 128-bit cap.

CIR's IntType was hard-limited to 128 bits, which meant any _BitInt
wider than that hit an errorNYI. LLVM IR goes up to 2^23 (about 8
million bits), and there are real tests/users at those sizes. This
raises CIR's limit to match and drops the guard that was working around
it.

Tests: added a _BitInt(256) global to bitint.c and a 1024-bit round-trip
to bitint.cir.

Made with [Cursor](https://cursor.com)
DeltaFile
+23-0clang/test/CIR/CodeGen/bitint.c
+6-8clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+3-2clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+3-2clang/test/CIR/IR/bitint.cir
+35-124 files

LLVM/project a36e9d1clang/include/clang/CIR/Dialect/IR CIROps.td CIRDialect.td, clang/lib/CIR/CodeGen CIRGenVTables.cpp

[CIR] Add musttail thunks and covariant return null-check (#191255)

Implement variadic thunk emission via musttail and null-check
pointer returns in covariant thunk adjustment, matching classic
codegen behavior.

Adds musttail UnitAttr to cir.call/cir.try_call with lowering
to LLVM::MustTail.

Made with [Cursor](https://cursor.com)
DeltaFile
+54-14clang/lib/CIR/CodeGen/CIRGenVTables.cpp
+63-0clang/test/CIR/CodeGen/thunks.cpp
+8-0clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+4-1clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+1-0clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-0clang/include/clang/CIR/Dialect/IR/CIRDialect.td
+131-156 files

LLVM/project 9c94881clang/test/Driver serenity.cpp

[clang] Attempt to unbreak clang/test/Driver/serenity.cpp on bots more (#192113)

This snippet fails on (at least) this bot:
https://lab.llvm.org/buildbot/#/builders/10/builds/26512
DeltaFile
+0-9clang/test/Driver/serenity.cpp
+0-91 files

LLVM/project ae0c5dcclang/test/CodeGen 2006-01-23-FileScopeAsm.c asm_incbin.c

Mark tests as unsupported on z/OS (#191843)

z/OS has a platform specific requirement to not allow asm statements at
file scope. These tests generate that message rather than the expected
IR. Mark the tests as unsupported on z/OS.
DeltaFile
+1-0clang/test/CodeGen/2006-01-23-FileScopeAsm.c
+1-0clang/test/CodeGen/asm_incbin.c
+2-02 files

LLVM/project 1c46118clang/include/clang/Basic FileManager.h, clang/lib/Basic Module.cpp

Load AST files as binary on z/OS (#191840)

The ast files need to be loaded as binary on z/OS to avoid translation.
Add the `IsText=false` option to all of the relevant file open calls.
DeltaFile
+11-3clang/lib/Serialization/ASTReader.cpp
+9-4clang/lib/Serialization/ModuleManager.cpp
+3-2clang/include/clang/Basic/FileManager.h
+2-1clang/lib/Basic/Module.cpp
+25-104 files

LLVM/project 01a83d3clang/lib/Format ContinuationIndenter.cpp

[clang-format][NFC] Remove superflous checks (#191872)

Doesn't change anything, must be a leftover now handled by some other
code.
DeltaFile
+1-4clang/lib/Format/ContinuationIndenter.cpp
+1-41 files

LLVM/project 838bf51compiler-rt/lib/sanitizer_common sanitizer_linux.cpp sanitizer_netbsd.cpp

[sanitizer] Make internal_close_range available on all POSIX platforms (#191971)

Make internal_close_range available on all POSIX platforms so callers
can use it without platform-specific #if guards. Platforms without
close_range return -1, letting callers fall back gracefully.

Currently only FreeBSD has a real implementation. A TODO is left for
adding Linux support (__NR_close_range, kernel 5.9+).

The Linux support will be added in
https://github.com/llvm/llvm-project/pull/191450.
DeltaFile
+4-2compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+4-0compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
+2-2compiler-rt/lib/sanitizer_common/sanitizer_posix.h
+4-0compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+4-0compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
+4-0compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp
+22-46 files

LLVM/project 6d11ac4llvm/utils/gn/secondary/clang/lib/Driver BUILD.gn

[gn build] Port 934f795064ab (#192107)
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn
+1-01 files

LLVM/project 3f8fa45clang/test/Driver serenity.cpp

[clang] Attempt to unbreak clang/test/Driver/serenity.cpp on bots (#192105)

The c++/v1 paths aren't found on bots, so remove them for now until this
is analyzed.

Match on `-isysroot` to get SYSROOT var instead.

Also remove what looks like one unintentional SYSROOT: capture for
crt0.o.
DeltaFile
+6-7clang/test/Driver/serenity.cpp
+6-71 files

LLVM/project ce8251elldb/docs/_ext lldb_setting.py build_include.py, lldb/docs/_static lldb-setting.css

[LLDB][Docs] List available settings (#168245)

This PR adds a documentation page that lists all available settings. The
page is automatically generated.

Having the settings listed in the online documentation makes it easier
to search for users. It also has the advantage of being indexed by
search engines.

To generate the docs, we first generate JSON out of the TableGen
definitions with `-dump-json`.

Once all properties are available as JSON, a Markdown file with the
merged documentation (`settings.md`) is generated. I chose Markdown over
RST, because some descriptions already use backticks, which would become
references in RST.

Currently, enum names/descriptions are not visible, because they're
defined in C++. In the future, these could be moved to TableGen as well.
DeltaFile
+154-0lldb/scripts/gen-property-docs-from-json.py
+83-0lldb/docs/_static/lldb-setting.css
+73-0lldb/docs/_ext/lldb_setting.py
+29-23lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
+48-0lldb/docs/_ext/build_include.py
+25-19lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt
+412-4224 files not shown
+540-6330 files

LLVM/project 4326a54llvm/lib/Transforms/Scalar GVN.cpp

[GVN] Clean up `reportMayClobberedLoad` to use the dependency instruction (NFC) (#192103)

Minor opportunity to clean `reportMayClobberedLoad` routine, which was
previously receiving the entire `MemDepResult` object, though only using
the dependency instruction.

Co-authored-by: Momchil Velikov <momchil.velikov at arm.com>
DeltaFile
+3-3llvm/lib/Transforms/Scalar/GVN.cpp
+3-31 files

LLVM/project 0c18d74clang/cmake/caches Fuchsia.cmake Fuchsia-stage2-instrumented.cmake

[clang][cmake] Add check-clang-extra to bootstrap targets for Fuchsia

Not having these prevents us from testing the clang-tool-extra targets in
our CI, and multi stage builds.
DeltaFile
+2-0clang/cmake/caches/Fuchsia.cmake
+1-0clang/cmake/caches/Fuchsia-stage2-instrumented.cmake
+3-02 files

LLVM/project 11f3a56clang/include/clang/Basic HLSLIntrinsics.td

Use ascii for dashes (#191892)

Use the standard ascii character for the dashes.
DeltaFile
+4-4clang/include/clang/Basic/HLSLIntrinsics.td
+4-41 files

LLVM/project 51822a6llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Analyses BUILD.gn

[gn build] Port fc12e59d1d8b (#192101)

[gn build] Port fc12e59d1d8b
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/ScalableStaticAnalysisFramework/Analyses/BUILD.gn
+1-01 files

LLVM/project 7b4c821llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc BUILD.gn

[gn build] Port a2bf43d6b18d (#192100)

[gn build] Port a2bf43d6b18d
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+1-01 files

LLVM/project 585a4a2llvm/utils/gn/secondary/clang/unittests/CIR BUILD.gn

[gn build] Port 472aa4e326be (#192098)

[gn build] Port 472aa4e326be
DeltaFile
+1-0llvm/utils/gn/secondary/clang/unittests/CIR/BUILD.gn
+1-01 files

LLVM/project 3e94498llvm/utils/gn/secondary/llvm/lib/Target/AArch64/MCTargetDesc BUILD.gn

[gn build] Port 3fe0bdfaa592 (#192096)

[gn build] Port 3fe0bdfaa592
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Target/AArch64/MCTargetDesc/BUILD.gn
+1-01 files

LLVM/project a8f36ccllvm/lib/Target/AArch64 AArch64InstrInfo.cpp

[AArch64] Check Subtarget via STI in getInstSizeInBytes (#192089)

The InstSizes test (`llvm/unittests/Target/AArch64/InstSizes.cpp`)
destroys the Subtarget field early (`ST` created on the stack in
[`createInstrInfo`](https://github.com/llvm/llvm-project/blob/40a585e742ed6b28306d7511380079325ba1a003/llvm/unittests/Target/AArch64/InstSizes.cpp#L32)),
causing a use-after-free if it is used in `getInstSizeInBytes`. This
causes a failure when running the test with hwasan (reported by build
bot). To fix this, this PR switches to using `STI` instead of
`Subtarget` in `getInstSizeInBytes` for checking `isLFI`, which survives
for the lifetime of the test.

I think fixing the test itself (the root of the issue, as far as I can
tell) would be more involved. Perhaps I should open an issue for it
though?

I have tested the fix on an AArch64 machine with hwasan to confirm that
it resolves the issue.
DeltaFile
+2-2llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+2-21 files

LLVM/project 1bc5719llvm/test/Analysis/CostModel/AArch64 sve-fptoi_sat.ll fptoi_sat.ll

[AArch64] Add additional cost coverage for SVE fptosi.sat and fptoui.sat. NFC (#192095)
DeltaFile
+179-0llvm/test/Analysis/CostModel/AArch64/sve-fptoi_sat.ll
+0-166llvm/test/Analysis/CostModel/AArch64/fptoi_sat.ll
+179-1662 files

LLVM/project c1d6f76llvm/docs/CommandGuide lit.rst, llvm/utils/lit/lit cl_arguments.py ProgressBar.py

[lit] Add an option to lit which ratelimits progressbar output. (#186479)

Add a new option --min-output-interval, which ratelimits updates to the
progress bar.

When running Lit with the full curses progressbar, it updates both the
bar, and the status text below on every test completion. Running
check-llvm on my laptop runs about 44k tests and takes about 260 seconds
for a release build. Or about 171 tests/second on average.

Moreover, when ssh'd to another host, this generates quite a bit of
traffic. Using tcpdump, I measured the traffic for a run of check-llvm
and -clang. With all updates, its about 8.7 megabytes. With a rate limit
of 5 update/sec, this came down to 175 kilobytes. This can be
significant on slow/metered connections.

This patch adds an option to limit lit's output to once per a given
interval. This only affects the progressbar and status message below,
not any log messages above. It also does not affect anything when not

    [5 lines not shown]
DeltaFile
+26-0llvm/utils/lit/lit/cl_arguments.py
+17-1llvm/utils/lit/lit/ProgressBar.py
+5-0llvm/docs/CommandGuide/lit.rst
+3-1llvm/utils/lit/lit/display.py
+51-24 files

LLVM/project 19344adclang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvzip/policy/non-overloaded vpaire.c, clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvzip/policy/overloaded vpaire.c vpairo.c

Merge branch 'main' into users/ziqingluo/PR-172429193-pre-2
DeltaFile
+6,877-0llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-sve-instructions.s
+5,336-0llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-writeback.s
+3,167-0llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-neon-instructions.s
+2,723-0clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvzip/policy/overloaded/vpaire.c
+2,723-0clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvzip/policy/overloaded/vpairo.c
+2,723-0clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/zvzip/policy/non-overloaded/vpaire.c
+23,549-0674 files not shown
+87,632-9,781680 files