Commit Graph

474584 Commits

Author SHA1 Message Date
Joseph Huber
bf85f27370
[libc] Implement 'qsort' and 'bsearch' on the GPU (#66230)
Summary:
This patch simply adds the necessary config to enable qsort and bsearch
on the GPU. It is *highly* unlikely that anyone will use these, as they
are single threaded, but we may as well support all entrypoints that we
can.
2023-09-13 12:06:34 -05:00
Stefan Gränitz
8d99bf92b5 [JITLink][AArch32] Revisit descriptions for Call and Jump24 relocation types (NFC) 2023-09-13 18:59:08 +02:00
Stefan Gränitz
21ee9e4b26 [JITLink][AArch32] Remove duplicate '0x' hex prefixes from formatv strings in error messages 2023-09-13 18:59:08 +02:00
Stefan Gränitz
1025189ea0 [JITLink][AArch32] Don't adjust Thumb bit in fixup code; it doesn't contribute to branch ranges
We don't have to set or clear the Thumb bit in relocation fixup values.
It's not part of the branch range and the respective encoding functions
like encodeImmBT4BlT1BlxT2() shift out the least significant bit anyway.

This was a leftover from the initial patch before we switched to store
Thumb state in target-flags with D146641.
2023-09-13 18:59:07 +02:00
Reid Kleckner
ee643b706b Revert "[InlineAsm] wrap ConstraintCode in enum class NFC (#66003)"
This reverts commit 2ca4d13612.

Also revert the followup, "[InlineAsm] fix botched merge conflict resolution"

This reverts commit 8b9bf3a9f7.

There were SystemZ and Mips build errors, too many to fix forward.
2023-09-13 09:58:02 -07:00
Luke Lau
2ec7dbaff7 [RISCV] Update comment on vslide*_vl that it has a sixth policy operand. NFC 2023-09-13 17:52:36 +01:00
Louis Dionne
cce062d226
[libc++] Reintroduce the removed std::char_traits specialization (#66153)
This partially reverts commit e30a148b09, which removed the base
template for std::char_traits. That base template had been marked as
deprecated since LLVM 16 and we were planning to remove it in LLVM 18.
However, as explained in the post-commit comments in
https://reviews.llvm.org/D157058, the deprecation mechanism didn't work
as expected. Basically, the deprecation warnings were never shown to
users since libc++ headers are system headers and Clang doesn't show
warnings in system headers.

As a result, this removal came with basically no lead time as far as
users are concerned, which is a poor experience. For this reason, I am
re-introducing the deprecated char_traits specialization until we have a
proper way of phasing it out in a way that is not a surprise for users.
2023-09-13 12:30:05 -04:00
Philip Reames
2f005df066
[DAG][X86] Fold mgather/mscatter/etc with splat index (#65980)
A splat index means the operation is reading from (writing to) the same
memory location. Generally, zero is the cheapest value to splat. As
such, we'd prefer to add the splatted value to the base, and use a
constant zero as the index operand.
2023-09-13 09:26:30 -07:00
Simon Pilgrim
8b479136c9 [X86] SimplifyMultipleUseDemandedBitsForTargetNode - add X86ISD::BLENDV handling
If we know the condition mask sign bit of the demanded elements then we can directly return the LHS/RHS selection
2023-09-13 17:23:11 +01:00
frgossen
1cddbf8cf5
Revert Add host-supports-nvptx requirement to lit tests (#66102 and #66129) (#66225) 2023-09-13 12:20:38 -04:00
Nick Desaulniers
8b9bf3a9f7 [InlineAsm] fix botched merge conflict resolution
Link: #66003
2023-09-13 09:18:42 -07:00
Jonas Devlieghere
4d10b9507d
[lldb] Fix formatting and whitespace in Debugger.{h,cpp} (NFC)
This file is heavily trafficked and the various formatting and
whitespace issues make it tedious to work on.
2023-09-13 09:14:54 -07:00
Krzysztof Drewniak
df852599f3 [mlir] Split up VectorToLLVM pass
Currently, the VectorToLLVM patterns are built into a library along
with the corresponding pass, which also pulls in all the
platform-specific vector dialects (like AMXDialect) to apply all the
vector to LLVM conversions.

This causes dependency bloat when writing libraries - for example the
GPU to LLVM passes, which use the vector to LLVM patterns, don't need
the X86Vector dialect to be present at all.

This commit partitions the library into VectorToLLVM and
VectorToLLVMPass, where the latter pulls in all the other vector
transformations.

Reviewed By: nicolasvasilache, mehdi_amini

Differential Revision: https://reviews.llvm.org/D158287
2023-09-13 16:09:56 +00:00
Vitaly Buka
b4b4d8bd61 [test][clang-repl][Orc] Lsan report workaround
Not sure if this is real leak of lsan and clang-repl incompatibility.
ca8d2533c7 causes leak report in
ClangReplInterpreterExceptionTests.
2023-09-13 09:07:30 -07:00
Krzysztof Drewniak
ba6d7a0f25 [mlir][AMDGPU] Add gfx941 to buffer atomics emulation
Reviewed By: fmorac

Differential Revision: https://reviews.llvm.org/D152299
2023-09-13 16:07:07 +00:00
Joshua Cranmer
bf49237103 [Clang] Enable -print-pipeline-passes in clang.
Reviewed By: arsenm, aeubanks

Differential Revision: https://reviews.llvm.org/D127221
2023-09-13 08:57:10 -07:00
David Spickett
b6f66c94bc [lldb][AArch64] Reformat register set test with black
I missed this before landing.
2023-09-13 15:52:24 +00:00
Mircea Trofin
c1f8fdbb5c [mlgo] fix 2 regalloc tests post DAG change
The tests check against an expected output file - trivial change.

Reference: either D158068 or e6b85c3
2023-09-13 11:48:47 -04:00
Nick Desaulniers
2ca4d13612
[InlineAsm] wrap ConstraintCode in enum class NFC (#66003)
Similar to
commit 2fad6e6985 ("[InlineAsm] wrap Kind in enum class NFC")

Fix the TODOs added in
commit 93bd428742 ("[InlineAsm] refactor InlineAsm class NFC
(#65649)")
2023-09-13 08:48:09 -07:00
Yinying Li
dbe1be9aa4
[mlir][sparse] Migrate tests to use new syntax (#66146)
lvlTypes = [ "compressed" ] to map = (d0) -> (d0 : compressed)
lvlTypes = [ "dense" ] to map = (d0) -> (d0 : dense)
2023-09-13 11:41:25 -04:00
Siva Chandra
d25b4fae93
[libc][NFC] Make entrypoint alias targets real library targets. (#66044)
This is part of a libc wide CMake cleanup which aims to eliminate
certain explicitly duplicated logic which is available in CMake-3.20.
This change in particular makes the entrypoint aliases real library
targets so that they can be treated as normal library targets by other
libc build rules.
2023-09-13 08:35:23 -07:00
Eymen Ünay
62f793ec9c [JITLink][AArch32] Implement ELF::R_ARM_JUMP24 relocation
Added support and test for ELF::R_ARM_JUMP24

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D157541
2023-09-13 17:16:29 +02:00
Eymen Ünay
142c89c381 [JITLink][AArch32] Implement ELF::R_ARM_CALL relocation
- Added WritableArmRelocation and ArmRelocation Structs
- Encode/Decode funcs for B/BL A1 and BLX A2 encodings
- Add ARM helper functions, consistent with the existing Thumb helper functions
- Add Test for ELF::R_ARM_CALL

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D157533
2023-09-13 17:16:29 +02:00
Timm Bäder
a7f256fb4c [clang][Interp][NFC] Use delegate() once more 2023-09-13 17:08:40 +02:00
sstwcw
5db201fb75
[clang-format] Stop breaking unbreakable strings in JS (#66168)
Dictionary literal keys and strings in TypeScript type declarations can
not be broken.

The problem was pointed out by @alexfh and @e-kud here:

https://reviews.llvm.org/D154093#4644512
2023-09-13 17:04:04 +02:00
lorenzo chelini
d65885ae63
[MLIR][Linalg] Bail out if the tiles provided are more than the number (#66007)
Currently, the compiler crashes if the number of tiles provided exceeds
the number of loops.
2023-09-13 10:41:03 -04:00
Zequan Wu
5db9412010 [test] add 'REQUIRES: lld-available' to online-merging-windows.c
This test doesn't explicitly require lld but clang's flag -fuse-ld=lld uses lld.
This fixes the error that clang cannot invoke lld.
2023-09-13 10:30:56 -04:00
CarolineConcatto
ee31ba0dd9
[AArch64][SME]Update intrinsic interface for ld1/st1 (#65582)
The new ACLE PR#225[1] now combines the slice parameters for some
builtins. 
Slice specifies the ZA slice number directly and needs to be explicity
implemented by the "user" with the base register plus the immediate
offset

[1]https://github.com/ARM-software/acle/pull/225/files
2023-09-13 15:24:09 +01:00
Martin Erhart
c199f7dc62 Revert "[mlir][bufferization] Remove allow-return-allocs and create-deallocs pass options, remove bufferization.escape attribute"
This reverts commit 6a91dfedeb.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:48 +00:00
Martin Erhart
94c8faeaff Revert "[mlir][bufferization] Update linalg integration tests to lower ops created by bufferization-to-memref pass"
This reverts commit 6f35401f86.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:48 +00:00
Martin Erhart
520407a7c8 Revert "[mlir][bufferization] Improve buffer deallocation pass"
This reverts commit 1bebb60a75.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:48 +00:00
Martin Erhart
792caac0f8 Revert "[mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface"
This reverts commit 29d86175e6.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Martin Erhart
9782232ec7 Revert "[mlir][bufferization] BufferDeallocationOpInterface: support custom ownership update logic"
This reverts commit 89117f1807.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Martin Erhart
ccb16acd46 Revert "[mlir][bufferization] Implement BufferDeallocationopInterface for scf.forall.in_parallel"
This reverts commit 1356e853d4.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Martin Erhart
7995a4701d Revert "[mlir][bufferization] Define a pipeline for buffer deallocation"
This reverts commit f0c4663942.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Martin Erhart
99cd1e7004 Revert "[mlir][bufferization] Remove unused function"
This reverts commit cb5fe6ce75.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Mikhail R. Gadelha
75398f28eb [libc] Make time_t 64 bits long on all platforms but arm32
This patch changes the size of time_t to be an int64_t. This still
follows the POSIX standard which only requires time_t to be an integer.

Making time_t a 64-bit integer also fixes two cases in 32 bits platforms
that use SYS_clock_nanosleep_time64 and SYS_clock_gettime64, as the name
of these calls implies, they require a 64-bit time_t. For instance, in rv32,
the 32-bit version of these syscalls is not available.

We also follow glibc here, where time_t is still a 32-bit integer in
arm32.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159125
2023-09-13 10:49:39 -03:00
Joseph Huber
1b7a095e27
[Clang][AMDGPU] Permit language address spaces for AMDGPU globals (#66205)
Summary:
Currently, there is an assertion that prevents us from emitting an
AMDGPU global with a non-target specific address space (i.e. numerical
attribute). I'm unsure what the original intentions of this assertion
were, but we should be able to use OpenCL address spaces when compiling
directly to AMDGPU from C++. This is permitted on NVPTX so I'm unsure
what this assertion is guarding. The patch simply removes the assertion
and adds a test to ensure that these emit the expected address spaces.

Fixes https://github.com/llvm/llvm-project/issues/65069
2023-09-13 08:43:01 -05:00
Guray Ozen
ba81cd10d6
[MLIR] Fix the tma_load test (#66208)
clang was used for local testing. The PR changes it to `mlir-cpu-runner`
2023-09-13 15:33:42 +02:00
Joseph Huber
49ff6a96a7
[Clang] Define AMDGPU ABI when referenced in CodeGen for ABI "none" (#66162)
Summary:
We use the `llvm.amgcn.abi.version` varaible to control code generation.
This is emitted in every module now to indicate what should be used when
compiling. Previously, the logic caused us to emit an external reference
to this variable when creating the code for the `none` type. This would
then cause us not to emit the actual definition. This patch refines the
logic to create the external reference, and then update it if it is
found unset by the time we emit the global. I had to remove the
reference to `GetOrCreateLLVmGlobal` because it did not accept the
proper address space.
2023-09-13 08:31:31 -05:00
Guray Ozen
38faecc692
[MLIR] SM_90 integration test of TMA with 128b Swizzling (#65953)
An integration test for the 128b Swizzling TMA.

TMA with 128B Swizzle loads data as follows (each numbered cell is 16
bytes). The program tests this pattern for `128x64xf16` type.

```
|-------------------------------|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 |
| 2 | 3 | 0 | 1 | 6 | 7 | 4 | 5 |
| 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 |
| 4 | 5 | 6 | 7 | 0 | 1 | 2 | 3 |
| 5 | 4 | 7 | 6 | 1 | 0 | 3 | 2 |
| 6 | 7 | 4 | 5 | 2 | 3 | 0 | 1 |
|-------------------------------|
| ... pattern repeats ...       |
|-------------------------------|
```
2023-09-13 15:22:48 +02:00
martinboehme
e65e94fddc
[clang][dataflow] Rename test target function to target(). (#66195)
Otherwise, the test doesn't actually do anything.
2023-09-13 15:07:44 +02:00
Guray Ozen
6360d09531
[MLIR][NVVM] Fix the register number of predicate (#65970)
The register number of predicate is calculated incorrectly. This PR
fixes that.
2023-09-13 15:04:31 +02:00
Timm Bäder
d2c2fa94ae [clang][NFC] Replace deprected *cast_or_null casts 2023-09-13 14:54:21 +02:00
Luke Drummond
8248388c5e [NVPTX][NFC] Use unsigned for all custom printmethods
We were using a mix of unsigned and signed ints in the various PTX asm
printers. All calls from tablgen use a non-negative immediate, so either
will work, but when doing arithmetic on the return value from
`getNumOperands`, or calling `getOperand`, it makes sense to keep
everything unsigned.
2023-09-13 13:45:31 +01:00
Paul T Robinson
47daf144f1
Update paths for debuginfo labeling (#66143)
Adds a bunch of stuff overlooked in the original setup. Steps back a
little on the llvm/lib/CodeGen/AsmPrinter paths.
2023-09-13 08:38:37 -04:00
Michael Maitland
0f4c9a0560
[IR][IntrinsicInst] Add VPBinOpIntrinsic (#66132)
VPIntrinsics with VP_PROPERTY_BINARYOP property should have the ability
to be queried with with VPBinOpIntrinsic::isVPBinOp, similiar to how
intrinsics with the VP_PROPERTY_REDUCTION property can be queried with
VPReductionIntrinsic::isVPReduction.

This will be used in #65706. In that PR the usage of this class is
tested.
2023-09-13 08:35:17 -04:00
Luke Lau
41eb82f8d1
[VP] Add method for looking up functional intrinsic ID for VP. NFC (#66190)
This adds a helper method to get the ID of the functionally equivalent
intrinsic, similar to the existing getFunctionalOpcodeForVP and
getConstrainedIntrinsicIDForVP methods.

Not sure if it's notable or not, but I can't find any existing uses of
VP_PROPERTY_FUNCTIONAL_INTRINSIC?

It could potentially be used in #65706 to scalarize VP intrinsics.
2023-09-13 13:33:55 +01:00
Timm Bäder
05a11f3e6d [clang][Sema][NFC] Add missing docs to some FieldDecl methods. 2023-09-13 14:20:10 +02:00
Simon Pilgrim
4a32c48280 [X86] LowerTRUNCATE - ensure we handle cases where we truncate to a sub-128bit type (PR66194)
Fixes #66194
2023-09-13 13:15:42 +01:00