528927 Commits

Author SHA1 Message Date
Eisuke Kawashima
24abf2c728
[lldb] fix(lldb/**.py): fix invalid escape sequences (#94034)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-02-28 14:59:35 +00:00
Louis Dionne
037cf12b07
[libc++] Mark _XOPEN_SOURCE test as unsupported on FreeBSD (#128950)
The test otherwise fails on FreeBSD, which wasn't noticed when
originally landing the patch that added the test because FreeBSD
CI was disabled at that moment.
2025-02-28 09:58:49 -05:00
Yaxun (Sam) Liu
0f0665db06
[CUDA][HIP] check dtor in deferred diag (#129117)
Currently the deferred diag fails to diagnose calling of host function
in host device function in device compilation triggered by destructors.

This can be further divided into two issuse:

1. the deferred diag visitor does not visit dtor of member and parent
class when visiting dtor, which it should

2. the deferred diag visitor does not visit virtual dtor of explicit
template class instantiation, which it should

Due to these issues, some constexpr functions which call host functions
are emitted on device side, which causes undefind symbols in linking
stage, as revealed by
https://github.com/llvm/llvm-project/issues/108548

By fixing these issue, clang will diag the issues early during
compilation instead of linking.
2025-02-28 09:58:19 -05:00
Martin Storsjö
e6a0ee3d1d
[libc++][ci] Update the Windows toolchains to Clang 19 (#129232)
This also fixes test failures in the clang-cl build configs that started
a couple days ago. It seems like the failures were triggered by an update
to the base image on the Github provided runners.

There were failures in test/libcxx/system_reserved_names.gen.py, due to
an issue in an Clang intrinsics header (avx512fp16intrin.h); this issue
was observed and fixed for Clang 19 in 6f04f46927c. The test does
    #define A SYSTEM_RESERVED_NAME
which clashes with a parameter with the name `A` in that header.

By upgrading the toolchain to Clang 19, we get fixed version of this
intrinsics header.

Also update the llvm-mingw toolchains to a version with Clang 19.1.7.
2025-02-28 09:56:16 -05:00
Balázs Benics
dea08c2b67
Fix RegionStore assertion failure after #127602 (#129224)
Basically, we may leave the loop because if exhaust the fields, array
elements or other subobjects to initialize.
In that case, the Bindings may be in an exhausted state, thus no further
addBinding calls are allowed.

Let's harden the code by sprinkling some early exists in the recursive
dispatcher functions.
And to actually fix the issue, I added a check guarding the single
unguarded addBinding right after a loop I mentioned.

Fixes #129211
2025-02-28 15:48:31 +01:00
Brox Chen
db973cea7c
[AMDGPU][True16][CodeGen] True16 Add OpSel when optimizing exec mask (#128928)
True16 Add OpSel when optimizing exec mask

True16 VOPCX have the opsel argument. Add it when we create these
instructions in SIOptimizeExecMasking.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-02-28 09:41:05 -05:00
Donát Nagy
71389e565d
[NFC][analyzer] OOB test consolidation III: 'outofbound' tests (#128508)
Before commit 6e17ed9 the test files `outofbound.c` and
`outofbound-notwork.c` tested the behavior of the old alpha checker
`alpha.security.ArrayBound` (V1); then that commit converted them into
tests for the checker `security.ArrayBound` which was previously called
`alpha.security.ArrayBoundV2`.

This commit removes these test files and migrates their useful content
to `out-of-bounds.c`. The file `outofbound.c` contained lots of
testcases that covered features which are also covered in
`out-of-bounds.c` or `out-of-bounds-diagnostics.c`; those redundant
cases are discarded during this migration process.

This is part of a commit series that reorganizes the tests of
`security.ArrayBound` to a system that's easier to understand and
maintain.
2025-02-28 15:26:57 +01:00
Matt Arsenault
00f5763943
AMDGPU: Remove nocapture attribute from is.shared and is.private intrinsics (#129238)
This should be replaced with captures(address), but tablegen currently
has
no way to indicate that on an intrinsic. I opened issue #129184 to fix
this.
2025-02-28 21:26:25 +07:00
Virginia Cangelosi
2477f82db9
[clang] Update SVE load and store intrinsics to have FP8 variants (#126726) 2025-02-28 14:20:59 +00:00
Benjamin Kramer
9e2eb95c23 [Coroutines] [CodeGen] Don't actually emit an output file from unit test 2025-02-28 15:13:27 +01:00
Jonas Paulsson
c298f71ea6
[SystemZ] Fix regstate of SELRMux operand in selectSLRMux(). (#128555)
It seems that there can be other cases with this that also can lead to
wrong code (discovered with csmith). This time it involved not the kill
flag but the undef flag.

Use the intersection of the flags from both MachineOperand:s instead
of the RegState from just one of them.
2025-02-28 15:03:04 +01:00
gdehame
e481943f5f
[MLIR][EmitC][cf] Bugfix: correctly inline emitc.expression op in the emitted if condition of a cf.cond_br (#128958)
emitc.expression ops are expected to be inlined in the if condition in
the lowering of cf.cond_br if this is their only use but they weren't
inlined.
Instead, a use of the variable corresponding to the expression result
was generated but with no declaration/definition.
2025-02-28 15:00:16 +01:00
Nikita Popov
5d89123a39 [X86] Add tests for sspstrong with phi nodes (NFC) 2025-02-28 14:56:41 +01:00
Zahira Ammarguellat
26fc3aa983
[OpenMP] Missing implicit otherwise clause in metadirective. (#127113)
Compiling this:
 `int main() {`
 ` #pragma omp metadirective when(use r= {condition(0)}`
`: parallel for)`
  `for (int i=0; i<10; i++)`
  ;
}`

is generating an error:
`error: expected expression`
The compiler is interpreting this as if it's compiling a `#pragma omp
metadirective` with no `otherwise` clause.
In the OMP5.2 specs chapter 7.4 it's mentioned that: 
`If no otherwise clause is specified the effect is as if one was
specified without an associated directive variant.`
This patch fixes the issue.
2025-02-28 08:02:35 -05:00
Benjamin Maxwell
89e7f4d31b
[LV] Teach the vectorizer to cost and vectorize modf and sincospi intrinsics (#129064)
Follow on to #128035. It is a small extension to support vectorizing
`llvm.modf.*` and `llvm.sincospi.*` too.

This renames the test files from `sincos.ll` ->
`multiple-result-intrinsics.ll` to group together the similar tests
(which make up most of this PR).
2025-02-28 12:56:12 +00:00
Haojian Wu
a19979166c
[modules] Add missing test file for b21ee08e57173102b67bc18237b135550 (#129221)
The commit missed a test file.
2025-02-28 13:50:18 +01:00
Nikolas Klauser
1a6f9fd87f
[libc++] Enable algorithm vectorization on arm neon (#128873)
Previously the wrong detection macro has been used to check whether arm
NEON is available. This fixes it, and removes a few unnecessary includes
from `__algorithm/simd_utils.h` as a drive-by.
2025-02-28 13:38:52 +01:00
Paul Walker
1aea0241f1
[LLVM][SVE] Add isel for bfloat based select operations. (#128881)
Patch also adds missing tests for unpacked half and float types.
2025-02-28 10:56:09 +00:00
Paul Osmialowski
c93dc581d9
[libc++][test] extend -linux-gnu XFAIL to cover all of the -linux targets (#129140)
The default triple of Amazon Linux on AArch64 is aarch64-amazon-linux,
see issue highlighded by PR #109263, somewhat serious linker issues are
encountered if any other triple is being used.

Unfortunately, this makes XFAIL lines like:
`XFAIL: target=aarch64{{.*}}-linux-gnu` ineffective,
making it impossible to complete all of the check-cxx without failures.
2025-02-28 10:54:08 +00:00
Jack Frankland
f363cfaa74
[mlir][tosa][tosa-to-linalg] Ignore Int NaN Mode (#129041)
For non floating point operations NaN propagation mode has no meaning
and can be safely ignored. For non integer types skip the compare and
select materialization for NaN propagation even in "IGNORE" mode. This
fixes a bug where an unchecked `cast<FloatType>()` was called in the
"IGNORE" case even when the operation is acting on integers.

Update the lit tests for the NaN propagation lowering to check that the
propagation logic is not materialized in the case of a non floating
point type e.g. i8.

Signed-off-by: Jack Frankland <jack.frankland@arm.com>
2025-02-28 10:41:44 +00:00
Nikita Popov
36f0838a3d [FunctionAttrs] Consider non-willreturn functions during capture inference
Matching the CaptureTracking change in abd97d9685c07c4787ff22e56c0a7b8963630063,
only directly infer captures(none) for
readonly+nocapture+willreturn+void.

Part of https://github.com/llvm/llvm-project/issues/129090.
2025-02-28 11:33:44 +01:00
Meng Zhuo
76910f914c
[tsan][RISCV] Add Go support for linux/riscv64 (#127295)
This is needed to support race detector in Golang.

See also: https://github.com/golang/go/issues/64345
2025-02-28 18:27:48 +08:00
Matt Arsenault
6a46cf4dc6
AMDGPU/GlobalISel: Restore disabled test (#129001) 2025-02-28 17:24:28 +07:00
Nikita Popov
abd97d9685 [CaptureTracking] Take non-willreturn calls into account
We can leak one bit of information about the address by either
diverging or not.

Part of https://github.com/llvm/llvm-project/issues/129090.
2025-02-28 11:15:28 +01:00
Jay Foad
0ba4767fea
[AMDGPU] Cosmetic tweaks in AMDGPUAtomicOptimizer. NFC. (#129081)
Simplify iteration over the ToReplace vector, and some related cosmetic
cleanups.
2025-02-28 10:09:53 +00:00
klensy
62f15a042b
[flang][test] Fix filecheck annotation typos [2/n] (#126099)
Few more fixes, previous: #92387

Co-authored-by: klensy <nightouser@gmail.com>
2025-02-28 10:04:16 +00:00
Mikhail Goncharov
1adb00110e [bazel] port 15c49b9db3f60bdbd320271d5e97f118c00b95dd 2025-02-28 10:31:31 +01:00
pvanhout
f09e245b35 [NFC][clang] Remove trailing whitespace in Options.td 2025-02-28 10:29:42 +01:00
Devon Loehr
751f2fc8d5
Disable unique-object-duplication warning in templates (#129120)
I've been trying to resolve instances of the unique-object-duplication
warning in chromium code. Unfortunately, I've found that practically
speaking, it's near-impossible to actually fix the problem when
templates are involved.

My understanding is that the warning is correct -- the variables it's
flagging are indeed duplicated and potentially causing bugs as a result.
The problem is that hiddenness is contagious: if a templated class or
variable depends on something hidden, then it itself must also be
hidden, even if the user explicitly marked it visible. In order to make
it actually visible, the user must manually figure out everything that
it depends on, mark them as visible, and do so recursively until all of
its ancestors are visible.

This process is extremely difficult and unergonomic, negating much of
the benefits of templates since now each new use requires additional
work. Furthermore, the process doesn't work if the user can't edit some
of the files, e.g. if they're in a third-party library.

Since a warning that can't practically be fixed isn't useful, this PR
disables the warning for _all_ templated code by inverting the check.
The warning remains active (and, in my experience, easily fixable) in
non-templated code.
2025-02-28 10:25:55 +01:00
Mikhail Goncharov
a278b28a94 [bazel] fix build after bafd44bff58cff9efe569a221b232bab004d55cd 2025-02-28 10:20:16 +01:00
Jonathan Albrecht
ddaa5b3bfb
[SystemZ] Add header guard macros to vecintrin.h (#129170)
Add header guard macros to clang/lib/Headers/vecintrin.h. Found while
compiling the latest numpy with clang 19 on s390x which ends up
including vecintrin.h twice. The gcc version of this file has header
guards so numpy compiles fine with gcc.

Signed-off-by: Jonathan Albrecht <jonathan.albrecht@ibm.com>
2025-02-28 10:16:19 +01:00
Hans Wennborg
d0edd931bc
[Coroutines] Mark parameter allocas with coro.outside.frame metadata (#127653)
Parameters to a coroutine get copied (moved) to coroutine-local
instances which code inside the coroutine then uses.

The original parameters should not be part of the frame. Normally
CoroSplit figures that out by itself, but for [[clang::trivial_abi]]
parameters which, get destructed at the end of the ramp function, it
does not (see bug), causing use-after-free's if the frame is destroyed
before the end of the ramp (as happens if it doesn't suspend).

Since Clang knows these should never be part of the frame, use metadata
to make it so.

Fixes #127499
2025-02-28 09:54:47 +01:00
jeanPerier
a8db1fb9b5
[flang] update fir.coordinate_of to carry the fields (#127231)
This patch updates fir.coordinate_op to carry the field index as
attributes instead of relying on getting it from the fir.field_index
operations defining its operands.

The rational is that FIR currently has a few operations that require
DAGs to be preserved in order to be able to do code generation. This is
the case of fir.coordinate_op, which requires its fir.field operand
producer to be visible.
This makes IR transformation harder/brittle, so I want to update FIR to
get rid if this.

Codegen/printer/parser of fir.coordinate_of and many tests need to be
updated after this change.
2025-02-28 09:50:05 +01:00
Mariya Podchishchaeva
2871f69052
[clang] Fix issues with #embed and intializer lists/template arguments (#128890)
Sometimes number of expressions in InitListExpr is used for template
argument deduction. So, in these cases we need to pay attention to real
number of expressions including expanded #embed data.

Fixes https://github.com/llvm/llvm-project/issues/122306
2025-02-28 09:35:59 +01:00
Chuanqi Xu
15c49b9db3 [Coroutines] [CodeGen] Don't change AST in CodeGen/Coroutines
The root source of other odd bugs.

We performed a hack in CodeGen/Coroutines. But we didn't recognize that
the CodeGen is a consumer of AST. The CodeGen shouldn't change AST in
any ways. It'll break the assumption about the ASTConsumer in Clang's
framework, which may break any other clang-based tools which depends on
multiple consumers to work together.

The fix here is simple. But I am not super happy about the test. It is
too specific and verbose. We can remove this if we can get the signature
of the AST in ASTContext.
2025-02-28 16:03:50 +08:00
Kazu Hirata
44b9f5eeab
[CodeGen] Avoid repeated hash lookups (NFC) (#129190) 2025-02-27 23:01:35 -08:00
Kazu Hirata
f4aea1324d
[PowerPC] Avoid repeated hash lookups (NFC) (#129193) 2025-02-27 23:01:19 -08:00
Craig Topper
497d4f175e [SPIRV] Remove unused variable. NFC 2025-02-27 22:57:29 -08:00
Uday Bondhugula
9b514bc893
[MLIR][Affine] Fix affine data copy generate for zero-ranked memrefs (#129186)
Fix affine data copy generate for zero-ranked memrefs.

Fixes: https://github.com/llvm/llvm-project/issues/122210 and
https://github.com/llvm/llvm-project/issues/61167

Test cases borrowed from https://reviews.llvm.org/D147298, authored by
Lewuathe <Kai Sasaki>.

Co-authored-by: Kai Sasaki <lewuathe@gmail.com>
2025-02-28 12:16:21 +05:30
Kazu Hirata
192b13bc9f
[ProfileData] Avoid repeated hash lookups (NFC) (#129194) 2025-02-27 22:41:46 -08:00
Kazu Hirata
50064db174
[AMDGPU] Avoid repeated hash lookups (NFC) (#129189) 2025-02-27 22:41:35 -08:00
Fangrui Song
97da0856b0 [PowerPC] Simplify ELFStreamer and XCOFFStreamer 2025-02-27 22:26:07 -08:00
Madhur Amilkanthwar
9fefc013db
[GVN/PRE] Remove triple from GVN/PRE tests (#129073)
The tests in GVN/PRE need not to depend on target triple. Removing the
triple dependence from all the tests in this directory.
2025-02-28 11:43:45 +05:30
Philip Reames
b2152823e0 Revert "[RISCV][TTI] Add shuffle costing for masked slide lowering (#128537)"
This reverts commit 4904728cab8596320a77a895cb712fba07ea7bb1.  Downstream
test failed, reverting during investigation.
2025-02-27 22:03:18 -08:00
Matt Arsenault
d410f093da
AMDGPU: Simplify demanded vector elts of readfirstlane sources (#128646)
Stub implementation of simplifyDemandedVectorEltsIntrinsic for
readfirstlane.
2025-02-28 13:01:10 +07:00
Matt Arsenault
2fa6c5265e
AMDGPU: Add baseline tests for simplify elts of readfirstlane (#128645) 2025-02-28 12:56:58 +07:00
Chuanqi Xu
170b573682 [Driver] [C++20] [Modules] Warning for the surprising useless case for reduced BMI
Found in downstream. I didn't realize the output file for precompile and
reduced BMI refers to the same location. Then the generating process of
reduced BMI is basically a waste of time.
2025-02-28 13:36:29 +08:00
Arnab Dutta
3cccb2017f
[MLIR][Tensor] Enhance bufferization of tensor.expand_shape op (#128871)
Instead of inferring the output shape argument of
memref.expand_shape op, use output_shape argument of tensor.expand_shape
op by adding dynamic dimension support for bufferization of
tensor.expand_shape when there are more than one dynamic dim within a
reassociation set.
2025-02-28 10:45:38 +05:30
Johannes Doerfert
9f28621fae
[Attributor][NFC] Clang format (#129163) 2025-02-27 23:59:08 -05:00
Kareem Ergawy
e0c690990d
[flang][OpenMP] Add reduction clause support to loop directive (#128849)
Extends `loop` directive transformation by adding support for the
`reduction` clause.
2025-02-28 05:46:03 +01:00