Timm Bäder [Thu, 20 May 2021 05:08:12 +0000 (07:08 +0200)]
[clang][driver] Treat -flto=[auto,jobserver] as -flto
Instead of ignoring flto=auto and -flto=jobserver, treat them as -flto
and pass -flto=full along.
Differential Revision: https://reviews.llvm.org/D102479
Vitaly Buka [Fri, 21 May 2021 00:06:53 +0000 (17:06 -0700)]
[scudo][NFC] Split BasicTest further
It's still the slowest test under our emulator.
Xiang1 Zhang [Fri, 21 May 2021 05:38:54 +0000 (13:38 +0800)]
[HWASAN] No code changed, Only clang-format for HWAddressSanitizer.cpp
Vitaly Buka [Fri, 21 May 2021 05:09:43 +0000 (22:09 -0700)]
[scudo] Fix compilation after D102886
Christudasan Devadasan [Sun, 18 Apr 2021 13:45:38 +0000 (19:15 +0530)]
GlobalISel: Help reduce operation width for instruction with two results.
The function `reduceOperationWidth` helps to legalize a vector
operation either by narrowing its type or by scalarizing the
operation itself. It currently supports instructions with one result.
This patch, in addition allows the same for instructions with two
results (for instance, G_SDIVREM).
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D100725
Serge Pavlov [Thu, 6 May 2021 19:17:42 +0000 (02:17 +0700)]
[APFloat] convertToDouble/Float can work on shorter types
Previously APFloat::convertToDouble may be called only for APFloats that
were built using double semantics. Other semantics like single precision
were not allowed although corresponding numbers could be converted to
double without loss of precision. The similar restriction applied to
APFloat::convertToFloat.
With this change any APFloat that can be precisely represented by double
can be handled with convertToDouble. Behavior of convertToFloat was
updated similarly. It make the conversion operations more convenient and
adds support for formats like half and bfloat.
Differential Revision: https://reviews.llvm.org/D102671
Stanislav Mekhanoshin [Thu, 20 May 2021 23:07:34 +0000 (16:07 -0700)]
[AMDGPU] Request module used variables from LDS lowering as internal
I do not see any practical difference but technically
used.* variables are internal and a call to getGlobalVariable
misses true as a second argument. NFC as far as I can tell.
Differential Revision: https://reviews.llvm.org/D102884
George Balatsouras [Fri, 21 May 2021 03:28:33 +0000 (20:28 -0700)]
[sanitizer_common] Remove unused var in test
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D102898
George Balatsouras [Wed, 19 May 2021 23:06:30 +0000 (16:06 -0700)]
[sanitizer_common] Add StackTrace::PrintTo method
This method is like StackTrace::Print but instead of printing to stderr
it copies its output to a user-provided buffer.
Part of https://reviews.llvm.org/D102451.
Reviewed By: vitalybuka, stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D102815
Jinsong Ji [Fri, 21 May 2021 02:14:13 +0000 (02:14 +0000)]
[AIX] Print printable byte list as quoted string
.byte supports string, so if the whole byte list are printable,
we can actually print the string for readability and LIT tests maintainence.
.byte 'H,'e,'l,'l,'o,',,' ,'w,'o,'r,'l,'d
->
.byte "Hello, world"
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D102814
Vitaly Buka [Fri, 21 May 2021 02:36:49 +0000 (19:36 -0700)]
[NFC][scudo] Fix typo in comment
Vitaly Buka [Fri, 21 May 2021 00:16:27 +0000 (17:16 -0700)]
[NFC][scudo] Let disableMemoryTagChecksTestOnly to fail
If this happend we can't run corresponding test.
kuperxu [Fri, 21 May 2021 02:05:16 +0000 (19:05 -0700)]
[debugserver] Add platform cache support to improve performance.
The dyld SPI used by debugserver (_dyld_process_info_create) has become
much slower in macOS BigSur 11.3 causing a significant performance
regression when attaching. This commit mitigates that by caching the
result when calling the SPI to compute the platform.
Differential revision: https://reviews.llvm.org/D102833
Nicolai Hähnle [Wed, 12 May 2021 00:41:25 +0000 (02:41 +0200)]
[IR] Memory intrinsics are not unconditionally `nosync`
Remove the `nosync` attribute from the memory intrinsic definitions
(i.e. memset, memcpy, memmove).
Like native memory accesses, memory intrinsics can be volatile. This is
indicated by an immarg in the intrinsic call. All else equal, a volatile
memory intrinsic is `sync`, so we cannot annotate the intrinsic functions
themselves as `nosync`. The attributor and function-attr passes know to
take the volatile bit into account.
Since `nosync` is a default attribute, this means we have to stop using
the DefaultAttrIntrinsic tablegen class for memory intrinsics, and
specify all default attributes other than `nosync` explicitly.
Most of the test changes are trivial churn, but one test case
(in nosync.ll) was in fact incorrect before this change.
Differential Revision: https://reviews.llvm.org/D102295
Nicolai Hähnle [Wed, 19 May 2021 03:56:53 +0000 (05:56 +0200)]
[tests] Update Transforms/DeadStoreElim/multiblock-malloc-free.ll
This change is generated by running update_test_checks.py. It serves to
make subsequent diffs easier to understand.
Vitaly Buka [Thu, 20 May 2021 23:17:25 +0000 (16:17 -0700)]
[scudo] Fix EXPECT_DEATH tests
Put allocate/deallocate next to memory
access inside EXPECT_DEATH block.
This way we reduce probability that memory is not mapped
by unrelated code.
It's still not absolutely guaranty that mmap does not
happen so we repeat it few times to be sure.
Reviewed By: cryptoad
Differential Revision: https://reviews.llvm.org/D102886
Shoaib Meenai [Wed, 12 May 2021 21:45:10 +0000 (14:45 -0700)]
[libcxxabi] Remove unnecessary define from build
Now that we're passing -D_LIBCPP_BUILDING_LIBRARY to the libc++abi
build, -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is redundant
(https://github.com/llvm/llvm-project/blob/
fb3a00c327df78eaa534e53ac6f07112e0585121/libcxx/include/exception#L120-L121
is the only use of _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS in
libc++, and that conditional also checks for _LIBCPP_BUILDING_LIBRARY).
Reviewed By: #libc_abi, phosek
Differential Revision: https://reviews.llvm.org/D102372
Reid Kleckner [Thu, 20 May 2021 23:19:20 +0000 (16:19 -0700)]
[PDB] Check the type server guid when ghashing
Previously we simply didn't check this. Prereq to make the test suite
pass with ghash enabled by default.
Differential Revision: https://reviews.llvm.org/D102885
Stanislav Mekhanoshin [Thu, 20 May 2021 22:32:43 +0000 (15:32 -0700)]
[AMDGPU] Fix module LDS selection
Accesses to global module LDS variable start from null,
but kernel also thinks its variables start address is
null. Fixed by not using a null as an address.
Differential Revision: https://reviews.llvm.org/D102882
Vitaly Buka [Thu, 20 May 2021 20:08:04 +0000 (13:08 -0700)]
[asan] Add autogenerated test for fake stack
This will help to see result of D102462.
Test was generated with
./llvm/utils/update_test_checks.py llvm/test/Instrumentation/AddressSanitizer/fake-stack.ll --opt-binary <build_dir>/bin/opt
Differential Revision: https://reviews.llvm.org/D102867
Wei Wang [Mon, 3 May 2021 22:43:39 +0000 (15:43 -0700)]
[clang][AST] Improve AST Reader/Writer memory footprint
Reduce memory footprint of AST Reader/Writer:
1. Adjust internal data containers' element type.
2. Switch to set for deduplication of deferred diags.
Differential Revision: https://reviews.llvm.org/D101793
Nicolas Vasilache [Thu, 20 May 2021 21:35:25 +0000 (21:35 +0000)]
[mlir][Affine] NFC - Drop Affine EDSC usage
Drop the Affine dialect EDSC subdirectory and update all uses.
Differential Revision: https://reviews.llvm.org/D102878
Martin Storsjö [Thu, 29 Apr 2021 11:06:24 +0000 (14:06 +0300)]
[LLD] [COFF] Fix automatic export of symbols from LTO objects
Differential Revision: https://reviews.llvm.org/D101569
peter klausler [Thu, 20 May 2021 21:04:40 +0000 (14:04 -0700)]
[flang] Remove unused variable
Fixes the clang build of flang/runtime/transformational.cpp.
Yaxun (Sam) Liu [Wed, 19 May 2021 19:44:20 +0000 (15:44 -0400)]
[CUDA][HIP] Fix device variables used by host
variables emitted on both host and device side with different addresses
when ODR-used by host function should not cause device side counter-part
to be force emitted.
This fixes the regression caused by https://reviews.llvm.org/D102237
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D102801
Min-Yih Hsu [Thu, 6 May 2021 18:05:22 +0000 (11:05 -0700)]
[M68k] Support for inline asm operands w/ simple constraints
This patch adds supports for inline assembly operands and some simple
operand constraints, including register and constant operands.
Differential Revision: https://reviews.llvm.org/D102585
Min-Yih Hsu [Mon, 17 May 2021 01:30:29 +0000 (18:30 -0700)]
[M68k] Allow user to preserve certain registers
Add `-ffixed-a[0-6]` and `-ffixed-d[0-7]` and the corresponding
subtarget features to prevent certain register from being allocated.
Differential Revision: https://reviews.llvm.org/D102805
peter klausler [Thu, 20 May 2021 20:49:31 +0000 (13:49 -0700)]
[flang] Fix broken build of flang with clang
A recent commit (e00a170) inadvertently exposed the Reshape runtime
function as being extern "C", for which it is not yet ready, leading
to a valid warning from clang that we treat as an error. Patch.
peter klausler [Thu, 20 May 2021 17:37:03 +0000 (10:37 -0700)]
[flang] Implement more transformational intrinsic functions in runtime
Define APIs, naively implement, and add basic sanity unit tests for
the transformational intrinsic functions CSHIFT, EOSHIFT, PACK,
SPREAD, TRANSPOSE, and UNPACK. These are the remaining transformational
intrinsic functions that rearrange data without regard to type
(except for default boundary values in EOSHIFT); RESHAPE was already
in place as a stress test for the runtime's descriptor handling
facilities.
Code is in place to create copies of allocatable/automatic
components when transforming arrays of derived type, but it won't
do anything until we have derived type information being passed to the
runtime from the frontend.
Differential Revision: https://reviews.llvm.org/D102857
Nicolas Vasilache [Thu, 20 May 2021 20:05:55 +0000 (20:05 +0000)]
[mlir][MemRef] NFC - Drop MemRef EDSC usage
Drop the MemRef dialect EDSC subdirectory and update all uses.
Differential Revision: https://reviews.llvm.org/D102868
Heejin Ahn [Wed, 19 May 2021 08:47:58 +0000 (01:47 -0700)]
[WebAssembly] Warn on exception spec for Emscripten EH
It turns out we have not correctly supported exception spec all along in
Emscripten EH. Emscripten EH supports `throw()` but not `throw` with
types. See https://bugs.llvm.org/show_bug.cgi?id=50396.
Wasm EH also only supports `throw()` but not `throw` with types, and we
have been printing a warning message for the latter. This prints the
same warning message for `throw` with types when Emscripten EH is used,
or more precisely, when Wasm EH is not used. (So this will print the
warning messsage even when `-fno-exceptions` is used but I think that
should be fine. It's cumbersome to do a complilcated option checking in
CGException.cpp and options checkings are mostly done in elsewhere.)
Reviewed By: dschuff, kripken
Differential Revision: https://reviews.llvm.org/D102791
Jan Kratochvil [Thu, 20 May 2021 18:40:08 +0000 (20:40 +0200)]
[lldb] Improve invalid DWARF DW_AT_ranges error reporting
In D98289#inline-939112 @dblaikie said:
Perhaps this could be more informative about what makes the range list
index of 0 invalid? "index 0 out of range of range list table (with
range list base 0xXXX) with offset entry count of XX (valid indexes
0-(XX-1))" Maybe that's too verbose/not worth worrying about since
this'll only be relevant to DWARF producers trying to debug their
DWARFv5, maybe no one will ever see this message in practice. Just
a thought.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D102851
Jessica Clarke [Thu, 20 May 2021 19:34:23 +0000 (20:34 +0100)]
[SelectionDAG][Mips][PowerPC][RISCV][WebAssembly] Teach computeKnownBits/ComputeNumSignBits about atomics
Unlike normal loads these don't have an extension field, but we know
from TargetLowering whether these are sign-extending or zero-extending,
and so can optimise away unnecessary extensions.
This was noticed on RISC-V, where sign extensions in the calling
convention would result in unnecessary explicit extension instructions,
but this also fixes some Mips inefficiencies. PowerPC sees churn in the
tests as all the zero extensions are only for promoting 32-bit to
64-bit, but these zero extensions are still not optimised away as they
should be, likely due to i32 being a legal type.
This also simplifies the WebAssembly code somewhat, which currently
works around the lack of target-independent combines with some ugly
patterns that break once they're optimised away.
Re-landed with correct handling in ComputeNumSignBits for Tmp == VTBits,
where zero-extending atomics were incorrectly returning 0 rather than
the (slightly confusing) required return value of 1.
Re-landed again after D102819 fixed PowerPC to correctly zero-extend all
of its atomics as it claimed to do, since the combination of that bug
and this optimisation caused buildbot regressions.
Reviewed By: RKSimon, atanasyan
Differential Revision: https://reviews.llvm.org/D101342
Jon Chesterfield [Thu, 20 May 2021 19:33:35 +0000 (20:33 +0100)]
[libomptarget] Improve dlwrap compile time error diagnostic
[libomptarget] Improve dlwrap compile time error diagnostic
The dlwrap interface takes an explict arity, e.g. DLWRAP(cuAlloc, 2);
This probably can't be eliminated as it controls the argument list of an
external symbol, not an inline header function. If the arity given is too
big, the error from clang referring to the line is in the middle of
implementation details.
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple:1277:7: error: static_assert failed
due to requirement '0UL < tuple_size<std::tuple<>>::value' "tuple index is in range"
static_assert(__i < tuple_size<tuple<>>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple:1260:7: ...
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/tuple:1260:7: ...
/home/amd/llvm-project/openmp/libomptarget/include/dlwrap.h:93:27 ...
/home/amd/llvm-project/openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp:34:1: note: in
instantiation of template class 'dlwrap::trait<cudaError_enum (*)(unsigned long *, unsigned
long)>::arg<2>' requested here
DLWRAP(cuMemAlloc, 3);
^
/home/amd/llvm-project/openmp/libomptarget/include/dlwrap.h:51:31: ...
/home/amd/llvm-project/openmp/libomptarget/include/dlwrap.h:166:3: ...
/home/amd/llvm-project/openmp/libomptarget/include/dlwrap.h:133:3: ...
/home/amd/llvm-project/openmp/libomptarget/include/dlwrap.h:186:37: ...
If the arity is too small, the diagnostic is better:
cuda/dynamic_cuda/cuda.cpp:34:1: error: too few
arguments to function call, expected 2, have 1
DLWRAP(cuMemAlloc, 1);
This patch changes the diagnostic to:
cuda/dynamic_cuda/cuda.cpp:34:1: error:
static_assert failed due to requirement '1 == trait<cudaError_enum (*)(unsigned long *, unsigned
long)>::nargs' "Arity Error"
DLWRAP(cuMemAlloc, 1);
or
cuda/dynamic_cuda/cuda.cpp:34:1: error:
static_assert failed due to requirement '3 == trait<cudaError_enum (*)(unsigned long *, unsigned
long)>::nargs' "Arity Error"
DLWRAP(cuMemAlloc, 3);
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D102858
Louis Dionne [Sat, 8 May 2021 14:42:44 +0000 (10:42 -0400)]
[libc++] Translate the test suite sanitizer support to the DSL
Differential Revision: https://reviews.llvm.org/D102108
LLVM GN Syncbot [Thu, 20 May 2021 19:20:25 +0000 (19:20 +0000)]
[gn build] Port
0af3105b641a
Jon Roelofs [Thu, 20 May 2021 19:17:58 +0000 (12:17 -0700)]
Revert "[Remarks] Add analysis remarks for memset/memcpy/memmove lengths"
This reverts commit
4bf69fb52b3c445ddcef5043c6b292efd14330e0.
This broke spec2k6/403.gcc under -global-isel. Details to follow once I've
reduced the problem.
Nico Weber [Thu, 20 May 2021 19:08:37 +0000 (15:08 -0400)]
[gn build] try reverting code part of
f05fbb7795
Maybe
aa8fe8fe6c7b was all that was needed to fix the build and
we can keep the code with fewer conditionals after all.
Nico Weber [Thu, 20 May 2021 19:01:35 +0000 (15:01 -0400)]
[gn build] attempt again to unbreak linux after
fc9696130c8
Nico Weber [Thu, 20 May 2021 19:00:24 +0000 (15:00 -0400)]
[gn build] use PEP-8 indents in symbol_exports.py
Nico Weber [Thu, 20 May 2021 18:55:37 +0000 (14:55 -0400)]
[gn build] attempt to unbreak linux after
fc9696130c8
Only emit `global:` if there are any exported symbols.
While here, `chmod +x` the symbol_exports.py script.
zoecarver [Thu, 13 May 2021 17:53:27 +0000 (10:53 -0700)]
[libcxx][ranges] Implement `ranges::borrowed_range`.
Differential Revision: https://reviews.llvm.org/D102426
Nico Weber [Thu, 20 May 2021 13:55:27 +0000 (09:55 -0400)]
[gn build] Use .export files
Just fixing an old TODO, no dramatic behavior change.
Differential Revision: https://reviews.llvm.org/D102843
Kevin P. Neal [Thu, 20 May 2021 18:35:17 +0000 (14:35 -0400)]
[FPEnv] EarlyCSE support for constrained intrinsics, default FP environment edition
EarlyCSE cannot distinguish between floating point instructions and
constrained floating point intrinsics that are marked as running in the
default FP environment. Said intrinsics are supposed to behave exactly the
same as the regular FP instructions. Teach EarlyCSE to handle them in that
case.
Differential Revision: https://reviews.llvm.org/D99962
Mitch Phillips [Thu, 20 May 2021 18:09:53 +0000 (11:09 -0700)]
[scudo] Add supported architectures.
Adds extra supported architectures that were available for vanilla
scudo, in preparation for D102543. Hopefully the dust has settled and
7d0a81ca38e427de9b7fb0961ec643b757028131 is no longer an issue.
Reviewed By: cryptoad, vitalybuka
Differential Revision: https://reviews.llvm.org/D102648
Fraser Cormack [Wed, 19 May 2021 11:49:08 +0000 (12:49 +0100)]
[RISCV] Ensure small mask BUILD_VECTORs aren't expanded
The default expansion for BUILD_VECTORs -- save for going through
shuffles -- is to go through the stack. This method only works when the
type is at least byte-sized, so for v2i1 and v4i1 we would crash.
This patch ensures that small mask-type BUILD_VECTORs are always handled
without crashing. We lower to a SETCC of the equivalent i8 type.
This also exposes some pre-existing issues where the lowering when
optimizing for size results in larger code than without. Those will be
tackled in future patches.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D102767
Reid Kleckner [Thu, 13 May 2021 21:43:22 +0000 (14:43 -0700)]
[PGO] Don't reference functions unless value profiling is enabled
This reduces the size of chrome.dll.pdb built with optimizations,
coverage, and line table info from 4,690,210,816 to 2,181,128,192, which
makes it possible to fit under the 4GB limit.
This change can greatly reduce binary size in coverage builds, which do
not need value profiling. IR PGO builds are unaffected. There is a minor
behavior change for frontend PGO.
PGO and coverage both use InstrProfiling to create profile data with
counters. PGO records the address of each function in the __profd_
global. It is used later to map runtime function pointer values back to
source-level function names. Coverage does not appear to use this
information.
Recording the address of every function with code coverage drastically
increases code size. Consider this program:
void foo();
void bar();
inline void inlineMe(int x) {
if (x > 0)
foo();
else
bar();
}
int getVal();
int main() { inlineMe(getVal()); }
With code coverage, the InstrProfiling pass runs before inlining, and it
captures the address of inlineMe in the __profd_ global. This greatly
increases code size, because now the compiler can no longer delete
trivial code.
One downside to this approach is that users of frontend PGO must apply
the -mllvm -enable-value-profiling flag globally in TUs that enable PGO.
Otherwise, some inline virtual method addresses may not be recorded and
will not be able to be promoted. My assumption is that this mllvm flag
is not popular, and most frontend PGO users don't enable it.
Differential Revision: https://reviews.llvm.org/D102818
Mitch Phillips [Thu, 20 May 2021 17:56:47 +0000 (10:56 -0700)]
[scudo] Disable secondary cache-unmap tests on arm32.
Looks like secondary pointers don't get unmapped on one of the arm32
bots. In the interests of landing some dependent patches, disable this
test on arm32 so that it can be tested in isolation later.
Reviewed By: cryptoad, vitalybuka
Split from differential patchset (1/2): https://reviews.llvm.org/D102648
Lang Hames [Thu, 20 May 2021 15:56:03 +0000 (08:56 -0700)]
[ORC-RT] Add string_view and span utilities for use by the ORC runtime.
These are substitutes for std::string_view (and llvm::StringRef) and std::span
(and llvm::ArrayRef) for use by the ORC runtime.
Simon Pilgrim [Thu, 20 May 2021 17:43:30 +0000 (18:43 +0100)]
[X86][Atom] Fix vector fadd/fcmp/fmul resource/throughputs
Match whats documented in the Intel AOM - these are all fadd/fcmp use Port1 and fmul uses Port1, but in many cases BOTH ports are required - this was being incorrectly modelled as EITHER port.
Discovered while investigating the correct fptoui costs to fix the regressions in D101555.
Now that we can use in-order models in llvm-mca, the atom model is a good "worst case scenario" analysis for x86.
Tamar Christina [Thu, 20 May 2021 17:55:11 +0000 (18:55 +0100)]
libsanitizer: Remove cyclades inclusion in sanitizer
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.
libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.
Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.
As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.
[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D102059
Alex Orlov [Thu, 20 May 2021 17:40:28 +0000 (21:40 +0400)]
Add support for DWARF embedded source to llvm-symbolizer.
This patch adds DWARF embedded source printout to llvm-symbolizer.
Reviewed By: jhenderson, dblaikie
Differential Revision: https://reviews.llvm.org/D102355
Stefan Pintilie [Thu, 20 May 2021 01:22:28 +0000 (20:22 -0500)]
[PowerPC] Add fix to partword atomic operations
Partword atomic binaries are not zero extended as they should be.
This patch fixes them to ensure that they are zero extended.
Reviewed By: nemanjai, #powerpc
Differential Revision: https://reviews.llvm.org/D102819
Fraser Cormack [Tue, 18 May 2021 13:08:45 +0000 (14:08 +0100)]
[RISCV] Ensure shuffle splat operands are type-legal
The use of `SelectionDAG::getSplatValue` isn't guaranteed to return a
type-legal splat value as it may implicitly extract a vector element
from another shuffle. It is not permitted to introduce an illegal type
when lowering shuffles.
This patch addresses the crash by adding a boolean flag to
`getSplatValue`, defaulting to false, which when set will ensure a
type-legal return value. If it is unable to do that it will fail to
return a splat value.
I've been through the existing uses of `getSplatValue` in other targets
and was unable to find a need or test cases showing a need to update
their uses. In some cases, the call is made during `LegalizeVectorOps`
which may still produce illegal scalar types. In other situations, the
illegally-typed splat value may be quickly patched up to a legal type
(such as any-extending the returned `extract_vector_elt` up to a legal
type) before `LegalizeDAG` notices.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D102687
Wouter van Oortmerssen [Thu, 22 Apr 2021 23:54:58 +0000 (16:54 -0700)]
[WebAssembly] Fix PIC/GOT codegen for wasm64
__table_base is know 64-bit, since in LLVM it represents a function pointer offset
__table_base32 is a copy in wasm32 for use in elem init expr, since no truncation may be used there.
New reloc R_WASM_TABLE_INDEX_REL_SLEB64 added
Differential Revision: https://reviews.llvm.org/D101784
Steven Wu [Thu, 20 May 2021 16:53:55 +0000 (09:53 -0700)]
[IR][AutoUpgrade] Drop alignment from non-pointer parameters and returns
This is a follow-up of D102201. After some discussion, it is a better idea
to upgrade all invalid uses of alignment attributes on function return
values and parameters, not just limited to void function return types.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D102726
Jamie Schmeiser [Thu, 20 May 2021 16:37:46 +0000 (12:37 -0400)]
When vector is found as a type or non-type id, check if it is really the altivec vector token.
Summary:
Call TryAltiVecVectorToken when an identifier is seen in the parser before
annotating the token. This checks the next token where necessary to ensure
that vector is properly handled as the altivec token.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: ZarkoCA (Zarko Todorovski)
Differential Revision: https://reviews.llvm.org/D100991
Stephen Tozer [Thu, 20 May 2021 15:33:38 +0000 (16:33 +0100)]
[DebugInfo] Handle DIArgList in FastISel or GlobalIsel
Currently, variadic dbg.values (i.e. those using a DIArgList as part of
their location) are not handled properly by FastISel or GlobalISel, and
will produce invalid DBG_VALUE instructions if they encounter them. This
patch fixes this issue by emitting undef DBG_VALUE instructions for
variadic dbg.values, so that no incorrect instruction is produced and
any prior variable location is terminated.
This is simply a quick-fix to prevent errors; a correct implementation
should come later for these ISel pipelines to ensure that we do not drop
debug information unnecessarily.
Differential Revision: https://reviews.llvm.org/D102500
Jean Perier [Thu, 20 May 2021 16:24:10 +0000 (18:24 +0200)]
[flang] simplify derived type info table format
- Replace class(*) member by a c_ptr member to avoid having to handle
polymorphic components in the type info table generation. Polymorphic
entity handling will require these very tables to be lowered properly.
Note: keep the init as NullPointer/Designators. This is technically
invalid Fortran, the init should have c_ptr type. But wrapping this
in a C_LOC intrinsic call would make runtime generation and lowering
more complex with no real benefits.
- ComponentIterator is crashing when used on the generated derived
types in GetScope. This patch makes GetScope more robust, but it
is not entirely clear to me why this is only happening with the
generated derived types.
- The type of generated character globals was incorrect because
Scope::FindType was matching character types with different
length. Add a CharacterTypeSpec == operator to fix this.
Differential Revision: https://reviews.llvm.org/D102768
Peter Waller [Wed, 12 May 2021 14:47:22 +0000 (14:47 +0000)]
[CodeGen][AArch64][SVE] Canonicalize intrinsic rdffr{ => _z}
Follow up to D101357 /
3fa6510f6.
Supersedes D102330.
Goal: Use flags setting rdffrs instead of rdffr + ptest.
Problem: RDFFR_P doesn't have have a flags setting equivalent.
Solution: in instcombine, canonicalize to RDFFR_PP at the IR level, and
rely on RDFFR_PP+PTEST => RDFFRS_PP optimization in
AArch64InstrInfo::optimizePTestInstr.
While here:
* Test that rdffr.z+ptest generates a rdffrs.
* Use update_{test,llc}_checks.py on the tests.
* Use sve attribute on functions.
Differential Revision: https://reviews.llvm.org/D102623
Sanjay Patel [Thu, 20 May 2021 15:32:03 +0000 (11:32 -0400)]
[GlobalOpt] recompute alignments for loads and stores of updated globals
GlobalOpt can slice structs/arrays and change GEPs in the process,
but it was not updating alignments for load/store users. This
eventually causes the crashing seen in:
https://llvm.org/PR49661
https://llvm.org/PR50253
On x86, this required SLP+codegen to create an aligned vector
store on an invalid address. The bugs would be easier to
demonstrate on a target with stricter alignment requirements.
I'm not sure if this is a complete solution. The alignment
updating code is adapted from InstCombine, so I assume that
part is tested and good.
Differential Revision: https://reviews.llvm.org/D102552
Sanjay Patel [Thu, 20 May 2021 15:15:53 +0000 (11:15 -0400)]
[GlobalOpt] adjust test to show load problems; NFC
Goes with D102552
Raphael Isemann [Thu, 20 May 2021 16:00:01 +0000 (18:00 +0200)]
[lldb] Adjust DumpDataExtractorTest.Formats for Windows
Not sure if that's the ostringstream or our conversion code, but this is
returning the wrong results on Windows.
Alexey Bataev [Wed, 28 Apr 2021 14:27:13 +0000 (07:27 -0700)]
[SLP]Try to vectorize tiny trees with shuffled gathers of extractelements.
If we gather extract elements and they actually are just shuffles, it
might be profitable to vectorize them even if the tree is tiny.
Differential Revision: https://reviews.llvm.org/D101460
Nicolas Vasilache [Thu, 20 May 2021 15:05:05 +0000 (15:05 +0000)]
[mlir][Linalg] NFC - Drop Linalg EDSC usage
Drop the Linalg dialect EDSC subdirectory and update all uses.
Differential Revision: https://reviews.llvm.org/D102848
Aaron Ballman [Thu, 20 May 2021 15:28:36 +0000 (11:28 -0400)]
Correct some thread safety analysis diagnostics; NFC.
The diagnostics were not following the usual style rules.
Jon Chesterfield [Thu, 20 May 2021 15:26:42 +0000 (16:26 +0100)]
[libomptarget][amdgpu] Remove majority of fatal errors
[libomptarget][amdgpu] Remove majority of fatal errors
Replaces most calls to exit() with returning an error to the library entry
point. Minor changes to error handling for clear bugs, remove some dead code.
Each exit() call site replaced is either in a library entry point or a
function that already returns error codes on some paths. The existing handling
is not well tested but replacing exit() with a fallback path should be a strict
improvement.
Remaining two early exit points are an abort() from a callback and exit() from
within msgpack. Fixes for those are less obvious and left for a later patch.
Reviewed By: pdhaliwal
Differential Revision: https://reviews.llvm.org/D102346
Raphael Isemann [Thu, 20 May 2021 15:05:16 +0000 (17:05 +0200)]
[lldb][NFC] Add more Float16 unit tests
Daniel Kiss [Thu, 20 May 2021 15:06:43 +0000 (17:06 +0200)]
[ARM][AArch64] SLSHardening: make non-comdat thunks possible
Linker scripts might not handle COMDAT sections. SLSHardeing adds
new section for each __llvm_slsblr_thunk_xN. This new option allows
the generation of the thunks into the normal text section to handle these
exceptional cases.
,comdat or ,noncomdat can be added to harden-sls to control the codegen.
-mharden-sls=[all|retbr|blr],nocomdat.
Reviewed By: kristof.beyls
Differential Revision: https://reviews.llvm.org/D100546
Louis Dionne [Thu, 20 May 2021 15:01:10 +0000 (11:01 -0400)]
[libc++] Fix documentation build failure
Louis Dionne [Sat, 8 May 2021 15:14:58 +0000 (11:14 -0400)]
[libc++] Remove workaround for PR28391 (ODR violations with ASAN)
This is not an issue anymore since we don't build the libc++ dylib with
C++14 anymore (see https://llvm.org/PR28391) for details.
Differential Revision: https://reviews.llvm.org/D102106
Jon Chesterfield [Thu, 20 May 2021 14:46:53 +0000 (15:46 +0100)]
[libomptarget] Disable test bug49334 on amdgpu
[libomptarget] Disable test bug49334 on amdgpu
Hangs on amdgpu, do not know why. Disable to unblock build.
Reviewed By: ye-luo
Differential Revision: https://reviews.llvm.org/D102017
Louis Dionne [Fri, 26 Feb 2021 18:18:21 +0000 (13:18 -0500)]
[libc++] Switch a few CI jobs to the minimal Lit configuration
Eventually, this should become the default way of running the tests.
For now, only move a few CI nodes to it, and keep a node that runs the
legacy configuration.
Differential Revision: https://reviews.llvm.org/D97565
Andrzej Warzynski [Thu, 20 May 2021 14:37:28 +0000 (14:37 +0000)]
[flang][docs] Update driver sync-up call link
The old invitation has expired, so I've created a new one and update the
link in the docs accordingly.
Aaron Puchert [Thu, 20 May 2021 14:28:46 +0000 (16:28 +0200)]
[AST] Store regular ValueDecl* in BindingDecl (NFC)
We were always storing a regular ValueDecl* as decomposition declaration
and haven't been using the opportunity to initialize it lazily.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D99455
Djordje Todorovic [Thu, 20 May 2021 14:10:00 +0000 (07:10 -0700)]
Revert "[Debugify][Original DI] Test dbg var loc preservation"
This reverts commit
76f375f3d9d6902820ffc21200e454926748c678.
This will be pushed again, after investigating a test failure:
https://lab.llvm.org/buildbot/#/builders/16/builds/11254
Hubert Tong [Thu, 20 May 2021 13:50:33 +0000 (09:50 -0400)]
[test] Fix pre-ra-sched.c to check for error message from stderr
The test previous accidentally passed because it was looking for a lack
of specific input from the binary(!) output being sent to stdout.
Tamar Christina [Thu, 20 May 2021 13:42:55 +0000 (14:42 +0100)]
Revert "libsanitizer: Guard cyclades inclusion in sanitizer"
This reverts commit
f7c5351552387bd43f6ca3631016d7f0dfe0f135.
To investigate a test failure.
Djordje Todorovic [Wed, 12 May 2021 08:44:28 +0000 (01:44 -0700)]
[Debugify][Original DI] Test dbg var loc preservation
This is an improvement of [0]. This adds checking of
original llvm.dbg.values()/declares() instructions in
optimizations.
We have picked a real issue that has been found with
this (actually, picked one variable location missing
from [1] and resolved the issue), and the result is
the fix for that -- D100844.
Before applying the D100844, using the options from [0]
(but with this patch applied) on the compilation of GDB 7.11,
the final HTML report for the debug-info issues can be found
at [1] (please scroll down, and look for
"Summary of Variable Location Bugs"). After applying
the D100844, the numbers has improved a bit -- please take
a look into [2].
[0] https://llvm.org/docs/HowToUpdateDebugInfo.html\
[1] https://djolertrk.github.io/di-check-before-adce-fix/
[2] https://djolertrk.github.io/di-check-after-adce-fix/
Differential Revision: https://reviews.llvm.org/D100845
Paul C. Anagnostopoulos [Tue, 11 May 2021 14:20:36 +0000 (10:20 -0400)]
[TableGen] [Clang] Clean up arm_mve.td file.
Differential Revision: https://reviews.llvm.org/D102238
Xiangling Liao [Thu, 20 May 2021 12:58:53 +0000 (08:58 -0400)]
Fix LIT failure on native aix
On AIX, char bitfields have the same alignment as unsigned int.
Reference: https://reviews.llvm.org/D87029
Differential Revision: https://reviews.llvm.org/D102715
Haojian Wu [Wed, 19 May 2021 12:28:41 +0000 (14:28 +0200)]
[clang] Invalidate a non-dependent-type RecordDecl when it has any dependent-type base class specifier.
This happens during the error-recovery, and it would esacpe all
dependent-type check guards in getTypeInfo/constexpr-evaluator code
paths, which lead to crashes.
Differential Revision: https://reviews.llvm.org/D102773
Joerg Sonnenberger [Thu, 20 May 2021 13:25:46 +0000 (15:25 +0200)]
[SPARCv9] allow stw as alias for st
Strictly speaking, the architecture manual no longer uses the st
mnemonic, but that's a much more intrusive change for little gain.
Differential Revision: https://reviews.llvm.org/D96313
David Green [Thu, 20 May 2021 13:13:39 +0000 (14:13 +0100)]
[ARM] Extra tests for MVE vhadd and vmulh. NFC
Adrian Kuegel [Thu, 20 May 2021 11:59:16 +0000 (13:59 +0200)]
[mlir] Add conversion from complex to standard dialect for EqualOp.
This adds the straightforward conversion for EqualOp
(two complex numbers are equal if both the real and the imaginary part are equal).
Differential Revision: https://reviews.llvm.org/D102840
David Sherwood [Fri, 14 May 2021 09:50:08 +0000 (10:50 +0100)]
[CodeGen] Add support for widening the result of EXTRACT_SUBVECTOR
When trying to return a type such as <vscale x 1 x i32> from a
function we crash in DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR
when attempting to get the fixed number of elements in the vector.
For the simple case we are dealing with, i.e. extracting
<vscale x 1 x i32> from index 0 of input vector <vscale x 4 x i32>
we can simply rely upon existing code that just returns the input.
Differential Revision: https://reviews.llvm.org/D102605
Adrian Kuegel [Thu, 20 May 2021 11:12:23 +0000 (13:12 +0200)]
[mlir] Add EqualOp and NotEqualOp to complex dialect.
Simon Pilgrim [Thu, 20 May 2021 11:16:01 +0000 (12:16 +0100)]
[CostModel][X86][AVX2] Improve 256-bit vector non-uniform shifts costs
Haswell, Excavator and early Ryzen all have slower 256-bit non-uniform vector shifts (confirmed on AMDSoG/Agner/instlatx64 and llvm models) - so bump the worst case costs accordingly.
Noticed while investigating PR50364
David Truby [Thu, 20 May 2021 10:50:08 +0000 (10:50 +0000)]
[llvm][sve] Lowering for VLS MLOAD/MSTORE
This adds custom lowering for the MLOAD and MSTORE ISD nodes when
passed fixed length vectors in SVE. This is done by converting the
vectors to VLA vectors and using the VLA code generation.
Fixed length extending loads and truncating stores currently produce
correct code, but do not use the built in extend/truncate in the
load and store instructions. This will be fixed in a future patch.
Differential Revision: https://reviews.llvm.org/D101834
Michael Spencer [Thu, 20 May 2021 08:54:11 +0000 (10:54 +0200)]
Reapply "[clang][deps] Support inferred modules"
This reverts commit
76b8754d and ensures the PCM files are created in the correct directory (not in the current working directory).
Roman Lebedev [Thu, 20 May 2021 10:29:56 +0000 (13:29 +0300)]
[NFC][Coroutines] Autogenerate a few tests for ease of further updates
Sergey Dmitriev [Thu, 20 May 2021 09:29:32 +0000 (02:29 -0700)]
[llvm-strip] Add support for '--' for delimiting options from input files
This will allow to use llvm-strip with file names that begin with dashes.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D102825
David Green [Thu, 20 May 2021 10:32:51 +0000 (11:32 +0100)]
[AArch64] Add extra codegen tests. NFC
This adds some extra codegen tests for abs and hadd, regenerating some
of the existing tests with updated check lines.
LLVM GN Syncbot [Thu, 20 May 2021 10:17:56 +0000 (10:17 +0000)]
[gn build] Port
081c62501e4f
Alexey Lapshin [Fri, 23 Apr 2021 11:19:11 +0000 (14:19 +0300)]
[llvm-objcopy] Refactor CopyConfig structure.
This patch prepares llvm-objcopy to move its implementation
into a separate library. To make it possible it is necessary
to minimize internal dependencies.
Differential Revision: https://reviews.llvm.org/D99055
Roman Lebedev [Thu, 20 May 2021 10:03:59 +0000 (13:03 +0300)]
[NFC][CHR] Autogenerate checklines in a few tests for ease of updates
Roman Lebedev [Thu, 20 May 2021 10:03:42 +0000 (13:03 +0300)]
[NFC][PruneEH] Autogenerate checklines in a few tests for ease of updates
Roman Lebedev [Thu, 20 May 2021 10:03:34 +0000 (13:03 +0300)]
[NFC][SimplifyCFG] Autogenerate checklines in a few tests for ease of updates
Tamar Christina [Thu, 20 May 2021 09:58:37 +0000 (10:58 +0100)]
libsanitizer: Guard cyclades inclusion in sanitizer
The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.
libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.
Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.
As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.
[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D102059
Simon Pilgrim [Thu, 20 May 2021 09:13:46 +0000 (10:13 +0100)]
[X86][AVX] Don't scrub pointer math in avx-vperm2x128.ll
This will make it easier to track address offsets in folded loads/broadcasts of subvectors