[all-commits] [llvm/llvm-project] e6a413: Reland "[libc] utf8 to 32 CharacterConverter" (#14...

Garvit Gupta via All-commits all-commits at lists.llvm.org
Tue Jun 17 10:52:02 PDT 2025


  Branch: refs/heads/users/quic-garvgupt/undefined
  Home:   https://github.com/llvm/llvm-project
  Commit: e6a41399cb8796e5d18940d49b0151704568321a
      https://github.com/llvm/llvm-project/commit/e6a41399cb8796e5d18940d49b0151704568321a
  Author: sribee8 <sriya.pratipati at gmail.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M libc/src/__support/wchar/character_converter.cpp
    M libc/test/src/__support/CMakeLists.txt
    M libc/test/src/__support/wchar/CMakeLists.txt
    A libc/test/src/__support/wchar/utf8_to_32_test.cpp

  Log Message:
  -----------
  Reland "[libc] utf8 to 32 CharacterConverter" (#144450)

Reverts llvm/llvm-project#144446
Figured out the issue, so creating a new pull request.

---------

Co-authored-by: Sriya Pratipati <sriyap at google.com>


  Commit: 65d590e8d012df9dabbf8b3ec929fd1543c7398a
      https://github.com/llvm/llvm-project/commit/65d590e8d012df9dabbf8b3ec929fd1543c7398a
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp

  Log Message:
  -----------
  [X86] combineLogicBlendIntoConditionalNegate - convert to SDPatternMatch matching. NFC. (#144536)


  Commit: c66be289901b3f035187d391e80e3610d7d6232e
      https://github.com/llvm/llvm-project/commit/c66be289901b3f035187d391e80e3610d7d6232e
  Author: Timm Baeder <tbaeder at redhat.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang/lib/AST/ByteCode/Compiler.cpp
    M clang/lib/AST/ByteCode/Compiler.h
    M clang/lib/AST/ByteCode/Descriptor.cpp
    M clang/lib/AST/ByteCode/Disasm.cpp
    M clang/lib/AST/ByteCode/Floating.h
    M clang/lib/AST/ByteCode/Integral.h
    M clang/lib/AST/ByteCode/IntegralAP.h
    M clang/lib/AST/ByteCode/Interp.cpp
    M clang/lib/AST/ByteCode/Interp.h
    M clang/lib/AST/ByteCode/InterpBuiltin.cpp
    M clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp
    M clang/lib/AST/ByteCode/InterpState.h
    M clang/lib/AST/ByteCode/Opcodes.td
    M clang/lib/AST/ByteCode/PrimType.h
    M clang/lib/AST/ByteCode/Program.h
    M clang/test/AST/ByteCode/builtin-bit-cast-long-double.cpp
    M clang/test/AST/ByteCode/builtin-functions.cpp

  Log Message:
  -----------
  [clang][bytecode] Allocate IntegralAP and Floating types using an allocator (#144246)

Both `APInt` and `APFloat` will heap-allocate memory themselves using
the system allocator when the size of their data exceeds 64 bits.

This is why clang has `APNumericStorage`, which allocates its memory
using an allocator (via `ASTContext`) instead. Calling `getValue()` on
an ast node like that will then create a new `APInt`/`APFloat` , which
will copy the data (in the `APFloat` case, we even copy it twice).
That's sad but whatever.

In the bytecode interpreter, we have a similar problem. Large integers
and floating-point values are placement-new allocated into the
`InterpStack` (or into the bytecode, which is a `vector<std::byte>`).
When we then later interrupt interpretation, we don't run the destructor
for all items on the stack, which means we leak the memory the
`APInt`/`APFloat` (which backs the `IntegralAP`/`Floating` the
interpreter uses).

Fix this by using an approach similar to the one used in the AST. Add an
allocator to `InterpState`, which is used for temporaries and local
values. Those values will be freed at the end of interpretation. For
global variables, we need to promote the values to global lifetime,
which we do via `InitGlobal` and `FinishInitGlobal` ops.

Interestingly, this results in a slight _improvement_ in compile times:
https://llvm-compile-time-tracker.com/compare.php?from=6bfcdda9b1ddf0900f82f7e30cb5e3253a791d50&to=88d1d899127b408f0fb0f385c2c58e6283195049&stat=instructions:u
(but don't ask me why).

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


  Commit: 9ec75a50bc48c84c68430f113332769d23481ef5
      https://github.com/llvm/llvm-project/commit/9ec75a50bc48c84c68430f113332769d23481ef5
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.h
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
    R llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp
    R llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.h
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    M llvm/lib/Target/Mips/MipsAsmPrinter.cpp
    M llvm/lib/Target/Mips/MipsMCInstLower.cpp
    M llvm/lib/Target/Mips/MipsTargetObjectFile.cpp

  Log Message:
  -----------
  MIPS: Replace MipsMCExpr with MCSpecifierExpr


  Commit: 382e3fdbb476a5d5771b315daedcd05a15883fbc
      https://github.com/llvm/llvm-project/commit/382e3fdbb476a5d5771b315daedcd05a15883fbc
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp

  Log Message:
  -----------
  [lldb][Formatter] Get element type for unordered_maps from __hash_table::value_type (#144517)

https://github.com/llvm/llvm-project/pull/143501 changes usage of
`__hash_value_type` in libcxx to an empty tag type. This type will no
longer have a definition in DWARF. Currently the LLDB unordered_map
formatter deduces the map's `element_type` by looking at the `__cc_`
member of `__hash_value_type`. But that will no longer work because we
only have its forward declaration. Since what we're really after is the
type that `__hash_value_type` is wrapping, we can just look at the
`__hash_table::value_type` typedef. With
https://github.com/llvm/llvm-project/pull/143501 that will now point to
the `std::pair` element type (which used to be what we got from
`__cc_`).

TBD: need to double-check this works for older layouts. Quick glance at
the code makes me suspicious of cases like `unordered_map<std::pair<int,
int>, int>`


  Commit: 4e884dd993e040f7ccd83ecdc3c4570d23a42ee6
      https://github.com/llvm/llvm-project/commit/4e884dd993e040f7ccd83ecdc3c4570d23a42ee6
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
    R llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
    M llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
    M llvm/lib/Target/Sparc/SparcISelLowering.cpp
    M llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp

  Log Message:
  -----------
  SPARC: Remove SparcMCExpr.h


  Commit: 0c608175c11cf0ce797be7575a7c8d8ebcdecbd8
      https://github.com/llvm/llvm-project/commit/0c608175c11cf0ce797be7575a7c8d8ebcdecbd8
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp

  Log Message:
  -----------
  [X86] matchLogicBlend - convert to SDPatternMatch matching. NFC. (#144546)

Removes a LOT of commutative matching.


  Commit: b14e03d8555043bc35e9c75fff7f52d28950b3ab
      https://github.com/llvm/llvm-project/commit/b14e03d8555043bc35e9c75fff7f52d28950b3ab
  Author: nerix <nerixdev at outlook.de>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py

  Log Message:
  -----------
  [LLDB] Consolidate C++ string buffer summaries (#144258)

As part of https://github.com/llvm/llvm-project/pull/143177, I moved the
non-libc++ specific formatting of `std::string`s out to `CxxStringTypes`
as MSVC's STL `std::string` can also be thought of a pointer+size pair.
I named this kind of string "string buffer".

This PR picks that change, so the MSVC PR can be smaller.
Unfortunately, libstdc++'s `std::string` does not fit this (it also uses
a different string printer function).

This resolves two FIXMEs in the libc++ tests, where empty u16 and u32
strings didn't have any prefix (u/U).


  Commit: 5baf351ba819e1e6bae0250492e85a2862ef406b
      https://github.com/llvm/llvm-project/commit/5baf351ba819e1e6bae0250492e85a2862ef406b
  Author: yonghong-song <yhs at fb.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp

  Log Message:
  -----------
  [BPF] Do not allow gotol in the middle of asm insn (#144545)

Previously I accidentally allowed 'gotol' insn in the middle of asm insn
([1]). But actually 'gotol' is not allowed in the middle of any asm
insn, so remove it from isValidIdInMiddle().

[1] https://github.com/yonghong-song/llvm-project/commit/6c412b6c6faa2dabd8602d35d3f5e796fb1daf80


  Commit: 556e69b7f4328a0d7c36c9d7ca0dd8f52f82ad71
      https://github.com/llvm/llvm-project/commit/556e69b7f4328a0d7c36c9d7ca0dd8f52f82ad71
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M lldb/cmake/modules/FindPythonAndSwig.cmake
    M lldb/test/API/lit.cfg.py
    M lldb/test/API/lit.site.cfg.py.in
    M lldb/test/Shell/lit.cfg.py

  Log Message:
  -----------
  [lldb] make lit use the same Python executable for building and testing (#143756)

When testing LLDB, we want to make sure to use the same Python as the
one we used to build it.

This patch uses the CMake variable `Python3_ROOT_DIR` to add the correct
Python to the `PATH` in LLDB lit tests, in order to ensure of this.

Please see https://github.com/swiftlang/swift/pull/82063 for the
original issue.

This is a continuation of https://github.com/swiftlang/swift/pull/82063.


  Commit: 8063bd153c6aca43869d96aee64aeceb9be98ca5
      https://github.com/llvm/llvm-project/commit/8063bd153c6aca43869d96aee64aeceb9be98ca5
  Author: Nishant Patel <nishant.b.patel at intel.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp
    A mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-elemwise.mlir

  Log Message:
  -----------
  [MLIR][XeGPU] Add support for elementwise ops in Wg to Sg distribute pass [1/N] (#142797)

This PR adds support for Elementwise operations' (unary & binary)
lowering from Workgroup to Subgroup.


  Commit: 01a7a21a4b8070a88e5dcc9753066e38d26faf85
      https://github.com/llvm/llvm-project/commit/01a7a21a4b8070a88e5dcc9753066e38d26faf85
  Author: Chris B <chris.bieneman at me.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/cmake/modules/AddLLVM.cmake

  Log Message:
  -----------
  [CMake] Add BINARY_DIR argument for add_lit_testsuites (#144431)

We're doing some slightly odd things with LIT in the offload-test-suite.
Specifically we generate multiple binary directories to configure and
run tests with different configurations from the same source root.

In this configuration the subdirectory targets need to instead point to
the correct generated binary directory and use test filtering to get a
subset of tests.


  Commit: 526310e916af2073e30b57b678307ce94df803f3
      https://github.com/llvm/llvm-project/commit/526310e916af2073e30b57b678307ce94df803f3
  Author: Jon Roelofs <jonathan_roelofs at apple.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/IR/DiagnosticInfo.cpp
    M llvm/test/Transforms/GVN/opt-remarks.ll

  Log Message:
  -----------
  [Remarks] Elaborate on called intrinsics (#143985)


  Commit: ec230aa7a7d13c222c0b34b87c3c16937383b4a0
      https://github.com/llvm/llvm-project/commit/ec230aa7a7d13c222c0b34b87c3c16937383b4a0
  Author: Garvit Gupta <quic_garvgupt at quicinc.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/lib/Driver/ToolChains/BareMetal.h
    M clang/test/Driver/aarch64-toolchain-extra.c
    M clang/test/Driver/aarch64-toolchain.c
    M clang/test/Driver/arm-toolchain-extra.c
    M clang/test/Driver/arm-toolchain.c
    M clang/test/Driver/baremetal.cpp
    M clang/test/Driver/sanitizer-ld.c

  Log Message:
  -----------
  [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (#121830)

This patch conditionalise the addition of crt{begin,end}.o object files
along
with addition of -lgloss lib based on whether libc selected is newlib or
llvm
libc. Since there is no way a user can specify which libc it wants to
link
against, currently passing valid GCCInstallation to driver will select
newlib
otherwise it will default to llvm libc.

Moreover, this patch makes gnuld the default linker for baremetal
toolchain
object. User need to pass `-fuse-ld=lld` explicitly to driver to select
lld

This is the 2nd patch in the series of patches of merging RISCVToolchain
into
BareMetal toolchain object.

RFC:

https://discourse.llvm.org/t/merging-riscvtoolchain-and-baremetal-toolchains/75524


  Commit: 8513066f2c49457f5d1f63e275403330f854041c
      https://github.com/llvm/llvm-project/commit/8513066f2c49457f5d1f63e275403330f854041c
  Author: someoneinjd <someoneinjd at outlook.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang-tools-extra/clangd/ClangdLSPServer.cpp
    M clang-tools-extra/clangd/Protocol.cpp
    M clang-tools-extra/clangd/Protocol.h
    A clang-tools-extra/clangd/test/positionencoding.test

  Log Message:
  -----------
  [clangd] Implement LSP 3.17 positionEncoding (#142903)

This PR adds support for the `positionEncoding` client capability
introduced in LSP 3.17. Clangd can now negotiate the position encoding
with the client during initialization.

Fix https://github.com/clangd/clangd/issues/1746

Co-authored-by: kadir çetinkaya <kadircetinkaya.06.tr at gmail.com>


  Commit: 9dd1c66e8ffba73fead13aaf359e290f6e1d4899
      https://github.com/llvm/llvm-project/commit/9dd1c66e8ffba73fead13aaf359e290f6e1d4899
  Author: Luke Lau <luke at igalia.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.h
    M llvm/test/Transforms/LoopVectorize/AArch64/clamped-trip-count.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/divs-with-scalable-vfs.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/epilog-iv-select-cmp.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/optsize_minsize.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions-unusual-types.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-accesses.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-masked-accesses.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-remove-loop-region.ll
    M llvm/test/Transforms/LoopVectorize/ARM/optsize_minsize.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/interleaved-masked-access.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/mask-index-type.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/pr87378-vpinstruction-or-drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/pr88802.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/uniform-load-store.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-interleave.ll
    M llvm/test/Transforms/LoopVectorize/X86/constant-fold.ll
    M llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/X86/induction-costs.ll
    M llvm/test/Transforms/LoopVectorize/X86/interleave-cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/outer_loop_test1_no_explicit_vect_width.ll
    M llvm/test/Transforms/LoopVectorize/X86/scatter_crash.ll
    M llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll
    M llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
    M llvm/test/Transforms/LoopVectorize/load-deref-pred-poison-ub-ops-feeding-pointer.ll
    M llvm/test/Transforms/LoopVectorize/pointer-induction.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
    M llvm/test/Transforms/LoopVectorize/scalable-first-order-recurrence.ll
    M llvm/test/Transforms/LoopVectorize/scalable-inductions.ll
    M llvm/test/Transforms/LoopVectorize/scalable-iv-outside-user.ll
    M llvm/test/Transforms/LoopVectorize/single_early_exit_live_outs.ll
    M llvm/test/Transforms/LoopVectorize/uniform-blend.ll
    M llvm/test/Transforms/LoopVectorize/vplan-iv-transforms.ll

  Log Message:
  -----------
  [VPlan] Expand VPWidenIntOrFpInductionRecipe into separate recipes (#118638)

The motivation of this PR is to make #115274 easier to implement, and
should allow us to add EVL support by just passing EVL to the VF
operand.

The current difficulty with widening IVs with EVL is that
VPWidenIntOrFpInductionRecipe generates its own backedge value. Since
it's a VPHeaderPHIRecipe the VF operand must be in the preheader, which
means we can't use the EVL since it's defined in the loop body.

The gist in this PR is to take the approach in #114305 and expand
VPWidenIntOrFpInductionRecipe into several recipes for the initial
value, phi and backedge value just before execution. I.e. this example:

```
  vector.ph:
  Successor(s): vector loop

  <x1> vector loop: {
    vector.body:
      WIDEN-INDUCTION %i = phi %start, %step, %vf
      ...
      EMIT branch-on-count ...
    No successors
  }
```

gets expanded to:

``` 
vector.ph:
  ...
  vp<%induction.start> = ...
  vp<%induction.increment> = ...

Successor(s): vector loop

<x1> vector loop: {
  vector.body:
    ir<%i> = WIDEN-PHI vp<%induction.start>, vp<%vec.ind.next>
    ...
    vp<%vec.ind.next> = add ir<%i>, vp<%induction.increment>
    EMIT branch-on-count ...
  No successors
}
```

This allows us to a value defined in the loop in the backedge value, and
also means we can just reuse the existing backedge fixups in
VPlan::execute without having to specially handle it ourselves.

After this #115274 should just become a matter of setting the VF operand
to EVL (and building the increment step in the loop body, not the
preheader).


  Commit: 9e0186d925f0c375a627866c59394f25c22eb3ff
      https://github.com/llvm/llvm-project/commit/9e0186d925f0c375a627866c59394f25c22eb3ff
  Author: Finn Plummer <finn.c.plum at gmail.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
    M llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
    M llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
    M llvm/unittests/Frontend/CMakeLists.txt
    A llvm/unittests/Frontend/HLSLRootSignatureRangesTest.cpp

  Log Message:
  -----------
  [HLSL][RootSignature] Implement `ResourceRange` as an `IntervalMap` (#140957)

A resource range consists of a closed interval, `[a;b]`, denoting which
shader registers it is bound to.

For instance:
 - `CBV(b1)`  corresponds to the resource range of `[1;1]`
 - `CBV(b0, numDescriptors = 3)` likewise to `[0;2]`

We want to provide an error diagnostic when there is an overlap in the
required registers (an overlap in the resource ranges).

The goal of this pr is to implement a structure to model a set of
resource ranges and provide an api to detect any overlap over a set of
resource ranges.

`ResourceRange` models this by implementing an `IntervalMap` to denote a
mapping from an interval of registers back to a resource range. It
allows for a new `ResourceRange` to be added to the mapping and it will
report if and what the first overlap is.

For the context of how this will be used in validation of a
`RootSignatureDecl` please see the proceeding pull request here:
https://github.com/llvm/llvm-project/pull/140962.

- Implements `ResourceRange` as an `IntervalMap`
- Adds unit testing of the various `insert` scenarios

Note: it was also considered to implement this as an `IntervalTree`,
this would allow reporting of a diagnostic for each overlap that is
encountered, as opposed to just the first. However, error generation of
just reporting the first error is already rather verbose, and adding the
additional diagnostics only made this worse.

Part 1 of https://github.com/llvm/llvm-project/issues/129942


  Commit: fa8aad1e9df9b21696fea33de4678a809a13367c
      https://github.com/llvm/llvm-project/commit/fa8aad1e9df9b21696fea33de4678a809a13367c
  Author: Garvit Gupta <quic_garvgupt at quicinc.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/test/Driver/aarch64-toolchain-extra.c
    M clang/test/Driver/aarch64-toolchain.c
    M clang/test/Driver/arm-toolchain-extra.c
    M clang/test/Driver/arm-toolchain.c
    M clang/test/Driver/baremetal-multilib.yaml
    M clang/test/Driver/baremetal-sysroot.cpp
    M clang/test/Driver/baremetal.cpp

  Log Message:
  -----------
  [Driver] Fix link order of BareMetal toolchain object

The linker job in BareMetal toolchain object will be used by gnuld and lld both.
However, gnuld process the arguments in the order in which they appear on command
line, whereas there is no such restriction with lld.

The previous order was:
LibraryPaths -> Libraries -> LTOOptions -> LinkerInputs
The new iorder is:
LibraryPaths -> LTOOptions -> LinkerInputs -> Libraries

LTO options need to be added before adding any linker inputs because file format
after compile stage during LTO is bitcode which gnuld natively cannot process.
Hence iwill need to pass appropriate plugins before adding any bitcode file on the
command line.

Object files that are getting linked need to be passed before processing any
libraries so that gnuld can appropriately do symbol resolution for the symbols
for which no definition is provided through user code.

Similar link order is also followed by other linker jobs for gnuld such as in
gnutools::Linker in Gnu.cpp

This is the 3rd patch in the series of patches of merging RISCVToolchain into
BareMetal toolchain object.

RFC:
https://discourse.llvm.org/t/merging-riscvtoolchain-and-baremetal-toolchains/75524

Change-Id: I0e68e403c08b5687cc3346e833981f7b9f3819c4


  Commit: ec09d8368f790978a083a829b55306b07642ddd7
      https://github.com/llvm/llvm-project/commit/ec09d8368f790978a083a829b55306b07642ddd7
  Author: Garvit Gupta <quic_garvgupt at quicinc.com>
  Date:   2025-06-17 (Tue, 17 Jun 2025)

  Changed paths:
    M clang-tools-extra/clangd/ClangdLSPServer.cpp
    M clang-tools-extra/clangd/Protocol.cpp
    M clang-tools-extra/clangd/Protocol.h
    A clang-tools-extra/clangd/test/positionencoding.test
    M clang/lib/AST/ByteCode/Compiler.cpp
    M clang/lib/AST/ByteCode/Compiler.h
    M clang/lib/AST/ByteCode/Descriptor.cpp
    M clang/lib/AST/ByteCode/Disasm.cpp
    M clang/lib/AST/ByteCode/Floating.h
    M clang/lib/AST/ByteCode/Integral.h
    M clang/lib/AST/ByteCode/IntegralAP.h
    M clang/lib/AST/ByteCode/Interp.cpp
    M clang/lib/AST/ByteCode/Interp.h
    M clang/lib/AST/ByteCode/InterpBuiltin.cpp
    M clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp
    M clang/lib/AST/ByteCode/InterpState.h
    M clang/lib/AST/ByteCode/Opcodes.td
    M clang/lib/AST/ByteCode/PrimType.h
    M clang/lib/AST/ByteCode/Program.h
    M clang/test/AST/ByteCode/builtin-bit-cast-long-double.cpp
    M clang/test/AST/ByteCode/builtin-functions.cpp
    M libc/src/__support/wchar/character_converter.cpp
    M libc/test/src/__support/CMakeLists.txt
    M libc/test/src/__support/wchar/CMakeLists.txt
    A libc/test/src/__support/wchar/utf8_to_32_test.cpp
    M lldb/cmake/modules/FindPythonAndSwig.cmake
    M lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
    M lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    M lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
    M lldb/test/API/lit.cfg.py
    M lldb/test/API/lit.site.cfg.py.in
    M lldb/test/Shell/lit.cfg.py
    M llvm/cmake/modules/AddLLVM.cmake
    M llvm/include/llvm/Frontend/HLSL/HLSLRootSignature.h
    M llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
    M llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
    M llvm/lib/IR/DiagnosticInfo.cpp
    M llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
    M llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
    M llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.h
    M llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
    R llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp
    R llvm/lib/Target/Mips/MCTargetDesc/MipsMCExpr.h
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    M llvm/lib/Target/Mips/MipsAsmPrinter.cpp
    M llvm/lib/Target/Mips/MipsMCInstLower.cpp
    M llvm/lib/Target/Mips/MipsTargetObjectFile.cpp
    M llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp
    M llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
    R llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h
    M llvm/lib/Target/Sparc/SparcAsmPrinter.cpp
    M llvm/lib/Target/Sparc/SparcISelLowering.cpp
    M llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.h
    M llvm/test/Transforms/GVN/opt-remarks.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/clamped-trip-count.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/divs-with-scalable-vfs.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/epilog-iv-select-cmp.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/optsize_minsize.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/simple_early_exit.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions-unusual-types.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-accesses.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-masked-accesses.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-remove-loop-region.ll
    M llvm/test/Transforms/LoopVectorize/ARM/optsize_minsize.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/interleaved-masked-access.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/mask-index-type.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/pr87378-vpinstruction-or-drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/pr88802.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/uniform-load-store.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-interleave.ll
    M llvm/test/Transforms/LoopVectorize/X86/constant-fold.ll
    M llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/X86/induction-costs.ll
    M llvm/test/Transforms/LoopVectorize/X86/interleave-cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/outer_loop_test1_no_explicit_vect_width.ll
    M llvm/test/Transforms/LoopVectorize/X86/scatter_crash.ll
    M llvm/test/Transforms/LoopVectorize/epilog-vectorization-any-of-reductions.ll
    M llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
    M llvm/test/Transforms/LoopVectorize/load-deref-pred-poison-ub-ops-feeding-pointer.ll
    M llvm/test/Transforms/LoopVectorize/pointer-induction.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
    M llvm/test/Transforms/LoopVectorize/scalable-first-order-recurrence.ll
    M llvm/test/Transforms/LoopVectorize/scalable-inductions.ll
    M llvm/test/Transforms/LoopVectorize/scalable-iv-outside-user.ll
    M llvm/test/Transforms/LoopVectorize/single_early_exit_live_outs.ll
    M llvm/test/Transforms/LoopVectorize/uniform-blend.ll
    M llvm/test/Transforms/LoopVectorize/vplan-iv-transforms.ll
    M llvm/unittests/Frontend/CMakeLists.txt
    A llvm/unittests/Frontend/HLSLRootSignatureRangesTest.cpp
    M mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp
    A mlir/test/Dialect/XeGPU/xegpu-wg-to-sg-elemwise.mlir

  Log Message:
  -----------
  Merge branch 'users/quic-garvgupt/link_order' into users/quic-garvgupt/undefined


Compare: https://github.com/llvm/llvm-project/compare/beaabe6b3d1e...ec09d8368f79

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list