LLVM/project 6e9b25eclang/bindings/python/tests/cindex test_cursor.py test_type.py, clang/test/bindings/python/tests/cindex test_cursor.py test_type.py

Merge branch 'main' into users/kparzysz/spr/d01-name-parser
DeltaFile
+1,066-0clang/bindings/python/tests/cindex/test_cursor.py
+0-1,066clang/test/bindings/python/tests/cindex/test_cursor.py
+0-598clang/test/bindings/python/tests/cindex/test_type.py
+598-0clang/bindings/python/tests/cindex/test_type.py
+357-0clang/bindings/python/tests/cindex/test_translation_unit.py
+0-357clang/test/bindings/python/tests/cindex/test_translation_unit.py
+2,021-2,021137 files not shown
+5,417-4,069143 files

LLVM/project a068ed2lldb/source/Commands CommandObjectProtocolServer.cpp, lldb/test/API/commands/protocol TestMCPUnixSocket.py

[lldb][mcp] Fix unix domain socket protocol server addresses (#146603)

When starting an MCP protocol server that uses unix sockets as the
transport, a local `'[0.0.0.0]:0'` file is used instead of the supplied
socket path, e.g:
```
(lldb) protocol-server start MCP accept:///tmp/some/path.sock
MCP server started with connection listeners: unix-connect://[0.0.0.0]:0
(lldb) shell ls '[*'
[0.0.0.0]:0
```

This change makes it so that the URI path is used if the socket protocol
is `ProtocolUnixDomain`:
```
(lldb) protocol-server start MCP accept:///tmp/some/path.sock
MCP server started with connection listeners: unix-connect:///tmp/some/path.sock
```
DeltaFile
+33-0lldb/test/API/commands/protocol/TestMCPUnixSocket.py
+7-3lldb/source/Commands/CommandObjectProtocolServer.cpp
+40-32 files

LLVM/project f01017cllvm/docs DeveloperPolicy.rst GitHub.rst

[docs] Refresh Developer Policy text (#136198)

Clarify lots of existing practice. Expand on the "major change" section,
which is the closest thing we have on how to run an RFC.

---------

Co-authored-by: Oleksandr "Alex" Zinenko <azinenko at amd.com>
Co-authored-by: Aaron Ballman <aaron at aaronballman.com>
DeltaFile
+178-124llvm/docs/DeveloperPolicy.rst
+2-0llvm/docs/GitHub.rst
+180-1242 files

LLVM/project 1a3e23fllvm/lib/Target/WebAssembly WebAssemblyTargetMachine.cpp WebAssemblyAsmPrinter.cpp, llvm/lib/Target/WebAssembly/MCTargetDesc WebAssemblyMCTargetDesc.cpp WebAssemblyMCAsmInfo.cpp

WebAssembly: Stop changing MCAsmInfo's ExceptionsType based on flags

Currently wasm adds an extra level of options that work backwards
from the standard options, and overwrites them. The ExceptionModel
field in TM->Options is the standard user configuration option for the
exception model to use. MCAsmInfo's ExceptionsType is a constant for the
default to use for the triple if not explicitly set in the TargetOptions
ExceptionModel. This was adding 2 custom flags, changing the MCAsmInfo
default, and overwriting the ExceptionModel from the custom flags.

These comments about compiling bitcode with clang are describing a toolchain
bug or user error. TargetOptions is bad, and we should move to eliminating it.
It is module state not captured in the IR. Ideally the exception model should either
come implied from the triple, or a module flag and not depend on this side state.
Currently it is the  responsibility of the toolchain and/or user to ensure the same
command line flags are used at each phase of the compilation. It is not the backend's
responsibilty to try to second guess these options.

-wasm-enable-eh and -wasm-enable-sjlj should also be removed in favor of the standard

    [3 lines not shown]
DeltaFile
+0-29llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
+29-0llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+7-6llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+1-8llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp
+9-0llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
+0-7llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
+46-504 files not shown
+50-5610 files

LLVM/project 4e26801clang/test/CodeGenCXX builtins-eh-wasm.cpp

clang: Add requires webassembly to a test

Prior to 6ab7e52dd80dc2ece12cc7f1924a71f1a58e2a8a the test got
away with out it because the error was not triggered if the
backend didn't run.
DeltaFile
+1-0clang/test/CodeGenCXX/builtins-eh-wasm.cpp
+1-01 files

LLVM/project 5e31d4cllvm/lib/Target/RISCV RISCVVLOptimizer.cpp, llvm/test/CodeGen/RISCV/rvv vl-opt-instrs.ll

[RISCV][VLOPT] Support v[f]slide1up.v{x,f} (#146716)

Similarly to #146710, for vslide1ups vl only determines the destination
elements written to so we can safely reduce their AVL.

We cannot do this for vslide1downs as the vl determines which lane the
new element is to be inserted in, so some negative tests have been
added.
DeltaFile
+86-0llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+2-1llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+88-12 files

LLVM/project 717899cclang/include/clang/CIR/Dialect/IR CIROps.td CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenExpr.cpp

[CIR] Upstream get_bitfield operation to load bit-field members from structs (#145971)

This PR adds support for loading bit-field members from structs using
the `get_bitfield` operation.
It enables retrieving the address of the bitfield-packed member but does
**not** yet support volatile bitfields this will be addressed in a
future PR.
DeltaFile
+79-0clang/include/clang/CIR/Dialect/IR/CIROps.td
+63-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+56-4clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+58-0clang/test/CIR/CodeGen/bitfields.c
+54-0clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+38-0clang/lib/CIR/Lowering/LoweringHelpers.cpp
+348-48 files not shown
+482-514 files

LLVM/project 925588cflang/lib/Lower ConvertVariable.cpp, flang/lib/Semantics tools.cpp

[flang][cuda] Allocate derived-type with CUDA componement in managed memory (#146797)

Similarly to descriptor for device data, put derived type holding device
descriptor in managed memory.
DeltaFile
+25-2flang/lib/Lower/ConvertVariable.cpp
+13-2flang/lib/Semantics/tools.cpp
+12-2flang/test/Lower/CUDA/cuda-derived.cuf
+50-63 files

LLVM/project e873ce3flang/include/flang/Evaluate tools.h, flang/include/flang/Semantics tools.h

[flang][cuda] Do not create global for derived-type with allocatable device components (#146780)

derived type with CUDA device allocatable components will be handle via
CUDA allocation. Do not create global for them.
DeltaFile
+24-5flang/lib/Evaluate/tools.cpp
+20-1flang/lib/Semantics/tools.cpp
+20-0flang/test/Lower/CUDA/cuda-derived.cuf
+1-10flang/include/flang/Evaluate/tools.h
+2-0flang/include/flang/Semantics/tools.h
+67-165 files

LLVM/project 0d7e64fcompiler-rt/lib/asan asan_rtl.cpp asan_flags.cpp, compiler-rt/test/asan/TestCases/Windows alloc_dealloc_mismatch.cpp

[ASan][Windows] Honor asan config flags on windows when set through the user function (#122990)

**Related to:** https://github.com/llvm/llvm-project/issues/117925 
**Follow up to:** https://github.com/llvm/llvm-project/pull/117929

**Context:**
As noted in the linked issue, some ASan configuration flags are not
honored on Windows when set through the `__asan_default_options` user
function. The reason for this is that `__asan_default_options` is not
available by the time `AsanInitInternal` executes, which is responsible
for applying the ASan flags.

To fix this properly, we'll probably need a deep re-design of ASan
initialization so that it is consistent across OS'es.
In the meantime, this PR offers a practical workaround.

**This PR:** refactors part of `AsanInitInternal` so that **idempotent**
flag-applying steps are extracted into a new function `ApplyOptions`.
This function is **also** invoked in the "weak function callback" on

    [16 lines not shown]
DeltaFile
+43-9compiler-rt/lib/asan/asan_rtl.cpp
+13-19compiler-rt/lib/asan/asan_flags.cpp
+29-0compiler-rt/test/asan/TestCases/Windows/alloc_dealloc_mismatch.cpp
+11-1compiler-rt/lib/asan/asan_allocator.cpp
+1-0compiler-rt/lib/asan/asan_allocator.h
+1-0compiler-rt/lib/asan/asan_internal.h
+98-296 files

LLVM/project 6550f28llvm/lib/Target/RISCV RISCVVLOptimizer.cpp, llvm/test/CodeGen/RISCV/rvv vl-opt-instrs.ll vp-vector-interleaved-access.ll

[RISCV][VLOPT] Support vslide{up,down} (#146710)

For vslideup and vslidedown, vl controls the elements which are written
just like other vector instructions. So unless I'm missing something it
should be safe to reduce them. For vslidedown, the specification states
that elements past vl may be read.

We already reduce vslideup and vslidedown in
RISCVVectorPeephole::tryToReduceVL where we just check for
RISCVII::elementsDependOnVL.

Eventually we should replace the whitelist with
RISCVII::elementsDependOnVL once we have test coverage. I've also added
an assert just to double check the instructions we currently support.

This helps reduce vl toggles for fixed-order recurrences vectorized with
EVL tail folding.
DeltaFile
+80-0llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+33-33llvm/test/CodeGen/RISCV/rvv/vp-vector-interleaved-access.ll
+12-12llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect.ll
+9-0llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+134-454 files

LLVM/project c6abab2llvm/lib/Target/RISCV RISCVVLOptimizer.cpp, llvm/test/CodeGen/RISCV/rvv setcc-fp-vp.ll vl-opt-instrs.ll

[RISCV][VLOPT] Add support for vfmerge.vfm and vfmv.v.f (#146692)

I noticed these were missing when seeing some extra vl toggles with EVL
tail folding.

This helps remove quite a few vsetvlis in llvm-test-suite
DeltaFile
+32-64llvm/test/CodeGen/RISCV/rvv/setcc-fp-vp.ll
+40-0llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll
+2-4llvm/test/CodeGen/RISCV/rvv/vfma-vp-combine.ll
+4-0llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+1-2llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll
+79-705 files

LLVM/project 6ab7e52clang/test/CodeGen/WebAssembly wasm-exception-model-flag-parse-ir-input.ll, clang/test/CodeGenCXX wasm-eh.cpp builtins-eh-wasm.cpp

WebAssembly: Move validation of EH flags to TargetMachine construct time (#146634)

DeltaFile
+52-58llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+4-3clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll
+3-3clang/test/CodeGenCXX/wasm-eh.cpp
+1-1clang/test/CodeGenCXX/builtins-eh-wasm.cpp
+1-1llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
+1-1llvm/test/CodeGen/WebAssembly/exception-legacy.mir
+62-671 files not shown
+63-687 files

LLVM/project c28bdc7clang/test/Driver pgo-sample-use-profi.c

nit: updated comment
DeltaFile
+1-1clang/test/Driver/pgo-sample-use-profi.c
+1-11 files

LLVM/project 7fcd8declang/lib/Driver/ToolChains Clang.cpp, clang/test/Driver pgo-sample-use-profi.c

[Clang][Driver][SamplePGO] Enable -fsample-profile-use-profi by default for SamplePGO
DeltaFile
+3-3clang/test/Driver/pgo-sample-use-profi.c
+1-1clang/lib/Driver/ToolChains/Clang.cpp
+4-42 files

LLVM/project 9d35e46llvm/include/llvm/Frontend/OpenMP DirectiveNameParser.h

Add missing brace in comment
DeltaFile
+1-1llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
+1-11 files

LLVM/project 538cfcdllvm/include/llvm/Frontend/OpenMP DirectiveNameParser.h, llvm/lib/Frontend/OpenMP DirectiveNameParser.cpp

Add const version of next()
DeltaFile
+9-1llvm/lib/Frontend/OpenMP/DirectiveNameParser.cpp
+1-0llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
+10-12 files

LLVM/project f49ba8bllvm/lib/Frontend/OpenMP DirectiveNameParser.cpp

Use llvm::seq
DeltaFile
+2-1llvm/lib/Frontend/OpenMP/DirectiveNameParser.cpp
+2-11 files

LLVM/project 3b1ce3bllvm/lib/Target/DirectX DXILRootSignature.h

formating
DeltaFile
+1-1llvm/lib/Target/DirectX/DXILRootSignature.h
+1-11 files

LLVM/project d433134clang/include/clang/Driver Options.td, clang/lib/Driver/ToolChains Clang.cpp

[Clang][Driver][SamplePGO] Introduce -fno_sample_profile_use_profi flag for SamplePGO (#145957)

This flag allows opting out of using profile inference pass for SamplePGO.
DeltaFile
+18-2clang/test/Driver/pgo-sample-use-profi.c
+2-1clang/lib/Driver/ToolChains/Clang.cpp
+2-0clang/include/clang/Driver/Options.td
+22-33 files

LLVM/project c863e0eclang/bindings/python/tests/cindex test_cursor.py test_type.py, clang/test/bindings/python/tests/cindex test_cursor.py test_type.py

Revert "Move python binding tests to lit framework (#146486)" (#146789)

This reverts commit a75587d2718f76dc53112065da36e08d04034eb9.
DeltaFile
+0-1,066clang/test/bindings/python/tests/cindex/test_cursor.py
+1,066-0clang/bindings/python/tests/cindex/test_cursor.py
+598-0clang/bindings/python/tests/cindex/test_type.py
+0-598clang/test/bindings/python/tests/cindex/test_type.py
+0-357clang/test/bindings/python/tests/cindex/test_translation_unit.py
+357-0clang/bindings/python/tests/cindex/test_translation_unit.py
+2,021-2,02168 files not shown
+3,593-3,61174 files

LLVM/project c234717clang/lib/CodeGen CGDebugInfo.cpp CGDebugInfo.h, clang/test/CodeGenCXX debug-info-dtor-implicit-args.cpp

Reapply "[Clang,debuginfo] added vtt parameter in destructor DISubroutineType (#130674)" (#145697)

This reverts commit cd826d6e840ed33ad88458c862da5f9fcc6e908c and relands
27c1aa9b9cf9e0b14211758ff8f7d3aaba24ffcf
This fixes #104765

I tweaked the code to avoid an OOB.
DeltaFile
+24-0clang/test/CodeGenCXX/debug-info-dtor-implicit-args.cpp
+18-3clang/lib/CodeGen/CGDebugInfo.cpp
+6-1clang/lib/CodeGen/CGDebugInfo.h
+48-43 files

LLVM/project 3f8dec4llvm/lib/Target/DirectX DXILRootSignature.h

format
DeltaFile
+13-12llvm/lib/Target/DirectX/DXILRootSignature.h
+13-121 files

LLVM/project 242545ellvm/lib/Target/DirectX DXILRootSignature.cpp DXILRootSignature.h

clean up
DeltaFile
+3-5llvm/lib/Target/DirectX/DXILRootSignature.cpp
+0-2llvm/lib/Target/DirectX/DXILRootSignature.h
+3-72 files

LLVM/project a74c7d8clang/lib/Driver/ToolChains CommonArgs.cpp, llvm/lib/Target/AArch64 AArch64FrameLowering.cpp

[win][aarch64] Always reserve frame pointers for Arm64 Windows (#146582)

There is no way in Arm64 Windows to indicate that a given function has
used the Frame Pointer as a General Purpose Register, as such stack
walks will always assume that the frame chain is valid and will follow
whatever value has been saved for the Frame Pointer (even if it is
pointing to data, etc.).

This change makes the Frame Pointer always reserved when building for
Arm64 Windows to avoid this issue.

We will be updating the official Windows ABI documentation to reflect
this requirement, and I will provide a link once it's available.
DeltaFile
+32-16llvm/test/CodeGen/AArch64/win-sve.ll
+17-19llvm/test/CodeGen/AArch64/wincfi-missing-seh-directives.ll
+22-3llvm/test/CodeGen/AArch64/regress-w29-reserved-with-fp.ll
+21-0llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+13-2clang/lib/Driver/ToolChains/CommonArgs.cpp
+9-5llvm/test/CodeGen/AArch64/wineh-frame7.mir
+114-454 files not shown
+131-5010 files

LLVM/project ab3f0ccclang/lib/Parse ParseOpenMP.cpp

[clang][OpenMP] Use DirectiveNameParser to parse directive names

This simplifies the parsing code in clang quite a bit.
DeltaFile
+18-161clang/lib/Parse/ParseOpenMP.cpp
+18-1611 files

LLVM/project 0e9eab6llvm/include/llvm/Frontend/OpenMP DirectiveNameParser.h, llvm/lib/Frontend/OpenMP DirectiveNameParser.cpp CMakeLists.txt

[Frontend][OpenMP] Implement directive name parser

Implement a state machine that consumes tokens (words delimited by white
space), and returns the corresponding directive id, or fails if the tokens
did not form a valid name.
DeltaFile
+171-0llvm/unittests/Frontend/OpenMPDirectiveNameParserTest.cpp
+93-0llvm/lib/Frontend/OpenMP/DirectiveNameParser.cpp
+76-0llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h
+1-0llvm/lib/Frontend/OpenMP/CMakeLists.txt
+1-0llvm/unittests/Frontend/CMakeLists.txt
+342-05 files

LLVM/project 551d6ddclang/test/Modules mingw-exceptions.cppm

[clang] [test] Add a missing requirement for a test

This fixes a test added in 7fc50e92a59c764eb6b1897fcdd506aacb92629c.
DeltaFile
+1-0clang/test/Modules/mingw-exceptions.cppm
+1-01 files

LLVM/project 497060flld/test/wasm compress-relocs.s compress-relocs64.s, lld/wasm InputChunks.cpp

[lld][WebAssembly] Add missing relocation types to the --compress-relocations path (#144578)

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

Reloc list reference:
```
+ Already handled
A Added in this change
= Not applicable / expected (though technically legal, e. g. you can relocate v128.const...)

+ R_WASM_FUNCTION_INDEX_LEB,      0
+ R_WASM_TABLE_INDEX_SLEB,        1
= R_WASM_TABLE_INDEX_I32,         2
+ R_WASM_MEMORY_ADDR_LEB,         3
+ R_WASM_MEMORY_ADDR_SLEB,        4
= R_WASM_MEMORY_ADDR_I32,         5
+ R_WASM_TYPE_INDEX_LEB,          6
+ R_WASM_GLOBAL_INDEX_LEB,        7
= R_WASM_FUNCTION_OFFSET_I32,     8

    [18 lines not shown]
DeltaFile
+129-0lld/test/wasm/compress-relocs.s
+92-0lld/test/wasm/compress-relocs64.s
+40-6lld/wasm/InputChunks.cpp
+0-26lld/test/wasm/compress-relocs.ll
+3-1llvm/include/llvm/BinaryFormat/Wasm.h
+264-335 files

LLVM/project 2725765llvm/include/llvm/ADT ArrayRef.h, llvm/unittests/ADT ArrayRefTest.cpp

[LLVM][ADT] Add `consume_front` and `consume_back` to ArrayRef (#146741)

Add `consume_front` that returns the first element and drops it from the
current ArrayRef, and `consume_back` that returns the last element and
drops it from the current ArrayRef.
DeltaFile
+42-0llvm/unittests/ADT/ArrayRefTest.cpp
+28-0llvm/include/llvm/ADT/ArrayRef.h
+70-02 files