Commit Graph

539447 Commits

Author SHA1 Message Date
Jon Roelofs
798058fca5 [Remarks] Remove an upcast footgun. NFC (#142191)
CodeRegion's were previously passed as Value*, but then immediately
upcast to BasicBlock. Let's keep the type information around until the
use cases for non-BasicBlock code regions actually materialize.
2025-05-31 11:07:54 -07:00
Timm Baeder
b9675617af [clang][Sema] Optimize ~SemaDiagnosticBuilder (#142252)
Call getDiagnosticLevel(), which is expensive, only if ShowCallStack is
set.

Small gains:

https://llvm-compile-time-tracker.com/compare.php?from=843e362318e884991e517a54446b4faeacdad789&to=5cef0c18466318a426924b3c45f7abaaa8f6b535&stat=instructions:u
2025-05-31 19:59:55 +02:00
Ely Ronnen
81602769d8 [lldb-dap] Synchronously wait for breakpoints resolves in tests (#140470)
Attempt to improve tests by synchronously waiting for breakpoints to
resolve. Not sure if it will fix all the tests but I think it should
make the tests more stable
2025-05-31 16:59:46 +02:00
Ellis Hoag
79da1c405d [Sanitizer] Use %device_rundir/ to fix test (#142274)
I attempted to fix this test in
https://github.com/llvm/llvm-project/pull/142235 but we a new error.


https://lab.llvm.org/buildbot/#/builders/186/builds/9524/steps/26/logs/stdio
> ERROR: Can't create directory: /var

The path we want is actually at `/data/local/tmp/Output/var/...`.

I found `%device_rundir/` evaluates to this prefix on android, and
nothing otherwise.


f057a593a7/compiler-rt/test/lit.common.cfg.py (L658)
2025-05-31 07:33:11 -07:00
Rahul Joshi
2cbe8df181 [NFC][DWP] Make getContributionIndex static (#141708)
Remove `getContributionIndex` declaration from header and make it static
as it seems to be only used within the .cpp file.
2025-05-31 07:32:46 -07:00
Ramkumar Ramachandra
f057a593a7 [VPlan] Improve code in VPWidenCallRecipe (NFC) (#141926)
Use operands() instead of {op_begin(), op_end()}. Also rename
arg_operands to args to match CallBase.
2025-05-31 15:41:20 +02:00
Ramkumar Ramachandra
07ba406cbd [VPlan] Improve code in VPWidenIntrinsic (NFC) (#141936)
Use operands() instead of {op_begin(), op_end()}.
2025-05-31 15:20:28 +02:00
Aaron Ballman
0adf6e8d33 Work around a build issue with MSVC; NFC (#142195)
Microsoft helpfully defines `THIS` to `void` in two different platform
SDK headers, at least one of which is reachable via <Windows.h>. We have
a user who ran into a build because of `THIS` unfortunate macro name
collision.

Rename the members to better match our naming conventions.

Fixes #142186
2025-05-31 08:35:26 -04:00
Florian Hahn
78eafb14f7 [VPlan] Add getIndexFor(Predecessor|Successor) helpers (NFC).
Move code to get the index of a predecessor and successor to helpers in
VPBlockBase, to avoid duplication and enable future reuse.

Split off from https://github.com/llvm/llvm-project/pull/140409.
2025-05-31 12:53:05 +01:00
David Green
7a688c080f [ARM] Add vector vrint tests and fix FP16 to expand. 2025-05-31 12:21:46 +01:00
Florian Hahn
c3cce7caf8 [VPlan] Remove unused VPUser constructors (NFC).
Now all users construct VPUsers using VPUser(ArraryRef<VPValue *>).
Remove the other unused constructors.
2025-05-31 12:20:32 +01:00
cor3ntin
6f7268e204 [Clang] Improve infrastructure for libstdc++ workarounds (#141977)
This introduces a way detect the libstdc++ version, use that to enable
workarounds.
The version is cached.

This should make it easier in the future to find and remove these hacks.

I did not find the need for enabling a hack between or after specific
versions, so it's left as a future exercise.

We can extend this fature to other libraries as the need arise.
2025-05-31 12:26:49 +02:00
Folkert de Vries
3a98934474 [AArch64] Treat @llvm.ssub.sat the same as @llvm.aarch64.neon.sqsub (#140454)
Fixes #94463

Co-authored-by: Spencer Abson <spencer.abson@arm.com>
2025-05-31 11:26:27 +01:00
Ely Ronnen
3b6ff59d9b fix PATH_MAX missing in windows build (#142259) 2025-05-31 10:27:44 +02:00
Yingwei Zheng
3ec0c5c7fe [InstCombine] Propagate FMF from select instead of fcmp (#141010)
Previously,
3d6b53980c
propagates FMF from fcmp to avoid performance regressions. With the help
of https://github.com/llvm/llvm-project/pull/139861,
https://github.com/llvm/llvm-project/pull/141015, and
https://github.com/llvm/llvm-project/pull/141914, we can still convert
SPF into fabs/minnum/maxnum intrinsics even if some flags are missing.
This patch propagates FMF from select to address the long-standing
issue.

Closes https://github.com/llvm/llvm-project/issues/140994.
2025-05-31 16:25:10 +08:00
Andreas Jonson
7c080e2677 [InstCombine] Avoid to create bitreverse.i1 for or of trunc to i1 (#142258) 2025-05-31 10:20:49 +02:00
Michael Buch
f669b9c3ec [lldb][test] Test all libcxxabi demangler test-cases against TrackingOutputBuffer (#137793)
To test the infrastructure added in
https://github.com/llvm/llvm-project/pull/131836 in would be nice to
confirm that we can reconstruct all kinds of demangled names. The
libcxxabi test-suite already has all those test-cases.

This patch copies those test-cases (taken from
`libcxxabi/test/test_demangle.pass.cpp`), reconstructs the name like
LLDB would when showing backtraces, and confirms that all demangled
names can be fully reconstructed.

Two open questions:
1. Do we really want a copy of all those test-cases in LLDB? It's
unlikely to be kept in sync with the demangler test-suite. It includes
30,000+ test-cases
2. Do we want to turn the
`GetDemangledBasename`/`GetDemangledScope`/etc. into public APIs (e.g.,
on `TrackingOutputBuffer`) so that we can use the exact same method of
extraction in the tests?
2025-05-31 09:05:53 +01:00
Andreas Jonson
c0b25f4e74 [InstCombine] Test cast support in simplifyUsingControlFlow (NFC) 2025-05-31 09:21:35 +02:00
Jessica Clarke
35757d67ba Revert "[libc++] Re-enable std::pair trivial copy constructor for FreeBSD >= 14" (#142204)
The ABI bump to adopt the conforming ABI v1 std::pair implementation did
not end up happening for FreeBSD 14, and instead this diff was reverted
downstream in FreeBSD[1]. Align the upstream ABI config with FreeBSD's
actual ABI.

[1] ce4f1f49e036 ("Revert commit 6255157d24 from llvm-project (by
Dimitry Andric):")

This reverts commit 6255157d24.
2025-05-31 08:07:15 +01:00
LLVM GN Syncbot
d6a2ca3eb8 [gn build] Port 22dfe9cb58 2025-05-31 06:47:29 +00:00
Ely Ronnen
22dfe9cb58 [lldb-dap] Reuse source object logics (#141426)
Refactor code revolving source objects such that most logics will be
reused.

The main change is to expose a single `CreateSource(addr, target)` that
can return either a normal or an assembly source object, and call
`ShouldDisplayAssemblySource()` only from this function instead of
multiple places across the code.

Other functions can use `source.IsAssemblySource()` in order to check
which type the source is.
2025-05-31 08:47:18 +02:00
Matt Arsenault
ad0a52202e AMDGPU: Improve v32f16/v32bf16 copysign handling (#142177) 2025-05-31 08:24:51 +02:00
Matt Arsenault
3aeffcfde1 AMDGPU: Improve v16f16/v16bf16 copysign handling (#142176) 2025-05-31 08:18:52 +02:00
Matt Arsenault
ffee01e748 AMDGPU: Improve v8f16/v8bf16 copysign handling (#142175) 2025-05-31 08:15:45 +02:00
Jim Lin
dfbb9a0e30 [RISCV] Implement intrinsics for XAndesVDot (#141441)
This patch implements clang intrinsic support for XAndesVDot.

The document for the intrinsics can be found at:

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/intrinsic_funcs.adoc#andes-vector-dot-product-extensionxandesvdot
and with policy variants
https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/policy_funcs/intrinsic_funcs.adoc#andes-vector-dot-product-extensionxandesvdot

Co-authored-by: Tony Chuan-Yue Yuan <yuan593@andestech.com>
2025-05-31 14:12:01 +08:00
Matt Arsenault
20ad4209dd AMDGPU: Improve v4f16/v4bf16 copysign handling (#142174) 2025-05-31 08:09:51 +02:00
Matt Arsenault
4aa4005e04 AMDGPU: Make copysign with matching v2f16/v2bf16 inputs legal (#142173)
Fixes #141931
2025-05-31 08:06:49 +02:00
Craig Topper
64e9a3f8f0 [RISCV] Use isVLPreservingConfig in isConvertibleToVMV_V_V. NFC 2025-05-30 22:59:22 -07:00
Nadharm
f71e4e9bc2 [InstSimplify] Handle nsz when simplifying X * 0.0 (#142181)
If ValueTracking can guarantee non-NaN and non-INF and the `nsz`
fast-math flag is set, we can simplify X * 0.0 ==> 0.0.

https://alive2.llvm.org/ce/z/XacRQZ
2025-05-31 13:50:22 +08:00
Craig Topper
11f915f473 [RISCV] Add RISCVISD::VQDOT*_VL to RISCVSelectionDAGInfo::verifyTargetNode. (#142202)
After seeing the bug that #142185 fixed, I thought it might be a good
idea to start verifying that nodes are formed correctly.

This patch introduces the verifyTargetNode function and adds these
opcodes. More opcodes can be added in later patches.
2025-05-30 22:33:29 -07:00
Longsheng Mou
26b81c4300 [mlir][memref] Add terminator check to prevent a crash (#141972)
This PR adds terminator check to prevent a crash when invoke
`lastNonTerminatorInRegion`. Fixes #137333.
2025-05-31 13:25:42 +08:00
Craig Topper
40e1f7d1e7 [RISCV] Use llvm::is_contained. NFC (#142239) 2025-05-30 22:01:54 -07:00
Ellis Hoag
74420ce524 [Sanitizer][NFC] Remove extra env from test (#142247) 2025-05-30 21:56:03 -07:00
Mallikarjuna Gouda
418c1d8a44 [MIPS] Reland Add FeatureMSA to i6400 and i6500 cores (#134985) (#141730)
Note: This relands #134985 with a fix. Original PR resulted in test fail
for msan builds.
Fix: Initialize MipsSubtarget::ProcImpl to ProcImpl::CPU::Others


[MIPS] Reland Add FeatureMSA to i6400 and i6500 cores (#134985)

- Enable 'FeatureMSA' for MIPS i6400 and i6500 cpu.
- Enable -mmsa option if mcpu is set to either i6400 or i6500
- added clang driver test to validate msa feature
- added llvm codegen test to validate msa instructions for cpu i6500 and
i6400

MIPS i6400 and i6500 cores implements and enables MSA (MIPS SIMD
ARCHITECTURE) by default.
2025-05-30 22:33:34 -04:00
Nathan Ridge
ed14e0da77 [clangd] Log the paths of loaded config files without --log=verbose (#142063)
Users sometimes forget about configuration they've placed in the user
config file, or an ancestor directory of their project.

Logging the paths of loaded config files by default (without
--log=verbose) surfaces more readily where clangd is getting its
configuration from.
2025-05-30 22:31:12 -04:00
Ellis Hoag
c979d1f812 [Sanitizer] Fix android test env issue (#142235)
I attempted to fix android tests in
https://github.com/llvm/llvm-project/pull/142207 (broken by
https://github.com/llvm/llvm-project/pull/141820). They are still
failing but now I have more info.


https://lab.llvm.org/buildbot/#/builders/186/builds/9504/steps/16/logs/stdio

ERROR: Can't open file: //foo.8862 (reason: 30)

I believe the reason is that on android the HOME and TMPDIR environment
variables are not being set correctly, or they are not read correctly.
(https://github.com/llvm/llvm-project/pull/142234#issuecomment-2923694428)
2025-05-30 19:26:26 -07:00
Shilei Tian
4d48673562 Reapply "Reapply "[AMDGPU] Make getAssumedAddrSpace return AS1 for pointer kernel arguments (#137488)""
This reverts commit 37ea3b32cd.
2025-05-30 22:11:22 -04:00
Shilei Tian
37ea3b32cd Revert "Reapply "[AMDGPU] Make getAssumedAddrSpace return AS1 for pointer kernel arguments (#137488)""
This reverts commit 4efc13f8ff.
2025-05-30 22:06:16 -04:00
Sirui Mu
628a3f0a48 [CIR] Call to variadic functions (#141942) 2025-05-31 09:59:41 +08:00
Shilei Tian
4efc13f8ff Reapply "[AMDGPU] Make getAssumedAddrSpace return AS1 for pointer kernel arguments (#137488)"
This reverts commit 3c6211c183.
2025-05-30 21:56:24 -04:00
Owen Pan
4851886693 [clang-format] Handle bit-field colon of non-numeric-constant size (#142110)
Fix #142050
2025-05-30 18:51:01 -07:00
Konrad Kleine
84fd907aa7 [lit] add --max-retries-per-test execution option (#141851)
When packaging LLVM we've seen arbitrary tests fail.
It happened sporadically and most of the times the test
do work if they are run a second time on the next day.

The tests themselves were always different and we didn't
know ahead of time which ones we wanted to re-run.
That's we filter-out a lot of `libomp` and `libarcher` tests [1].

This change allows us to set
`LIT_OPTS="--max-retries-per-test=12"`
when running any "check-XXX" build target. Then any lit test
will at most be re-run 12 times, unless there's an `ALLOW_RETRIES:`
in one of the test scripts that's specifying a different value
than `12`. `12` is just an example here, any positive integer
will work.

Please note, that this only adds the possibility to re-run
lit tests. It does not actually do it until the caller specifies
`--max-retries-per-test=<POSITIVE_INT>` either on a call to `lit` or
in `LIT_OPTS`.

Also note, that one can still use `ALLOW_RETRIES:` in test scripts
and it will always rule over `--max-retries-per-test`. When
`--max-retries-per-test` is set too low, but the
`config.test_retry_attempts`
is high enough, it works as well.

Any option in the list below overrules its predecessor:

* `--max-retries-per-test`
* `config.test_retry_attempts`
* `ALLOW_RETRIES` keyword

From the above options to re-run tests, `--max-retries-per-test` is the
only one that doesn't require a change in the test scripts or the test
config.

[1]:
https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec#_2326

Downstream PR to make use of the `--max-retries-per-test` option:
https://src.fedoraproject.org/rpms/llvm/pull-request/434
Downstream ticket: https://issues.redhat.com/browse/LLVM-145
2025-05-31 03:46:12 +02:00
fleeting-xx
278ef84d20 Revert "[clangd] [Modules] Fixes to correctly handle module dependencies" (#142162) 2025-05-31 09:21:50 +08:00
Shilei Tian
3c6211c183 Revert "[AMDGPU] Make getAssumedAddrSpace return AS1 for pointer kernel arguments (#137488)"
This reverts commit 9bf6b2a8cb.
2025-05-30 21:15:25 -04:00
Shilei Tian
2446381838 Revert "[FIX] Fix a test update by mistake"
This reverts commit 0a75d8e433.
2025-05-30 21:15:25 -04:00
Aviad Cohen
ab77a70a74 Fixed wrong check OperationEquivalenceTest.HashWorksWithFlags (#142210)
The check was meant to check `IgnoreProperties` works as expected but
operated on the wrong operation.

Co-authored-by: Aviad Cohen <aviad.cohen2@mobileye.com>
2025-05-30 18:14:28 -07:00
Finn Plummer
0996bfc663 [HLSL][RootSignature] Add space, visibility enums to StaticSampler (#140306)
- adds the `space` and `visibility` parameters to StaticSampler
- adds basic unit tests to demonstrate setting functionality

Part 7 and Resolves https://github.com/llvm/llvm-project/issues/126574
2025-05-30 17:50:47 -07:00
Finn Plummer
9cdd33db16 [HLSL][RootSignature] Metadata generation of RootFlags, RootConstants, RootDescriptors (#142010)
Implements metadata generation of a Root Signature from its in-memory
representation. It follows the same style as:
https://github.com/llvm/llvm-project/pull/139633.

This pr handles RootFlags, RootConstants and RootDescriptors.

The metadata follows the format described
[here](https://github.com/llvm/wg-hlsl/blob/main/proposals/0002-root-signature-in-clang.md#metadata-schema).

- Implement `BuildRoot[Flags|Constants|Descriptors]` into
`HLSLRootSignature.h`
- Add sample testcases demonstrating functionality

Note: there is no validation of metadata nodes as the
`llvm::hlsl::rootsig::RootElement` that generates it will have already
been validated.

First part of https://github.com/llvm/llvm-project/issues/126586.
2025-05-30 16:52:19 -07:00
Walter Lee
1d338a0b9a Wrap ifndef NDEBUG around assertion-only code (#142227)
Otherwise we get unused variable warnings.
2025-05-30 19:48:20 -04:00
sribee8
339851e140 [libc][obvious] Fixed wchar.yaml (#142238)
Changed __restricted to __restrict for wmemcpy.

Co-authored-by: Sriya Pratipati <sriyap@google.com>
2025-05-30 16:41:11 -07:00