444619 Commits

Author SHA1 Message Date
Simon Pilgrim
f2bfe0f84a [InstCombine] Regenerate select-gep.ll test checks
Fixes superfluous diffs identified in D139253
2022-12-05 21:19:43 +00:00
Simon Pilgrim
f9faf832a6 [InstCombine] Regenerate select-bitext.ll test checks
Fixes superfluous diffs identified in D139253
2022-12-05 21:19:43 +00:00
Simon Pilgrim
531ef2cd24 [InstCombine] Regenerate select-cmpxchg.ll test checks 2022-12-05 21:19:42 +00:00
Simon Pilgrim
6f12fc2b82 [InstCombine] Regenerate select-masked_load.ll test checks 2022-12-05 21:19:42 +00:00
Simon Pilgrim
8c42da536c [InstCombine] Regenerate opaque-ptr.ll test checks
Fixes superfluous diffs identified in D139253
2022-12-05 21:19:42 +00:00
Simon Pilgrim
53411c82a9 [X86] Remove unnecessary x87 overrides from znver1/znver2 model
Reported by D138359 - the overrides matched the base class schedule WriteMicrocoded definition
2022-12-05 21:19:42 +00:00
Jez Ng
04b1dad717 [lld-macho] Canonicalize LSDA pointers
This was causing an uncaught exception issue in one of our programs. The
issue was fairly subtle / rare as it required two identical LSDAs that were
referenced by a pair of non-identical compact unwind encodings.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D139269
2022-12-05 16:18:15 -05:00
Rob Suderman
58fa8426ff [mlir][tosa] Handle tosa.resize nearest rounding correctly
Rounding of tosa.resize did not handle rounding to the nearest pixel correctly.
Rather than dividing the scale by 2 we should double the partial pixel to
guarantee we include a check on the lowest bit.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D139162
2022-12-05 13:10:08 -08:00
Roy Jacobson
7d58c95635 [Clang] Don't consider default constructors ineligible if the more constrained constructor is a template
Partially solves https://github.com/llvm/llvm-project/issues/59206:

We now mark trivial constructors as eligible even if there's a more constrained templated default constructor. Although technically non-conformant, this solves problems with pretty reasonable uses cases like
```
template<int n>
struct Foo {
	constexpr Foo() = default;

	template<class... Ts>
	Foo(Ts... vals) requires(sizeof...(Ts) == n) {}
};
```
where we currently consider the default constructor to be ineligible and therefor inheriting/containing classes have non trivial constructors. This is aligned with GCC: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c75ebe76ae12ac4020f20a24f34606a594a40d15

This doesn't change `__is_trivial`. Although we're technically standard conformant in this regard, GCC/MSVC exhibit different behaviors that seem to make more sense. An issue has been filed to CWG and we await their response.

Reviewed By: erichkeane, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D139038
2022-12-05 23:02:37 +02:00
Tarun Prabhu
7fe4abbbc2 [flang] Lower F08 NORM2 intrinsic
The implementation follows the pattern used in comparable intrinsics.
Change the runtime API for Norm2 so it does not expect a mask argument
since the Norm2 intrinsic does not accept a mask in Fortran.

Differential Revision: https://reviews.llvm.org/D138150
2022-12-05 13:53:35 -07:00
Krzysztof Parzyszek
14c41b7d35 [Hexagon] Remove leftover debug messages after 87a3f1ab 2022-12-05 12:45:52 -08:00
Nico Weber
9ddbcb0182 [gn build] Fix build of merge-fdata in a clean build dir
merge-fdata doesn't depend on any libraries except Support,
but it includes headers that require Attributes.inc to exist.
Add a dep that ensures that it does exist.
Corresponds to the intrinsics_gen dep in CMake.
2022-12-05 15:44:30 -05:00
Philip Reames
186c192261 [SDAG] Allow scalable vectors in SimplifyDemanded routines
This is a continuation of the series of patches adding lane wise support for scalable vectors in various knownbit-esq routines.

The basic idea here is that we track a single lane for scalable vectors which corresponds to an unknown number of lanes at runtime. This is enough for us to perform lane wise reasoning on many arithmetic operations.

Differential Revision: https://reviews.llvm.org/D137190
2022-12-05 12:42:16 -08:00
Krzysztof Parzyszek
87a3f1ab3b [Hexagon] Better detection of impossible completions to perfect shuffles
If there is an entry P that has C bits set, it could become one of C
different possibilities. If P occurs more than C times, then there are
no valid completions.
2022-12-05 12:40:08 -08:00
Peter Steinfeld
a43319a8ad [Flang] Restore Flang cmake configuration data
Patch D138274 removed some Flang cmake configuration information that we
need for our internal builds.  This change restores them.

Differential Revision: https://reviews.llvm.org/D139355
2022-12-05 12:35:50 -08:00
Nicolai Hähnle
34c0ed58d2 test/Transforms/Scalarizer: re-run update_test_checks.py
Goal is to get a cleaner diff in an upcoming functional change.
2022-12-05 21:24:48 +01:00
Fangrui Song
d3b7c84a0b [llvm-objdump][docs] Mention --show-all-symbols
after D131589

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D139282
2022-12-05 20:01:01 +00:00
Ramkumar Ramachandra
d246bf4199 mlir/TosaToLinalg: improve debugging during conversion
Make systematic use of notifyMatchFailure.

Signed-off-by: Ramkumar Ramachandra <r@artagnon.com>

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D139190
2022-12-05 11:40:08 -08:00
River Riddle
031ff673d8 [mlir] Fix alias printing for dialect attribute self types
This was donked up in the last patch that only considered
aliases for things actually getting printed.
2022-12-05 11:31:50 -08:00
River Riddle
737391bdf3 [mlir] Slightly optimize getRegions checks by inlining size check
Calculating the position of the region trailing objects isn't free,
given that it's the last trailing object, and inlining the size check
removes the need for users to explicitly add size checks for
micro-optimization.
2022-12-05 11:31:50 -08:00
Roman Lebedev
be51fa4580
[NFC] Port all runlines for LoopVectorize pass tests to -passes syntax 2022-12-05 22:17:30 +03:00
Chris Bieneman
b4d711dc96 Fix DirectX test build
This broke when some headers got moved aorund.
2022-12-05 13:12:43 -06:00
Jamie Schmeiser
455530425e Reland "A new hidden option exec-on-ir-change=exe that calls exe each time IR changes"
Summary:
This relands commit dff0e8b4ff13af311512c369d059f1e095e83a60.  The test is now
guarded with a lit.local.cfg that ensures /bin/cat is available.  Also, the
code has been updated to match changes made to relevant code.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By:aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D110776
2022-12-05 14:11:15 -05:00
LLVM GN Syncbot
51e33ac9c7 [gn build] Port 5ecd36329508 2022-12-05 18:56:16 +00:00
Jonas Paulsson
5ecd363295 Reapply "[CodeGen] Add new pass for late cleanup of redundant definitions."
This reverts commit 122efef8ee9be57055d204d52c38700fe933c033.

- Patch fixed to not reuse definitions from predecessors in EH landing pads.
- Late review suggestions (by MaskRay) have been addressed.
- M68k/pipeline.ll test updated.
- Init captures added in processBlock() to avoid capturing structured bindings.
- RISCV has this disabled for now.

Original commit message:

A new pass MachineLateInstrsCleanup is added to be run after PEI.

This is a simple pass that removes redundant and identical instructions
whenever found by scanning the MF once while keeping track of register
definitions in a map. These instructions are typically immediate loads
resulting from rematerialization, and address loads emitted by target in
eliminateFrameInde().

This is enabled by default, but a target could easily disable it by means of
'disablePass(&MachineLateInstrsCleanupID);'.

This late cleanup is naturally not "optimal" in removing instructions as it
is done by looking at phys-regs, but still quite effective. It would be
desirable to improve other parts of CodeGen and avoid these redundant
instructions in the first place, but there are no ideas for this yet.

Differential Revision: https://reviews.llvm.org/D123394

Reviewed By: RKSimon, foad, craig.topper, arsenm, asb
2022-12-05 12:53:50 -06:00
Peter Klausler
962863d988 [flang] Catch attempts to copy pointers in allocatables in PURE
In a pure context, a pointer acquired from an INTENT(IN) dummy argument
may not be copied.  Catch the case in which the pointer is a component
of an allocatable component at some depth of nesting.

(This patch adds a new component iterator kind that is a variant of
a potential subobject component iterator; it visits all potential
subobject components, plus pointers, into which it does not descend.)

Differential Revision: https://reviews.llvm.org/D139161
2022-12-05 10:18:06 -08:00
Michael Buch
e31160155e [lldb][Test] TestRerunAndExprDylib.py on Linux: dlclose solib to force destruction module
Previously we didn't properly trigger the destructor of
the `lldb_private::Module` backing `libfoo.so`. So the newly
rebuilt version wouldn't actually be loaded on a program re-run.
The test expects the fresh module to be loaded.
2022-12-05 18:14:26 +00:00
Roman Lebedev
d1d1293569
[NFC] Port all runlines for SimplifyCFG pass tests to -passes syntax 2022-12-05 21:12:20 +03:00
Matt Arsenault
32975934f1 AMDGPU: Convert a test to generated checks
Also switch to not using kernels to test, since it shouldn't matter
for these addressing modes. This should reduce some of the diffs
between subtargets, but it's still not enough to share the same
checks.

The test could use some additional modernization. Probably should also
round this out with the new maximium offsets.
2022-12-05 13:00:12 -05:00
Peter Klausler
b90ebbc5bd [flang] Fold the RHS of assignment
In order to emit overflow warnings from assignment statements whose
right-hand sides are constants that undergo conversions, run the
right-hand sides of assignments through constant folding after the
conversions have been made explicit in expression analysis.

Differential Revision: https://reviews.llvm.org/D139151
2022-12-05 09:31:32 -08:00
Valentin Clement
491b6a9ccb
[flang] Fix pointer association with remap on polymorphic entities
Runtime is expecting a 1d array. This patch fixes the generation
of the array holding the bounds to be passed to the runtime function call.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D139324
2022-12-05 18:29:06 +01:00
Valentin Clement
87dfec9dc8
[flang] Retrieve rank before updating the pointer
The code is iterating on the rank of the pointer to set the bounds.
If the rank is retrieved after the `pointer = target` it does not
reflect the actual rank of the pointer.

This could happen in code like the following:

```
type t1
  integer :: a
end type

type(t), pointer :: p(:)
class(t), pointer :: q(:,:)
q(0:1,-2:2) => p(10:1:-1)
```

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D139327
2022-12-05 18:27:19 +01:00
Jamie Schmeiser
2b6683fd5f Expand loop peeling phi computation to handle binary ops and casts
Summary:
Expand the capabilities of the code for computing how many peels are
needed to make phis determined.  A cast gets the peel count for the
value being casted while a binary op gets the maximum of the operands.

Respond to review comments: remove redundant asserts.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By:mkazantsev (Max Kazantsev),syzaara (Zaara Syeda)
Differential Revision: https://reviews.llvm.org/D138719
2022-12-05 12:10:53 -05:00
Navdeep Katel
3d35546cd1 Support transpose mode for gpu.subgroup WMMA ops
Add support for loading, computing, and storing `gpu.subgroup` WMMA ops
in transpose mode as well. Update the GPU to NVVM lowerings to support
`transpose` mode and update integration tests as well.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D139021
2022-12-05 22:37:02 +05:30
Paul Walker
03b3017aef [InstCombine] Increase test coverage of vector.reverse ready for follow on work. 2022-12-05 17:03:00 +00:00
Matt Arsenault
8dce4333f9 AMDGPU: Bulk update memory legalizer tests to use opaque pointers 2022-12-05 12:00:09 -05:00
Michael Buch
e1edcf7d14 Reland "[lldb][Target] Flush the scratch TypeSystem when owning lldb_private::Module gets unloaded"
This relands commit `71f3cac7895ad516ec25438f803ed3c9916c215a`

Fixes LLDB Linux bots and improves TypeSystem flushing for shared libraries.

Differential Revision: https://reviews.llvm.org/D138724
2022-12-05 16:57:42 +00:00
Matt Arsenault
47c68904a5 DAG: ComputeNumSignBits from load range metadata
The cases where the result type doesn't match the range type
are inadequately tested, but I'm not sure how to write such a
test. During the pre-legalize combine, any obviously optimizable
code gets handled so it's harder to test legalized extloads.
2022-12-05 11:57:13 -05:00
Matt Arsenault
f246b139bd AMDGPU: Add baseline tests for known sign bits of load range metadata 2022-12-05 11:57:13 -05:00
Philip Reames
7969ab85e0 [SDAG] Allow scalable vectors in ComputeKnownBits (try 2)
This was previously reverted due to a hang on a Hexagon bot.  This turned out to be a bug in the Hexagon backend around how splat_vectors are legalized (which they're using for fixed length vectors!).  I adjusted this patch to remove the implicit truncate support.  This hides the hexagon bug for now, and unblocks the rest of the change.

Original commit message:

This is the SelectionDAG equivalent of D136470, and is thus an alternate patch to D128159.

The basic idea here is that we track a single lane for scalable vectors which corresponds to an unknown number of lanes at runtime. This is enough for us to perform lane wise reasoning on many arithmetic operations.

This patch also includes an implementation for SPLAT_VECTOR as without it, the lane wise reasoning has no base case. The original patch which inspired this (D128159), also included STEP_VECTOR. I plan to do that as a separate patch.

Differential Revision: https://reviews.llvm.org/D137140
2022-12-05 08:52:37 -08:00
Florian Hahn
6887cfb982
[ConstraintElim] Queue facts and checks directly.
This allows interleaving facts and checks in a single block. In
particular this enables using facts from assumes for conditions in the
same block that come after the assume.

This could be extended to only try to simplify checks at the point where
a condition is used.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D138452
2022-12-05 16:44:20 +00:00
Matt Arsenault
be2ca02555 PGOProfile: Only keep opaque pointer tests
The typed pointer tests were already converted, these were identical
now.
2022-12-05 11:42:11 -05:00
Matt Arsenault
c6a5057453 PredicateInfo: Convert test to opaque pointers
Drops the "has predicate info" for the first block.
2022-12-05 11:42:11 -05:00
Paul Walker
6e26ddbc7e [NFC][PatternMatch] Add helper for m_Intrinsic<Intrinsic::experimental_vector_reverse>. 2022-12-05 16:36:08 +00:00
Florian Hahn
2501ab5e3f
[ConstraintElim] Add test subtracting SIGNED_MIN. 2022-12-05 16:32:45 +00:00
chenglin.bi
683e03d6d8 [Instcombine] Precommit tests for some or canonicalization; NFC
~((A & B) ^ (A | ?)) -> (A & B) | ~(A | ?)
~(A & B) ^ (A | ?) -> (A & B) | ~(A | ?)
2022-12-06 00:32:10 +08:00
Timm Bäder
d4f1f35978 [clang][Interp][NFC] Move to std::optional 2022-12-05 17:31:49 +01:00
chenglin.bi
18cae673a4 [Instcombine] Precommit tests for D139080; NFC
Test pattern for
(C & X) | ~(C | Y) -> C ? X : ~Y
2022-12-06 00:23:28 +08:00
Samuel Parker
22d87b8212 [NFC][WebAssembly] Add codegen tests 2022-12-05 16:13:05 +00:00
Matt Arsenault
2d56d8c4e8 ExecutionEngine: Convert tests to opaque pointers 2022-12-05 11:12:17 -05:00