7775 Commits

Author SHA1 Message Date
Qihan Cai
5f0515debd
[RISCV] Support Remaining P Extension Instructions for RV32/64 (#150379)
This patch implements pages 15-17 from
jhauser.us/RISCV/ext-P/RVP-instrEncodings-015.pdf

Documentation:
jhauser.us/RISCV/ext-P/RVP-baseInstrs-014.pdf
jhauser.us/RISCV/ext-P/RVP-instrEncodings-015.pdf
2025-08-20 22:54:07 +10:00
petergrind3
27f32831b9
[lanai] Add back the ability to set the memory model with --mcmodel. (#150575)
This ability got removed at some point but is still needed to select specific modes for Lanai backend. Add back with simple frontend smoke test.
2025-08-20 09:05:23 +02:00
Phoebe Wang
99a1d5f7fa
[X86][APX] Remove CF feature from APXF and Diamond Rapids (#153751)
Due to it results in more losses than gains.
2025-08-20 03:07:56 +00:00
Oliver Hunt
19c4e86f3e
[clang][PAC][darwin] Set correct default ptrauth features for arm64e-darwin (#153722)
This PR makes sure that when targeting arm64e on darwin platforms the
correct flags are set for the userspace platform ABI.
2025-08-19 17:31:14 -07:00
Frederik Harwath
f1e56ac032
Revert "[Clang] Take libstdc++ into account during GCC detection" (#154368)
Reverts llvm/llvm-project#145056
2025-08-19 16:35:58 +00:00
Frederik Harwath
50a3368f22
[Clang] Take libstdc++ into account during GCC detection (#145056)
The Generic_GCC::GCCInstallationDetector class picks the GCC
installation directory with the largest version number. Since the
location of the libstdc++ include directories is tied to the GCC
version, this can break C++ compilation if the libstdc++ headers for
this particular GCC version are not available. Linux distributions tend
to package the libstdc++ headers separately from GCC. This frequently
leads to situations in which a newer version of GCC gets installed as a
dependency of another package without installing the corresponding
libstdc++ package. Clang then fails to compile C++ code because it
cannot find the libstdc++ headers. Since libstdc++ headers are in fact
installed on the system, the GCC installation continues to work, the
user may not be aware of the details of the GCC detection, and the
compiler does not recognize the situation and emit a warning, this
behavior can be hard to understand - as witnessed by many related bug
reports over the years.

The goal of this work is to change the GCC detection to prefer GCC
installations that contain libstdc++ include directories over those
which do not. This should happen regardless of the input language since
picking different GCC installations for a build that mixes C and C++
might lead to incompatibilities.
Any change to the GCC installation detection will probably have a
negative impact on some users. For instance, for a C user who relies on
using the GCC installation with the largest version number, it might
become necessary to use the --gcc-install-dir option to ensure that this
GCC version is selected.
This seems like an acceptable trade-off given that the situation for
users who do not have any special demands on the particular GCC
installation directory would be improved significantly.
 
This patch does not yet change the automatic GCC installation directory
choice. Instead, it does introduce a warning that informs the user about
the future change if the chosen GCC installation directory differs from
the one that would be chosen if the libstdc++ headers are taken into
account.

See also this related Discourse discussion:
https://discourse.llvm.org/t/rfc-take-libstdc-into-account-during-gcc-detection/86992.
2025-08-19 16:55:45 +02:00
Naveen Seth Hanig
9403c2d64d
Reland [clang][modules-driver] Add scanner to detect C++20 module presence (#153497)
This patch is part of a series to support driver managed module builds
for C++ named modules and Clang modules.
This introduces a scanner that detects C++ named module usage early in
the driver with only negligible overhead.

For now, it is enabled only with the `-fmodules-driver` flag and serves
solely diagnostic purposes. In the future, the scanner will be enabled
for any (modules-driver compatible) compilation with two or more inputs,
and will help the driver determine whether to implicitly enable the
modules driver.

Since the scanner adds very little overhead, we are also exploring
enabling it for compilations with only a single input. This approach
could allow us to detect `import std` usage in a single-file
compilation, which would then activate the modules driver. For
performance measurements on this, see
https://github.com/naveen-seth/llvm-dev-cxx-modules-check-benchmark.

RFC for driver managed module builds:

https://discourse.llvm.org/t/rfc-modules-support-simple-c-20-modules-use-from-the-clang-driver-without-a-build-system

This patch relands the reland (2d31fc8) for commit ded1426. The earlier
reland failed due to a missing link dependency on `clangLex`. This
reland fixes the issue by adding the link dependency after discussing it
in the following RFC:

https://discourse.llvm.org/t/rfc-driver-link-the-driver-against-clangdependencyscanning-clangast-clangfrontend-clangserialization-and-clanglex
2025-08-18 21:21:08 +02:00
林克
6842cc5562
[RISCV] Add SpacemiT XSMTVDot (SpacemiT Vector Dot Product) extension. (#151706)
The full spec can be found at spacemit-x60 processor support scope:
Section 2.1.2.2 (Features):

https://developer.spacemit.com/documentation?token=BWbGwbx7liGW21kq9lucSA6Vnpb#2.1

This patch only supports assembler.
2025-08-18 18:03:17 +08:00
Craig Topper
e67ec12640
[RISCV] Remove experimental from Smctr and Ssctr. (#153903)
These extensions were ratified in November 2024.
2025-08-15 17:18:09 -07:00
Stanislav Mekhanoshin
57c1e01e48
[AMDGPU] Don't allow wgp mode on gfx1250 (#153680)
- gfx1250 only supports cu mode
2025-08-14 15:16:56 -07:00
Joseph Huber
dedc5916a5
[LinkerWrapper] Remove special handling for archives (#114843)
Summary:
Previously we extracted archives and did special symbol resolution on
them, this was mostly done because the nvlink executable couldn't handle
archives natively. Since I have added a wrapper around it that handles
that, we can now remove a lot of this complexity and just create a new
archive and pass it to the device linker.

The one issue here is that for offloading code, we often have references
to kernels that do not come from the device link job, but from the host
that wishes to call them. Under normal circumstances we would ignore
them because they are not referenced, but we need them. For now I am
just passing `--whole-archive`. In a future patch I will likely add some
logic to create a linker script that will tell the linker which symbols
we want to be extracted. That won't work for NVPTX but it's the most
canonical solution.

Also some ugliness in this patch where I need to juggle whether or not
the input is an archive and throw pairs around, I may merge that into
the `OffloadFile` struct in a later patch.
2025-08-13 14:24:47 -05:00
Nick Sarnie
116c318225
[Clang][Driver] Don't pass -mllvm to the linker for non-LLVM offloading toolchains (#153272)
When determining what arguments to pass to `clang-linker-wrapper` as
device linker args, don't forward `-mllvm` args if the offloading
toolchain doesn't have native LLVM support.

I saw this when working with SPIR-V, we were trying to pass `-mllvm` to
`spirv-link`.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-08-12 21:41:00 +00:00
Florian Mayer
3f6c0e62d5
[clang][KCFI] Respect -fsanitize-cfi-icall-generalize-pointers (#152400)
This flag was previously ignored by KCFI.
2025-08-11 17:21:13 -07:00
Ahmed Bougacha
69d141712a
[AArch64] Bump default CPUs for iOS 26/watchOS 26 to A12/S6. (#152235)
iOS 26/watchOS 26 deprecate some devices, allowing the default CPU to be
raised based on the deployment target.

watchOS 26 also introduces arm64 (vs. arm64_32/arm64e).

The defaults are now:
- arm64-apple-ios26         apple-a12
- arm64-apple-watchos26     apple-s6
- arm64_32-apple-watchos26  apple-s6
- arm64e-apple-watchos26    apple-s6

Left unchanged are:
- arm64-apple-tvos26        apple-a7
- arm64e-apple-tvos26       apple-a12
- arm64e-apple-ios26        apple-a12
- arm64_32-apple-watchos11  apple-s4

While there, rewrite an outdated comment in a related Mac test.
2025-08-11 11:39:16 -07:00
Garvit Gupta
585f27ccbd
Add necessary linker flags when -static-pie is enabled in BareMetal Toolchain (#147589) 2025-08-11 21:44:05 +05:30
Joseph Huber
9da4d74a88
[Clang] Always pass detected CUDA path to 'clang-nvlink-wrapper' (#152789)
Summary:
We always want to use the detected path. The clang driver's detection is
far more sophisticated so we should use that whenever possible. Also
update the usage so we properly fall back to path instead of incorrectly
using the `/bin` if not provided.
2025-08-11 07:22:11 -05:00
Craig Topper
92a966bd8f
[RISCV] Add -march=unset to cancel and ignore a previous -march. (#148321)
-mcpu is used to determine the ISA string if an explicit -march is not
present on the command line. If there is a -march present it always has
priority over -mcpu regardless of where it appears in the command line.

This can cause issues if -march appears in a Makefile and a user wants
to override it with an -mcpu on the command line. The user would need to
provide a potentially long ISA string to -march that matches the -mcpu
in order to override the MakeFile.

This issue can also be seen on Compiler Explorer where the rv64gc
toolchain is passed -march=rv64gc before any user command line options
are added. If you pass -mcpu=spacemit-x60, vectors will not be enabled
due to the hidden -march.

This patch adds a new option for -march, "unset" that makes the -march
ignored for purposes of prioritizing over -mcpu. Now a user can write
-march=unset -mcpu=<cpu_name>. This is also implemented by gcc for
ARM32.

An alternative would be to allow -march to take a cpu name, but that
requires "-march=<cpu_name> -mcpu=<cpu_name>" or "-march=<cpu_name>
-mtune=<cpu_name>" to ensure the tune cpu also gets updated. IMHO,
needing to repeat the CPU name twice isn't friendly and invites
mistakes.

gcc has implemented this as well.
2025-08-09 09:23:04 -05:00
jeremyd2019
ff616b4806
[Tests] Add system-cygwin feature, and use it. (#152611)
Several Clang tests were failing on Cygwin, and were already marked as
requiring !system-windows, unsupported on system-windows, or xfail on
system-windows. Add system-cygwin to lit's llvm.config, and use it in
such tests in addition to system-windows.
2025-08-08 13:29:00 -07:00
Yaxun (Sam) Liu
479556c720
[HIP] compressed bundle format defaults to v3 (#152600)
HIP runtime support for compressed bundle format v3 is in place,
therefore switch the default compressed bundle format to v3 in compiler.

This allows both compressed and decompressed fat binary size to exceed
4GB by default.

Environment variable COMPRESSED_BUNDLE_FORMAT_VERSION=2 can be used for
backward compatibility for older HIP runtimes not supporting v3.

Fixes: SWDEV-548879
2025-08-08 08:53:01 -04:00
Joseph Huber
56ba1181e9
[Clang] Fix warning on synthetic offload arch argument in host only mode (#151969)
Summary:
These arguments are synthetically generated and should always be
considered used. This was emitting a warning on the new driver.
2025-08-06 07:30:07 -05:00
Fraser Cormack
df74736732
[clang] Add the ability to link libclc OpenCL libraries (#146503)
This commit adds driver support for linking libclc OpenCL libraries. It
takes the form of a new optional flag: --libclc-lib=namespec. Nothing is
linked unless this flag is specified.

Not all libclc targets have corresponding clang targets. For this reason
it is desirable for users to be able to specify a libclc library name.
We support this by taking both a library name (without the .bc suffix)
or a filename. Both of these are searched for in the clang resource
directory. Filenames are
also checked themselves so that absolute paths can be provided. The
syntax for specifying filenames (as opposed to library names) uses a
leading colon (:), inspired by the -l option.

To accommodate this option, libclc libraries are now placed into clang's
resource directory in an in-tree configuration. The libraries are all
placed in <resource-dir>/lib/libclc and
are not grouped under host-specific directories as some other runtime
libraries are; it is not expected that OpenCL libraries will differ
depending on the host toolchain.

Currently only the AMDGPU toolchain supports this option as a proof of
concept. Other targets such as NVPTX or SPIR/SPIR-V could support it
too. We could optionally let target toolchains search for libclc
libraries themselves, possibly when passed an empty --libclc-lib.
2025-08-04 15:37:22 +01:00
Aiden Grossman
b7b501e54c Reapply "[clang] Remove %T from tests (#151614)"
This reverts commit 4c80193a58a5c24e2bbebe291feb406191c4e2ab.

This relands the commit. The issues have theoretically been fixed.
2025-08-02 20:08:53 +00:00
Artem Belevich
12eab1a7b8
[CUDA] Use --image3 to construct fat binary (#151760)
CUDA-12.9 has removed fatbinary tool's `--image` argument we've been
using till now.

--image3 has been supported since cuda-9, so we do not need CUDA SDK
version checks.
2025-08-01 13:14:14 -07:00
Aiden Grossman
4c80193a58 Revert "[clang] Remove %T from tests (#151614)"
This reverts commit 5a586375aa3a128dadc9473cfa196bf8588c2a82.

This breaks two buildbots with failures in
implicit-module-header-maps.cpp. No idea why these failures are
occurring.

https://lab.llvm.org/buildbot/#/builders/64/builds/5166
https://lab.llvm.org/buildbot/#/builders/13/builds/8725
2025-08-01 17:30:24 +00:00
Aiden Grossman
5a586375aa
[clang] Remove %T from tests (#151614)
This patch removes %T from clang lit tests. %T has been deprecated for
about seven years and is not reccomended as it is not unique to each
test, which can lead to races. This patch is intended to remove usage in
tree with the end goal of removing support for %T within lit.
2025-08-01 08:25:14 -07:00
Aiden Grossman
6b7a8e9015
[clang] Remove use of %T from crash-report-modules.m (#151615)
This patch removes the use of %T from crash-report-modules.m. %T has
been deprecated for about seven years, and is to be avoided as it can
lead to races between tests.

Posting this one as a separate patch given it was explicitly ported to
%T in 5c268f078ddbaa7cc1e9ea0ef658eb90563ff5db. Given
36bb47c70802629df98276ce90b0f8163f959e28 was landed seven years ago to
completely disable the test on Windows due to continued failures, I
think it should be fine to just leave this test unsupported on Windows.
2025-08-01 07:31:20 -07:00
Joseph Huber
812b982e36
[HIP] Fix compression arguments being passed to linker wrapper (#151591)
Summary:
The new driver's behavior forwards all unrecognized command line
arguments to the host linker. It only knew `--compress` so when
`-compress` was passed it didn't forward it correctly. This patch
changes the spelling because multi word arguments should have two
dashes.
2025-08-01 07:26:02 -05:00
Steven Wu
441f5b0e36
[clang] Infer compilation directory in driver
When building with -fdebug-compilation-dir/-fcoverige-compilation-dir,
infer the compilation directory in clang driver, rather than try to
fallback to VFS current working directory lookup during CodeGen. This
allows compilation directory to be used as it is passed via cc1 flag and
the value can be empty to remove dependency on CWD if needed.

Reviewers: adrian-prantl, dwblaikie

Reviewed By: adrian-prantl, dwblaikie

Pull Request: https://github.com/llvm/llvm-project/pull/150112
2025-07-31 10:39:06 -07:00
William Huynh
15f65afc7a
[clang] Add option for -nolibc in Driver/ToolChains/Baremetal.cpp (#145700)
Some tests in LLVM-libc require this flag
(https://github.com/llvm/llvm-project/issues/145349), which requires
compiler-rt to be linked in, but not the C library. With this change,
the `-nolibc` flag will not be ignored.
2025-07-31 09:40:40 +01:00
Hood Chatham
8dd91996f0
[WebAssembly] Add gc target feature to addBleedingEdgeFeatures (#151294)
Also alphebetize feature list, add `-mgc` and `-mno-gc` flags, and add
some missing feature tests.

Reland of #151107.

https://github.com/llvm/llvm-project/pull/150201#discussion_r2237982637
2025-07-30 13:04:02 -07:00
Joel E. Denny
74e4a8645d
[LinkerWrapper] Fix -fsave-optimization-record default file (#149003)
As discussed in PR #145603, the following command seems to fail to
produce a YAML remarks file for offload LTO passes and thus for
kernel-info:

```
clang -O2 -g -fopenmp --offload-arch=native test.c -foffload-lto \
  -Rpass=kernel-info -fsave-optimization-record
```

The problem is that, in clang-linker-wrapper's clang call, clang names
the file based on clang's main output file (from `-o`). That is a
temporary file, so the YAML file becomes a temporary file, which the
user never sees.

This patch:
- Makes clang honor `-dumpdir` for the default YAML remarks file in the
case of LTO.
- Extends clang-linker-wrapper to specify that option to clang.

To demonstrate the appeal of the generality of `-dumpdir` (as opposed to
a one-off `-fsave-optimization-record` solution in
clang-linker-wrapper), this patch also fixes `-gsplit-dwarf`. Without
this patch, when using `-gsplit-dwarf` and later debugging using rocgdb,
the dwo directory for offload is a temporary file, so temporary file
cleanup causes rocgdb to lose debug symbols for offload code.

WARNING: The clang driver passes `-dumpdir` to various clang frontend
calls. For LTO, that was previously being ignored, and now it's not.
That changes some auxiliary file names, as revealed by changes in some
existing tests' expected output: `clang/test/Driver/opt-record.c` and
`clang/test/Driver/lto-dwo.c`. Hopefully this change does not introduce
a backward compatibility issue for users.
2025-07-30 10:25:37 -04:00
Joseph Huber
4562b557a6
[HIP] Handle -fhip-emit-reloctable in the new driver (#151237)
Summary:
Support for this was missing, here it pretty much overrides the normal
bundling behavior and also requires a few errors to be emitted.
2025-07-30 06:31:59 -05:00
Keno Fischer
7f470586e1
[Driver][MinGW] Always put libc argument last, even if non-standard (#149434)
I was attempting to build openblas with clang in msys2's `ucrt64`
environment (I'm aware of the `clang64` environment, but I wanted
libstdc++). The openblas link failed with the following:

```
clang -march=native -mtune=native -m64  -O2 -fno-asynchronous-unwind-tables -O2 -DSMALL_MATRIX_OPT -DMS_ABI -DMAX_STACK_ALLOC=2048 -Wall -m64 -DF_INTERFACE_GFORT -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=512 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1 -DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.29\" -UASMNAME -UASMFNAME -UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..  libopenblas64_.def dllinit.obj \
-shared -o ../libopenblas64_.dll -Wl,--out-implib,../libopenblas64_.dll.a \
-Wl,--whole-archive ../libopenblas64_p-r0.3.29.a -Wl,--no-whole-archive -LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0 -LC:/msys64/ucrt64/bin/../lib/gcc -LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib -LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../..  -lgfortran -lmingwex -lmsvcrt -lquadmath -lm -lpthread -lmingwex -lmsvcrt  -defaultlib:advapi32 -lgfortran -defaultlib:advapi32 -lgfortran

C:/msys64/ucrt64/bin/ld: C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o): in function `__report_error':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:157:(.text+0x59): undefined reference to `abort'
C:/msys64/ucrt64/bin/ld: C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o): in function `___w64_mingwthr_add_key_dtor':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:48:(.text+0xa5): undefined reference to `calloc'
C:/msys64/ucrt64/bin/ld: C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pesect.o): in function `_FindPESectionByName':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pesect.c:79:(.text+0xfd): undefined reference to `strncmp'
```

These symbols come from the `-lmingw32` dep that the driver added and
are ordinarily found in `-lmsvcrt`, which got skipped here, because
openblas passed `-lmsvcrt` explicitly earlier in the link line. Since we
always add these libraries at the end here, I think that clang is "at
fault" (as opposed to a user or packaging mistake) and should have added
some crt here.

To preserve the intent of letting the user override which crt is chosen,
duplicate the (first) user chosen crt `-l` into this position, although
we should perhaps consider an explicit `-mcrtdll` like gcc has as well.
2025-07-30 01:09:27 -04:00
ronlieb
a7e029bd0b
Revert "[WebAssembly] Add gc target feature to addBleedingEdgeFeatures" (#151268)
Reverts llvm/llvm-project#151107
2025-07-29 22:07:17 -07:00
Hood Chatham
fe25445ded
[WebAssembly] Add gc target feature to addBleedingEdgeFeatures (#151107)
See suggestion here:
https://github.com/llvm/llvm-project/pull/150201#discussion_r2237982637
2025-07-29 17:54:12 -07:00
Victor Campos
910f6ad15a
[Clang][Driver] Valid -march value is not mandatory in AArch64 multilib (#151103)
If a user passed an invalid value to `-march`, an assertion failure
happened in the AArch64 multilib logic.

But an invalid `-march` value is an expected case that should be handled
via error messages.

This patch removes the requirement that the `-march` value must be
valid.
2025-07-29 14:43:11 +01:00
Jonathon Penix
ee63c1f352
[clang][Driver] Prefer non-Linux emulations for baremetal Arm/AArch64 targets (#149235)
I'm unsure if there is an official source for which targets use/support
which emulations, but for the baremetal GNU Arm/AArch64 toolchains or
binutils builds I've tried to use, GNU ld either did not support the
Linux emulations (resulting in errors unless overriding the emulation)
or the Linux emulations were supported but GCC passed the non-Linux
emulations by default.

These emulations all seem to be accepted by lld as well, so try to align
with what it seems GCC is doing and prefer the non-Linux emulations for
baremetal Arm/AArch64 targets.
2025-07-28 15:41:00 -07:00
Paulius Velesko
ae0614de05
HIPSPV: Unbundle SDL (#136412)
This fixes the issue of rdc linking static libraries with device code

https://github.com/CHIP-SPV/chipStar/issues/984

---------

Co-authored-by: Henry Linjamäki <henry.linjamaki@gmail.com>
2025-07-28 14:22:23 -04:00
Joseph Huber
2368be38a1
[HIP] Always respect --gpu-bundle-output in the new driver (#150989)
Summary:
This is a bit of an awkward transition point for the new and old
drivers. Previously AMDGPU uses this to generate offloading bundles, but
the new driver much prefers to output the file itself. This patch
changes the behavior to always respect `--gpu-bundle-output` instead of
having it be the default behavior. This means that we effectively get to
override the default new driver behavior with this flag now. This should
hoepfully fix some errors in the downstream comgr tests.
2025-07-28 12:04:49 -05:00
Cyndy Ishida
5ebdfe386e
[clang][Modules] Respect -fno-cxx-modules as a driver flag (#150349)
The mentioned flag is already both a cc1 & driver flag; however, whether
it is respected was tied to either:
1. Whether it was passed as a cc1 option (`Xclang`)
2. or `-fmodules` accompanying it

This poses a consistency problem where `std=c++20` enables the modules
feature, independent of other module settings.
This patch resolves this issue by checking for the presence
unconditionally & passing it down to cc1 when applicable.
2025-07-25 13:17:09 -07:00
Aaron Ballman
479ae4aa8f
Revert "fix: replace report_fatal_error with Diags and exit" (#150662)
Reverts llvm/llvm-project#147959
2025-07-25 13:24:00 -04:00
woruyu
9d3dd8efe0
fix: replace report_fatal_error with Diags and exit (#147959)
report_fatal_error is not a good way to report diagnostics to the users, so this switches to using actual diagnostic reporting mechanisms instead.

Fixes #147187
2025-07-25 10:20:30 -04:00
Jordan Rupprecht
34447efd46
[clang][test] Specify value of -fopenmp=libomp for test. (#150301)
`libomp` is the default value when unconfigured in cmake, but llvm can
be configured to have `libgomp` be the default instead. Explicitly
specify this value so the test does not fail when it assumes libomp is
always the default.
2025-07-23 15:46:49 -05:00
Joseph Huber
1206a6165e
[Clang] Fix new driver HIP SPIR-V compilation in device only mode (#150309)
Summary:
This should emit LLVM-IR. Add to the extremely ugly if statement so that
this happens correctly.
2025-07-23 15:41:47 -05:00
Rainer Orth
06233892e8
[Driver] Default to -mv8plus on 32-bit Solaris/SPARC (#150176)
While investigating PR #149990, I noticed that while both the Oracle
Studio compilers and GCC default to `-mv8plus` on 32-bit Solaris/SPARC,
Clang does not.

This patch fixes this by enabling the `v8plus` feature.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
2025-07-23 17:03:34 +02:00
Joseph Huber
efa25c4737
[Clang] Fix new driver device only compilation for amdgcnspirv target (#150110)
Summary:
This is broken with the current target because it was not bundling the
output as HIP likes and this would fail if targeting both at the same
time.
2025-07-23 07:55:10 -05:00
Rainer Orth
0f23569570
[Driver] Default to -mcpu=ultrasparc3 on Solaris/SPARC (#149990)
Prompted by PR #149652, this patch changes the Solaris/SPARC default to
-mcpu, matching both the Oracle Studio 12.6 compilers and GCC 16:
[[PATCH] Default to -mcpu=ultrasparc3 on
Solaris/SPARC](https://gcc.gnu.org/pipermail/gcc-patches/2025-July/690191.html).
This is equivalent to enabling the `vis2` feature.

Tested on `sparcv9-sun-solaris2.11` and `sparc64-unknown-linux-gnu`.
2025-07-23 09:05:10 +02:00
Slava "nerfur" Voronzoff
5eecbc018b
Adding Loongarch64 to OpenBSD parts (#149737)
Adding Loongarch64 to OpenBSD parts
2025-07-22 18:18:12 -04:00
Victor Campos
579a80784d
[Clang][Driver][ARM] Forward -Os and -Oz as multilib flags (#149819)
Pass along `-Os` and `-Oz` as multilib flags under ARM and AArch64 so
that they can be used as criteria for multilib selection.
2025-07-22 10:57:44 +01:00
Garvit Gupta
81651e9fd0
Remove extraneous addition of -X flag in baremetal toolchain (#148855)
Commit 597ee88 moved the -X flag to a new position in the baremetal
toolchain's linker job, but unintentionally left the original instance in place.

This patch removes the redundant flag, ensuring -X is passed only once.
2025-07-22 14:23:54 +05:30