Commit Graph

432349 Commits

Author SHA1 Message Date
Kazu Hirata 1dd8a31854 [clang-tidy] Use is_contained (NFC) 2022-08-07 23:55:25 -07:00
Kazu Hirata 0e37ef0186 [Transforms] Fix comment typos (NFC) 2022-08-07 23:55:24 -07:00
Kazu Hirata d3651aa697 [BOLT] Upgrade to C++17
Without this patch, I am getting errors like:

  llvm-project/llvm/include/llvm/ADT/StringRef.h:233:7: error: use of
  the 'nodiscard' attribute is a C++17 extension
  [-Werror,-Wc++17-extensions]

Differential Revision: https://reviews.llvm.org/D131348
2022-08-07 23:12:16 -07:00
wanglei 0c2b738f8f [LoongArch] Support for varargs
This patch ensures the `$fp` always points to the bottom of the vararg
spill region.
Includes support for expand `ISD::DYNAMIC_STACKALLOC`.

Differential Revision: https://reviews.llvm.org/D130250
2022-08-08 14:01:24 +08:00
Fangrui Song 350f17ab52 [llvm-ar] Remove unused parameter. NFC 2022-08-07 21:31:35 -07:00
Sheng 64d326c33c [M68k] Add MC support for link/unlk
Reviewers: myhsu

Differential Revision: https://reviews.llvm.org/D125444
2022-08-08 11:00:11 +08:00
Nico Weber cf7c8bd74e [gn build] (manually) port ace6e172bd 2022-08-07 22:02:51 -04:00
luxufan ace6e172bd [RISCV] Support fe_getround and fe_raise_inexact in builtins
Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D128240
2022-08-08 09:58:27 +08:00
Jun Zhang 98339ac7af
[Support] move llvm::llvm_is_multithread to header, NFC
This allow optimization without LTO. Also remove some useless else-ifs.
Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D131313
2022-08-08 08:49:02 +08:00
Peter Klausler 1d1f5a5251 [flang] Handle subnormals while folding SCALE, SET_EXPONENT, & FRACTION
The implementations of folding for the intrinsic functions SCALE and SET_EXPONENT
do not cope correctly with numbers in the subnormal range.  Fix SCALE,
then modify SET_EXPONENT to be a special case of SCALE.

Differential Revision: https://reviews.llvm.org/D131099
2022-08-07 16:12:14 -07:00
Ashay Rane d1bb3016dd
[mlir] fix `add_tablegen()` macro to allow installing mlir-pdll
Prior to this patch, the `add_tablegen()` macro in
llvm/cmake/modules/TableGen.cmake added the install rule only if
`project` matched `LLVM` or `MLIR`.  This patch adds an optional
`DESTINATION` argument, which, if non-empty, decides whether (and where)
to install the tablegen tool, thus eliminating the need for
project-specific overrides.  This patch also updates all other
invocations of the `add_tablegen()` macro.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D131282
2022-08-07 15:48:38 -07:00
Jacques Pienaar 10de551297 [mlir][python] Address deprecation warning for hasValue 2022-08-07 15:28:18 -07:00
Peter Klausler e6373de53d [flang] Allow assignment to host association in BLOCK in PURE subprogram
We need to distinguish BLOCK host association from subprogram host
association when checking assignments in PURE subprograms.
The specific case that is not allowed is an assignment to a variable
from the scope around the PURE subprogram.

Differential Revision: https://reviews.llvm.org/D131098
2022-08-07 14:48:53 -07:00
Lang Hames 608131b1f9 [ORC-RT] Fix missing #include <string_view>s.
1dcff823db updated the ORC runtime to use std::string_view, rather than its
own placeholder class (__orc_rt::string_view), but failed to add these
includes.
2022-08-07 14:32:28 -07:00
Jonas Devlieghere d446d91aa3
[lldb] Use single-argument static_assert where applicable (NFC)
Since C++17 the message string for static_assert is optional. Replaces
static asserts with an empty string literal with the single-argument
variant.
2022-08-07 14:26:08 -07:00
Sanjay Patel 74b5e797d5 [InstSimplify] fold scalable vectors with over-shift splat constant to poison
Fixes #56968
2022-08-07 16:26:05 -04:00
Sanjay Patel 34a785fee7 [InstSimplify] add test for over-shift of scalable vector; NFC 2022-08-07 16:26:05 -04:00
Peter Klausler 921316af6e [flang][runtime] Catch & report attempts at recursive I/O
When an I/O statement contains a function call that attempts
to perform I/O on the same unit, detect the recursive I/O
and terminate with a useful message rather than deadlocking in
the threading library.

Differential Revision: https://reviews.llvm.org/D131097
2022-08-07 12:52:56 -07:00
Lang Hames 41c41fcbc0 Revert "[JITLink] Fix some C++17 related fixmes."
This reverts commit 6ea5bf436a.

6ea5bf436a made use of new c++17 rules regarding
order of evaluation (specifically: in function calls the expression naming the
function should be sequenced before the evalution of any operands) to simplify
some continuation-passing calls. Unfortunately this appears to break at least
one MSVC bot: https://lab.llvm.org/buildbot/#/builders/123/builds/12149 .

Includes an update to the comments to note that the workaround is now based on
MSVC limitations, not on LLVM adopting c++17.
2022-08-07 12:15:59 -07:00
Kazu Hirata f616a63db2 [mlir] Use value instead of getValue 2022-08-07 11:59:37 -07:00
Kazu Hirata b5f8d42efe [ADT] Deprecate Optional::{hasValue,getValue} (NFC)
Differential Revision: https://reviews.llvm.org/D131349
2022-08-07 11:30:58 -07:00
Lang Hames aa2a3196e2 [ORC-RT] Remove a stray __orc_rt::string_view helper.
This function was accidentally left in after 1dcff823db.
2022-08-07 11:23:09 -07:00
Dave Lee c615e467db [lldb] Hoist TraceOn check out of loop (NFC) 2022-08-07 12:19:47 -06:00
Dave Lee 87990fd8f4 [lldb] Fix formatting in python-reference.rst 2022-08-07 12:17:36 -06:00
Dave Lee e49c1568b6 [lldb] Dynamically generate enum names in lldbutil
Change the `<enum>_to_str` functions in lldbutil to be dynamic.

Instead of a manually maintained if/elif switch, the functions now perform
lookup in a dynamically generated dict. The names are determined by stripping
the enum's prefix, and then lowercasing the remaining suffix, ex:

    eStateRunning -> "running"

Differential Revision: https://reviews.llvm.org/D131138
2022-08-07 12:15:51 -06:00
Adrian Vogelsgesang fc40804a5a [libc++][NFC] Fix `the the` in comment in `__format/buffer.h`
I made this commit primarily to test my commit access to the LLVM repo

Differential Revision: https://reviews.llvm.org/D131365
2022-08-07 11:14:43 -07:00
Kazu Hirata 5b14c7aee8 [mlir] Fix a warning
This patch fixes:

  llvm-project/mlir/include/mlir/IR/OpDefinition.h:1544:19: error: use
  of bitwise '|' with boolean operands
  [-Werror,-Wbitwise-instead-of-logical]
2022-08-07 11:13:19 -07:00
Sanjay Patel 8148c28fad [ConstFolding] fix overzealous assert when converting FP half
Fixes #56981
2022-08-07 13:34:51 -04:00
Sanjay Patel 2843a1d87d [InstCombine] add tests for bitwise logic; NFC 2022-08-07 13:34:51 -04:00
Lang Hames 6ea5bf436a [JITLink] Fix some C++17 related fixmes. 2022-08-07 09:37:14 -07:00
Lang Hames 1dcff823db [ORC-RT] Drop __orc_rt::string_view now that we have c++17.
b1356504e6 enabled the use of c++17 features in LLVM, which means that we can
drop the ORC runtime's placeholder string_view implemention in favor of
std::string_view.
2022-08-07 09:37:09 -07:00
Sergei Barannikov 87dc7d4b61
[clang][CodeGen] Factor out Swift ABI hooks (NFCI)
Swift calling conventions stands out in the way that they are lowered in
mostly target-independent manner, with very few customization points.
As such, swift-related methods of ABIInfo do not reference the rest of
ABIInfo and vice versa.
This change follows interface segregation principle; it removes
dependency of SwiftABIInfo on ABIInfo. Targets must now implement
SwiftABIInfo separately if they support Swift calling conventions.

Almost all targets implemented `shouldPassIndirectly` the same way. This
de-facto default implementation has been moved into the base class.

`isSwiftErrorInRegister` used to be virtual, now it is not. It didn't
accept any arguments which could have an effect on the returned value.
This is now a static property of the target ABI.

Reviewed By: rusyaev-roman, inclyc

Differential Revision: https://reviews.llvm.org/D130394
2022-08-08 00:23:23 +08:00
Amaury Séchet dbff03b858 [X86] Add test case to recombine LEA from OR. 2022-08-07 16:19:53 +00:00
Peter Klausler 3f10091c04 [flang] Allow pure function references in expandable scalar
F18 disallows function references and coarray references from
appearing in scalar expressions that are to be expanded into
arrays to conform with other operands or actual arguments in
an elemental expression.  This is too strong, as pure procedures
can be safely used.

Differential Revision: https://reviews.llvm.org/D131096
2022-08-07 09:12:46 -07:00
Jacques Pienaar 7602e285f6 [mlir] Flip to prefixed accessors (NFC)
Missed these in td files.
2022-08-07 08:46:15 -07:00
Gabriel Ravier ea540bc210
[polly] Fixed a number of typos. NFC
I went over the output of the following mess of a command:

`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Reviewed By: inclyc

Differential Revision: https://reviews.llvm.org/D131167
2022-08-07 22:56:07 +08:00
Haojian Wu 82439b201a [clang-tidy] Fix a forwarding-reference-overload crash after the
ElaboratedType change.

After 15f3cd6bfc, the nss of
ElaboratedType can be null.
2022-08-07 16:53:56 +02:00
Aaron Ballman 32fd0b7fd5 Revert "[RDF] Remove explicit template arguments from Print"
This reverts commit ede96de751.

This breaks the build on Windows with Visual Studio:
https://lab.llvm.org/buildbot/#/builders/123/builds/12134
2022-08-07 08:24:01 -04:00
Roman Gareev e8c9eb49ea [Polly] Suppress the LLVM-IR output for pattern matching tests, if there is no FileCheck-ing for it. 2022-08-07 14:56:26 +03:00
Jacques Pienaar d3b3f7653d [mlir] Flip to prefixed accessors (NFC) 2022-08-07 04:55:58 -07:00
David Green f8d976171f [ARM] Regenerate vector_store.ll tests. NFC 2022-08-07 12:46:28 +01:00
Roman Gareev b02c7e2b63 [Polly] Generalize the pattern matching to the case of tensor contractions
The pattern matching optimization of Polly detects and optimizes dense general
matrix-matrix multiplication. The generated code is close to high performance
implementations of matrix-matrix multiplications, which are contained in
manually tuned libraries. The described pattern matching optimization is
a particular case of tensor contraction optimization, which was
introduced in [1].

This patch generalizes the pattern matching to the case of tensor contractions
using the form of data dependencies and memory accesses produced by tensor
contractions [1].

Optimization of tensor contractions will be added in the next patch. Following
the ideas introduced in [2], it will logically represent tensor contraction
operands as matrix multiplication operands and use an approach for
optimization of matrix-matrix multiplications.

[1] - Gareev R., Grosser T., Kruse M. High-Performance Generalized Tensor
Op­erations: A Compiler-Oriented Approach // ACM Transactions on
Architec­ture and Code Optimization (TACO). 2018. Vol. 15, no. 3.
P. 34:1–34:27. DOI: 10.1145/3235029.

[2] - Matthews D. High-Performance Tensor Contraction without BLAS // SIAM
Journal on Scientific Computing. 2018. Vol. 40, no. 1. P. C 1—C 24.
DOI: 110.1137/16m108968x.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D114336
2022-08-07 13:10:32 +03:00
Igor Zhukov 6bb51bf062 [libc++][test] Fix MSVC warnings C6054, C6001, C4242 in format_tests.h
Reviewed By: Mordante

Differential Revision: https://reviews.llvm.org/D131336
2022-08-07 16:55:50 +07:00
Markus Böck 26d811b3ec [mlir] Make use of C++17 language features
Now that C++17 is enabled in LLVM, a lot of the TODOs and patterns to emulate C++17 features can be eliminated.
The steps I have taken were essentially:
```
git grep C++17
git grep c++17
git grep "initializer_list<int>"
```
and address given comments and patterns.
Most of the changes boiled down to just using fold expressions rather than initializer_list.

While doing this I also discovered that Clang by default restricts the depth of fold expressions to 256 elements. I specifically hit this with `TestDialect` in `addOperations`. I opted to not replace it with fold expressions because of that but instead adding a comment documenting the issue.
If any other functions may be called with more than 256 elements in the future we might have to revert other parts as well.
I don't think this is a common occurence besides the `TestDialect` however. If need be, this could potentially be fixed via `mlir-tblgen` in the future.

Differential Revision: https://reviews.llvm.org/D131323
2022-08-07 11:16:49 +02:00
Alexey Bader f0f1bcadc7 [demangler] Add getters for Qual/Vector/Pointer types
These are useful for downstream tool aligning the mangling of data types which differ between different languages/targets.

Patch by Steffen Larsen <steffen.larsen@intel.com>

Differential Revision: https://reviews.llvm.org/D130909
2022-08-07 02:10:05 -07:00
Shivam Gupta fdc950958e Added warning about outdated feature into Kaleidoscope tutorial text
**Motivation: **  I have been studying LLVM with LLVM Kaleidoscope tutorial. In the 4th part I faced an error which said that I can't redefine a function as shown in the tutorial. After hours of searching, I finally found the reason that produced the error is that the feature of symbols redefinition has been disabled since LLVM-9. There was no information about that in the tutorial's text, so I've decided to add a warning.

**Changes**: The only file I fixed is "`llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst`", I added text warning which says that described feature is outdated and the described functionality will not work properly on LLVM versions older 8 one.

Patch by : DKay7

Differential Revision: https://reviews.llvm.org/D130613
2022-08-07 14:37:05 +05:30
Kazu Hirata ba0407ba86 [llvm] Use range-based for loops (NFC) 2022-08-07 00:16:21 -07:00
Kazu Hirata 54199d805a [x86] Remove unused declaration processWaitCnt (NFC)
The declaration was introduced without a corresponding definition on
Jan 2, 2022 in commit 85e6e748d4.
2022-08-07 00:16:19 -07:00
Kazu Hirata 7542e72188 Use llvm::is_contained (NFC) 2022-08-07 00:16:17 -07:00
Kazu Hirata d0ec61c9ff [Target] Remove unused forward declarations (NFC) 2022-08-07 00:16:16 -07:00