468119 Commits

Author SHA1 Message Date
Simon Pilgrim
b8bda50932 [Sparc] Regenerate float-constants.ll test checks 2023-07-18 17:31:34 +01:00
Rahul Kayaith
67a910bbff [mlir][python] Remove PythonAttr mapping functionality
This functionality has been replaced by TypeCasters (see D151840)

depends on D154468

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D154469
2023-07-18 12:21:28 -04:00
Dinar Temirbulatov
fe22b9050c [AArch64] Regenerate a couple of vector-shuffle tests. NFC
As a request in https://reviews.llvm.org/D152205
2023-07-18 16:04:15 +00:00
Joseph Huber
8759f1b030 Revert "[libc] Default the GPU build to the default memory utilities"
This reverts commit eca8b54a5f76c65a055bac05556b70c2a0ec63a1.

Another user reverted the patch this was based on leaving this one in a
broken state.
2023-07-18 11:01:38 -05:00
Slava Zakharin
daa8734233 [flang][hlfir] Support polymorphic hlfir.expr values.
This patch sets 'polymorphic' attribute of hlfir::ExprType when
the value is created from a polymorphic entity.
Memoization of such ExprType involves creating a mutable descriptor
on the stack, which is initialized (as a null box) and passed to
AllocatableApplyMold with the mold being the entity from which
the ExprType value is being created.

This patch fixes "creating polymorphic temporary" TODO and also
several cases of "'fir.convert' op invalid type conversion" error.

Reviewed By: tblah

Differential Revision: https://reviews.llvm.org/D155541
2023-07-18 09:00:26 -07:00
Joseph Huber
eca8b54a5f [libc] Default the GPU build to the default memory utilities
A previous patch made this cause an error on the GPU. We have not yet
dedicated time towards an optimial implementaiton there but we do not
want it to cause an error. We simply use the fallback routines.

Differential Revision: https://reviews.llvm.org/D155615
2023-07-18 10:49:51 -05:00
Jens Carl
37937b8a04 [clang-tidy][NFC] Update path of main translation unit
The forcing of the linker for a new module was moved from file
clang-tidy/tools/ClangTidyModule.cpp to
clang-tidy/ClangTidyForceLinker.h.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D76477
2023-07-18 15:49:01 +00:00
Jon Chesterfield
f717c2d4f2 Revert "[libc][memfunctions] Explicit error when platform in not supported"
Broke amdgpu libc bot

This reverts commit a39c951730aa92894e27da038e834229d4613db1.
2023-07-18 16:41:47 +01:00
Mark de Wever
ab0d757bcf [libc++][chrono] Fixes month inc and dec operations.
The operator++, operator++(int), operator--, and operator--(int) need to
change the month to a valid value. The wording is specified in terms of
  operator+(const month& x, const months& y) noexcept;
which has the correct behavior. The aforementioned operators instead
used ++/-- on the internal value direction, resulting in incorrect
behaviour.

As a drive-by improve the unit tests:
- use the typical constexpr test method
- test whether the month is valid after the operations
- format the tests

Fixes: https://llvm.org/PR63912

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D155504
2023-07-18 17:32:11 +02:00
Haojian Wu
f4f6c229bd [clangd] Refine the workflow for diagnostic Fixits.
- No longer store the diagnostic fixits in the clangdLSPServer
- When propagating the fixit via the code action, we use the Diag
  information stored in the ParsedAST (in clangdServer.cpp)

Differential Revision: https://reviews.llvm.org/D155173
2023-07-18 17:25:08 +02:00
Martin Storsjö
793a349e6f Revert "[AArch64] Fix an immediate out of range for large realignments on Windows"
This reverts commit b1d0bc0f4395c69097bc11b6ba8f821f621272a9.

Builds with expensive checks show that 'sp' isn't a valid register
in ADDXrr - an object file built without exprnsive checks enabled
disassembles as "add x15, xzr, x16", instead of the intended
"add x15, sp, x16".
2023-07-18 18:21:23 +03:00
Razvan Lupusoru
7496177d98 [openacc] Add dialect definition for acc declare
A declare directive is used to specify the creation of a visible device
copy of a variable for the duration of the implicit data region as it
relates to the scope in which the variable is declared.

In order to support this, the following new operations were added:
1) `acc.global_ctor` and `acc.global_dtor`. These are used whenever the
declare directive applies to a global.
2) `acc.declare_enter` and `acc.declare_exit`. These operations are
modeled similarly to `acc.enter_data` and `acc.exit_data`. The reason
they are not modeled like `acc.data` is so that these operations can be
used both for globals and regions like functions.
3) `acc.declare_device_resident` and `acc.declare_link`. These
operations are modeled in a manner consistent with previously defined
data entry operation model.

The `acc.getdeviceptr` was generalized so that it can be used with
acc.declare_exit.

Reviewed By: clementval, vzakhari

Differential Revision: https://reviews.llvm.org/D155322
2023-07-18 08:11:06 -07:00
Markus Böck
cde72af3db [mlir][LLVM] Append call ops alias scopes to inlined operations
Currently when inlining, any alias scope information previously attached to the call op is lost. This leads to a loss of information that could be used by alias analysis to determine that two memory access operations do not alias.

This patch fixes this issue by also taking any alias scopes of the call operation into account. These can then simply be appended onto any inlined operations.

This is analogous to the following code in LLVM: 1768c4597e/llvm/lib/Transforms/Utils/InlineFunction.cpp (L940)

Differential Revision: https://reviews.llvm.org/D155595
2023-07-18 16:26:17 +02:00
Ingo Müller
ef240e942a [mlir][transform][bufferization][python] Add .td file for bindings.
Reviewed By: springerm, ftynse

Differential Revision: https://reviews.llvm.org/D155564
2023-07-18 14:16:37 +00:00
Adrian Kuegel
7da6e0af1d [mlir][Bazel] Add missing dependency. 2023-07-18 16:10:48 +02:00
Adrian Kuegel
107a7d1f05 [mlir][Bazel] Add VectorToArmSME target. 2023-07-18 16:02:15 +02:00
Guillaume Chatelet
a39c951730 [libc][memfunctions] Explicit error when platform in not supported
Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D155597
2023-07-18 13:53:03 +00:00
Adrian Kuegel
7bde09cc24 [mlir][Bazel] Add missing dependency. 2023-07-18 15:51:49 +02:00
iambrj
3dd9931c0f [MLIR][Presburger] Implement domain and range restriction for PresburgerRelation
This patch implements domain and range restriction for PresburgerRelation

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D154798
2023-07-18 19:12:12 +05:30
Martin Braenne
6236bf5341 [clang][dataflow] Strengthen flow condition assertions.
Instead of asserting merely that the flow condition doesn't imply that a variable is true, make the stronger assertion that the flow condition implies that the variable is false.

Reviewed By: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D155067
2023-07-18 13:41:43 +00:00
Paweł Bylica
7324535984
[clang][NFC] Fix typos in sema builtins test 2023-07-18 15:40:28 +02:00
Christoph Stiller
1768c4597e [MCA] Document behaviour of ResourceRef
Differential Revision: https://reviews.llvm.org/D155347
2023-07-18 14:09:21 +01:00
Alexey Bataev
83ba148a8a [SLP]Include cost of the reshuffling for same nodes with resizing.
Need to account reshuffling, required for the reused elements in the
buildvector nodes, which are copies (perfect match) of other nodes, but
include reused elements.

Differential Revision: https://reviews.llvm.org/D149966
2023-07-18 06:05:15 -07:00
John Brawn
343e204a52 [ARM] Replace TransferImpOps with copyImplicitOps
In most places where TransferImpOps is currently used we just have one
machine instruction, so it's doing the same thing as copyImplicitOps
anyway. In those cases where we have more than one machine
instruction the destination is written to in each instruction so any
implicit defs should appear on all of them (and we shouldn't see any
implicit refs as these pseudo-instruction don't have any register
inputs), meaning the current use of TransferImpOps is incorrect and
we should be using copyImplicitOps on all of the generated
instructions.

Differential Revision: https://reviews.llvm.org/D155301
2023-07-18 14:01:04 +01:00
wanglei
46aec7bc09 [LoongArch][NFC] Revise instruction format to match lsx and lasx styles
Replace lengthy `0b...` binary form with a unified 32-bit hexadecimal
 representation for opcode.  This reduces complexity when dealing with
 opcode discontinuities.
2023-07-18 20:58:34 +08:00
Martin Storsjö
b1d0bc0f43 [AArch64] Fix an immediate out of range for large realignments on Windows
Also add a missing FrameSetup flag on the existing add instruction.

This fixes https://github.com/llvm/llvm-project/issues/63701.

Differential Revision: https://reviews.llvm.org/D155447
2023-07-18 15:56:36 +03:00
Luke Lau
5eb7191421 [RISCV] Add VP patterns for vandn.[vv,vx]
This builds upon D155433

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D155434
2023-07-18 13:53:17 +01:00
Luke Lau
26ff4c6745 [RISCV] Add SDNode patterns for vandn.[vv,vx]
Unfortunately we can't use the standard splat_vector and vnot PatFrags because
they are preprocessed to vmv.v.x's, so we need to define helpers to catch
those. We can't use SplatPat either because we need to nest another fragment
inside of it.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D155433
2023-07-18 13:53:14 +01:00
Matthias Springer
db393288ff [mlir][NVGPU][transform] Add create_async_groups transform op
This transform looks for suitable vector transfers from global memory to shared memory and converts them to async device copies.

Differential Revision: https://reviews.llvm.org/D155569
2023-07-18 14:36:41 +02:00
Guillaume Chatelet
23dcdbfba7 [libc][NFC] Split memmove implementations per platform
This is a follow up on D154800 and D154770 to make the code structure more principled and avoid too many nested #ifdef/#endif.

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D155515
2023-07-18 12:20:23 +00:00
Jie Fu
30d11e5ef9 [Flang] Remove unused variable 'converter' in genCustomIntrinsicRefCore
/data/workspace/llvm-project/flang/lib/Lower/ConvertCall.cpp:1281:9: error: unused variable 'converter' [-Werror,-Wunused-variable]
  auto &converter = callContext.converter;
        ^
1 error generated.
2023-07-18 20:17:18 +08:00
Nikita Popov
eadbc4b004 [Constants] Use getGEPReturnType() (NFC)
This reimplements essentially the same logic.
2023-07-18 14:11:38 +02:00
dingfei
c24f0f9bd6 [NFC][clang-extdef-mapping] fix test failure on unsupported targets
ms-stlye asm block is not supported on targets like arm/hexagon.
Specify a working target as POC.

Introduced by https://reviews.llvm.org/D154983

Differential Revision: https://reviews.llvm.org/D155576
2023-07-18 19:56:50 +08:00
Alex Zinenko
4a6b31b8d8 [mlir] NFC: untangle SCF Patterns.h and Transforms.h
These two headers both contained a strange mix of definitions related to
both patterns and non-pattern transforms. Put patterns and "populate"
functions into Patterns.h and standalone transforms into Transforms.h.

Depends On: D155223

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D155454
2023-07-18 11:27:36 +00:00
Markus Böck
dd28cc707c [mlir][LLVM] Perform deep clone of alias scopes during inlining
This is the first and most basic and important step for inlining memory operations with alias scopes.

For correctness, it is required that any alias scopes of inlined operations are replaced with deep copies. This is necessary as otherwise the same function could be inlined twice in one function, and suddenly the alias scopes extended.
A simple example would be `foo(a, b); foo(a2, b2)`. `a` and `a2` may alias. If `foo` is inlined in both instances, the store and load operations from `foo` may suddenly claim that `a` and `a2` do not alias if we were to keep the original alias scopes.

This is analogous to the following class/code in LLVM: 4eef2e30d6/llvm/lib/Transforms/Utils/InlineFunction.cpp (L985)

Differential Revision: https://reviews.llvm.org/D155479
2023-07-18 13:23:40 +02:00
Haojian Wu
be861b64d9 [include-cleaner] Avoid a caching issue when running --edit mode on multiple files.
Snapshot all analysing files before running the tool, this makes sure
that we analyse all files statelessly and avoid the FileManager caching issue
when running `-edit` on multiple files.

Differential Revision: https://reviews.llvm.org/D155195
2023-07-18 13:21:23 +02:00
Kiran Chandramohan
fc43c4f018 [Flang] Include logical default with default-integer-8
Other compilers include the logical default also with the
default-integer-8 setting. This patch does the same for
flang.

Reviewed By: awarzynski, sscalpone

Differential Revision: https://reviews.llvm.org/D155279
2023-07-18 11:05:25 +00:00
Tom Eccles
75f459d555 [flang][hlfir][NFC] catch dynamically optional args with no lowering
These should be lowered with genOptionalValue as in D154897, but I
haven't found any cases where this code path is actually hit (flang
tests, gfortran test suite), so I don't think it would be testable.
Adding an assertion for if this code path ever becomes live.

Differential Revision: https://reviews.llvm.org/D155477
2023-07-18 11:03:35 +00:00
Tom Eccles
db7b665c5c [flang][hlfir] support dynamically optional array arguments to intrinsics with custom handling
The previous code path created the elemental kernel by generating a
scalar intrinsic call using pre-prepared arguments using genIntrinsicRefCore,
which then generated the intrinsic call using genIntrinsicCall().

The problem with this approach was that the dynamically optional
arguments were marked as having no argLowering, which meant that they
were unconditionally passed by value without any check to see if they
were present.

It would be nice to put an if operation in the path for !argLowering,
doing something similar to genOptionalValue(). However, this can't be
done because it isn't clear what value should be used for the default.
If zero was used (like in genOptionalValue) this could effect the result
of MIN or MAX.

Instead, this patch re-uses the implementation for scalar dynamically
optional arguments (in non-elemental calls). This does the correct
thing, entirely ignoring absent optional arguments.

Depends On: D155292

Differential Revision: https://reviews.llvm.org/D155293
2023-07-18 11:03:35 +00:00
Tom Eccles
09880ef6c9 [flang][hlfir] add support for elemental intrinsics with custom handling
Only minimal argument processing is needed here because they will be
lowered properly either by the elemental intrinsic call builder or the
lowering of the scalar call inside the elemental kernel.

Dynamically optional arrays are coming in the next patch.

Depends On: D155291

Differential Revision: https://reviews.llvm.org/D155292
2023-07-18 11:03:34 +00:00
Tom Eccles
b0935fc4f8 [flang][hlfir] custom intrinsic handling for scalar arguments
This should produce the same results as the FIR lowering

Differential Revision: https://reviews.llvm.org/D155291
2023-07-18 11:03:34 +00:00
Paulo Matos
eb5d79876a [InstCombine] Allow KnownBits to be propagated
Bug #63699 shows a hang on arm in instcombine because we do not
propagate known bits for fshl/fshr rotates. We perform the propagation
and add regression test.

Differential Revision: https://reviews.llvm.org/D155307
2023-07-18 13:01:22 +02:00
Matt Arsenault
c28e09c8d1 AMDGPU: Preserve flags in fdiv_fast lowering
We were dropping the flags and thus blocking contract into potential
fadd users. GlobalISel was already preserving the flags here.

https://reviews.llvm.org/D155443
2023-07-18 06:57:07 -04:00
Matt Arsenault
4a81283b94 AMDGPU: Generate and add fdiv tests
Prepare for new lowering strategies because we somehow didn't have
enough of them already.
2023-07-18 06:38:05 -04:00
Matt Arsenault
f868c22bee ValueTracking: Fix computeKnownFPClass canonicalize handling
This mostly manifested as broken constant folding. This was
mishandling the dynamic denormal mode. It was also mishandling literal
signaling nans, such that they would also be treated as poison.

https://reviews.llvm.org/D155437
2023-07-18 06:37:15 -04:00
Matt Arsenault
00f9c6fcb8 ValueTracking: Add more tests for canonicalize class handling 2023-07-18 06:37:15 -04:00
Matt Arsenault
cdfdfe7ccc AMDGPU: Add some additional rcp/rsq tests 2023-07-18 06:37:15 -04:00
Nikita Popov
b13f280538 [IR] Remove typed pointer handling from getGEPReturnType() (NFC) 2023-07-18 12:28:53 +02:00
Sander de Smalen
08fd44b300 [AArch64] Force streaming-compatible codegen when attributes are set.
Before this patch, the only way to generate streaming-compatible code
was to use the `-force-streaming-compatible-sve` flag, but the compiler
should also avoid the use of instructions invalid in streaming mode
when a function has the aarch64_pstate_sm_enabled/compatible attribute.

Reviewed By: paulwalker-arm, david-arm

Differential Revision: https://reviews.llvm.org/D155428
2023-07-18 10:26:00 +00:00
Matt Arsenault
e9725628ba libomptarget: Try to fix dependency tracking for llvm tools 2023-07-18 06:21:33 -04:00