529994 Commits

Author SHA1 Message Date
A. Jiang
94714fb303
[libc++] Deprecate is_pod(_v) since C++20 (#129471)
Previously, commit 042f07eed8c1acba19ea04310137bee12b18045a claimed that
P0767R1 was implemented in LLVM 7.0, but no deprecation warning was
implemented. This patch adds the missing warnings.
2025-03-07 16:02:57 +08:00
zhaohui
3a67c7c6f7
[Clang] Check for uninitialized use in lambda within CXXOperatorCallExpr (#129198)
Track whether a LambdaExpr is an immediate operand of a
CXXOperatorCallExpr using a new flag, isInCXXOperatorCall. This enables
special handling of capture initializations to detect uninitialized
variable uses, such as in `S s = [&]() { return s; }();`.

Fix #128058
2025-03-07 16:01:23 +08:00
Kazu Hirata
6cb2f6de9b
[AMDGPU] Avoid repeated hash lookups (NFC) (#130235) 2025-03-06 23:58:16 -08:00
Craig Topper
fc1450c597 [CriticalAntiDepBreaker] Attempt to fix MSVC build error. NFC 2025-03-06 23:57:47 -08:00
Piotr Sobczak
170c0dac44
[AMDGPU] Fix edge case of buffer OOB handling (#115479)
Strengthen out-of-bounds guarantees for buffer accesses by disallowing
buffer accesses with alignment lower than natural alignment.

This is needed to specifically address the edge case where an access
starts out-of-bounds and then enters in-bounds, as the hardware would
treat the entire access as being out-of-bounds. This is normally not
needed for most users, but at least one graphics device extension
(VK_EXT_robustness2) has very strict requirements - in-bounds accesses
must return correct value, and out-of-bounds accesses must return zero.

The direct consequence of the patch is that a buffer access at negative
address is not merged by load-store-vectorizer with one at a positive
address, which fixes a CTS test.

Targets that do not care about the new behavior are advised to use the
new target feature relaxed-buffer-oob-mode that maintains the state from
before the patch.
2025-03-07 08:56:44 +01:00
Matthias Springer
a21cfca320
[mlir][IR] Deprecate match and rewrite functions (#130031)
Deprecate the `match` and `rewrite` functions. They mainly exist for
historic reasons. This PR also updates all remaining uses of in the MLIR
codebase.

This is addressing a
[comment](https://github.com/llvm/llvm-project/pull/129861#pullrequestreview-2662696084)
on an earlier PR.

Note for LLVM integration: `SplitMatchAndRewrite` will be deleted soon,
update your patterns to use `matchAndRewrite` instead of separate
`match` / `rewrite`.

---------

Co-authored-by: Jakub Kuderski <jakub@nod-labs.com>
2025-03-07 08:43:01 +01:00
Craig Topper
6b094020c2 [CriticalAntiDepBreaker] Use Register and MCRegister. NFC 2025-03-06 23:35:01 -08:00
Craig Topper
fc4bce3289 [MachineTraceMetrics] Use Register::id(). NFC 2025-03-06 23:29:17 -08:00
Craig Topper
59245b4d22 [ImplicitNullChecks] Use Register. NFC 2025-03-06 23:29:17 -08:00
Kazu Hirata
f83eeacc9d [X86] Fix a warning
This patch fixes:

  llvm/lib/Target/X86/X86ISelLowering.cpp:31886:11: error: unused
  variable 'M' [-Werror,-Wunused-variable]
2025-03-06 23:28:28 -08:00
Michael Buch
39a4da20d8 [lldb][asan] Add temporary logging to ReportRetriever
`TestReportData.py` is failing on the macOS CI with:
```
Traceback (most recent call last):
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1784, in test_method
    return attrvalue(self)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 148, in wrapper
    return func(*args, **kwargs)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/test/API/functionalities/asan/TestReportData.py", line 28, in test_libsanitizers_asan
    self.asan_tests(libsanitizers=True)
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/test/API/functionalities/asan/TestReportData.py", line 60, in asan_tests
    self.expect(
  File "/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2490, in expect
    self.fail(log_msg)
AssertionError: Ran command:
"thread list"

Got output:
Process 3474 stopped
* thread #1: tid = 0x38b5e9, 0x00007ff80f563b52 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT

Expecting sub string: "stopped" (was found)
Expecting sub string: "stop reason = Use of deallocated memory" (was not found)
Process should be stopped due to ASan report
```

There isn't much to go off of in the log, so adding more to help us debug this.
2025-03-07 07:09:18 +00:00
Craig Topper
1873f5567a [MIRVRegNamerUtils] Use Register. NFC 2025-03-06 22:51:05 -08:00
Craig Topper
f611c22cb5 [ImplicitNullChecks] Use Register. NFC 2025-03-06 22:25:51 -08:00
Matt Arsenault
e4cbbd323c AMDGPU: Switch a test to generated checks 2025-03-07 13:18:50 +07:00
Matt Arsenault
5997cdb4bc AMDGPU: Switch an undef in a test for poison 2025-03-07 13:18:05 +07:00
Yanzuo Liu
d933882ed3
[Clang] Add test for CWG2285 "Issues with structured bindings" (#126421)
The resolution of [CWG2285](https://wg21.link/cwg2285) adds the point of
declaration of a structured binding, and was implemented in
bdb84f374c
.

Drive-by changes: modify comment and diagnostic messages mentioned in
CWG2285.
2025-03-07 07:16:51 +01:00
Kito Cheng
733ad3fdeb
[LTO] Override TargetABI from module flags if present when creating TargetMachine (#126497)
…argetMachine

RISC-V's data layout is determined by the ABI, not just the target
triple. However, the TargetMachine is created using the data layout from
the target triple, which is not always correct. This patch uses the
target ABI from the module and passes it to the TargetMachine, ensuring
that the data layout is set correctly according to the ABI.

The same problem will happen with other targets like MIPS, but
unfortunately, MIPS didn't emit the target-abi into the module flags, so
this patch only fixes the issue for RISC-V.

NOTE: MIPS with -mabi=n32 can trigger the same issue.

Another possible solution is add new parameter to the TargetMachine
constructor, but that would require changes in all the targets.
2025-03-07 14:09:26 +08:00
Craig Topper
bedb9077c3
[RISCV] Simplify how we find combinable cm.pop+ret. (#130204)
Instead of scanning the whole basic block for a POP, find the RET and
then look backwards for the POP. Using getFirstTerminator, we can do
this with less code and it's probably faster.
2025-03-06 21:55:47 -08:00
Kiran Kumar T P
c02019141c
[LLVM-FLANG] [OpenMP] [Taskloop] - Add test case with cancel construct inside taskloop (#129862)
Added a test case with cancel construct inside taskloop. Currently
taskloop lowering is not supported so below error is issued: "not yet
implemented: Taskloop construct"
Once the lowering patch is merged, todo error should be issued for
cancel construct. "not yet implemented: OpenMPCancelConstruct"
2025-03-07 11:15:22 +05:30
John Harrison
2894719314
[lldb-dap] Updating naming and documentation to follow style guide. (#130202)
Updating the naming and adding documentation to better follow the style
guide.
2025-03-07 06:42:26 +01:00
Valentin Churavy
ed6bde93f0
[X86] Use fence(seq_cst) in IdempotentRMWIntoFencedLoad (#126521)
This extends this optimization for scenarios where the subtarget
has `!hasMFence` or we have SyncScope SingleThread, by avoiding
the direct usage of `llvm.x64.sse2.mfence`.
2025-03-07 06:39:03 +01:00
Jason Molenda
1a31bb38a4 [lldb][Mach-O] Don't read symbol table of specially marked binary (#129967)
We have a binary image on Darwin that has no code, only metadata. It has
a large symbol table with many external symbol names that will not be
needed in the debugger. And it is possible to not have this binary on
the debugger system - so lldb must read all of the symbol names out of
memory, one at a time, which can be quite slow.

We're adding a section __TEXT,__lldb_no_nlist, to this binary to
indicate that lldb should not read the nlist symbols for it when we are
reading out of memory. If lldb is run with an on-disk version of the
binary, we will load the symbol table as we normally would, there's no
benefit to handling this binary differently.

I added a test where I create a dylib with this specially named section,
launch the process. The main binary deletes the dylib from the disk so
lldb is forced to read it out of memory. lldb attaches to the binary,
confirms that the dylib is present in the process and is a memory
Module. If the binary is not present, or lldb found the on-disk copy
because it hasn't been deleted yet, we delete the target, flush the
Debugger's module cache, sleep and retry, up to ten times. I create the
specially named section by compiling an assembly file that puts a byte
in the section which makes for a bit of a messy Makefile (the pre-canned
actions to build a dylib don't quite handle this case) but I don't think
it's much of a problem. This is a purely skipUnlessDarwin test case.

Relanding this change with a restructured Makefiles for the test case
that should pass on the CI bots.

rdar://146167816
2025-03-06 21:29:38 -08:00
Matt Arsenault
21b2611025 AMDGPU Add baseline tests for shufflevector of physreg copy combine 2025-03-07 12:20:30 +07:00
Mircea Trofin
c8fd7a8a3a
[ctxprof] Profile section for flat profiles (#129932)
A section for flat profiles (i.e. non-contextual). This is useful for debugging or for intentional cases where a root isn't identified.

This patch adds the reader/writer support. `compiler-rt` changes follow in a subsequent change.
2025-03-06 21:18:57 -08:00
Owen Pan
3664b4e2d5
[clang-format] Remove special handling of C++ access specifiers in C (#129983)
This effectively reverts d1aed486efc6d35a81ca4acbabb4203c4b91cda9
because of
#129426.
2025-03-06 21:08:25 -08:00
lonely eagle
95767a9903
[mlir][nvgpu] separate ops, types, attribute definitions in NVGPU dialect. (#129846)
It is hoped that the Ops, Types, and Attribute of the NVGPU dialect can
be defined in separate files.If downstream projects extend NVGPU and
define other Ops, the types and attributes will be used.This PR was
raised to avoid including the definition of NVGPU Ops.
2025-03-07 13:00:05 +08:00
Kareem Ergawy
9543e9e927
[flang][OpenMP] Handle pre-detemined lastprivate for simd (#129507)
This PR tries to fix `lastprivate` update issues in composite
constructs. In particular, pre-determined `lastprivate` symbols are
attached to the wrong leaf of the composite construct (the outermost
one). When using delayed privatization (should be the default mode in
the future), this results in trying to update the `lastprivate` symbol
in the wrong construct (outside the `omp.loop_nest` op).

For example, given the following input:
```fortran
!$omp target teams distribute parallel do simd collapse(2) private(y_max)
  do i=x_min,x_max
    do j=y_min,y_max
    enddo
  enddo
```

Without the fixes introduced in this PR, the `DataSharingProcessor`
tries to generate the `lastprivate` update ops in the `parallel` op
since this is the op for which the DSP instance is created.

The fix consists of 2 main parts:
1. Instead of creating a single DSP instance, one instance is created
for the leaf constructs that might need privatization (whether for
explicit, implicit, or pre-determined symbols).
2. When generating the `lastprivate` comparison ops, we don't directly
use the SSA values of the UBs and steps. Instead, we regenerated these
SSA values from the original loop bounds' expressions. We have to do
this to avoid using `host_eval` values in the `lastprivate` comparison
logic which is illegal.
2025-03-07 05:44:39 +01:00
Thirumalai Shaktivel
e15545cad8
[Flang][OpenMP] Allow copyprivate and nowait on the directive clauses (#127769)
Issue:
- Single construct used to throw a semantic error for copyprivate and
  nowait clause when used in the single directive.
- Also, the copyprivate with nowait restriction has been removed from
  OpenMP 6.0

Fix:
- Allow copyprivate and nowait on both single and end single directive
- Allow at most one nowait clause
- Throw a warning when the same list item is used in the copyprivate clause
  on the end single directive

From Reference guide (OpenMP 5.2, 2.10.2):
```
!$omp single [clause[ [,]clause] ... ]
loosely-structured-block
!$omp end single [end-clause[ [,]end-clause] ...]

clause:
  copyprivate (list)
  nowait
  [...]

end-clause:
  copyprivate (list)
  nowait
```

Towards: https://github.com/llvm/llvm-project/issues/110008
2025-03-07 09:24:32 +05:30
Yaxun (Sam) Liu
f3dc358953
[MC] output inlined-at debug info (#106230)
Currently MC print source location of instructions in comments in
assembly when debug info is available, however, it does not include
inlined-at locations when a function is inlined.

For example, function foo is defined in header file a.h and is called
multiple times in b.cpp. If foo is inlined, current assembly will only
show its instructions with their line numbers in a.h. With inlined-at
locations, the assembly will also show where foo is called in b.cpp.

This patch adds inlined-at locations to the comments by using
DebugLoc::print. It makes the printed source location info consistent
with those printed by machine passes.
2025-03-06 22:47:11 -05:00
Yaxun (Sam) Liu
2674034422
Reland "[HIP] Use original file path for CUID" (#111885)
This patch fixes the buildbots failure of lit tests on MacOS. Since
clang driver options depend on toolchain, we cannot hardcode CUID hash.
On MacOS there is an extra -mlinker-version= option.
2025-03-06 22:46:41 -05:00
Lang Hames
2c8b2dc3f4 [ORC-RT] Rename 'orc_rt_*CWrapper*' types and functions to 'orc_rt_*Wrapper*'.
The orc_rt_ prefix implies C API anyway (the C++ API should use the orc_rc::
namespace), so the 'C' is redundant here.
2025-03-07 14:31:42 +11:00
Aiden Grossman
f984b472c4 [Github] Revert bumping actions-script version in issue-write
This patch reverts that upgrade which was performed in
74df2032d467618a9aab085120539e306f21bcc0. This broke the workflow, presumably
due to the breaking changes introduced in v5 of this action.

This is a stop-gap for #130211.
2025-03-07 03:21:43 +00:00
Valentin Clement (バレンタイン クレメン)
478e516140
[flang][cuda] Sync double descriptor after c_f_pointer call (#130194)
After a global device pointer is set through `c_f_pointer`, we need to
sync the double descriptor so the version on the device is also up to
date.
2025-03-06 19:19:51 -08:00
Kito Cheng
55f86cf023
[RISCV][clang] Fix wrong VLS CC detection (#130107)
RISCVABIInfo::detectVLSCCEligibleStruct should early exit if VLS calling
convention is not used, however the sentinel value was not set to
correctly, it should be zero instead of one.
2025-03-07 11:15:20 +08:00
Kazu Hirata
8839ba4187
[Instrumentation] Avoid repeated hash lookups (NFC) (#129988)
Co-authored-by: Nikita Popov <github@npopov.com>
2025-03-06 19:07:36 -08:00
Jim Lin
93b3cbadc2 [RISCV] Remove the TODO for lowering f32 libcall on RV64 with lp64 abi. (NFC)
The unnecessary extension doesn't exist anymore after https://reviews.llvm.org/D65497.
2025-03-07 10:52:04 +08:00
Jim Lin
2bd9f268b4 [RISCV] Fix typo. +Zve64x -> zve64x. 2025-03-07 10:52:04 +08:00
Jacob Lalonde
5b1c281fca
[LLDB][Docstrings] Fix some poorly formatted Docstrings (#129605)
I was looking earlier on the public doc website, and noticed the
markdown was very badly mangled for this recent docstring that I added.
So I'm dropping the backticks and just leaving the snippet.


![image](https://github.com/user-attachments/assets/de63ab73-3bd5-4f8f-a07c-9f6accfee7e1)
2025-03-06 18:57:54 -08:00
Joseph Huber
d5cef39d74
[Clang] Make '-Wglobal-constructors` work on the GNU attributes (#129917)
Summary:
The `-Wglobal-constructors` option is useful for restricting the usage
of global constructors / destructors. However, it currently ignores the
attributes that introduce global constructors, meaning that the module
can still have ctors if `-Werror` is set. If this is intentional by the
user, I believe it would be more correct to push the diagnostic.
2025-03-06 20:43:42 -06:00
Craig Topper
f5eeeec4d3
[MachinePipeliner] Use Register. NFC (#130165) 2025-03-06 18:39:29 -08:00
Matt Arsenault
7425af4b7a
AMDGPU: Add pseudoinstruction for agpr or vgpr constants (#130042) 2025-03-07 09:18:22 +07:00
LLVM GN Syncbot
2e53856bda [gn build] Port 6c4febee2992 2025-03-07 02:09:56 +00:00
Nico Weber
e5c5e621e6 [gn] Make sync script sync .mm files too
Motivated by #129332, which added a new .mm file that didn't get
autosynced.
2025-03-06 21:09:10 -05:00
Augie Fackler
94c937d321 [bazel] fix lldb deps some more 2025-03-06 20:39:26 -05:00
Joseph Huber
ca39a029b6
[Clang] Fix 'gpuintrin.h' match when included with no arch set (#129927)
Summary:
These require `+ptx` features to be set even though they're guarded by
the `__nvvm_reflect`. Rather than figure out how to hack around that
with the `target` attribute I'm just going to disable it for 'generic'
builds and use the slow version for now.
2025-03-06 19:37:39 -06:00
Kito Cheng
c95dc2d439
[clang][test] Fix -DBUILD_SHARED_LIBS build by adding depency on Targ… (#130105)
…etParser from clangTesting

Commit 979c275097a642e9b96c6b0a12f013c831af3a6e (#129868) introduced a
dependency on the llvm::Triple::Triple in `lookupTarget`. This is part
of TargetParser, which wasn't listed in
clang/lib/Testing/CMakeLists.txt. This broke the
-DBUILD_SHARED_LIBS=True builds.

Fixes #130112
2025-03-07 09:31:33 +08:00
Augie Fackler
7a7fe6e8ca [bazel] fix libc deps for 542d52b1e8a0a7e04538f608487603124c70e1ab 2025-03-06 20:24:38 -05:00
Jim Lin
49bb51ed91
[RISCV][LibCall] Add libcall for i64 -> bf16 (#130024)
Add support for lowering i64 -> bf16 with libcall.
2025-03-07 09:23:50 +08:00
Craig Topper
0a63eb882a
[TargetRegisterInfo][ARM] Use MCRegister in isInlineAsmReadOnlyReg interface. NFC (#130149) 2025-03-06 17:20:36 -08:00
Jason Molenda
82af9888db Revert "[lldb][Mach-O] Don't read symbol table of specially marked binary (#129967)"
This reverts commit 397696bb3d26c1298bf265e4907b0b6416ad59c9.

This breaks the macOS CI bots, I need to use $LDFLAGS in the $LD
invocation when building the dylib to get the dylibs to build on
the CI bots.  But I've added "-lno-nlists -lhas-nlists" to the LDFLAGS
for the main binary in the same directory, so using LDFLAGS will
result in a compile error for the dylibs.  I'll need to build the
dylibs in a subdir with a different Makefile, will reland with that
change in a bit.
2025-03-06 17:19:43 -08:00