Commit Graph

483827 Commits

Author SHA1 Message Date
Prathamesh Tagore
2255795f28
[mlir] [tensor] Fix typo in tensor.pack documentation (#74922) 2023-12-14 11:21:10 +05:30
Michael Spencer
90c2398176 [test][llvm-config] Allow extra libraries in test on Windows
Extra libraries can show up here depending on how LLVM was configured,
so just allow extra libraries to show up instead of expecting an exact
list.

Partially reverts d7aee33029.
2023-12-13 21:19:54 -08:00
Igor Kudrin
4f1ddf7523 [CommandLine] Remove unused variable 'NearestHandler' (fixup for #74811)
Buildbots reported:
.../CommandLine.cpp:1626:13: error: variable 'NearestHandler' set but not used [-Werror,-Wunused-but-set-variable]
2023-12-13 20:12:33 -08:00
LLVM GN Syncbot
8abc80eeb0 [gn build] Port ef3f476097 2023-12-14 03:31:46 +00:00
Sirui Mu
9d02770832
[clang] Parse attribute [[gnu::no_stack_protector]] (#75289)
This commit adds relative TableGen definitions to parse the
`[[gnu::no_stack_protector]]` attribute.

This PR addresses issue #75235.
2023-12-14 11:31:17 +08:00
Nico Weber
b07aaf8d3b [gn] port a5ffabce98 (unix sockets -> ws2_32.lib dep everywhere O_o) 2023-12-13 22:30:45 -05:00
Shengchen Kan
c7aee648d7 [X86][test] Merge encoding tests for avx512dq_vl 2023-12-14 11:27:05 +08:00
Keren Zhou
e66f97e8a8
[mlir] Fix loop pipelining when the operand of yield is not defined in the loop body (#75423) 2023-12-13 19:19:13 -08:00
Shoaib Meenai
042a2e8932 [Support] Fix WS2_32 casing
The file name is WS2_32.Lib in all the Windows SDK versions I looked at.
You can get away with the incorrect casing on a case-insensitive file
system but it can matter for cross-compilation.
2023-12-13 19:02:08 -08:00
Nico Weber
c60663d128 [gn] port 2e45326b08 (arm streaming attrs) 2023-12-13 21:58:10 -05:00
Joseph Huber
edc83886d4
[LLVM] Add file magic detection for SPIR-V files. (#75363)
Summary:
More SPIR-V related patches are being upstreamed. We should add support
to detect when a binary file is SPIR-V. This will be used in the future
when support for SPIR-V is added to the offloading runtime or more
support for bundling.

The magic number is described in the official documentation:
https://registry.khronos.org/SPIR-V/specs/1.0/SPIRV.html#Magic. Notably,
SPIR-V files are streams of 32-bit words. This means that the magic
numbers differ depending on the endianness. Here we simply check the
strandard and byte-reversed versions.
2023-12-13 20:39:50 -06:00
Philip Reames
1f3d13c415 [riscv] Fix build due to missing test update
My 632f1c appears to have missed a test update, sorry for the breakage.
2023-12-13 18:18:41 -08:00
Artem Dergachev
ef3f476097 [attributes][analyzer] Implement [[clang::suppress]] - suppress static analysis warnings.
The new attribute can be placed on statements in order to suppress
arbitrary warnings produced by static analysis tools at those statements.

Previously such suppressions were implemented as either informal comments
(eg. clang-tidy `// NOLINT:`) or with preprocessor macros (eg.
clang static analyzer's `#ifdef __clang_analyzer__`). The attribute
provides a universal, formal, flexible and neat-looking suppression mechanism.

Implement support for the new attribute in the clang static analyzer;
clang-tidy coming soon.

The attribute allows specifying which specific warnings to suppress,
in the form of free-form strings that are intended to be specific to
the tools, but currently none are actually supported; so this is also
going to be a future improvement.

Differential Revision: https://reviews.llvm.org/D93110
2023-12-13 18:09:16 -08:00
Shilei Tian
c76c00f866
[LLVM][Support] Fixed the compile error caused by #73603 (#75418)
This patch fixed the following compile error caused by #73603.

```
llvm/lib/Support/raw_ostream.cpp: In static member function ‘static llvm::Expected<llvm::ListeningSocket> llvm::ListeningSocket::createUnix(llvm::StringRef, int)’:
llvm/lib/Support/raw_ostream.cpp:1040:10: error: could not convert ‘ListenSocket’ from ‘llvm::ListeningSocket’ to ‘llvm::Expected<llvm::ListeningSocket>’
   return ListenSocket;
          ^~~~~~~~~~~~
```
2023-12-13 20:56:30 -05:00
NAKAMURA Takumi
e0ca12a145 [Bazel] Add arm_vector_types.h (fixup #73258) 2023-12-14 10:51:51 +09:00
Philip Reames
632f1c5d18
[RISCV] When VLEN is exactly known, prefer VLMAX encoding for vsetvli (#75412)
If we know the exact VLEN, then we can tell if the AVL for particular
operation is equivalent to the vsetvli xN, zero, <vtype> encoding. Using
this encoding is better than having to materialize an immediate in a
register, but worse than being able to use the vsetivli zero, imm,
<type> encoding.
2023-12-13 17:51:03 -08:00
Michael Spencer
d7aee33029 [llvm][Windows] Don't run socket tests on old versions of Windows
AF_UNIX sockets were added to Windows 10 build 17063 in 2017, older
versions of Windows will fail this test.

Also add a lit config so lit tests using sockets can do:
// REQUIRES: unix-sockets
(It would be cool if unit tests could use lit available_features)

Also fix llvm-config test that didn't fail when new libs are added.
2023-12-13 17:33:04 -08:00
Igor Kudrin
de8ee03ed9
[CommandLine] Better report unknown subcommands (#74811)
The patch improves the reporting for the first option in the command
line when it looks like a subcommand name but does not match any
defined.

Before the patch:
```
> prog baz
prog: Unknown command line argument 'baz'.  Try: 'prog --help'
```

With the patch:
```
> prog baz
prog: Unknown subcommand 'baz'.  Try: 'prog --help'
prog: Did you mean 'bar'?
```
2023-12-14 08:29:29 +07:00
Aiden Grossman
67d7903262
[Bazel] Define BUILTIN_THREAD_POINTER where appropriate on x86-64 linux (#74574)
This patch defines BUILTIN_THREAD_POINTER in config.bzl when appropriate
on x86-64 linux only. This is needed to build exegesis properly as
certain functionality breaks if this is not enabled. This option is only
supported on relatively recent compiler versions, but given most people
using the bazel build are using very recent toolchains, this shouldn't
be an issue.
2023-12-13 16:53:38 -08:00
Fangrui Song
eb05d7a05a [bazel] Port 2e45326b08 2023-12-13 16:47:44 -08:00
Augusto Noronha
b047c91164
[lldb] Skip 2 newly introduced tests from running on DWARF2 and clang 11 (#75406) 2023-12-13 16:30:39 -08:00
Sam Tebbs
2e45326b08
[AArch64][SME] Warn when using a streaming builtin from a non-streaming function (#74064)
This PR adds a warning that's emitted when a non-streaming or
non-streaming-compatible builtin is called in an unsuitable function.

Uses work by Kerry McLaughlin.
2023-12-14 00:11:04 +00:00
Matthias Springer
6d3ebd831c
[mlir][affine] Allow memref.cast in isDimOpValidSymbol (#74401)
`isDimOpValidSymbol` is used during the verification of `affine.for`
ops. It is used to check if LB/UB values are valid symbols. This change
adds support for `memref.cast`, which can be skipped over if it is a
ranked -> ranked cast.

This change fixes `mlir/test/Transforms/canonicalize.mlir`, which used
to fail when verifying the IR after each pattern application (#74270).
In this test case, a pattern that folds dynamic offsets/sizes/strides to
static ones is applied. This pattern inserts a trivial `memref.cast`
that can be folded away. This folding happens after the pattern
application, so the IR fails to verify after applying the
offsets/sizes/strides canonicalization pattern.

Note: The verifier of `affine.for` violates MLIR guidelines. Only local
properties of an op should be verified. The verifier should not inspect
the defining ops of operands. (This would mean that constraints such as
"operand is a valid affine symbol" cannot be verified.)
2023-12-14 08:54:39 +09:00
Jonas Devlieghere
590001431b
[dsymutil] Improve missing symbol warning message (#75378)
The current warning emitted by dsymutil when it can't find a symbol in
an object file is worded rather poorly:

```
could not find object file symbol for symbol _foo
```

It's also lacking information that makes the warning actionable, such as
the object file it's looking at. This patch rewords the warning and adds
the object file path to the warning:

```
could not find symbol '_foo' in object file 'test.o'
```

rdar://119621065
2023-12-13 15:47:54 -08:00
Vitaly Buka
fcce843227
[msan] Use pthread_atfork instead of interceptor (#75398)
This is done for consistency with other sanitizers.
Also lock the allocator.
2023-12-13 15:36:38 -08:00
Pete Lawrence
c1552695ae
[lldb] Return index of element in ValueObject path instead of the element's value (#74413)
It's more meaningful and actionable to indicate which element in the
array has an issue by returning that element's index instead of its
value. The value can be ambiguous if at least one other element has the
same value.

The first parameter for these methods is `idxs`, an array of indices
that represent a path from a (root) parent to on of its descendants,
typically though intermediate descendants. When the path leads to a
descendant that doesn't exist, the method is supposed to indicate where
things went wrong by setting an index to `&index_of_error`, the second
parameter.

The problem is the method sets `*index_of_error` to the index of the
most recent parent's child in the hierarchy, which isn't very useful if
there's more one index with the same value in the path.

In this example, each element in the path has a value that's the same as
another element.

```cpp
GetChildAtIndexPath({1, 2, 3, 3, 1, 1, 2}, &index_of_error);
```

Say the the second `1` in the path (the 5th element at `[4]`) doesn't
exist and the code returns a `nullptr`. In that situation, the code sets
`*index_of_error` to `1`, but that's an ambiguous hint can implicate the
1st, 5th, or 6th element (at `[0]`, `[4]`, or `[5]`).

It’s more helpful to set `*index_of_error` to `4` to clearly indicate
which element in `idxs` has the issue.
2023-12-13 15:26:05 -08:00
Aart Bik
e52c941921
[mlir][sparse] minor cleanup of transform/utils (#75396)
Consistent include macro naming
Modified and added comments
2023-12-13 15:18:35 -08:00
Louis Dionne
f0d4811690
[libc++] Add CI job for testing macOS C++03 (#75355)
It's not that I have much love for C++03, but we should ensure that it
works. Some recent changes broke this configuration because slightly
older Clang versions don't support attribute syntax in C++03 mode.
2023-12-13 18:05:36 -05:00
Vitaly Buka
8d300e67d2
[hwasan] Improve support of forking with threads (#75291)
Lock Lsan and Thread related date at_fork.

Clean shadow before thread starts, forked process may reuse already
mapped stack of 'lost' parent thread for new threads.
2023-12-13 14:50:26 -08:00
Vitaly Buka
192840113a [NFC][msan] Clang-format some includes 2023-12-13 14:46:08 -08:00
Vitaly Buka
c636b186bc
[test][hwasan] Implement sanitizer_specific for HWASAN (#75280) 2023-12-13 14:39:35 -08:00
Prathamesh Tagore
f397bdf5ae
[mlir][tensor] Fold consumer linalg transpose with producer tensor pack (#74206)
Partial fix to https://github.com/openxla/iree/issues/15367
2023-12-13 14:26:19 -08:00
Vitaly Buka
8bea83b8f5 [NFC][GlobalISel] Fix case of local variable 2023-12-13 14:10:28 -08:00
Vitaly Buka
eabf7ec3f3 [GlobalISel] Fix misaligned read after #74429 2023-12-13 14:04:59 -08:00
Owen Pan
c3fa4b788f
[clang-format] Fix a bug in git-clang-format.bat (#75268)
Pass the fully-qualified path name (less the file extension) of
git-clang-format.bat to py so that it can be run from anywhere.

Fixes #75265.
2023-12-13 14:00:06 -08:00
Fangrui Song
2a9d8caf29 Revert "[MLIR] Fuse locations of merged constants (#74670)"
This reverts commit 87e2e89019.
and its follow-ups 0d1490f09f (#75218)
and 6fe3cd5467 (#75312).

We observed significant OOM/timeout issues due to #74670 to quite a few
services including google-research/swirl-lm. The follow-up #75218 and
 #75312 do not address the issue. Perhaps this is worth more
investigation.
2023-12-13 13:49:03 -08:00
Arthur Eubanks
c64334fb30
[X86][FastISel] Support medium code model in more places (#75375)
The medium code model is basically identical to the small code model
except that large objects cannot be referenced with 32-bit offsets.
2023-12-13 13:44:37 -08:00
Vitaly Buka
e065841cb0
[asan] Install pthread_atfork (#75290)
This prevents deadlocks in forked process
if parent had more then one running threads.
2023-12-13 13:42:24 -08:00
Philip Reames
12af9c8337 [RISCV] Extract a utility for computing bounds on VLMAX [nfc]
Simplifying an upcoming change...
2023-12-13 13:40:18 -08:00
Fangrui Song
71ba8bb4a7 [mlir,vector] Fix -Wunused-variable 2023-12-13 13:28:17 -08:00
Nico Weber
d860480f9b Revert "[clangd] Add test for GH75115 (#75116)"
This reverts commit 04580edd8a.

The test fails if asserts are disabled, see
https://github.com/llvm/llvm-project/pull/75116#issuecomment-1854543611
and the next comment.
2023-12-13 16:24:40 -05:00
Nick Desaulniers
1f6427a2d5
[libc] add mempcpy to bazel overlay (#75383)
We'd like to begin overlaying mempcpy.
2023-12-13 13:23:42 -08:00
Alan Phipps
8ecbb0404d Reland "[Coverage][llvm-cov] Enable MC/DC Support in LLVM Source-based Code Coverage (2/3)"
Part 2 of 3. This includes the Visualization and Evaluation components.

Differential Revision: https://reviews.llvm.org/D138847
2023-12-13 15:10:05 -06:00
Vitaly Buka
14d7e0bb0f
[lsan] Install pthread_atfork (#75281)
This prevents deadlocks in forked process on essencial
runtime components.
2023-12-13 13:09:36 -08:00
Arthur Eubanks
e8f43883a0 [X86][test] Use separate check prefix in code-model-elf.ll
Since these will produce different results in upcoming changes.
2023-12-13 13:05:59 -08:00
Florian Hahn
173032902c
Revert "[VPlan] Mark Select VPInstructions as not having sideeffects."
This reverts commit 19918ac34d.

Fixes #75298. There is still a case where we miss the correct users
outside the main vector loop for reductions, and that is tail-folded
loops with reductions where the final value is stored after the loop.

This should be handled explicitly in #70253
2023-12-13 21:05:24 +00:00
Florian Hahn
8d893f28f2
[LV] Add test case for #75298. 2023-12-13 20:59:28 +00:00
Philip Reames
29bb7f762b [RISCV] Add test coverage for profitable vsetvli a0, zero, <vtype> cases
Test coverage for an upcoming change, we can avoid generating an immediate
in register if we know the immediate is equal to vlmax.
2023-12-13 12:58:25 -08:00
Tom Stellard
c5b3b5e0e8
workflows/release-binaries: Add schedule to run job once per month (#73812)
This will help catch any regressions introduced in the main branch
before we start release testing.
2023-12-13 12:50:52 -08:00
Andrzej Warzyński
c02d07fdf0
[mlir][vector] Add pattern to drop unit dim from elementwise(a, b)) (#74817)
For vectors with either leading or trailing unit dim, replaces:

    elementwise(a, b)

with:

    sc_a = shape_cast(a)
    sc_b = shape_cast(b)
    res = elementwise(sc_a, sc_b)
    return shape_cast(res)

The newly inserted shape_cast Ops fold (before elementwise Op) and then
restore (after elementwise Op) the unit dim. Vectors `a` and `b` are
required to be rank > 1.

Example:
```mlir
  %mul = arith.mulf %B_row, %A_row : vector<1x[4]xf32>
  %cast = vector.shape_cast %mul : vector<1x[4]xf32> to vector<[4]xf32>
```

gets converted to:

```mlir
  %B_row_sc = vector.shape_cast %B_row : vector<1x[4]xf32> to vector<[4]xf32>
  %A_row_sc = vector.shape_cast %A_row : vector<1x[4]xf32> to vector<[4]xf32>
  %mul = arith.mulf %B_row_sc, %A_row_sc : vector<[4]xf32>
  %mul_sc = vector.shape_cast %mul : vector<[4]xf32> to vector<1x[4]xf32>
  %cast = vector.shape_cast %mul_sc : vector<1x[4]xf32> to vector<[4]xf32>
```

In practice, the bottom 2 shape_cast(s) will be folded away.
2023-12-13 20:29:12 +00:00