Commit graph

416691 commits

Author SHA1 Message Date
Siva Chandra Reddy 32a50c6b93 [libc][NFC] Add a static assert for futex size. 2022-03-01 22:56:56 +00:00
rkayaith d75ac58117 [mlir] Add option to control python search priming
This adds an option to configure the CMake python search priming
behaviour that was introduced in D118148. In some environments the
priming would cause the "real" search to fail. The default behaviour is
unchanged, i.e. the search will be primed.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D120765
2022-03-01 14:52:56 -08:00
Florian Mayer 864820bb3c [HWASAN] Add test for optnone function.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D120102
2022-03-01 14:48:43 -08:00
Florian Mayer 1d730d80ce [HWASAN] erase lifetime intrinsics if tag is outside.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D120437
2022-03-01 14:47:33 -08:00
Peter Klausler df38f35acb [flang] Allow data transfer stmt control list errors to be caught
The runtime crashes on several fundamental I/O data transfer statement
control list errors, like list I/O on a direct-access unit, or
input from a write-only unit, &c.  These errors should not be fatal
when ERR= or IOSTAT= are present.

This patch creates a new ErroneousIoStatementState class and
uses it for the state of an I/O statement that is doomed to fail
from these errors.  If there is no ERR= label or IOSTAT= variable,
the error will be raised at the end of the statement.  Data transfer
operations along the way will be no-op failures.

Differential Revision: https://reviews.llvm.org/D120745
2022-03-01 14:39:30 -08:00
Valentin Clement bc274b854d
[flang] Add test for allocatable on the caller side
This patch adds test for allocatable on the caller side.
Lowering for missing features is added as well.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120746

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-01 23:26:43 +01:00
Zequan Wu b901c404a8 [PDB] add missing char8_t for 5c9e20d 2022-03-01 14:24:21 -08:00
Joseph Huber 6632180745 [OpenMP][NFC] Add an option to print the module before in OpenMPOpt
Previously there was a debug flag to print the module after
optimizations. Sometimes we wanted to print the module before
optimizations so this is being split into two flags.
`-openmp-opt-print-module` is now `-openmp-opt-print-module-after`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D120768
2022-03-01 17:09:09 -05:00
River Riddle 026fe5ffc3 [mlir][NFC] Remove several dead references to the old standard dialect 2022-03-01 14:02:24 -08:00
Valentin Clement 96d9df4157
[flang] Add test for allocatable on the callee side
This patch adds couple of tests for allocatable
on the callee side. Lowering for some missing underlying features
is added as well.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120744

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-01 22:58:34 +01:00
River Riddle 2f5715dc78 [mlir][NFC] Rename the old Standard dialect test directory to Func
The remanants of Standard was renamed to Func, but the test directory
remained named as Standard. In adidition to fixing the name, this commit
also moves the tests for operations not in the Func dialect to the proper
parent dialect test directory.
2022-03-01 13:48:34 -08:00
Duncan P. N. Exon Smith 15ab7bc3af Testing: Make TempFile safe to move; test Temp{Dir,File,Link}
Default the moves and delete the copies for TempFile, matching TempDir
and TempLink, and add tests for all of them to confirm that the
destructor is not harmful after it has been moved from.

Differential Revision: https://reviews.llvm.org/D120691
2022-03-01 13:45:51 -08:00
Martin Storsjö 736c6e246f [libcxx] [test] Place output from newconfig tests under a 'test' subdir
Previously, all the output from the tests were placed directly in
the build directory. The tests produce a couple directories named
`__config_{exec,cache,src}__` which are easy to distinguish, but
the output from the individual tests are placed in subdirectories
named `std` or `libcxx`. Especially the build output from libcxx
tests ends up conflated in the same directories as are used for
building libcxx with cmake.

Differential Revision: https://reviews.llvm.org/D120479
2022-03-01 23:44:26 +02:00
Zequan Wu 5c9e20d7d0 [PDB] Add char8_t type
Differential Revision: https://reviews.llvm.org/D120690
2022-03-01 13:39:51 -08:00
Valentin Clement d88dfd2b31
[flang] Handle dynamic array lowering
This patch enables dynamic array lowering
and use the funcationality inside some IO tests.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120743

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-01 22:29:49 +01:00
Krystian Kuzniarek 5e51ace4e8 [clang-format][docs] Fix a bad comment
Follow up to 8f310d1967.

Differential Revision: https://reviews.llvm.org/D120618
2022-03-01 21:55:32 +01:00
Björn Schäpers d6daca2173 [clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs
In the presence of pp branches we parse the token stream multiple times.
Thus the token already has the type set. It's best just not to assert on
any type in the parser.

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

Differential Revision: https://reviews.llvm.org/D120621
2022-03-01 21:55:32 +01:00
Björn Schäpers 78ac867018 [clang-format] Fix requires related crash
In the presence of pp branches we parse the token stream multiple times.
Thus the token already has the type set. It's best just not to assert on
any type in the parser.

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

Differential Revision: https://reviews.llvm.org/D120512
2022-03-01 21:55:31 +01:00
Björn Schäpers 1e7cc72ac9 [clang-format] Allow to set token types final
We have a little problem. TokenAnnotator::resetTokenMetadata() resets
the type, except for a (growing) whitelist. This is because the
TokenAnnotator visits some tokens multiple times. E.g. trying to
identify if a < is an operator less or a template opener. And in some
runs, which are bascially "reverted" the types are reset.

On the other hand, if the parser does already know the type, it should
be able to set it, without it being reset. So we introduce the ability
to set a type and make that final.

Differential Revision: https://reviews.llvm.org/D120511
2022-03-01 21:55:31 +01:00
David Tenty f642436cc2 [libc++][AIX] Use C++ overloads from libc++'s math.h
AIX's system header provides these C++ overloads for compatibility with
older XL C++ implementations, but they can be disabled by defining
__LIBC_NO_CPP_MATH_OVERLOADS__ since AIX 7.2 TL 5 SP 3.

Since D109078 landed clang will define this macro when using libc++ on
AIX and we already run the lit tests with it too. This change will
enable the overloads in libc++'s math.h and we'll continue to require
the compiler to define the macro going forward.

Reviewed By: ldionne, jsji, EricWF

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

co-authored-by: Jason Liu <jasonliu.development@gmail.com>
2022-03-01 15:53:41 -05:00
Cameron McInally 70629d570b [SVE] Update patterns to commute FMLS multiplication operands
Use PatFrags to commute the multiplication operands of an AArch64ISD::FMA_PRED
node, allowing unpredicated FMLS instructions to match.

Reviewed by: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D120570
2022-03-01 12:53:14 -08:00
Valentin Clement 8c22cb846f
[flang] Lower basic IO statement
This patch enables the lowering of the print, read and write
IO statements.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2022-03-01 21:48:41 +01:00
Peter Klausler 59d38f1b56 [flang] Check constraint C711 correctly
An assumed-type actual argument that corresponds to an assumed-rank dummy
argument shall be assumed-shape or assumed-rank.

Differential Revision: https://reviews.llvm.org/D120750
2022-03-01 12:22:17 -08:00
River Riddle 1f971e23f0 [mlir] Trim a huge number of unnecessary dependencies on the Func dialect
The Func has a large number of legacy dependencies carried over from the old
Standard dialect, which was pervasive and contained a large number of varied
operations. With the split of the standard dialect and its demise, a lot of lingering
dead dependencies have survived to the Func dialect. This commit removes a
large majority of then, greatly reducing the dependence surface area of the
Func dialect.
2022-03-01 12:10:04 -08:00
River Riddle 23aa5a7446 [mlir] Rename the Standard dialect to the Func dialect
The last remaining operations in the standard dialect all revolve around
FuncOp/function related constructs. This patch simply handles the initial
renaming (which by itself is already huge), but there are a large number
of cleanups unlocked/necessary afterwards:

* Removing a bunch of unnecessary dependencies on Func
* Cleaning up the From/ToStandard conversion passes
* Preparing for the move of FuncOp to the Func dialect

See the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061

Differential Revision: https://reviews.llvm.org/D120624
2022-03-01 12:10:04 -08:00
Brian Cain 9bf6e3e97e [libcxx] Make test case fmt specifiers more portable
These printf()s fail to compile like so on hexagon:

.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:94:23: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
        printf("%u ", elem);
                ~~    ^~~~
                %lu
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:569:56: error: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Werror,-Wformat]
        fprintf(stderr, "%s failed for 0x%08X\n", msg, bits);
                                         ~~~~          ^~~~
                                         %08lX
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:1096:43: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
    printf("Randomized test cases: %u\n", PrefixesToTest * Fractions);
                                   ~~     ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                   %lu

Differential Revision: https://reviews.llvm.org/D120532
2022-03-01 12:07:23 -08:00
Craig Topper 626ecef1fc [RISCV] Add more test case for absolute value. NFC
This adds tests for i8 through i128 with intrinsic and select forms.

Covering rv32 and rv64 with the base ISA, Zbb, and Zbt. Some
Zbb tests already covered part of this, but not all.

FIXMEs have been added for some obviously suboptimal codegen.
2022-03-01 12:02:44 -08:00
serge-sans-paille a494ae43be Cleanup includes: TransformsUtils
Estimation on the impact on preprocessor output:
before: 1065307662
after:  1064800684

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120741
2022-03-01 21:00:07 +01:00
serge-sans-paille eeaca53df7 Add missing include under EXPENSIVE_CHECK
This is a followup to 344f8ec3048b6eeef94569800acb012f794ad372

It should fix
https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/21961/console
2022-03-01 21:00:06 +01:00
rdzhabarov 2e32525d95 [mlir] Fix unused var warning in the IR/MemRefOps.cpp
Fix unused var compiler warning.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D120759
2022-03-01 19:53:52 +00:00
Craig Topper 1f4bb9c69f [RISCV] Fix the indentation of 'ret' in rv*zb*-intrinsic.ll tests. NFC
Many of these test cases had a single space before 'ret' while
every other instruction had two space indentation. I did not audit
any other tests for this problem.
2022-03-01 11:37:49 -08:00
Arthur O'Dwyer f86c2b6f1f [libc++] Add explicit to a bunch of internal detail ctors.
Notably the following ctors remain non-explicit because they
are used as implicit conversions in too many places:
* __debug_less(_Compare&)
* __map_iterator(_TreeIterator)
* __map_const_iterator(_TreeIterator)
* __hash_map_iterator(_HashIterator)
* __hash_map_const_iterator(_HashIterator)

Differential Revision: https://reviews.llvm.org/D119894
2022-03-01 14:37:06 -05:00
Fangrui Song 50874a188b Fix -DLLVM_ENABLE_EXPENSIVE_CHECKS=on build after D120659 2022-03-01 11:36:25 -08:00
Martin Storsjö d2617a6b52 [libcxx] [test] Fix the put_double, put_long_double tests for clang-cl
These tests are hit hard by a bug that is fixed in a newer version
of UCRT. Add a test for the specific bug, and XFAIL the tests if
that bug is present (as it is in CI).

Split out hex formatting of floats to separate test files, that
are excluded with `XFAIL: msvc`. (Based on reading the C standard for
printf formatting, it seems like this isn't necessarily a proper bug
in printf, but just a case of differing optional behaviour.)

Differential Revision: https://reviews.llvm.org/D120022
2022-03-01 21:33:30 +02:00
Martin Storsjö eb4dcc744d [libcxx] [test] Add a 'win32-' prefix to the 'broken-utf8-wchar-ctype' feature
This was suggested in the review of https://reviews.llvm.org/D120022.

Also indent the code for the compilation test one step compared
to the surrounding expression.

Differential Revision: https://reviews.llvm.org/D120469
2022-03-01 21:33:30 +02:00
Mircea Trofin 261419273a Fix build breaks on ml-* bots introduced by include cleanups 2022-03-01 11:29:18 -08:00
Mark de Wever 93b333908d [libc++] Remove _LIBCPP_HAS_NO_STRONG_ENUMS.
All supported compilers have implemented this feature.
Therefore use the language version instead of the feature macro.

Reviewed By: #libc, philnik, ldionne, Quuxplusone

Differential Revision: https://reviews.llvm.org/D119865
2022-03-01 20:27:20 +01:00
Aart Bik 1e47888de6 [mlir][sparse] fix compile-time warning
Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D120756
2022-03-01 11:26:15 -08:00
Arthur O'Dwyer 0444a0e8a9 [libc++] Remove extraneous space in module.modulemap. NFC. 2022-03-01 14:25:09 -05:00
Arthur O'Dwyer a281bdd51b [libc++] [test] Improve the tests for std::{begin,end}(valarray).
Incidentally, this removes some unqualified ADL calls to `begin` and `end`.

Differential Revision: https://reviews.llvm.org/D119687
2022-03-01 14:24:46 -05:00
Nicolas Miller 510fd283fd [NVPTX] Add ex2.approx.f16/f16x2 support
NOTE: this is a follow-up commit with the missing clang-side changes.

This patch adds builtins and intrinsics for the f16 and f16x2 variants of the ex2
instruction.

These two variants were added in PTX7.0, and are supported by sm_75 and above.

Note that this isn't wired with the exp2 llvm intrinsic because the ex2
instruction is only available in its approx variant.

Running ptxas on the assembly generated by the test f16-ex2.ll works as
expected.

Differential Revision: https://reviews.llvm.org/D119157
2022-03-01 11:07:11 -08:00
Jakub Chlanda a895182302 [NVPTX] Add more FMA intriniscs/builtins
This patch adds builtins/intrinsics for the following variants of FMA:

NOTE: follow-up commit with the missing clang-side changes.

- f16, f16x2
  - rn
  - rn_ftz
  - rn_sat
  - rn_ftz_sat
  - rn_relu
  - rn_ftz_relu
- bf16, bf16x2
  - rn
  - rn_relu

ptxas (Cuda compilation tools, release 11.0, V11.0.194) is happy with the generated assembly.

Differential Revision: https://reviews.llvm.org/D118977
2022-03-01 11:07:11 -08:00
Jakub Chlanda 7a6d692b3b [NVPTX] Expose float tys min, max, abs, neg as builtins
Adds support for the following builtins:

abs, neg:
- .bf16,
- .bf16x2
min, max
- {.ftz}{.NaN}{.xorsign.abs}.f16
- {.ftz}{.NaN}{.xorsign.abs}.f16x2
- {.NaN}{.xorsign.abs}.bf16
- {.NaN}{.xorsign.abs}.bf16x2
- {.ftz}{.NaN}{.xorsign.abs}.f32

Differential Revision: https://reviews.llvm.org/D117887
2022-03-01 11:07:11 -08:00
Zequan Wu e527986a9c [llvm-pdbutil] Fix crashes when TypeIndex is simple or doesn't exist in type stream
- Print simple TypeIndex
- Print error message when type doesn't exist.

Differential Revision: https://reviews.llvm.org/D120692
2022-03-01 11:04:56 -08:00
Bixia Zheng 20eaa88fff [mlir][sparse] Extend convertToMLIRSparseTensor to support permutation and more general sparsity values.
Previously, convertToMLIRSparseTensor assumes identity storage ordering and all
compressed dimensions. This change extends the function with two parameters for
users to specify the storage ordering and the sparsity of each dimension.

Modify PyTACO to reflect this change.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D120643
2022-03-01 10:51:39 -08:00
Michał Górny ba4f1e44e4 [libcxx] Add an explicit option to build against system-libcxxabi
Add an explicit LIBCXX_CXX_ABI=system-libcxxabi option for linking to
system-installed libc++abi. This fixes the ability to link against one
when building libcxx via the runtimes build, as otherwise the build
system insists on linking into in-tree targets.

Differential Revision: https://reviews.llvm.org/D119539
2022-03-01 13:44:56 -05:00
Jorge Gorbe Moya 3de4e6b400 [bazel] add missing dependency 2022-03-01 10:43:27 -08:00
William S. Moses 78fb4f9d5d [SCF][MemRef] Enable SCF.Parallel Lowering to use Scope Op
As discussed in https://reviews.llvm.org/D119743 scf.parallel would continuously stack allocate since the alloca op was placd in the wsloop rather than the omp.parallel. This PR is the second stage of the fix for that problem. Specifically, we now introduce an alloca scope around the inlined body of the scf.parallel and enable a canonicalization to hoist the allocations to the surrounding allocation scope (e.g. omp.parallel).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D120423
2022-03-01 13:25:09 -05:00
Craig Topper b9d6e8c441 [RISCV] Lower VECTOR_SPLICE to RVV instructions.
This lowers VECTOR_SPLICE of scalable vectors to a slidedown follow by a slideup.
Fixed vectors are encouraged to use shufflevector instruction. The equivalent patch
for fixed vectors is D119039.

I've used a tail agnostic slidedown and limited the VL to only the
elements that will not be overwritten by the slideup. The slideup
uses VLMax for its VL. It unfortunately uses tail undisturbed policy
but it isn't required as there is no tail. We just need the merge
operand to carry the bits for the lower portion of the result.

Care was taken to ensure that either the slideup or slidedown will
be able to use a .vi instruction when the immediate is small. Which
one uses the immediate depends on the sign of the immediate.

Reviewed By: frasercrmck, ABataev

Differential Revision: https://reviews.llvm.org/D119303
2022-03-01 10:10:13 -08:00
Craig Topper 7bc6667845 [Analysis] Simplify the interface to llvm::getICmpCode. NFC
Instead of passing an InstCmpInt * and a bool just pass the predicate
from the caller.

I'm considering moving the similar FCmp functions from InstCombine
over here and this makes the interface consistent with what is used
for FCmp.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D120609
2022-03-01 09:53:27 -08:00