LLVM/project 9f839a4llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[SLP][NFC]Fix non-determinism in pointers comparison, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/210216
DeltaFile
+13-8llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+13-81 files

LLVM/project 398f211clang/test/Analysis/Scalable/ssaf-linker static-library-create.test static-library-help.test, clang/test/Analysis/Scalable/ssaf-linker/Outputs libtwo.json

[clang][ssaf] Add static-library create subcommand (#208799)

This change adds `clang-ssaf-linker static-library create` for bundling
TU summaries into a StaticLibrary archive. The linker has been
refactored to dispatch on `cl::SubCommand`; invocations without a
subcommand still run the existing linker pipeline unchanged for backward
compatibility.

rdar://181930526
DeltaFile
+640-0clang/test/Analysis/Scalable/ssaf-linker/Outputs/libtwo.json
+191-0clang/tools/clang-ssaf-linker/StaticLibraryCreateCLI.cpp
+106-27clang/tools/clang-ssaf-linker/SSAFLinker.cpp
+114-0clang/test/Analysis/Scalable/ssaf-linker/static-library-create.test
+103-0clang/tools/clang-ssaf-linker/StaticLibraryCreateCLI.h
+24-0clang/test/Analysis/Scalable/ssaf-linker/static-library-help.test
+1,178-279 files not shown
+1,301-3215 files

LLVM/project 6b99290bolt/docs profiles.md, bolt/include/bolt/Profile DataReader.h

[BOLT] Add fdata symbols mode (#209932)

Add a new fdata profile mode accepting symbol names as-is.

It addresses the UX gap surfaced by #208313 that all methods of selecting
functions to process (symbolized profile types, `-funcs*` options) expect
disambiguated local symbols. 

Introduce fdata mode activated by a `symbols` header line, where each subsequent
line is a (mangled) symbol name. The names are matched against restored function
names (with disambiguation suffix stripped), and every matching function gets an
execution count of 1. 

This can be used to drive selective instrumentation (`--instrument-hot-only`) or
basic linker-script style optimizations.

Symbols are stored as branch entry data so matching reuses the existing default
branch profile path.

Test Plan:
Update docs/profiles.md and add profile-symbols-mode.s
DeltaFile
+71-0bolt/test/X86/profile-symbols-mode.s
+51-5bolt/lib/Profile/DataReader.cpp
+22-0bolt/docs/profiles.md
+11-1bolt/include/bolt/Profile/DataReader.h
+155-64 files

LLVM/project 5658411clang/lib/CodeGen/Targets SPIR.cpp, clang/test/CodeGenHLSL/resources RWBuffer-imageformat.hlsl

[SPIRV] Pack 64-bit vec2 typed buffers into 4x32-bit images (#208626)
DeltaFile
+43-14llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+26-0llvm/test/CodeGen/SPIRV/hlsl-resources/SignedBufferLoadStore.ll
+26-0llvm/test/CodeGen/SPIRV/hlsl-resources/UnsignedBufferLoadStore.ll
+11-0clang/lib/CodeGen/Targets/SPIR.cpp
+2-2clang/test/CodeGenHLSL/resources/RWBuffer-imageformat.hlsl
+108-165 files

LLVM/project eafc387orc-rt/include CMakeLists.txt, orc-rt/include/orc-rt CCallback.h

[orc-rt] Add asCCallback utility -- C callbacks for methods. (#210048)

Adds orc_rt::asCCallback<&Class::method>, which produces a C-ABI
function pointer that forwards to the given member function. The first
parameter of the generated trampoline is an opaque context pointer (
void * for non-const methods, const void * for const methods) that is
cast back to the class type and used as the receiver:

  struct Counter {
    void inc(int N) { Count += N; }
    int Count = 0;
  };

  Counter C;
  void (*CB)(void *, int) = asCCallback<&Counter::inc>;
  CB(asCCallbackContext<&Counter::inc>(C), 2); // C.Count == 2

asCCallbackContext produces the matching context pointer via
static_cast, so any base-class offset is applied and const-ness is

    [9 lines not shown]
DeltaFile
+129-0orc-rt/test/unit/CCallbackTest.cpp
+122-0orc-rt/include/orc-rt/CCallback.h
+1-0orc-rt/include/CMakeLists.txt
+1-0orc-rt/test/unit/CMakeLists.txt
+253-04 files

LLVM/project a45ae4clibc/src/__support/FPUtil Hypot.h, libc/src/__support/math hypot.h

[libc][math] Fix double-rounding errors with denormal inputs for hypot function. (#208247)

The issue was reported by Paul Zimmermann.

Solution: for denormal inputs, we use 1.0 + x trick after proper scaling
to mimick rounding at denormal scale.
DeltaFile
+111-6libc/src/__support/math/hypot.h
+17-8libc/src/__support/FPUtil/Hypot.h
+13-0libc/test/src/math/smoke/hypot_test.cpp
+141-143 files

LLVM/project 611d015llvm/utils/gn README.rst, llvm/utils/gn/build BUILDCONFIG.gn

gn build: Support building debug binaries from a release build directory.

This change makes it so that all binaries in `bin` have a corresponding
debug binary target `$TARGET.dbg` that will build a debug binary in
`bin.dbg/$TARGET`. This is implemented using a separate toolchain for
the debug builds. This has the following advantages over a separate
debug build directory:

1. Can use release mode tblgen to generate code for the debug build
   binaries, which speeds up the build because it can run tblgen faster as
   well as being able to reuse the tblgen binary from the release build.

2. Can reuse runtimes built in the release mode clang's resource
   directory, avoiding the need to build them again with a slow debug
   build of clang.

Assisted-by: gemini

Reviewers: aeubanks, nico

    [3 lines not shown]
DeltaFile
+408-402llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+50-42llvm/utils/gn/secondary/BUILD.gn
+37-28llvm/utils/gn/secondary/clang-tools-extra/clang-doc/tool/BUILD.gn
+41-14llvm/utils/gn/build/toolchain/BUILD.gn
+23-13llvm/utils/gn/build/BUILDCONFIG.gn
+16-5llvm/utils/gn/README.rst
+575-50424 files not shown
+616-53230 files

LLVM/project 03ab16cbolt/docs BOLTAArch64OptimizationStatus.md GettingStarted.md

[docs] Finish MyST migration for BOLT docs (#210199)

Tracking issue: #201242
See the [migration guide] for more information. 

[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is a stacked PR based on #210198, which will be a standalone commit
that
renames *.rst -> *.md before this PR lands for history preservation
purposes.

This was prepared with rst2myst plus LLM-assisted cleanup. I paged
through all the generated HTML looking for migration artifacts, and all
of the differences I could find appear to be formatting error
corrections. Please spot check my work and approve if it looks good. You
can use the HTML links below to confirm it renders properly.

-----

    [18 lines not shown]
DeltaFile
+116-116bolt/docs/BOLTAArch64OptimizationStatus.md
+86-103bolt/docs/GettingStarted.md
+32-31bolt/docs/index.md
+234-2503 files

LLVM/project 565ef24llvm/lib/Target/WebAssembly WebAssemblyCleanCodeAfterTrap.cpp WebAssembly.h

[WebAssembly] Port WebAssemblyCleanCodeAfterTrapPass

Standard NewPM pass porting.

Reviewers: sbc100, dschuff, aheejin

Pull Request: https://github.com/llvm/llvm-project/pull/209892
DeltaFile
+23-7llvm/lib/Target/WebAssembly/WebAssemblyCleanCodeAfterTrap.cpp
+10-2llvm/lib/Target/WebAssembly/WebAssembly.h
+2-2llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+2-0llvm/lib/Target/WebAssembly/WebAssemblyPassRegistry.def
+1-1llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+38-125 files

LLVM/project 49a1341clang/docs DebuggingCoroutines.rst DebuggingCoroutines.md, llvm/test/CodeGen/AArch64 sve-fixed-length-fp-extend-bf16.ll sve-fixed-length-fp-extend-trunc-bf16.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+0-1,295clang/docs/DebuggingCoroutines.rst
+1,270-0clang/docs/DebuggingCoroutines.md
+852-327llvm/test/Transforms/LoopIdiom/cyclic-redundancy-check.ll
+0-1,007clang/docs/BoundsSafety.rst
+994-0llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-bf16.ll
+0-994llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-trunc-bf16.ll
+3,116-3,6231,102 files not shown
+37,381-16,6241,108 files

LLVM/project d0dd060llvm/test/CodeGen/AMDGPU llvm.amdgcn.intersect_ray.ll llvm.amdgcn.exp.compr.ll, llvm/test/CodeGen/AMDGPU/GlobalISel llvm.amdgcn.intersect_ray.ll

[NFC] Use new target triple for some tests (#210202)

They were mistakenly reverted back to the old ones.
DeltaFile
+15-15llvm/test/CodeGen/AMDGPU/llvm.amdgcn.intersect_ray.ll
+6-6llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.compr.ll
+5-5llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.intersect_ray.ll
+4-4llvm/test/CodeGen/AMDGPU/llvm.amdgcn.dual_intersect_ray.ll
+2-2llvm/test/CodeGen/AMDGPU/s-wakeup-barrier.ll
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.tanh.ll
+34-341 files not shown
+35-357 files

LLVM/project 2494e80llvm/lib/Target/WebAssembly WebAssemblyFixBrTableDefaults.cpp WebAssembly.h

[WebAssembly] Port WebAssemblyFixBrTableDefaultsPass

Standard NewPM pass porting.

Reviewers: dschuff, sbc100, aheejin

Pull Request: https://github.com/llvm/llvm-project/pull/209882
DeltaFile
+22-7llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp
+10-2llvm/lib/Target/WebAssembly/WebAssembly.h
+3-3llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+1-1llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+2-0llvm/lib/Target/WebAssembly/WebAssemblyPassRegistry.def
+38-135 files

LLVM/project 0fc03f0bolt/docs GettingStarted.md GettingStarted.rst

[bolt][docs] Rename BOLT docs to Markdown (#210198)

Tracking issue: #201242
See the [migration guide] for more information. 

[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines

This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
DeltaFile
+255-0bolt/docs/GettingStarted.md
+0-255bolt/docs/GettingStarted.rst
+145-0bolt/docs/BOLTAArch64OptimizationStatus.md
+0-145bolt/docs/BOLTAArch64OptimizationStatus.rst
+0-46bolt/docs/index.rst
+46-0bolt/docs/index.md
+446-4466 files

LLVM/project 8419be1clang/docs DebuggingCoroutines.rst DebuggingCoroutines.md, llvm/test/CodeGen/AArch64 sve-fixed-length-fp-extend-trunc-bf16.ll sve-fixed-length-fp-extend-bf16.ll

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+0-1,295clang/docs/DebuggingCoroutines.rst
+1,270-0clang/docs/DebuggingCoroutines.md
+852-327llvm/test/Transforms/LoopIdiom/cyclic-redundancy-check.ll
+0-1,007clang/docs/BoundsSafety.rst
+0-994llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-trunc-bf16.ll
+994-0llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-bf16.ll
+3,116-3,6231,096 files not shown
+36,935-16,1781,102 files

LLVM/project 5337314llvm/lib/Target/WebAssembly WebAssemblySetP2AlignOperands.cpp WebAssembly.h

[WebAssembly] Port WebAssemblySetP2AlignOperandsPass

Standard NewPM pass porting.

Reviewers: dschuff, sbc100, aheejin

Pull Request: https://github.com/llvm/llvm-project/pull/209871
DeltaFile
+23-7llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp
+10-2llvm/lib/Target/WebAssembly/WebAssembly.h
+3-3llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+2-0llvm/lib/Target/WebAssembly/WebAssemblyPassRegistry.def
+1-1llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+39-135 files

LLVM/project 89db17fcompiler-rt/docs ASanABI.md BuildingCompilerRT.md, libsycl/docs index.md

[docs] Finish MyST migration for selected docs
DeltaFile
+33-33compiler-rt/docs/ASanABI.md
+21-31libunwind/docs/BuildingLibunwind.md
+21-23llvm-libgcc/docs/LLVMLibgcc.md
+18-26compiler-rt/docs/BuildingCompilerRT.md
+4-5libsycl/docs/index.md
+2-2compiler-rt/docs/TestingGuide.md
+99-1205 files not shown
+108-12811 files

LLVM/project 3f93f26compiler-rt/docs ASanABI.md BuildingCompilerRT.md, libsycl/docs index.md CodingGuidelines.md

[docs] Finish MyST migration for selected docs
DeltaFile
+33-33compiler-rt/docs/ASanABI.md
+21-31libunwind/docs/BuildingLibunwind.md
+18-26compiler-rt/docs/BuildingCompilerRT.md
+16-17llvm-libgcc/docs/LLVMLibgcc.md
+4-5libsycl/docs/index.md
+2-2libsycl/docs/CodingGuidelines.md
+94-1145 files not shown
+103-12211 files

LLVM/project 26c7a45compiler-rt/docs ASanABI.md, flang/docs/CommandGuide index.md

[docs] Convert selected rst docs with rst2myst
DeltaFile
+109-101libsycl/docs/index.md
+66-83llvm-libgcc/docs/LLVMLibgcc.md
+40-50libunwind/docs/index.md
+50-34libunwind/docs/BuildingLibunwind.md
+43-39flang/docs/CommandGuide/index.md
+38-40compiler-rt/docs/ASanABI.md
+346-3475 files not shown
+465-45811 files

LLVM/project e7a6e0dlibsycl/docs index.md index.rst, libunwind/docs BuildingLibunwind.md BuildingLibunwind.rst

[docs] Rename misc rst docs to md
DeltaFile
+187-0llvm-libgcc/docs/LLVMLibgcc.md
+0-187llvm-libgcc/docs/LLVMLibgcc.rst
+140-0libsycl/docs/index.md
+0-140libsycl/docs/index.rst
+133-0libunwind/docs/BuildingLibunwind.md
+0-133libunwind/docs/BuildingLibunwind.rst
+460-46022 files not shown
+978-97528 files

LLVM/project 71a7c24llvm/test/MC/Hexagon relax-align.s

[Hexagon] Add MC lit test for dropped fixups after packet relaxation (#210157)

Test that a branch fixup is preserved when MC relaxes a packet
containing a conditional compare-and-jump due to a following .p2align
directive. Regression test for issue #163851.
DeltaFile
+29-0llvm/test/MC/Hexagon/relax-align.s
+29-01 files

LLVM/project 396d255llvm/lib/Target/WebAssembly/MCTargetDesc WebAssemblyInstPrinter.cpp, llvm/test/MC/Disassembler/WebAssembly wasm.txt

[WebAssembly] Don't assert on a non-zero call_indirect table index (#210120)

WebAssemblyInstPrinter::printInst asserted that a non-symbol table
operand of call_indirect is the immediate 0, on the assumption that only
MVP single-table compilation units reach the printer. That is true for
code generated by the compiler, but the printer is shared by the
disassembler.

The disassembler must produce output for any byte sequence it is pointed
at and shouldn't abort on the operand values it decodes. A non-zero
immediate table index is both a valid encoding, from a multi-table
module, and a routine result of best-effort disassembly of a range that
is not all code, which is how I hit this in LLDB.

Print the table operand when it is a symbol or a non-zero immediate, and
omit it only for the implicit table 0. This makes the output lossless
and unambiguous, matching how a table symbol is already printed. MVP and
table-symbol output are unchanged, so there is no effect on the
compiler's assembly.
DeltaFile
+9-8llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
+5-0llvm/test/MC/Disassembler/WebAssembly/wasm.txt
+14-82 files

LLVM/project e5c143fllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer sub-nsw-icmp-eq-zero-reorder.ll

[SLP]Drop nsw when reordering a sub feeding icmp eq/ne 0

A sub used only by icmp eq/ne 0 is treated as commutative, so SLP may
swap its operands, and nsw does not survive a - b -> b - a (a - b can
be INT_MIN while b - a overflows).

Fixes #210177

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/210205
DeltaFile
+15-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+1-1llvm/test/Transforms/SLPVectorizer/sub-nsw-icmp-eq-zero-reorder.ll
+16-12 files

LLVM/project eb819b9llvm/test/Transforms/SLPVectorizer sub-nsw-icmp-eq-zero-reorder.ll

[SLP][NFC]Add a test with incorrect nsw in reordered sub feeding equal cmp, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/210204
DeltaFile
+43-0llvm/test/Transforms/SLPVectorizer/sub-nsw-icmp-eq-zero-reorder.ll
+43-01 files

LLVM/project 0a0fdfdllvm/test/CodeGen/AMDGPU llvm.amdgcn.intersect_ray.ll llvm.amdgcn.exp.compr.ll, llvm/test/CodeGen/AMDGPU/GlobalISel llvm.amdgcn.intersect_ray.ll

[NFC] Use new target triple for some tests

They were mistakenly reverted back to the old ones.
DeltaFile
+15-15llvm/test/CodeGen/AMDGPU/llvm.amdgcn.intersect_ray.ll
+6-6llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.compr.ll
+5-5llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.intersect_ray.ll
+4-4llvm/test/CodeGen/AMDGPU/llvm.amdgcn.dual_intersect_ray.ll
+2-2llvm/test/CodeGen/AMDGPU/llvm.amdgcn.tanh.ll
+2-2llvm/test/CodeGen/AMDGPU/s-wakeup-barrier.ll
+34-341 files not shown
+35-357 files

LLVM/project 3cfb013bolt/docs BOLTAArch64OptimizationStatus.md GettingStarted.md

[docs] Finish MyST migration for selected docs
DeltaFile
+103-108bolt/docs/BOLTAArch64OptimizationStatus.md
+9-10bolt/docs/GettingStarted.md
+112-1182 files

LLVM/project 092ac9clldb/docs/resources test.md, lldb/packages/Python/lldbsuite/support xcode.py

[lldb][test] Allow dotest.py to call for Xcode to attach (#209628)

This speeds up the debugging of API tests a little on macOS.

(AppleScript written by Claude based on Xcode.sdef)
DeltaFile
+24-0lldb/packages/Python/lldbsuite/support/xcode.py
+7-2lldb/packages/Python/lldbsuite/test/dotest.py
+7-0lldb/packages/Python/lldbsuite/test/dotest_args.py
+5-1lldb/docs/resources/test.md
+43-34 files

LLVM/project 205a662clang/lib/Driver/ToolChains MinGW.cpp, clang/test/Driver mingw-sysroot.cpp

[clang][mingw] Try both native and ARM64EC triples when looking for a sysroot on the ARM64EC target (#210017)

Similarly to MSVC, a MinGW toolchain may provide support for both ARM64
and ARM64EC in a single sysroot. Structuring the toolchain this way has
the additional advantage of seamlessly supporting linking ARM64X images.

Support this configuration in findClangRelativeSysroot.
DeltaFile
+20-0clang/test/Driver/mingw-sysroot.cpp
+15-0clang/lib/Driver/ToolChains/MinGW.cpp
+35-02 files

LLVM/project 5ed5468llvm/lib/Transforms/Scalar LoopStrengthReduce.cpp

[NFC][LSR] Remove duplicate debug expression update (#210188)

Remove duplicate debug expression update we assigned
the same DIExpression twice so let's just remove the redundant call.

Tested via make check.

Assisted by AI.
DeltaFile
+0-1llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+0-11 files

LLVM/project bd0395elibc/src/sys/time gettimeofday.h, libc/src/sys/time/linux gettimeofday.cpp

[libc] Move gettimeofday to sys/time.h header. (#210185)

`gettimeofday` is supposed to be declared in the `<sys/time.h>` header,
not the `<time.h>` where we've had it previously. Move the declaration
to the correct header, and move the files with implementation and unit
tests accordingly.

Note that `gettimeofday` is removed removed from POSIX-2024, but let's
keep it available for now, since there's fair amount of existing code
that still uses it.
DeltaFile
+46-0libc/src/sys/time/linux/gettimeofday.cpp
+0-42libc/src/time/linux/gettimeofday.cpp
+26-0libc/test/src/sys/time/gettimeofday_test.cpp
+26-0libc/src/sys/time/gettimeofday.h
+0-21libc/src/time/gettimeofday.h
+0-17libc/test/src/time/gettimeofday_test.cpp
+98-8012 files not shown
+140-12718 files

LLVM/project 5978ac0llvm/lib/CodeGen/AsmPrinter DwarfExpression.cpp

[NFC] Inline DwarfExpression frame register check (#210186)

Inline DwarfExpression frame register check as it's the only call.

Tested via make check.

Assisted by AI.
DeltaFile
+1-2llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+1-21 files