Skip to content

Conversation

@iclsrc
Copy link
Collaborator

@iclsrc iclsrc commented Nov 4, 2025

adrian-prantl and others added 30 commits October 27, 2025 12:43
…k LLVM IR (#165297)

This patch series renames these Objective-C property tests to something
more descriptive and adjusts them to check IR. Currently the tests check
raw assembly output (not even dwarfdump). Which most likely hid some
bugs around property debug-info.
New name makes it easer to find and checking IR is less likely to hide
bugs (and is more consistent with the other Clang debug-info tests).
00f5a1e added in some new tests that fail
under the profcheck configuration. We have not finished cleaning up
SimplifyCFG yet, so disable these tests for now.
  CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticDriverKinds.td
…n (#165046)

This options sets a compile option when building sources inside the
string directory, and this option affects string_utils.h. But
string_utils.h is #included from more places than just the string
directory (such as from __support/CPP/string.h), leading to both
narrow-reads in those cases, but more seriously, ODR violations when the
two different string_length implementations are included int he same
program.

Having this option at the top level avoids this problem.
This PR adds the code of Boost.Math as of version 1.89 into the
third-party directory, as discussed in a recent RFC [1].

The goal is for this code to be used as a back-end for the C++17
Math Special Functions.

As explained in third-paty/README.md, this code is cleared for
usage inside libc++ for the Math Special functions, however
the LLVM Foundation should be consulted before using this
code anywhere else in the LLVM project, due to the fact
that it is under the Boost Software License (as opposed
to the usual LLVM license). See the RFC [1] for more details.

[1]: https://discourse.llvm.org/t/rfc-libc-taking-a-dependency-on-boost-math-for-the-c-17-math-special-functions
`Reloc::length` actually encodes the log2 of the length. Thanks @int3
for pointing this out in
llvm/llvm-project#160894 (comment).

This code computes hashes of relocations. With the correct length, the
hashes should more accurately represent the relocation. In my testing of
some large binaries, the compressed size change is negligable.
So it's treated as a comment and doesn't need to be manually removed
from the output when used as IR.
llvm/llvm-project#162722 introduced a regression
that started creating initializers for CDEFINED variables. CDEFINED
variables cannot have initializers, because their storage is expected
come from elsewhere, likely outside of Fortran. Fixed the regression and
improved the regression test to catch the incorrect initialization case.

Also, based on the code review feedback, made CDEFINED variable
initialization a hard error and updated tests accordingly.
…175)

Started running `clang-tidy` on our clang-tidy headers. This part covers
what `clang-tidy` could fix automatically (with `--fix` option).

The main goal is to enable `HeaderFilterRegex:
'clang-tools-extra/clang-tidy/.*'` eventually in config.
In DXIL, some 64bit types are actually represented with their 32bit
counterpart. This was already being address in the codegen, however the
metadata generation was lacking this information. This PR is fixing this
issue.

Closes: [#146735](llvm/llvm-project#146735)
In `Driver.cpp` `std::atomic<uint64_t>` is used which may need
libatomic.

Build failure (if that is of interest):
```
[127/135] Linking CXX shared library lib/liblldMachO.so.20.1
ninja: job failed: : && /usr/lib/ccache/bin/clang++-20 -fPIC -Os -fstack-clash-protection -Wformat -Werror=format-security -D_GLIBCXX_ASSERTIONS=1 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -D_LIBCPP_ENABLE_HARDENED_MODE=1 -g -O2 -DNDEBUG -g1 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections  -Wl,--as-needed,-O1,--sort-common -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/user/aports/main/lld20/src/lld-20.1.5.src/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,liblldMachO.so.20.1 -o lib/liblldMachO.so.20.1 MachO/CMakeFiles/lldMachO.dir/Arch/ARM64.cpp.o MachO/CMakeFiles/lldMachO.dir/Arch/ARM64Common.cpp.o MachO/CMakeFiles/lldMachO.dir/Arch/ARM64_32.cpp.o MachO/CMakeFiles/lldMachO.dir/Arch/X86_64.cpp.o MachO/CMakeFiles/lldMachO.dir/ConcatOutputSection.cpp.o MachO/CMakeFiles/lldMachO.dir/Driver.cpp.o MachO/CMakeFiles/lldMachO.dir/DriverUtils.cpp.o MachO/CMakeFiles/lldMachO.dir/Dwarf.cpp.o MachO/CMakeFiles/lldMachO.dir/EhFrame.cpp.o MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o MachO/CMakeFiles/lldMachO.dir/ICF.cpp.o MachO/CMakeFiles/lldMachO.dir/InputFiles.cpp.o MachO/CMakeFiles/lldMachO.dir/InputSection.cpp.o MachO/CMakeFiles/lldMachO.dir/LTO.cpp.o MachO/CMakeFiles/lldMachO.dir/MapFile.cpp.o MachO/CMakeFiles/lldMachO.dir/MarkLive.cpp.o MachO/CMakeFiles/lldMachO.dir/ObjC.cpp.o MachO/CMakeFiles/lldMachO.dir/OutputSection.cpp.o MachO/CMakeFiles/lldMachO.dir/OutputSegment.cpp.o MachO/CMakeFiles/lldMachO.dir/Relocations.cpp.o MachO/CMakeFiles/lldMachO.dir/BPSectionOrderer.cpp.o MachO/CMakeFiles/lldMachO.dir/SectionPriorities.cpp.o MachO/CMakeFiles/lldMachO.dir/Sections.cpp.o MachO/CMakeFiles/lldMachO.dir/SymbolTable.cpp.o MachO/CMakeFiles/lldMachO.dir/Symbols.cpp.o MachO/CMakeFiles/lldMachO.dir/SyntheticSections.cpp.o MachO/CMakeFiles/lldMachO.dir/Target.cpp.o MachO/CMakeFiles/lldMachO.dir/UnwindInfoSection.cpp.o MachO/CMakeFiles/lldMachO.dir/Writer.cpp.o -L/usr/lib/llvm20/lib -Wl,-rpath,"\$ORIGIN/../lib:/usr/lib/llvm20/lib:/home/user/aports/main/lld20/src/lld-20.1.5.src/build/lib:"  lib/liblldCommon.so.20.1  /usr/lib/llvm20/lib/libLLVM.so.20.1 && :
/usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../powerpc-alpine-linux-musl/bin/ld: MachO/CMakeFiles/lldMachO.dir/Driver.cpp.o: in function `handleExplicitExports()':
/usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../include/c++/14.3.0/bits/atomic_base.h:501:(.text._ZL21handleExplicitExportsv+0xb8): undefined reference to `__atomic_load_8'
/usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../powerpc-alpine-linux-musl/bin/ld: /usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../include/c++/14.3.0/bits/atomic_base.h:501:(.text._ZL21handleExplicitExportsv+0x180): undefined reference to `__atomic_load_8'
/usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../powerpc-alpine-linux-musl/bin/ld: MachO/CMakeFiles/lldMachO.dir/Driver.cpp.o: in function `void llvm::function_ref<void (unsigned int)>::callback_fn<llvm::parallelForEach<lld::macho::Symbol* const*, handleExplicitExports()::$_0>(lld::macho::Symbol* const*, lld::macho::Symbol* const*, handleExplicitExports()::$_0)::{lambda(unsigned int)#1}>(int, unsigned int)':
/usr/lib/gcc/powerpc-alpine-linux-musl/14.3.0/../../../../include/c++/14.3.0/bits/atomic_base.h:631:(.text._ZN4llvm12function_refIFvjEE11callback_fnIZNS_15parallelForEachIPKPN3lld5macho6SymbolEZL21handleExplicitExportsvE3$_0EEvT_SC_T0_EUljE_EEvij+0xd4): undefined reference to `__atomic_fetch_add_8'
clang++-20: error: linker command failed with exit code 1 (use -v to see invocation)
```

CC @int3 @gkmhub @smeenai

Similar to
llvm/llvm-project@f0b451c
We shouldn't just consider the dynamic dimensions, but all output
dimensions for the value bounds constraints. The previous test just
worked because the dynamic dimension was on the first position.
…ction creation (#165315)

Should set the insertion point appropriately before we create an
instruction with IRBuilder.

Fixes: SWDEV-562571
…ofitable (#160483)

Skip the transform that replaces:
  %a = trunc i64 %x to i16
  %b = sext i16 %a to i32
with
  %a = trunc i64 %x to i32
  %b = shl i32 %a, 16
  %c = ashr exact i32 %b, 16
when (pre-trunc) source type is wider than the final destination type.
Modern architectures typically have efficient sign-extend instruction.
It is preferable to preserve the sext for this case.

Resolves #116019

Also fold sext(trunc nsw) to trunc nsw when narrowing source.
--[no-]offloadlib option is used by rocm and cuda toolchain to
enable/disable device libraries in linking phase for device code. It
makes sense to re-use this option in SYCL for similar purpose and since
clang driver supports SYCL in CL compatibility mode, we also need to
enable this option in CL compatibility mode.

---------

Signed-off-by: jinge90 <ge.jin@intel.com>
…d. (#165305)

`MCInstrDesc` counts the SWZ operand for `NumOperands` -- thus, since we
do not parse this into the `MCInst` operands, there will be a mismatch
between `MCInst.getNumOperands` and `MCInstrDesc.getNumOperands` .

`llvm-mca` assumes that each operand counted by
`MCInstrDesc.getNumOperands` will be present in `MCInst.operands`
https://github.com/llvm/llvm-project/blob/263377a17570e1cbe6eeae9ffa5ce02f240839ef/llvm/lib/MCA/InstrBuilder.cpp#L324

This parses a dummy operand for the buffer_loads as a placeholder for
the implicit SWZ operand. This is similar to the parsing of `tbuffer_`
variants which automatically parse the dummy operand
https://github.com/llvm/llvm-project/blob/263377a17570e1cbe6eeae9ffa5ce02f240839ef/llvm/utils/TableGen/AsmMatcherEmitter.cpp#L1853
@jsji
Copy link
Contributor

jsji commented Nov 7, 2025

@sarnex
Copy link
Contributor

sarnex commented Nov 10, 2025

ESIMD LGTM

@premanandrao
Copy link
Contributor

The CFE changes highlighted above look okay to me.

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUDA, HIP and NativeCPU LGTM!

@jsji
Copy link
Contributor

jsji commented Nov 11, 2025

@intel/llvm-gatekeepers This is ready for merge. Can someone help to issue /merge? Thanks!

@sarnex
Copy link
Contributor

sarnex commented Nov 11, 2025

@jsji Looks like there's a new conflict, can you resolve it? Thx

@jsji
Copy link
Contributor

jsji commented Nov 12, 2025

@intel/llvm-gatekeepers This is ready for merge again. Can someone help to issue /merge? Thanks!

@steffenlarsen
Copy link
Contributor

/merge

@jsji
Copy link
Contributor

jsji commented Nov 12, 2025

/merge

Thanks for issuing the command line. Looks like there is some issue with the automation again. @sarnex

@sarnex
Copy link
Contributor

sarnex commented Nov 12, 2025

/merge

@sarnex
Copy link
Contributor

sarnex commented Nov 12, 2025

@jsji If it doesn't work can you send me the safe git commands to do it manually? Thx

@sarnex sarnex merged commit c64a9b4 into sycl Nov 12, 2025
79 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable-lint Skip linter check step and proceed with build jobs

Projects

None yet

Development

Successfully merging this pull request may close these issues.