platform/upstream/llvm.git
17 months ago[scudo] Call __scudo_deallocate_hook on reallocations.
Guillaume Chelfi [Tue, 14 Feb 2023 18:44:37 +0000 (18:44 +0000)]
[scudo] Call __scudo_deallocate_hook on reallocations.

Scudo is expected to call __scudo_allocate_hook on allocations, and
__scudo_deallocate_hook on deallocations, but it's behavior is not
clear on reallocations. Currently, non-trivial reallocations call
__scudo_allocate_hook but never __scudo_deallocate_hook. We should
prefer either calling both, none, or a dedicated
hook (__scudo_reallocate_hook, for instance).

This patch implements the former, and adds a unit test to enforce
those expectations.

Reviewed By: Chia-hungDuan

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

17 months ago[libc][doc] Move docs/math.rst to docs/math/index.rst
Tue Ly [Tue, 14 Feb 2023 17:36:07 +0000 (12:36 -0500)]
[libc][doc] Move docs/math.rst to docs/math/index.rst

Move docs/math.rst to docs/math/index.rst

Reviewed By: michaelrj

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

17 months ago[OpenMP]Fix PR55970: Miscompile of collapse(3) with non-rectangular loop nest.
Alexey Bataev [Tue, 14 Feb 2023 15:19:45 +0000 (07:19 -0800)]
[OpenMP]Fix PR55970: Miscompile of collapse(3) with non-rectangular loop nest.

Need to assign the calculated lower bound back to temp variable,
otherwise incorrect value (upper bound instead of lower bound) might be
used.

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

17 months ago[gn build] Port 7f5d130a428f
LLVM GN Syncbot [Tue, 14 Feb 2023 18:25:58 +0000 (18:25 +0000)]
[gn build] Port 7f5d130a428f

17 months agolibclc: add clspv to targets exempt from alwaysinline
Kévin Petit [Tue, 14 Feb 2023 18:26:42 +0000 (18:26 +0000)]
libclc: add clspv to targets exempt from alwaysinline

https://reviews.llvm.org/D132362

Patch by: Aaron Greig <aaron.greig@codeplay.com>

17 months agolibclc: add generated convert.cl to clspv/clspv64 targets
Kévin Petit [Tue, 14 Feb 2023 18:23:35 +0000 (18:23 +0000)]
libclc: add generated convert.cl to clspv/clspv64 targets

https://reviews.llvm.org/D136772

Patch by: Aaron Greig <aaron.greig@codeplay.com>

17 months ago[libc++][format] Fixes test failures.
Mark de Wever [Thu, 2 Feb 2023 18:41:01 +0000 (19:41 +0100)]
[libc++][format] Fixes test failures.

Using some builds the modular build fails due to missing exports
and includes. This fixes the build.

Reviewed By: #libc, ldionne

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

17 months ago[libc++][chrono] Add hh_mm_ss formatter.
Mark de Wever [Sun, 20 Mar 2022 12:40:02 +0000 (13:40 +0100)]
[libc++][chrono] Add hh_mm_ss formatter.

Partially implements:
- P1361 Integration of chrono with text formatting
- P2372 Fixing locale handling in chrono formatters
- P1466 Miscellaneous minor fixes for chrono

Depends on D137022

Reviewed By: ldionne, #libc

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

17 months ago[mlir][gpu] Add support for unsigned integer extend in vector to gpu.subgroup_mma...
Quinn Dawkins [Mon, 13 Feb 2023 01:33:10 +0000 (20:33 -0500)]
[mlir][gpu] Add support for unsigned integer extend in vector to gpu.subgroup_mma lowering

Unsigned integer types are supported in subgroup mma ops by matching
against arith.extui ops. This allows for subgroup_mma_compute ops with
mixed signedness which requires later conversions to handle this. SPIR-V
cooperative matrix ops support this while the lowering to WMMA does not.

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

17 months agolibclc: add more generic implementations to clspv SOURCES
Kévin Petit [Tue, 14 Feb 2023 18:10:44 +0000 (18:10 +0000)]
libclc: add more generic implementations to clspv SOURCES

https://reviews.llvm.org/D134887

Patch by: Aaron Greig <aaron.greig@codeplay.com>

17 months ago[libc++][doc] Adds Issaquah papers and issues.
Mark de Wever [Sun, 12 Feb 2023 12:07:49 +0000 (13:07 +0100)]
[libc++][doc] Adds Issaquah papers and issues.

Reviewed By: ldionne, #libc

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

17 months ago[AArch64] Remove dead isReflexive methods. NFC
David Green [Tue, 14 Feb 2023 17:58:28 +0000 (17:58 +0000)]
[AArch64] Remove dead isReflexive methods. NFC

These were added in 71f0ec242f348e7d2298 but never used.

17 months ago[libc++] Counter<T>'s assignment operator shouldn't ++gConstructed
Arthur O'Dwyer [Thu, 9 Feb 2023 18:06:52 +0000 (13:06 -0500)]
[libc++] Counter<T>'s assignment operator shouldn't ++gConstructed

This has been here since d5f461ca03e30, but assigning into an existing
Counter object definitely doesn't create a new object. This causes the
count to "leak" higher and higher, inside algorithms based on swapping.

17 months ago[flang][runtime] Handle aliasing in Assign()
Peter Klausler [Wed, 1 Feb 2023 23:25:54 +0000 (15:25 -0800)]
[flang][runtime] Handle aliasing in Assign()

Detect and handle LHS/RHS aliasing when effecting intrinsic
assignments via the Assign() runtime function.

Also: don't apply special handling for allocatable LHS when calling
a user-defined type-bound ASSIGNMENT(=) generic procedure for a
polymorphic type, and refactor some code into utility functions to
make Assign() more comprehensible.

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

17 months ago[llvm] Deprecate {Bits,Float,Double}To{Bits,Float,Double} (NFC)
Kazu Hirata [Tue, 14 Feb 2023 17:52:36 +0000 (09:52 -0800)]
[llvm] Deprecate {Bits,Float,Double}To{Bits,Float,Double} (NFC)

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

17 months ago[NFC][IR] Make Module::getIFuncList() private.
Vasileios Porpodas [Tue, 7 Feb 2023 03:43:13 +0000 (19:43 -0800)]
[NFC][IR] Make Module::getIFuncList() private.

This patch adds several missing IFuncList modifier functions, like
removeIFunc(), eraseIFunc() and insertIFunc().
There is no longer need to access the list directly so it also makes
getIFuncList() private.

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

17 months ago[flang] Strengthen conformance requirements for allocatable/pointer dummy arguments
Peter Klausler [Thu, 9 Feb 2023 23:23:52 +0000 (15:23 -0800)]
[flang] Strengthen conformance requirements for allocatable/pointer dummy arguments

There's several sets of circumstances in which a scalar actual argument can be
associated with a dummy argument array in Fortran, but they apply only to "ordinary"
dummy arguments, not those that are allocatables or pointers.

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

17 months ago[clang][test][RISCV] Check for __riscv_i in riscv-target-features.c
Alex Bradbury [Tue, 14 Feb 2023 17:02:32 +0000 (17:02 +0000)]
[clang][test][RISCV] Check for __riscv_i in riscv-target-features.c

This was overlooked, even though we have comprehensive tests for all the
other __riscv_fooext defines.

17 months ago[clang][test][RISCV] Fix precision of CHECK-NOT lines in riscv-target-features.c
Alex Bradbury [Tue, 14 Feb 2023 16:52:26 +0000 (16:52 +0000)]
[clang][test][RISCV] Fix precision of CHECK-NOT lines in riscv-target-features.c

`CHECK-NOT: __riscv_f 2000000{{$}}` was overly precise, in that it
wouldn't test what we want it to if the version of the F extension was
bumped. Meanwhile, lines like `CHECK-NOT: __riscv_d` were too imprecise,
as they would match any define with that prefix (e.g.
`__riscv_dsomethingelse`).

This patch just updates these lines to check for `__riscv_foo {{.*$}}`.

17 months ago[AMDGPU ASAN] Remove reference to asan bitcode library
Yaxun (Sam) Liu [Tue, 14 Feb 2023 15:37:46 +0000 (10:37 -0500)]
[AMDGPU ASAN] Remove reference to asan bitcode library

The asan functions are now attributed as used
in the device library, no need to keep the
declaration of asan device preserve function.

Patch by: Praveen Velliengiri

Reviewed by: Yaxun Liu

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

17 months ago[CodeGen] Trivial simplification of some getRegisterType calls. NFC.
Jay Foad [Tue, 14 Feb 2023 16:30:07 +0000 (16:30 +0000)]
[CodeGen] Trivial simplification of some getRegisterType calls. NFC.

17 months ago[libc++] Enforce formatting for already formatted and new files and ignore the format...
Nikolas Klauser [Fri, 20 Jan 2023 06:42:44 +0000 (07:42 +0100)]
[libc++] Enforce formatting for already formatted and new files and ignore the formatting of tests

It is quite confusing to newcomers that the formatting check gets mostly ignored. To fix that, enforce the formatting for new file and already formatted files, but ignore it for any files that aren't formatted already. We ignore the tests for now, since almost no test is formatted currently, and they are changed almost never.

Reviewed By: ldionne, Mordante, #libc

Spies: arichardson, fedor.sergeev, phosek, sstefan1, libcxx-commits, abrachet

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

17 months agoRevert "[extract_symbols.py] Adjust how the output of nm is interpreted"
Jake Egan [Tue, 14 Feb 2023 16:23:26 +0000 (11:23 -0500)]
Revert "[extract_symbols.py] Adjust how the output of nm is interpreted"

This commit was intended to fix some failures on AIX, but introduced some new failures instead. Commit e5d914672233cd055cda564eee2803a0a1c78c36 fixed the original failures. See D142989.

This reverts commit 78f13ea093afdebcaa3b5c5690530b9217bbdfac.

17 months agoRevert "[libc] Separate memcpy implementations per arch"
Guillaume Chatelet [Tue, 14 Feb 2023 16:14:51 +0000 (16:14 +0000)]
Revert "[libc] Separate memcpy implementations per arch"

Reverting as it broke downstream users.
This reverts commit 26541d4176346f8510302c74d6f3b958a4e523db.

17 months ago[AArch64][SME]: Custom lower select and fp_extend for streaming SVE
Hassnaa Hamdi [Tue, 14 Feb 2023 15:36:25 +0000 (15:36 +0000)]
[AArch64][SME]: Custom lower select and fp_extend for streaming SVE

Custom lower select/fp_extend and update related testing files

Reviewed By: sdesmalen

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

17 months ago[libc] Separate memcpy implementations per arch
Guillaume Chatelet [Tue, 14 Feb 2023 15:57:53 +0000 (15:57 +0000)]
[libc] Separate memcpy implementations per arch

As x86_64 implementations is likely to grow up to a point where it's no more manageable to have all implementations in the same file.

17 months ago[libc] refactor logic around embedded memcpy
Guillaume Chatelet [Tue, 14 Feb 2023 15:11:47 +0000 (15:11 +0000)]
[libc] refactor logic around embedded memcpy

17 months ago[flang] Associate entities are variables
Peter Klausler [Thu, 9 Feb 2023 18:00:12 +0000 (10:00 -0800)]
[flang] Associate entities are variables

A more precise reading of the standard for associate entities, like "x"
in ASSOCIATE(x => selector), shows that the utility predicates used for
determining their status as variables should treat them as variables
(not necessarily definable), whatever the selector is.  Currently
the cases where the selector is an expression or a designator with a
vector subscript are not properly considered to be variables.
(See Fortran 2018, 11.1.3.3 paragraph 5.)

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

17 months ago[AArch64][SME]: Custom-lower SIGN_EXTEND_INREG for streaming SVE
Hassnaa Hamdi [Tue, 14 Feb 2023 15:11:23 +0000 (15:11 +0000)]
[AArch64][SME]: Custom-lower SIGN_EXTEND_INREG for streaming SVE

Custom lower SIGN_EXTEND_INREG and udpate related tests.

Reviewed By: sdesmalen

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

17 months ago[MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS...
Arjun P [Tue, 14 Feb 2023 15:26:22 +0000 (15:26 +0000)]
[MLIR][Presburger] Matrix: hide expensive consistency check behind EXPENSIVE_CHECKS macro

This significantly improves performance of Release assert builds.

Reviewed By: bondhugula

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

17 months ago[ConstraintElim] Add reproducer remarks.
Florian Hahn [Tue, 14 Feb 2023 15:15:14 +0000 (15:15 +0000)]
[ConstraintElim] Add reproducer remarks.

This patch adds an optimization remark for each performed optimization
containing a module that can be used to reproduce the transformation.

The reproducer function contains a series of @llvm.assume calls, one for
each condition currently in scope. For each condition, the operand
instruction are cloned until we reach operands that have an entry in the
constraint system. Those will then be added as function arguments.

The reproducer functions are minimal, that is, they only contain the
conditions required for a given simplification. The resulting IR is very
compact and can be used to verify each transformation individually.

It also provides a python script to extract the IR from the remarks and
create LLVM IR files from it.

Reviewed By: paquette

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

17 months ago[AArch64][SME]: Add missing Ops that need custom-lowering in streaming mode.
Hassnaa Hamdi [Tue, 14 Feb 2023 13:56:25 +0000 (13:56 +0000)]
[AArch64][SME]: Add missing Ops that need custom-lowering in streaming mode.

Add missing Ops and update related testing files.

Reviewed By: sdesmalen

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

17 months ago[LVI] Fix and re-enable at-use reasoning (PR60629)
Nikita Popov [Tue, 14 Feb 2023 14:48:25 +0000 (15:48 +0100)]
[LVI] Fix and re-enable at-use reasoning (PR60629)

This fixes the handling of phi nodes in getConstantRangeAtUse()
and re-enables it, reverting the workaround from
c77c186a647b385c291ddabecd70a2b4f84ae342.

For phi nodes, while we can make use of the edge condition for the
incoming value, we shouldn't look past the phi node to look for
further conditions, because we might be reasoning about values
from two different cycle iterations (which will have the same
SSA value).

To handle this more specifically we would have to detect cycles,
and there doesn't seem to be any motivating case for that at this
point.

17 months ago[LV] Synthesize all true masks for masked vector function variants
Graham Hunter [Fri, 9 Sep 2022 08:41:02 +0000 (09:41 +0100)]
[LV] Synthesize all true masks for masked vector function variants

When vectorizing code with function calls in it, if we encounter
a function which only has vectorized variants requiring a mask
we can synthesize an all-true mask to enable us to proceed.

Since we want the mask to be represented in vplan, the pointer
to the chosen Function is now stored as part of the
VPWidenCallRecipe, and mask arguments are added at the
appropriate index to the recipe operands.

Reviewed By: david-arm, fhahn, reames

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

17 months agoDAG: Remove hasBitPreservingFPLogic
Matt Arsenault [Tue, 24 Jan 2023 01:19:57 +0000 (21:19 -0400)]
DAG: Remove hasBitPreservingFPLogic

This doesn't make sense as an option. fneg and fabs are bit
preserving by definition. If a target has some fneg or fabs
instruction that are not bitpreserving it's incorrect to lower
fneg/fabs to use it.

17 months ago[mlir][llvm] Make LoopAnnotations non-discardable
Christian Ulmann [Tue, 14 Feb 2023 14:07:16 +0000 (15:07 +0100)]
[mlir][llvm] Make LoopAnnotations non-discardable

This commit adds the loop annotation attribute to LLVM::Br and
LLVM::CondBr to ensure it is non-discardable. Furthermore, the name is
changed from "llvm.loop" to "loop-annotation".

Reviewed By: gysit

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

17 months ago[clang][NFC] Adjust tests to not un/define predefined macros
John Brawn [Fri, 3 Feb 2023 13:31:40 +0000 (13:31 +0000)]
[clang][NFC] Adjust tests to not un/define predefined macros

An upcoming patch will be making all defining or undefining of
predefined macros to be warning (currently only some give a warning).
In preparation for this adjust some tests that would emit a warning:
 * In thread-specifier.c the undefine is done to avoid a different
   warning, but we get that warning just because __thread and
   __private_extern__ are the wrong way around so we can just swap
   them.
 * There are a couple of objective-c tests that redefine IBAction to
   what it's already defined as, so we can just remove the define.

17 months ago[flang] support fir.unreachable in stack arrays pass
Tom Eccles [Mon, 13 Feb 2023 15:45:47 +0000 (15:45 +0000)]
[flang] support fir.unreachable in stack arrays pass

Some functions (e.g. the main function) end with a call to the STOP
statement instead of a func.return. This is lowered as a call to the
stop runtime function followed by a fir.unreachable. fir.unreachable is
a terminator and so this can cause functions to have no func.return.

The stack arrays pass looks to see which heap allocations have always
been freed by the time a function returns. Without any returns, the pass
does not detect any freed allocations. This patch changes this behaviour
so that fir.unreachable is checked as well as func.return.

This allows 15 heap allocations for array temporaries in spec2017
exchange2's main function to be moved to the stack.

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

17 months ago[flang] automatically load FIR dialect with hlfir
Tom Eccles [Mon, 13 Feb 2023 18:03:44 +0000 (18:03 +0000)]
[flang] automatically load FIR dialect with hlfir

MLIR loads dialects lazily so if a hlfir type (or operation) is found
before any fir type (or operation), the fir dialect will not have been
loaded when the hlfir thing is verified. Verification of some hlfir
operations does depend on fir types (e.g. hlfir.sum needs
fir::SequenceType).

Tablegen change recommended by jeanPerier

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

17 months ago[libc] Conform memcpy tuning macro to the new naming scheme
Guillaume Chatelet [Tue, 14 Feb 2023 13:43:53 +0000 (13:43 +0000)]
[libc] Conform memcpy tuning macro to the new naming scheme

17 months ago[MachineTraceMetrics][NFC] Move Strategy enum out of the class
Anton Sidorenko [Tue, 14 Feb 2023 10:30:13 +0000 (13:30 +0300)]
[MachineTraceMetrics][NFC] Move Strategy enum out of the class

Make forward declaration possible to reduce amount of dependencies and reduce
re-compilation burden caused by further patches.

Reviewed By: spatel

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

17 months ago[mlir][LLVM] Properly wrap code examples in markdown code blocks
Markus Böck [Tue, 14 Feb 2023 13:20:11 +0000 (14:20 +0100)]
[mlir][LLVM] Properly wrap code examples in markdown code blocks

These are otherwise rendered and formatted as raw text on the website, making them completely unreadable

17 months ago[flang][hlfir] remove unnecessary header include
Jean Perier [Tue, 14 Feb 2023 13:12:47 +0000 (14:12 +0100)]
[flang][hlfir] remove unnecessary header include

Builder/HLFIRTools.h is not needed and is causing build
issues in some shared library builds because it belongs to another
library that depends on libHLFIRDialect (so libHLFIRDialect should
not depend on it).

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

17 months ago[flang] Fix USE rename
Leandro Lupori [Fri, 10 Feb 2023 20:50:45 +0000 (20:50 +0000)]
[flang] Fix USE rename

Fix USE rename when use-name and local-name are the same.
Previously, the associated symbol was being removed from scope.

Operator rename implementation needed no change, because, as it
doesn't call AddUseRename(), symbol erasure is skipped.

Fixes #60223

Reviewed By: klausler

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

17 months ago[SimpleLoopUnswitch] Re-enable simple-loop-unswitch-inject-invariant-conditions
Max Kazantsev [Tue, 14 Feb 2023 12:54:19 +0000 (19:54 +0700)]
[SimpleLoopUnswitch] Re-enable simple-loop-unswitch-inject-invariant-conditions

Underlying bug (taking a branch from inner loop as candidate) is now fixed.
We can return it.

17 months ago[SimpleLoopUnswitch] Ignore inner loops when injecting invariant conditions. PR60736
Max Kazantsev [Tue, 14 Feb 2023 12:26:15 +0000 (19:26 +0700)]
[SimpleLoopUnswitch] Ignore inner loops when injecting invariant conditions. PR60736

The transform and all related updates don't expect the situation when candidate
is from an inner loop. I think we *might* still do something in this case, but
the current implementation doesn't expect this and does incorrect loop info
updates in this situation.

Details: https://github.com/llvm/llvm-project/issues/60736

17 months agoDAG: Relax foldBitcastedFPLogic conditions
Matt Arsenault [Mon, 23 Jan 2023 20:49:41 +0000 (16:49 -0400)]
DAG: Relax foldBitcastedFPLogic conditions

Requiring a bitcast to exist was unhelpful. The most basic cases
are always going to be a CopyFromReg or load, so they would need
a new cast inserted. Don't require a bitcast if it's a free
operation. I don't think this logic makes particularly much sense
(it seems to be imparting special interpretation of bitcast), but
this needs to be in sync with foldSignChangeInBitcast.

We should also get rid of this hasBitPreservingFPLogic hook. fabs/fneg
are bitpreserving or incorrectly implemented, so this should just be a
regular legality check.

17 months ago[NFC] Move some asserts out of Expensive Checks
Max Kazantsev [Tue, 14 Feb 2023 11:42:06 +0000 (18:42 +0700)]
[NFC] Move some asserts out of Expensive Checks

This was done by reviewer's request, but in fact without them we
skip very nasty bugs. Unless it is a REAL problem, I'd keep them
in default setup.

17 months ago[llvm][AArch64] Fix an interaction of SLS and BTI after a returns twice call
David Spickett [Mon, 13 Feb 2023 14:48:02 +0000 (14:48 +0000)]
[llvm][AArch64] Fix an interaction of SLS and BTI after a returns twice call

This fixes the combination of two things:
* Placing a BTI after calls to a returns twice function like setjmp.
  This allows the setjmp to return with a br instead of a ret.
* Straight line speculation mitigations that replace BLR with a BL
  to a thunk that does the mitigation, and then goes to the original
  target.

Originally I marked AArch64call_bti as requiring that SLS mitigation
be disabled. This caused a crash when you tried to codegen with both.
Since CALL_BTI tried to match with AArch64call_bti but could not.

This change does 2 things:
* Follow the pattern set by AArch64call and add 2 patterns for
  AArch64call_bti. One with no IP (interprocedural) registers,
  and one with. For SLS mitigation on and off respectively.
* Modify the sls hardening pass to iterate through bundled
  instructions, as the AArch64 KCFI pass does.

Since there is a 1:1 replacement of the BLR with a BL,
the bundle remains intact. This is checked with an MIR test.

The ir -> asm testing is updated to add runs with the sls
mitigation enabled.

Reviewed By: kristof.beyls, pzheng

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

17 months ago[Test] Add test for PR60736
Max Kazantsev [Tue, 14 Feb 2023 11:04:44 +0000 (18:04 +0700)]
[Test] Add test for PR60736

Details at https://github.com/llvm/llvm-project/issues/60736

17 months ago[SimpleLoopUnswitch] Temorarily switch off simple-loop-unswitch-inject-invariant...
Max Kazantsev [Tue, 14 Feb 2023 10:54:58 +0000 (17:54 +0700)]
[SimpleLoopUnswitch] Temorarily switch off simple-loop-unswitch-inject-invariant-conditions. PR60736

It caused an assertion failure, not sure induced or introduced. Disabling
to investigate it. See details at https://github.com/llvm/llvm-project/issues/60736

17 months ago[mlir] fix LLVM IR translation of vector<... x index>
Alex Zinenko [Tue, 14 Feb 2023 10:04:33 +0000 (10:04 +0000)]
[mlir] fix LLVM IR translation of vector<... x index>

When the translation was written, `vector<... x index>` was not allowed
at all. After it was added later, the translation was never adapted. It
kept working in the most common case of index-typed attributes using
64-bit storage and being converted to 64-bit integers in LLVM IR, but
not in the other cases that require truncation or extension, producing
wrong results when using the raw data storage of the dense attrbute to
construct the LLVM IR constant. When the storage size doesn't match,
fall back to the per-element constant construction, which is slower but
handles bitwidth differences correctly.

Fixes #60614.

Reviewed By: gysit

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

17 months ago[Flang] Fix for Any/All simplification to properly propogate the inital value
Sacha Ballantyne [Tue, 14 Feb 2023 10:28:43 +0000 (10:28 +0000)]
[Flang] Fix for Any/All simplification to properly propogate the inital value

When rank > 1, the inital value would be lost on inner loops, leading to the wrong
value to be returned, e.g. This would return T. This patch fixes this to use the correct
inital value for all cases.
```
    Integer :: m(0,10)
    Any(m .eq 0)
```

Reviewed By: vdonaldson

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

17 months ago[docs] Update the ACLE URL
KAWASHIMA Takahiro [Tue, 14 Feb 2023 10:09:23 +0000 (19:09 +0900)]
[docs] Update the ACLE URL

17 months ago[docs] Fix bullet list formatting
KAWASHIMA Takahiro [Tue, 14 Feb 2023 10:03:51 +0000 (19:03 +0900)]
[docs] Fix bullet list formatting

reST requires an empty line before a bullet list.

17 months ago[mlir][linalg] expose convolution dimension classifier
Alex Zinenko [Tue, 7 Feb 2023 17:29:21 +0000 (17:29 +0000)]
[mlir][linalg] expose convolution dimension classifier

Make available through functions in the `linalg::detail` namespace the
classification of Linalg op dimensions as different kinds (batch, image,
channel, etc) of convolution dimensions. This is useful for identifying
which dimensions to target with transformations.

Reviewed By: chelini

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

17 months ago[mlir] reallow null results in TransformEachOpTrait
Alex Zinenko [Mon, 13 Feb 2023 12:32:07 +0000 (12:32 +0000)]
[mlir] reallow null results in TransformEachOpTrait

Previous changes in 98acd7468307b6099e7deae206a749af324ff95f were overly
eager to disallow null payload everywhere. The semantics of
TransformEachOpTrait allows individual applications to return null
payloads as means of filtering out the operations to which they are not
applicable without emitting even a silenceable failure. This is a
questionable choice, but one apparently relied upon. Null payloads are
not supposed to leak outside of the trait.

Reviewed By: qcolombet

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

17 months agoUse llvm::bit_cast (NFC)
Kazu Hirata [Tue, 14 Feb 2023 09:22:12 +0000 (01:22 -0800)]
Use llvm::bit_cast (NFC)

17 months ago[mlir] Drop unused arith conversion class (NFC)
Christian Ulmann [Tue, 14 Feb 2023 08:42:46 +0000 (09:42 +0100)]
[mlir] Drop unused arith conversion class (NFC)

This commit removes an old helper class for fastmath attribute
conversion that is no longer used.

The last usage of this class was dropped in https://reviews.llvm.org/D137456.

Reviewed By: gysit

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

17 months ago[include-cleaner] Better support ambiguous std symbols
Haojian Wu [Mon, 13 Feb 2023 13:46:07 +0000 (14:46 +0100)]
[include-cleaner] Better support ambiguous std symbols

By special-casing them at the moment. The tooling stdlib lib doesn't
support these symbols (most important one is std::move).

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

17 months ago[Modules] Don't re-generate template specialization in the importer
Chuanqi Xu [Tue, 14 Feb 2023 02:27:22 +0000 (10:27 +0800)]
[Modules] Don't re-generate template specialization in the importer

Close https://github.com/llvm/llvm-project/issues/60693.

In this issue, we can find that the importer will try to generate the
template specialization again in the importer, which is not good and
wastes time. This patch tries to address the problem.

17 months ago[Tooling][Stdlib][NFC] Reflow comments and strip clang-format pragmas
Kadir Cetinkaya [Tue, 14 Feb 2023 08:46:41 +0000 (09:46 +0100)]
[Tooling][Stdlib][NFC] Reflow comments and strip clang-format pragmas

17 months ago[AVR] Fix inaccurate offsets in PC relative branch instructions
Ben Shi [Mon, 13 Feb 2023 11:46:02 +0000 (19:46 +0800)]
[AVR] Fix inaccurate offsets in PC relative branch instructions

In avr-gcc, the destination of "rjmp label + offset" is address
'label + offset', while destination of "rjmp . + offset" is
'address_of_rjmp + offset + 2'.

Clang is in accordance with avr-gcc for "rjmp label + offset", but
emits incorrect destination of "rjmp . + offset" to
'address_of_rjmp + offset', in which the expected offset 2 is missing.

This patch fixes the above issue.

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

Reviewed By: jacquesguan, aykevl

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

17 months agoMove global namespace cl::opt inside llvm::
Fangrui Song [Tue, 14 Feb 2023 08:09:44 +0000 (00:09 -0800)]
Move global namespace cl::opt inside llvm::

17 months agoAMDGPU: Teach getNegatedExpression about rcp
Matt Arsenault [Mon, 13 Feb 2023 18:57:38 +0000 (14:57 -0400)]
AMDGPU: Teach getNegatedExpression about rcp

17 months agoAMDGPU: Add test for getNegatedExpression with rcp
Matt Arsenault [Mon, 13 Feb 2023 20:12:44 +0000 (16:12 -0400)]
AMDGPU: Add test for getNegatedExpression with rcp

17 months agoAMDGPU: Add additional tests for combiner infinite loop
Matt Arsenault [Fri, 10 Feb 2023 13:44:46 +0000 (09:44 -0400)]
AMDGPU: Add additional tests for combiner infinite loop

17 months agollvm-reduce: Run instruction reduction last
Matt Arsenault [Fri, 10 Feb 2023 14:00:53 +0000 (10:00 -0400)]
llvm-reduce: Run instruction reduction last

With the current state of mir support, this is going to generate
a large number of verifier errors. Running the use and def
reductions first helps to mitigate the impact of this.

17 months ago[DAG] Handle build_vector with all undefs in reduceBuildVecTruncToBitCast
pvanhout [Mon, 13 Feb 2023 09:20:14 +0000 (10:20 +0100)]
[DAG] Handle build_vector with all undefs in reduceBuildVecTruncToBitCast

While working on D143731 I hit a case where a build_vector with 2 undef operands could be generated (with one undef hidden behind a bitcast).
That made `reduceBuildVecTruncToBitCast` crash because it seems to assume there is at least one good operand.

Reviewed By: arsenm

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

17 months ago[LangRef] Global variable declarations imply minimum size
Nikita Popov [Wed, 1 Feb 2023 10:18:47 +0000 (11:18 +0100)]
[LangRef] Global variable declarations imply minimum size

Adjust the wording added in D78952 to say that global variable
declarations (and interposable definitions) do imply a minimum
size (and alignment) on the global. They just don't imply a
maximum size.

We rely on these semantics in at least two places:

* Global dereferenceability: https://github.com/llvm/llvm-project/blob/2153544865a9733b06579823814c981f735e4201/llvm/lib/IR/Value.cpp#L907
* Global inbounds GEP: https://github.com/llvm/llvm-project/blob/2153544865a9733b06579823814c981f735e4201/llvm/lib/IR/ConstantFold.cpp#L2283

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

17 months ago[Coroutines] Don't run optimizations for optnone functions
Chuanqi Xu [Tue, 14 Feb 2023 07:19:20 +0000 (15:19 +0800)]
[Coroutines] Don't run optimizations for optnone functions

Currently we will run two optimization (rematerialization and sink
lifetime markers) unconditionally even if the coroutine is marked as
optnone (O0). This looks not good. This patch disables these 2
optimizations for optnone functions. An internal change shows the change
improve the compilation time for 3% in the debug build.

17 months ago[mlir][llvm] Reintroduce string based attribute setting.
Tobias Gysi [Mon, 13 Feb 2023 21:05:01 +0000 (22:05 +0100)]
[mlir][llvm] Reintroduce string based attribute setting.

Reintroduce string based attribute setting in the
translation from LLVM dialect to LLVM IR. The TypeSwitch
based implementation introduced in
https://reviews.llvm.org/D143654  does not work for
intrinsics that set the requiresAccessGroup or
requiresAliasScope flag.

Reviewed By: hgreving

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

17 months ago[PowerPC] Specify the dynamic loader prefix in ppc-float-abi-warning
Tulio Magno Quites Machado Filho [Tue, 14 Feb 2023 07:03:58 +0000 (15:03 +0800)]
[PowerPC] Specify the dynamic loader prefix in ppc-float-abi-warning

Ensure the tests do not fail during cross compilation by specifying
the dynamic loader prefix for a GNU installation that is expected to
support IEEE 128-bit long double.

Reviewed By: qiucf

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

17 months ago[LoopDeletion] Simplify. NFC
Fangrui Song [Tue, 14 Feb 2023 06:49:09 +0000 (22:49 -0800)]
[LoopDeletion] Simplify. NFC

17 months ago[docs] Add document for clang-scan-deps -format=p1689
Chuanqi Xu [Tue, 14 Feb 2023 05:56:32 +0000 (13:56 +0800)]
[docs] Add document for clang-scan-deps -format=p1689

The patches for `clang-scan-deps` have been landed. And we need to
document the behavior then.

17 months ago[OpenMP] Fix extra parenthesis in kmp_os.h
Vadim Paretsky (Intel Americas Inc) [Tue, 14 Feb 2023 05:39:28 +0000 (21:39 -0800)]
[OpenMP] Fix extra parenthesis in kmp_os.h

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

17 months ago[ARM] Use llvm::rotl and llvm::rotr (NFC)
Kazu Hirata [Tue, 14 Feb 2023 05:28:50 +0000 (21:28 -0800)]
[ARM] Use llvm::rotl and llvm::rotr (NFC)

17 months ago[RISCV] Rename InstFormatCSZN->InstFormatCU to match latest Zcb spec. NFC
Craig Topper [Tue, 14 Feb 2023 05:14:03 +0000 (21:14 -0800)]
[RISCV] Rename InstFormatCSZN->InstFormatCU to match latest Zcb spec. NFC

This was updated in version 1.0.2 of the spec. Latest version
https://github.com/riscv/riscv-code-size-reduction/releases/download/v1.0.3/Zc-v1.0.3.pdf

17 months ago[RISCV] Use llvm::rotl (NFC)
Kazu Hirata [Tue, 14 Feb 2023 04:16:48 +0000 (20:16 -0800)]
[RISCV] Use llvm::rotl (NFC)

17 months agoRecommit: [NFC][IR] Make Module::getAliasList() private
Vasileios Porpodas [Tue, 14 Feb 2023 03:19:36 +0000 (19:19 -0800)]
Recommit: [NFC][IR] Make Module::getAliasList() private

This reverts commit 6d4a674acbc56458bb084878d82d16e393d45a6b.

17 months ago[AArch64] Use llvm::rotl and llvm::rotr (NFC)
Kazu Hirata [Tue, 14 Feb 2023 04:07:09 +0000 (20:07 -0800)]
[AArch64] Use llvm::rotl and llvm::rotr (NFC)

17 months ago[bazel] build fix
Aart Bik [Tue, 14 Feb 2023 03:27:55 +0000 (19:27 -0800)]
[bazel] build fix

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

17 months ago[mlir][affine] Normalize constant valued bound loop
Kai Sasaki [Tue, 14 Feb 2023 02:15:07 +0000 (11:15 +0900)]
[mlir][affine] Normalize constant valued bound loop

This change aims to resolve the issue reported in https://github.com/llvm/llvm-project/issues/59994.

After calling AffineForOp#setUpperBound and setLowerBound, it makes the original affine map structure inconsistent. It's necessary to keep the original map to build the new induction vars.

Reviewed By: bondhugula

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

17 months agoRevert "[NFC][IR] Make Module::getAliasList() private"
Vasileios Porpodas [Tue, 14 Feb 2023 03:12:30 +0000 (19:12 -0800)]
Revert "[NFC][IR] Make Module::getAliasList() private"

This reverts commit b64f7d028bdcaf679130afeed9518c09663f6dc8.

17 months agoRevert "[DAGCombiner] handle more store value forwarding"
Arthur Eubanks [Tue, 14 Feb 2023 03:00:32 +0000 (19:00 -0800)]
Revert "[DAGCombiner] handle more store value forwarding"

This reverts commit f35a09daebd0a90daa536432e62a2476f708150d.

Causes miscompiles, see D138899

17 months agoRevert "[DAGCombiner] fix comments for D138899; NFC"
Arthur Eubanks [Tue, 14 Feb 2023 03:00:15 +0000 (19:00 -0800)]
Revert "[DAGCombiner] fix comments for D138899; NFC"

This reverts commit 63854f91d3ee1056796a5ef27753648396cac6ec.

Dependent commit to be reverted.

17 months ago[NFC][IR] Make Module::getAliasList() private
Vasileios Porpodas [Mon, 6 Feb 2023 21:05:01 +0000 (13:05 -0800)]
[NFC][IR] Make Module::getAliasList() private

This patch adds several missing AliasList modifier functions, like
removeAlias(), eraseAlias() and insertAlias().
There is no longer need to access the list directly so it also makes
getAliaList() private.

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

17 months ago[PowerPC][GISel] add support for fpconstant
Chen Zheng [Mon, 12 Dec 2022 09:53:53 +0000 (09:53 +0000)]
[PowerPC][GISel] add support for fpconstant

Reviewed By: arsenm

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

17 months agoRevert "[mlir] Make the vast majority of integration and runner tests work on Windows"
Aart Bik [Tue, 14 Feb 2023 02:19:36 +0000 (18:19 -0800)]
Revert "[mlir] Make the vast majority of integration and runner tests work on Windows"

This reverts commit 161b9d741a3c25f7bd79620598c5a2acf3f0f377.

REASON:

cmake --build . --target check-mlir-integration

Failed Tests (186):
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-addi-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-cmpi-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-compare-results-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-constants-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-max-min-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-muli-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-shli-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-shrsi-i16.mlir
  MLIR :: Integration/Dialect/Arith/CPU/test-wide-int-emulation-shrui-i16.mlir
  MLIR :: Integration/Dialect/Async/CPU/microbench-linalg-async-parallel-for.mlir
  MLIR :: Integration/Dialect/Async/CPU/microbench-scf-async-parallel-for.mlir
  MLIR :: Integration/Dialect/Async/CPU/test-async-parallel-for-1d.mlir
  MLIR :: Integration/Dialect/Async/CPU/test-async-parallel-for-2d.mlir
  MLIR :: Integration/Dialect/Complex/CPU/correctness.mlir
  MLIR :: Integration/Dialect/LLVMIR/CPU/X86/test-inline-asm-vector.mlir
  MLIR :: Integration/Dialect/LLVMIR/CPU/X86/test-inline-asm.mlir
  MLIR :: Integration/Dialect/LLVMIR/CPU/test-vector-reductions-fp.mlir
  MLIR :: Integration/Dialect/LLVMIR/CPU/test-vector-reductions-int.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/matmul-vs-matvec.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/rank-reducing-subview.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-collapse-tensor.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-1d-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-1d-nwc-wcf-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-2d-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-2d-nhwc-hwcf-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-3d-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-conv-3d-ndhwc-dhwcf-call.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-elementwise.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-one-shot-bufferize.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-padtensor.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-subtensor-insert-multiple-uses.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-subtensor-insert.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-tensor-e2e.mlir
  MLIR :: Integration/Dialect/Linalg/CPU/test-tensor-matmul.mlir
  MLIR :: Integration/Dialect/Memref/cast-runtime-verification.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/concatenate.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/dense_output.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/dense_output_bf16.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/dense_output_f16.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_abs.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_binary.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_cast.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_codegen_dim.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_codegen_foreach.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_complex32.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_complex64.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_complex_ops.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_constant_to_sparse_tensor.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conv_1d_nwc_wcf.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conv_2d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conv_2d_nhwc_hwcf.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conv_3d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conv_3d_ndhwc_dhwcf.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conversion.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conversion_dyn.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conversion_ptr.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conversion_sparse2dense.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_conversion_sparse2sparse.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_dot.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_expand.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_file_io.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_filter_conv2d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_foreach_slices.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_index.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_index_dense.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_insert_1d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_insert_2d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_insert_3d.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_matmul.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_matrix_ops.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_out_mult_elt.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_out_reduction.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_pack.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_quantized_matmul.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_re_im.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_reduce_custom.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_reduce_custom_prod.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_reductions.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_reductions_prod.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_reshape.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_rewrite_push_back.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_rewrite_sort.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_rewrite_sort_coo.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sampled_mm_fusion.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_scale.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_scf_nested.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_select.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sign.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sorted_coo.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_storage.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sum_bf16.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sum_c32.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_sum_f16.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_tensor_mul.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_tensor_ops.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_transpose.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_unary.mlir
  MLIR :: Integration/Dialect/SparseTensor/CPU/sparse_vector_ops.mlir
  MLIR :: Integration/Dialect/SparseTensor/python/test_SDDMM.py
  MLIR :: Integration/Dialect/SparseTensor/python/test_SpMM.py
  MLIR :: Integration/Dialect/SparseTensor/python/test_elementwise_add_sparse_output.py
  MLIR :: Integration/Dialect/SparseTensor/python/test_output.py
  MLIR :: Integration/Dialect/SparseTensor/python/test_stress.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_MTTKRP.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_SDDMM.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_SpMM.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_SpMV.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_Tensor.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_scalar_tensor_algebra.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_simple_tensor_algebra.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_tensor_complex.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_tensor_types.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_tensor_unary_ops.py
  MLIR :: Integration/Dialect/SparseTensor/taco/test_true_dense_tensor_algebra.py
  MLIR :: Integration/Dialect/SparseTensor/taco/unit_test_tensor_core.py
  MLIR :: Integration/Dialect/SparseTensor/taco/unit_test_tensor_io.py
  MLIR :: Integration/Dialect/SparseTensor/taco/unit_test_tensor_utils.py
  MLIR :: Integration/Dialect/Standard/CPU/test-ceil-floor-pos-neg.mlir
  MLIR :: Integration/Dialect/Standard/CPU/test_subview.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-mulf-full.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-mulf.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-muli-ext.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-muli-full.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-muli.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-tilezero-block.mlir
  MLIR :: Integration/Dialect/Vector/CPU/AMX/test-tilezero.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-dot.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-inline-asm-vector-avx512.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-mask-compress.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-rsqrt.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-sparse-dot-product.mlir
  MLIR :: Integration/Dialect/Vector/CPU/X86Vector/test-vp2intersect-i32.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-0-d-vectors.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-broadcast.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-compress.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-constant-mask.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-contraction.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-create-mask-v4i1.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-create-mask.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-expand.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-extract-strided-slice.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-flat-transpose-col.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-flat-transpose-row.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-fma.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-gather.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-index-vectors.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-insert-strided-slice.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-maskedload.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-maskedstore.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-matrix-multiply-col.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-matrix-multiply-row.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-outerproduct-f32.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-outerproduct-i64.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-print-int.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-realloc.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-f32-reassoc.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-f32.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-f64-reassoc.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-f64.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-i32.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-i4.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-i64.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-si4.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-reductions-ui4.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-scan.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-scatter.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-shape-cast.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-shuffle.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-sparse-dot-matvec.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-sparse-saxpy-jagged-matvec.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-read-1d.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-read-2d.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-read.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-to-loops.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transfer-write.mlir
  MLIR :: Integration/Dialect/Vector/CPU/test-transpose.mlir

Testing Time: 0.29s
  Unsupported:  31
  Passed     :   5
  Failed     : 186

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

17 months ago[flang] Disable libc++ assertions in the runtime library
Shao-Ce SUN [Mon, 13 Feb 2023 09:41:35 +0000 (17:41 +0800)]
[flang] Disable libc++ assertions in the runtime library

Similar to D143168. Solve compiling error caused by D143612.

Error info:
```
flang-new -flang-experimental-exec hello.f90
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
llvm-project/build/lib/libFortranRuntime.a(unit.cpp.o): in function `std::__1::optional<unsigned long>::operator*[abi:v170000]() &':
unit.cpp:(.text._ZNRSt3__18optionalImEdeB7v170000Ev[_ZNRSt3__18optionalImEdeB7v170000Ev]+0x4f): undefined reference to `std::__1::__libcpp_verbose_abort(char const*, ...)'
/usr/bin/ld: llvm-project/build/lib/libFortranRuntime.a(unit.cpp.o): in function `void std::__1::__optional_storage_base<long, false>::__construct[abi:v170000]<unsigned long>(unsigned long&&)':
unit.cpp:(.text._ZNSt3__123__optional_storage_baseIlLb0EE11__constructB7v170000IJmEEEvDpOT_[_ZNSt3__123__optional_storage_baseIlLb0EE11__constructB7v170000IJmEEEvDpOT_]+0x55): undefined reference to `std::__1::__libcpp_verbose_abort(char const*, ...)'
```

Reviewed By: vzakhari

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

17 months ago[flang] Catch repeated BIND(C) attribute specifications for a symbol
Peter Klausler [Thu, 9 Feb 2023 00:49:10 +0000 (16:49 -0800)]
[flang] Catch repeated BIND(C) attribute specifications for a symbol

A BIND(C) attribute statement or type-declaration-stmt attribute, just
like most attributes, can only appear once.  Name resolution was excluding
the BIND(C) attribute from its check for duplicated attributes, but I
don't see a reason that remains to do so.

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

17 months ago[Clang][RISCV] Guard vector float16 type correctly with semantic analysis
eopXD [Thu, 9 Feb 2023 16:12:02 +0000 (08:12 -0800)]
[Clang][RISCV] Guard vector float16 type correctly with semantic analysis

Before this commit, vector float 16 types (e.g. `vfloat16m1_t`) of RVV
is only defined when extension `zvfh` is defined. However this
generate inaccurate diagnostics like:

```
error: unknown type name 'vfloat16m1_t'
```

This commit improves the compiler by guarding type check correctly
under semantic analysis.

Reviewed By: craig.topper

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

17 months ago[mlir][NFC] Remove unused variable 'indexType' in GPUTransformOps.cpp
Jie Fu [Tue, 14 Feb 2023 01:48:09 +0000 (09:48 +0800)]
[mlir][NFC] Remove unused variable 'indexType' in GPUTransformOps.cpp

/data/jiefu/llvm-project/mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp:430:13: error: unused variable 'indexType' [-Werror,-Wunused-variable]
  IndexType indexType = rewriter.getIndexType();
            ^
1 error generated.

17 months ago[mlir][gpu] NFC change to pass threadID ops to rewriteOneForeachThreadToGpuThreads
Thomas Raoux [Tue, 14 Feb 2023 01:14:37 +0000 (01:14 +0000)]
[mlir][gpu] NFC change to pass threadID ops to rewriteOneForeachThreadToGpuThreads

This allows user to give both the thread ids and dimension of the threads we want to distribute on.
This means we can use it to distribute on warps as well.

Reviewed By: harsh

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

17 months ago[flang] Check for invalid BIND(C) names
Peter Klausler [Thu, 9 Feb 2023 00:28:08 +0000 (16:28 -0800)]
[flang] Check for invalid BIND(C) names

Require BIND(C) interoperable names to be valid C identifiers.

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

17 months ago[flang] Check for non-interoperable intrinsic types in BIND(C) derived types
Peter Klausler [Wed, 8 Feb 2023 23:30:07 +0000 (15:30 -0800)]
[flang] Check for non-interoperable intrinsic types in BIND(C) derived types

Every component of a BIND(C) interoperable derived type must have an
interoperable type.  Semantics was checking components with derived types,
but not components with intrinsic types.

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

17 months ago[libc++][NFC] Remove duplicated line from `Cxx20Issues.csv`
Adrian Vogelsgesang [Tue, 14 Feb 2023 00:33:21 +0000 (16:33 -0800)]
[libc++][NFC] Remove duplicated line from `Cxx20Issues.csv`

17 months ago[flang] Pointers returned from functions are not definable as pointers
Peter Klausler [Wed, 8 Feb 2023 21:31:25 +0000 (13:31 -0800)]
[flang] Pointers returned from functions are not definable as pointers

A reference to a pointer-valued function is a "variable" in the argot of
the Fortran standard, and can be the left-hand side of an assignment
statement or passed as a definable actual argument -- but it is not a
definable pointer, and cannot be associated with a pointer dummy argument
that is not INTENT(IN).

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

17 months ago[flang] Respect inaccessibility of type-bound ASSIGNMENT(=)
Peter Klausler [Wed, 8 Feb 2023 18:44:20 +0000 (10:44 -0800)]
[flang] Respect inaccessibility of type-bound ASSIGNMENT(=)

When a derived type has a PRIVATE type-bound generic binding for
a defined ASSIGNMENT(=), don't use it in scopes outside of the
module that defines the type.  We already get this case right
for other type-bound generics, including defined operators,
and for non-type-bound generic interfaces, but the check was
not applied for this case.

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

17 months agoRevert "[lldb] Use portable format string PRIx64"
Pranav Kant [Mon, 13 Feb 2023 23:42:57 +0000 (15:42 -0800)]
Revert "[lldb] Use portable format string PRIx64"

This reverts commit be7d7ca1101840fc8e19e0e48f9dc395da569d23.

This commit was made to fix be7d7ca1101840fc8e19e0e48f9dc395da569d23
which got reverted in 620b3d9ba3343d7bc5bab2340174a20952fcd00f. We need
to revert this commit as well because types in log statements are 32 bit again.