529975 Commits

Author SHA1 Message Date
Vitaly Buka
7dd5f23279
[NFC][LTO] Move GUID calculation into CfiFunctionIndex (#130370)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
2025-03-07 18:59:48 -08:00
R
3121da52aa Revert "[flang] In AllocMemOp lowering, convert types for calling malloc on 32-bit (#129308)"
This reverts commit cf1964af5a461196904b663ede04c26555fcff69.

This causes breakage on all the non-x86 buildbots as they don't have the i686
target enabled. This was missed in pre-commit CI.
2025-03-08 02:42:24 +00:00
Bruno Cardoso Lopes
d8747eac36
[MLIR][LLVMIR] Translation: honor frame-pointer fn attribute (#130335) 2025-03-07 18:34:10 -08:00
R
cf1964af5a
[flang] In AllocMemOp lowering, convert types for calling malloc on 32-bit (#129308)
Although 32-bit targets are currently not officially supported, add a type conversion in the AllocMemOp lowering when calling the `malloc` function on 32-bit targets. This fixes a type mismatch, and this fix makes it easier to potentially support such targets in the future.

This involves making sure the `LLVMTypeConverter` has the necessary information to know the target bit width.

Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
2025-03-08 02:25:17 +00:00
Vitaly Buka
5bc166728a
Revert "Reland [EquivClasses] Introduce members iterator-helper" (#130380)
Reverts llvm/llvm-project#130319

Multiple bot failures.
2025-03-07 17:46:53 -08:00
Connector Switch
a5588b6d20
[libc] implement strings/ffs (#129892)
This patch adds the `strings/ffs` function.
ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/ffs.html
Closes: #122054.
2025-03-08 09:31:18 +08:00
Ivan Kosarev
15869a861b
[AMDGPU][MC] Don't crash on decoding invalid SOP1 ssrc0 operands. (#130302)
These are encoded as 8-bit fields.
2025-03-08 01:10:09 +00:00
Heejin Ahn
76393d3863
[WebAssembly] Rename functions in wasm-eh.cpp (#130220)
I think it is generally better for tests have some descriptive function
names so that we can insert new tests in the middle and don't have to
renumber all tests.

Also recently I added a (named) test to this file in #129020 so I think
it's consistent for other tests to be named.
2025-03-07 16:54:22 -08:00
JaydeepChauhan14
ab87206c4b
[X86][GlobalISel] Enable POW/EXP*/LOG* functions with libcall mapping (#130328) 2025-03-08 07:30:36 +07:00
Matt Arsenault
8ce612ff70
AMDGPU: Replace undef phi inputs with poison in tests (#130267)
I think the chance of this changing the tests in meaningful ways
is very low. This was perl with a few minor adjustments to a few
tests that produce new undefs. Only one test had a minor codegen
change with the switch, which I dropped from the change.
2025-03-08 07:14:29 +07:00
Matt Arsenault
ecec7d15a7
DAG: Use phi in alloca constant case to create virtual registers (#130254)
This is a follow up from 39bf765bb671fa7df3fe6c164cc9532fcb8653bd,
for the other case handled here. We would create CopyToReg marked
as uniform, even though the end phi would need to use VGPRs due
to another divergent input. There's no directly observable change in
the final output of the new test, but it does hit this case.
2025-03-08 07:13:11 +07:00
Vitaly Buka
0db702ac8e
[NFC][IR] Wrap std::set into CfiFunctionIndex (#130361)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.

We need a data structure to lookup by GUID.
Wrapping allow us to change implementation
with minimal changes to users.
2025-03-07 15:57:39 -08:00
Valentin Clement (バレンタイン クレメン)
ae42f07103
[flang][cuda] Allow array pointer for atomicexch and atomiccas (#130363) 2025-03-07 15:36:08 -08:00
Valentin Clement (バレンタイン クレメン)
829e8993e5
[flang][cuda] Lower __LDCA, __LDCS, __LDLU, __LDCV, __LDCG with arrays (#130357) 2025-03-07 15:35:52 -08:00
Greg Clayton
8ac359ba0d
Add complete ObjectFileJSON support for sections. (#129916)
Sections now support specifying:
- user IDs
- file offset/size
- alignment
- flags
- bool values for fake, encrypted and thread specific sections
2025-03-07 15:34:27 -08:00
Chris B
0ea52234fc
[DXC] Add -metal flag to DXC driver (#130173)
This adds a flag to the DXC driver to enable calling the metal shader
converter if it is available to convert the final shader output for
metal.
2025-03-07 17:28:41 -06:00
Lei Huang
23a44b925a
[NFC] Add additional checks to test for vec_pack_to_short_fp32 (#130324)
Update test in prep for IR changes that will be introduced in
https://github.com/llvm/llvm-project/pull/129923
2025-03-07 18:27:35 -05:00
Alexey Samsonov
76e9b2a614
[libc][bazel] Introduce libc_test_library macros. (#130355)
Use it instead of libc_support_library macros for all helper libraries
that are used for unit tests. See #130327 for the rationale why we want
to do this. With this change, we can additionally ensure that no
testonly library will end up being a dependency of production libraries.
2025-03-07 15:09:23 -08:00
Ziqing Luo
b2563028cf
[-Wunsafe-buffer-usage] Add alloc_size knowledge to the 2-param span constructor warning (#114894)
We can take advantage of the attribute `alloc_size`.  For example, 
```
void * malloc(size_t size) __attribute__((alloc_size(1)));

std::span<char>{(char *)malloc(x), x}; // this is safe
```

rdar://136634730
2025-03-07 15:05:20 -08:00
Vitaly Buka
e3076c6f3d
[NFC][IR] Use emplace instead of insert (#130360)
Preparation for for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
2025-03-07 14:57:02 -08:00
Vitaly Buka
d8e8892ddf
[NFC][ThinLTO] Avoid temporary std::string (#130353)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
2025-03-07 14:56:44 -08:00
Vitaly Buka
e4a6e2eb71
[NFC][IR] Remove redundant .empty() check (#130352)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
2025-03-07 14:48:00 -08:00
Vitaly Buka
356bbb0b25
[NFC][IR] Use auto instead of explicit type (#130351)
Preparation for CFI Index refactoring,
which will fix O(N^2) in ThinLTO indexing.
2025-03-07 14:47:24 -08:00
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