516869 Commits

Author SHA1 Message Date
Thorsten Schütt
6effab990c
Revert "[GlobalISel][AArch64] Legalize G_INSERT_VECTOR_ELT for SVE" (#114353)
Reverts llvm/llvm-project#114310
2024-10-31 05:41:16 +01:00
Thorsten Schütt
6bf214b7c6
[GlobalISel][AArch64] Legalize G_INSERT_VECTOR_ELT for SVE (#114310)
There are patterns for:
* {nxv2s32, s32, s64},
* {nxv4s16, s16, s64},
* {nxv2s16, s16, s64}
2024-10-31 04:56:41 +01:00
Adam Yang
948249d804
Revert "[DXIL] Add GroupMemoryBarrierWithGroupSync intrinsic" (#114322)
Reverts llvm/llvm-project#111884
2024-10-30 20:44:54 -07:00
apple-fcloutier
9778808998
[ObjC] Insert method parameters in scope as they are parsed (#113745)
Before this change, ParseObjc would call the closing
`MaybeParseAttributes` before it had created Objective-C `ParmVarDecl`
objects (and associated name lookup entries), meaning that you could not
reference Objective-C method parameters in
`__attribute__((diagnose_if))`. This change moves the creation of the
`ParmVarDecl` objects ahead of calling `Sema::ActOnMethodDeclaration` so
that `MaybeParseAttributes` can find them. This is already how it works
for C parameters hanging off of the selector.

This change alone is insufficient to enable `diagnose_if` for
Objective-C methods and effectively is NFC. There will be a follow-up PR
for diagnose_if. This change is still useful for any other work that may
need attributes to reference Objective-C parameters.

rdar://138596211
2024-10-30 20:34:38 -07:00
Jonas Devlieghere
75aaa312ff
[lldb] Fix formatting and whitespace in ScriptInterpreterPython (NFC) 2024-10-30 20:33:28 -07:00
LLVM GN Syncbot
ccdfd1a182 [gn build] Port 8127162427c5 2024-10-31 02:27:09 +00:00
Craig Topper
55dbacbf07
[RISCV] Remove RISCVISD::VFCVT_X(U)_F_VL by using VFCVT_RM_X(U)_F_VL with DYN rounding mode. NFC (#114306) 2024-10-30 19:16:23 -07:00
Craig Topper
f0bae562dc
[GISel] Return const APInt & from getIConstantFromReg. NFC (#114320)
This matches what the call to ConstantInt::getValue() returns. Let the
caller make a copy if needed.
2024-10-30 19:15:51 -07:00
Feng Zou
8127162427
[X86][AMX] Support AMX-FP8 (#113850)
Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368
2024-10-31 10:14:25 +08:00
Alexey Samsonov
14f3cdc8e2
[libc][bazel] Add BUILD rules for float16 math functions. (#114187)
Adds libc_math_function rules for various f16* and *f16 functions.
Closes #114140
2024-10-30 19:05:24 -07:00
Jonas Devlieghere
de7ad6b682
[lldb] Use Py_InitializeFromConfig with Python >= 3.8 (NFC) (#114112)
This fixes the deprecation warning for Py_SetPythonHome, which was
deprecated in Python 3.11. With this patch, when building against Python
3.8 or later, we now use Py_InitializeFromConfig instead.

Fixes #113475
2024-10-30 18:48:43 -07:00
Chuanqi Xu
e9b7fe8e5a
[clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (#113879)
@kadircet mentioned in
448d8fa880 (diff-fb3ba8a781117ff04736f951a274812cb7ad1678f9d71d4d91870b711ab45da0L285)
that:

> this is definitely a functional change, clangd is used in environments
that solely relies on VFS, and doesn't depend on ASTUnit at all.

> right now this is both introducing a dependency on ASTUnit, and making
all the logical IO physical instead. can you instead use the regular
compiler utilities in clangd, and get the astreader from
CompilerInstance directly, which is VFS-aware, and doesn't depend on
ASTUnit ?

This tries to resolve the problem by creating ASTReader directly and use
VFS to create the FileManager.
2024-10-31 09:32:01 +08:00
jimingham
3243e3d887
Fix stepping away from the bottom-most frame of a virtual inlined call stack. (#114337)
The computation of 'Thread::IsVirtualStep" was wrong - it called being
at the bottom of a virtual call stack a "virtual step" but that is
actually when you've gotten to concrete code and need to step for real.

I also added a test for this.
2024-10-30 18:26:38 -07:00
Nikolas Klauser
e99c4906e4
[libc++] Granularize <cstddef> includes (#108696) 2024-10-31 02:20:10 +01:00
Akira Hatanaka
dafb90dedc
[NFC] Call base class method in DarwinAArch64TargetInfo::getOSDefines (#114241)
This is needed for a private patch we'll be upstreaming in the future.
2024-10-30 18:00:59 -07:00
Kazu Hirata
f582cd3dc7 [SelectionDAG] Fix a warning
This patch fixes:

  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1489:17: error:
  unused variable 'Flags' [-Werror,-Wunused-variable]
2024-10-30 17:49:51 -07:00
Chris Apple
dbece8edb4
[rtsan][NFC] Put in comment describing why freeing a nullptr is safe (#113720)
Just documenting this for future devs.

Also moved to `nullptr` and deleted unnecessary braces as per the coding
standard.
2024-10-30 17:39:28 -07:00
LLVM GN Syncbot
d67f2bd45d [gn build] Port 84b7bcfcac02 2024-10-31 00:17:29 +00:00
Yingwei Zheng
cf9d1c1486
[SDAG] Simplify SDNodeFlags with bitwise logic (#114061)
This patch allows using enumeration values directly and simplifies the
implementation with bitwise logic. It addresses the comment in
https://github.com/llvm/llvm-project/pull/113808#discussion_r1819923625.
2024-10-31 08:10:07 +08:00
Nico Weber
36b79156db [gn] port 508263824f4ef (BuiltinsX86.td) 2024-10-30 19:59:48 -04:00
Paul Kirth
b01e2a8b56
[llvm] Allow always dropping all llvm.type.test sequences
Currently, the `DropTypeTests` parameter only fully works with phi nodes
and llvm.assume instructions. However, we'd like CFI to work in
conjunction with FatLTO, in so far as the bitcode section should be able
to contain the CFI instrumentation, while any incompatible bits are
dropped when compiling the object code.

To do that, we need to drop the llvm.type.test instructions everywhere,
and not just their uses in phi nodes. This patch updates the
LowerTypeTest pass so that uses are removed, and replaced with `true` in
all cases, and not just in phi nodes.

Addressing this will allow us to fix #112053 by modifying the FatLTO
pipeline.

Reviewers: pcc, nikic

Reviewed By: pcc

Pull Request: https://github.com/llvm/llvm-project/pull/112787
2024-10-30 16:56:30 -07:00
Craig Topper
51628faa01
[RISCV] Sink hasPostISelHook = 1 for vector pseudos into the subclasses that set HasRoundModeOp. NFC (#114294) 2024-10-30 16:33:18 -07:00
Kazu Hirata
c1858cdd1d [clang-link-wrapper] Fix a warning
This patch fixes:

  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:221:23:
  error: unused function 'getInputBitcodeLibrary'
  [-Werror,-Wunused-function]
2024-10-30 16:32:38 -07:00
Craig Topper
847f4ef21b
[X86] Use getAllOnesConstant instead of getConstant(-1). NFC (#114299) 2024-10-30 16:22:23 -07:00
lntue
a39fb30a49
[libc] Fix usage of std::nullptr_t in LibcTest.h. (#114321) 2024-10-30 19:08:47 -04:00
Joseph Huber
6ffefbbc25
[LinkerWrapper] Remove handling of special bitcode flags (#114298)
Summary:
These flags were used in the very early days while we were trying to
port stuff. Now that we just pass bitcode to the device link job it
can be easily replaced by `-Xoffload-linker foo.bc`.
2024-10-30 16:02:34 -07:00
Luke Lau
1cb599835c [RISCV] Remove redundant +zfh from +zvfh[min] tests. NFC
In the vast majority of f16 tests we don't end up emitting any scalar
code that needs +zfh, so remove it.
2024-10-31 06:51:39 +08:00
Jonas Devlieghere
3a782ef97d
[lldb] Add a link to LLDB's Discord channel on the website (#114289)
Looking at #114276, I realized we have a link to Discourse on the
website, but not Discord. I think it would be helpful to have that link
there for real-time community discussion.
2024-10-30 15:47:48 -07:00
Caio Oliveira
6e75eec866
[mlir][spirv] Remove code for de-duplicating symbols in SPIR-V grammar (#111778)
SPIR-V grammar was updated in upstream to have an "aliases" field
instead of duplicating symbols with same values. See
https://github.com/KhronosGroup/SPIRV-Headers/pull/447 for details.
2024-10-30 18:40:08 -04:00
Caio Oliveira
67c485798a
[mlir][spirv] Ignore extra comma for category_args in gen_spirv_dialect.py (#111776)
In the code being parsed, the comma separates following traits from the
category args. If there's no category args, it is still present.
2024-10-30 18:39:32 -04:00
Artem Belevich
04e876e6c6
Revert "[NVPTX] instcombine known pointer AS checks." (#114319)
Reverts llvm/llvm-project#112964

Crashes MLIR: https://lab.llvm.org/buildbot/#/builders/138/builds/5665
2024-10-30 15:34:08 -07:00
Matthias Springer
d043670d66
[mlir][func] Replace ValueDecomposer with target materialization (#114192)
The `ValueDecomposer` in `DecomposeCallGraphTypes` was a workaround
around missing 1:N support in the dialect conversion. Since #113032, the
dialect conversion infrastructure supports 1:N type conversions and 1:N
target materializations. The `ValueDecomposer` class is no longer
needed. (However, target materializations must still be inserted
manually, until we fully merge the 1:1 and 1:N drivers.)

Note for LLVM integration: Register 1:N target materializations on the
type converter instead of "decompose value conversions" on the
`ValueDecomposer`.
2024-10-31 07:26:12 +09:00
Artem Belevich
1cecc58c3f
[NVPTX] instcombine known pointer AS checks. (#112964)
The change improves the code in general and, as a side effect, avoids crashing
on an impossible address space casts guarded by `__isGlobal/__isShared`, which
partially fixes https://github.com/llvm/llvm-project/issues/112760
It's still possible to trigger the issue by using explicit AS casts w/o
AS checks, but LLVM should no longer crash on valid code.
2024-10-30 15:13:06 -07:00
gulfemsavrun
36d5692570
Revert "[TLI] Add support for hypot libcall." (#114312)
Reverts llvm/llvm-project#113724
2024-10-30 15:10:29 -07:00
George Burgess IV
50c44478fe
[libc] fix behavior of strrchr(x, '\0') (#112620)
`strrchr("foo", '\0')` is defined to point to the end of `foo`, rather
than returning NULL. This wasn't caught by tests, since llvm-libc's
`ASSERT_STREQ(nullptr, "");` is not an assertion error.

While I'm here, refactor the test slightly to check for NULL more
specifically. I considered adding fancier `ASSERT`s (and changing the
semantics of `ASSERT_STREQ`), but opted for a more local fix by fair
dice roll.
2024-10-30 15:08:03 -07:00
Michael Jones
5d35747f6d
[libc] Refactor statvfs tests (#114147)
The previous statvfs tests had several issues, this patch updates them
to meet current standards.
2024-10-30 15:05:13 -07:00
Craig Topper
56dcfbef45
[RISCV] Remove duplicate vector conversion pseudos. (#114287)
These pseudos used to be handled by CustomInserter to insert the
rounding
mode change for vector ceil, floor, etc. At some point they were changed
to use the InsertReadWriteCSR pass instead of the custom inserter. I
believe
that makes them redundant with the pseudos used by the RVV intrinsics
with rounding mode operand.
2024-10-30 14:47:29 -07:00
Luke Lau
14045de250
[RISCV] Account for factor in interleave memory op costs (#111511)
Currently we cost an interleaved memory op as if it were a load/store of
the widened vector type, but this was undercosting in all cases when
compared to the measured performance of todays hardware.

On the x280 at NF=2 and spacemit-x60 at NF=2,3 and 4, a segmented load
is carried out as a wide load and NF LMUL shuffle ops:
https://github.com/preames/bp3-microarch#vlseg_lmul_x_sew_throughput

All other NFs go through a slow path. On the spacemit-x60 this is
proportional to VLMAX * NF, and on the x280 proportional to the number
of segments.

This patch increases the cost by implementing a wide load + NF LMUL
shuffle op cost for the lowest common denominator NF=2, and then a
slower cost proportional to VL for the other NFs.

In a follow up patch we can add a tuning flag to use the faster cost
model for NF=3 and 4 on the spacemit-x60.

Note that the FIXME about illegal vectors seems to have been fixed in
#100436
2024-10-31 05:36:46 +08:00
Helena Kotas
74d8f3952c
[HLSL] Remove old resource annotations for UAVs and SRVs (#114139)
UAVs and SRVs have already been converted to use LLVM target types and
we can disable generating of the !hlsl.uavs and !hlsl.srvs! annotations.
This will enable adding tests for structured buffers with user defined
types that this old resource annotations code does not handle (it
crashes).

Part 1 of #114126
2024-10-30 14:06:42 -07:00
Felipe de Azevedo Piovezan
4afa978756
Revert "[Clang][Sema] Always use latest redeclaration of primary template" (#114304)
Clang importer doesn't seem to work well with this change, see
discussion in the original PR.

Reverts llvm/llvm-project#114258
2024-10-30 14:04:26 -07:00
Wanyi
f7c36d2f88
[lldb] Fix API test for file redirection to existing files (#114119)
API test failed for remote platform in
[#112657](https://github.com/llvm/llvm-project/pull/112657)

Previously when putting files onto remote platform, I used `platform
file write -d <data>` which actually required a `platform file open
<path>` first in order to obtain a file descriptor.
eg. in file
[TestGDBRemotePlatformFile.py](94e7d9c0bf/lldb/test/API/functionalities/gdb_remote_client/TestGDBRemotePlatformFile.py (L24-L32))
To fix this, use the `platform put-file` method, which is used in the
`redirect_stdin` from this test already.
2024-10-30 17:00:40 -04:00
Renaud Kauffmann
bfe486fe76
Passing descriptors by reference to CUDA runtime calls (#114288)
Passing a descriptor as a `const Descriptor &` or a `const Descriptor *`
generates a FIR signature where the box is passed by value.
This is an issue, as it requires a load of the box to be passed. But
since, ultimately, all boxes are passed by reference a temporary is
generated in LLVM and the reference to the temporary is passed.

The boxes addresses are registered with the CUDA runtime but the
temporaries are not, thus preventing the runtime to properly map a host
side address to its device side counterpart.

To address this issue, this PR changes the signatures to the transfer
functions to pass a descriptor as a `Descriptor *`, which will in turn
generate a FIR signature with that takes a box reference as an argument.
2024-10-30 13:24:47 -07:00
Artem Pianykh
84a78abdf5
[NFC][Utils] Extract CloneFunctionAttributesInto from CloneFunctionInto (#112976)
This patch is a part of step-by-step refactoring of CloneFunctionInto.
The goal is to extract reusable pieces out of it that will be later used
to optimize function cloning e.g. in coroutine processing.

Extracted from #109032 (commit 2)
2024-10-30 13:23:43 -07:00
Artem Pianykh
1c2824e3a4
[NFC][Coro] Add helpers for coro cloning with a TimeTraceScope (#112948)
A helper (2 overloads) that consolidates corocloner creation and the
actual cloning. The helpers create a TimeTraceScope to make it easier to
see how long the cloning takes.

Extracted from #109032 (commit 1)
2024-10-30 13:23:20 -07:00
Craig Topper
0167a92e28 [RISCV] Use unsigned instead of int64_t for two small positive shift amounts. NFC 2024-10-30 13:10:55 -07:00
Justin Fargnoli
e89f821233
[NFC][NVPTX] Cleanup getPreferredVectorAction() (#114115)
`v2*16` is a legal type in NVPTX. Thus, this is dead code.
2024-10-30 13:05:40 -07:00
Nick Desaulniers
b1320d3633
[libc][i386] setjmp/longjmp (#112437)
Link: #93709
2024-10-30 12:59:59 -07:00
Vyacheslav Levytskyy
c616f24bcb
[SPIR-V] Do instruction selection for G_BITCAST on an earlier stage (#114216)
This PR implements instruction selection for G_BITCAST on an earlier
stage to avoid MachineVerifier complains on subtle semantics difference
between G_BITCAST and OpBitcast.

We do instruction selections for OpBitcast after IR Translation instead
of calling MIB.buildBitcast() generating the general op code G_BITCAST,
because when MachineVerifier validates G_BITCAST we see a check of a
kind: 'if Source Type is equal to Destination Type then report error
"bitcast must change the type"'. This doesn't take into account the
notion of a typed pointer that is important for SPIR-V where a user may
and should use bitcast between pointers with different pointee types
(https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#OpBitcast).

It's important for correct lowering in SPIR-V, because interpretation of
the data type is not left to instructions that utilize the pointer, but
encoded by the pointer declaration, and the SPIRV target can and must
handle the declaration and use of pointers that specify the type of data
they point to.

It's not feasible to improve validation of G_BITCAST using just
information provided by low level types of source and destination.
Therefore we don't produce G_BITCAST as the general op code with
semantics different from OpBitcast, but rather lower to OpBitcast
immediately.

See discussion in https://github.com/llvm/llvm-project/pull/110270 for
even more context.
2024-10-30 20:49:21 +01:00
Ilya Enkovich
d2109640a3
[MLIR] [AMX] Fix strides used by AMX lowering for tile loads and stores. (#113476) 2024-10-30 20:41:28 +01:00
Aaron Ballman
e4dfb51da4 Fix documentation build
This fixes the build after the removal of the clang-format status page.
2024-10-30 15:30:34 -04:00