Commit Graph

438318 Commits

Author SHA1 Message Date
Petr Hosek 849059861c [CMake] Provide Findzstd module
This module is used to find the system zstd library. The imported
targets intentionally use the same name as the generate zstd config
CMake file so these can be used interchangeably.

Differential Revision: https://reviews.llvm.org/D134990
2022-10-06 08:22:51 +00:00
Nikita Popov 3d0b5f019e [AA] Remove unused template argument from AAResultBase (NFC)
After D94363, there is no more need to use CRTP here.
2022-10-06 10:21:17 +02:00
Pierrick Bouvier 86e23c4e1f Detect Visual Studio in Windows packaging script
Instead of hardcoding a specific VS install, try sequentially:

- %VSINSTALLDIR% (already set from a vs prompt)
- 2019/Enterprise
- 2019/Professional
- 2019/Community
- 2019/BuildTools

It stops when one is found and set vsdevcmd env var.

Differential revision: https://reviews.llvm.org/D135173
2022-10-06 10:18:58 +02:00
Haojian Wu df61bb271a [SourceManager] Improve getFileIDLoaded.
Similar to getFileIDLocal patch, but for the version for load module.

Test with clangd (building AST with preamble), FileID scans in binary
search is reduced:

SemaExpr.cpp: 142K -> 137K (-3%)
FindTarget.cpp: 368K -> 343K (-6%)

Differential Revision: https://reviews.llvm.org/D135258
2022-10-06 10:15:09 +02:00
Florian Hahn e09b0589a9
[ConstraintElimination] Extend test coverage for AND chains. 2022-10-06 09:11:08 +01:00
Nikita Popov c5bf452022 [AA] Pass AAResults through AAQueryInfo
Currently, AAResultBase (from which alias analysis providers inherit)
stores a reference back to the AAResults aggregation it is part of,
so it can perform recursive alias analysis queries via
getBestAAResults().

This patch removes the back-reference from AAResultBase to AAResults,
and instead passes the used aggregation through the AAQueryInfo.
This can be used to perform recursive AA queries using the full
aggregation.

Differential Revision: https://reviews.llvm.org/D94363
2022-10-06 10:10:19 +02:00
Kadir Cetinkaya d1f13c54f1
[clang][Tooling] Move STL recognizer to its own library
As pointed out in https://reviews.llvm.org/D119130#3829816, this
introduces a clang AST dependency to the clangToolingInclusions, which is used
by clang-format.

Since rest of the inclusion tooling doesn't depend on clang ast, moving this
into a separate library.

Differential Revision: https://reviews.llvm.org/D135245
2022-10-06 10:09:13 +02:00
Nikita Popov 6053b37e45 [AA] Thread AAQI through getModRefBehavior() (NFC)
This is in preparation for D94363, as we will need AAQI to
perform the recursive call to the function variant.
2022-10-06 09:57:42 +02:00
Nikita Popov d785a8eaa2 [clang] Remove CLANG_ENABLE_OPAQUE_POINTERS cmake option
Remove the ability to disable opaque pointers by default in clang.
It is still possible to explicitly disable them via cc1
-no-opaque-pointers.

Differential Revision: https://reviews.llvm.org/D135259
2022-10-06 09:46:04 +02:00
Florian Hahn cceb8c068d
[ConstraintElimination] Extend test coverage for OR chains. 2022-10-06 08:39:11 +01:00
Pierre van Houtryve 3ec0085c3f [DAG] Update `isKnownNeverNaN` for `FMA/FMAD`
We can still get a NaN even if none of the operands are NaN,
e.g. from +inf/-inf. D50804 didn't catch that.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D134854
2022-10-06 06:52:36 +00:00
Florian Hahn 7449570ff7
[ConstraintElimination] Use ConstraintTy::IsSigned instead of Predicate.
This should be NFC and ensure the sign of the constraint is used
consistently in the future.
2022-10-06 07:51:49 +01:00
Pierre van Houtryve bb71079e30 [AMDGPU][GISel] Add missing V2S16 BUILD_VECTOR_TRUNC legalization
Previously we would be unable to legalize V2S16 BUILD_VECTOR_TRUNC on GFX8 & below as the custom legalization was missing.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D135149
2022-10-06 06:48:53 +00:00
Alex Brachet a672b7a7d7 [InstrProf] Make __llvm_profile_counter_bias_default hidden
This symbol shouldn't have default visibility.

Differential Revision: https://reviews.llvm.org/D135346
2022-10-06 06:16:22 +00:00
Matthias Springer 6cdd34b973 [mlir][tensor][bufferize] Bufferize inserts into equivalent tensors in-place
Inserting a tensor into an equivalent tensor is a no-op after bufferization. No alloc is needed.

Differential Revision: https://reviews.llvm.org/D132662
2022-10-06 15:06:33 +09:00
Alex Brachet b423f4cc83 Fix d5090cd94, MSVC mangling issue
Evidently * and [] are mangled differently by MSVC...
2022-10-06 05:24:45 +00:00
Alex Brachet d5090cd94a [llvm-driver] Add various tools to the llvm-driver
The llvm-driver, enabled with LLVM_TOOL_LLVM_DRIVER_BUILD combines many llvm executables
into one to save overall toolchain size. This patch adds a few more llvm tools to the
llvm-driver.

Differential Revision: https://reviews.llvm.org/D135281
2022-10-06 05:16:13 +00:00
owenca 7cbc920669 [clang-format][NFC] Clean up class HeaderIncludes and Format.cpp
Differential Revision: https://reviews.llvm.org/D134852
2022-10-05 21:54:40 -07:00
Aart Bik 80902b72ef [mlir][bazel] fix VectorToGPU bazel breakage
NOTE: this is probably not the long term organization
      that you want to keep after the refactoring to new
      directories, but this fixes the breakage for now;
      I leave proper refactoring of build to the NVGPU
      bazel team.

Differential Revision: https://reviews.llvm.org/D135344
2022-10-05 21:12:01 -07:00
Christopher Bate ea2ed80e6d [mlir][nvgpu] NFC - move NVGPU conversion helpers to NvGpu utils library
The ConvertVectorToGpu pass implementation contained a small private
support library for performing various calculations during conversion
between `vector` and `nvgpu.mma.sync` and `nvgpu.ldmatrix` operations.
The support library is moved under `Dialect/NVGPU/Utils` because the
functions have wider utility. Some documentation comments are added or
improved.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D135303
2022-10-05 20:21:27 -06:00
Peiming Liu 01dffc5ae8 [mlir][sparse] Favors defined dimension when optimize lattice points.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135337
2022-10-06 01:16:30 +00:00
wren romano 794d347988 [mlir][sparse] Fixing bug in python test
This is a followup to D135004, to correct one of the tests that didn't get caught by the buildbot.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135336
2022-10-05 18:06:22 -07:00
Ilia Diachkov 25ee36c6b1 [SPIRV] read kernel arg attributes from fuction/module metadata
The patch introduces reading the attributes of kernel arguments both from
function-attached and module-level metadata, during kernel arguments lowering.
Two tests are added to show the improvement.

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

Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey.tretyakov@mail.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
2022-10-06 04:43:52 +03:00
wren romano 933fefb6a8 [mlir][sparse] Adjusting DimLevelType numeric values for faster predicates
This differential adjusts the numeric values for DimLevelType values: using the low-order two bits for recording the "No" and "Nu" properties, and the high-order bits for the formats per se.  (The choice of encoding may seem a bit peculiar, since the bits are mapped to negative properties rather than positive properties.  But this was done in order to preserve the collation order of DimLevelType values.  If we don't care about collation order, then we may prefer to flip the semantics of the property bits, so that they're less surprising to readers.)

Using distinguished bits for the properties and formats enables faster implementation for the predicates detecting those properties/formats, which matters because this is in the runtime library itself (rather than on the codegen side of things).  This differential pushes through the changes to the enum values, and optimizes the basic predicates.  However it does not optimize all the places where we check compound predicates (e.g., "is compressed or singleton"), to help reduce rebasing conflict with D134933.  Those optimizations will be done after this differential and D134933 are landed.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D135004
2022-10-05 17:40:38 -07:00
Carl Ritson c316332e17 [Sink] Allow sinking of invariant loads across critical edges
Invariant loads can always be sunk.

Reviewed By: foad, arsenm

Differential Revision: https://reviews.llvm.org/D135133
2022-10-06 09:21:12 +09:00
Murali Vijayaraghavan 9c3d3eeb51 [mlir] vector.multi_reduction canonicalizes to vector.shape_cast (or
vector.extract, if the result is a scalar) only if all reduction
dimensions are of size 1.

Differential Revision: https://reviews.llvm.org/D135333
2022-10-06 00:11:31 +00:00
Daniel Rodríguez Troitiño 1a5116794d [NFC] Fix typo in error message.
Fix typo in error message. No other changes

Differential Revision: https://reviews.llvm.org/D135318
2022-10-05 17:09:13 -07:00
Yaxun (Sam) Liu 844b84af20 [clang-offload-bundler] extracting compatible bundle entry
In HIP a library is usually compiled with default target ID e.g. gfx906 so that
it can be used in all GPU configurations. The bitcode is saved in bundled
bitcode with gfx906 in entry ID.

In runtime compilation, a HIP program is compiled with a target ID matching
the GPU configuration, e.g. gfx906:xnack-. This program needs to link with
a library bundled bitcode with target ID gfx906.

For example:

  clang --offload-arch=gfx906 -o lib.o lib.hip
  clang --offload-arch=gfx906:xnack- program.hip lib.o

This common use case requires that clang-offlod-bundler to be able to extract
entry with compatible target ID, e.g. extracting an gfx906 entry when requesting
gfx906:xnack-.

Currently clang-offload-bundler only allow extracting entry with exact match
of target ID. This patch relaxes that so that it can extract entries with compatible
target ID.

Reviewed by: Artem Belevich, Saiyedul Islam

Differential Revision: https://reviews.llvm.org/D134546
2022-10-05 19:44:38 -04:00
Dominic Chen 8f10d204d1 Revert "[libc] Resolve NaN/implementation-defined behavior of floating-point tests"
This reverts commit 5470b1fcb5.
2022-10-05 16:33:32 -07:00
Rob Suderman bba48dfe4a [mlir][tosa] tosa.resize canonicalizer for trivial noop
If the scaling factor is by 1 with no offset or border, then the
resize is a no-op.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D135329
2022-10-05 16:28:25 -07:00
Dominic Chen 5470b1fcb5 [libc] Resolve NaN/implementation-defined behavior of floating-point tests
Differential Revision: https://reviews.llvm.org/D134917
2022-10-05 16:23:19 -07:00
wren romano 1b27484a49 [mlir][sparse] further implement singleton dimension level type
Handle more cases of singleton DLT including direct sparse2sparse conversion.  (Followup to D134096)

Depends On D134926

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D134933
2022-10-05 16:14:52 -07:00
Ben Langmuir 074fcec1ea [clang][deps] Canonicalize module map path
When dep-scanning, canonicalize the module map path as much as we can.
This avoids unnecessarily needing to build multiple versions of a module
due to symlinks or case-insensitive file paths.

Despite the name `tryGetRealPathName`, the previous implementation did
not actually return the realpath most of the time, and indeed it would
be incorrect to do so since the realpath could be outside the module
directory, which would have broken finding headers relative to the
module.

Instead, use a canonicalization that is specific to the needs of
modulemap files (canonicalize the directory separately from the
filename).

Differential Revision: https://reviews.llvm.org/D134923
2022-10-05 15:42:38 -07:00
Nathaniel McVicar ff7a2b6055 [mlir][sparse] Case coverage fix no errorhandling
Restores the fix from D134925 for MSVC without breaking cpu runner.

Differential Revision: https://reviews.llvm.org/D135304
2022-10-05 15:35:00 -07:00
Sami Tolvanen 43f4c215a1 [AArch64][KCFI] Define Size for KCFI_CHECK
Specify the correct size for the KCFI_CHECK pseudo
instruction, which is lowered into six 4-byte instructions in
AArch64AsmPrinter::LowerKCFI_CHECK.

Link: https://github.com/ClangBuiltLinux/linux/issues/1730
2022-10-05 22:24:50 +00:00
Matthias Braun a946eb160a ReduceOperands: Do not crash on vector of pointer types
Avoid crash in `reduceOperandsOneDeltaPass` function for operands with
vector of pointer type.

While on it add a `reduce-operands-ptr.ll` test in the spirit of the
existing `reduce-operands-int.ll`/`reduce-operands-fp.ll` tests.

Differential Revision: https://reviews.llvm.org/D135307
2022-10-05 15:04:32 -07:00
Aart Bik 779dcd2ecc [mlir][sparse] move sparse tensor rewriting into its own pass
Makes individual testing and debugging easier.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D135319
2022-10-05 14:52:55 -07:00
Murali Vijayaraghavan 617ca92bf1 Revert "Added canonicalization for vector.multi_reduction"
This reverts commit c16f3260a9.

There's a bug in the commit creates a scalar result with `ShapeCastOp`.
Reverting till that fix is done.
2022-10-05 21:43:51 +00:00
Quentin Colombet 6e440ee2aa [RISCV][ISel] Finally fix the UBSan error
Forgot another SDValue check and a boolean initialization.
2022-10-05 21:43:09 +00:00
Valentin Clement 91dd872ea6
[flang] Keep current polymorphic implementation under a flag
It is useful for couple of test suite like NAG to keep failing
with a TODO until the polymorphic entities is implemented  all the
way done to codegen.

This pass adds a flag to LoweringOptions for experimental development.
This flag is off by default and can be enable in `bbc` with `-polymorphic-type`.
Options can be added in the driver and tco when needed.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D135283
2022-10-05 23:05:28 +02:00
Sam McCall 60b4b39f5a [clangd] Avoid lexicographic compare when sorting SymbolIDs. NFC
These are 8 bytes and we don't care about the actual ordering, so use
integer compare.

The array generated code has some extra byte swaps (clang), calls memcmp (gcc)
or inlines a big chain of comparisons (MSVC): https://godbolt.org/z/e79r6jM6K
2022-10-05 23:02:28 +02:00
Quentin Colombet 6bbe7d376e [RISCV][ISel] Attempt to fix UBSan error
Explicitly check an SDValue with the invalid SDValue.

UBSan reports:
runtime error: load of value 36, which is not a valid value for type
'bool'

https://lab.llvm.org/buildbot/#/builders/85/builds/11231
2022-10-05 20:59:28 +00:00
Quentin Colombet c5c2de287e [RISCV][ISel] Fold extensions when all the users can consume them
This patch allows the combines that fold extensions in binary operations
to have more than one use.
The approach here is pretty conservative: if all the users of an
extension can fold the extension, then the folding is done, otherwise we
don't fold.
This is the first step towards avoiding the one-use limitation.

As a result, we make a decision to fold/don't fold for a web of
instructions. An instruction is part of the web of instructions as soon
as it consumes an extension that needs to be folded for all its users.

Because of how SDISel works a web of instructions can be visited over
and over. More precisely, if the folding happens, it happens for the
whole web and that's the end of it, but if the folding fails, the whole
web may be revisited when another member of the web is visited.

To avoid a compile time explosion in pathological cases, we bail out
earlier for webs that are bigger than a given threshold (arbitrarily set
at 18 for now.) This size can be changed using
`--riscv-lower-ext-max-web-size=<maxWebSize>`.

At the current time, I didn't see a better scheme for that. Assuming we
want to stick with doing that in SDISel.

Differential Revision: https://reviews.llvm.org/D133739
2022-10-05 20:49:21 +00:00
David Green 03b145480d [AArch64] Add tablegen patterns for bf16 trn/zip/uzp.
This adds some missing tablegen patterns to handle trn1/trn2/zip1/zip2/uzp1/uzp2,
similar to the Arm handling in 5e1a9d319d, but via tablegen
patterns for the AArch64 backend.
2022-10-05 21:47:36 +01:00
oToToT 0da59bb865 [libc++] Fix wrong implementation of CityHash
As PR56606 stated, the current implementation of CityHash in libc++
would drop some bits unintentionally. Cast the 32bit int to the 64bit
int to avoid this happened.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D134124
2022-10-06 04:32:04 +08:00
David Blaikie b61860e63e Use inheriting ctors for OSTargetInfo
(& remove PSPTargetInfo because it's unused - it had the wrong ctor in
it anyway, so wouldn't've been able to be instantiated - must've
happened due to bitrot over the years)
2022-10-05 20:22:19 +00:00
Mark de Wever a1beb0a382 [libc++][format] Implements formattable concept.
This concept is introduced in P2286, but was implemented in libc++
before. This implementation was used in the library internally. This
implementation lacked the resolution of LWG3636. The original formatter
had a non-const member function that wasn't trivial to make a const
member. The recent parser improvements made this member a const member
in preparation of LWG3636.

Note LWG3636 isn't voted in. Its status is Ready. P2286's concept has
been written as-if LWG3636 is accepted and refers to that LWG issue.

Updates some tests make format a const member function and removes a
tests that's mainly a duplicate of the formattable concept test.

Implements
- LWG3636 formatter<T>::format should be const-qualified

Implements parts of
- P2286R8 Formatting Ranges

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D134110
2022-10-05 22:21:00 +02:00
TatWai Chong ff23599a0d [mlir][tosa] Update TOSA resize to match specification
Attribute stride and shift are removed, and has new scale and border.

Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Change-Id: I6cdbeb3978f5ee540bc6cf59eb7c273eb0131430

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D131629
2022-10-05 13:18:00 -07:00
Ben Langmuir 5ea78c4113 [clang] Update ModuleMap::getModuleMapFile* to use FileEntryRef
Update SourceManager::ContentCache::OrigEntry to keep the original
FileEntryRef, and use that to enable ModuleMap::getModuleMapFile* to
return the original FileEntryRef. This change should be NFC for
most users of SourceManager::ContentCache, but it could affect behaviour
for users of getNameAsRequested such as in compileModuleImpl. I have not
found a way to detect that difference without additional functional
changes, other than incidental cases like changes from / to \ on
Windows so there is no new test.

Differential Revision: https://reviews.llvm.org/D135220
2022-10-05 13:12:43 -07:00
Filipp Zhinkin 1888dc91ac [AArch64] Add tests for i128 comparison; NFC
Baseline tests for D135302.
2022-10-05 23:11:56 +03:00