Rahman Lavaee [Thu, 24 Feb 2022 20:29:08 +0000 (12:29 -0800)]
Revert "Encode address offsets of basic blocks relative to the end of the previous basic blocks."
This reverts commit
029283c1c0d8d06fbf000f5682c56b8595a1101f.
The code in `ELFFile::decodeBBAddrMap` was not changed in the submitted patch.
Differential Revision: https://reviews.llvm.org/D120457
Reid Kleckner [Thu, 24 Feb 2022 21:12:48 +0000 (13:12 -0800)]
[lld/MachO] Fix +asserts build after recent change
Sanjay Patel [Thu, 24 Feb 2022 20:42:30 +0000 (15:42 -0500)]
[AArch64][x86] add tests for bitwise logic + shifts; NFC
Craig Topper [Thu, 24 Feb 2022 20:36:33 +0000 (12:36 -0800)]
[RISCV] Add tests for (neg (abs X)) where the abs has an additional user.
Fangrui Song [Thu, 24 Feb 2022 20:54:16 +0000 (12:54 -0800)]
[ELF][test] Remove invalid weak COMMON tests
GNU as reports `Error: symbol `foo' can not be both weak and common`,
though LLVM integrated assembler does not report an error yet.
Yitzhak Mandelbaum [Thu, 24 Feb 2022 20:02:00 +0000 (20:02 +0000)]
[clang][dataflow] Add limits to size of modeled data structures in environment.
Adds two new parameters to control the size of data structures modeled in the environment: # of values and depth of data structure. The environment already prevents creation of recursive data structures, but that was insufficient in practice. Very large structs still ground the analysis to a halt. These new parameters allow tuning the size more effectively.
In this patch, the parameters are set as internal constants. We leave to a future patch to make these proper model parameters.
Differential Revision: https://reviews.llvm.org/D120510
Jez Ng [Thu, 24 Feb 2022 20:39:59 +0000 (15:39 -0500)]
[lld-macho] Implement -why_live (without perf overhead)
This was based off @thakis' draft in {D103517}. I employed templates to ensure
the support for `-why_live` wouldn't slow down the regular non-why-live code
path.
No stat sig perf difference on my 3.2 GHz 16-Core Intel Xeon W:
base diff difference (95% CI)
sys_time 1.195 ± 0.015 1.199 ± 0.022 [ -0.4% .. +1.0%]
user_time 3.716 ± 0.022 3.701 ± 0.025 [ -0.7% .. -0.1%]
wall_time 4.606 ± 0.034 4.597 ± 0.046 [ -0.6% .. +0.2%]
samples 44 37
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D120377
Aaron Ballman [Thu, 24 Feb 2022 20:41:25 +0000 (15:41 -0500)]
Fix typo in file name; NFC
Aaron Ballman [Thu, 24 Feb 2022 20:30:30 +0000 (15:30 -0500)]
Add -Wno-strict-prototypes to C tests; NFC
This patch adds -Wno-strict-prototypes to all of the test cases that
use functions without prototypes, but not as the primary concern of the
test. e.g., attributes testing whether they can/cannot be applied to a
function without a prototype, etc.
This is done in preparation for enabling -Wstrict-prototypes by
default.
Aaron Ballman [Thu, 24 Feb 2022 20:27:07 +0000 (15:27 -0500)]
Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,
void func();
becomes
void func(void);
This is the final batch of tests being updated to add prototypes,
hopefully.
Valentin Clement [Thu, 24 Feb 2022 20:09:40 +0000 (21:09 +0100)]
[flang] Simple array assignment lowering
This patch handles lowering of simple array assignment.
```
a(:) = 10
```
or
```
a(1) = 1
```
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld, schweitz
Differential Revision: https://reviews.llvm.org/D120501
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Jay Foad [Mon, 14 Feb 2022 09:51:56 +0000 (09:51 +0000)]
[AMDGPU] Divergence-driven instruction selection for bitreverse
Differential Revision: https://reviews.llvm.org/D119702
Fangrui Song [Thu, 24 Feb 2022 20:21:40 +0000 (12:21 -0800)]
[ELF] Simplify --fortran-common. NFC
Fangrui Song [Thu, 24 Feb 2022 20:20:05 +0000 (12:20 -0800)]
[ELF] De-template Symbol::resolveLazy. NFC
Damian Rouson [Fri, 12 Nov 2021 00:24:01 +0000 (16:24 -0800)]
[flang] add semantics tests for sync team
Test a range of acceptable forms of SYNC TEAM statements,
including combinations with and without the stat-variable
and errmsg-variable present. Also test that several invalid
forms of SYNC TEAM call generate the correct error messages.
Differential Revision: https://reviews.llvm.org/D120099
Alexey Bataev [Thu, 24 Feb 2022 20:04:39 +0000 (12:04 -0800)]
Revert "[OPENMP]Fix PR50347: Mapping of global scope deep object fails."
This reverts commit
638938117aeae5518d6cacd066ffd9830ef4fc9a. Need to
fix reported fail https://lab.llvm.org/buildbot/#/builders/193/builds/7496
Alexey Bataev [Thu, 1 Jul 2021 11:16:56 +0000 (04:16 -0700)]
[OPENMP]Fix PR50347: Mapping of global scope deep object fails.
Changed the we handle llvm::Constants in sizes arrays. ConstExprs and
GlobalValues cannot be used as initializers, need to put them at the
runtime, otherwise there wight be the compilation errors.
Differential Revision: https://reviews.llvm.org/D105297
Yuanfang Chen [Thu, 24 Feb 2022 19:46:37 +0000 (11:46 -0800)]
[CMake][WinMsvc] Replace MSVC_BASE/WINSDK_BASE with LLVM_WINSYSROOT
- Using LLVM_WINSYSROOT would pick up DIA SDK path automatically,
otherwise llvm-pdbutil has no DIA support.
- Add MSVC_VER to specify VC tools version.
- Make MSVC_VER/WINSDK_VER optional. If not specified, use the highest
version number like the driver does.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D117852
Simon Pilgrim [Thu, 24 Feb 2022 19:18:37 +0000 (19:18 +0000)]
[DAG] Attempt to fold bswap(shl(x,c)) -> zext(bswap(trunc(shl(x,c-bw/2))))
If the shl is at least half the bitwidth (i.e. the lower half of the bswap source is zero), then we can reduce the shift and perform the bswap at half the bitwidth and just zero extend.
Based off PR51391 + PR53867
Differential Revision: https://reviews.llvm.org/D120192
David Green [Thu, 24 Feb 2022 19:33:45 +0000 (19:33 +0000)]
[AArch64] Regenerate dp1.ll test, NFC
The old check lines were not showing enough congtext to show issues.
Regenerate the test with theua auto-check lines to be clearer.
Fangrui Song [Thu, 24 Feb 2022 19:31:58 +0000 (11:31 -0800)]
[ELF] Set config->exportDynamic to true if config->shared. NFC
Stanislav Mekhanoshin [Tue, 22 Feb 2022 20:26:41 +0000 (12:26 -0800)]
[AMDGPU] Extend SILoadStoreOptimizer to handle global stores
TODO: merge flat load/stores.
TODO: merge flat with global promoting to flat.
Differential Revision: https://reviews.llvm.org/D120346
Damian Rouson [Fri, 12 Nov 2021 00:22:38 +0000 (16:22 -0800)]
[flang] add semantics test for sync memory
Test a range of acceptable forms of SYNC MEMORY statements,
including combinations with and without the stat-variable
and errmsg-variable present. Also test that several invalid
forms of SYNC MEMORY call generate the correct error messages.
Differential Revision: https://reviews.llvm.org/D120097
Momchil Velikov [Thu, 24 Feb 2022 18:36:37 +0000 (18:36 +0000)]
[AArch64] Async unwind - Always place the first LDP at the end when ReverseCSRRestoreSeq is true
This patch is in preparation for the async unwind CFI.
Put the first `LDP` the end, so that the load-store optimizer can run
and merge the `LDP` and the `ADD` into a post-index `LDP`.
Do this always and as early as at the time of the initial creation of
the CSR restore instructions, even if that `LDP` is not guaranteed to
be mergeable with a subsequent `SP` increment.
This greatly simplifies the CFI generation for prologue, as otherwise
we have to take extra steps to ensure reordering does not cross CFI
instructions.
Reviewed By: danielkiss
Differential Revision: https://reviews.llvm.org/D112328
Stanislav Mekhanoshin [Wed, 23 Feb 2022 00:33:06 +0000 (16:33 -0800)]
[AMDGPU] Fix combined MMO in load-store merge
Loads and stores can be out of order in the SILoadStoreOptimizer.
When combining MachineMemOperands of two instructions operands are
sent in the IR order into the combineKnownAdjacentMMOs. At the
moment it picks the first operand and just replaces its offset and
size. This essentially loses alignment information and may generally
result in an incorrect base pointer to be used.
Use a base pointer in memory addresses order instead and only adjust
size.
Differential Revision: https://reviews.llvm.org/D120370
Amir Ayupov [Wed, 16 Feb 2022 01:27:31 +0000 (17:27 -0800)]
[X86] Introduce x86-cmov-converter-force-all
Introduce an option to expand all CMOV groups into hammocks, matching GCC's
`-fno-if-conversion2` flag. The motivation is to leave CMOV conversion
opportunities to a binary optimizer that can make the decision based on branch
misprediction rate (available e.g. in Intel's LBR).
Reviewed By: MaskRay, skan
Differential Revision: https://reviews.llvm.org/D119777
Benjamin Kramer [Thu, 24 Feb 2022 18:30:50 +0000 (19:30 +0100)]
[tblgen] Compress CompositeSequences to 1/8th of its size. NFCI.
Craig Topper [Thu, 24 Feb 2022 18:15:07 +0000 (10:15 -0800)]
[RISCV] Add Zbb RUN lines to neg-abs.ll.
Momchil Velikov [Thu, 24 Feb 2022 17:36:19 +0000 (17:36 +0000)]
[AArch64] Async unwind - helper functions to decide on CFI emission
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D112327
Fangrui Song [Thu, 24 Feb 2022 18:06:11 +0000 (10:06 -0800)]
[analyzer] Just use default capture after
7fd60ee6e0a87957a718297a4a42d9881fc561e3
Thomas Raoux [Wed, 16 Feb 2022 07:49:32 +0000 (23:49 -0800)]
[mlir][memref] Add transformation to do loop multi-buffering
This transformation is useful to break dependency between consecutive loop
iterations by increasing the size of a temporary buffer. This is usually
combined with heavy software pipelining.
Differential Revision: https://reviews.llvm.org/D119406
Craig Topper [Thu, 24 Feb 2022 17:23:14 +0000 (09:23 -0800)]
[RISCV] Update some tests to use floating point ABI where it makes sense.
Trying to reduce the diffs from D118333 for cases where it makes
more sense to use an FP ABI.
Reviewed By: asb, kito-cheng
Differential Revision: https://reviews.llvm.org/D120447
Momchil Velikov [Thu, 24 Feb 2022 16:08:14 +0000 (16:08 +0000)]
[AArch64] Async unwind - do not schedule frame setup/destroy
The PostRA scheduler can reorder non-CFI instructions in a way that
makes the unwind info not instruction precise.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D112326
Craig Topper [Thu, 24 Feb 2022 17:18:48 +0000 (09:18 -0800)]
[RISCV] Fold (sext_inreg (fmv_x_anyexth X), i16) -> (fmv_x_signexth X).
Add a new ISD opcode to represent the sign extending behavior of
vmv.x.h. Keep the previous anyext opcode to allow the existing
(fmv_x_anyexth (fmv_h_x X)) combine to keep working without needing
to generate a sign extend.
For fmv.x.w we are able to match the sext_inreg in an isel pattern,
but a 16-bit sext_inreg is lowered to a shift pair before isel. This
seemed like a larger match than we should do in isel.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D118974
Valentin Clement [Thu, 24 Feb 2022 17:11:41 +0000 (18:11 +0100)]
[flang] Lower allocatable assignment for scalar
Add lowering for simple assignement on allocatable
scalars.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120483
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D120488
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Stanislav Gatev [Wed, 23 Feb 2022 15:39:26 +0000 (15:39 +0000)]
[clang][dataflow] Update StructValue child when assigning a value
When assigning a value to a storage location of a struct member we
need to also update the value in the corresponding `StructValue`.
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D120414
Sven van Haastregt [Thu, 24 Feb 2022 16:28:52 +0000 (16:28 +0000)]
[clang-tidy] Remove opencl-c.h inclusion from tests
After D120254 some clang-tidy tests started failing on release builds.
clang-tidy has been using the `-fdeclare-opencl-builtins` functionality
since this became the default in clang, so there is no need to include
`opencl-c.h`.
Differential Revision: https://reviews.llvm.org/D120470
Sanjay Patel [Thu, 24 Feb 2022 16:09:57 +0000 (11:09 -0500)]
[SDAG] remove shift that is redundant with part of funnel shift
This is the SDAG translation of D120253 :
https://alive2.llvm.org/ce/z/qHpmNn
The SDAG nodes can have different operand types than the result value.
We can see an example of that with AArch64 - the funnel shift amount
is an i64 rather than i32.
We may need to make that match even more flexible to handle
post-legalization nodes, but I have not stepped into that yet.
Differential Revision: https://reviews.llvm.org/D120264
Valentin Clement [Thu, 24 Feb 2022 16:16:02 +0000 (17:16 +0100)]
[flang] Handle allocatable dummy arguments
This patch handles allocatable dummy argument lowering
in function and subroutines.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D120483
Co-authored-by: Jean Perier <jperier@nvidia.com>
Anton Korobeynikov [Thu, 24 Feb 2022 16:03:21 +0000 (19:03 +0300)]
Disable Mailgun click tracking
Aaron Ballman [Thu, 24 Feb 2022 16:00:40 +0000 (11:00 -0500)]
Remove useless RUN lines in the middle of the file and pipe to FileCheck; NFC
Joseph Huber [Thu, 24 Feb 2022 15:24:39 +0000 (10:24 -0500)]
[OpenMP] Make section variable external to prevent collisions
Summary:
We use a section to embed offloading code into the host for later
linking. This is normally unique to the translation unit as it is thrown
away during linking. However, if the user performs a relocatable link
the sections will be merged and we won't be able to access the files
stored inside. This patch changes the section variables to have external
linkage and a name defined by the section name, so if two sections are
combined during linking we get an error.
Sanjay Patel [Thu, 24 Feb 2022 15:20:18 +0000 (10:20 -0500)]
[InstCombine] try harder to preserve 'nsz' in fneg-of-select transform
The corner case where 'nsz' needs to be removed is very narrow
as discussed here:
https://reviews.llvm.org/rG3cdd05e519dd
If the select condition is not undef, there's no problem with
propagating 'nsz':
https://alive2.llvm.org/ce/z/4GWJdq
Sanjay Patel [Thu, 24 Feb 2022 15:19:23 +0000 (10:19 -0500)]
[InstCombine] add test for fneg of select with FMF; NFC
Jay Foad [Wed, 23 Feb 2022 11:35:55 +0000 (11:35 +0000)]
[MIRParser] Diagnose too large align values in MachineMemOperands
When parsing MachineMemOperands, MIRParser treated the "align" keyword
the same as "basealign". Really "basealign" should specify the
alignment of the MachinePointerInfo base value, and "align" should
specify the alignment of that base value plus the offset.
This worked OK when the specified alignment was no larger than the
alignment of the offset, but in cases like this it just caused
confusion:
STW killed %18, 4, %stack.1.ap2.i.i :: (store (s32) into %stack.1.ap2.i.i + 4, align 8)
MIRPrinter would never have printed this, with an offset of 4 but an
align of 8, so it must have been written by hand. MIRParser would
interpret "align 8" as "basealign 8", but I think it is better to give
an error and force the user to write "basealign 8" if that is what they
really meant.
Differential Revision: https://reviews.llvm.org/D120400
Change-Id: I7eeeefc55c2df3554ba8d89f8809a2f45ada32d8
Marius Brehler [Thu, 17 Feb 2022 09:57:09 +0000 (09:57 +0000)]
[mlir][emitc] Add a variable op
This adds a variable op, emitted as C/C++ locale variable, which can be
used if the `emitc.constant` op is not sufficient.
As an example, the canonicalization pass would transform
```mlir
%0 = "emitc.constant"() {value = 0 : i32} : () -> i32
%1 = "emitc.constant"() {value = 0 : i32} : () -> i32
%2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
%3 = emitc.apply "&"(%1) : (i32) -> !emitc.ptr<i32>
emitc.call "write"(%2, %3) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()
```
into
```mlir
%0 = "emitc.constant"() {value = 0 : i32} : () -> i32
%1 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
%2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>
emitc.call "write"(%1, %2) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()
```
resulting in pointer aliasing, as %1 and %2 point to the same address.
In such a case, the `emitc.variable` operation can be used instead.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D120098
Corentin Jabot [Thu, 24 Feb 2022 15:00:44 +0000 (07:00 -0800)]
[clang] Warn on unqualified calls to std::move and std::forward
This adds a diagnostic when an unqualified call is resolved
to std::move or std::forward.
This follows some C++ committee discussions where some
people where concerns that this might be an usual anti pattern
particularly britle worth warning about - both because move
is a common name and because these functions accept any values.
This warns inconditionnally of whether the current context is in
std:: or not, as implementations probably want to always qualify
these calls too, to avoid triggering adl accidentally.
Differential Revision: https://reviews.llvm.org/D119670
Sven van Haastregt [Thu, 24 Feb 2022 15:17:24 +0000 (15:17 +0000)]
[OpenCL] Handle TypeExtensions in OpenCLBuiltinFileEmitter
Until now, any types that had TypeExtensions attached to them were not
guarded with those extensions. Extend the OpenCLBuiltinFileEmitter
such that all required extensions are emitted for the types of a
builtin function.
The `clang-tblgen -gen-clang-opencl-builtin-tests` emitter will now
produce e.g.:
#if defined(cl_khr_fp16) && defined(cl_khr_fp64)
half8 test11802_convert_half8_rtp(double8 arg1) {
return convert_half8_rtp(arg1);
}
#endif // TypeExtension
Differential Revision: https://reviews.llvm.org/D120262
Florian Hahn [Thu, 24 Feb 2022 14:51:43 +0000 (14:51 +0000)]
[AArch64] Simplify and extend tests added in
0c5ea01b20623e40.
Simon Pilgrim [Thu, 24 Feb 2022 14:14:08 +0000 (14:14 +0000)]
[X86] LowerRotate - enable v8i16 ROTL/ROTR on all pre-SSE41 targets
We're still better off expanding this once we have PMOVZX
Simon Pilgrim [Thu, 24 Feb 2022 13:51:51 +0000 (13:51 +0000)]
[X86] SimplifyDemandedVectorEltsForTargetNode - add X86ISD::ANDNP handling
Shraiysh Vaishay [Thu, 24 Feb 2022 13:30:40 +0000 (19:00 +0530)]
[mlir][OpenMP][NFC] Remove unused binary operator enum
This patch removes binary operator enum which was introduced with `omp.atomic.update`. Now the update operation handles update in a region so this is no longer required.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D120458
Benjamin Kramer [Thu, 24 Feb 2022 13:19:19 +0000 (14:19 +0100)]
[Symbolizer] Move ctor/dtor into .cpp file
On some standard library configurations these have a dependency on the
complete type of SymbolizableModule. They also do a lot of
copying/freeing so no point in inlining them.
Alex Zinenko [Tue, 11 Jan 2022 10:56:21 +0000 (11:56 +0100)]
[mlir] Document creation of Python bindings for a dialect
Documentation exists about the details of the API but is missing a
description of the overall structure per dialect.
Reviewed By: shabalin
Differential Revision: https://reviews.llvm.org/D117002
Benjamin Kramer [Thu, 24 Feb 2022 12:34:04 +0000 (13:34 +0100)]
[mlir][linalg] Cast back to the original type after making linalg.generic outputs more static
This codepath was entirely untested.
Differential Revision: https://reviews.llvm.org/D120473
Roman Lebedev [Thu, 24 Feb 2022 05:47:14 +0000 (08:47 +0300)]
[NFC][SROA] Update tests for D113520
serge-sans-paille [Wed, 23 Feb 2022 21:18:20 +0000 (22:18 +0100)]
Cleanup includes: ProfileData
Estimation of the impact on preprocessor output:
before:
1067349756
after:
1065940348
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120434
serge-sans-paille [Wed, 23 Feb 2022 21:16:39 +0000 (22:16 +0100)]
Cleanup include: DebugInfo/Symbolize
Estimation of the impact on preprocessor output
after:
1067349756
before:
1067487786
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120433
Jay Foad [Thu, 24 Feb 2022 12:17:34 +0000 (12:17 +0000)]
[AMDGPU] Fix permissions on test files
Florian Hahn [Thu, 24 Feb 2022 12:12:21 +0000 (12:12 +0000)]
[AArch64] Add vector select test showing redundant operations.
The tests show sub-optimal lowering of extend/cmp/select chains starting
with v16i8 vectors.
Shao-Ce SUN [Thu, 24 Feb 2022 03:14:43 +0000 (11:14 +0800)]
[NFC][RISCV] Reuse ISD::NodeType in float extension
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D120412
Sven van Haastregt [Thu, 24 Feb 2022 11:52:32 +0000 (11:52 +0000)]
[OpenCL] opencl-c.h: remove arg names for image builtins
This simplifies completeness comparisons against OpenCLBuiltins.td and
also makes the header no longer "claim" the identifiers "image",
"image_array", "coord", "sampler", "sample", "gradientX", "gradientY",
"lod", and "color".
Continues the direction set out in D119560.
Pavel Labath [Thu, 24 Feb 2022 11:47:17 +0000 (12:47 +0100)]
[lldb] Fix macos build for D120425
Javier Setoain [Thu, 27 Jan 2022 13:36:16 +0000 (13:36 +0000)]
[mlir][LLVM] Allow scalable vectors in ShuffleVectorOp
The current implementation of ShuffleVectorOp assumes all vectors are
scalable. LLVM IR allows shufflevector operations on scalable vectors,
and the current translation between LLVM Dialect and LLVM IR does the
rigth thing when the shuffle mask is all zeroes. This is required to
do a splat operation on a scalable vector, but it doesn't make sense
for scalable vectors outside of that operation, i.e.: with non-all zero
masks.
Differential Revision: https://reviews.llvm.org/D118371
Simon Pilgrim [Thu, 24 Feb 2022 11:12:52 +0000 (11:12 +0000)]
[X86] LowerShiftByScalarVariable - use getSplatSourceVector for vXi8 shift expansion
Using getSplatValue causes poor codegen due to not always being able to remove the EXTRACT_VECTOR_ELT created inside getSplatValue.
The vXi16 shifts/rotates are still showing occasional regressions but vXi8 is a definite improvement.
Nikita Popov [Thu, 24 Feb 2022 11:12:05 +0000 (12:12 +0100)]
Revert "[RISCV] add the MC layer support of Zfinx extension"
This reverts commit
7798ecca9c3db42241169d31fea4fb820ed01830.
As reported in https://reviews.llvm.org/D93298#3331641 and
following, this causes assertion failures with inline assembly.
Shao-Ce SUN [Thu, 20 Jan 2022 02:58:26 +0000 (10:58 +0800)]
[NFC][clang] Simplify `isOneOf` function
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D117740
Pavel Labath [Thu, 24 Feb 2022 11:05:42 +0000 (12:05 +0100)]
[lldb] One more fix for the MonitorChildProcess patch (D120425)
Matthias Springer [Thu, 24 Feb 2022 10:48:40 +0000 (19:48 +0900)]
[mlir][linalg][bufferize] Always bufferize in-place with "out" operands by default
In D115022, we introduced an optimization where OpResults of a `linalg.generic` may bufferize in-place with an "in" OpOperand if the corresponding "out" OpOperand is not used in the computation.
This optimization can lead to unexpected behavior if the newly chosen OpOperand is in the same alias set as another OpOperand (that is used in the computation). In that case, the newly chosen OpOperand must bufferize out-of-place. This can be confusing to users, as always choosing the "out" OpOperand (regardless of whether it is used) would be expected when having the notion of "destination-passing style" in mind.
With this change, we go back to always bufferizing in-place with "out" OpOperands by default, but letting users override the behavior with a bufferization option.
Differential Revision: https://reviews.llvm.org/D120182
Pavel Labath [Thu, 24 Feb 2022 10:50:54 +0000 (11:50 +0100)]
[lldb] Fix windows build for D120425
Andrzej Warzynski [Thu, 17 Feb 2022 16:53:57 +0000 (16:53 +0000)]
[flang][docs] Update the top "doc" page
* Added a note about "Classic Flang"
* sorted entries in ToC
Differential Revision: https://reviews.llvm.org/D120067
Pavel Labath [Tue, 22 Feb 2022 16:45:35 +0000 (17:45 +0100)]
[lldb/host] Remove monitor_signals argument from process monitoring functions
All current callers set the argument to false. monitor_signals=true used
to be used in the Process plugins (which needed to know when the
debugged process gets a signal), but this implementation has several
serious issues, which means that individual process plugins now
orchestrate the monitoring of debugged processes themselves.
This allows us to simplify the implementation (no need to play with
process groups), and the interface (we only catch fatal events, so the
callback is always called just once).
Differential Revision: https://reviews.llvm.org/D120425
Benjamin Kramer [Thu, 24 Feb 2022 09:58:32 +0000 (10:58 +0100)]
[Sema] Silence unused variable warning in Release builds. NFC.
rkayaith [Thu, 24 Feb 2022 09:21:40 +0000 (10:21 +0100)]
[mlir][python] Support more types in IntegerAttr.value
Previously only accessing values for `index` and signless int types
would work; signed and unsigned ints would hit an assert in
`IntegerAttr::getInt`. This exposes `IntegerAttr::get{S,U}Int` to the C
API and calls the appropriate function from the python bindings.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D120194
Marek Kurdej [Tue, 22 Feb 2022 21:32:03 +0000 (22:32 +0100)]
[clang-format] Avoid inserting space after C++ casts.
Fixes https://github.com/llvm/llvm-project/issues/53876.
This is a solution for standard C++ casts: const_cast, dynamic_cast, reinterpret_cast, static_cast.
A general approach handling all possible casts is not possible without semantic information.
Consider the code:
```
static_cast<T>(*function_pointer_variable)(arguments);
```
vs.
```
some_return_type<T> (*function_pointer_variable)(parameters);
// Later used as:
function_pointer_variable = &some_function;
return function_pointer_variable(args);
```
In the latter case, it's not a cast but a variable declaration of a pointer to function.
Without knowing what `some_return_type<T>` is (and clang-format does not know it), it's hard to distinguish between the two cases. Theoretically, one could check whether "parameters" are types (not a cast) and "arguments" are value/expressions (a cast), but that might be inefficient (needs lots of lookahead).
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D120140
Xiaodong Liu [Thu, 24 Feb 2022 09:14:24 +0000 (17:14 +0800)]
[sancov][sanitizer-common] Correct sanitizer coverage point
Sanitizer coverage point should be the previous instruction PC of the
caller and the offset to the previous instruction might be different
on each CPU architecture.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119233
Marek Kurdej [Mon, 21 Feb 2022 13:17:58 +0000 (14:17 +0100)]
[clang-format] Fix QualifierOrder breaking the code with requires clause.
Fixes https://github.com/llvm/llvm-project/issues/53962.
Given the config:
```
BasedOnStyle: LLVM
QualifierAlignment: Custom
QualifierOrder: ['constexpr', 'type']
```
The code:
```
template <typename F>
requires std::invocable<F>
constexpr constructor();
```
was incorrectly formatted to:
```
template <typename F>
requires
constexpr std::invocable<F> constructor();
```
because we considered `std::invocable<F> constexpr` as a type, not recognising the requires clause.
This patch avoids moving the qualifier across the boundary of the requires clause (checking `ClosesRequiresClause`).
Reviewed By: HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D120309
Sander de Smalen [Thu, 24 Feb 2022 08:46:15 +0000 (08:46 +0000)]
[AArch64][AsmParser] Arch directives should set implied features.
When assembling for example an SVE instruction with the `.arch +sve2` directive,
+sve should be implied by setting +sve2, similar to what would happen if
one would pass the mattr=+sve2 flag on the command-line.
The AsmParser doesn't set the implied features, meaning that the SVE
instruction does not assemble. This patch fixes that.
Note that the same does not hold when disabling a feature. For example,
+nosve2 does not imply +nosve.
Reviewed By: c-rhodes
Differential Revision: https://reviews.llvm.org/D120259
Luis Penagos [Thu, 24 Feb 2022 08:48:24 +0000 (09:48 +0100)]
[clang-format] Do not insert space after new/delete keywords in C function declarations
Fixes https://github.com/llvm/llvm-project/issues/46915.
Reviewed By: curdeius, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D120374
Nikolas Klauser [Wed, 23 Feb 2022 22:07:07 +0000 (23:07 +0100)]
[libc++] Remove <chrono> include from <future>
Reviewed By: Quuxplusone, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D120436
Iain Sandoe [Sun, 7 Feb 2021 01:00:33 +0000 (01:00 +0000)]
[C++20][Modules][3/8] Initial handling for module partitions.
This implements the parsing and recognition of module partition CMIs
and removes the FIXMEs in the parser.
Module partitions are recognised in the base computation of visibility,
however additional amendments to visibility follow in subsequent patches.
Differential Revision: https://reviews.llvm.org/D118586
lian wang [Tue, 15 Feb 2022 06:17:33 +0000 (06:17 +0000)]
[RISCV] Add schedule class for Zbm and Zbe extension
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D119805
lian wang [Thu, 24 Feb 2022 01:57:10 +0000 (01:57 +0000)]
[RISCV][NFC] Remove useless intrinsic function declare in test of Zbp extension
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D120393
Martin Storsjö [Tue, 22 Feb 2022 10:28:08 +0000 (12:28 +0200)]
[libcxx] [test] Fix the get/put long_double_ru_RU tests on Apple platforms
This fixes issue #45084 (https://llvm.org/PR45739).
Remove unnecessary trailing spaces after the "RUB" international
currency symbol (and after the plain number in some parts of the
put_long_double test).
Both of these test files are
`XFAIL: netbsd || linux || LIBCXX-WINDOWS-FIXME`, and then have some of
their test cases commented out when `__APPLE__`. This patch comments-in
those test cases and adjusts them all to work on Apple, while leaving the
test `XFAIL`ed on NetBSD, Linux, and Windows.
Differential Revision: https://reviews.llvm.org/D120316
Fangrui Song [Thu, 24 Feb 2022 08:13:13 +0000 (00:13 -0800)]
[analyzer] Fix -Wunused-lambda-capture in -DLLVM_ENABLE_ASSERTIONS=off builds
Nikita Popov [Mon, 14 Feb 2022 16:18:07 +0000 (17:18 +0100)]
[InstCombine] Canonicalize SPF to min/max intrinsics
Now that integer min/max intrinsics have good support in both
InstCombine and other passes, start canonicalizing SPF min/max
to intrinsic min/max.
Once this sticks, we can stop matching SPF min/max in various
places, and can remove hacks we have for preventing infinite loops
and breaking of SPF canonicalization.
Differential Revision: https://reviews.llvm.org/D98152
Nikita Popov [Thu, 24 Feb 2022 07:50:40 +0000 (08:50 +0100)]
Revert "[InstCombine] Remove one-use limitation from X-Y==0 fold"
This reverts commit
65dc78d63ee2eb20fbed54401091f08a685ef8c1.
This caused a major code-size regression on tramp3d-v4, revert
until I can investigate.
Adrian Kuegel [Thu, 24 Feb 2022 07:22:13 +0000 (08:22 +0100)]
[mlir][SCF] Apply suggested ClangTidy fixes.
Maksim Panchenko [Thu, 24 Feb 2022 06:54:42 +0000 (22:54 -0800)]
[BOLT] Support PC-relative relocations with addends
PC-relative memory operand could reference a different object from
the one located at the target address, e.g. when a negative offset
is used. Check relocations for the real referenced object.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D120379
eopXD [Tue, 22 Feb 2022 03:20:02 +0000 (19:20 -0800)]
[Driver][RISCV] Add missing rv64 test case
Add missing test case. Thanks @rogfer01 for spotting this out.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D120297
Chenbing.Zheng [Thu, 24 Feb 2022 05:23:25 +0000 (05:23 +0000)]
[RISCV] Add more tests for vcpop and vfirst with VL=0
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D120300
Chenbing.Zheng [Thu, 24 Feb 2022 03:49:58 +0000 (03:49 +0000)]
[RISCV][NFC] Add helper function isVectorConfigInstr to reduce Repeated code.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D119924
Fangrui Song [Thu, 24 Feb 2022 05:36:45 +0000 (21:36 -0800)]
[ELF] Symbols.h: remove #include "InputFiles.h"
Fangrui Song [Thu, 24 Feb 2022 05:32:50 +0000 (21:32 -0800)]
[ELF] Move isUsedInRegularObj assignment from ctor to call sites. NFC
This removes the tricky
`isUsedInRegularObj(!file || file->kind() == InputFile::ObjKind)`
and the copy from `Symbol::mergeProperties`.
Craig Topper [Thu, 24 Feb 2022 05:12:54 +0000 (21:12 -0800)]
[RISCV] Use SelectionDAG::getFreeze to simplify some code. NFC
Fangrui Song [Thu, 24 Feb 2022 04:48:49 +0000 (20:48 -0800)]
[ELF][test] Avoid race on a.out
Fangrui Song [Thu, 24 Feb 2022 04:44:34 +0000 (20:44 -0800)]
[ELF] Don't rely on Symbols.h's transitive inclusion of InputFiles.h. NFC
Amir Ayupov [Thu, 24 Feb 2022 03:30:30 +0000 (19:30 -0800)]
[BOLT][NFC] Report errors from RewriteInstance `discoverStorage` and `run`
Further improve error handling in BOLT by reporting `RewriteInstance` errors in
a library and fuzzer-friendly way instead of exiting.
Follow-up to D119658
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D120224
Fangrui Song [Thu, 24 Feb 2022 04:34:48 +0000 (20:34 -0800)]
[ELF] Move TLS mismatch error from Symbol::replace to postParse
* detect `def_tls.o undef_nontls.o` violation
* place error checking code (checking duplicate symbol) together
* allow `--defsym tls1=tls2 def_tls.o`
As a degraded error checking, `--defsym tls1=42` violation will not be detected.
V Donaldson [Thu, 24 Feb 2022 00:31:07 +0000 (16:31 -0800)]
[flang] Do not print format tabs
As an extension, tabs are accepted in a format, but should be skipped,
not printed.