LLVM/project 711a177lldb/unittests/Core MangledTest.cpp

add explicit default initialization to DemangledNameInfo to remove warning (#141790)

https://github.com/llvm/llvm-project/pull/140762 introduces some
compilation warnings in `lldb/unittests/Core/MangledTest.cpp`. This
patch adds explicit default initialization to `DemangledNameInfo` to
suppress those warnings.

We only had the default initialization values to `PrefixRange` and
`SuffixRange` because they are the only _optional_ fields of the
structure.
DeltaFile
+22-20lldb/unittests/Core/MangledTest.cpp
+22-201 files

LLVM/project c4c7abdmlir/lib/Dialect/XeGPU/Transforms XeGPUBlocking.cpp

refactor
DeltaFile
+13-17mlir/lib/Dialect/XeGPU/Transforms/XeGPUBlocking.cpp
+13-171 files

LLVM/project 596ccd6llvm/test/TableGen directive1.td

Fix testcase
DeltaFile
+2-2llvm/test/TableGen/directive1.td
+2-21 files

LLVM/project 0d7b34bllvm/include/llvm/Transforms/Utils LoopUtils.h, llvm/lib/Transforms/Utils LoopUtils.cpp

[LoopUtils] Pass start value directly to createAnyOfReduction (NFC).

Now that there is only a single AnyOf recurrence kind, simply pass the
start value instead of the full recurrence descriptor, to tighten the
interface.
DeltaFile
+3-5llvm/include/llvm/Transforms/Utils/LoopUtils.h
+1-6llvm/lib/Transforms/Utils/LoopUtils.cpp
+2-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+6-123 files

LLVM/project 6efd24cllvm/utils/gn/secondary/llvm/lib/ProfileData BUILD.gn

[gn build] Port cc6f446d3865
DeltaFile
+2-0llvm/utils/gn/secondary/llvm/lib/ProfileData/BUILD.gn
+2-01 files

LLVM/project cc6f446llvm/include/llvm/ProfileData MemProfSummary.h MemProfSummaryBuilder.h, llvm/lib/ProfileData MemProfSummary.cpp MemProfSummaryBuilder.cpp

[MemProf] Add basic summary section support (#141805)

This patch adds support for a basic MemProf summary section, which is
built along with the indexed MemProf profile (e.g. when reading the raw
or YAML profiles), and serialized through the indexed profile just after
the header.

Currently only 6 fields are written, specifically the number of contexts
(total, cold, hot), and the max context size (cold, warm, hot).

To support forwards and backwards compatibility for added fields in the
indexed profile, the number of fields serialized first. The code is
written to support forwards compatibility (reading newer profiles with
additional summary fields), and comments indicate how to implement
backwards compatibility (reading older profiles with fewer summary
fields) as needed.

Support is added to print the summary as YAML comments when displaying
both the raw and indexed profiles via `llvm-profdata show`. Because they

    [7 lines not shown]
DeltaFile
+138-0llvm/lib/ProfileData/MemProfSummary.cpp
+77-0llvm/unittests/ProfileData/MemProfTest.cpp
+1-70llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
+70-0llvm/include/llvm/ProfileData/MemProfSummary.h
+61-0llvm/lib/ProfileData/MemProfSummaryBuilder.cpp
+51-0llvm/include/llvm/ProfileData/MemProfSummaryBuilder.h
+398-7014 files not shown
+507-15420 files

LLVM/project 02916a4lldb/include/lldb/DataFormatters TypeSummary.h, lldb/source/Commands CommandObjectType.cpp

[lldb][Formatters] Add --pointer-match-depth option to `type summary add` command. (#138209)

Currently, the type `T`'s summary formatter will be matched for `T`,
`T*`, `T**` and so on. This is unexpected in many data formatters. Such
unhandled cases could cause the data formatter to crash. An example
would be the lldb's built-in data formatter for `std::optional`:
```
$ cat main.cpp
#include <optional>

int main() {
  std::optional<int> o_null;
  auto po_null = &o_null;
  auto ppo_null = &po_null;
  auto pppo_null = &ppo_null;
  return 0;
}
$ clang++ -g main.cpp && lldb -o "b 8" -o "r" -o "v pppo_null"
[lldb crash]

    [15 lines not shown]
DeltaFile
+112-0lldb/test/API/functionalities/data-formatter/data-formatter-ptr-matching/TestDataFormatterPtrMatching.py
+24-16lldb/source/DataFormatters/FormatManager.cpp
+23-14lldb/source/DataFormatters/TypeSummary.cpp
+32-0lldb/test/API/functionalities/data-formatter/data-formatter-ptr-matching/main.cpp
+19-8lldb/source/Commands/CommandObjectType.cpp
+13-4lldb/include/lldb/DataFormatters/TypeSummary.h
+223-4211 files not shown
+292-5517 files

LLVM/project cb7f4ffclang/lib/Sema HLSLExternalSemaSource.cpp, clang/test/AST/HLSL TypedBuffers-AST.hlsl

[HLSL] Add Buffer def to frontend (#141086)

Fixes #138902

Defines the `Buffer<>` type in the clang frontend. Lowering from
IR->Target Machine is already handled by other code
DeltaFile
+114-0clang/test/SemaHLSL/BuiltIns/Buffers.hlsl
+16-4clang/test/AST/HLSL/TypedBuffers-AST.hlsl
+13-0clang/lib/Sema/HLSLExternalSemaSource.cpp
+2-2clang/test/SemaHLSL/BuiltIns/RWBuffers.hlsl
+2-2clang/test/SemaHLSL/BuiltIns/StructuredBuffers.hlsl
+147-85 files

LLVM/project 440a8adllvm/lib/Transforms/Vectorize VPlanRecipes.cpp LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize vplan-printing-reductions.ll

[VPlan] Use VPIRFlags to manage FMFs for ComputeReductionResult (NFC).

Manage fast-math flags using VPIRFlags from VPInstruciton, in inline
with other VPInstructions. With this change, we now print the correctly
flags for ComputeReductionResult, other than that NFC.
DeltaFile
+6-6llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+7-2llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+3-3llvm/test/Transforms/LoopVectorize/vplan-printing-reductions.ll
+16-113 files

LLVM/project 8fb09c8mlir/include/mlir/Dialect/GPU/IR GPUOps.td, mlir/lib/Conversion/GPUToSPIRV WmmaOpsToSPIRV.cpp

[mlir][gpu] Add GPU subgroup MMA extract and insert operations (#139048)

- Introduced `gpu.subgroup_mma_extract` operation to extract values from
`!gpu.mma_matrix` by invocation and indices.
- Introduced `gpu.subgroup_mma_insert` operation to insert values into
`!gpu.mma_matrix` by invocation and indices.
- Updated the conversion patterns to SPIR-V for both extract and insert
operations.
- Added test cases to validate the new operations in the GPU to SPIR-V
conversion.

RFC:
https://discourse.llvm.org/t/rfc-add-gpu-operations-to-permute-data-in-2-loaded-mma-matrix/86148?u=hsiangkai
DeltaFile
+89-0mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
+63-0mlir/lib/Conversion/GPUToSPIRV/WmmaOpsToSPIRV.cpp
+27-0mlir/test/Conversion/GPUToSPIRV/wmma-ops-to-spirv-khr-coop-matrix.mlir
+14-0mlir/test/Dialect/GPU/ops.mlir
+193-04 files

LLVM/project 0b2cb98llvm/test/CodeGen/AMDGPU bit-op-reduce-width-known-bits.ll

AMDGPU: Add test showing bit operations that should be reducible

v_xor_i64_known_i32_from_range_use_out_of_block demonstrates a regression
that appears in a future patch in the IR division expansion.

We could generalize splitBinaryBitConstantOp to use known bits. I'm
not sure if it's worth it in the original example, since the pattern
seems to disappear if I optimize the division expansion. We should
probably fix the divide expand to avoid this.
DeltaFile
+162-0llvm/test/CodeGen/AMDGPU/bit-op-reduce-width-known-bits.ll
+162-01 files

LLVM/project d8235afllvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU combine-cond-add-sub.ll

AMDGPU: Add is.shared/is.private intrinsics to isBoolSGPR (#141804)

No change in the net output since these ultimately expand to setcc,
but saves a step in the DAG.
DeltaFile
+48-0llvm/test/CodeGen/AMDGPU/combine-cond-add-sub.ll
+12-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+60-02 files

LLVM/project 9ffbc8allvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU combine-and-sext-bool.ll

AMDGPU: Add overflow operations to isBoolSGPR (#141803)

The particular use in the test doesn't seem to do anything for
the expanded cases (i.e. the signed add/sub or multiplies).
DeltaFile
+89-0llvm/test/CodeGen/AMDGPU/combine-and-sext-bool.ll
+7-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+96-02 files

LLVM/project e6bae02llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU combine-and-sext-bool.ll

AMDGPU: Add is_fpclass to isBoolSGPR (#141801)

DeltaFile
+25-0llvm/test/CodeGen/AMDGPU/combine-and-sext-bool.ll
+1-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+26-02 files

LLVM/project b7bb256llvm/include/llvm/IR DiagnosticInfo.h, llvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPULegalizerInfo.cpp

Warn on misuse of DiagnosticInfo classes that hold Twines (#137397)

This annotates the `Twine` passed to the constructors of the various
DiagnosticInfo subclasses with `[[clang::lifetimebound]]`, which causes
us to warn when we would try to print the twine after it had already
been destructed.

We also update `DiagnosticInfoUnsupported` to hold a `const Twine &`
like all of the other DiagnosticInfo classes, since this warning allows
us to clean up all of the places where it was being used incorrectly.
DeltaFile
+17-24llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+18-12llvm/include/llvm/IR/DiagnosticInfo.h
+13-17llvm/lib/Target/ARM/ARMISelLowering.cpp
+12-17llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+7-10llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+6-9llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+73-8914 files not shown
+105-12220 files

LLVM/project fea40f0llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU combine-and-sext-bool.ll

AMDGPU: Add is_fpclass to isBoolSGPR
DeltaFile
+25-0llvm/test/CodeGen/AMDGPU/combine-and-sext-bool.ll
+1-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+26-02 files

LLVM/project e653dc9lldb/test/API/commands/command/language Makefile

[lldb] Fix TestFrameLanguageCommands.py build (#141829)

The use of `-lobjc` resulted in this test failing to build on Linux. The
flag is not necessary, this removes the flag with the expectation it
will fix the test on Linux.
DeltaFile
+0-1lldb/test/API/commands/command/language/Makefile
+0-11 files

LLVM/project 8a486f7llvm/include/llvm/Frontend/Directive DirectiveBase.td Spelling.h

Set the minimum possible version to 0 instead of 1

The default value of the Version parameter in get<Lang><Enum>Name()
was 0, which was not in the range [1, 0x7fffffff]. To fix this, it
was either to change the default value to 1, or to lower the minimum
version to 0. The latter seemed like a better choice, since 0 is a
natural choice for a lower bound on version numbers.
DeltaFile
+2-2llvm/include/llvm/Frontend/Directive/DirectiveBase.td
+3-1llvm/include/llvm/Frontend/Directive/Spelling.h
+5-32 files

LLVM/project 3581e9bllvm/docs MLGO.rst, llvm/include/llvm/Analysis IR2Vec.h

[NFC][IR2Vec] Refactoring for Stateless Embedding Computation (#141811)

Currently, users have to invoke two APIs: `computeEmbeddings()` followed
by getters to access the embeddings. This PR refactors the code to
reduce this *stateful* access of APIs. Users can now directly invoke
getters; Internally, getters would compute the embeddings.
DeltaFile
+21-16llvm/include/llvm/Analysis/IR2Vec.h
+11-14llvm/docs/MLGO.rst
+21-3llvm/lib/Analysis/IR2Vec.cpp
+53-333 files

LLVM/project 259fe01utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc BUILD.bazel

[bazel] Add the missing dependency for the introduced use of support/Utils.h (#141828)

#138066 adds the use of this unspecified dependency. 
This breaks bazel build. 

https://buildkite.com/llvm-project/upstream-bazel/builds/137154#01971745-cb44-4fd1-af59-ccef34c3f61e
DeltaFile
+1-0utils/bazel/llvm-project-overlay/clang-tools-extra/clang-doc/BUILD.bazel
+1-01 files

LLVM/project a581327clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/lib/CIR/CodeGen CIRGenBuilder.h CIRGenModule.h

[CIR] Streamline creation of mlir::IntegerAttrs using mlir::Builder

- Uses getI<bitwidth>IntegerAttr builder method instead of explicit attribute and its type creation.
- Adds few helper functions `getAlignmentAttr` to build alignment representing mlir::IntegerAttr.
- Removes duplicit type parameters, that are inferred from mlir::IntegerAttr.

This mirrors incubator changes from https://github.com/llvm/clangir/pull/1645#event-17840237927
DeltaFile
+27-18clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+16-24clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+4-11clang/lib/CIR/CodeGen/CIRGenBuilder.h
+3-5clang/unittests/CIR/PointerLikeTest.cpp
+1-2clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+1-1clang/lib/CIR/CodeGen/CIRGenModule.h
+52-616 files

LLVM/project 46f9016.github/workflows pr-code-format.yml

[Github] Bump PR Code Format clang-format version (#141819)

As we have discussed in the past, we should be using the latest version.
This has not been updated in a while.
DeltaFile
+1-1.github/workflows/pr-code-format.yml
+1-11 files

LLVM/project 5cb422ellvm/docs MLGO.rst, llvm/include/llvm/Analysis IR2Vec.h

Reducing state
DeltaFile
+21-16llvm/include/llvm/Analysis/IR2Vec.h
+11-14llvm/docs/MLGO.rst
+21-3llvm/lib/Analysis/IR2Vec.cpp
+53-333 files

LLVM/project b096c6bbolt/lib/Passes PAuthGadgetScanner.cpp, bolt/test/binary-analysis/AArch64 gs-pauth-tail-calls.s gs-pauth-debug-output.s

[BOLT] Gadget scanner: optionally assume auth traps on failure

On AArch64 it is possible for an auth instruction to either return an
invalid address value on failure (without FEAT_FPAC) or generate an
error (with FEAT_FPAC). It thus may be possible to never emit explicit
pointer checks, if the target CPU is known to support FEAT_FPAC.

This commit implements an --auth-traps-on-failure command line option,
which essentially makes "safe-to-dereference" and "trusted" register
properties identical and disables scanning for authentication oracles
completely.
DeltaFile
+97-87bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s
+104-73bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s
+74-38bolt/lib/Passes/PAuthGadgetScanner.cpp
+31-23bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s
+4-2bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s
+4-2bolt/test/binary-analysis/AArch64/gs-pauth-jump-table.s
+314-2252 files not shown
+318-2278 files

LLVM/project b0eeddbbolt/include/bolt/Core MCPlusBuilder.h MCInstUtils.h, bolt/lib/Core MCInstUtils.cpp

[BOLT] Gadget scanner: prevent false positives due to jump tables

As part of PAuth hardening, AArch64 LLVM backend can use a special
BR_JumpTable pseudo (enabled by -faarch64-jump-table-hardening
Clang option) which is expanded in the AsmPrinter into a contiguous
sequence without unsafe instructions in the middle.

This commit adds another target-specific callback to MCPlusBuilder
to make it possible to inhibit false positives for known-safe jump
table dispatch sequences. Without special handling, the branch
instruction is likely to be reported as a non-protected call (as its
destination is not produced by an auth instruction, PC-relative address
materialization, etc.) and possibly as a tail call being performed with
unsafe link register (as the detection whether the branch instruction
is a tail call is an heuristic).

For now, only the specific instruction sequence used by the AArch64
LLVM backend is matched.
DeltaFile
+703-0bolt/test/binary-analysis/AArch64/gs-pauth-jump-table.s
+73-0bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+20-0bolt/lib/Core/MCInstUtils.cpp
+14-0bolt/include/bolt/Core/MCPlusBuilder.h
+10-0bolt/lib/Passes/PAuthGadgetScanner.cpp
+9-0bolt/include/bolt/Core/MCInstUtils.h
+829-06 files

LLVM/project d374259bolt/lib/Passes PAuthGadgetScanner.cpp, bolt/test/binary-analysis/AArch64 gs-pauth-debug-output.s

[BOLT] Gadget scanner: make use of C++17 features and LLVM helpers

Perform trivial syntactical cleanups:
* make use of structured binding declarations
* use LLVM utility functions when appropriate
* omit braces around single expression inside single-line LLVM_DEBUG()

This patch is NFC aside from minor debug output changes.
DeltaFile
+31-36bolt/lib/Passes/PAuthGadgetScanner.cpp
+7-7bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s
+38-432 files

LLVM/project af01b4ebolt/include/bolt/Core MCInstUtils.h, bolt/lib/Target/AArch64 AArch64MCPlusBuilder.cpp

[BOLT] Introduce helpers to match `MCInst`s one at a time (NFC)

Introduce matchInst helper function to capture and/or match the operands
of MCInst. Unlike the existing `MCPlusBuilder::MCInstMatcher` machinery,
matchInst is intended for the use cases when precise control over the
instruction order is required. For example, when validating PtrAuth
hardening, all registers are usually considered unsafe after a function
call, even though callee-saved registers should preserve their old
values *under normal operation*.
DeltaFile
+128-0bolt/include/bolt/Core/MCInstUtils.h
+37-59bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+165-592 files

LLVM/project 5b9848cbolt/include/bolt/Core MCInstUtils.h, bolt/include/bolt/Passes PAuthGadgetScanner.h

[BOLT] Factor out MCInstReference from gadget scanner (NFC)

Move MCInstReference representing a constant reference to an instruction
inside a parent entity - either inside a basic block (which has a
reference to its parent function) or directly to the function (when CFG
information is not available).
DeltaFile
+1-177bolt/include/bolt/Passes/PAuthGadgetScanner.h
+168-0bolt/include/bolt/Core/MCInstUtils.h
+42-60bolt/lib/Passes/PAuthGadgetScanner.cpp
+57-0bolt/lib/Core/MCInstUtils.cpp
+1-0bolt/lib/Core/CMakeLists.txt
+269-2375 files

LLVM/project 74bbe1ebolt/include/bolt/Core MCPlusBuilder.h, bolt/lib/Passes PAuthGadgetScanner.cpp

[BOLT] Gadget scanner: account for BRK when searching for auth oracles

An authenticated pointer can be explicitly checked by the compiler via a
sequence of instructions that executes BRK on failure. It is important
to recognize such BRK instruction as checking every register (as it is
expected to immediately trigger an abnormal program termination) to
prevent false positive reports about authentication oracles:

    autia   x2, x3
    autia   x0, x1
    ; neither x0 nor x2 are checked at this point
    eor     x16, x0, x0, lsl #1
    tbz     x16, #62, on_success ; marks x0 as checked
    ; end of BB: for x2 to be checked here, it must be checked in both
    ; successor basic blocks
  on_failure:
    brk     0xc470
  on_success:
    ; x2 is checked
    ldr     x1, [x2] ; marks x2 as checked
DeltaFile
+22-22bolt/test/binary-analysis/AArch64/gs-pauth-address-checks.s
+21-3bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+14-0bolt/include/bolt/Core/MCPlusBuilder.h
+11-2bolt/lib/Passes/PAuthGadgetScanner.cpp
+4-5bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s
+3-3bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s
+75-356 files

LLVM/project a75cab7bolt/lib/Passes PAuthGadgetScanner.cpp, bolt/test/binary-analysis/AArch64 gs-pauth-tail-calls.s

[BOLT] Gadget scanner: detect untrusted LR before tail call

Implement the detection of tail calls performed with untrusted link
register, which violates the assumption made on entry to every function.

Unlike other pauth gadgets, this one involves some amount of guessing
which branch instructions should be checked as tail calls.
DeltaFile
+597-0bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s
+80-0bolt/lib/Passes/PAuthGadgetScanner.cpp
+677-02 files