Commit Graph

415398 Commits

Author SHA1 Message Date
Guillaume Chatelet b254a2a703 [libc][automemcpy] Add mean/variance and simplify implementation
Differential Revision: https://reviews.llvm.org/D120031
2022-02-17 12:11:05 +00:00
Nikita Popov 4846568191 [Docs] Update opaque pointers docs
Expand migration instructions.
2022-02-17 13:03:33 +01:00
Roman Lebedev 07cf95942f
[NFC][PhaseOrdering] Improve test coverage for D119975 2022-02-17 14:58:22 +03:00
Simon Pilgrim 5f4549c372 [SystemZ] lowerDYNAMIC_STACKALLOC_XPLINK - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
2022-02-17 11:56:29 +00:00
Simon Pilgrim ada6bcc13f [X86] X86tcret_1reg - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
2022-02-17 11:54:12 +00:00
Simon Pilgrim f1877eb1bb AArch64_MC::isQForm - Fix MSVC 'no default capture mode' lambda warning 2022-02-17 11:41:47 +00:00
Nikita Popov 36fdfaba19 [RelLookupTableConverter] Ensure that GV, GEP and load types match
This code could be generalized to be type-independent, but for now
just ensure that the same type constraints are enforced with opaque
pointers as with typed pointers.
2022-02-17 12:05:05 +01:00
Max Kazantsev fc539b0004 [SCEV] Infer ranges for SCC consisting of cycled Phis
Our current strategy of computing ranges of SCEVUnknown Phis was to simply
compute the union of ranges of all its inputs. In order to avoid infinite recursion,
we mark Phis as pending and conservatively return full set for them. As result,
even simplest patterns of cycled phis always have a range of full set.

This patch makes this logic a bit smarter. We basically do the same, but instead
of taking inputs of single Phi we find its strongly connected component (SCC)
and compute the union of all inputs that come into this SCC from outside.

Processing entire SCC together has one more advantage: we can set range for all
of them at once, because the only thing that happens to them is the same value is
being passed between those Phis. So, despite we spend more time analyzing a
single Phi, overall we may save time by not processing other SCC members, so
amortized compile time spent should be approximately the same.

Differential Revision: https://reviews.llvm.org/D110620
Reviewed By: reames
2022-02-17 18:03:52 +07:00
Sven van Haastregt 9798b33d1d [OpenCL] Guard 64-bit atomic types
Until now, overloads with a 64-bit atomic type argument were always
made available with `-fdeclare-opencl-builtins`.  Ensure these
overloads are only available when both the `cl_khr_int64_base_atomics`
and `cl_khr_int64_extended_atomics` extensions have been enabled, as
required by the OpenCL specification.

Differential Revision: https://reviews.llvm.org/D119858
2022-02-17 10:58:52 +00:00
Alexey Lapshin 889317d47b [objcopy][NFC] Add doc comments to the executeObjcopy* functions.
Add doc comments to the executeObjcopy* functions.

Depends on D88827
2022-02-17 13:48:48 +03:00
Pavel Kosov 37fa99eda0 [SchedModels][CortexA55] Add ASIMD integer instructions
Depends on D114642

Original review https://reviews.llvm.org/D112201

OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D117003
2022-02-17 13:41:57 +03:00
Pavel Kosov f3809b20f2 [AArch64][SchedModels] Handle virtual registers in FP/NEON predicates
Current implementation of Check[HSDQ]Form predicates doesn’t handle virtual registers and therefore isn’t useful for pre-RA scheduling. Patch fixes this implementing two function predicates: CheckQForm for checking that instruction writes 128-bit NEON register and CheckFpOrNEON which checks that instruction writes FP register (any width). The latter supersedes Check[HSD]Form predicates which are not used individually.

OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D114642
2022-02-17 13:41:05 +03:00
Nikita Popov 5065076698 [CodeGen] Rename deprecated Address constructor
To make uses of the deprecated constructor easier to spot, and to
ensure that no new uses are introduced, rename it to
Address::deprecated().

While doing the rename, I've filled in element types in cases
where it was relatively obvious, but we're still left with 135
calls to the deprecated constructor.
2022-02-17 11:26:42 +01:00
Zakk Chen 093ecccdab [RISCV] Add the passthru operand for vadc/vsbc/vmerge/vfmerge IR intrinsics.
The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D119686
2022-02-17 02:21:39 -08:00
Eli Friedman 0389f2edf7 Revert "[compiler-rt] Implement ARM atomic operations for architectures without SMP support"
This reverts commit 910a642c0a.

There are serious correctness issues with the current approach: __sync_*
routines which are not actually atomic should not be enabled by default.

I'll continue discussion on the review.
2022-02-17 02:17:27 -08:00
Eli Friedman d20e01bb06 Revert "[NFC][compiler-rt] Format file lib/builtins/arm/sync-ops.h"
This reverts commit f165c23bf3.

Part of revert sequence for 910a642c0a.
2022-02-17 02:16:25 -08:00
Alexey Lapshin f75da0c8e6 [llvm-objcopy][NFC] Move core implementation of llvm-objcopy into separate library.
This patch moves core implementation of llvm-objcopy into Object library
(http://lists.llvm.org/pipermail/llvm-dev/2020-September/145075.html).
The functionality for parsing input options is left inside tools/llvm-objcopy.
The interface of ObjCopy library:

ObjCopy/ELF/ELFObjcopy.h

```
Error executeObjcopyOnIHex(const CopyConfig &Config, MemoryBuffer &In,
                           Buffer &Out);
Error executeObjcopyOnRawBinary(const CopyConfig &Config, MemoryBuffer &In,
                                Buffer &Out);
Error executeObjcopyOnBinary(const CopyConfig &Config,
                             object::ELFObjectFileBase &In, Buffer &Out);

```
ObjCopy/COFF/COFFObjcopy.h

```
Error executeObjcopyOnBinary(const CopyConfig &Config,
                             object::COFFObjectFile &In, Buffer &Out);

```
ObjCopy/MachO/MachOObjcopy.h

```
Error executeObjcopyOnBinary(const CopyConfig &Config,
                             object::MachOObjectFile &In, Buffer &Out);

```
ObjCopy/wasm/WasmObjcopy.h

```
Error executeObjcopyOnBinary(const CopyConfig &Config,
                             object::WasmObjectFile &In, Buffer &Out);

```

Differential Revision: https://reviews.llvm.org/D88827
2022-02-17 13:11:42 +03:00
Siddharth Bhat 24a37a396a [MLIR] add entry block to MLIR grammar.
The MLIR parser allows regions to have an unnamed entry block.
Make this explicit in the language grammar.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D119950
2022-02-17 15:40:43 +05:30
David Green f3bc7fd546 [AArch64] Cleanup for performCommonVectorExtendCombine. NFC
This is some NFC (hopefully!) cleanup for performCommonVectorExtendCombine
and related methods, removing conditions that cannot occur and otherwise
cleaning up the code a little.
2022-02-17 10:03:28 +00:00
Jay Foad c08896d292 [AMDGPU] Return better Changed status from SILowerI1Copies
Differential Revision: https://reviews.llvm.org/D119946
2022-02-17 09:38:57 +00:00
Jay Foad 78ebb1dd24 [AMDGPU] Return better Changed status from SIAnnotateControlFlow
Differential Revision: https://reviews.llvm.org/D119945
2022-02-17 09:38:57 +00:00
Stanislav Gatev a480841566 Add missing break statement in switch. 2022-02-17 09:37:02 +00:00
Jay Foad 1822a5ecdd [AMDGPU] Return better Changed status from AMDGPUPerfHintAnalysis
Differential Revision: https://reviews.llvm.org/D119944
2022-02-17 09:31:42 +00:00
Jay Foad 77e793d025 [AMDGPU] Return better Changed status from AMDGPUAnnotateUniformValues
Differential Revision: https://reviews.llvm.org/D119943
2022-02-17 09:31:42 +00:00
Jay Foad 50ddb5d2d1 [CodeGen] Return better Changed status from LocalStackSlotAllocation
Differential Revision: https://reviews.llvm.org/D119942
2022-02-17 09:31:41 +00:00
Jay Foad f0092f9ded [CodeGen] Return false from LiveIntervals::runOnMachineFunction
This is an analysis pass so it does not modify the MachineFunction.

Differential Revision: https://reviews.llvm.org/D119941
2022-02-17 09:31:41 +00:00
Jay Foad 3c9229c663 [CodeGen] Return better Changed status from DetectDeadLanes
Differential Revision: https://reviews.llvm.org/D119940
2022-02-17 09:31:41 +00:00
Ben Shi 0b93e90971 Revert "[RISCV] LUI used for address computation should not isAsCheapAsAMove"
This reverts commit 23a5073600.

Although this patch achieved better codegen in most cases, it is really
important to accurately describe the cost of instructions. So I revert it.
2022-02-17 17:27:37 +08:00
Roman Lebedev 371fcb720e
[SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until after at least the IPSCCP
That transformation is lossy, as discussed in
https://github.com/llvm/llvm-project/issues/53853
and https://github.com/rust-lang/rust/issues/85133#issuecomment-904185574

This is an alternative to D119839,
which would add a limited IPSCCP into SimplifyCFG.

Unlike lowering switch to lookup, we still want this transformation
to happen relatively early, but after giving a chance for the things
like CVP to do their thing. It seems like deferring it just until
the IPSCCP is enough for the tests at hand, but perhaps we need to
be more aggressive and disable it until CVP.

Fixes https://github.com/llvm/llvm-project/issues/53853
Refs. https://github.com/rust-lang/rust/issues/85133

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D119854
2022-02-17 12:13:55 +03:00
Alex Zinenko d4a53f3bfa [mlir] call target materialization more in dialect conversion
During dialect conversion, target materialization is triggered to create
cast-like operations when a type mismatch occurs between the value that
replaces a rewritten operation and the type that another operations expects as
operands processed by the type conversion. First, a dummy cast is inserted to
make sure the pattern application can proceed. The decision to trigger the
user-provided materialization hook is taken later based on the result of the
dummy cast having uses. However, it only has uses if other patterns constructed
new operations using the casted value as operand. If existing (legal)
operations use the replaced value, they may have not been updated to use the
casted value yet. The conversion infra would then delete the dummy cast first,
and then would replace the uses with now-invalid (null in the bast case) value.
When deciding whether to trigger cast materialization, check for liveness the
uses not only of the casted value, but also of all the values that it replaces.

This was discovered in the finalizing bufferize pass that cleans up
mutually-cancelling casts without touching other operations. It is not
impossible that there are other scenarios where the dialect converison infra
could produce invalid operand uses because of dummy casts erased too eagerly.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D119937
2022-02-17 10:13:23 +01:00
Stanislav Gatev dd4dde8d39 [clang][dataflow] Add transfer functions for logical and, or, not.
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D119953
2022-02-17 09:09:59 +00:00
Lorenzo Chelini 25f1d50ca5 [MLIR][PDL] Fix typo (NFC) 2022-02-17 10:06:16 +01:00
Nikita Popov c3c5280b0e [InstSimplify] Delay creation of constants for offsets (NFC)
Return APInt from stripAndComputeConstantOffsets(), and only
create corresponding Constants later, if we actually need them.
2022-02-17 09:56:32 +01:00
Martin Storsjö 83c2aa467e [libcxx] [test] Fix locale.time.get.byname get_date and get_date_wide on Windows
Also apply the same fix on glibc. This takes the test one step closer
to passing on glibc, but it still fails on the zh_CN test (which
requires a more involved fix in libc++ itself).

Differential Revision: https://reviews.llvm.org/D119791
2022-02-17 10:54:39 +02:00
Martin Storsjö f081cc5037 [libcxx] [test] Fix the locale get_one_wide test for windows and glibc
Differential Revision: https://reviews.llvm.org/D119790
2022-02-17 10:54:18 +02:00
Martin Storsjö 77c7ce0384 [libcxx] [test] Make the put_long_double test pass on mingw, clarify quirks in put_double
Expect the same NAN formatting on Windows as on Glibc. (Both MSVC and
MinGW produce the same formatting there.)

The hex float formatting tests pass on MinGW, so opt in to those tests.

Document exactly what issues are remaining in Clang-cl/MSVC
configurations. (It's easily possible to make the tests pass there too,
but it requires a whole lot of small-scope ifndefs in the test file;
around 60 ifdefs in total for those both test files. Those could
be avoided if the CI environment could run with a newer version
of UCRT, but that's nontrivial to fix right away.)

Differential Revision: https://reviews.llvm.org/D119766
2022-02-17 10:53:28 +02:00
Amir Ayupov 32d2473a5d [BOLT][NFC] Report errors from createBinaryContext and RewriteInstance ctor
Refactor createBinaryContext and RewriteInstance/MachORewriteInstance
constructors to report an error in a library and fuzzer-friendly way instead of
returning a nullptr or exiting.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D119658
2022-02-17 00:50:52 -08:00
Marek Kurdej 0ae2464fcd [clang-format] Fix wrong assertion with non-negative shift when aligning tokens.
Fixes https://github.com/llvm/llvm-project/issues/53880.
2022-02-17 09:49:00 +01:00
Nikita Popov 859567725d [IndVars] Don't run full optimization pipeline in test (NFC)
This extracts the IR prior to IndVarSimplify and only runs the
single pass.
2022-02-17 09:28:33 +01:00
Ivan Butygin d271fc04d5 [mlir][gpu] Split ops sinking from gpu-kernel-outlining pass into separate pass
Previously `gpu-kernel-outlining` pass was also doing index computation sinking into gpu.launch before actual outlining.
Split ops sinking from `gpu-kernel-outlining` pass into separate pass, so users can use theirs own sinking pass before outlining.
To achieve old behavior users will need to call both passes: `-gpu-launch-sink-index-computations -gpu-kernel-outlining`.

Differential Revision: https://reviews.llvm.org/D119932
2022-02-17 10:34:20 +03:00
Pavel Kosov f165c23bf3 [NFC][compiler-rt] Format file lib/builtins/arm/sync-ops.h 2022-02-17 10:21:22 +03:00
Pavel Kosov 910a642c0a [compiler-rt] Implement ARM atomic operations for architectures without SMP support
ARMv5 and older architectures don’t  support SMP and do not have atomic instructions. Still they’re in use in IoT world, where one has to stick to libgcc.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D116088
2022-02-17 10:11:25 +03:00
Damian Rouson d4332a8842 [flang] add semantics test for sync images
Test a range of acceptable forms of SYNC IMAGES statements,
including combinations with and without the stat-variable
and errmsg-variable present.  Also test that several invalid
forms of SYNC IMAGES call generate the correct error messages.

Differential Revision: https://reviews.llvm.org/D118933
2022-02-16 22:30:58 -08:00
Tom Stellard fee491a10a issue-release-workflow: Add support for /cherry-pick command in issue body
Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D119312
2022-02-16 22:18:06 -08:00
Shraiysh Vaishay 5bec1ea7a7 [mlir] Added oilist primitive
This patch attempts to add the `oilist` primitive proposed in the [[ https://llvm.discourse.group/t/rfc-extending-declarative-assembly-format-to-support-order-independent-variadic-segments/4388 | RFC: Extending Declarative Assembly Format to support order-independent variadic segments ]].

This element supports optional order-independent variadic segments for operations. This will allow OpenACC and OpenMP Dialects to have similar and relaxed requirements while encouraging the use of Declarative Assembly Format and avoiding code duplication.

An oilist element parses grammar of the form:
```
clause-list := clause clause-list | empty
clause := `keyword` clause1 | `otherKeyword` clause2
clause1 := <assembly-format element>
clause2 := <assembly-format element>
```

AssemblyFormat specification:
```
let assemblyFormat = [{
  oilist( `keyword` clause1
        | `otherkeyword` clause2
        ...
        )
}];
```

Example:
```
oilist( `private` `(` $arg0 `:` type($arg0) `)`
      | `nowait`
      | `reduction` custom<ReductionClause>($arg1, type($arg1)))

oilist( `private` `=` $arg0 `:` type($arg0)
      | `reduction` `=` $arg1 `:` type($arg1)
      | `firstprivate` `=` $arg3 `:` type($arg2))
```

Reviewed By: Mogball, rriddle

Differential Revision: https://reviews.llvm.org/D115215
2022-02-17 11:10:24 +05:30
Eugene Zhulenev abe2dee5eb [mlir] NFC Async: always use 'b' for the current builder
Currently some of the nested IR building inconsistently uses `nb` and `b`, it's very easy to call wrong builder outside of the current scope, so for simplicity all builders are always called `b`, and in nested IR building regions they just shadow the "parent" builder.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D120003
2022-02-16 21:20:53 -08:00
Damian Rouson 99dd49cf97 [flang] add semantics test for sync all
Test a range of acceptable forms of SYNC ALL statements,
including combinations with and without the stat-variable
and errmsg-variable present.  Also test that several invalid
forms of SYNC ALL call generate the correct error messages.

Differential Revision: https://reviews.llvm.org/D114181
2022-02-16 20:43:01 -08:00
Serguei Katkov 194899caef [MemoryDependency] Relax the re-ordering of atomic store and unordered load/store
Atomic store with Release semantic allows re-ordering of unordered load/store before the store.
Implement it.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D119844
2022-02-17 10:53:25 +07:00
Jim Ingham 05f10ae0d8 On Windows, the function name contains the return parameter, so
the test has to be "function name contains the name we used to specify
the breakpoint" not IS the name...
2022-02-16 19:10:03 -08:00
Alex Brachet 64f5f6d759 [libc] Use '+' constraint on inline assembly
As suggested by @mcgrathr in D118099

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D119978
2022-02-17 03:00:17 +00:00