[Offload] Fix build install directory and remove 'add_llvm_library' (#198622)
Summary:
The problem is that we do not correctly set the build directory output
for offload/. Normally, it's supposed to mirror the install pattern.
This is because we both have variants and so people can use the compiler
from the build directory.
Currently, if you build more than one variant of the offload/ library
they will clobber each-other in `<build>/lib/`, so no cross compiling
allowed. Additionally, these will not be usable in the build directory
because the compiler will think that they are in the triple directory
when they are not.
Relatively simple fix, just copy-paste the pattern every other runtime
uses and then remove the implicit handling we get from
`add_llvm_libraries`. The only this it did for us was automatically map
component names to the libraries, which is easy enough to do.
[VPlan] Sink VPRecipeValue dtors. (#198623)
Currently (after https://github.com/llvm/llvm-project/pull/195483) the
VPRecipeValue accesses the defining value and removes it. This can cause
uninitialized memory reads, because the Def pointer held by the
VPMultiDefValue is destroyed before the super class destructor runs.
fix: tcsh: add missing exportpath() prototype to sh.decls.h
GCC 15 treats implicit function declarations as errors.
exportpath() is defined in sh.set.c but had no prototype,
causing a build failure with -Werror=implicit-function-declaration.
[libc][freebsd] initialize freebsd support (#124459)
Initialize FreeBSD support. Currently, only overlay build (mainly math
routines) is supported.
This PR mainly define the target entrypoints and basic syscall support.
Different from Linux, FreeBSD's syscall return always consist of two
component:
- return value as arch register
- error flag
On x86-64, the flag is returned via the carry bit state. Hence, for
syscall stubs, we always return a structure containing these two fields.
For math support, the only big difference is that FreeBSD has different
naming convention in some exception macros.
Further fixes for C++ userland are tracked in #197605
Assisted-by: Codex with gpt-5.5 high fast
[lldb-dap] Fall back to name when arguments are missing (#198626)
When `lldb-dap --list-processes` omits the `arguments` field for a
process, fall back to `name` (matching the `command` field's fallback)
instead of an empty string. This keeps the process picker from showing
blank entries for processes whose full command line is unavailable.
clang: Refactor handling of offload sanitizer arguments
Previously the AMDGPU toolchains hackily handled -fsanitize arguments.
They would lie and report that all host side sanitizers are available,
then TranslateArgs would filter out the device side cases that do not
work, providing diagnostics for the skipped cases. Move that logic
into the base sanitizer argument parsing.
This makes the produced diagnostics more consistent. Previously we
would get repeated warnings when a sanitizer is fully unsupported
by amdgpu, which should now be once for the toolchain. These could
be further improved; we're printing the specific field of -fsanitize
in more cases where it could be skipped. In other cases we have the
opposite problem, where we aren't reporting the exact sanitizer
from the -f flag in the case that depends on a subtarget feature.
This will help fix other broken target specific flag forwarding bugs
in the future.
Co-authored-by: Claude Sonnet 4 <noreply at anthropic.com>
clang/AMDGPU: Use TranslateArgs from the base toolchain instead of the host
This fixes -Xopenmp-target / -Xarch for arbitrary arguments. HIP and OpenMP
had cargo-cult broken implementations of TranslateArgs, which called the host
toolchain's implementation, and then special case transferred either -march
or -mcpu to the device argument list. The respective device forwarding flags
should work for any argument, not just this one. The main feature that needs
to be preserved is the shared filtering of unsupported sanitizers to degrade
them into warnings.
Most of the changes here are dealing with fallout observed when
the host target is darwin. The darwin toolchain happens to have
some hacky statefulness tracking the compile target version, which
gets written and rewritten on argument parsing. To maintain this hack,
there are a few unused calls to getArgsForToolChain; start passing OFK_Host
to these so the offload toolchains don't get confused and think they're in
a non-offload context.
clang: Add BoundArch/OffloadKind argument to getSupportedSanitizers
Currently the AMDGPU HIP and OpenMP toolchains falsely report
all host sanitizers are supported, and then go out of their way
to skip forwarding those to the device compiles. Add an offloading
kind argument so that in the future this can be handled in one
place in the base toolchain.
Co-authored-by: Claude Sonnet 4 <noreply at anthropic.com>
databases/rocksdb: Fix build with PIE
RocksDB's build_detect_platform sets PROFILING_FLAGS=-pg when the compiler
supports it. The two benchmark targets table_reader_bench and log_write_bench
are then linked with -pg, which causes the linker to pull in FreeBSD's gcrt1.o
(the profiling CRT). gcrt1.o contains R_X86_64_64 absolute relocations that are
incompatible with -pie, resulting in a link failure when WITH_PIE=yes is set.
PR: 295260
Approved by: sunpoet (maintainer)
Sponsored by: Netflix
[AMDGPU] Enable support for Wave64 on gfx13
This is a temporary workaround needed to unblock ongoing GFX13-related
changes. This will be removed by https://github.com/llvm/llvm-project/pull/197991
powerpc: Remove stale include line from MPC85XX
The stale include line caused config -m to fail with an error trying
to parse the config file during make universe/tinderbox which in turn
caused universe/tinderbox to abort without building any powerpc
kernels (or subsequent architectures such as riscv64) with the error:
make[2]: freebsd/main/Makefile:767: Target architecture for powerpc/conf/MPC85XX unknown. config(8) likely too old.
in .for loop from freebsd/main/Makefile:761 with kernel = MPC85XX
in make[2] in directory "freebsd/main"
make[2]: stopped making "universe_kernels" in freebsd/main
*** Error code 1
Reported by: npn, many others
Fixes: fd8d34ce272b ("dpaa: Migrate from NCSW base to a home-grown driver")
[VectorCombine] Fold reduce.add == 0 into reduce.[or,umax] == 0 (#180001)
When vector elements are known to be either non-positive (e.g., from
sext i1), or non-negative (e.g., from zext i1), comparing the sum
against zero is equivalent to checking if all elements are zero. This
can be done more efficiently using reduce.or or reduce.umax.
science/v_sim: fix plist
It seems that Python files are not always installed at the same location
depending on the platform.
Since I’m there register missing dependencies with minor improvements.
PR: 295393
Reported by: D. Engberg
[LifetimeSafety] Propagate loans through chained assignment (#198510)
Now, `handleAssignment` also propagates loans into the assignment
expression (`BinaryOperator`/`CXXOperatorCallExpr`) so chained
assignments can flow loans forward.
Closes #198497