platform/upstream/llvm.git
2 years ago[clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs
Björn Schäpers [Thu, 24 Feb 2022 14:14:49 +0000 (15:14 +0100)]
[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

2 years ago[clang-format] Fix requires related crash
Björn Schäpers [Thu, 24 Feb 2022 14:14:49 +0000 (15:14 +0100)]
[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

2 years ago[clang-format] Allow to set token types final
Björn Schäpers [Thu, 24 Feb 2022 07:57:03 +0000 (08:57 +0100)]
[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

2 years ago[libc++][AIX] Use C++ overloads from libc++'s math.h
David Tenty [Mon, 7 Feb 2022 23:22:35 +0000 (18:22 -0500)]
[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>

2 years ago[SVE] Update patterns to commute FMLS multiplication operands
Cameron McInally [Tue, 1 Mar 2022 20:05:41 +0000 (12:05 -0800)]
[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

2 years ago[flang] Lower basic IO statement
Valentin Clement [Tue, 1 Mar 2022 20:47:40 +0000 (21:47 +0100)]
[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>
2 years ago[flang] Check constraint C711 correctly
Peter Klausler [Fri, 18 Feb 2022 20:25:58 +0000 (12:25 -0800)]
[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

2 years ago[mlir] Trim a huge number of unnecessary dependencies on the Func dialect
River Riddle [Mon, 28 Feb 2022 22:25:39 +0000 (14:25 -0800)]
[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.

2 years ago[mlir] Rename the Standard dialect to the Func dialect
River Riddle [Sat, 26 Feb 2022 22:49:54 +0000 (14:49 -0800)]
[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

2 years ago[libcxx] Make test case fmt specifiers more portable
Brian Cain [Fri, 25 Feb 2022 03:59:18 +0000 (19:59 -0800)]
[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

2 years ago[RISCV] Add more test case for absolute value. NFC
Craig Topper [Tue, 1 Mar 2022 19:50:43 +0000 (11:50 -0800)]
[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.

2 years agoCleanup includes: TransformsUtils
serge-sans-paille [Tue, 1 Mar 2022 13:28:22 +0000 (14:28 +0100)]
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

2 years agoAdd missing include under EXPENSIVE_CHECK
serge-sans-paille [Tue, 1 Mar 2022 19:59:08 +0000 (20:59 +0100)]
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

2 years ago[mlir] Fix unused var warning in the IR/MemRefOps.cpp
rdzhabarov [Tue, 1 Mar 2022 19:44:12 +0000 (19:44 +0000)]
[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

2 years ago[RISCV] Fix the indentation of 'ret' in rv*zb*-intrinsic.ll tests. NFC
Craig Topper [Tue, 1 Mar 2022 19:36:34 +0000 (11:36 -0800)]
[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.

2 years ago[libc++] Add `explicit` to a bunch of internal detail ctors.
Arthur O'Dwyer [Wed, 9 Feb 2022 22:30:46 +0000 (17:30 -0500)]
[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

2 years agoFix -DLLVM_ENABLE_EXPENSIVE_CHECKS=on build after D120659
Fangrui Song [Tue, 1 Mar 2022 19:36:25 +0000 (11:36 -0800)]
Fix -DLLVM_ENABLE_EXPENSIVE_CHECKS=on build after D120659

2 years ago[libcxx] [test] Fix the put_double, put_long_double tests for clang-cl
Martin Storsjö [Thu, 10 Feb 2022 09:56:44 +0000 (09:56 +0000)]
[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

2 years ago[libcxx] [test] Add a 'win32-' prefix to the 'broken-utf8-wchar-ctype' feature
Martin Storsjö [Thu, 24 Feb 2022 11:14:21 +0000 (13:14 +0200)]
[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

2 years agoFix build breaks on ml-* bots introduced by include cleanups
Mircea Trofin [Tue, 1 Mar 2022 19:28:51 +0000 (11:28 -0800)]
Fix build breaks on ml-* bots introduced by include cleanups

2 years ago[libc++] Remove _LIBCPP_HAS_NO_STRONG_ENUMS.
Mark de Wever [Fri, 11 Feb 2022 18:34:33 +0000 (19:34 +0100)]
[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

2 years ago[mlir][sparse] fix compile-time warning
Aart Bik [Tue, 1 Mar 2022 19:21:50 +0000 (11:21 -0800)]
[mlir][sparse] fix compile-time warning

Reviewed By: bixia

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

2 years ago[libc++] Remove extraneous space in module.modulemap. NFC.
Arthur O'Dwyer [Tue, 1 Mar 2022 19:25:09 +0000 (14:25 -0500)]
[libc++] Remove extraneous space in module.modulemap. NFC.

2 years ago[libc++] [test] Improve the tests for std::{begin,end}(valarray).
Arthur O'Dwyer [Mon, 14 Feb 2022 04:28:19 +0000 (23:28 -0500)]
[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

2 years ago[NVPTX] Add ex2.approx.f16/f16x2 support
Nicolas Miller [Tue, 1 Mar 2022 18:34:02 +0000 (10:34 -0800)]
[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

2 years ago[NVPTX] Add more FMA intriniscs/builtins
Jakub Chlanda [Tue, 1 Mar 2022 18:29:54 +0000 (10:29 -0800)]
[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

2 years ago[NVPTX] Expose float tys min, max, abs, neg as builtins
Jakub Chlanda [Tue, 1 Mar 2022 18:15:07 +0000 (10:15 -0800)]
[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

2 years ago[llvm-pdbutil] Fix crashes when TypeIndex is simple or doesn't exist in type stream
Zequan Wu [Tue, 1 Mar 2022 02:03:07 +0000 (18:03 -0800)]
[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

2 years ago[mlir][sparse] Extend convertToMLIRSparseTensor to support permutation and more gener...
Bixia Zheng [Mon, 28 Feb 2022 22:22:41 +0000 (14:22 -0800)]
[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

2 years ago[libcxx] Add an explicit option to build against system-libcxxabi
Michał Górny [Tue, 1 Mar 2022 18:43:25 +0000 (13:43 -0500)]
[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

2 years ago[bazel] add missing dependency
Jorge Gorbe Moya [Tue, 1 Mar 2022 18:43:27 +0000 (10:43 -0800)]
[bazel] add missing dependency

2 years ago[SCF][MemRef] Enable SCF.Parallel Lowering to use Scope Op
William S. Moses [Wed, 23 Feb 2022 19:08:51 +0000 (14:08 -0500)]
[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

2 years ago[RISCV] Lower VECTOR_SPLICE to RVV instructions.
Craig Topper [Tue, 1 Mar 2022 18:10:08 +0000 (10:10 -0800)]
[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

2 years ago[Analysis] Simplify the interface to llvm::getICmpCode. NFC
Craig Topper [Tue, 1 Mar 2022 17:53:26 +0000 (09:53 -0800)]
[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

2 years ago[SanitizerBounds] Add support for NoSanitizeBounds function
Tong Zhang [Tue, 1 Mar 2022 09:58:10 +0000 (10:58 +0100)]
[SanitizerBounds] Add support for NoSanitizeBounds function

Currently adding attribute no_sanitize("bounds") isn't disabling
-fsanitize=local-bounds (also enabled in -fsanitize=bounds). The Clang
frontend handles fsanitize=array-bounds which can already be disabled by
no_sanitize("bounds"). However, instrumentation added by the
BoundsChecking pass in the middle-end cannot be disabled by the
attribute.

The fix is very similar to D102772 that added the ability to selectively
disable sanitizer pass on certain functions.

In this patch, if no_sanitize("bounds") is provided, an additional
function attribute (NoSanitizeBounds) is attached to IR to let the
BoundsChecking pass know we want to disable local-bounds checking. In
order to support this feature, the IR is extended (similar to D102772)
to make Clang able to preserve the information and let BoundsChecking
pass know bounds checking is disabled for certain function.

Reviewed By: melver

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

2 years ago[Openmp]: Missing import statement in openmp interface for Fortran
Malhar Jajoo [Tue, 1 Mar 2022 10:51:21 +0000 (10:51 +0000)]
[Openmp]: Missing import statement in openmp interface for Fortran

Essentially removed the "use omp_lib_kinds" statement and replaced it
with import to maintain consistency (and avoid compilation error
in case the omp_lib_kinds.mod file is not accessible) in header file.

The import is required to access entities in host scoping unit.

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

2 years ago[libc++] Re generate header tests
Louis Dionne [Tue, 1 Mar 2022 17:17:32 +0000 (12:17 -0500)]
[libc++] Re generate header tests

This must have been missed in 368faacac7525.

2 years ago[libc] Remove the remaining uses of stdatomic.h.
Siva Chandra Reddy [Tue, 1 Mar 2022 08:54:46 +0000 (08:54 +0000)]
[libc] Remove the remaining uses of stdatomic.h.

New methods to the Atomic class have been added as required. Futex
related types have been consolidated at a common place.

Reviewed By: lntue

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

2 years ago[mlir][spirv] Convert gpu.barrier to spv.ControlBarrier
Lei Zhang [Tue, 1 Mar 2022 17:00:38 +0000 (12:00 -0500)]
[mlir][spirv] Convert gpu.barrier to spv.ControlBarrier

Reviewed By: ThomasRaoux

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

2 years agoCleanup includes: LLVMAnalysis
serge-sans-paille [Mon, 28 Feb 2022 13:08:36 +0000 (14:08 +0100)]
Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after:  1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120659

2 years ago[AMDGPU] Handle legacy multiply-accumulate opcodes in convertToThreeAddress
Jay Foad [Mon, 28 Feb 2022 16:56:19 +0000 (16:56 +0000)]
[AMDGPU] Handle legacy multiply-accumulate opcodes in convertToThreeAddress

Handle V_MAC_LEGACY_F32 and V_FMAC_LEGACY_F32 in
convertToThreeAddress, to avoid the need for an extra mov
instruction in some cases.

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

2 years ago[AMDGPU] Disentangle MFMA handling in convertToThreeAddress. NFC.
Jay Foad [Mon, 28 Feb 2022 16:33:20 +0000 (16:33 +0000)]
[AMDGPU] Disentangle MFMA handling in convertToThreeAddress. NFC.

Move MFMA handling to the top of convertToThreeAddress and pull
IsF16 calculation out of the switch. I think this makes it clearer
exactly which mac/fmac opcodes are handled, since they are now
listed in the switch with minimal extra clutter.

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

2 years ago[LLD] [COFF] Use StringTableBuilder to optimize the string table
Martin Storsjö [Mon, 28 Feb 2022 11:01:51 +0000 (13:01 +0200)]
[LLD] [COFF] Use StringTableBuilder to optimize the string table

This does tail merging (and deduplication) of the strings.

On a statically linked clang.exe, this shrinks the ~17 MB string
table by around 0.5 MB. This adds ~160 ms to the linking time
which originally was around 950 ms.

For cases where `-debug:symtab` or `-debug:dwarf` isn't set, the
string table is only used for long section names, where this
shouldn't make any difference at all.

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

2 years ago[AMDGPU] Fix test_fmaak_otherimm_src0_f64 test
Jay Foad [Tue, 1 Mar 2022 16:07:12 +0000 (16:07 +0000)]
[AMDGPU] Fix test_fmaak_otherimm_src0_f64 test

Judging by the name, and comparing with the f32 version, this was
supposed to be testing that FMAC with a non-inlinable constant
operand did not get converted to FMA.

2 years ago[NFC]Promote addInstantiatedParametersToScope to a private Sema function
Erich Keane [Tue, 1 Mar 2022 15:22:44 +0000 (07:22 -0800)]
[NFC]Promote addInstantiatedParametersToScope to a private Sema function

This is used a few places in SemaTeplateInstantiateDecl, but is going
to be useful in SemaConcept.cpp as well. This patch switches it to be
a private function in Sema.

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

2 years ago[NFC][analyzer] Allow CallDescriptions to be matched with CallExprs
Kristóf Umann [Fri, 4 Feb 2022 14:40:08 +0000 (15:40 +0100)]
[NFC][analyzer] Allow CallDescriptions to be matched with CallExprs

Since CallDescriptions can only be matched against CallEvents that are created
during symbolic execution, it was not possible to use it in syntactic-only
contexts. For example, even though InnerPointerChecker can check with its set of
CallDescriptions whether a function call is interested during analysis, its
unable to check without hassle whether a non-analyzer piece of code also calls
such a function.

The patch adds the ability to use CallDescriptions in syntactic contexts as
well. While we already have that in Signature, we still want to leverage the
ability to use dynamic information when we have it (function pointers, for
example). This could be done with Signature as well (StdLibraryFunctionsChecker
does it), but it makes it even less of a drop-in replacement.

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

2 years ago[UpdateTestChecks][AMDGPU] Run test update script
Joe Nash [Tue, 1 Mar 2022 15:25:33 +0000 (10:25 -0500)]
[UpdateTestChecks][AMDGPU] Run test update script

NFC. Run the mir test auto-update script. These tests haven't been updated
since the script changed from inserting CHECK to CHECK-NEXT.

2 years ago[libc] Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without...
Tue Ly [Mon, 7 Feb 2022 16:46:09 +0000 (11:46 -0500)]
[libc] Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without full build.

Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without full build.

Reviewed By: sivachandra

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

2 years ago[Clang-tidy] Check the existence of ElaboratedType's qualifiers
Jun Zhang [Wed, 16 Feb 2022 15:48:27 +0000 (23:48 +0800)]
[Clang-tidy] Check the existence of ElaboratedType's qualifiers

The ElaboratedType can have no qualifiers, so we should check it before
use.

Fix #issue53874(https://github.com/llvm/llvm-project/issues/53874)

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

2 years ago[X86] Add vector shift by scalar test with bitcasted scalar shift amount
Simon Pilgrim [Tue, 1 Mar 2022 15:40:30 +0000 (15:40 +0000)]
[X86] Add vector shift by scalar test with bitcasted scalar shift amount

As noted on D120553, we didn't have any tests that explicitly showed the bitcast - we were relying on i64 -> i32 legalization on 32-bit targets

2 years ago[DAGCombiner] Don't expand (neg (abs x)) if the abs has an additional user.
Craig Topper [Tue, 1 Mar 2022 15:16:39 +0000 (07:16 -0800)]
[DAGCombiner] Don't expand (neg (abs x)) if the abs has an additional user.

If the types aren't legal, the expansions may get type legalized in a
different way preventing code sharing. If the type is legal, we will
share some instructions between the two expansions, but we will need an
extra register.

Since we don't appear to fold (neg (sub A, B)) if the sub has an
additional user, I think it makes sense not to expand NABS.

Reviewed By: RKSimon

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

2 years ago[RISCV] Add test cases miscompile of (rotl (grevi X, 24), 16) on RV64. NFC
Craig Topper [Mon, 28 Feb 2022 20:59:48 +0000 (12:59 -0800)]
[RISCV] Add test cases miscompile of (rotl (grevi X, 24), 16) on RV64. NFC

This pattern was moved from isel to DAG combine in D119527, but
it lost the RV32 qualification in the process.

2 years ago[InstCombine] Support phi to cond fold with more than two preds
Nikita Popov [Tue, 1 Mar 2022 14:46:25 +0000 (15:46 +0100)]
[InstCombine] Support phi to cond fold with more than two preds

This transform can still be applied if there are more than two
phi inputs, as long as phi inputs with the same value are dominated
by the same idom edge.

2 years ago[PowerPC] Remove redundant MMA patterns.
Stefan Pintilie [Mon, 28 Feb 2022 21:34:19 +0000 (15:34 -0600)]
[PowerPC] Remove redundant MMA patterns.

There are two MMA patterns that have been added twice. This patch just removes
one set of petterns. Should not change the way MMA behaves.

Reviewed By: lei, #powerpc

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

2 years ago[InstCombine] Add additional test for phi to condition fold (NFC)
Nikita Popov [Tue, 1 Mar 2022 15:07:47 +0000 (16:07 +0100)]
[InstCombine] Add additional test for phi to condition fold (NFC)

This one does not have an intermediate block for the true branch,
and demonstrates the importance of using edge dominance.

2 years ago[clang] Improve laziness of resolving module map headers.
Adam Czachorowski [Fri, 25 Feb 2022 16:21:32 +0000 (17:21 +0100)]
[clang] Improve laziness of resolving module map headers.

clang has support for lazy headers in module maps - if size and/or
modtime and provided in the cppmap file, headers are only resolved when
an include directive for a file with that size/modtime is encoutered.

Before this change, the lazy resolution was all-or-nothing per module.
That means as soon as even one file in that module potentially matched
an include, all lazy files in that module were resolved. With this
change, only files with matching size/modtime will be resolved.

The goal is to avoid unnecessary stat() calls on non-included files,
which is especially valuable on networked file systems, with higher
latency.

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

2 years ago[AMDGPU] Preserve src2_modifiers in convertToThreeAddress
Jay Foad [Tue, 1 Mar 2022 11:12:00 +0000 (11:12 +0000)]
[AMDGPU] Preserve src2_modifiers in convertToThreeAddress

Found by code inspection. I don't think it makes a difference with
current codegen, because if any source modifiers were present we
would have selected mad/fma instead of mac/fmac in the first place.

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

2 years ago[InstCombine] Add more tests for phi to cond fold (NFC)
Nikita Popov [Tue, 1 Mar 2022 14:47:28 +0000 (15:47 +0100)]
[InstCombine] Add more tests for phi to cond fold (NFC)

These have more than two predecessors.

2 years ago[UpdateTestChecks] Add requires asserts to tests
Sebastian Neubauer [Tue, 1 Mar 2022 14:28:19 +0000 (15:28 +0100)]
[UpdateTestChecks] Add requires asserts to tests

The tests use debug-only, which is only available in debug mode.
This should fix the failing tests.

2 years ago[LV] Add test with multiple use of a FOR chained together.
Florian Hahn [Tue, 1 Mar 2022 11:28:40 +0000 (11:28 +0000)]
[LV] Add test with multiple use of a FOR chained together.

Additional test coverage for D118642.

2 years ago[InstCombine] Slightly relax one-use check in abs canonicalization
Nikita Popov [Tue, 1 Mar 2022 14:05:34 +0000 (15:05 +0100)]
[InstCombine] Slightly relax one-use check in abs canonicalization

Treat the icmp and sub symmetrically, and require that one of them
has one use, not the icmp in particular. This could be further
relaxed in the abs (but not nabs) case to not check one-use at
all.

2 years ago[AArch64] Pass Reg instead of MI to tryToFindRenameRegister (NFC).
Florian Hahn [Tue, 1 Mar 2022 14:02:02 +0000 (14:02 +0000)]
[AArch64] Pass Reg instead of MI to tryToFindRenameRegister (NFC).

FirstMI is only used to get the load/store operand and the machine
function. Pass the MF and register explicitly, so the helper can be used
to find rename registers for other instructions in the future.

2 years ago[LoopVectorize] Regenerate test checks (NFC)
Nikita Popov [Tue, 1 Mar 2022 14:01:00 +0000 (15:01 +0100)]
[LoopVectorize] Regenerate test checks (NFC)

2 years ago[InstCombine] drop FMF in select->copysign transform
Sanjay Patel [Tue, 1 Mar 2022 13:48:37 +0000 (08:48 -0500)]
[InstCombine] drop FMF in select->copysign transform

It is not correct to propagate flags from the select
to the new instructions:
https://alive2.llvm.org/ce/z/tNATrd
https://alive2.llvm.org/ce/z/VwcVzn

Fixes #54077

2 years ago[InstCombine] add test for copysign with FMF propagation; NFC
Sanjay Patel [Tue, 1 Mar 2022 13:24:25 +0000 (08:24 -0500)]
[InstCombine] add test for copysign with FMF propagation; NFC

This is a miscompile as noted in #54077.

2 years ago[InstCombine] Remove SPF min/max check from select demanded bits (NFCI)
Nikita Popov [Thu, 24 Feb 2022 14:05:15 +0000 (15:05 +0100)]
[InstCombine] Remove SPF min/max check from select demanded bits (NFCI)

This should no longer be necessary now that we canonicalize to
intrinsics. This may not be entirely NFC in practice if worklist
order gets inverted and we perform demanded bits simplification
of a select user before the select is canonicalized.

2 years ago[runtimes] Remove FOO_TARGET_TRIPLE, FOO_SYSROOT and FOO_GCC_TOOLCHAIN
Louis Dionne [Tue, 12 Oct 2021 19:59:08 +0000 (15:59 -0400)]
[runtimes] Remove FOO_TARGET_TRIPLE, FOO_SYSROOT and FOO_GCC_TOOLCHAIN

Instead, folks can use the equivalent variables provided by CMake
to set those. This removal aims to reduce complexity and potential
for confusion when setting the target triple for building the runtimes,
and make it correct when `CMAKE_OSX_ARCHITECTURES` is used (right now
both `-arch` and `--target=` will end up being passed, which is downright
incorrect).

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

2 years ago[libc++] Revert "Protect users from relying on detail headers" & related changes
Louis Dionne [Mon, 28 Feb 2022 21:37:25 +0000 (16:37 -0500)]
[libc++] Revert "Protect users from relying on detail headers" & related changes

This commit reverts 5aaefa51 (and also partly 7f285f48e77 and b6d75682f9,
which were related to the original commit). As landed, 5aaefa51 had
unintended consequences on some downstream bots and didn't have proper
coverage upstream due to a few subtle things. Implementing this is
something we should do in libc++, however we'll first need to address
a few issues listed in https://reviews.llvm.org/D106124#3349710.

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

2 years ago[mlir] disallow side-effecting ops in llvm.mlir.global
Alex Zinenko [Tue, 1 Mar 2022 13:15:13 +0000 (14:15 +0100)]
[mlir] disallow side-effecting ops in llvm.mlir.global

The llvm.mlir.global operation accepts a region as initializer. This region
corresponds to an LLVM IR constant expression and therefore should not accept
operations with side effects. Add a corresponding verifier.

Reviewed By: wsmoses, bondhugula

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

2 years ago[Dexter] Optimize breakpoint deletion in Visual Studio
gbtozers [Fri, 25 Feb 2022 17:40:18 +0000 (17:40 +0000)]
[Dexter] Optimize breakpoint deletion in Visual Studio

Breakpoint deletion in visual studio is currently implemented by
iterating over the breakpoints we want to delete, for each of which we
iterate over the complete set of breakpoints in the debugger instance
until we find the one we wish to delete. Ideally we would resolve this
by directly deleting each breakpoint by some ID rather than searching
through the full breakpoint list for them, but in the absence of such a
feature in VS we can instead invert the loop to improve performance.

This patch changes breakpoint deletion to iterate over the complete list
of breakpoints, deleting breakpoints that match the breakpoints we
expect to delete by checking set membership. This represents a
worst-case improvement from O(nm) to O(n), for 'm' breakpoints being
deleted out of 'n' total. In practise this is almost exactly 'm'-times
faster, as when we delete multiple breakpoints they are typically
adjacent in the full breakpoint list.

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

2 years ago[clang-tidy] Fix `readability-const-return-type` for pure virtual function.
Sockke [Tue, 1 Mar 2022 12:54:10 +0000 (20:54 +0800)]
[clang-tidy] Fix `readability-const-return-type` for pure virtual function.

It cannot match a `pure virtual function`. This patch fixes this behavior.

Reviewed By: aaron.ballman

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

2 years ago[DebugInfo][InstrRef][NFC] Use unique_ptr instead of raw pointers
Jeremy Morse [Tue, 1 Mar 2022 12:46:50 +0000 (12:46 +0000)]
[DebugInfo][InstrRef][NFC] Use unique_ptr instead of raw pointers

InstrRefBasedLDV allocates some big tables of ValueIDNum, to store live-in
and live-out block values in, that then get passed around as pointers
everywhere. This patch wraps the allocation in a std::unique_ptr, names
some types based on unique_ptr, and passes references to those around
instead. There's no functional change, but it makes it clearer to the
reader that references to these tables are borrowed rather than owned, and
we get some extra validity assertions too.

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

2 years ago[demangler] Add co_await demangling
Nathan Sidwell [Fri, 18 Feb 2022 17:51:24 +0000 (09:51 -0800)]
[demangler] Add co_await demangling

The demangler doesn't understand 'aw' as an operator name. This adds
the necessary smarts -- you may use this as an operator functionname,
but not as an expression operator.

Reviewed By: ChuanqiXu

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

2 years ago[AArch64] Remove unused argument from tryToFindRegisterToRename (NFC).
Florian Hahn [Tue, 1 Mar 2022 12:44:03 +0000 (12:44 +0000)]
[AArch64] Remove unused argument from tryToFindRegisterToRename (NFC).

The MI argument is not used by the function. Remove it.

2 years ago[demangler][NFC] Tabularize operator name parsing
Nathan Sidwell [Thu, 27 Jan 2022 21:23:16 +0000 (13:23 -0800)]
[demangler][NFC] Tabularize operator name parsing

We need to parse operator names in 3 places -- expressions, names &
fold expressions.  Currently we have 3 separate pieces to do this, and a FIXME.

The operator name and expression parsing are implemented as
handwritten two-character nested switches, the fold expression is a
sequence of string comparisons.

This adds a new OperatorInfo class to encode the operator info
(encoding, kind, name), and has a table that it can binary search.
From that each of the above 3 uses are altered to use the new scheme.

Existing tests cover parsing operator encodings.

Reviewed By: ChuanqiXu

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

2 years agoRevert "[lit] Read command stdout/stderr as text on Windows"
Martin Storsjö [Tue, 1 Mar 2022 12:42:49 +0000 (14:42 +0200)]
Revert "[lit] Read command stdout/stderr as text on Windows"

This reverts commit 640e45b9b2205ba18a4a562a9404418d8b90abda.

That commit seemed to quite conclusively break a number of buildbots.

2 years ago[demangler] Improve buffer hysteresis
Nathan Sidwell [Wed, 16 Feb 2022 16:03:24 +0000 (08:03 -0800)]
[demangler] Improve buffer hysteresis

Improve demangler buffer hysteresis.  If we needed more than double
the buffer, the original code would allocate exactly the amount
needed, and thus consequently the next request would also realloc.
We're very unlikely to get into wanting more than double, after the
first allocation, as it would require the user to have used an
identifier larger than the hysteresis.  With machine generated code
that's possible, but unlikely.

Reviewed By: ChuanqiXu

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

2 years ago[demangler] Simplify SwapAndRestore
Nathan Sidwell [Mon, 28 Feb 2022 20:04:37 +0000 (12:04 -0800)]
[demangler] Simplify SwapAndRestore

The SwapAndRestore class is over engineered.  Nothing makes use of the
early restoration machinery.  Let's just remove that cognative burdon.

Reviewed By: ChuanqiXu

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

2 years ago[Clang] Add `-funstable` flag to enable unstable and experimental features
Egor Zhdan [Fri, 18 Feb 2022 21:04:49 +0000 (21:04 +0000)]
[Clang] Add `-funstable` flag to enable unstable and experimental features

This new flag enables `__has_feature(cxx_unstable)` that would replace libc++ macros for individual unstable/experimental features, e.g. `_LIBCPP_HAS_NO_INCOMPLETE_RANGES` or `_LIBCPP_HAS_NO_INCOMPLETE_FORMAT`.

This would make it easier and more convenient to opt-in into all libc++ unstable features at once.

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

2 years ago[lit] Read command stdout/stderr as text on Windows
Martin Storsjö [Sat, 26 Feb 2022 22:16:24 +0000 (00:16 +0200)]
[lit] Read command stdout/stderr as text on Windows

This takes care of normalizing newlines back to single LF instead
of CRLF.

This on itself breaks on a couple tests that accidentally seem to
be writing binary data to stdout; make sure those cases are piped
to /dev/null instead of actually written to a terminal.

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

2 years ago[FuncSpec] Remove definitions of fully specialized functions.
Alexandros Lamprineas [Tue, 1 Mar 2022 11:57:08 +0000 (11:57 +0000)]
[FuncSpec] Remove definitions of fully specialized functions.

A function is basically dead when:
 * it has no uses
 * it has only self-referencing uses (it's recursive)

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

2 years ago[FuncSpec][NFC] Improve debug messages.
Alexandros Lamprineas [Tue, 1 Mar 2022 11:41:42 +0000 (11:41 +0000)]
[FuncSpec][NFC] Improve debug messages.

Adds diagnostic messages when debugging the pass.

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

2 years ago[objcopy] Refactor CommonConfig to add posibility to specify added/updated sections...
Alexey Lapshin [Thu, 24 Feb 2022 09:58:05 +0000 (12:58 +0300)]
[objcopy] Refactor CommonConfig to add posibility to specify added/updated sections as MemoryBuffer.

Current objcopy implementation has a possibility to add or update sections.
The incoming section is specified as a pair: section name and name of the file
containing section data. The interface does not allow to specify incoming
section as a memory buffer. This patch adds possibility to specify incoming
section as a memory buffer.

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

2 years ago[FuncSpec][NFC] Variable renaming.
Alexandros Lamprineas [Tue, 15 Feb 2022 12:19:19 +0000 (12:19 +0000)]
[FuncSpec][NFC] Variable renaming.

Just preparing the ground for follow up patches to make the reviews easier.

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

2 years ago[AArch64] NFC: Change description of Streaming SVE mode.
Sander de Smalen [Mon, 28 Feb 2022 15:42:34 +0000 (15:42 +0000)]
[AArch64] NFC: Change description of Streaming SVE mode.

Streaming SVE mode includes more than just the streaming compatible
SVE/SVE2/NEON instructions.

2 years ago[AMDGPU] Precommit tests for D120709
Jay Foad [Tue, 1 Mar 2022 11:09:54 +0000 (11:09 +0000)]
[AMDGPU] Precommit tests for D120709

2 years ago[NFC][clang-tidy][docs] Remove mention of backported fix of `readability-suspicious...
Whisperity [Tue, 1 Mar 2022 11:06:59 +0000 (12:06 +0100)]
[NFC][clang-tidy][docs] Remove mention of backported fix of `readability-suspicious-call-argument` from `ReleaseNotes`

Commit 416e689ecda66616da855c82f7ec652657730c6a introduced a fix to
`readability-suspicious-call-argument` which added an entry to the
Release Notes, but the same change was backported to **14.0** in commit
e89602b7b2ec12f20f2618cefb864c2b22d0048a.

Hence, this change is not a new thing of the to-be 15.0 release.

2 years ago[SCEV] Only verify BECounts for reachable loops (PR50523)
Nikita Popov [Mon, 28 Feb 2022 10:12:42 +0000 (11:12 +0100)]
[SCEV] Only verify BECounts for reachable loops (PR50523)

For unreachable loops, any BECount is legal, and since D98706 SCEV
can make use of this for loops that are unreachable due to constant
branches. To avoid false positives, adjust SCEV verification to only
check BECounts in reachable loops.

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

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

2 years ago[AArch64] Add tests with unnecessary dependency with faddp lowering.
Florian Hahn [Tue, 1 Mar 2022 10:30:33 +0000 (10:30 +0000)]
[AArch64] Add tests with unnecessary dependency with faddp lowering.

The added tests highlight an unnecessary cross-iteration dependency when
lowering reductions to faddp. This dependency can negatively impact
performance.

2 years ago[AArch64] Use common CHECK prefix for test, reducing duplicated checks.
Florian Hahn [Tue, 1 Mar 2022 10:30:29 +0000 (10:30 +0000)]
[AArch64] Use common CHECK prefix for test, reducing duplicated checks.

Use the common CHECK prefix with runlines with and without fullfp16.
This means no duplicated checks are generated for tests not using fp16.

2 years ago[NVPTX] Fix nvvm.match.sync*.i64 intrinsics return type (i64 -> i32)
Kristina Bessonova [Tue, 1 Mar 2022 10:21:15 +0000 (12:21 +0200)]
[NVPTX] Fix nvvm.match.sync*.i64 intrinsics return type (i64 -> i32)

NVVM IR specification defines them with i32 return type:

  declare i32 @llvm.nvvm.match.any.sync.i64(i32 %membermask, i64 %value)
  declare {i32, i1} @llvm.nvvm.match.all.sync.i64(i32 %membermask, i64 %value)
  ...
  The i32 return value is a 32-bit mask where bit position in mask corresponds
  to thread’s laneid.

as well as PTX ISA:

  9.7.12.8. Parallel Synchronization and Communication Instructions: match.sync

  match.any.sync.type  d, a, membermask;
  match.all.sync.type  d[|p], a, membermask;
  ...
  Destination d is a 32-bit mask where bit position in mask corresponds
  to thread’s laneid.

Additionally, ptxas doesn't accept intructions, produced by NVPTX backend.
After this patch, it compiles with no issues.

Reviewed By: tra

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

2 years ago[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py
Yatao Wang [Tue, 1 Mar 2022 09:54:24 +0000 (10:54 +0100)]
[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py

Add a check on run lines to pick up isel options in llc commands and allow
generating check lines of isel final output other than assembly. If llc command
line contains -debug-only=isel, update_llc_test_checks.py will try to scrub isel
output, otherwise, the script will fall back on default behaviour, which is try to
scrub assembly output instead.

The motivation of this change is to allow usage of update_llc_test_checks.py to
autogenerate checks of instruction selection results. In this way, we can detect
errors at an earlier stage before the compilation goes all the way to assembly.
It is an example of having some transparency for the stages between IR and
assembly. These generated tests are almost like "unit tests" of isel stage.

This patch only implements the initial change to differentiate isel output from
assembly output for Lanai. Other targets will not be supported for isel check
generation at the moment. Although adding support for it will only require
implementing the function regex and scrubber for corresponding targets.

The Lanai implementation was chosen mainly for the simplicity of demonstrating
the difference between isel checks and asm checks.

This patch also do not include the implementation of function prefix, which is
required for the generated isel checks to pass. I will put up a follow up revision
for the function prefix change to complete isel support.

Reviewed By: Flakebi

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

2 years ago[LLD] [COFF] Use the new encodeSectionName() helper for long section names
Martin Storsjö [Mon, 28 Feb 2022 21:07:16 +0000 (23:07 +0200)]
[LLD] [COFF] Use the new encodeSectionName() helper for long section names

The previous code used an unbounded sprintf, which in theory can
overflow, writing either the null terminator or the last digits
into the next struct member.

In practice, in LLD, all long section names are written sequentially
first at the start of the string table, followed by all the long
symbol names. Due to this, even if the total string table would
end up large, the long section names have fairly short offsets,
which is why this hasn't been an issue in practice.

I don't think it's worth trying to write a test that produces an
executable with enough long section names to make the section names
themselves exceed 10^6 bytes, which is currently necessary to trigger
faults with the previous form.

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

2 years ago[llvm][AArch64] Restore lit cfg for TypePromotion tests
David Spickett [Tue, 1 Mar 2022 09:28:15 +0000 (09:28 +0000)]
[llvm][AArch64] Restore lit cfg for TypePromotion tests

Accidentally deleted in 20d75059a2ea49117a3dc9a78fb5b815a84ae33e.

As seen in failures on https://lab.llvm.org/buildbot/#/builders/171/builds/10952.

2 years agoRevert "[TypePromotion] Avoid some unnecessary truncs"
Sam Parker [Tue, 1 Mar 2022 08:59:28 +0000 (08:59 +0000)]
Revert "[TypePromotion] Avoid some unnecessary truncs"

This reverts commit 281d29b8fed369c6ebe33ed85c518fc1ed81f44a.

Report of a miscompilation and awaiting a reproducer.

2 years ago[NFC][hwasan] Check __GLIBCXX__ before checking _GLIBCXX_RELEASE in test
Hans Wennborg [Tue, 1 Mar 2022 08:36:14 +0000 (09:36 +0100)]
[NFC][hwasan] Check __GLIBCXX__ before checking _GLIBCXX_RELEASE in test

_GLIBCXX_RELEASE wasn't defined before GCC 7.1.

This is another follow-up to https://reviews.llvm.org/D119161

2 years ago[C++20][Modules][8/8] Amend module visibility rules for partitions.
Iain Sandoe [Sun, 4 Apr 2021 11:31:31 +0000 (12:31 +0100)]
[C++20][Modules][8/8] Amend module visibility rules for partitions.

Implementation partitions bring two extra cases where we have
visibility of module-private data.

1) When we import a module implementation partition.
2) When a partition implementation imports the primary module intertace.

We maintain a record of direct imports into the current module since
partition decls from direct imports (but not trasitive ones) are visible.

The rules on decl-reachability are much more relaxed (with the standard
giving permission for an implementation to load dependent modules and for
the decls there to be reachable, but not visible).

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

2 years ago[mlir][OpDSL] Rename function to make signedness explicit (NFC).
gysit [Tue, 1 Mar 2022 08:10:51 +0000 (08:10 +0000)]
[mlir][OpDSL] Rename function to make signedness explicit (NFC).

The revision renames the following OpDSL functions:
```
TypeFn.cast -> TypeFn.cast_signed
BinaryFn.min -> BinaryFn.min_signed
BinaryFn.max -> BinaryFn.max_signed
```
The corresponding enum values on the C++ side are renamed accordingly:
```
#linalg.type_fn<cast> -> #linalg.type_fn<cast_signed>
#linalg.binary_fn<min> -> #linalg.binary_fn<min_signed>
#linalg.binary_fn<max> -> #linalg.binary_fn<max_signed>
```

Depends On D120110

Reviewed By: aartbik

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

2 years ago[RISCV] Add FMV_W_X and FMV_H_X instrutions to hasAllNBitUsers
Lian Wang [Tue, 1 Mar 2022 07:35:19 +0000 (07:35 +0000)]
[RISCV] Add FMV_W_X and FMV_H_X instrutions to hasAllNBitUsers

Reviewed By: craig.topper

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

2 years ago[MLIR][Standalone] Don't look for Python if bindings are OFF
Lorenzo Chelini [Wed, 23 Feb 2022 14:13:15 +0000 (15:13 +0100)]
[MLIR][Standalone] Don't look for Python if bindings are OFF

Reviewed By: stellaraccident

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