Commit Graph

438073 Commits

Author SHA1 Message Date
Nikita Popov 07253bc8c0 [LICM] Convert tests to opaque pointers (NFC)
Using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.

The opaque pointer migration resolves the TODO on test_fence3: The
transform now works as expected by dint of the bitcast no longer
existing.
2022-10-05 16:47:53 +02:00
Nikita Popov bf6ec0dea0 [LICM] Adjust speculation test to avoid no-op instruction (NFC)
Such GEPs don't exist with opaque pointers, give it an actual
offset.
2022-10-05 16:41:20 +02:00
Juan Manuel MARTINEZ CAAMAÑO fa2b1cb8c9 [NFC][AMDGPULowerKernelAttributes] Factorize repeated code into function
Differential Revision: https://reviews.llvm.org/D135266
2022-10-05 09:26:39 -05:00
Fraser Cormack 043a585b05 [LangRef][VP] Change masked-off lanes from undef to poison
These were all changed in 32b1b06b70 (as
discussed in D133967) but some intrinsics introduced since have
re-introduced `undef` as the masked-off value.

Reviewed By: reames, eopXD

Differential Revision: https://reviews.llvm.org/D135244
2022-10-05 15:24:14 +01:00
Anton Sidorenko 3e97e94237 [NFC][RISCV] Move getSEWLMULRatio function to header
More uses of getSEWLMULRatio will be added in D130895.

Reviewed By: craig.topper, frasercrmck

Differential Revision: https://reviews.llvm.org/D135086
2022-10-05 15:10:53 +01:00
Valentin Clement 0d7e4d099e
[flang] Deallocate polymorphic and unlimited polymorphic intent(out) allocatable with runtime
Polymorphic and unlimited polymorphic entities should be handled by runtime. This patch
update the condition in `genDeallocate` to force polymorphic and unlimited polymorphic entities
to be deallocated through a runtime call and not inlined.

Depends on D135143

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D135144
2022-10-05 16:07:12 +02:00
Nikita Popov c603cefbda [DSE] Convert tests to opaque pointers (NFC)
Using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.
2022-10-05 16:00:44 +02:00
Sam McCall 20c9ac2925 [Index] USRGeneration doesn't depend on unnamed.printName() => ''. NFC
This prepares for printName() to print `(anonymous struct)` etc in D134813.

Differential Revision: https://reviews.llvm.org/D135191
2022-10-05 15:51:00 +02:00
Sam McCall 0a50eafd1d [clangd] Stop isSpelledInSource from printing source locations.
It shows up on profiles, albeit only at 0.1% or so.
2022-10-05 15:49:22 +02:00
Johannes Doerfert e18736149c [Attributor] Teach AAPointerInfo about atomic cmxchg and rmw
The atomic operations behave similar to a store except that we don't
know the new value and we read the result first.
2022-10-05 06:48:00 -07:00
Dmitry Preobrazhensky f4b1cfa1cb [AMDGPU][MC][GFX11] Correct e64_dpp variants of v_movreld and v_movrelsd
Differential Revision: https://reviews.llvm.org/D135079
2022-10-05 16:47:18 +03:00
Kerry McLaughlin f7f44f018f [AArch64][SME] Set up a lazy-save/restore around calls.
Setting up a lazy-save mechanism around calls is done during SelectionDAG
because calls to intrinsics may be expanded into an actual function call
(e.g. calls to @llvm.cos()), and maintaining an allowed-list in the SMEABI
pass is not feasible.

The approach for conditionally restoring the lazy-save based on the runtime
value of TPIDR2_EL0 is similar to how we handle conditional smstart/smstop.
We create a pseudo-node which gets expanded into a conditional branch and
expands to a call to __arm_tpidr2_restore(%tpidr2_object_ptr).

The lazy-save buffer and TPIDR2 block are only allocated once at the start
of the function. For each call, the TPIDR2 block is initialised, and at
the end of the call, a pseudo node (RestoreZA) is planted.

Patch by Sander de Smalen.

Differential Revision: https://reviews.llvm.org/D133900
2022-10-05 14:36:53 +01:00
Johannes Doerfert 93e51fa444 [Attributor] AAPointerInfo can model non-escaping call uses
If a call base use will not capture a pointer we can approximate the
effects. This is important especially for readnone/only uses. Even
may-write uses are not too bad with reachability in place. Capturing
is the problem as we loose track of update sides.
2022-10-05 06:29:14 -07:00
Nikita Popov 1940c499fe [DSE] Regenerate test checks (NFC) 2022-10-05 15:26:55 +02:00
Nikita Popov b44c9b39c5 [DSE] Fix variable name clash in test (NFC)
update_tests_checks.py generates the same identifier for lowercase
and uppercase variable names. Make sure they have a distinct name.
2022-10-05 15:26:55 +02:00
Kadir Cetinkaya adab08ecf2
[clang][Sema] Fix crash on invalid base destructor
LookupSpecialMember might fail, so changes the cast to cast_or_null.
Inside Sema, skip a particular base, similar to other cases, rather than
asserting on dtor showing up.

Other option would be to mark classes with invalid destructors as invalid, but
that seems like a lot more invasive and we do lose lots of diagnostics that
currently work on classes with broken members.

Differential Revision: https://reviews.llvm.org/D135254
2022-10-05 15:23:15 +02:00
Johannes Doerfert 477e8e10f0 [Attributor] Teach AAPointerInfo to look into aggregates
If we have a constant aggregate, e.g., as an initializer, we usually
failed to extract the proper value/type from it. This patch provides the
size and offset information necessary to extract the right part of the
constant.
2022-10-05 06:19:47 -07:00
Johannes Doerfert 4040c5c2f4 [Attributor][NFC] Re-run update_test_checks on all Attributor tests 2022-10-05 06:19:43 -07:00
Nikita Popov 42d98d80fb [MemCpyOpt] Convert tests to opaque pointers (NFC)
Converted using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.
2022-10-05 14:53:50 +02:00
Nikita Popov 5fa14ee835 [MemCpyOpt] Don't hoist above producer of pointer operand
This was already handled correctly below, but not checked for the
original store pointer operand. Encountered when converting tests
to opaque pointers, where the intermediate bitcast goes away.
2022-10-05 14:52:33 +02:00
Shilei Tian 0c623ab1bf [Clang][OpenMP] Only check value if the expression is not instantiation dependent
Currently the following case fails:
```
template<typename Ty>
Ty foo(Ty *addr, Ty val) {
  Ty v;
#pragma omp atomic compare capture
  {
    v = *addr;
    if (*addr > val)
      *addr = val;
  }
  return v;
}
```

The compiler complains `addr` is not a lvalue. That's because when an expression
is instantiation dependent, we cannot tell if it is lvalue or not.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D135224
2022-10-05 08:44:56 -04:00
David Stuttard d1d7d2235c [AggressiveInstCombine] Fix cases where non-opaque pointers are used
In the case of non-opaque pointers, when combining consecutive loads,
need to bitcast the pointer source to the combined type size, otherwise
asserts are triggered.

Differential Revision: https://reviews.llvm.org/D135249
2022-10-05 13:42:46 +01:00
Oleksandr "Alex" Zinenko d14a029222
[mlir] tweak declarative assembly doc
Change the formal argument of the `functional-type` directive from "results" to "outputs" to avoid confusion with the `results` directive.
2022-10-05 14:33:47 +02:00
Peixin Qiao f4accbf55f [flang][OpenMP] Support privatization for single construct
This supports the lowering of private and firstprivate clauses in single
construct. The alloca ops are emitted in the entry block according to
https://llvm.org/docs/Frontend/PerformanceTips.html#use-of-allocas, and
the load/store ops are emitted in the single region. The data race
problem is handled in OMPIRBuilder. That is, the barrier is emitted in
OMPIRBuilder.

Co-authored-by: Nimish Mishra <neelam.nimish@gmail.com>

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128596
2022-10-05 20:22:33 +08:00
Nikita Popov e94619b955 Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
The infinite loop seen on buildbots should be fixed by
11897708c0 (assuming there are not
multiple infinite combine loops...)

-----

foldOpIntoPhi() currently only folds operations into the phi if all
but one operands constant-fold. The two exceptions to this are freeze
and select, where we allow more general simplification.

This patch makes foldOpIntoPhi() generally simplification based and
removes all the instruction-specific logic. We just try to simplify
the instruction for each operand, and for the (potentially) one
non-simplified operand, we move it into the new block with adjusted
operands.

This fixes https://github.com/llvm/llvm-project/issues/57448, which
was my original motivation for the change.

Differential Revision: https://reviews.llvm.org/D134954
2022-10-05 14:00:19 +02:00
Emmmer d0dcbb9b02 [LLDB][RISCV][NFC] Rewrite instruction in algebraic datatype
The old approach (dedicated ExecXXX for each instruction) is not flexible and results in duplicated code when RVC kicks in.

According to the spec, every compressed instruction can be decoded to a non-compressed one. So we can lower compressed instructions to instructions we already had, which requires a decoupling between the decoder and executor.

This patch:
- use llvm::Optional and its combinators AMAP.
- use template constraints on common instruction.
- make instructions strongly-typed (no uint32_t everywhere bc it is error-prone and burdens the developer when lowering the RVC) with the help of algebraic datatype (std::variant).

Note:
(NFC) because this is more of a refactoring in preparation for RVC.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D135015
2022-10-05 19:45:28 +08:00
Nikita Popov 11897708c0 [InstCombine] Directly replace instr in foldIntegerTypedPHI() (NFCI)
Rather than inserting a ptrtoint + inttoptr pair, directly replace
the inttoptr with the new phi node. This ensures that no other
transform can undo it before the pair gets folded away.

This avoids the infinite loop when combined with D134954.

This is NFCI in the sense that it shouldn't make a difference, but
could due to different worklist order.
2022-10-05 13:28:23 +02:00
Nikita Popov e035f03e92 [InstCombine] Add test for infinite combine loop with D134954 (NFC)
The patch interacts badly with foldIntegerTypedPHI().
2022-10-05 13:12:14 +02:00
Guray Ozen e68a7bed59 [mlir][transform] Add failing test for GPU transform dialect
The GPU transform dialect currently has restrictions and several situations where we can't use transform dialect.

This update includes a method to test a failing cases in GPU transform dialect.

Differential Revision: https://reviews.llvm.org/D135063
2022-10-05 13:10:13 +02:00
Guray Ozen 78305720f3 [mlir][transform][nfc] typo fix
fix typo

Reviewed By: nicolasvasilache, ftynse

Differential Revision: https://reviews.llvm.org/D135242
2022-10-05 13:05:46 +02:00
LLVM GN Syncbot b1bdcd4d5c [gn build] Port f0f474dfd0 2022-10-05 09:44:51 +00:00
David Sherwood f0f474dfd0 [AArch64][SME] Add codegen pass to handle ZA state in arm_new_za functions.
The new pass implements the following:

* Inserts code at the start of an arm_new_za function to
    commit a lazy-save when the lazy-save mechanism is active.
* Adds a smstart intrinsic at the start of the function.
* Adds a smstop intrinsic at the end of the function.

Patch co-authored by kmclaughlin.

Differential Revision: https://reviews.llvm.org/D133896
2022-10-05 09:43:57 +00:00
Fraser Cormack 08497a785b [VP] Fix unused variable in release configurations 2022-10-05 10:33:07 +01:00
Mikhail Goncharov c21e57156c Fix clang baremetal test
def48cae45 accidentally dropped -no-canonical-prefixes
2022-10-05 11:32:28 +02:00
Florian Hahn 469f0fc6a6
[SimpleLoopUnswitch] Clear dispos in deleteDeadBlocksFromLoop.
SimpleLoopUnswitch may remove blocks from loops. Clear block and loop
dispositions in that case, to clean up invalid entries in the cache.

Fixes #58158.

Fixes #58159.
2022-10-05 10:28:15 +01:00
Florian Hahn eb975cae4b
[SimpleLoopUnswitch] Simplify test, reduce the passes to trigger crash.
This simplifies the test case added in e399dd601 to only require indvars
and simple-loop-unswitch. This allows adding the test case for #58158 to
the same file, keeping related tests together.
2022-10-05 10:19:55 +01:00
Kadir Cetinkaya feea7ef23c
Revert "[clang][Lex] Fix a crash on malformed string literals"
This reverts commit 36a200208f.
2022-10-05 10:37:32 +02:00
Nikita Popov 2813bc5d24 [SROA] Regenerate test checks (NFC) 2022-10-05 10:31:03 +02:00
David Sherwood 991a36da1b [AArch64][SME] Prevent SVE object address calculations between smstop and call
This patch introduces a new AArch64 ISD node (OBSCURE_COPY) that can
be used when we want to prevent SVE object address calculations
from being rematerialised between a smstop/smstart and a call.
At the moment we use COPY to copy the frame index to a register,
which leads to problems because the "simple register coalescing"
pass understands the COPY instruction and attempts to rematerialise
an address calculation with 'addvl' between an smstop and a call.
When in streaming mode the 'addvl' instruction may have different
behaviour because the streaming SVE vector length is not guaranteed
to equal the normal SVE vector length.

The new ISD opcode OBSCURE_COPY gets lowered to a new pseudo
instruction also called OBSCURE_COPY. This ensures it cannot be
rematerialised and we expand this into a simple move very late in
the machine instruction pipeline.

A new test is added here:

CodeGen/AArch64/sme-streaming-interface.ll

Differential Revision: https://reviews.llvm.org/D134940
2022-10-05 08:11:16 +00:00
Valentin Clement e50e19af00
[flang] Update to fir::isUnlimitedPolymorphicType and fir::isPolymorphicType functions
This patch update the fir::isUnlimitedPolymorphicType function
to reflect the chosen design. It adds also a fir::isPolymorphicType
function.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D135143
2022-10-05 10:05:11 +02:00
Martin Storsjö 2f7fbf8376 [AArch64] Add missing SEH_Nop when aligning the stack
This makes sure that the instructions of the prologue matches the
SEH opcodes.

Also remove a couple redundant cases of setting HasWinCFI; it was
already set unconditionally after the conditional cases.

Differential Revision: https://reviews.llvm.org/D135101
2022-10-05 11:00:36 +03:00
David Spickett a9ffb47345 Fix LLDB build on old Linux kernels (pre-4.1)
These fields are guarded elsewhere, but were missing here.

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D133778
2022-10-05 08:00:05 +00:00
Nicolas Vasilache 5fc28ebbaf [mlir][Linalg] NFC - Add bbarg pretty printing to linalg::generic
Differential Revision: https://reviews.llvm.org/D135151
2022-10-05 00:59:42 -07:00
Kadir Cetinkaya 36a200208f
[clang][Lex] Fix a crash on malformed string literals
Differential Revision: https://reviews.llvm.org/D135161
2022-10-05 09:55:50 +02:00
Nicolas Vasilache 05fa8e88f4 [mlir][Linalg] Retire LinalgStrategyLowerVectorsPass and filter-based patterns
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785

Depends on D135200

Differential Revision: https://reviews.llvm.org/D135222
2022-10-05 00:55:27 -07:00
Rainer Orth 93b1256e38 [compiler-rt][test] Heed COMPILER_RT_DEBUG when compiling unittests
When trying to debug some `compiler-rt` unittests, I initially had a hard
time because

- even in a `Debug` build one needs to set `COMPILER_RT_DEBUG` to get
  debugging info for some of the code and
- even so the unittests used a hardcoded `-O2` which often makes debugging
  impossible.

This patch addresses this by instead using `-O0` if `COMPILER_RT_DEBUG`.
Two tests in `sanitizer_type_traits_test.cpp` need to be disabled since
they have undefined references to `__sanitizer::integral_constant<bool,
true>::value`.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D91620
2022-10-05 09:53:26 +02:00
Nicolas Vasilache 27c634aed6 [mlir][Linalg] Retire LinalgStrategyPeelPass and filter-based pattern.
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785

Differential Revision: https://reviews.llvm.org/D135200
2022-10-05 00:50:13 -07:00
Adrian Kuegel ac06f7169f [mlir] Add attribute constraints for sorted order.
We often have constraints for array attributes that they are sorted
non-decreasing or strictly increasing. This change adds AttrConstraint classes
that support DenseArrayAttr for integer types.

Differential Revision: https://reviews.llvm.org/D134944
2022-10-05 09:46:19 +02:00
Siva Chandra Reddy 995105de1b [libc] Add the POSIX waitpid function and the BSD wait4 function.
Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D135225
2022-10-05 07:38:55 +00:00
Fraser Cormack a3a9b0743e [VP][NFC] Remove \brief commands from doxygen comments
Following a precedent set in D46861.
2022-10-05 08:08:30 +01:00