Commit Graph

435583 Commits

Author SHA1 Message Date
Nicolas Vasilache 1a6ffd7781 [mlir][vector] NFC - Add rewriter.notifyMatchFailure messages for better debugging
Add rewriter.notifyMatchFailure messages for better debugging

Differential Revision: https://reviews.llvm.org/D133532
2022-09-08 15:02:56 -07:00
Fabian Parzefall 4fdbe9853c [BOLT] Introduce SplitStrategy ABC
This introduces an abstract base class for splitting strategies to
document the interface a strategy needs to implement, and also to avoid
code bloat of the `splitFunction` method.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D132054
2022-09-08 14:59:18 -07:00
Zequan Wu 32530e0493 [LLDB][NativePDB] Set block address range.
The block address range was missing before.

Differential Revision: https://reviews.llvm.org/D133461
2022-09-08 14:51:47 -07:00
Jakub Kuderski 5e5937d057 [mlir][func] Remove unnecessary link dependencies for MLIRFuncTransforms
This is so that FuncTransforms can be used by other dialects without introducing cyclic dependencies.

Tested by building with `BUILD_SHARED_LIBS=ON`

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133527
2022-09-08 17:35:22 -04:00
rdzhabarov b3999fd261 Fix bazel deps. 2022-09-08 21:21:20 +00:00
Jonathan Peyton e5ac98fa01 [OpenMP][libomp] Cleanup __kmpc_flush() code
Have it be simple KMP_MFENCE() which incorporates x86-specific logic and
reduces to KMP_MB() for other architectures.

Differential Revision: https://reviews.llvm.org/D130928
2022-09-08 16:17:20 -05:00
Vitaly Buka 1cf5c7fe8c [msan] Disambiguate warnings debug location
If multiple warnings created on the same instruction (debug location)
it can be difficult to figure out which input value is the cause.

This patches chains origins just before the warning using last origins
update debug information.

To avoid inflating the binary unnecessarily, do this only when uncertainty is
high enough, 3 warnings by default. On average it adds 0.4% to the
.text size.

Reviewed By: kda, fmayer

Differential Revision: https://reviews.llvm.org/D133232
2022-09-08 14:17:07 -07:00
bixia1 8a583bd53d [mlir][sparse] Add codegen for expand op.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D133454
2022-09-08 14:06:01 -07:00
Vitaly Buka 0f2f1c2be1 [sanitizers] Invalidate GlobalsAA
GlobalsAA is considered stateless as usually transformations do not introduce
new global accesses, and removed global access is not a problem for GlobalsAA
users.
Sanitizers introduce new global accesses:
 - Msan and Dfsan tracks origins and parameters with TLS, and to store stack origins.
  - Sancov uses global counters. HWAsan store tag state in TLS.
  - Asan modifies globals, but I am not sure if invalidation is required.

I see no evidence that TSan needs invalidation.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D133394
2022-09-08 14:00:43 -07:00
Fangrui Song 2f23dc9127 [AST/Interp] Fix left shift overflow bug in D64146
Noticed by Dmitri Gribenko
2022-09-08 13:49:07 -07:00
Fangrui Song 49c289879c [AST/Interp] Fix latent unitialized use of memory bug in D64146
Exposed by D132727: clang/test/AST/Interp/arrays.cpp fails with --config=msan
2022-09-08 13:39:30 -07:00
Tom Honermann 8d03328e7b [clang] NFC: Add a missing const qualifier to Decl::isLocalExternDecl(). 2022-09-08 13:21:10 -07:00
Joe Loser 47b76631e7 [lldb] Use std::size instead of llvm::array_lengthof
LLVM contains a helpful function for getting the size of a C-style
array: `llvm::array_lengthof`. This is useful prior to C++17, but not as
helpful for C++17 or later: `std::size` already has support for C-style
arrays.

Change call sites to use `std::size` instead.

Differential Revision: https://reviews.llvm.org/D133501
2022-09-08 14:21:55 -06:00
Emilio Cota e413eb6cf8 [mlir] ConvertAsyncToLLVM: add missing dependence on async dialect
Differential Revision: https://reviews.llvm.org/D133516
2022-09-08 16:17:34 -04:00
Diego Caballero b9cfb6f7e0 [mlir][tosa] Add apply scale flags to TosaToArith creation API
TosaToArith has two flags to enable/disable 'tosa.apply_scale' ops and
to use a 64-bit/32-bit implementation for it. This patch makes the flags
available from the pass creation API.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D133515
2022-09-08 20:11:47 +00:00
Aart Bik dc46d5c979 [mlir][sparse] improve dimop rewriting during conversion
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D133512
2022-09-08 13:04:28 -07:00
Dominic Chen ac77b3fde1 [clang][ARM][NFC] Clean up signed conversion and undefined macros in builtin header
These warnings were identified while debugging modules with Wsystem-headers.

Differential Revision: https://reviews.llvm.org/D132003
2022-09-08 12:46:08 -07:00
Craig Topper 5f3a8b585b [RISCV] Add RecurKind::FMulAdd to isLegalToVectorizeReduction for scalable vectors.
Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D133511
2022-09-08 12:34:59 -07:00
Jakub Kuderski 45b5e8abe5 Revert "[mlir][arith] Attempt to fix shared libs build for EmulateWideInt"
This reverts commit 4902c3b7f8.

Revert "[mlir][arith] Add wide integer emulation pass"

This reverts commit fa8eb27088.

Revert https://reviews.llvm.org/D133135 due to link errors with shared
libs on.
2022-09-08 15:32:18 -04:00
Philip Reames be442d2f12 [docs][RISCV] Document experimental extensions
This adds a description of the currently existing experimental extensions. I took all information about versions and specifications from either the original commits, or current code. I'm not terribly familiar with any of these, so double checking my facts is much appreciated.

Differential Revision: https://reviews.llvm.org/D133214
2022-09-08 12:26:16 -07:00
Mircea Trofin a219a8a822 [mlgo][nfc] Set logging level to warning or higher for TFLite 2022-09-08 12:10:56 -07:00
Jakub Kuderski 4902c3b7f8 [mlir][arith] Attempt to fix shared libs build for EmulateWideInt
Add missing CMake dependencies.

Original change: https://reviews.llvm.org/D133135
2022-09-08 15:02:55 -04:00
David Green 3875c38adf [AArch64] Fix formatting of the Shuffle Cost tables. NFC 2022-09-08 19:54:12 +01:00
Quentin Colombet e833fdcd05 [mlir] Add missing dependency in bazel build
The MemRefTransform library now depends on ArithmeticUtils because
of the newly added SimplifyExtractStridedMetadata pass.
2022-09-08 18:51:14 +00:00
Felipe de Azevedo Piovezan 9a41f6e708 Revert "[lldb] Use just-built libcxx for tests when available"
This reverts commit c38eeecbc7.
2022-09-08 14:38:08 -04:00
River Riddle b69f10f5a1 [mlir][PDL] Infer result types from a `replace` as the last resort
This prevents situations where explicit results types were provided,
which have different types than the operation being replaced. This
is useful for supporting dialect conversion, which will have proper
support added in a followup.

Differential Revision: https://reviews.llvm.org/D133141
2022-09-08 11:35:31 -07:00
Paul Robinson f92c1726de Make llvm-tli-checker support static libraries
The original implementation assumed dynamic libraries and so looked
only at the dynamic symbol table.  Use the regular symbol table for
ET_REL files.

Differential Revision: https://reviews.llvm.org/D133448
2022-09-08 11:10:26 -07:00
Jakub Kuderski fa8eb27088 [mlir][arith] Add wide integer emulation pass
In this first patch in a series to add wide integer emulation:
*  Set up the initial pass structure
*  Add a custom type converter
*  Handle func ops

The initial implementation supports power-of-two integers types only. We
emulate wide integer operations by splitting original i2N integer types
into two iN halves

My immediate use case is to emulate i64 operations using i32 ones
on mobile GPUs that do not support i64.

Reviewed By: antiagainst, Mogball

Differential Revision: https://reviews.llvm.org/D133135
2022-09-08 13:51:01 -04:00
Felipe de Azevedo Piovezan c38eeecbc7 [lldb] Use just-built libcxx for tests when available
This commit improves upon cc0b5ebf7f, which added support for
specifying which libcxx to use when testing LLDB. That patch honored
requests by tests that had `USE_LIBCPP=1` defined in their makefiles.
Now, we also use a non-default libcxx if all conditions below are true:

1. The test is not explicitly requesting the use of libstdcpp
(USE_LIBSTDCPP=1).
2. The test is not explicitly requesting the use of the system's
library (USE_SYSTEM_STDLIB=1).
3. A path to libcxx was either provided by the user through CMake flags
or libcxx was built together with LLDB.

Condition (2) is new and introduced in this patch in order to support
tests that are either:

* Cross-platform (such as API/macosx/macCatalyst and
API/tools/lldb-server). The just-built libcxx is usually not built for
platforms other than the host's.
* Cross-language (such as API/lang/objc/exceptions). In this case, the
Objective C runtime throws an exceptions that always goes through the
system's libcxx, instead of the just built libcxx. Fixing this would
require either changing the install-name of the just built libcxx in Mac
systems, or tuning the DYLD_LIBRARY_PATH variable at runtime.

Some other tests exposes limitations of LLDB when running with a debug
standard library. TestDbgInfoContentForwardLists had an assertion
removed, as it was checking for buggy LLDB behavior (which now
crashes). TestFixIts had a variable renamed, as the old name clashes
with a standard library name when debug info is present. This is a known
issue: https://github.com/llvm/llvm-project/issues/34391.

For `TestSBModule`, the way the "main" module is found was changed to
look for the "a.out" module, instead of relying on the index being 0. In
some systems, the index 0 is dyld when a custom standard library is
used.

Differential Revision: https://reviews.llvm.org/D132940
2022-09-08 13:42:56 -04:00
Zequan Wu 9b825dcdb2 [LLDB][NativePDB] Fix PdbAstBuilder::GetParentDeclContext when ICF happens.
Removed `GetParentDeclContextForSymbol` as this is not necesssary. We can get
the demangled names from CVSymbol and then using it to create tag decl or
namespace decl. This also fixed a bug when icf applied.

Differential Revision: https://reviews.llvm.org/D133243
2022-09-08 10:42:12 -07:00
Filipp Zhinkin c4d0509e3b [ARM] Add tests on instructions fusion with comparison with zero; NFC
Baseline tests for D131786
2022-09-08 20:24:32 +03:00
Matheus Izvekov 16e5d6d7f9
[clang] extend getCommonSugaredType to merge sugar nodes
This continues D111283 by extending the getCommonSugaredType
implementation to also merge non-canonical type nodes.

We merge these nodes by going up starting from the canonical
node, calculating their merged properties on the way.

If we reach a pair that is too different, or which we could not
otherwise unify, we bail out and don't try to keep going on to
the next pair, in effect striping out all the remaining top-level
sugar nodes. This avoids mismatching 'companion' nodes, such as
ElaboratedType, so that they don't end up elaborating some other
unrelated thing.

Depends on D111509

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D130308
2022-09-08 19:17:53 +02:00
Matheus Izvekov d42122cd5d
[clang] use getCommonSugar in an assortment of places
For this patch, a simple search was performed for patterns where there are
two types (usually an LHS and an RHS) which are structurally the same, and there
is some result type which is resolved as either one of them (typically LHS for
consistency).

We change those cases to resolve as the common sugared type between those two,
utilizing the new infrastructure created for this purpose.

Depends on D111283

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D111509
2022-09-08 19:17:53 +02:00
Matheus Izvekov d200db3863
[clang] template / auto deduction deduces common sugar
After upgrading the type deduction machinery to retain type sugar in
D110216, we were left with a situation where there is no general
well behaved mechanism in Clang to unify the type sugar of multiple
deductions of the same type parameter.

So we ended up making an arbitrary choice: keep the sugar of the first
deduction, ignore subsequent ones.

In general, we already had this problem, but in a smaller scale.
The result of the conditional operator and many other binary ops
could benefit from such a mechanism.

This patch implements such a type sugar unification mechanism.

The basics:

This patch introduces a `getCommonSugaredType(QualType X, QualType Y)`
method to ASTContext which implements this functionality, and uses it
for unifying the results of type deduction and return type deduction.
This will return the most derived type sugar which occurs in both X and
Y.

Example:

Suppose we have these types:
```
using Animal = int;
using Cat = Animal;
using Dog = Animal;

using Tom = Cat;
using Spike = Dog;
using Tyke = Dog;
```
For `X = Tom, Y = Spike`, this will result in `Animal`.
For `X = Spike, Y = Tyke`, this will result in `Dog`.

How it works:

We take two types, X and Y, which we wish to unify as input.
These types must have the same (qualified or unqualified) canonical
type.

We dive down fast through top-level type sugar nodes, to the
underlying canonical node. If these canonical nodes differ, we
build a common one out of the two, unifying any sugar they had.
Note that this might involve a recursive call to unify any children
of those. We then return that canonical node, handling any qualifiers.

If they don't differ, we walk up the list of sugar type nodes we dived
through, finding the last identical pair, and returning that as the
result, again handling qualifiers.

Note that this patch will not unify sugar nodes if they are not
identical already. We will simply strip off top-level sugar nodes that
differ between X and Y. This sugar node unification will instead be
implemented in a subsequent patch.

This patch also implements a few users of this mechanism:
* Template argument deduction.
* Auto deduction, for functions returning auto / decltype(auto), with
  special handling for initializer_list as well.

Further users will be implemented in a subsequent patch.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Differential Revision: https://reviews.llvm.org/D111283
2022-09-08 19:17:48 +02:00
Alan Zhao b34006dd0a [lld][COFF] Add support for overriding weak symbols in LLVM bitcode input
LLVM bitcode contains support for weak symbols, so we can add support
for overriding weak symbols in the output COFF even though COFF doesn't
have inherent support for weak symbols.

The motivation for this patch is that Chromium is trying to use libc++'s
assertion handler mechanism, which relies on weak symbols [0], but we're
unable to perform a ThinLTO build on Windows due to this problem [1].

[0]: https://reviews.llvm.org/D121478
[1]: https://crrev.com/c/3863576

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D133165
2022-09-08 13:17:02 -04:00
Quentin Colombet 63a2536f77 [mlir][MemRef] Simplify extract_strided_metadata(subview)
Add a dedicated pass to simplify
extract_strided_metadata(other_op(memref)).

Currently the pass features only one pattern:
extract_strided_metadata(subview).
The goal is to get rid of the subview while materializing its effects on
the offset, sizes, and strides with respect to the base object.

In other words, this simplification replaces:
```
baseBuffer, offset, sizes, strides =
    extract_strided_metadata(
        subview(memref, subOffset, subSizes, subStrides))
```

With

```
baseBuffer, baseOffset, baseSizes, baseStrides =
    extract_strided_metadata(memref)
strides#i = baseStrides#i * subSizes#i
offset = baseOffset + sum(subOffset#i * strides#i)
sizes = subSizes
```

Differential Revision: https://reviews.llvm.org/D133166
2022-09-08 17:10:02 +00:00
Peiming Liu de883be1f0 [mlir][bufferization] fix typo in example code for bufferization.alloc_tensor
See BufferizationOps.cpp:408, the dynamic sizes are enclosed by "()" not "[]"

https://github.com/llvm/llvm-project/blob/main/mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp#L408

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D133505
2022-09-08 17:07:45 +00:00
V Donaldson 78c40b3c53 [flang] Control flow with empty select case blocks
Fix control flow for empty select case blocks such as:

  select case (2)
    case (1)
      print*, '1'
    case (2)
    ! print*, '2'
    case default
      print*, 'default'
  end select
2022-09-08 10:07:07 -07:00
natashaknk 87a6ccf094 [mlir][tosa] Add dynamic width/height for pooling in tosa to linalg
Needed to support dynamic width/height for pooling inputs using
the similar convolution work.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D133389
2022-09-08 09:50:09 -07:00
raghavmedicherla 5d3cf8267f Revert "Support: Add mapped_file_region::sync(), equivalent to msync"
This reverts commit 142f51fc2f.

This shouldn't be committed, it got committed accidentally.
2022-09-08 12:49:52 -04:00
Mathieu Fehr a8c647dbe6 [mlir][NFC] Provide accessor for TableGen record
Constraint and Predicate classes did not expose their underlying
tablegen records. This means that for Constraints, it is not possible
to get the underlying base constraint of a variadic constraint.
For Predicate, it is not possible to get the predicates forming an
`Or` predicate for instance.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D133264
2022-09-08 09:47:20 -07:00
Sanjay Patel 444f08c832 [InstCombine] fold icmp of truncated left shift, part 2
(trunc (1 << Y) to iN) == 2**C --> Y == C
(trunc (1 << Y) to iN) != 2**C --> Y != C
https://alive2.llvm.org/ce/z/xnFPo5

Follow-up to d9e1f9d759. This was a suggested
enhancement mentioned in issue #51889.
2022-09-08 12:44:02 -04:00
Katherine Rasmussen 2944f8ef04 [flang] Add co_sum to the list of intrinsics and update test
Add the collective subroutine, co_sum, to the list of intrinsics.
In accordance with 16.9.50 and 16.9.137, add a check for and an
error if coindexed objects are being passed to certain arguments
in co_sum and in move_alloc. Add a semantics test to check that
this error is successfully caught in calls to move_alloc. Remove
the XFAIL directive, update the ERROR directives and add
standard-conforming and non-standard conforming calls in the
semantics test for co_sum.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D114134
2022-09-08 09:38:24 -07:00
Kadir Cetinkaya 71c4fb1d64
[clangd] Set Incompleteness for spec fuzzyfind requests
Differential Revision: https://reviews.llvm.org/D133479
2022-09-08 18:34:25 +02:00
Fangrui Song b090ef9e4f [test] Fix compress-debug-sections-zlib-unavailable.s 2022-09-08 09:32:13 -07:00
Kadir Cetinkaya abd2b1a9d0
[clang] Fix a crash in constant evaluation 2022-09-08 18:21:44 +02:00
Philip Reames 4c4c0d2c06 [LV] Use safe-divisor lowering for fixed vectors if profitable
This extends the safe-divisor widening scheme recently added for scalable vectors to handle fixed vectors as well.

Differential Revision: https://reviews.llvm.org/D132591
2022-09-08 09:15:54 -07:00
Jonas Paulsson 906ea59d00 [SystemZ] Fix new test case
Add 'REQUIRES: systemz-registered-target'.
2022-09-08 18:05:17 +02:00
Zain Jaffal 04548e82ed
[AArch64] Add test for vscale nontemporal loads larger than 256.
Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D133498
2022-09-08 17:03:44 +01:00
Mark de Wever 3695cf2065 [libc++] Removes Clang 13 support.
Reviewed By: #libc, ldionne, jloser

Differential Revision: https://reviews.llvm.org/D133435
2022-09-08 17:51:52 +02:00