Commit Graph

393642 Commits

Author SHA1 Message Date
John Demme 5664c5e24e [MLIR] [Python] Add `owner` to PyValue and fix its parent reference
Adds `owner` python call to `mlir.ir.Value`.

Assuming that `PyValue.parentOperation` is intended to be the value's owner, this fixes the construction of it from `PyOpOperandList`.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D103853
2021-07-14 20:32:43 -07:00
Mehdi Amini 3e25ea709c Revert "Defend early against operation created without a registered dialect"
This reverts commit 58018858e8.

The Python bindings test are broken.
2021-07-15 03:31:44 +00:00
Kuter Dinel ade190c5ea [Attributor] AACallEdges, Add a way to ask nonasm unknown callees
This patch adds a feature to AACallEdges AbstractAttribute that allows
users to ask if there is a unknown callee that isn't a inline assembly.
This feature is needed by some of it's users.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D105992
2021-07-15 06:10:42 +03:00
Mehdi Amini 58018858e8 Defend early against operation created without a registered dialect
Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D105961
2021-07-15 03:02:52 +00:00
Chen Zheng 70788052ac [PowerPC][NFC] add testcase for update-form preparation with non-const increment 2021-07-15 02:46:24 +00:00
Matthias Springer a0e02018be [mlir][linalg] Improve codegen when tiling PadTensor evenly
Produce simpler IR with more static type information and fewer affine expressions.

Differential Revision: https://reviews.llvm.org/D105530
2021-07-15 11:29:21 +09:00
Matthias Springer 318ce4ad92 [mlir][linalg] Improve codegen of ExtractSliceOfPadTensorSwapPattern
Generate simpler code in case low/high padding of the PadTensorOp is statically zero.

Differential Revision: https://reviews.llvm.org/D105529
2021-07-15 11:05:55 +09:00
Matthias Springer ffb139290d [mlir][linalg] Fix Windows build
The build failure was introduced by D105458. (Linux builds were not affected.)

Differential Revision: https://reviews.llvm.org/D106029
2021-07-15 10:56:30 +09:00
Matthias Springer 4064b6a363 [mlir][linalg] Tile PadTensorOp
Tiling can be enabled with `linalg-tile-pad-tensor-ops`. Only scf::ForOp can be generated at the moment.

Differential Revision: https://reviews.llvm.org/D105460
2021-07-15 10:42:32 +09:00
Matthias Springer d624c1b509 [mlir][NFC] Move asOpFoldResult helper functions to StaticValueUtils
Differential Revision: https://reviews.llvm.org/D105602
2021-07-15 10:28:57 +09:00
Matthias Springer 5da010af9a [mlir][linalg] Add optional output operand to PadTensorOp
This optional operand will be used for tiling in a subsequent commit.

Differential Revision: https://reviews.llvm.org/D105459
2021-07-15 10:20:36 +09:00
Matthias Springer 3469a8e03b [mlir][linalg][NFC] Factor out tile generation in makeTiledShapes
Factor out the functionality into a new function, so that it can be used for creating PadTensorOp tiles.

Differential Revision: https://reviews.llvm.org/D105458
2021-07-15 10:18:58 +09:00
LLVM GN Syncbot 8b426bdaf1 [gn build] Port b9c3941cd6 2021-07-15 01:12:36 +00:00
Kai Luo b9c3941cd6 [PowerPC] Generate inlined quadword lock free atomic operations via AtomicExpand
This patch uses AtomicExpandPass to implement quadword lock free atomic operations. It adopts the method introduced in https://reviews.llvm.org/D47882, which expand atomic operations post RA to avoid spilling that might prevent LL/SC progress.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D103614
2021-07-15 01:12:09 +00:00
Dave Airlie de79ba9f9a [OpenCL] opencl-c.h: CL3.0 generic address space
This is one of the easier pieces of adding CL3.0 support.

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D105526
2021-07-15 10:51:04 +10:00
Dave Airlie 090f007e34 [OpenCL][NFC] opencl-c.h: reorder atomic operations
This just reorders the atomics, it doesn't change anything except their layout in the header.

This is a prep patch for adding some conditionals around these for CL3.0 but that patch is much easier to review if all the atomic operations are grouped together like this.

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D105601
2021-07-15 10:48:44 +10:00
Jan Vesely ea469b08b8 libclc: Add -cl-no-stdinc to clang flags on clang >=13
cf3ef15a6e ("[OpenCL] Add builtin
declarations by default.")
 switched behaviour to include "opencl-c-base.h". We don't want or need
 that for libclc so pass the flag to revert to old behaviour.

Fixes build since cf3ef15a6e

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D99794
2021-07-15 10:43:26 +10:00
Kuter Dinel a7749c3f79 [AMDGPU] Use update_test_checks.py script for annotate kernel features tests.
This patch makes the annotate kernel features tests use the update_tests_checks.py
script. Which makes it easy to update the tests.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D105864
2021-07-15 03:13:37 +03:00
Arthur O'Dwyer 4118858b4e [libc++] NFCI: Restore code duplication in wrap_iter, with test.
It turns out that D105040 broke `std::rel_ops`; we actually do need
both a one-template-parameter and a two-template-parameter version of
all the comparison operators, because if we have only the heterogeneous
two-parameter version, then `x > x` is ambiguous:

    template<class T, class U> int f(S<T>, S<U>) { return 1; }
    template<class T> int f(T, T) { return 2; }  // rel_ops
    S<int> s; f(s,s);  // ambiguous between #1 and #2

Adding the one-template-parameter version fixes the ambiguity:

    template<class T, class U> int f(S<T>, S<U>) { return 1; }
    template<class T> int f(T, T) { return 2; }  // rel_ops
    template<class T> int f(S<T>, S<T>) { return 3; }
    S<int> s; f(s,s);  // #3 beats both #1 and #2

We have the same problem with `reverse_iterator` as with `__wrap_iter`.
But so do libstdc++ and Microsoft, so we're not going to worry about it.

Differential Revision: https://reviews.llvm.org/D105894
2021-07-14 20:10:52 -04:00
Nathan Ridge 9cfec72ffe [clang] Refactor AST printing tests to share more infrastructure
Differential Revision: https://reviews.llvm.org/D105457
2021-07-14 19:44:18 -04:00
Thomas Lively 4a4229f70f [WebAssembly] Codegen for v128.storeX_lane instructions
Replace the experimental clang builtins and LLVM intrinsics for these
instructions with normal codegen patterns. Resolves PR50435.

Differential Revision: https://reviews.llvm.org/D106019
2021-07-14 16:15:25 -07:00
Jon Roelofs d143103068 [GlobalOpt] Fix a miscompile when evaluating struct initializers.
The bug was that evaluateBitcastFromPtr attempts a narrowing to a struct's 0th
element of a store that covers other elements. While this is okay on the load
side, applying it to stores causes us to miss the writes to the additionally
covered elements.

rdar://79503568

Differential revision: https://reviews.llvm.org/D105838
2021-07-14 15:37:01 -07:00
Steven Wu 483df57313 [Support] Turn on SupportTest for Apple Silicon
Follow up for D106012, turn on unittest for Host on Apple Silicon.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D106020
2021-07-14 15:24:56 -07:00
George Rokos 0c7a4870c5 [libomptarget] Keep the Shadow Pointer Map up-to-date
D105812 introduced a regression where if a PTR_AND_OBJ entry was mapped on the device, then the OBJ was deallocated and then reallocated at a different address, the Shadow Pointer Map would still contain an entry for the PTR but pointing to the old address. This caused test `env/base_ptr_ref_count.c` to fail.

Differential Revision: https://reviews.llvm.org/D105947
2021-07-14 15:19:58 -07:00
owenca 58494c856a [clang-format] Make BreakAfterReturnType work with K&R C functions
This fixes PR50999.

Differential Revision: https://reviews.llvm.org/D105964
2021-07-14 14:38:02 -07:00
Arthur Eubanks 3bf101f34c [docs][OpaquePtr] Remove finished task 2021-07-14 14:36:41 -07:00
Wolfgang Pieb d1116697be [ARM] Fix RELA relocations for 32bit ARM.
RELA relocations for 32 bit ARM ignored the addend. Some tools generate
them instead of REL type relocations. This fixes PR50473.

    Reviewed By: MaskRay, peter.smith

    Differential Revision: https://reviews.llvm.org/D105214
2021-07-14 14:27:15 -07:00
Michael Kruse 7e29e57917 [Polly] Fix misleading debug message. NFC.
The number of parameters can be the reason for aliasing checks not being
generated, but most of the time it for other reasons.
2021-07-14 16:25:45 -05:00
Derek Schuff 7cb25f5387 [llvm-strip][WebAssembly] Support strip flags
Summary:
Add support for the basic section stripping (and keeping) flags for wasm:
strip with no flags, --strip-all, --strip-debug,
--only-section, --keep-section, and --only-keep-debug.

Factor section removal into a function and use a predicate chain like
the ELF implementation.

Reviewers: jhenderson, sbc100

Differential Revision: https://reviews.llvm.org/D73820
2021-07-14 14:17:02 -07:00
Arthur Eubanks d3816ef042 Precommit test for D106017 2021-07-14 14:14:49 -07:00
Arthur Eubanks 5366de7375 [SimpleLoopUnswitch] Don't non-trivially unswitch loops with catchswitch exits
SplitBlock() can't handle catchswitch.

Fixes PR50973.

Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D105672
2021-07-14 14:07:28 -07:00
Jon Roelofs 0e49c54a8c [AArch64] Fix selection of G_UNMERGE <2 x s16>
Differential revision: https://reviews.llvm.org/D106007
2021-07-14 13:40:56 -07:00
Nicolas Vasilache df538fdaa9 [mlir][affine] Add single result affine.min/max -> affine.apply canonicalization.
Differential Revision: https://reviews.llvm.org/D106014
2021-07-14 20:38:06 +00:00
Philip Reames 7e496c29e2 [tests] Stablize tests for possible change in deref semantics
This is conceptually part of e75a2dfe.  This file contains both tests whose results don't change (with the right attributes added), and tests which fundementally regress with the current proposal.  Doing the update took some care, thus the seperate change.

Here's the e75a2dfe context repeated:

There's a potential change in dereferenceability attribute semantics in the nearish future.  See llvm-dev thread "RFC: Decomposing deref(N) into deref(N) + nofree" and D99100 for context.

This change simply adds appropriate attributes to tests to keep transform logic exercised under both old and new/proposed semantics.  Note that for many of these cases, O3 would infer exactly these attributes on the test IR.

This change handles the idiomatic pattern of a dereferenceable object being passed to a call which can not free that memory.  There's a couple other tests which need more one-off attention, they'll be handled in another change.
2021-07-14 13:37:50 -07:00
Kirill Stoimenov ac500fd18f [asan][clang] Add flag to outline instrumentation
Summary This option can be used to reduce the size of the
binary. The trade-off in this case would be the run-time
performance.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105726
2021-07-14 13:36:34 -07:00
Jonas Devlieghere de448c0a9e [lldb] Make TargetList iterable (NFC)
Make it possible to iterate over the TargetList.

Differential revision: https://reviews.llvm.org/D105914
2021-07-14 13:35:54 -07:00
Jonas Devlieghere 1e4a417ee6 [lldb] Always call DestroyImpl from Process::Finalize
Always destroy the process, regardless of its private state. This will
call the virtual function DoDestroy under the hood, giving our derived
class a chance to do the necessary tear down, including what to do when
the private state is eStateExited.

Differential revision: https://reviews.llvm.org/D106004
2021-07-14 13:35:53 -07:00
Steven Wu e23dce6c97 [Support] Get correct number of physical cores on Apple Silicon
Fix a bug that `computeHostNumPhysicalCores` is fallback to default
unknown when building for Apple Silicon macs.

rdar://80533675

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D106012
2021-07-14 13:29:54 -07:00
Nicolas Vasilache 7b47de774f [mlir] NFC - Add AffineMap::replace variant with dim/symbol inference 2021-07-14 20:29:12 +00:00
Philip Reames b86ddfdb9a Global variables with strong definitions cannot be freed
With the current deref semantics, this is redundant - since we assume that anything which is dereferenceable (ever) can't be freed - but it becomes neccessary for the deref-at-point semantics.

Testing wise, this is covered by test/CodeGen/X86/hoist-invariant-load.ll when -use-dereferenceable-at-point-semantics is active.  I didn't bother duplicating the command line since a) it's an in-development mode, and b) the change is pretty obvious.
2021-07-14 13:26:18 -07:00
Martin Storsjö d37689e9ab [libcxx] [test] Remove a LIBCXX-WINDOWS-FIXME in trivial_abi/unique_ptr_ret
This is the same thing that was clarified in D105906 for weak_ptr_ret.

Differential Revision: https://reviews.llvm.org/D105965
2021-07-14 23:20:11 +03:00
Philip Reames e75a2dfe20 [tests] Stablize tests for possible change in deref semantics
There's a potential change in dereferenceability attribute semantics in the nearish future.  See llvm-dev thread "RFC: Decomposing deref(N) into deref(N) + nofree" and D99100 for context.

This change simply adds appropriate attributes to tests to keep transform logic exercised under both old and new/proposed semantics.  Note that for many of these cases, O3 would infer exactly these attributes on the test IR.

This change handles the idiomatic pattern of a dereferenceable object being passed to a call which can not free that memory.  There's a couple other tests which need more one-off attention, they'll be handled in another change.
2021-07-14 13:05:43 -07:00
Stanislav Mekhanoshin 76b7d3432e [AMDGPU] Add TII::isIgnorableUse() to allow VOP rematerialization
Any def of EXEC prevents rematerialization of any VOP instruction
because of the physreg use. Create a callback to check if the
physreg use can be ingored to allow rematerialization.

Differential Revision: https://reviews.llvm.org/D105836
2021-07-14 13:03:58 -07:00
Alexey Bataev ba2690b17b [SLP][NFC]Fix variables names, NFC. 2021-07-14 12:43:45 -07:00
Fangrui Song 3bda1c4e22 [docs] Fix :option:`--file-header` reference in llvm-readelf.rst after D105532 2021-07-14 12:39:22 -07:00
Simon Pilgrim 4fd0addb68 [SLP] Fix case of variable name. NFCI. 2021-07-14 20:20:04 +01:00
Geoffrey Martin-Noble 8461995d35 [Bazel] Uniformly export all MLIR td files
CMake would have no restrictions on this and the custom list is a pain
to maintain.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106003
2021-07-14 12:18:44 -07:00
Louis Dionne 850b57c5fb [runtimes] Bring back TARGET_TRIPLE
This commit reverts 5099e01568 and 77396bbc98, which broke the build
in various ways. I'm reverting until I can investigate, since that
change appears to be way more subtle than it seemed.
2021-07-14 15:15:22 -04:00
Roman Lebedev dfbfc277b2
[NFC] Drop redundant check prefixes in newly added test file 2021-07-14 22:14:36 +03:00
Nikita Popov cd88a01cb8 [Attributes] Use single method to fetch type from AttributeSet (NFC)
While it is nice to have separate methods in the public AttributeSet
API, we can fetch the type from the internal AttributeSetNode
using a generic API for all type attribute kinds.
2021-07-14 21:10:56 +02:00