520563 Commits

Author SHA1 Message Date
Daniel Paoliello
ee9e786717
[aarch64] Add support for the __{inc|add}x18{byte|word|dword|qword intrinsics (#117752)
Adds support for the following MSVC intrinsics:
* `__addx18byte`
* `__addx18word`
* `__addx18dword`
* `__addx18qword`
* `__incx18byte`
* `__incx18word`
* `__incx18dword`
* `__incx18qword`

These are documented at:
<https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170>
2024-12-04 10:29:58 -08:00
Krzysztof Parzyszek
3dcc52d464 [flang][OpenMP] Add comments to IsContiguous, improve formatting, NFC 2024-12-04 12:29:20 -06:00
Valentin Clement (バレンタイン クレメン)
2757dc33ee
Revert "[flang][cuda] Run target rewrite in gpu.module" (#118679)
Reverts llvm/llvm-project#118592
2024-12-04 10:17:21 -08:00
Simon Pilgrim
2567feaa13 [X86] Add fabs/fneg rmw style test coverage for #117557
Missed opportunity to avoid use of fpu for store(fabs(load()) style patterns
2024-12-04 18:16:30 +00:00
Simon Pilgrim
77908345d0 [X86] fsxor-alignment.ll - add nounwind to prevent cfi noise in an upcoming change 2024-12-04 18:16:30 +00:00
hidekisaito
8c36a823c2
Fix to account for multiple ISA enumeration (#118676) 2024-12-04 12:11:16 -06:00
Brian Cain
7748492c37
[hexagon] Add support for llvm.debugtrap (#117049)
Also: set `hasSideEffects` on `Y2_break` instruction.
2024-12-04 12:10:29 -06:00
Valentin Clement (バレンタイン クレメン)
cd92c6a895
[flang][cuda] Run target rewrite in gpu.module (#118592)
Apply signature conversion for `func.func` in the gpu.module. More work
will need to be done for gpu.func op and implement the NVVM ABI for
conversion in the gpu module.
2024-12-04 10:00:42 -08:00
Dmitry Sidorov
d057b53a7d
[SPIR-V] Add SPV_INTEL_joint_matrix extension (#118578)
The spec is available here:
https://github.com/intel/llvm/pull/12497

The PR doesn't add OpCooperativeMatrixApplyFunctionINTEL instruction as
it's still experimental and not properly tested E2E.

The PR also fixes few bugs in the related code:
1. CooperativeMatrixMulAddKHR optional operand must be literal, not a
constant;
2. Fixed available capabilities table creation for a case, when a single
extension adds few capabilities, that occupy not contiguous op codes.

---------

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
2024-12-04 19:00:19 +01:00
Oliver Hunt
fe4bba6578
Add support for referencable labels for attribute documentation (#118428)
The existing mechanism being used is to manually add a reference in the
documentation. These references link to the beginning of the text rather
than the heading for the attribute which is what this PR allows.

---------

Co-authored-by: Sirraide <aeternalmail@gmail.com>
2024-12-04 12:58:20 -05:00
Louis Dionne
842d563151 [libc++][CI] Also restart failed jobs when they fail for a spurious reason
Since we moved to a Docker-in-Docker setup, CI jobs sometimes fail due
to the Docker VM dying with 'context cancelled' errors. This is currently
not recognized as a spurious failure, which leads to the job not being
automatically restarted. This patch fixes that.

This commit only adds a test job with the new logic since this workflow
triggers on workflow_run, which means that the changes need to be on
`main` before they can be tested. Once this is tested to work properly,
I'll make it the default definition for the workflow.
2024-12-04 12:51:27 -05:00
Jon Roelofs
e51a0b2e26
[llvm][AArch64] Fix a crash in performPostLD1Combine (#118538)
rdar://138004275
2024-12-04 09:49:09 -08:00
bernhardu
b8d857efac
[win/asan] Populate test for function GetInstructionSize. (#118204)
This puts the content of GetInstructionSize into a test.
There are 5 cases missing, which I have already or would like to propose
a fix later.
2024-12-04 18:47:13 +01:00
Jonas Devlieghere
ff5953804e
[lldb-dap] Support finding the lldb-dap binary (#118547)
Support finding the lldb-dap binary with `xcrun` on Darwin or in PATH on
all other platforms.

Unfortunately, this PR is larger than I would like because it removes
the `lldbDapOptions`. I believe these options are not necessary, and as
previously implemented, they caused a spurious warning with this change.
The problem was that the options were created before the custom factory.
By moving the creation logic into the factory, we make sure it's only
called after the factory has been registered. The upside is that this
simplifies the code and removes a level of indirection.
2024-12-04 09:43:49 -08:00
Renaud Kauffmann
ed2db3be61
[flang][cuda] Do not register global constants (#118582)
Global constants have no symbols in library files. They are replaced
with literal constants during lowering before kernels are moved into a
GPU module. Do not register them because they will result in unresolved
symbols.
2024-12-04 09:37:08 -08:00
Louis Dionne
ef164ecedf
[libc++][libunwind] Fix documentation CI job after #118159 (#118555) 2024-12-04 12:30:35 -05:00
Kunwar Grover
a8f927161b
[mlir][Vector] Fix vector.extract lowering to llvm for 0-d vectors (#117731)
The current implementation of lowering to llvm for vector.extract
incorrectly assumes that if the number of indices is zero, the operation
can be folded away. This PR removes this condition and relies on the
folder to do it instead.

This PR also unifies the logic for scalar extracts and slice extracts,
which as a side effect also enables vector.extract lowering for n-d
vector.extract with dynamic inner most dimension. (This was only
prevented by a conservative check in the old implementation)
2024-12-04 17:26:53 +00:00
Jakub Kuderski
bb9bb68674
[mlir][spirv] Handle vectors of integers of unsupported width (#118663)
Fixes: https://github.com/llvm/llvm-project/issues/118612
2024-12-04 12:19:20 -05:00
Fangrui Song
4639a9a063 [lld-link] Replace log(...) with Log 2024-12-04 09:04:40 -08:00
Krzysztof Drewniak
87c21bf064
[AMDGPU] Preserve noundef and range during kernel argument loads (#118395)
This commit ensures than noundef (which is frequently a prerequisite for
other annotations) and range() annotations on kernel arguments are
copied onto their corresponding load from the kernel argument structure.
2024-12-04 11:04:03 -06:00
Rahul Joshi
e2c3d16282
[NFC] Eliminate need of Emacs tag and file name in file header (#118553)
- Simplify file header to not require file name and C++ Emacs tag.

See
https://discourse.llvm.org/t/is-c-in-header-files-still-relevant/83124/1
2024-12-04 08:57:27 -08:00
Florian Hahn
9e66206638
[Passes] Generalize ShouldRunExtraVectorPasses to allow re-use (NFCI). (#118323)
Generalize ShouldRunExtraVectorPasses to ShouldRunExtraPasses, to allow
re-use for other transformations.

PR: https://github.com/llvm/llvm-project/pull/118323
2024-12-04 16:55:06 +00:00
Nick Desaulniers
06c831d7fb
[libc] rename newhdrgen to just hdrgen (#118545)
Link: #117208
Fixes: #117254
2024-12-04 08:48:12 -08:00
John Harrison
d5ba143a6d
[lldb] Correct an issue when using Socket to listen on localhost:0 on ipv4 and ipv6. (#118565)
On systems supporting ting ipv4 and ipv6 the second socket to initialize 
will not update the listening address correctly after the call to `bind`.

This results in the second address listed in
`Socket::GetListeningConnectionURI` to have port `:0`, which is
incorrect.

To fix this, correct which address is used to detect the port and update
the unit tests to cover this use case.

Additionally, I updated the SocketTest's to only parameterize tests that
can work on ipv4 or ipv6. This means tests like
`SocketTest::DecodeHostAndPort` are only run once, instead of twice
since they do not change behavior based on parameters.

I also included a new unit test to cover listening on `localhost:0`,
validating both sockets correctly list the updated port.
2024-12-04 08:47:18 -08:00
Andrea Faulds
0a2116f4f9
[mlir][spirv][vector] Support converting vector.from_elements to SPIR-V (#118540)
Closes #118098.
2024-12-04 17:42:06 +01:00
Simon Pilgrim
85d15bd130
[TTI][X86] getMemoryOpCost - reduced costs when loading uniform values due to value reuse (#118642)
Similar to what we do for broadcast shuffles, when legalising load costs, if the value is known to be uniform, then we will only load a single vector and reuse this across the split legalised registers.

Fixes #111126
2024-12-04 16:36:00 +00:00
Kazu Hirata
1b95e76d8f [Instrumentation] Fix a warning
This patch fixes:

  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3840:14:
  error: unused variable 'NumArgOperands' [-Werror,-Wunused-variable]
2024-12-04 08:31:40 -08:00
Alexander Shaposhnikov
95e44d3670
[msan] Add handling for sse41_round_pd/sse41_round_ps (#118441)
Add handling for sse41_round_pd/sse41_round_ps similarly to
maybeHandleSimpleNomemIntrinsic.

Test plan: ninja check-all
2024-12-04 08:27:08 -08:00
Nikita Popov
66ed8fb973 [InstCombine] Fix use after free
Make sure we only access cached nowrap flags.
2024-12-04 17:20:04 +01:00
Nikita Popov
b79007d8a6 [IR] Fix accumulateConstantOffset() on zero-index GEP
These are degenerate but not malformed, so make sure we don't
crash.
2024-12-04 17:17:58 +01:00
cmtice
ba43a102a9
[LLDB] Fix error returns in CastToBasicType and CastToEnumType in ValueObject. (#117401)
Update the error returns in ValueObject::CastToBasicType and
ValueObject::CastToEnumType to create new errors and return a
ValueObjectConstResult with the error, rather tnan updating the error in
(and returning) the input ValueObject.
2024-12-04 08:11:10 -08:00
Nikita Popov
4a7abfe0a7 [InstCombine] Preserve nuw in OptimizePointerDifference
If both the geps and the subs are nuw the new sub is also nuw.

Proof: https://alive2.llvm.org/ce/z/mM8UvF
2024-12-04 16:58:35 +01:00
Vladislav Dzhidzhoev
4e80c532c6
[lldb][tests] Fix passing pthread library to a linker for some API tests (#118530)
Specify ENABLE_THREADS := YES within test's Makefile instead of passing
-lpthread explicitly via the compiler's CFLAGS options.

Refactoring fix.

Co-authored-by: Vladimir Vereschaka <vvereschaka@accesssoftek.com>
2024-12-04 16:55:28 +01:00
Timm Baeder
7aec6dc477
[clang][bytecode] Initialize bases when bitcasting (#117179)
Base pointers do not get passed to the callback, so initialize them when iterating bases.
2024-12-04 16:49:03 +01:00
Jérôme Duval
3b904ae5ac
[libunwind][Haiku] Improve support (#115462)
* Signal frame unwinding on x86_64 from X512
* Header search for commpage_defs.h on non-standard paths

Unwind supported tests pass on Haiku x86_64

---------

Co-authored-by: Trung Nguyen <trungnt282910@gmail.com>
2024-12-04 10:40:28 -05:00
Nikita Popov
a608607fd7
[ConstraintElim] Add support for decomposing gep nuw (#118639)
ConstraintElimination currently only supports decomposing gep nusw with
non-negative indices (with "non-negative" possibly being enforced via
pre-condition).

Add support for gep nuw, which directly gives us the necessary
guarantees for the decomposition.
2024-12-04 16:27:31 +01:00
Florian Hahn
7b6e0d9fc3
[Matrix] Use DenseMap for ShapeMap instead of ValueMap. (#118282)
ValueMap automatically updates entries with the new value if they have
been RAUW. This can lead to instructions that are expected to not have
shape info to be added to the map (e.g. shufflevector as in the added
test case).

This leads to incorrect results. Originally it was used for transpose
optimizations, but they now all use updateShapeAndReplaceAllUsesWith,
which takes care of updating the shape info as needed.

This fixes a crash in the newly added test cases.

PR: https://github.com/llvm/llvm-project/pull/118282
2024-12-04 14:51:31 +00:00
Jacek Caban
7235ac9051
[LLD][COFF] Check load config size before setting its DependentLoadFlags (#118535)
Merge prepareLoadConfig and checkLoadConfigGuardData to share helper
macros.
2024-12-04 15:36:41 +01:00
Oliver Stannard
99b862efba
[DAGISel][ARM] Fix vector truncate combine for big-endian (#118101)
This DAG combine was incorrect for big-endian targets, because it
assumes that when a bitcast changes the lane width, the
least-significant bits of the wider lanes are in the lower-numbered
lanes of the smaller type, which is only true for little-endian.
2024-12-04 14:32:15 +00:00
cor3ntin
8271195de0
[Clang] Deleting an incomplete enum type is not an error (#118455)
The changes introduced in #97733 accidentally prevented to delete an
incomplete enum (the validity of which has been confirmed by CWG2925

Fixes #99278
2024-12-04 15:31:19 +01:00
Balazs Benics
2e85138c0d
[clang][NFC] Generalize getSpecificAttr for const attributes (#116606)
This patch allows using `getSpecificAttr` for getting `const`
attributes. Previously, if users of this API would want to get a const
Attribute pointer, they had to pass `getSpecificAttr<const XYZ>()`, to
get it compile. It feels like an arbitrary limitation as the constness
was already encoded in the Attribute container's value type.
2024-12-04 15:17:47 +01:00
Maksim Ivanov
026fbe519e
[clang][www] Remove ClangDataFormat.py from docs (#117943)
The script was removed in
https://github.com/llvm/llvm-project/pull/96385.

Instead, mention the LLVM formatter as it's still very useful for
Clang's code.
2024-12-04 12:53:31 +00:00
Nathan Gauër
920ea4af64
[SPIR-V] Replace assert with report_fatal (#118617)
Irreducible must always be rejected, not only in debug builds.

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-12-04 13:47:21 +01:00
Paul Walker
a88653a2cd
[LLVM][IR] When evaluating GEP offsets don't assume ConstantInt is a scalar. (#117162) 2024-12-04 12:45:30 +00:00
Simon Pilgrim
140df02aa2 [SLP][X86] Update test coverage for #111126
I'd copied the test case from #118016 instead of the original #111126 test case
2024-12-04 12:28:55 +00:00
Nikita Popov
75af62839b [ConstraintElim] Add tests for gep nuw (NFC) 2024-12-04 13:17:02 +01:00
Kiran Chandramohan
9d952422b4
[Flang][OpenMP] Issue an error for loop directive without a loop (#118039)
Fixes #107500
2024-12-04 12:03:37 +00:00
Thorsten Schütt
148fdc519c
[GlobalISel] Add G_ABDS and G_ABDU instructions (#118122)
The DAG has the same instructions: the signed and unsigned absolute
difference of it's input. For AArch64, they map to uabd and sabd for
Neon and SVE. The Neon and SVE instructions will require custom
patterns.

They are pseudo opcodes and are not imported by the IRTranslator. We
need combines to create them.

PowerPC, ARM, and AArch64 have native instructions.

/// i.e trunc(abs(sext(Op0) - sext(Op1))) becomes abds(Op0, Op1) 
///  or trunc(abs(zext(Op0) - zext(Op1))) becomes abdu(Op0, Op1)

For GlobalISel, we are going to write the combines in MIR patterns.

see:
llvm/test/CodeGen/AArch64/abd-combine.ll

- [ ] combine into abd
- [ ] legalize and add td patterns
2024-12-04 12:53:15 +01:00
Simon Pilgrim
041e5c96c4 [X86] getMemoryOpCost - ensure we pass through OpInfo / Instruction args to base getMemoryOpCost calls
Nothing really uses these yet, but we shouldn't be losing the info.

We can also pass on the OpInfo arg to the getMemoryOpCost constant load call to indicate if its constant/uniform/pow2 etc.

Prep cleanup for #111126
2024-12-04 11:43:52 +00:00
SpencerAbson
0adab6b1af
[AArch64][Clang] Define __ARM_NEON_SVE_BRIDGE unconditionally (#118272)
The meaning of `__ARM_NEON_SVE_BRIDGE` was changed here:
https://github.com/ARM-software/acle/pull/362

Such that it should be defined to `1` if the `arm_neon_sve_bridge.h`
header file is available, which is the case for Clang.
2024-12-04 11:32:05 +00:00