platform/upstream/llvm.git
2 years ago[mlir][llvm] Fuse MD_access_group & MD_loop import
Christian Ulmann [Wed, 8 Feb 2023 13:47:29 +0000 (14:47 +0100)]
[mlir][llvm] Fuse MD_access_group & MD_loop import

This commit moves the importing logic of access group metadata into the
loop annotation importer. These two metadata imports can be grouped
because access groups are only used in combination with
`llvm.loop.parallel_accesses`.

As a nice side effect, this commit decouples the LoopAnnotationImporter
from the ModuleImport class.

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

2 years ago[libc] Add an optimization macro header
Guillaume Chatelet [Thu, 9 Feb 2023 13:35:31 +0000 (13:35 +0000)]
[libc] Add an optimization macro header

2 years ago[MemorySSA] Add test for gep with loop invariant pointer operand and
luxufan [Thu, 9 Feb 2023 12:34:15 +0000 (20:34 +0800)]
[MemorySSA] Add test for gep with loop invariant pointer operand and
indexes are all constant

2 years ago[mlir][NFC] Use fully qualified C++ namespaces in .td files.
Vladislav Vinogradov [Tue, 7 Feb 2023 08:21:07 +0000 (11:21 +0300)]
[mlir][NFC] Use fully qualified C++ namespaces in .td files.

Some extra cases that were not covered in 6da0184b.

Reviewed By: springerm

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

2 years ago[clang-tidy][doc] Improve clang-tidy documentation
Carlos Galvez [Fri, 6 Jan 2023 17:35:30 +0000 (17:35 +0000)]
[clang-tidy][doc] Improve clang-tidy documentation

- Specify that the .clang-tidy file is in YAML format.
- Document the options that may be used in the .clang-tidy file,
- Add missing documentation for existing options (User).
- Fix spurious newline after the dash that comes after every
  command-line option. This was inconsistent with single-line
  descriptions, which lacked a newline. The description is now
  aligned with the dash and the corresponding command-line option,
  more visually pleasing.

This enables documenting upcoming global clang-tidy
configuration options.

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

2 years ago[mlir] add support for transform dialect value handles
Alex Zinenko [Fri, 3 Feb 2023 14:00:33 +0000 (14:00 +0000)]
[mlir] add support for transform dialect value handles

Introduce support for the third kind of values in the transform dialect:
value handles. Similarly to operation handles, value handles are
pointing to a set of values in the payload IR. This enables
transformation to be targeted at specific values, such as individual
results of a multi-result payload operation without indirecting through
the producing op or block arguments that previously could not be easily
addressed. This is expected to support a broad class of memory-oriented
transformations such as selective bufferization, buffer assignment, and
memory transfer management.

Value handles are functionally similar to operation handles and require
similar implementation logic. The most important change concerns the
handle invalidation mechanism where operation and value handles can
affect each other.

This patch includes two cleanups that make it easier to introduce value
handles:

  - `RaggedArray` structure that encapsulates the SmallVector of
    ArrayRef backed by flat SmallVector logic, frequently used in the
    transform interfaces implementation;

  - rewrite the tests that associated payload handles with an integer
    value `reinterpret_cast`ed as a pointer, which were a frequent
    source of confusion and crashes when adding more debugging
    facilities that can inspect the payload.

Reviewed By: springerm

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

2 years agoRevert "[YAML IO] Check that mapping doesn't contain duplicating keys"
Anton Sidorenko [Thu, 9 Feb 2023 12:07:23 +0000 (15:07 +0300)]
Revert "[YAML IO] Check that mapping doesn't contain duplicating keys"

LLDB failures: https://lab.llvm.org/buildbot/#/builders/17/builds/33865

This reverts commit 4c228ee6d40a7cff256f1a680561b6c0155ad704.

2 years ago[llvm][cmake][Trivial] don't use `/Zc:preprocessor` with clang-cl
Markus Böck [Thu, 9 Feb 2023 12:01:49 +0000 (13:01 +0100)]
[llvm][cmake][Trivial] don't use `/Zc:preprocessor` with clang-cl

The flag is not recognized by clang-cl and emits unused command line warning for every translation unit

2 years ago[YAML IO] Check that mapping doesn't contain duplicating keys
Anton Sidorenko [Mon, 16 Jan 2023 15:03:12 +0000 (18:03 +0300)]
[YAML IO] Check that mapping doesn't contain duplicating keys

According to YAML specification keys must be unique for a mapping node:
"The content of a mapping node is an unordered set of key/value node pairs, with
the restriction that each of the keys is unique".

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

2 years agoAMDGPU/MC: Fix decoders for VSrc_v2b32 and VSrc_v2f32 RegisterOperands
Petar Avramovic [Thu, 9 Feb 2023 10:29:56 +0000 (11:29 +0100)]
AMDGPU/MC: Fix decoders for VSrc_v2b32 and VSrc_v2f32 RegisterOperands

Decoder should make 32 bit value when decoding immediates, not 64 bit.

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

2 years agoAMDGPU/MC: Add assembler tests for v2f32 and v2b32 with imm operand
Petar Avramovic [Wed, 8 Feb 2023 12:39:56 +0000 (13:39 +0100)]
AMDGPU/MC: Add assembler tests for v2f32 and v2b32 with imm operand

Add test coverage for https://github.com/llvm/llvm-project/issues/60563.
D142636 introduced a bug: incorrect disassembly of floating point inline
constants for v_pk_mov_b32, v_pk_add_f32, v_pk_mul_f32 and v_pk_fma_f32.
Precommit for D143574.

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

2 years ago[mlir][FuncToLLVM] Add option for emitting opaque pointers
Markus Böck [Thu, 9 Feb 2023 11:11:42 +0000 (12:11 +0100)]
[mlir][FuncToLLVM] Add option for emitting opaque pointers

Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179

FuncToLLVM contains some logic working with Memrefs and their lowerings and in the process creating pointer types, loads and allocas. This patch ports the code of these to be compatible with opaque pointers and adds a pass option to enable the use of opaque pointers within the pass.

For the migration effort, the tests have been rewritten to use opaque pointers with dedicated test files for typed pointer support

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

2 years ago[AArch64] Protect against overflowing shift amounts in performSETCCCombine
David Green [Thu, 9 Feb 2023 10:55:37 +0000 (10:55 +0000)]
[AArch64] Protect against overflowing shift amounts in performSETCCCombine

In the attached test case we can get into positions where the shift gets a
constant shift amount that is negative or larger than the bitwidth, leading to
trying to create an invalid constant. Add a check to make sure we can handle it
without assertions.

Fixes #60530

2 years ago[libc][NFC] separate macros in several targets
Guillaume Chatelet [Thu, 9 Feb 2023 10:50:49 +0000 (10:50 +0000)]
[libc][NFC] separate macros in several targets

2 years ago[LLDB] Add missing newline to "image lookup" output
David Spickett [Tue, 7 Feb 2023 17:39:31 +0000 (17:39 +0000)]
[LLDB] Add missing newline to "image lookup" output

When using --name, due to a missing newline, multiple symbol results
were not correctly printed:
```
(lldb) image lookup -r -n "As<.*"
2 matches found in <...>/tbi_lisp:
        Address: tbi_lisp<...>
        Summary: tbi_lisp<...> at Symbol.cpp:75        Address: tbi_lisp<...>
        Summary: tbi_lisp<...> at Symbol.cpp:82
```
It should be:
```
(lldb) image lookup -r -n "As<.*"
2 matches found in /home/david.spickett/tbi_lisp/tbi_lisp:
        Address: tbi_lisp<...>
        Summary: tbi_lisp<...> at Symbol.cpp:75
        Address: tbi_lisp<...>
        Summary: tbi_lisp<...> at Symbol.cpp:82
```
With Address/Summary on separate lines.

Reviewed By: clayborg, labath

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

2 years ago[AMDGPU] Ignore unused bits in VINTERP encoding
Jay Foad [Thu, 9 Feb 2023 10:15:10 +0000 (10:15 +0000)]
[AMDGPU] Ignore unused bits in VINTERP encoding

In the GFX11 VINTERP encoding bits 23, 59 and 60 are unused. Change the
disassembler to ignore these bits.

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

2 years ago[Support] Emulate SIGPIPE handling in raw_fd_ostream write for Windows
Andrew Ng [Fri, 20 Jan 2023 15:12:09 +0000 (15:12 +0000)]
[Support] Emulate SIGPIPE handling in raw_fd_ostream write for Windows

Prevent errors and crash dumps for broken pipes on Windows.

Fixes: https://github.com/llvm/llvm-project/issues/48672
Differential Revision: https://reviews.llvm.org/D142224

2 years ago[mlir][bufferization] Improve aliasing OpOperand/OpResult property
Matthias Springer [Thu, 9 Feb 2023 10:32:09 +0000 (11:32 +0100)]
[mlir][bufferization] Improve aliasing OpOperand/OpResult property

`getAliasingOpOperands`/`getAliasingOpResults` now encodes OpOperand/OpResult, buffer relation and a degree of certainty. E.g.:
```
// aliasingOpOperands(%r) = {(%t, EQUIV, DEFINITE)}
// aliasingOpResults(%t) = {(%r, EQUIV, DEFINITE)}
%r = tensor.insert %f into %t[%idx] : tensor<?xf32>

// aliasingOpOperands(%r) = {(%t0, EQUIV, MAYBE), (%t1, EQUIV, MAYBE)}
// aliasingOpResults(%t0) = {(%r, EQUIV, MAYBE)}
// aliasingOpResults(%t1) = {(%r, EQUIV, MAYBE)}
%r = arith.select %c, %t0, %t1 : tensor<?xf32>
```

`BufferizableOpInterface::bufferRelation` is removed, as it is now part of `getAliasingOpOperands`/`getAliasingOpResults`.

This change allows for better analysis, in particular wrt. equivalence. This allows additional optimizations and better error checking (which is sometimes overly conservative). Examples:

* EmptyTensorElimination can eliminate `tensor.empty` inside `scf.if` blocks. This requires a modeling of equivalence: It is not a per-OpResult property anymore. Instead, it can be specified for each OpOperand and OpResult. This is important because `tensor.empty` may be eliminated only if all values on the SSA use-def chain to the final consumer (`tensor.insert_slice`) are equivalent.
* The detection of "returning allocs from a block" can be improved. (Addresses a TODO in `assertNoAllocsReturned`.) This allows us to bufferize IR such as "yielding a `tensor.extract_slice` result from an `scf.if` branch", which currently fails to bufferize because the alloc detection is too conservative.
* Better bufferization of loops. Aliases of the iter_arg can be yielded (even if they are not equivalent) without having to realloc and copy the entire buffer on each iteration.

The above-mentioned examples are not yet implemented with this change. This change just improves the BufferizableOpInterface, its implementations and related helper functions, so that better aliasing information is available for each op.

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

2 years agoFix call to deprecated API in bd87a2449da0c82e63cebdf9c131c54a5472e3a7
Alex Richardson [Thu, 9 Feb 2023 10:26:21 +0000 (10:26 +0000)]
Fix call to deprecated API in bd87a2449da0c82e63cebdf9c131c54a5472e3a7

2 years ago[mlir][sparse] Port the remaining integration tests to use SVE
Andrzej Warzynski [Tue, 7 Feb 2023 17:34:23 +0000 (17:34 +0000)]
[mlir][sparse] Port the remaining integration tests to use SVE

This patch updates the remaining SparseCompiler integration tests to
target SVE when available.

Two tests will require some investigation in the future:
  * sparse_matmul.mlir
  * sparse_tanh.mlir
The former passes regardless - that's due to how `CHECK` lines are
defined. The latter fails when SVE is enabled, but passes when it's
disabled. I marked it as UNSUPPORTED as there is no mechanism to XFAIL a
test conditionally. Also, see [1] for more details.

[1] https://github.com/llvm/llvm-project/issues/60626

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

2 years ago[CGP] Add generic TargetLowering::shouldAlignPointerArgs() implementation
Alex Richardson [Thu, 9 Feb 2023 09:33:32 +0000 (09:33 +0000)]
[CGP] Add generic TargetLowering::shouldAlignPointerArgs() implementation

This function was added for ARM targets, but aligning global/stack pointer
arguments passed to memcpy/memmove/memset can improve code size and
performance for all targets that don't have fast unaligned accesses.
This adds a generic implementation that adjusts the alignment to pointer
size if unaligned accesses are slow.
Review D134168 suggests that this significantly improves performance on
synthetic benchmarks such as Dhrystone on RV32 as it avoids memcpy() calls.

Reviewed By: efriedma

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

2 years agoSimplify test from change D73904
Michael Platings [Wed, 8 Feb 2023 16:59:52 +0000 (16:59 +0000)]
Simplify test from change D73904

This part of the test can break if multilib is enabled, and isn't
important to testing the change with which is was added.

The relevant part of the test is
ARM-EABI: "-lclang_rt.builtins-arm"
which remains.

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

2 years ago[Test] Fix YAML mapping keys duplication. NFC.
Anton Sidorenko [Mon, 16 Jan 2023 14:58:28 +0000 (17:58 +0300)]
[Test] Fix YAML mapping keys duplication. NFC.

YAML specification does not allow keys duplication an a mapping. However, YAML
parser in LLVM does not have any check on that and uses only the last key entry.
In this change duplicated keys are merged to satisfy the spec.

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

2 years agoReland "[X86][ABI] Don't preserve return regs for preserve_all/preserve_most CCs""
Anton Bikineev [Mon, 6 Feb 2023 12:16:08 +0000 (13:16 +0100)]
Reland "[X86][ABI] Don't preserve return regs for preserve_all/preserve_most CCs""

The original change mistakenly excluded parameter registers from the
list of callee-saved-registers. This reland fixes it - it only excludes
the return registers for preserve_all/preserve_most CCs.

Original description:
> Currently both calling conventions preserve registers that are used to
> store a return value. This causes the returned value to be lost:
>
>   define i32 @bar() {
>     %1 = call preserve_mostcc i32 @foo()
>     ret i32 %1
>   }
>
>   define preserve_mostcc i32 @foo() {
>     ret i32 2
>     ; preserve_mostcc will restore %rax,
>     ; whatever it was before the call.
>   }
>
> This contradicts the current documentation (preserve_allcc "behaves
> identical to the `C` calling conventions on how arguments and return
> values are passed") and also breaks [[clang::preserve_most]].
>
> This change makes CSRs be preserved iff they are not used to store a
> return value (e.g.  %rax for scalars, {%rax:%rdx} for __int128, %xmm0
> for double).  For void functions no additional registers are
> preserved, i.e.  the behaviour is backward compatible with existing
> code.

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

2 years ago[clang][codegen] Fix emission of consteval constructor of derived type
Mariya Podchishchaeva [Thu, 9 Feb 2023 09:34:26 +0000 (04:34 -0500)]
[clang][codegen] Fix emission of consteval constructor of derived type

For simple derived type ConstantEmitter returns a struct of the same
size but different type which is then stored field-by-field into memory
via pointer to derived type. In case base type has more fields than derived,
the incorrect GEP is emitted. So, just cast pointer to derived type to
appropriate type with enough fields.

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

Reviewed By: aaron.ballman

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

2 years agoReland D143267: [LoopVectorize] Use DataLayout::getIndexType instead of i32 for non...
Sander de Smalen [Wed, 8 Feb 2023 16:47:02 +0000 (16:47 +0000)]
Reland D143267: [LoopVectorize] Use DataLayout::getIndexType instead of i32 for non-constant GEP indices.

Fixed issue where 'ConstantInt::get(IndextTy, -Part)' was executed with the wrong type for Part,
e.g. IndexTy was i64, but Part was 'unsigned', which led to things like 'mul i64 .., 4294967292',
which was obviously wrong.

Also changed sve-vector-reverse.ll to be vectorized with UF>1 to test this.

This reverts commit 1f01cdda68614dba12af3cc3aff38541d0abcc6b.

2 years ago[Docs] Clarify behavior of llvm-lit -vv
Jay Foad [Wed, 8 Feb 2023 15:24:11 +0000 (15:24 +0000)]
[Docs] Clarify behavior of llvm-lit -vv

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

2 years ago[libc] Add documentation for the macros folder
Guillaume Chatelet [Thu, 9 Feb 2023 09:34:08 +0000 (09:34 +0000)]
[libc] Add documentation for the macros folder

2 years ago[libc][NFC] Format bazel file
Guillaume Chatelet [Thu, 9 Feb 2023 09:33:40 +0000 (09:33 +0000)]
[libc][NFC] Format bazel file

2 years ago[libc][NFC] Move cpu_features.h to properties subfolder
Guillaume Chatelet [Thu, 9 Feb 2023 09:30:24 +0000 (09:30 +0000)]
[libc][NFC] Move cpu_features.h to properties subfolder

2 years ago[libc][NFC] Move compiler_features.h to properties subfolder
Guillaume Chatelet [Thu, 9 Feb 2023 09:25:45 +0000 (09:25 +0000)]
[libc][NFC] Move compiler_features.h to properties subfolder

2 years ago[mlir][llvm] Add extra attributes to the atomic ops.
Tobias Gysi [Thu, 9 Feb 2023 08:15:56 +0000 (09:15 +0100)]
[mlir][llvm] Add extra attributes to the atomic ops.

The revision adds a number of extra arguments to the
atomic read modify write and compare and exchange
operations. The extra arguments include the volatile,
weak, syncscope, and alignment attributes.

The implementation also adapts the fence operation to use
a assembly format and generalizes the helper used
to obtain the syncscope name.

Reviewed By: Dinistro

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

2 years ago[libc][NFC] Move architectures.h to properties subfolder
Guillaume Chatelet [Thu, 9 Feb 2023 09:20:39 +0000 (09:20 +0000)]
[libc][NFC] Move architectures.h to properties subfolder

2 years ago[mlir][transform] Fix apply WithPDLPatternsOp with non-pattern op
Kohei Yamaguchi [Thu, 9 Feb 2023 09:02:33 +0000 (10:02 +0100)]
[mlir][transform] Fix apply WithPDLPatternsOp with non-pattern op

Fix https://github.com/llvm/llvm-project/issues/60209

Fix crash with segmentation fault when transform::WithPDLPatternsOp is
applied with non-pattern op. Added check for existing transform ops with
pattern op.

Reviewed By: ftynse

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

2 years ago[mlir][llvm] Purge struct_attr
Christian Ulmann [Thu, 9 Feb 2023 08:27:13 +0000 (09:27 +0100)]
[mlir][llvm] Purge struct_attr

This commit removes the `llvm.struct_attr` which was used to bundle
result attributes that were previously attached to multiple results.
This extension isn't part of LLVM as result attribute semantics cannot
be supported on a struct field granularity.
Furthermore, many usages promoted result attributes to argument
attributes but this does not necessary preserve the semantics.

Reviewed By: gysit

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

2 years ago[mlir][bufferization][NFC] Cache definitions of read tensors
Matthias Springer [Thu, 9 Feb 2023 08:10:48 +0000 (09:10 +0100)]
[mlir][bufferization][NFC] Cache definitions of read tensors

This is to avoid unnecessary traversals of the IR.

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

2 years ago[mlir][vector] Prevent duplicating operations during vector distribute
Thomas Raoux [Thu, 9 Feb 2023 07:15:11 +0000 (07:15 +0000)]
[mlir][vector] Prevent duplicating operations during vector distribute

We should distribute ops that have other uses than the yield op as this
would duplicate those ops.

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

2 years ago[mlir][Tiling] Properly reject "buffer semantic" operations
Quentin Colombet [Wed, 8 Feb 2023 08:23:13 +0000 (09:23 +0100)]
[mlir][Tiling] Properly reject "buffer semantic" operations

Our tiling implementation assumes a "tensor semantic" for the operation to
be tiled.
Prior to this patch, if we provide a tilable op with "buffer semantic", we
will assert instead of gracefully reject the input.

This patch turns the assert in a proper error.

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

2 years ago[NFC][TableGen] Refine the check in Decoder
Xiang1 Zhang [Thu, 9 Feb 2023 07:27:02 +0000 (15:27 +0800)]
[NFC][TableGen] Refine the check in Decoder
The Opcode occupy 2 bytes in following test, we should use {{[0-9]+}}
to match the total value if it, not a part of it.
OPC_Decode(uleb128 Opcode, uleb128 DIdx)
and so do for OPC_TryDecode.

2 years ago[mlir][bufferize][NFC] Optimize read-only tensor detection
Matthias Springer [Thu, 9 Feb 2023 08:00:52 +0000 (09:00 +0100)]
[mlir][bufferize][NFC] Optimize read-only tensor detection

Check alias sets instead of traversing the IR.

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

2 years ago[flang][hlfir] Lower procedure designators to HLFIR
Jean Perier [Thu, 9 Feb 2023 08:02:43 +0000 (09:02 +0100)]
[flang][hlfir] Lower procedure designators to HLFIR

- Add a convertProcedureDesignatorToHLFIR that converts the
  fir::ExtendedValue from the current lowering to a
  fir.boxproc/tuple<fir.boxproc, len> mlir::Value.

- Allow fir.boxproc/tuple<fir.boxproc, len> as hlfir::Entity values
  (a function is an address, but from a Fortran entity point of view,
  procedure that are not procedure pointers cannot be assigned to, so
  it makes a lot more sense to consider those as values).

- Modify symbol association to not generate an hlfir.declare for dummy
  procedures. They are not needed and allowing hlfir.declare to declare
  function values would make its verifier and handling overly complex
  for little benefits (maybe an hlfir.declare_proc could be added if it
  turnout out useful later for debug info and attributes storing
  purposes).

- Allow translation from hlfir::Entity to fir::ExtendedValue.
  convertToBox return type had to be relaxed because some intrinsics
  handles both object and procedure arguments and need to lower their
  object arguments "asBox". fir::BoxValue is not intended to carry
  dummy procedures (all its member functions would make little sense
  and its verifier does not accept such type).
  Note that AsAddr, AsValue and AsBox will always return the same MLIR
  value for procedure designators because they are always handled the
  same way in FIR.

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

2 years ago[AVR] Optimize 16-bit comparison with a constant
Ben Shi [Sat, 21 Jan 2023 13:42:25 +0000 (21:42 +0800)]
[AVR] Optimize 16-bit comparison with a constant

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

Reviewed By: jacquesguan, aykevl

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

2 years ago[libc][obvious] Fix build.
Siva Chandra Reddy [Thu, 9 Feb 2023 06:07:03 +0000 (06:07 +0000)]
[libc][obvious] Fix build.

2 years ago[libc][math] Implement scalbn, scalbnf, scalbnl.
Renyi Chen [Thu, 9 Feb 2023 05:54:17 +0000 (05:54 +0000)]
[libc][math] Implement scalbn, scalbnf, scalbnl.

Implement scalbn via `fptuil::ldexp` for `FLT_RADIX==2` case.
"unimplemented" otherwise.

Reviewed By: lntue, sivachandra

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

2 years ago[mlir][func] Add support for nested tuples to TestDecomposeCallGraphTypes.
Ingo Müller [Wed, 8 Feb 2023 13:10:00 +0000 (13:10 +0000)]
[mlir][func] Add support for nested tuples to TestDecomposeCallGraphTypes.

Nested tuples were only supported in some narrow edge cases (and
potentially only because the test ops like `test.make_tuple` aren't
properly verified). This patch adds a couple of test cases with tested
tuple types and makes them work in the test pass by extending the
argument materialization and decomposition functions.

Reviewed By: silvas

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

2 years ago[Instcombine] Precommit tests update for icmp(trunc cttz/ctlz(x), C); NFC
chenglin.bi [Thu, 9 Feb 2023 05:03:41 +0000 (13:03 +0800)]
[Instcombine] Precommit tests update for icmp(trunc cttz/ctlz(x), C); NFC

2 years ago[llvm-c-test] Fix unused variable warnings
Kazu Hirata [Thu, 9 Feb 2023 05:00:45 +0000 (21:00 -0800)]
[llvm-c-test] Fix unused variable warnings

This patch fixes:

  llvm/tools/llvm-c-test/debuginfo.c:211:12: error: unused variable
  'tag0' [-Werror,-Wunused-variable]

  llvm/tools/llvm-c-test/debuginfo.c:222:12: error: unused variable
  'tag1' [-Werror,-Wunused-variable]

2 years ago[lldb] Add --gdb-format flag to dwim-print
Dave Lee [Mon, 19 Dec 2022 23:33:56 +0000 (15:33 -0800)]
[lldb] Add --gdb-format flag to dwim-print

Add support for the `--gdb-format`/`-G` flag to `dwim-print`.

The gdb-format flag allows users to alias `p` to `dwim-print`.

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

2 years ago[BOLT] Process fragment siblings in lite mode, keep lite mode on
Amir Ayupov [Thu, 9 Feb 2023 03:11:13 +0000 (19:11 -0800)]
[BOLT] Process fragment siblings in lite mode, keep lite mode on

In lite mode, include split function fragments to the list of functions to
process even if a fragment has no samples. This is required to properly
detect and update split jump tables (jump tables that contain pointers to code
in the main and cold fragments).

Reviewed By: #bolt, maksfb

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

2 years ago[mlir][linalg] Enhance padding LinalgOps to handle tensor.empty cases.
Hanhan Wang [Wed, 1 Feb 2023 04:36:18 +0000 (20:36 -0800)]
[mlir][linalg] Enhance padding LinalgOps to handle tensor.empty cases.

Reviewed By: nicolasvasilache

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

2 years agoInstCombine: Add some additional is.fpclass tests
Matt Arsenault [Fri, 3 Feb 2023 14:06:53 +0000 (10:06 -0400)]
InstCombine: Add some additional is.fpclass tests

Test some more cases related to compare with 0 and inf.

2 years ago[LoongArch] Add baseline tests for translating the selection of constants into mathem...
gonglingqin [Thu, 9 Feb 2023 01:28:39 +0000 (09:28 +0800)]
[LoongArch] Add baseline tests for translating the selection of constants into mathematical operations

2 years agoInstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass
Matt Arsenault [Mon, 12 Dec 2022 03:08:28 +0000 (22:08 -0500)]
InstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass

Fold class test performed by an fcmp into another class. For now this
avoids introducing new class calls then there isn't one that already
exists.

2 years ago[-Wunsafe-buffer-usage] To disable a test on Windows systems.
Ziqing Luo [Thu, 9 Feb 2023 01:35:07 +0000 (17:35 -0800)]
[-Wunsafe-buffer-usage] To disable a test on Windows systems.

One of the tests in the commit
'bdf4f2bea50e87f5b9273e3bbc9a7753bca3a6bb' sometimes fails on one of
the buildbots runing on a Windows machine. For example,
"https://lab.llvm.org/buildbot/#/builders/60/builds/10615" is a failed
build.

Now we disable it until we figure out why this could happen.

2 years ago[gn] port 79971d0d771a27 (LLVMProfdataTests)
Nico Weber [Thu, 9 Feb 2023 01:21:34 +0000 (20:21 -0500)]
[gn] port 79971d0d771a27 (LLVMProfdataTests)

2 years ago[clang][deps] NFC: Refactor inferred modules test
Jan Svoboda [Thu, 9 Feb 2023 00:20:49 +0000 (16:20 -0800)]
[clang][deps] NFC: Refactor inferred modules test

This patch squashes two tests with identical inputs into a single test, and adopts the `split-file` utility. This allows us to remove `sed` invocation with multiple commands, where "s|-E|-x objective-c -E|g" could've caused issues if previous replacements injected path containing "-E".

Reviewed By: benlangmuir

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

2 years ago[mlir][tosa] make Select operator broadcastable in the pass
TatWai Chong [Thu, 9 Feb 2023 00:37:15 +0000 (16:37 -0800)]
[mlir][tosa] make Select operator broadcastable in the pass

Making Select broadcastable can let this op easier to use.

Change-Id: I4a4bec4f7cbe532e954a5b4fe53136676ab4300c

Reviewed By: rsuderman

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

2 years agoadd LLVMGetDINodeTag to C bindings
Davide Bertola [Thu, 9 Feb 2023 00:28:34 +0000 (16:28 -0800)]
add LLVMGetDINodeTag to C bindings

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

2 years ago[docs] Update "production quality" targets for lld/ELF
Fangrui Song [Thu, 9 Feb 2023 00:16:13 +0000 (16:16 -0800)]
[docs] Update "production quality" targets for lld/ELF

Add RISC-V and update Arm from (>= v6) to (>= v4).

Reviewed By: pirama

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

2 years ago[CMake] Fix -DBUILD_SHARED_LIBS=on builds after D141446
Fangrui Song [Wed, 8 Feb 2023 23:52:07 +0000 (15:52 -0800)]
[CMake] Fix -DBUILD_SHARED_LIBS=on builds after D141446

2 years ago[SanitizerBinaryMetadata] Make constructors/destructors hidden
Marco Elver [Wed, 8 Feb 2023 23:46:15 +0000 (00:46 +0100)]
[SanitizerBinaryMetadata] Make constructors/destructors hidden

By switching them to external with default visibility, DSOs may not call
their own constructor/destructor. This is incorrect, because they pass
different parameters.

Fix it by marking the ctors/dtors as external linkage but with hidden
visibility.

Reviewed By: MaskRay

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

2 years agoFix initialization of th_task_state on each thread on expanding hot teams.
Terry Wilmarth [Fri, 20 Jan 2023 20:10:04 +0000 (14:10 -0600)]
Fix initialization of th_task_state on each thread on expanding hot teams.

The th_task_state was initialized from the master thread's value, or
from its memo stack, but this causes problems because neither of those
may have the right value at the right time. However, other threads in
the team are guaranteed to have the right values, so we change the
initialize the new threads' th_task_state from the th_task_state of
the last of the older threads in the hot team.

Differential Revision: https://reviews.llvm.org/D142247
Fix #56307.

2 years agoRemove core file that shouldn't have been committed
Aiden Grossman [Wed, 8 Feb 2023 23:15:48 +0000 (23:15 +0000)]
Remove core file that shouldn't have been committed

2 years ago[MLGO] Add BB Profile Dump in AsmPrinter
Aiden Grossman [Wed, 18 Jan 2023 09:26:42 +0000 (09:26 +0000)]
[MLGO] Add BB Profile Dump in AsmPrinter

This patch adds a basic block profile dump option within the AsmPrinter
and dumps basic block profile information so that cost models can use
the data for downstream analysis.

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

2 years ago[Lex] Fix -Wunused-variable for LLVM_ENABLE_ASSERTIONS=off builds after D140179
Fangrui Song [Wed, 8 Feb 2023 23:08:10 +0000 (15:08 -0800)]
[Lex] Fix -Wunused-variable for LLVM_ENABLE_ASSERTIONS=off builds after D140179

2 years ago[Support] Clarify CrashRecoveryContext exception codes on Windows. NFC
Alexandre Ganea [Wed, 8 Feb 2023 23:01:25 +0000 (18:01 -0500)]
[Support] Clarify CrashRecoveryContext exception codes on Windows. NFC

Differential revision: https://reviews.llvm.org/D143609

2 years ago[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create.
Kirill Stoimenov [Wed, 8 Feb 2023 22:52:28 +0000 (22:52 +0000)]
[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create.

Reviewed By: vitalybuka

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

2 years ago[clang][cli] Simplify repetitive macro invocations
Jan Svoboda [Wed, 8 Feb 2023 22:52:53 +0000 (14:52 -0800)]
[clang][cli] Simplify repetitive macro invocations

Since we now only support Visual Studio 2019 16.7 and newer, we're able to use the `/Zc:preprocessor` flag that turns on the standards-conforming preprocessor. It (among other things) correctly expands `__VA_ARGS__` (see https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-170#macro-arguments-are-unpacked). This enables us to get rid of some repetitive boilerplate in Clang's command-line parser/generator.

Reviewed By: Bigcheese

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

2 years ago[InstCombine] canonicalize cmp+select as umin/umax
Sanjay Patel [Wed, 8 Feb 2023 21:47:55 +0000 (16:47 -0500)]
[InstCombine] canonicalize cmp+select as umin/umax

(V == 0) ? 1 : V --> umax(V, 1)
(V == UMAX) ? UMAX-1 : V --> umin(V, UMAX-1)

https://alive2.llvm.org/ce/z/pfDBAf

This is one pair of the variants discussed in issue #60374.

Enhancements for the other end of the constant range and
signed variants are potential follow-ups, but that may
require more work because we canonicalize at least one
min/max like that to icmp+zext.

2 years ago[InstCombine] add tests for cmp+select; NFC
Sanjay Patel [Wed, 8 Feb 2023 21:13:05 +0000 (16:13 -0500)]
[InstCombine] add tests for cmp+select; NFC

2 years agoAdd CFI integer types normalization
Ramon de C Valle [Wed, 8 Feb 2023 19:19:13 +0000 (19:19 +0000)]
Add CFI integer types normalization

This commit adds a new option (i.e.,
`-fsanitize-cfi-icall-normalize-integers`) for normalizing integer types
as vendor extended types for cross-language LLVM CFI/KCFI support with
other languages that can't represent and encode C/C++ integer types.

Specifically, integer types are encoded as their defined representations
(e.g., 8-bit signed integer, 16-bit signed integer, 32-bit signed
integer, ...) for compatibility with languages that define
explicitly-sized integer types (e.g., i8, i16, i32, ..., in Rust).

``-fsanitize-cfi-icall-normalize-integers`` is compatible with
``-fsanitize-cfi-icall-generalize-pointers``.

This helps with providing cross-language CFI support with the Rust
compiler and is an alternative solution for the issue described and
alternatives proposed in the RFC
https://github.com/rust-lang/rfcs/pull/3296.

For more information about LLVM CFI/KCFI and cross-language LLVM
CFI/KCFI support for the Rust compiler, see the design document in the
tracking issue https://github.com/rust-lang/rust/issues/89653.

Relands b1e9ab7438a098a18fecda88fc87ef4ccadfcf1e with fixes.

Reviewed By: pcc, samitolvanen

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

2 years ago[clang][deps] Ensure module invocation can be serialized
Ben Langmuir [Wed, 8 Feb 2023 21:24:07 +0000 (13:24 -0800)]
[clang][deps] Ensure module invocation can be serialized

When reseting modular options, propagate the values from certain options
that have ImpliedBy relations instead of setting to the default. Also,
verify in clang-scan-deps that the command line produced round trips
exactly.

Ideally we would automatically derive the set of options that need this
kind of propagation, but for now there aren't very many impacted.

rdar://105148590

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

2 years ago[llvm-profdata] Add option to cap profile output size
William Huang [Wed, 8 Feb 2023 02:59:12 +0000 (02:59 +0000)]
[llvm-profdata] Add option to cap profile output size

D139603 (add option to llvm-profdata to reduce output profile size) contains test cases that are not cross-platform. Moving those tests to unit test and making sure the feature is callable from llvm library

Reviewed By: snehasish

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

2 years ago[-Wunsafe-buffer-usage] Add unsafe buffer checking opt-out pragmas
Ziqing Luo [Wed, 8 Feb 2023 22:06:37 +0000 (14:06 -0800)]
[-Wunsafe-buffer-usage] Add unsafe buffer checking opt-out pragmas

Add a pair of clang pragmas:
- `#pragma clang unsafe_buffer_usage begin` and
- `#pragma clang unsafe_buffer_usage end`,
which specify the start and end of an (unsafe buffer checking) opt-out
region, respectively.

Behaviors of opt-out regions conform to the following rules:

- No nested nor overlapped opt-out regions are allowed. One cannot
  start an opt-out region with `... unsafe_buffer_usage begin` but never
  close it with `... unsafe_buffer_usage end`. Mis-use of the pragmas
  will be warned.
- Warnings raised from unsafe buffer operations inside such an opt-out
  region will always be suppressed. This behavior CANNOT be changed by
  `clang diagnostic` pragmas or command-line flags.
- Warnings raised from unsafe operations outside of such opt-out
  regions may be reported on declarations inside opt-out
  regions. These warnings are NOT suppressed.
- An un-suppressed unsafe operation warning may be attached with
  notes. These notes are NOT suppressed as well regardless of whether
  they are in opt-out regions.

The implementation maintains a separate sequence of location pairs
representing opt-out regions in `Preprocessor`.  The `UnsafeBufferUsage`
analyzer reads the region sequence to check if an unsafe operation is
in an opt-out region. If it is, discard the warning raised from the
operation immediately.

This is a re-land after I reverting it at 9aa00c8a306561c4e3ddb09058e66bae322a0769.
The compilation error should be resolved.

Reviewed by: NoQ

Differential revision: https://reviews.llvm.org/D140179

2 years ago[mlir][sparse] Implement hybrid quick sort for sparse_tensor.sort.
bixia1 [Wed, 8 Feb 2023 17:02:13 +0000 (09:02 -0800)]
[mlir][sparse] Implement hybrid quick sort for sparse_tensor.sort.

Reviewed By: aartbik

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

2 years agoRevert "[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create."
Kirill Stoimenov [Wed, 8 Feb 2023 21:54:40 +0000 (21:54 +0000)]
Revert "[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create."

This reverts commit a7db3cb257ff6396481f44427bccd0ca5abf4d63.

2 years agoReapply "[cmake][msvc] Enable standards-conforming preprocessor"
Jan Svoboda [Wed, 8 Feb 2023 21:46:37 +0000 (13:46 -0800)]
Reapply "[cmake][msvc] Enable standards-conforming preprocessor"

This reverts commit 16e1a49441c51817697138437d8db2c15bc19cb4, essentially reapplying 12d8e7c6ade55bba241259312e3e4bdcf6aeab81. The build bot where this caused issues is supposed to be updated now: https://reviews.llvm.org/D135128#4108588

2 years ago[AMDGPU] Do not exapnd fp atomics on gfx940
Stanislav Mekhanoshin [Wed, 8 Feb 2023 20:46:57 +0000 (12:46 -0800)]
[AMDGPU] Do not exapnd fp atomics on gfx940

FP atomics are safe on gfx940. This fixes regression after D131560.

Fixes: SWDEV-380468
Differential Revision: https://reviews.llvm.org/D143603

2 years ago[X86] midpoint-int-vec - cleanup common check prefixes
Simon Pilgrim [Wed, 8 Feb 2023 21:09:41 +0000 (21:09 +0000)]
[X86] midpoint-int-vec - cleanup common check prefixes

2 years ago[AMDGPU] Update atomic tests. NFC.
Stanislav Mekhanoshin [Wed, 8 Feb 2023 20:53:14 +0000 (12:53 -0800)]
[AMDGPU] Update atomic tests. NFC.

This is to precommit tests before future patch.

2 years ago[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create.
Kirill Stoimenov [Wed, 8 Feb 2023 19:36:43 +0000 (19:36 +0000)]
[LSAN] Fix pthread_create interceptor to ignore leaks in real pthread_create.

Reviewed By: vitalybuka

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

2 years ago[DAG] Fold freeze(concat_vectors(x,y,...)) -> concat_vectors(freeze(x),freeze(y)...
Simon Pilgrim [Wed, 8 Feb 2023 19:55:04 +0000 (19:55 +0000)]
[DAG] Fold freeze(concat_vectors(x,y,...)) -> concat_vectors(freeze(x),freeze(y),...)

Another of the cleanups necessary for D136529

2 years ago[mlir][cf] Add support for opaque pointers to ControlFlowToLLVM lowering
Markus Böck [Wed, 8 Feb 2023 15:09:04 +0000 (16:09 +0100)]
[mlir][cf] Add support for opaque pointers to ControlFlowToLLVM lowering

Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179

This is a very simple patch since there is only one use of pointers types in `cf.assert` that has to be changed. Pointer types are conditionally created with element types and the GEP had to be adjusted to use the array type as base type.

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

2 years ago[lldb][test] Fix function references to function calls (NFC)
Dave Lee [Wed, 8 Feb 2023 19:29:13 +0000 (11:29 -0800)]
[lldb][test] Fix function references to function calls (NFC)

2 years ago[RISCV] Fix miscompile in SExtWRemoval due to early return ignoring other sources
Philip Reames [Wed, 8 Feb 2023 19:35:06 +0000 (11:35 -0800)]
[RISCV] Fix miscompile in SExtWRemoval due to early return ignoring other sources

This code is walking back through a worklist of sources. All of the sources need to be sign extending for the result to be true. We had a case which returned rather than continued, which causes a miscompile when another source was not sign extended. The flawed logic was introduced in Dec 22, by change 844430bcc377.

This was recently exposed in a stage2 build of llvm-tablegen when we switched from using llvm::Optional to std::optional. The stars aligned in just the wrong way, and we started actively miscompiling idiomatic optional usage. std::optional<uint32_t> appears to use the top 32 bits of the word on RV64 for its tag.

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

2 years ago[Tooling/Inclusion] Add more multi-header symbols to StdSpecialSymbolMap.inc
Haojian Wu [Wed, 8 Feb 2023 11:12:15 +0000 (12:12 +0100)]
[Tooling/Inclusion] Add more multi-header symbols to StdSpecialSymbolMap.inc

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

2 years ago[mlir][sparse] make foreach operation support sparse tensor slices.
Peiming Liu [Wed, 28 Dec 2022 01:42:53 +0000 (01:42 +0000)]
[mlir][sparse] make foreach operation support sparse tensor slices.

Reviewed By: aartbik

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

2 years ago[ELF] Reword symMap/symVector comment. NFC
Fangrui Song [Wed, 8 Feb 2023 18:50:44 +0000 (10:50 -0800)]
[ELF] Reword symMap/symVector comment. NFC

Having symVector makes iteration efficient and is actually more
efficient than using llvm::DenseMap<llvm::CachedHashStringRef, Symbol
*>, so the FIXME comment can be removed. Using an alternative
implementation ankerl/unordered_dense.h decreases link time for chromium
by 0.x% but I am unsure it justifies the extra header file.

2 years ago[lldb] Accept negative indexes in __getitem__
Dave Lee [Fri, 3 Feb 2023 16:45:44 +0000 (08:45 -0800)]
[lldb] Accept negative indexes in __getitem__

To the Python bindings, add support for Python-like negative indexes.

While was using `script`, I tried to access a thread's bottom frame with
`thread.frame[-1]`, but that failed. This change updates the `__getitem__`
implementations to support negative indexes as one would expect in Python.

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

2 years ago[TLS]: Clamp the alignment of TLS global variables if required by the target
Wolfgang Pieb [Mon, 6 Feb 2023 21:50:37 +0000 (13:50 -0800)]
[TLS]: Clamp the alignment of TLS global variables if required by the target

Adding a module flag 'MaxTLSAlign' describing the maximum alignment a global TLS
variable can have. Optimizers are prevented from increasing the alignment of such
variables beyond this threshold.

Reviewed By: probinson

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

2 years ago[SROA] Pre-commit vector-promotion.ll tests for D143225
Han Zhu [Wed, 8 Feb 2023 18:11:19 +0000 (10:11 -0800)]
[SROA] Pre-commit vector-promotion.ll tests for D143225

2 years ago[LLDB] Fix assertion failure by removing `CopyType` in `std::coroutine_handle` pretty...
Adrian Vogelsgesang [Thu, 2 Feb 2023 01:39:27 +0000 (17:39 -0800)]
[LLDB] Fix assertion failure by removing `CopyType` in `std::coroutine_handle` pretty printer

The pretty printer for `std::coroutine_handle` was running into
> Assertion failed: (target_ctx != source_ctx && "Can't import into itself")
from ClangASTImporter.h, line 270.

This commit fixes the issue by removing the `CopyType` call from the
pretty printer. While this call was necessary in the past, it seems to
be no longer required, at least all test cases are still passing. Maybe
something changed in the meantime around the handling of `TypesystemClang`
instances. I don't quite understand why `CopyType` was necessary earlier.

I am not sure how to add a regression test for this, though. It seems
the issue is already triggered by the exising `TestCoroutineHandle.py`,
but API tests seem to ignore all violations of `lldbassert` and still
report the test as "passed", even if assertions were triggered

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

2 years ago[RISCV] Precommit a test for upcoming miscompile bugfix
Philip Reames [Wed, 8 Feb 2023 18:01:46 +0000 (10:01 -0800)]
[RISCV] Precommit a test for upcoming miscompile bugfix

2 years ago[DAG] Fold freeze(build_pair(x,y)) -> build_pair(freeze(x),freeze(y))
Simon Pilgrim [Wed, 8 Feb 2023 17:53:59 +0000 (17:53 +0000)]
[DAG] Fold freeze(build_pair(x,y)) -> build_pair(freeze(x),freeze(y))

One of the cleanups necessary for D136529 - another being how we're going to handle moving freeze through multiple result nodes (like uaddo and subcarry)

2 years ago[flang] Fix rank and byte stride in pointer remapping
Valentin Clement [Wed, 8 Feb 2023 16:55:38 +0000 (17:55 +0100)]
[flang] Fix rank and byte stride in pointer remapping

In some remapping case the rank of the pointer is different
from the target one.

```
program remap
  type :: p
    integer :: a
  end type t
  type(p), target :: ta(10) = [ (t(i),i=1,10) ]
  class(t), pointer :: p(:,:)
  p(1:2,1:5) => ta
end
```

This patch updates the rank and the byte stride to fix such case.

Reviewed By: klausler

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

2 years ago[RuntimeDyld][ELF] Fixed relocations referencing undefined TLS symbols
Moritz Sichert [Wed, 8 Feb 2023 10:47:32 +0000 (11:47 +0100)]
[RuntimeDyld][ELF] Fixed relocations referencing undefined TLS symbols

The classification of TLS symbols in ELF was changed from ST_Data to
ST_Other in the following commit:
018a484cd26d72fb4c9e7fd75e5f5bc7838dfc73

RuntimeDyldELF::processRelocationRef() needs to be updated to also
handle ST_Other symbols so that it handles TLS relocations correctly.
The current tests did not fail because we have a shortcut for global
symbols that are already defined.

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

2 years ago[X86] Merge DQ/BW AVX512 ISD::ABDS/ABDU setOperationAction calls. NFCI.
Simon Pilgrim [Wed, 8 Feb 2023 16:12:01 +0000 (16:12 +0000)]
[X86] Merge DQ/BW AVX512 ISD::ABDS/ABDU setOperationAction calls. NFCI.

All set to Custom - there's no need to have them in separate loops

2 years ago[flang] Fix optional assertion in PFTBuilder
Valentin Clement [Wed, 8 Feb 2023 15:54:00 +0000 (16:54 +0100)]
[flang] Fix optional assertion in PFTBuilder

D142279 enabled assertion in libstdc++ and one was triggered
in the PFTBuilder because an optional was access even if it was
null.
This patch fix this issue and add a regression test.

Reviewed By: jeanPerier

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

2 years ago[LV] Perform recurrence sinking directly on VPlan.
Florian Hahn [Wed, 8 Feb 2023 15:49:29 +0000 (15:49 +0000)]
[LV] Perform recurrence sinking directly on VPlan.

This patch updates LV to sink recipes directly using the VPlan use
chains. The initial patch only moves sinking to be purely VPlan-based.
Follow-up patches will move legality checks to VPlan as well.

At the moment, there's a single test failure remaining.

Reviewed By: Ayal

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

2 years agoRevert "[LoopVectorize] Use DataLayout::getIndexType instead of i32 for non-constant...
Sander de Smalen [Wed, 8 Feb 2023 15:46:24 +0000 (15:46 +0000)]
Revert "[LoopVectorize] Use DataLayout::getIndexType instead of i32 for non-constant GEP indices."

This patch causes a regression, so reverting it while I investigate the issue.

This reverts commit e6eb84a191ca2a1afd5789c5bb398da68bb6065e.