554831 Commits

Author SHA1 Message Date
Michael Buch
2c3724419c
[lldb][Language] Add Language::GetDisplayNameForLanguageType API (#161803)
The intention for this API is to be used when presenting language names
to the user, e.g., in expression evaluation diagnostics or LLDB errors.

Most uses of `GetNameForLanguageType` can be probably replaced with
`GetDisplayNameForLanguageType`, but that's out of scope of this PR.

This uses `llvm::dwarf::LanguageDescription` under the hood, so we would
lose the version numbers in the names. If we deem those to be important,
we could switch to an implementation that hardcodes a list of
user-friendly names with version numbers included.

The intention is to use it from
https://github.com/llvm/llvm-project/pull/161688

Depends on https://github.com/llvm/llvm-project/pull/161804
2025-10-03 22:23:08 +00:00
Michael Buch
7f51a2a47d
[lldb][Language] Simplify SourceLanguage::GetDescription (#161804)
Currently we don't benefit from the user-friendly names that
`LanguageDescription` returns because we would always use
`Language::GetNameForLanguageType`. I'm not aware of a situation where
`GetDescription` should prefer the non-human readable form of the name
with. This patch removes the call to `GetNameForLanguageType`.

`LanguageDescription` already handles languages that it doesn't know
about. For those it would return `Unknown`. The LLDB language types
should all be available via DWARF. If there are languages that don't map
cleanly between `lldb::LanguageType` and `DW_LANG`, then we should add
explicit support for that in the `SourceLanguage::SourceLanguage`
constructor.
2025-10-03 23:15:38 +01:00
Yaxun (Sam) Liu
fb458aa91f Reland "[LLVM] Add GNU make jobserver support (#145131)"
With fix for JobServerTest where default parallel scheduling
strategy is saved/restored.
2025-10-03 17:38:37 -04:00
Craig Topper
9c118aa6a6 [RISCV] Remove unusable pattern from RISCVGISel.td. NFC
This pattern doesn't have a GISelPredicateCode so it's only usable
in SDAG.
2025-10-03 14:37:46 -07:00
Brox Chen
b8127cc8d0
[AMDGPU][True16][CodeGen] fix v_mov_b16_t16 index in folding pass (#161764)
With true16 mode v_mov_b16_t16 is added as new foldable copy inst, but
the src operand is in different index.

Use the correct src index for  v_mov_b16_t16.
2025-10-03 17:34:42 -04:00
Shafik Yaghmour
50285eaa59
[OpenMP][Clang][NFC] Initializer all of ScanInfo member variables and add deleted copy ctor and assignment operator (#158130)
Static analysis flagged that we were not initializing all of the members
of ScanInfo, fix this so that they are all initialized. Also it pointed
out that we were not following the rule of three. We had a custom
destructor but not copy constructor or assignment. We should never copy
or assignment so defaulting them as deleted.
2025-10-03 14:26:22 -07:00
Florian Hahn
1d65d9ce06
[VPlan] Match legacy CM in ::computeCost if load is used by load/store.
If a load is scalarized because it is used by a load/store address, the
legacy cost model does not pass ScalarEvolution to getAddressComputationCost.

Match the behavior in VPReplicateRecipe::computeCost.
2025-10-03 22:01:46 +01:00
sstwcw
2a05904288
[clang-format] Keep the ObjC selector name and @selector together (#160739)
Fixes #36459.

after

```Objective-C
- (void)test {
  if ([object
          respondsToSelector:@selector(
                                 selectorNameThatIsReallyLong:param1:param2:)])
    return;
}
```

before

```Objective-C
- (void)test {
  if ([object respondsToSelector:@selector
              (selectorNameThatIsReallyLong:param1:param2:)])
    return;
}
```

Before this patch, the `ObjCMethodExpr` type was assigned to many kinds
of tokens. The rule for allowing breaking the line before the colon on
line TokenAnnotator.cpp:6289 was intended for method declarations and
calls. It matched the parenthesis following `@selector` by mistake. To
fix the problem, this patch adds a new type for `@selector`. Most of the
special things in the code related to the old type is intended for other
constructs. So most of the code related to the old type is not changed
in this patch.
2025-10-03 20:40:48 +00:00
Craig Topper
36dc2a941f
[RISCV] Reverse the operands in ins for Zalasr store instructions. NFC (#161882)
Match the assembly printing order rather than sorting by operand name.

Tnis is consistent with normal store instructions.
2025-10-03 13:09:10 -07:00
Lucie Choi
b0ad9c293a
[SPIR-V] Fix asdouble issue in SPIRV codegen to correctly generate OpBitCast instruction. (#161891)
Generate `OpBitCast` instruction for pointer cast operation if the
element type is different.

The HLSL for the unit test is 
```hlsl
StructuredBuffer<uint2> In : register(t0);

RWStructuredBuffer<double2> Out : register(u2);


[numthreads(1,1,1)]
void main() {
  Out[0] = asdouble(In[0], In[1]);
}
```

Resolves https://github.com/llvm/llvm-project/issues/153513
2025-10-03 16:02:06 -04:00
ManuelJBrito
be29612ffc
[NewGVN] Remove returned arg simplification (#161865)
Replacing uses of the return value with the argument is already handled
in other passes, additionally it causes issues with memory value
numbering when the call is a memory defining intrinsic.
fixes #159918
2025-10-03 20:52:29 +01:00
Yatao Wang
178e2a704b
[LLVM][CodeGen] Check Non Saturate Case in isSaturatingMinMax (#160637)
Fix Issue #160611
2025-10-03 20:39:45 +01:00
Charitha Saumya
b86fef88c5
[mlir][xegpu] Create a test pass for subgroup distribution. (#161592)
Current subgroup distribution test employ the entire
`xegpu-subgroup-distribute` pass which include multiple steps like
layout propagation, move func body into warp op, and distribute to work
items.

This makes it harder to isolate the testing for xegpu subgroup
distribution logic, because certain corner cases may be not supported
yet by other steps mentioned above.

This PR introduces a test pass for subgroup distribution logic and
isolate the testing for distribution logic. We plan to add more corner
case (that were not possible before) covering non-xegpu ops (like
vector) in next PRs.

This PR also include,
1. minor bug fixes in gather/scatter distribution.  
2. bug fix in vector multi reduction lowering where it fails to retain
some layouts.
2025-10-03 12:35:13 -07:00
Craig Topper
99b0aafa4a
[AArch64] Use isStrongerThanMonotonic. NFC (#161866) 2025-10-03 12:34:25 -07:00
Alan Zhao
3b38314a2b
Reapply "[InstCombine] Preserve profile after folding select instructions with conditionals" (#161885) (#161890)
This reverts commit 572b579632fb79ea6eb562a537c9ff1280b3d4f5.

This is a reland of #159666 but with a fix moving the `extern`
declaration of the flag under the LLVM namespace, which is needed to fix
a linker error caused by #161240.
2025-10-03 12:26:09 -07:00
Martin Storsjö
f5dc553e93
[libcxx] [ci] Make the CI find the right version of Clang-cl (#161736)
We install a (or in practice, update a preexisting) copy of Clang, in
order to get a specific version that we want. At that point in the
procedure, this is the only version of Clang in the PATH.

However, the step of adding the MSVC build tools to the environment also
ends up adding another copy of Clang, bundled with MSVC, into the PATH.

Due to this, CMake ends up finding and preferring the older version of
Clang bundled with MSVC, rather than the one we intend to be used.

Manually add the directory of the version of Clang we want to use at the
head of the search path, after initializing the MSVC build tool
environment.

The directory name we add is a hardcoded guess of where it is installed
- this is not ideal, but seems like the most straightforward solution
for now.
2025-10-03 22:23:26 +03:00
Craig Topper
272025e5af [RISCV] Remove unneeded anyext/trunc patterns from RISCVGISel.td. NFC
We have code to manually select these as copies already. There are
multiple combinations of types that need to be supported due to
s32 and s16 being legal for the GPR register bank. It's simpler
to handle generically than to write out all the patterns.
2025-10-03 12:17:21 -07:00
David Green
119216ead1
[AArch64][GlobalISel] Use TargetConstant for shift immediates (#161527)
This changes the intrinsic definitions for shifts to use IntArg, which
in turn changes how the shifts are represented in SDAG to use
TargetConstant (and fixes up a number of ISel lowering places too). The
vecshift immediates are changed from ImmLeaf to TImmLeaf to keep them
matching the TargetConstant. On the GISel side the constant shift
amounts are then represented as immediate operands, not separate constants.
The end result is that this allows a few more patterns to match in GISel.
2025-10-03 20:16:08 +01:00
John Harrison
8ae30a3fac
[lldb] Adding A new Binding helper for JSONTransport. (#159160)
This adds a new Binding helper class to allow mapping of incoming and
outgoing requests / events to specific handlers.

This should make it easier to create new protocol implementations and
allow us to create a relay in the lldb-mcp binary.
2025-10-03 12:14:44 -07:00
Craig Topper
8284e4d7cd [RISCV] Remove unused uimm5i32 from RISCVGISel.td. NFC 2025-10-03 12:00:52 -07:00
Nico Weber
0cc2ad3c00 [gn] port 1af8ed198828 2025-10-03 14:57:10 -04:00
Andres-Salamanca
16f5a85fb6
[CIR] Initial support for emitting coroutine body (#161616)
This PR adds new `FuncOp` attributes (`coroutine` and `builtin`) and
begins the implementation of the `emitCoroutineBody` function. Feature
markers were also added for guidance in future PRs.
2025-10-03 13:56:53 -05:00
Razvan Lupusoru
478048df44
[mlir][acc] Add firstprivate operands to acc.loop (#161881)
Add support for firstprivate operands to the OpenACC loop construct,
enabling representation of privatization scenarios that require
initialization from original values.
2025-10-03 18:53:32 +00:00
Fateme Hosseini
aea5399919
[Hexagon] Support lowering of setuo & seto for vector types in Hexagon (#158740)
Resolves instruction selection failure for v64f16 and v32f32 vector
types.

Patch by: Fateme Hosseini

---------

Co-authored-by: Kaushik Kulkarni <quic_kauskulk@quicinc.com>
2025-10-03 13:44:35 -05:00
Mehdi Amini
eabfed8690 [MLIR] Apply clang-tidy fixes for modernize-use-bool-literals in VectorEmulateNarrowType.cpp (NFC) 2025-10-03 11:04:58 -07:00
S. VenkataKeerthy
616e5230c7
Fixing memory leaks in tests (#161878)
Fixing the memory leaks introduced (#158376) in the unit tests of
FunctionPropertiesAnalysis and IR2Vec.
2025-10-03 10:51:15 -07:00
Alexey Bataev
2e67f5ceb8 [SLP][NFC]Add udiv/srem test cases, NFC 2025-10-03 10:49:16 -07:00
Peter Klausler
0b8381aba9
[flang] Fix bogus generic interface error due to hermetic module files (#161607)
When the same generic interface is processed via USE association from
its original module file and from a copy in a hermetic module file, we
need to do a better job at detecting and omitting duplicate specific
procedures. They won't have the same symbol addresses, but they will
have the same name, module name, and characteristics. This will avoid a
bogus error about multiple specific procedures matching the actual
arguments later when the merged generic interface is referenced.
2025-10-03 10:48:32 -07:00
Peter Klausler
cbe3b72c4c
[flang][CUDA] Downgrade error to warning (#161570)
The compiler currently emit an error about the lack of an explicit
procedure interface when an external procedure that is called via an
implicit interface is known to have an dummy argument with a CUDA data
attribute, even when the corresponding actual argument does have a CUDA
data attribute. This behavior is inconsistent with what happens when
such a call is to an external in another source file and its definition
is not visible -- the compiler silently accepts an actual argument with
a CUDA data attribute across the implicit interface.

Harmonize this situation so that an actual argument with a CUDA data
attribute in a reference to a procedure with an implicit interface
elicits a usage warning encouraging the use of explicit interfaces. Only
when the procedure's definition is visible, and incompatible, will an
error message appear.
2025-10-03 10:48:13 -07:00
Peter Klausler
1fba01a51d
[flang] Consolidate & clean up COMMON block checks (#161286)
COMMON block checks are split between name resolution and declaration
checking. We generally want declaration checks to take place after name
resolution, and the COMMON block checks that are currently in name
resolution have some derived type analyses that are redundant with the
derived type component iteration framework used elsewhere in semantics.
So move as much as possible into declaration checking, use the component
iteration framework, and cope with the missing COMMON block name case
that arises with blank COMMON when placing the error messages.
2025-10-03 10:47:50 -07:00
joaosaffran
8fd8fb4d40
[Documentation][DirectX] Updating RTS0 structs to match d3d12 docs (#161593)
This PR updates the `DXContainer.rst` in two ways: First, it makes sure
the structures names are matching the ones in d3d12 documentation;
Second, it makes sure the types match what is in the code currently.
Closes: [135210](https://github.com/llvm/llvm-project/issues/135210)
2025-10-03 13:45:32 -04:00
joaosaffran
d682f61c12
[HLSL][TEST] Fix root signature driver test on WSL (#161566)
Running those test with validation enabled, causes emitting an
additional intermediary object, which causes the checks to fail, since
it will emit 2 `obj`, instead of one `obj` and one `dxo`. This patch
changes the test to make sure validation is disabled, making the test
consistent across environments.
2025-10-03 13:45:12 -04:00
Yi Zhang
436f9f39cb
[bazel] Add missing dep after cf86ef925d75ef08526fc399a2888673338298b3 (#161884) 2025-10-03 13:40:46 -04:00
Mehdi Amini
572b579632
Revert "[InstCombine] Preserve profile after folding select instructions with conditionals" (#161885)
Reverts llvm/llvm-project#159666

Many bots are broken right now.
2025-10-03 19:37:23 +02:00
Andy Kaylor
d6449b55cd
[CIR] Add support for emitting predefined expressions (#161757)
This adds support for emitting pseudo-macro expressions that represent
some form of the name of a function (such as `__func__` or
`__PRETTY_FUNCTION__`) as l-values.
2025-10-03 10:37:06 -07:00
Alan Zhao
c54d0d7a96
[InstCombine] Preserve profile after folding select instructions with conditionals (#159666)
If `select` simplification produces the transform:

```
(select A && B, T, F) -> (select A, T, F)
```

or

```
(select A || B, T, F) -> (select A, T, F)
```

it stands to reason that if the branches are the same, then the branch
weights remain the same since the net effect is a simplification of the
conditional.

There are also cases where InstCombine negates the conditional (and
therefore reverses the branches); this PR asserts that the branch
weights are reversed in this case.

Tracking issue: #147390
2025-10-03 10:19:08 -07:00
Derek Schuff
1af8ed1988
Fix filename in wasm build of compiler-rt (#161875) 2025-10-03 17:02:00 +00:00
modiking
74180eb024
[flang][rt] Add noinline attributes for CUDA compile path for successful compilation (#161760)
NVCC does more aggressive inlining than Clang/GCC causing the exported
functions in extrema.cpp and findloc.cpp to become extremely large from
function specializations leading to compilation timeouts. Marking the 2
functions in this change as noinline for NVCC alleviates this problem as
it removes the worst of the cross-matrix argument specializations.

Also remove the workaround in
https://github.com/llvm/llvm-project/pull/156542 that opted out
findloc.cpp from the CUDA flang-rt build

Testing:
ninja flang-rt builds in ~30 minutes, these 2 files build in ~3 minutes
2025-10-03 09:48:59 -07:00
Ellis Hoag
d0e98909d2
[lld][MachO] Tail merge strings (#161262)
Add the flag `--tail-merge-strings` to enable tail merging of cstrings.
For example, if we have strings `mystring\0` and `ring\0`, we could
place `mystring\0` at address `0x1000` and `ring\0` at address `0x1004`
and have them share the same underlying data.

It turns out that many ObjC method names can be tail merged. For
example, `error:` and `doFoo:error:`. On a large iOS binary, we saw
nearly a 15% size improvement in the `__TEXT__objc_methname` section and
negligible impact on link time.
```
$ bloaty --domain=vm merged.o.stripped -- base.o.stripped
     VM SIZE
 --------------
   +95% +5.85Ki    [__TEXT]
  -2.4%  -239Ki    __TEXT,__cstring
 -14.5%  -710Ki    __TEXT,__objc_methname
  -1.0%  -944Ki    TOTAL
```

Tail merging for MachO was originally removed in
7c269db779.
The previous implementation used `StringTableBuilder`, but that was
removed in
4308f031cd
to ensure deduplicated strings are aligned correctly. This
implementation ensures that tail merged strings are also aligned
correctly.

Special thanks to nocchijiang for pointing this out in
https://github.com/llvm/llvm-project/pull/158720#issuecomment-3310416030.

Depends on https://github.com/llvm/llvm-project/pull/161253.
2025-10-03 16:38:10 +00:00
Simon Pilgrim
3add28bf3f
[Hexagon] isel-fold-shl-zext.ll - regenerate test checks (#161869)
Improves codegen diff in an upcoming patch
2025-10-03 16:28:44 +00:00
Rahul Joshi
bd7e228fa4
[NFC][TableGen] Fix namespace usage in various files (#161839)
- Move standalone functions and variables out of anonymous namespace and
make them static.
- Eliminate `namespace llvm {}` wrapping all code in .cpp files, and
instead use namespace qualifier to define such functions
(https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions)
- Add namespace for X86DisassemblerShared.h.
2025-10-03 09:27:04 -07:00
Matt Arsenault
2a73a79e36
DAG: Remove TargetLowering::checkForPhysRegDependency (#161787)
I have no idea why this was here. The only implementation was AMDGPU,
which was essentially repeating the generic logic but for one specific
case.
2025-10-03 15:58:51 +00:00
David Spickett
78c5d9100f
[lldb][test] Disable TestLldbGdbServer.py on Linux temporarily (#161868)
While #161510 is dealt with.
2025-10-03 16:54:18 +01:00
Craig Topper
62791b4377
[RISCV] Replace uses of RISCV::NoRegister with Register() or isValid. NFC (#161781) 2025-10-03 08:53:58 -07:00
Ramkumar Ramachandra
36b543ab20
[InstComb] Handle undef in simplifyMasked(Store|Scatter) (#161825) 2025-10-03 16:52:48 +01:00
Chaitanya
2d67cb1a1f
[AMDGPU][Attributor] Stop inferring amdgpu-no-flat-scratch-init in sanitized functions. (#161319)
This PR stops the attributor pass to infer `amdgpu-no-flat-scratch-init`
for functions marked with `sanitize_*` attribute.
2025-10-03 21:16:57 +05:30
Simon Pilgrim
73651ba9bc
[x86] lowerV4I32Shuffle - don't adjust PSHUFD splat masks to match UNPCK (#161846)
Allow getV4X86ShuffleImm8ForMask to create a pure splat mask, helping to reduce demanded elts.
2025-10-03 15:29:43 +00:00
Shilei Tian
5537b9a167 [FIX] Add clangIndex as a dependence for clangStaticAnalyzerCore
This was introduced by #161663.
2025-10-03 11:20:26 -04:00
Hans Wennborg
69b8d6d4ea
[LLD][COFF] Fix tailMergeARM64 delayload thunk 128 MB range limitation (#161844)
lld would fail with "error: relocation out of range" if the thunk was
laid out more than 128 MB away from __delayLoadHelper2.

This patch changes the call sequence to load the offset into a register
and call through that, allowing for 32-bit offsets.

Fixes #161812
2025-10-03 17:17:23 +02:00
David Spickett
b4f54bf548 [llvm][LoongArch] Fix compiler warning produced by assert
Fixes #154918

tion ‘llvm::SDValue fillSubVectorFromBuildVector(llvm::BuildVectorSDNode*, llvm::SelectionDAG&, llvm::SDLoc, const llvm::LoongArchSubtarget&, llvm::EVT, unsigned int)’:
/home/davspi01/work/open_source/llvm-project/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:2863:16: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
 2863 |   assert(first >= 0 &&
      |          ~~~~~~^~~~

first is unsigned so this part of the expression is redundant.
2025-10-03 15:11:18 +00:00