529852 Commits

Author SHA1 Message Date
Ryosuke Niwa
c419acdf82
[alpha.webkit.UncountedCallArgsChecker] Recognize CXXUnresolvedConstructExpr as a safe origin. (#130258)
Handle CXXUnresolvedConstructExpr in tryToFindPtrOrigin so that
constructing Ref, RefPtr, CheckedRef, CheckedPtr, ... constructed in
such a way that its type is unresolved at AST level will be still
treated as a safe pointer origin.

Also fix a bug in isPtrOfType that it was not recognizing
DeducedTemplateSpecializationType.
2025-03-07 14:40:33 -08:00
Tom Tromey
993cbead9e
Two fixes for DISubrangeType (#130345)
My previous patch to add DISubrangeType (#126772) had a couple of minor
errors. This patch corrects them.

1. When using a DISubrangeType as an array index type, the wrong tag was
written into the DIE.

2. I'd intended for subranges to use bit strides, not byte strides --
but neglected to actually implement this. Ada needs bit strides.

This patch adds a new test that checks both these things.

Finally, this patch adds some documentation for DISubrangeType.
2025-03-07 14:23:05 -08:00
Alexey Samsonov
d90423e310
[libc][bazel] Minor cleanup to remove unused dependencies. (#130348)
* strcpy doesn't need to depend on memcpy
* qsort_test_helper has been generalized and doesn't need to depend on
qsort.

This is a small cleanup to unblock the work outlined in #130327.
2025-03-07 13:31:18 -08:00
agozillon
f1178815d2
[Flang][OpenMP][MLIR] Implement close, present and ompx_hold modifiers for Flang maps (#129586)
This PR adds an initial implementation for the map modifiers close,
present and ompx_hold, primarily just required adding the appropriate
map type flags to the map type bits. In the case of ompx_hold it
required adding the map type to the OpenMP dialect. Close has a bit of a
problem when utilised with the ALWAYS map type on descriptors, so it is
likely we'll have to make sure close and always are not applied to the
descriptor simultaneously in the future when we apply always to the
descriptors to facilitate movement of descriptor information to device
for consistency, however, we may find an alternative to this with
further investigation. For the moment, it is a TODO/Note to keep track
of it.
2025-03-07 22:22:30 +01:00
Florian Hahn
8dd160f476
Revert "[VPlan] Fold NOT into predicate of wide compares." (#130347)
Reverts llvm/llvm-project#129430

this seems to have introduced a divergence between legacy and
VPlan-based cost model

https://lab.llvm.org/buildbot/#/builders/30/builds/17159
2025-03-07 21:18:49 +00:00
Ramkumar Ramachandra
21d973dbb3
Reland [EquivClasses] Introduce members iterator-helper (#130319)
Changes: Fix the expectations in EquivalenceClassesTest.MemberIterator,
also fixing a build failure.
2025-03-07 21:09:31 +00:00
Valentin Clement (バレンタイン クレメン)
dcda314b6c
[flang][cuda] Fix atmoicxor lowering to accept arrays (#130331)
The first agrument can be an address of a scalare, an array element or
even just the address of the first element of an array. Update lowering
to not trigger elemental lowering.
2025-03-07 13:05:42 -08:00
Michael Buch
6cc8b0bef0
[lldb][test] Skip libsanitizers tests for now (#130305)
These are macOS tests only and are currently failing on the x86_64 CI
and on arm64 on recent versions of macOS/Xcode.

The tests are failing because we're stopping in:
```
Process 17458 stopped
* thread #1: tid = 0xbda69a, 0x00000002735bd000
  libsystem_malloc.dylib`purgeable_print_self.cold.1, stop reason = EXC_BREAKPOINT (code=1, subcode=0x2735bd000)
```
instead of the libsanitizers library. This seems to be related to
`-fsanitize-trivial-abi` support

Skip these for now until we figure out the root cause.
2025-03-07 21:04:24 +00:00
Yaxun (Sam) Liu
5ff43550fa Revert "Fix amdgpu-arch for dll name on Windows (#101350)"
This reverts commit 6fa1bfad65edefe3f4c17740f05297d34e833b47.

Revert it due to breaking buildbot:

Z:\b\llvm-clang-x86_64-sie-win\llvm-project\clang\tools\amdgpu-arch\AMDGPUArchByHIP.cpp(104):
 error C2039: 'parse': is not a member of 'llvm::VersionTuple'

https://lab.llvm.org/buildbot/#/builders/46/builds/13184
2025-03-07 15:54:50 -05:00
Tai Ly
dfbadfc5e5
[mlir][tosa] Change MatMul zero-point to inputs (#130332)
* Change zero-point attributes to inputs
* Fix relevant mlir tests
* Enhance ShardingInterface in MatMul

Signed-off-by: Udaya Ranga <udaya.ranga@arm.com>
Co-authored-by: Udaya Ranga <udaya.ranga@arm.com>
2025-03-07 12:37:28 -08:00
Florian Hahn
cb3ce30ca8
[VPlan] Fold NOT into predicate of wide compares. (#129430)
Add simplification to fold negation into a compare, if the negation is
the only user of the compare. This removes a number of redundant
negations.

Alive2 Proofs for FPCMP test changes:  https://alive2.llvm.org/ce/z/WGDz9U

PR: https://github.com/llvm/llvm-project/pull/129430
2025-03-07 20:32:43 +00:00
Alex MacLean
1b01f058f4
[NVPTX] Make GlobalUniqueCallSite a member of NVPTXISelLowering (#130212)
This change moves GlobalUniqueCallSite into NVPTXISelLowering. In
processes where multiple compilations occur, this makes call site
enumeration local to individual compilation, which ensures that call
site numbers are consistently sequential within each compilation and is
independent of other compilations happening in parallel.
2025-03-07 12:32:38 -08:00
Aaron Ballman
8c130b11cb Update the C status page for N3409
This was implemented in b19ed9c0435c5f7c89cba40285df3a1395a782fd but I
forgot to update the website at the same time.
2025-03-07 15:22:28 -05:00
Mircea Trofin
11b1f154be
Optionally print !prof metadata inline (#130303)
Inspired by PR #127944, this patch adds an option to print profile metadata inline with respect to the instruction (or function) it annotates - this saves one time from having to search up and down large textual modules to find this info.
2025-03-07 12:22:13 -08:00
Aaron Ballman
0ea02e7721 [C2y] Claim nonconformance to WG14 N3410
This paper made it a constraint violation for the same identifier
within a TU to have both internal and external linkage. It was
previously UB.

Clang does not correctly diagnose the constraint in some cases,
documented in the added test case.
2025-03-07 15:15:53 -05:00
Vitaly Buka
b0baa1d8bd
[gold] Fix compilation (#130334)
After #115331.
2025-03-07 12:06:03 -08:00
Jacek Caban
868c409d38 Reapply "[LLD][COFF] Support CF guards on ARM64X (#128440)"
Both native and EC views share table chunks. Ensure relevant symbols are
set in both symbol tables.
2025-03-07 21:04:30 +01:00
Joseph Huber
fefb6858da [Clang][Docs] Fix `ext_vector_type` code block documentation 2025-03-07 13:55:39 -06:00
Aaron Ballman
b19ed9c043
[C2y] Implement WG14 N3409 (#130299)
This paper removes UB around use of void expressions. Previously, code
like this had undefined behavior:
```
  void foo(void) {
    (void)(void)1;
    extern void x;
    x;
  }
```
and this is now well-defined in C2y. Functionally, this now means that
it is valid to use `void` as a `_Generic` association.
2025-03-07 14:46:29 -05:00
Michael Jones
3a228a33c4
[libc][bazel] Main f16 test targets, new f16 funcs (#130208)
This patch adds acosf16 and asinf16 which I missed last patch, and also
the primary math tests for the float16 functions.
2025-03-07 11:38:15 -08:00
Daniel Chen
78631ac51b
[Flang] explicitly link the pthread library when building shared flang-rt. (#129956)
This patch is to explicitly link the pthread library when building
shared flang-rt.
On AIX, for example, it needs to link in `libpthread.a` explicitly in
order to resolve the references to those `pthread_*` functions in
`include/flang-rt/runtime/lock.h`
2025-03-07 14:13:38 -05:00
Vitaly Buka
4bc3592bd2
[MachinePipeliner] Fix use-after-free coping values of the same DenseMap (#130311)
After #130165.

In the code: `VRMap[CurStageNum][Def] = VRMap[CurStageNum][LoopVal]`
`VRMap[CurStageNum][LoopVal]` calculates a reference before
`VRMap[CurStageNum][Def]` which may rehash the DenseMap.
Then the reference can be dead.
2025-03-07 11:09:57 -08:00
Craig Topper
6a42dc694c
[TableGen] Simplify emitULEB128 in DecoderEmitter.cpp. NFC (#130214)
Instead of returning the number of bytes emitted, just take the iterator
by reference so the increments in emitULEB128 will update the copy in
the caller.

Also pass the iterator by reference to emitNumToSkip so we don't need a
separate I += 3 in the caller.
2025-03-07 11:09:34 -08:00
Ian Wood
813bbe055d
[mlir][linalg] Allow fusing reshapes with non-parallel operands (#130148)
Removes the condition that checks that operand is not indexed by
reduction iterators which allows for more fine-grained control via the
reshape fusion control function. For example, users could allow fusing
reshapes expand the M/N dims of a matmul but not the K dims (or preserve
the current behavior by not fusing at all).

---------

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
2025-03-07 11:09:14 -08:00
Jerry-Ge
2619c2ed58
Revert "[mlir][tosa] Change MatMul zero-point to inputs" (#130330)
Reverts llvm/llvm-project#129785. Need rebase.
2025-03-07 11:03:38 -08:00
Corbin Robeck
50cfdf545e
[MLIR][ROCDL] Add Scale Convert Packed (B)FP8 <-> (B)F16 Support for GFX950 (#130300)
Add Rocdl support for the following GFX950 instructions:

CVT_SCALE_PK_FP8_F16
CVT_SCALE_PK_BF8_F16 
CVT_SCALE_PK_FP8_BF16 
CVT_SCALE_PK_BF8_BF16 
CVT_SCALE_SR_FP8_F16 
CVT_SCALE_SR_BF8_F16 
CVT_SCALE_SR_FP8_BF16 
CVT_SCALE_SR_BF8_BF16 
CVT_SCALE_PK_F16_FP8 
CVT_SCALE_PK_F16_BF8 
CVT_SCALE_F16_FP8 
CVT_SCALE_F16_BF8
2025-03-07 14:00:40 -05:00
Bruno Cardoso Lopes
8a43bc2c09
[MLIR][LLVMIR] Import: fix llvm.call attribute inheritance (#130221)
`inst->getFnAttr(Kind)` fallbacks to check if the parent has an
attribute, which breaks roundtriping the LLVM IR. This change actually
checks only in the call attribute list (no fallback to parent queries).

It's possible to argue that this small optimization isn't harmful, but
seems too early if it's breaking roundtrip behavior.
2025-03-07 10:59:03 -08:00
Tai Ly
106c96462f
[mlir][tosa] Change MatMul zero-point to inputs (#129785)
* Change zero-point attributes to inputs
* Fix relevant mlir tests
* Enhance ShardingInterface in MatMul

Signed-off-by: Udaya Ranga <udaya.ranga@arm.com>
Co-authored-by: Udaya Ranga <udaya.ranga@arm.com>
2025-03-07 10:46:25 -08:00
Augie Fackler
df79000896 [clangd] fix warning by adding missing parens 2025-03-07 13:38:49 -05:00
Jerry-Ge
96f369791d
[mlir][tosa] Update the description section for CastOp to align with TOSA v1.0 spec (#129958)
Updated the description section to include all data types and match the
ordering with the spec.

https://www.mlplatform.org/tosa/tosa_spec.html#_cast

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2025-03-07 10:36:43 -08:00
Jerry-Ge
ca582b1684
[mlir][tosa] Add FP8 lit tests (#127730)
Add FP8 lit tests to the following operators:

ARGMAX
AVGPOOL
CONV2D
CONV3D
DEPTHWISE_CONV2D
MATMUL
MAX_POOL2D
TRANSPOSE_CONV2D
CONST
CAST
CONCAT
PAD
RESHAPE
REVERSE
SLICE
TILE
TRANSPOSE
GATHER
SCATTER

Signed-off-by: Tai Ly <tai.ly@arm.com>
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Co-authored-by: Tai Ly <tai.ly@arm.com>
2025-03-07 10:36:27 -08:00
Tom Eccles
ca1833b91e
[mlir][OpenMP] cast address space of private variables (#130301)
Fixes #130159

The problem is that the alloca created for the private variable uses the
default alloca address space in that module, but the function the
pointer is being passed to expects a different address space, leading to
a type missmatch in the function argument.

I know nothing about how AMDGPU is supposed to work. I based this
solution on code from createDeviceArgumentAccessor(). Please could
somebody from AMD confirm this solution is appropriate.
2025-03-07 18:30:57 +00:00
LLVM GN Syncbot
c59713c2d8 [gn build] Port ce9e1d3c15ed 2025-03-07 18:23:23 +00:00
Andy Kaylor
8eb9b947af
[CIR] Emit init of local variables (#130164)
Local variable initialization was previously being ignored. This change
adds support for initialization of scalar variables with constant values
and introduces the constant emitter framework.
2025-03-07 10:23:06 -08:00
Valentin Clement (バレンタイン クレメン)
5668c7bb90
[flang][cuda] Add more interfaces for __ldca, __ldcs, __ldlu and __ldcv (#130218) 2025-03-07 10:19:20 -08:00
Yaxun (Sam) Liu
6fa1bfad65
Fix amdgpu-arch for dll name on Windows (#101350)
Recently HIP runtime changed dll name to amdhip64_n.dll on Windows,
where n is ROCm major version number.

Fix amdgpu-arch to search for amdhip64_n.dll on Windows.
2025-03-07 13:13:46 -05:00
JaydeepChauhan14
a2b3dafcdf
[X86][NFC] Updated POW/EXP*/LOG* functions testcases (#129677)
- Added GlobalISel runs as precommit testcase for G_POW/G_EXP*/G_LOG*.
- Removed unused tag MISSED.
2025-03-07 19:06:27 +01:00
anjenner
ce9e1d3c15
Modify the localCache API to require an explicit commit on CachedFile… (#115331)
…Stream.

CachedFileStream has previously performed the commit step in its
destructor, but this means its only recourse for error handling is
report_fatal_error. Modify this to add an explicit commit() method, and
call this in the appropriate places with appropriate error handling for
the location.

Currently the destructor of CacheStream gives an assert failure in Debug
builds if commit() was not called. This will help track down any
remaining uses of the API that assume the old destructior behaviour. In
Release builds we fall back to the previous behaviour and call
report_fatal_error if the commit fails.
2025-03-07 17:58:36 +00:00
John Brawn
fb0891387a
[SelectionDAG] Clean up some redundant setting of node flags (NFC) (#130307)
PR #130124 added a use of FlagInserter to the start of
SelectionDAGLegalize::PromoteNode, making some of the places where we
set flags be redundant, so remove them. The places where the setting of
flags remains are in non-floating-point operations.
2025-03-07 17:51:13 +00:00
Renaud Kauffmann
d4754db15d
Test fix: Adding REQUIRES: asserts (#130314) 2025-03-07 09:49:47 -08:00
Simon Pilgrim
445c43d712 [InstCombine] Add test for missing (or (zext x), (shl (ashr x, bw-1))) -> (sext x) case
#129363 handled all the cases where there was a sext for the original source value, but not for cases where the source is already half the size of the destination type

Another regression noticed in #76524
2025-03-07 17:48:47 +00:00
Zibi Sarbinowski
afbbca5c9d
[z/OS] Add call to shmctl() to release shared memory on z/OS (#130163)
This PR will solve the issue with leaking shared memory we have after running llvm lit test on z/OS.
In particular llvm/unittests/ExecutionEngine/Orc/SharedMemoryMapperTest.cpp was causing the leak.
2025-03-07 12:41:17 -05:00
Ramkumar Ramachandra
86dfd90193
Revert "[EquivClasses] Introduce members iterator-helper" (#130313)
This reverts commit 259624bf6d, as it causes a build failure.
2025-03-07 17:38:38 +00:00
Jacek Caban
c53e527bf8
[LLD][COFF] Implement ECExportThunkChunk::classof (NFC) (#130106)
Allows using `dyn_cast_or_null` in `maybeAddAddressTakenFunction` in #128440.
2025-03-07 18:34:56 +01:00
Ramkumar Ramachandra
259624bf6d
[EquivClasses] Introduce members iterator-helper (#130139) 2025-03-07 17:24:14 +00:00
Joseph Huber
5c9d0a26d9
[LinkerWrapper] Try to fix testing on Windows (#130285)
Summary:
Thanks to @Meinersbur for finding this. The `:` character used in AMD's
target-id's is invalid on windows. This patch replaces them with `-`.

---------

Co-authored-by: Michael Kruse <github@meinersbur.de>
2025-03-07 11:10:21 -06:00
Daniel Paoliello
99c6342b5e
[win] Fix EH Cont Guard targets when SEH personality is used (#129612)
There were two issues when `/guard:ehcont` is enabled with the SEH
personality on Windows:
1. As @namazso correctly identified, we bail out of
`WinException::endFunction` early for `MSVC_TableSEH` with funclets,
expecting the exception data to be emitted in `endFunclet`, but
`endFunclet` didn't copy the EHCont metadata from the function to the
module.
2. The SEH personality requires that the basic block containing the
`catchpad` is the target, not the `catchret`.

Fixes #64585
2025-03-07 09:07:47 -08:00
Renaud Kauffmann
718c4ed8a0
[flang] [NFCI] Using getSource instead of getOriginalDef (#128984)
As discussed in past MRs, this change removes the use of getOriginalDef
to use getSource instead to gather data from an indirection.
2025-03-07 08:47:42 -08:00
hanbeom
0ee8f69978
[VectorCombine] Fix invalid shuffle cost argument of foldShuffleOfSelects (#130281)
In the previous code (#128032), it specified the destination vector as the
getShuffleCost argument. Because the shuffle mask specifies the indices
of the two vectors specified as elements, the maximum value is twice the
size of the source vector. This causes a problem if the destination
vector is smaller than the source vector and specify an index in the
mask that exceeds the size of the destination vector.

Fix the problem by correcting the previous code, which was using wrong
argument in the Cost calculation.

Fixes #130250
2025-03-07 16:40:26 +00:00
Joseph Huber
3ed4daf9a7 [Clang] Add missing printer for vector type attribute 2025-03-07 10:39:09 -06:00