platform/upstream/llvm.git
21 months ago[LICM] Adjust speculation test to avoid no-op instruction (NFC)
Nikita Popov [Wed, 5 Oct 2022 14:40:29 +0000 (16:40 +0200)]
[LICM] Adjust speculation test to avoid no-op instruction (NFC)

Such GEPs don't exist with opaque pointers, give it an actual
offset.

21 months ago[NFC][AMDGPULowerKernelAttributes] Factorize repeated code into function
Juan Manuel MARTINEZ CAAMAÑO [Wed, 5 Oct 2022 13:38:35 +0000 (08:38 -0500)]
[NFC][AMDGPULowerKernelAttributes] Factorize repeated code into function

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

21 months ago[LangRef][VP] Change masked-off lanes from undef to poison
Fraser Cormack [Wed, 5 Oct 2022 07:31:00 +0000 (08:31 +0100)]
[LangRef][VP] Change masked-off lanes from undef to poison

These were all changed in 32b1b06b7081bd722750c6f3d528336f3f7ed34b (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

21 months ago[NFC][RISCV] Move getSEWLMULRatio function to header
Anton Sidorenko [Wed, 5 Oct 2022 13:58:07 +0000 (14:58 +0100)]
[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

21 months ago[flang] Deallocate polymorphic and unlimited polymorphic intent(out) allocatable...
Valentin Clement [Wed, 5 Oct 2022 14:05:11 +0000 (16:05 +0200)]
[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

21 months ago[DSE] Convert tests to opaque pointers (NFC)
Nikita Popov [Wed, 5 Oct 2022 13:28:15 +0000 (15:28 +0200)]
[DSE] Convert tests to opaque pointers (NFC)

Using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.

21 months ago[Index] USRGeneration doesn't depend on unnamed.printName() => ''. NFC
Sam McCall [Tue, 4 Oct 2022 20:05:16 +0000 (22:05 +0200)]
[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

21 months ago[clangd] Stop isSpelledInSource from printing source locations.
Sam McCall [Wed, 5 Oct 2022 13:48:28 +0000 (15:48 +0200)]
[clangd] Stop isSpelledInSource from printing source locations.

It shows up on profiles, albeit only at 0.1% or so.

21 months ago[Attributor] Teach AAPointerInfo about atomic cmxchg and rmw
Johannes Doerfert [Mon, 12 Sep 2022 20:22:05 +0000 (13:22 -0700)]
[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.

21 months ago[AMDGPU][MC][GFX11] Correct e64_dpp variants of v_movreld and v_movrelsd
Dmitry Preobrazhensky [Wed, 5 Oct 2022 13:44:00 +0000 (16:44 +0300)]
[AMDGPU][MC][GFX11] Correct e64_dpp variants of v_movreld and v_movrelsd

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

21 months ago[AArch64][SME] Set up a lazy-save/restore around calls.
Kerry McLaughlin [Wed, 5 Oct 2022 13:01:24 +0000 (14:01 +0100)]
[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

21 months ago[Attributor] AAPointerInfo can model non-escaping call uses
Johannes Doerfert [Mon, 12 Sep 2022 01:43:20 +0000 (18:43 -0700)]
[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.

21 months ago[DSE] Regenerate test checks (NFC)
Nikita Popov [Wed, 5 Oct 2022 13:26:41 +0000 (15:26 +0200)]
[DSE] Regenerate test checks (NFC)

21 months ago[DSE] Fix variable name clash in test (NFC)
Nikita Popov [Wed, 5 Oct 2022 13:25:40 +0000 (15:25 +0200)]
[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.

21 months ago[clang][Sema] Fix crash on invalid base destructor
Kadir Cetinkaya [Wed, 5 Oct 2022 10:09:56 +0000 (12:09 +0200)]
[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

21 months ago[Attributor] Teach AAPointerInfo to look into aggregates
Johannes Doerfert [Wed, 31 Aug 2022 19:13:42 +0000 (12:13 -0700)]
[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.

21 months ago[Attributor][NFC] Re-run update_test_checks on all Attributor tests
Johannes Doerfert [Wed, 5 Oct 2022 12:39:02 +0000 (05:39 -0700)]
[Attributor][NFC] Re-run update_test_checks on all Attributor tests

21 months ago[MemCpyOpt] Convert tests to opaque pointers (NFC)
Nikita Popov [Wed, 5 Oct 2022 12:26:57 +0000 (14:26 +0200)]
[MemCpyOpt] Convert tests to opaque pointers (NFC)

Converted using the script at
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.

21 months ago[MemCpyOpt] Don't hoist above producer of pointer operand
Nikita Popov [Wed, 5 Oct 2022 12:51:07 +0000 (14:51 +0200)]
[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.

21 months ago[Clang][OpenMP] Only check value if the expression is not instantiation dependent
Shilei Tian [Wed, 5 Oct 2022 12:43:53 +0000 (08:43 -0400)]
[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

21 months ago[AggressiveInstCombine] Fix cases where non-opaque pointers are used
David Stuttard [Mon, 3 Oct 2022 18:21:18 +0000 (19:21 +0100)]
[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

21 months ago[mlir] tweak declarative assembly doc
Oleksandr "Alex" Zinenko [Wed, 5 Oct 2022 12:33:47 +0000 (14:33 +0200)]
[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.

21 months ago[flang][OpenMP] Support privatization for single construct
Peixin Qiao [Wed, 5 Oct 2022 12:22:33 +0000 (20:22 +0800)]
[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

21 months agoReapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify
Nikita Popov [Fri, 30 Sep 2022 10:13:40 +0000 (12:13 +0200)]
Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify

The infinite loop seen on buildbots should be fixed by
11897708c0229c92802e747564e7c34b722f045f (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

21 months ago[LLDB][RISCV][NFC] Rewrite instruction in algebraic datatype
Emmmer [Wed, 28 Sep 2022 15:04:08 +0000 (23:04 +0800)]
[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

21 months ago[InstCombine] Directly replace instr in foldIntegerTypedPHI() (NFCI)
Nikita Popov [Wed, 5 Oct 2022 11:26:20 +0000 (13:26 +0200)]
[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.

21 months ago[InstCombine] Add test for infinite combine loop with D134954 (NFC)
Nikita Popov [Wed, 5 Oct 2022 11:11:13 +0000 (13:11 +0200)]
[InstCombine] Add test for infinite combine loop with D134954 (NFC)

The patch interacts badly with foldIntegerTypedPHI().

21 months ago[mlir][transform] Add failing test for GPU transform dialect
Guray Ozen [Wed, 5 Oct 2022 11:09:27 +0000 (13:09 +0200)]
[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

21 months ago[mlir][transform][nfc] typo fix
Guray Ozen [Wed, 5 Oct 2022 06:48:19 +0000 (08:48 +0200)]
[mlir][transform][nfc] typo fix

fix typo

Reviewed By: nicolasvasilache, ftynse

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

21 months ago[gn build] Port f0f474dfd03b
LLVM GN Syncbot [Wed, 5 Oct 2022 09:44:51 +0000 (09:44 +0000)]
[gn build] Port f0f474dfd03b

21 months ago[AArch64][SME] Add codegen pass to handle ZA state in arm_new_za functions.
David Sherwood [Wed, 5 Oct 2022 08:12:31 +0000 (08:12 +0000)]
[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

21 months ago[VP] Fix unused variable in release configurations
Fraser Cormack [Wed, 5 Oct 2022 09:32:44 +0000 (10:32 +0100)]
[VP] Fix unused variable in release configurations

21 months agoFix clang baremetal test
Mikhail Goncharov [Wed, 5 Oct 2022 09:32:28 +0000 (11:32 +0200)]
Fix clang baremetal test

def48cae45a5085b7759f2be71768e27718b901a accidentally dropped -no-canonical-prefixes

21 months ago[SimpleLoopUnswitch] Clear dispos in deleteDeadBlocksFromLoop.
Florian Hahn [Wed, 5 Oct 2022 09:28:15 +0000 (10:28 +0100)]
[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.

21 months ago[SimpleLoopUnswitch] Simplify test, reduce the passes to trigger crash.
Florian Hahn [Wed, 5 Oct 2022 09:19:54 +0000 (10:19 +0100)]
[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.

21 months agoRevert "[clang][Lex] Fix a crash on malformed string literals"
Kadir Cetinkaya [Wed, 5 Oct 2022 08:37:12 +0000 (10:37 +0200)]
Revert "[clang][Lex] Fix a crash on malformed string literals"

This reverts commit 36a200208facf58d454c9b7253c956c2f2a8b946.

21 months ago[SROA] Regenerate test checks (NFC)
Nikita Popov [Wed, 5 Oct 2022 08:30:44 +0000 (10:30 +0200)]
[SROA] Regenerate test checks (NFC)

21 months ago[AArch64][SME] Prevent SVE object address calculations between smstop and call
David Sherwood [Wed, 5 Oct 2022 07:41:23 +0000 (07:41 +0000)]
[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

21 months ago[flang] Update to fir::isUnlimitedPolymorphicType and fir::isPolymorphicType functions
Valentin Clement [Wed, 5 Oct 2022 08:04:46 +0000 (10:04 +0200)]
[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

21 months ago[AArch64] Add missing SEH_Nop when aligning the stack
Martin Storsjö [Sat, 1 Oct 2022 12:30:25 +0000 (15:30 +0300)]
[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

21 months agoFix LLDB build on old Linux kernels (pre-4.1)
David Spickett [Wed, 5 Oct 2022 07:31:03 +0000 (07:31 +0000)]
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

21 months ago[mlir][Linalg] NFC - Add bbarg pretty printing to linalg::generic
Nicolas Vasilache [Tue, 4 Oct 2022 12:14:30 +0000 (05:14 -0700)]
[mlir][Linalg] NFC - Add bbarg pretty printing to linalg::generic

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

21 months ago[clang][Lex] Fix a crash on malformed string literals
Kadir Cetinkaya [Tue, 4 Oct 2022 15:06:24 +0000 (17:06 +0200)]
[clang][Lex] Fix a crash on malformed string literals

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

21 months ago[mlir][Linalg] Retire LinalgStrategyLowerVectorsPass and filter-based patterns
Nicolas Vasilache [Tue, 4 Oct 2022 22:42:41 +0000 (15:42 -0700)]
[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

21 months ago[compiler-rt][test] Heed COMPILER_RT_DEBUG when compiling unittests
Rainer Orth [Wed, 5 Oct 2022 07:53:26 +0000 (09:53 +0200)]
[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

21 months ago[mlir][Linalg] Retire LinalgStrategyPeelPass and filter-based pattern.
Nicolas Vasilache [Tue, 4 Oct 2022 21:35:10 +0000 (14:35 -0700)]
[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

21 months ago[mlir] Add attribute constraints for sorted order.
Adrian Kuegel [Tue, 4 Oct 2022 08:51:56 +0000 (10:51 +0200)]
[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

21 months ago[libc] Add the POSIX waitpid function and the BSD wait4 function.
Siva Chandra Reddy [Tue, 4 Oct 2022 21:17:27 +0000 (21:17 +0000)]
[libc] Add the POSIX waitpid function and the BSD wait4 function.

Reviewed By: lntue, michaelrj

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

21 months ago[VP][NFC] Remove \brief commands from doxygen comments
Fraser Cormack [Wed, 5 Oct 2022 07:08:30 +0000 (08:08 +0100)]
[VP][NFC] Remove \brief commands from doxygen comments

Following a precedent set in D46861.

21 months ago[VP] Add IR expansion for vp.icmp and vp.fcmp
Fraser Cormack [Mon, 14 Mar 2022 11:22:52 +0000 (11:22 +0000)]
[VP] Add IR expansion for vp.icmp and vp.fcmp

These intrinsics are simply expanded to regular icmp/fcmp instructions.

Reviewed By: craig.topper

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

21 months ago[clang-tidy] Fix crashes on `if consteval` in readability checks
Emilia Dreamer [Wed, 5 Oct 2022 06:37:53 +0000 (09:37 +0300)]
[clang-tidy] Fix crashes on `if consteval` in readability checks

The `readability-braces-around-statements` check tries to look at the
closing parens of the if condition to determine where to insert braces,
however, "consteval if" statements don't have a condition, and always
have braces regardless, so the skip can be checked.

The `readability-simplify-boolean-expr` check looks at the condition
of the if statement to determine what could be simplified, but as
"consteval if" statements do not have a condition that could be
simplified, they can also be skipped here.

There may still be more checks that try to look at the conditions of
`if`s that aren't included here

Fixes https://github.com/llvm/llvm-project/issues/57568

Reviewed By: njames93, aaron.ballman

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

21 months ago[RegAllocFast] Clean-up. Remove redundant operations. NFC.
Serguei Katkov [Wed, 5 Oct 2022 03:57:30 +0000 (10:57 +0700)]
[RegAllocFast] Clean-up. Remove redundant operations. NFC.

Reviewed By: MatzeB, arsenm
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D109213

21 months ago[OpenMP] Eliminate the ThreadStates array in favor of indirection
Johannes Doerfert [Sun, 2 Oct 2022 16:45:08 +0000 (09:45 -0700)]
[OpenMP] Eliminate the ThreadStates array in favor of indirection

If we have thread states, the program is going to be rather slow. If we
don't, we want to avoid wasting shared memory. This patch introduces a
slight penalty (malloc + indirection) for the slow path and reduces
resource usage for the fast path.

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

21 months ago[OpenMP] Introduce more atomic operations into the runtime
Johannes Doerfert [Sun, 2 Oct 2022 16:34:41 +0000 (09:34 -0700)]
[OpenMP] Introduce more atomic operations into the runtime

We should use OpenMP atomics but they don't take variable orderings.
Maybe we should expose all of this in the header but that solves only
part of the problem anyway.

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

21 months ago[OpenMP] Replace __ATOMIC_XYZ with atomic::xyz for style
Johannes Doerfert [Sun, 2 Oct 2022 16:21:59 +0000 (09:21 -0700)]
[OpenMP] Replace __ATOMIC_XYZ with atomic::xyz for style

Also fixes one ordering argument not used.

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

21 months ago[Attributor] Qualify variables to avoid clashes in the future
Johannes Doerfert [Sun, 2 Oct 2022 17:19:28 +0000 (10:19 -0700)]
[Attributor] Qualify variables to avoid clashes in the future

21 months ago[OpenMP] Replace pointer comparison with `isSharedMemPtr` check
Johannes Doerfert [Tue, 4 Oct 2022 12:50:45 +0000 (05:50 -0700)]
[OpenMP] Replace pointer comparison with `isSharedMemPtr` check

The pointer comparison was causing confusion for capture tracking, let's
avoid confusion.

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

21 months ago[NVVM] Mark the pointer argument of `llvm.nvvm.isspace.*` `nocapture`
Johannes Doerfert [Tue, 4 Oct 2022 16:04:25 +0000 (09:04 -0700)]
[NVVM] Mark the pointer argument of `llvm.nvvm.isspace.*` `nocapture`

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

21 months ago[RISCV] Add isel patterns for vfmacc, vfnmacc, vfmsac and vfnmsac.
Yeting Kuo [Mon, 3 Oct 2022 12:09:23 +0000 (20:09 +0800)]
[RISCV] Add isel patterns for vfmacc, vfnmacc, vfmsac and vfnmsac.

The patch selects VSELECT_VL/VP_MERGE_VL that uses VF(N)M(ACC|SAC) as its
true operand and the adden of the true operand as its false operand.

Reviewed By: craig.topper

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

21 months ago[AArch64][Windows] Add llvm-readobj support for save_any_reg unwind opcode.
Eli Friedman [Wed, 5 Oct 2022 01:55:01 +0000 (18:55 -0700)]
[AArch64][Windows] Add llvm-readobj support for save_any_reg unwind opcode.

This is primarily used for Arm64EC, but it could be used for other
non-standard calling conventions. The testcase is based on an Arm64EC
thunk generated by MSVC.

The name save_any_reg comes from Microsoft documentation, but the full
encoding isn't specified there; this is reverse-engineered from the
behavior of the unwinder. (Thanks to Martin Storsjö for his example of
how to write simple unwinder testcases by directly calling
RtlVirtualUnwind.)

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

21 months ago[PowerPC] Fix the register allocation hints for ACC registers.
Stefan Pintilie [Tue, 4 Oct 2022 18:29:55 +0000 (13:29 -0500)]
[PowerPC] Fix the register allocation hints for ACC registers.

The allocation hints for copies of ACC registers assumed that we would only be
copying between VSRp and UACC registers. In reality it is also possible to copy
between UACC and ACC registers.

This patch adds a new case for the ACC copy to fix that issue.
Note that the test case added with this patch will hit an assert without the
fix.

Reviewed By: lei, amyk

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

21 months ago[clang-format] Handle C# interpolated verbatim string prefix @$
owenca [Sun, 2 Oct 2022 08:25:10 +0000 (01:25 -0700)]
[clang-format] Handle C# interpolated verbatim string prefix @$

Fixes #58062.

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

21 months ago[mlir][bufferization][NFC] Move EmptyTensorToAllocTensorPass
Matthias Springer [Wed, 5 Oct 2022 00:14:38 +0000 (09:14 +0900)]
[mlir][bufferization][NFC] Move EmptyTensorToAllocTensorPass

This change moves the pass from the Linalg dialect to the bufferization dialect.

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

21 months agoAdd APFloat and MLIR type support for fp8 (e5m2).
Stella Laurenzo [Wed, 27 Jul 2022 02:02:37 +0000 (19:02 -0700)]
Add APFloat and MLIR type support for fp8 (e5m2).

(Re-Apply with fixes to clang MicrosoftMangle.cpp)

This is a first step towards high level representation for fp8 types
that have been built in to hardware with near term roadmaps. Like the
BFLOAT16 type, the family of fp8 types are inspired by IEEE-754 binary
floating point formats but, due to the size limits, have been tweaked in
various ways in order to maximally use the range/precision in various
scenarios. The list of variants is small/finite and bounded by real
hardware.

This patch introduces the E5M2 FP8 format as proposed by Nvidia, ARM,
and Intel in the paper: https://arxiv.org/pdf/2209.05433.pdf

As the more conformant of the two implemented datatypes, we are plumbing
it through LLVM's APFloat type and MLIR's type system first as a
template. It will be followed by the range optimized E4M3 FP8 format
described in the paper. Since that format deviates further from the
IEEE-754 norms, it may require more debate and implementation
complexity.

Given that we see two parts of the FP8 implementation space represented
by these cases, we are recommending naming of:

* `F8M<N>` : For FP8 types that can be conceived of as following the
  same rules as FP16 but with a smaller number of mantissa/exponent
  bits. Including the number of mantissa bits in the type name is enough
  to fully specify the type. This naming scheme is used to represent
  the E5M2 type described in the paper.
* `F8M<N>F` : For FP8 types such as E4M3 which only support finite
  values.

The first of these (this patch) seems fairly non-controversial. The
second is previewed here to illustrate options for extending to the
other known variant (but can be discussed in detail in the patch
which implements it).

Many conversations about these types focus on the Machine-Learning
ecosystem where they are used to represent mixed-datatype computations
at a high level. At that level (which is why we also expose them in
MLIR), it is important to retain the actual type definition so that when
lowering to actual kernels or target specific code, the correct
promotions, casts and rescalings can be done as needed. We expect that
most LLVM backends will only experience these types as opaque `I8`
values that are applicable to some instructions.

MLIR does not make it particularly easy to add new floating point types
(i.e. the FloatType hierarchy is not open). Given the need to fully
model FloatTypes and make them interop with tooling, such types will
always be "heavy-weight" and it is not expected that a highly open type
system will be particularly helpful. There are also a bounded number of
floating point types in use for current and upcoming hardware, and we
can just implement them like this (perhaps looking for some cosmetic
ways to reduce the number of places that need to change). Creating a
more generic mechanism for extending floating point types seems like it
wouldn't be worth it and we should just deal with defining them one by
one on an as-needed basis when real hardware implements a new scheme.
Hopefully, with some additional production use and complete software
stacks, hardware makers will converge on a set of such types that is not
terribly divergent at the level that the compiler cares about.

(I cleaned up some old formatting and sorted some items for this case:
If we converge on landing this in some form, I will NFC commit format
only changes as a separate commit)

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

21 months ago[WebAssembly][MC] Fix missing `else` after `return` due to type checker bug
Sam Clegg [Tue, 4 Oct 2022 20:50:58 +0000 (13:50 -0700)]
[WebAssembly][MC] Fix missing `else` after `return` due to type checker bug

Once we are in the `Unreachable` we want to disable type checking, but
we were unconditionally returning `true` here which means we encountered
and error.  Instead we unconditionally return false to signal no error.

Fixes: https://github.com/llvm/llvm-project/issues/56935

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

21 months ago[GlobalISel] Add computeNumSignBits() support for compares.
Amara Emerson [Tue, 4 Oct 2022 15:50:57 +0000 (16:50 +0100)]
[GlobalISel] Add computeNumSignBits() support for compares.

Doing so allows G_SEXT_INREG to be combined away for many vector cases.

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

21 months ago[AArch64][GlobalISel] Make vector G_SEXT_INREG legal and allow combining.
Amara Emerson [Tue, 4 Oct 2022 13:26:04 +0000 (14:26 +0100)]
[AArch64][GlobalISel] Make vector G_SEXT_INREG legal and allow combining.

As a result of making these legal, and tweaking the combine to allow vectors,
we generate vector G_SEXT_INREG during legalization.

The reason we want to make these legal in the first place is to allow for
more combine opportunities. Once those have been done, we can just lower them
back to shifts in the post-legalizer lowering.

This needs to be one commit otherwise we start causing tests to fail due to
incomplete support for selection etc.

21 months ago[flang] Add -fpass-plugin option to Flang frontend
Tarun Prabhu [Tue, 4 Oct 2022 23:02:45 +0000 (17:02 -0600)]
[flang] Add -fpass-plugin option to Flang frontend

Add the -fpass-plugin option to flang which dynamically loads LLVM passes from the
shared object passed as the argument to the flag. The behavior of the option is
designed to replicate that of the same option in clang and thus has the same
capabilities and limitations.

- Multiple instances of -fpass-plugin=path-to-file can be specified and each of the
  files will be loaded in that order.

- The flag can be passed to both flang-new and flang-new -fc1.

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

21 months ago[RISCV] Teach SExtWRemoval to recognize sign extended values that come from arguments.
Craig Topper [Tue, 4 Oct 2022 22:19:49 +0000 (15:19 -0700)]
[RISCV] Teach SExtWRemoval to recognize sign extended values that come from arguments.

This information is not preserved in MIR today. So this patch adds
information to RISCVMachineFunctionInfo when the vreg is created for
the argument.

Reviewed By: reames

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

21 months ago[libc] fix fullbuild handling for macro functions
Michael Jones [Tue, 4 Oct 2022 22:35:19 +0000 (15:35 -0700)]
[libc] fix fullbuild handling for macro functions

Now they're only included at all if the mode is fullbuild.

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

21 months ago[libc] add CPU_COUNT macro and backing function
Michael Jones [Mon, 3 Oct 2022 22:55:40 +0000 (15:55 -0700)]
[libc] add CPU_COUNT macro and backing function

Add the macro CPU_COUNT as well as a backing function to implement the
functionality.

Reviewed By: sivachandra

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

21 months ago[mlir][sparse] Add an attribute to the sort operator for stable sorting.
bixia1 [Tue, 4 Oct 2022 17:37:38 +0000 (10:37 -0700)]
[mlir][sparse] Add an attribute to the sort operator for stable sorting.

Reviewed By: aartbik

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

21 months ago[lld-macho] Mark aliased symbols as noDeadStrip
Keith Smiley [Mon, 3 Oct 2022 16:13:10 +0000 (09:13 -0700)]
[lld-macho] Mark aliased symbols as noDeadStrip

This matches ld64 behavior

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

21 months agobuildbot-based-debugging a Microsoft lldb test XPASS
David Blaikie [Tue, 4 Oct 2022 21:38:02 +0000 (21:38 +0000)]
buildbot-based-debugging a Microsoft lldb test XPASS

Let's see if it's been fixed by my recent ABI fixes...

21 months ago[NFC] Fix warning wiht parens in assert from 1376c7
Erich Keane [Tue, 4 Oct 2022 21:33:36 +0000 (14:33 -0700)]
[NFC] Fix warning wiht parens in assert from 1376c7

21 months ago[lld-macho][test] Add -lSystem to all lld invocations
Keith Smiley [Tue, 4 Oct 2022 20:41:01 +0000 (13:41 -0700)]
[lld-macho][test] Add -lSystem to all lld invocations

This is a requirement from ld64, so this mirrors that expectation. Most
of these changes were just offsets from adding the library, or adding
dyld_stub_binder which is always added when linking ld64. This also adds
`%no-lsystem-lld` for the few cases where we're explicitly testing
things without that.

Fixes: https://github.com/llvm/llvm-project/issues/54184

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

21 months agoRevert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"
Gulfem Savrun Yeniceri [Tue, 4 Oct 2022 20:37:39 +0000 (20:37 +0000)]
Revert "Reapply [InstCombine] Switch foldOpIntoPhi() to use InstSimplify"

This reverts commit e1dd2cd063785ea3a6004c8d173f13113b1b8265 because
the original commit b20e34b39f72f2be035dfb7367b6880fd2cf213a had
a dramatic increase in the build time of RTfuzzer, which caused Fuchsia
Clang toolchain builders to timeout:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8801248587754572961/overview

21 months ago[lld/mac] With -demangle, strip leading _ from non-mangled names
Nico Weber [Tue, 4 Oct 2022 19:53:18 +0000 (15:53 -0400)]
[lld/mac] With -demangle, strip leading _ from non-mangled names

For

    void f();
    int main() { f(); }

`lld -demangle` now produces

    ld64.lld: error: undefined symbol: f
    >>> referenced by path/to/main.o:(symbol main+0x8)

instead of

    ld64.lld: error: undefined symbol: _f
    >>> referenced by path/to/main.o:(symbol _main+0x8)

previously. (Without `-demangle`, it still prints `_f` and `_main`.)

This does *not* match ld64's behavior, but it does match e.g. lld/COFF's
behaviour.

This is arguably easier to understand: clang prepends symbol names with `_`
on macOS, so it seems friendly if the linker removes it again in its
diagnostics. It also makes the `extern "C"` insertion diagnostics we added
recently look more self-consistent.

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

21 months ago[llvm-objdump] Add --build-id flag for debuginfod lookups without binary.
Daniel Thornburgh [Tue, 20 Sep 2022 17:51:14 +0000 (10:51 -0700)]
[llvm-objdump] Add --build-id flag for debuginfod lookups without binary.

Adding a --build-id flag allows handling binaries that are referenced in
logs from remote systems, but that aren't necessarily present on the
local machine. These are fetched via debuginfod and handled as if they
were input filenames.

Reviewed By: jhenderson, MaskRay

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

21 months ago[gn build] port 77945a344c3d
Nico Weber [Tue, 4 Oct 2022 20:39:41 +0000 (16:39 -0400)]
[gn build] port 77945a344c3d

21 months ago[ExecutionEngine] Enable ExecutionEngine regression tests on AArch64.
Lang Hames [Tue, 4 Oct 2022 18:31:09 +0000 (11:31 -0700)]
[ExecutionEngine] Enable ExecutionEngine regression tests on AArch64.

21 months ago[LoopVersioning,LLE] Clear LoopAccessInfoManager after making changes.
Florian Hahn [Tue, 4 Oct 2022 20:35:41 +0000 (21:35 +0100)]
[LoopVersioning,LLE] Clear LoopAccessInfoManager after making changes.

Loop versioning changes the control-flow, which may impact SCEVs cached
by for other loops in LoopAccessInfoManager. Clear the manager after
making changes.

Fixes #57825.

Depends on D134609.

Reviewed By: aeubanks

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

21 months ago[libc] implement basic rand and srand
Michael Jones [Tue, 4 Oct 2022 18:59:55 +0000 (11:59 -0700)]
[libc] implement basic rand and srand

This provides the reference implementation of rand and srand. In future
this will likely be upgraded to something that supports full ints.

Reviewed By: sivachandra

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

21 months ago[flang][tco] Engineering option for running only CodeGen passes.
Slava Zakharin [Mon, 3 Oct 2022 23:54:12 +0000 (16:54 -0700)]
[flang][tco] Engineering option for running only CodeGen passes.

This option allows running only CodeGen passes and then translating
FIR to LLVM IR. I am using it to fetch optimized FIR after bbc,
hand-modify it and then produce LLVM IR that can be fed to clang.

21 months agoMSVC ABI: Looks like even non-aarch64 uses the MSVC/14 definition for pod/aggregate...
David Blaikie [Thu, 8 Sep 2022 20:22:39 +0000 (20:22 +0000)]
MSVC ABI: Looks like even non-aarch64 uses the MSVC/14 definition for pod/aggregate passing

Details posted here: https://reviews.llvm.org/D119051#3747201

3 cases that were inconsistent with the MSABI without this patch applied:
  https://godbolt.org/z/GY48qxh3G - field with protected member
  https://godbolt.org/z/Mb1PYhjrP - non-static data member initializer
  https://godbolt.org/z/sGvxcEPjo - defaulted copy constructor

I'm not sure what's suitable/sufficient testing for this - I did verify
the three cases above. Though if it helps to add them as explicit tests,
I can do that too.

Also, I was wondering if the other use of isTrivialForAArch64MSVC in
isPermittedToBeHomogenousAggregate could be another source of bugs - I
tried changing the function to unconditionally call
isTrivialFor(AArch64)MSVC without testing AArch64 first, but no tests
fail, so it looks like this is undertested in any case. But I had
trouble figuring out how to exercise this functionality properly to add
test coverage and then compare that to MSVC itself... - I got very
confused/turned around trying to test this, so I've given up enough to
send what I have out for review, but happy to look further into this
with help.

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

21 months ago[AArch64] Ensure condition (SUBS) has no uses of value in performCONDCombine
David Green [Tue, 4 Oct 2022 20:18:30 +0000 (21:18 +0100)]
[AArch64] Ensure condition (SUBS) has no uses of value in performCONDCombine

performCONDCombine removes and 0xff in patterns of
SUBS (and (add(..), 0xff), C)
under certain complex conditions. It doesn't come up often,
but in the lowering of usub.sat where the SUBS is both used as a
condition and as a value, the And is removed where it would only be
valid for the condition.

Fixes #58109.

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

21 months agoMSVC AArch64 ABI: Homogeneous aggregates
David Blaikie [Fri, 23 Sep 2022 23:32:05 +0000 (23:32 +0000)]
MSVC AArch64 ABI: Homogeneous aggregates

Fixes:
Protected members, HFA: https://godbolt.org/z/zqdK7vdKc
Private members, HFA: https://godbolt.org/z/zqdK7vdKc
Non-empty base, HFA: https://godbolt.org/z/PKTz59Wev
User-provided ctor, HFA: https://godbolt.org/z/sfrTddcW6

Existing correct cases:
Empty base class, NonHFA: https://godbolt.org/z/4veY9MWP3
 - correct by accident of not allowing bases at all (see non-empty base
   case/fix above for counterexample)
Polymorphic: NonHFA: https://godbolt.org/z/4veY9MWP3
Trivial copy assignment, HFA: https://godbolt.org/z/Tdecj836P
Non-trivial copy assignment, NonHFA: https://godbolt.org/z/7c4bE9Whq
Non-trivial default ctor, NonHFA: https://godbolt.org/z/Tsq1EE7b7
 - correct by accident of disallowing all user-provided ctors (see
   user-provided non-default ctor example above for counterexample)
Trivial dtor, HFA: https://godbolt.org/z/nae999aqz
Non-trivial dtor, NonHFA: https://godbolt.org/z/69oMcshb1
Empty field, NonHFA: https://godbolt.org/z/8PTxsKKMK
 - true due to checking for the absence of padding (see comment in code)

After a bunch of testing, this fixes a bunch of cases that were
incorrect. Some of the tests verify the nuances of the existing
behavior/code checks that were already present.

This was mostly motivated by cleanup from/in D133817 which itself was
motivated by D119051.

By removing the incorrect use of isTrivialForAArch64MSVC here & adding
more nuance to the homogeneous testing we can more safely/confidently
make changes to the isTrivialFor(AArch64)MSVC to more properly align
with its usage anyway.

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

21 months ago[clang-tools-extra] [clangd] Respect llvm_shlib_dir in tests
Michał Górny [Mon, 3 Oct 2022 07:59:34 +0000 (09:59 +0200)]
[clang-tools-extra] [clangd] Respect llvm_shlib_dir in tests

Add llvm_shlib_dir to variables used in clangd test suite, consistently
to how it is used in the test suites of clang, clang-tools-extra
and a few other components.  This is necessary to ensure that
the correct shared libraries are used when building clang standalone --
otherwise, use_clang() sets LD_LIBRARY_PATH to the directory containing
the earlier system installation of clang rather than the just-built
library.

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

21 months ago[clang] fix generation of .debug_aranges with LTO
Azat Khuzhin [Tue, 4 Oct 2022 19:55:19 +0000 (19:55 +0000)]
[clang] fix generation of .debug_aranges with LTO

Right now in case of LTO the section is not emited:

    $ cat test.c
    void __attribute__((optnone)) bar()
    {
    }
    void __attribute__((optnone)) foo()
    {
            bar();
    }
    int main()
    {
            foo();
    }

    $ clang -flto=thin -gdwarf-aranges -g -O3 test.c
    $ eu-readelf -waranges a.out  | fgrep -c -e foo -e bar
    0

    $ clang -gdwarf-aranges -g -O3 test.c
    $ eu-readelf -waranges a.out  | fgrep -c -e foo -e bar
    2

Fix this by passing explicitly --plugin-opt=-generate-arange-section.

Suggested-by: OCHyams <orlando.hyams@sony.com>
Reviewed By: dblaikie, MaskRay

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

21 months ago[Clang] fix -Wvoid-ptr-dereference for gnu89
Nick Desaulniers [Tue, 4 Oct 2022 18:59:29 +0000 (11:59 -0700)]
[Clang] fix -Wvoid-ptr-dereference for gnu89

Follow up to D134702; it looks like we were still warning for gnu89
mode.

Link: https://reviews.llvm.org/D134702
Link: https://github.com/ClangBuiltLinux/linux/issues/1720#issuecomment-1265738778
Reviewed By: aaron.ballman

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

21 months ago[sparse] Make GenericOpSparsifier not crash on multi-output dense linalg.generic
Benjamin Kramer [Tue, 4 Oct 2022 16:16:39 +0000 (18:16 +0200)]
[sparse] Make GenericOpSparsifier not crash on multi-output dense linalg.generic

The actual transformation doesn't support multi-output GenericOps, but
if we encounter one without sparse annotations we can just leave it
alone.

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

21 months ago[clang][deps] NFC: Respect working directory on construction
Jan Svoboda [Tue, 4 Oct 2022 19:19:18 +0000 (12:19 -0700)]
[clang][deps] NFC: Respect working directory on construction

This patch provides `FileManager` with the CWD on construction in the worker, rather than later in the action.

Depends on D134976.

Reviewed By: benlangmuir

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

21 months ago[clang][deps] Abolish FileManager sharing
Jan Svoboda [Tue, 4 Oct 2022 19:19:01 +0000 (12:19 -0700)]
[clang][deps] Abolish FileManager sharing

This patch removes the ability of a dependency scanning worker to share a `FileManager` instance between individual scans. It's not sound and doesn't provide performance benefits (due to the underlying caching VFS).

Reviewed By: benlangmuir

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

21 months ago[clangd] Don't print locations of anonymous tags
Sam McCall [Tue, 4 Oct 2022 19:37:27 +0000 (21:37 +0200)]
[clangd] Don't print locations of anonymous tags

These are usually not interesting when clangd presents results in
context, and the file paths are noisy.

21 months ago[flang] Lower TYPE(*) as fir.box<none>
Valentin Clement [Tue, 4 Oct 2022 19:29:28 +0000 (21:29 +0200)]
[flang] Lower TYPE(*) as fir.box<none>

This patch lowers `TYPE(*)` correctly to fir.box<none>.

Reviewed By: jeanPerier

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

21 months ago[DAGCombiner] [AMDGPU] Allow vector loads in MatchLoadCombine
jeff [Tue, 6 Sep 2022 19:54:53 +0000 (19:54 +0000)]
[DAGCombiner] [AMDGPU] Allow vector loads in MatchLoadCombine

Since SROA chooses promotion based on reaching load / stores of allocas, we may run into scenarios in which we alloca a vector, but promote it to an integer. The result of which is the familiar LoadCombine pattern (i.e. ZEXT, SHL, OR). However, instead of coming directly from distinct loads, the elements to be combined are coming from ExtractVectorElements which stem from a shared load.

This patch identifies such a pattern and combines it into a load.

Change-Id: I0bc06588f11e88a0a975cde1fd71e9143e6c42dd

21 months ago[libc] Add a minimal implementation of the POSIX fork function.
Siva Chandra Reddy [Tue, 4 Oct 2022 06:43:59 +0000 (06:43 +0000)]
[libc] Add a minimal implementation of the POSIX fork function.

A very simple and minimal implementation of fork is added. Future
changes will add more functionality to satisfy POSIX and Linux
requirements.

An implementation of wait and a few support macros in sys/wait.h
have also been added to help with testing the fork function.

Reviewed By: lntue, michaelrj

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

21 months ago[mlir][arith] Mark unknown types legal in WIE
Jakub Kuderski [Tue, 4 Oct 2022 18:59:54 +0000 (14:59 -0400)]
[mlir][arith] Mark unknown types legal in WIE

Allow unknown types to pass through without being marked as illegal.

Reviewed By: antiagainst

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

21 months ago[mlir][gpu] Fix GCC -Wparenthesis warning
Christian Sigg [Tue, 4 Oct 2022 18:56:49 +0000 (20:56 +0200)]
[mlir][gpu] Fix GCC -Wparenthesis warning

21 months ago[Clang] make canonical AutoType constraints-free
Yuanfang Chen [Tue, 4 Oct 2022 18:15:03 +0000 (11:15 -0700)]
[Clang] make canonical AutoType constraints-free

As @mizvekov suggested in D134772. This works great for D128750 when
dealing with AutoType's.

Reviewed By: mizvekov, erichkeane

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