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
Luke [Mon, 29 Mar 2021 13:52:14 +0000 (21:52 +0800)]
[RISCV] Add legality check for vectorizing reduction
Check if it is legal to vectorize reduction.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D99509
David Sherwood [Wed, 12 May 2021 19:00:03 +0000 (20:00 +0100)]
[CodeGen] Add support for widening INSERT_SUBVECTOR operands
When attempting to return something like a <vscale x 1 x i32>
type from a function we end up trying to widen the vector by
inserting a <vscale x 1 x i32> subvector into an undefined
<vscale x 4 x i32> vector. However, during legalisation we
then attempt to widen the INSERT_SUBVECTOR operands and hit
an error in WidenVectorOperand.
This patch adds a new WidenVecOp_INSERT_SUBVECTOR function
that currently only supports inserting subvectors into undefined
vectors.
Differential Revision: https://reviews.llvm.org/D102501
Nicolas Vasilache [Thu, 20 May 2021 09:07:21 +0000 (09:07 +0000)]
[mlir][Linalg] Drop spurious usage of OperationFolder
Instead, use createOrFold builders which result in more static information available.
Differential Revision: https://reviews.llvm.org/D102832
Matthias Springer [Thu, 20 May 2021 08:51:53 +0000 (17:51 +0900)]
[mlir] Add Python bindings for vector dialect
Also add a minimal test case for vector.print.
Differential Revision: https://reviews.llvm.org/D102826
Heejin Ahn [Wed, 19 May 2021 18:22:25 +0000 (11:22 -0700)]
[WebAssembly] Ignore filters in Emscripten EH landingpads
We have been handling filters and landingpads incorrectly all along. We
pass clauses' (catches') types to `__cxa_find_matching_catch` in JS glue
code, which returns the thrown pointer and sets the selector using
`setTempRet0()`.
We apparently have been doing the same for filters' (exception specs')
types; we pass them to `__cxa_find_matching_catch` just the same way as
clauses. And `__cxa_find_matching_catch` treats all given types as
clauses. So it is a little surprising; maybe we intended to do something
from the JS side and didn't end up doing?
So anyway, I don't think supporting exception specs in Emscripten EH is
a priority, but this can actually cause incorrect results for normal
catches when functions are inlined and the inlined spec type has a
parent-child relationship with the catch's type.
---
The below is an example of a bug that can happen when inlining and class
hierarchy is mixed. If you are busy you can skip this part:
```
struct A {};
struct B : A {};
void bar() throw (B) { throw B(); }
void foo() {
try {
bar();
} catch (A &) {
fputs ("Expected result\n", stdout);
}
}
```
In the unoptimized code, `bar`'s landingpad will have a filter for `B`
and `foo`'s landingpad will have a clause for `A`. But when `bar` is
inlined into `foo`, `foo`'s landingpad has both a filter for `B` and a
clause for `A`, and it passes the both types to
`__cxa_find_matching_catch`:
```
__cxa_find_matching_catch(typeinfo for B, typeinfo for A)
```
`__cxa_find_matching_catch` thinks both are clauses, and looks at the
first type `B`, which belongs to a filter. And the thrown type is `B`,
so it thinks the first type `B` is caught. But this makes it return an
incorrect selector, because it is supposed to catch the exception using
the second type `A`, which is a parent of `B`. As a result, the `foo` in
the example program above does not print "Expected result" but just
throws the exception to the caller. (This wouldn't have happened if `A`
and `B` are completely disjoint types, such as `float` and `int`)
Fixes https://bugs.llvm.org/show_bug.cgi?id=50357.
Reviewed By: dschuff, kripken
Differential Revision: https://reviews.llvm.org/D102795
Caroline Concatto [Thu, 13 May 2021 18:06:55 +0000 (19:06 +0100)]
[CostModel][AArch64] Add missing costs for getShuffleCost with scalable vectors
Differential Revision: https://reviews.llvm.org/D102490
serge-sans-paille [Tue, 11 May 2021 18:46:58 +0000 (20:46 +0200)]
Force visibility of llvm::Any to external
llvm::Any::TypeId::Id relies on the uniqueness of the address of a static
variable defined in a template function. hidden visibility implies vague linkage
for that variable, which does not guarantee the uniqueness of the address across
a binary and a shared library. This totally breaks the implementation of
llvm::Any.
Ideally, setting visibility to llvm::Any::TypeId::Id should be enough,
unfortunately this doesn't work as expected and we lack time (before 12.0.1
release) to understand why setting the visibility to llvm::Any does work.
See https://gcc.gnu.org/wiki/Visibility and
https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html
for more information on that topic.
Differential Revision: https://reviews.llvm.org/D101972
Andrew Savonichev [Tue, 18 May 2021 12:54:43 +0000 (15:54 +0300)]
[AArch64] Combine vector shift instructions in SelectionDAG
bswap.v2i16 + sitofp in LLVM IR generate a sequence of:
- REV32 + USHR for bswap.v2i16
- SHL + SSHR + SCVTF for sext to v2i32 and scvt
The shift instructions are excessive as noted in PR24820, and they can
be optimized to just SSHR.
Differential Revision: https://reviews.llvm.org/D102333
Tobias Gysi [Thu, 20 May 2021 07:22:45 +0000 (07:22 +0000)]
[mlir][Python][linalg] Fix to limit size of SmallVector.
Stack allocate at most two ScalarAssign elements. Using the default number of inlined elements triggered a static assert in some setups (https://reviews.llvm.org/D102075).
Differential Revision: https://reviews.llvm.org/D102827
Haojian Wu [Wed, 19 May 2021 13:18:53 +0000 (15:18 +0200)]
[clang-tidy] Fix a crash for raw-string-literal check.
getSourceText could return an empty string for error cases (e.g. invalid
source locaiton), this patch makes the code more robust.
The crash did happen in our internal codebase, but unfortunately I
didn't manage to get a reproduce case. One thing I can confirm from
the core dump is that the crash is caused by calling isRawStringLiteral
on an empty Text.
Differential Revision: https://reviews.llvm.org/D102770
Amara Emerson [Thu, 20 May 2021 05:48:50 +0000 (22:48 -0700)]
[GlobalISel] Fix div+rem -> divrem combine causing use-def violation.
Simon Giesecke [Fri, 7 May 2021 10:42:38 +0000 (10:42 +0000)]
Add option to llvm-gsymutil to read addresses from stdin.
Differential Revision: https://reviews.llvm.org/D102224
Vitaly Buka [Wed, 19 May 2021 20:57:36 +0000 (13:57 -0700)]
[tsan] Deflake pthread_atfork_deadlock3
sleep(1) does not guaranty afterfork order.
Also relative child/parent afterfork order is not important for this test so we
can just avoid checking that.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D102810
Xiang1 Zhang [Thu, 20 May 2021 05:12:31 +0000 (13:12 +0800)]
Revert "[HWASAN] Update the tag info for X86_64."
This reverts commit
81c18ce03cd8199cc4f2c817e31b42a191a0fe7d.
Sergey Dmitriev [Thu, 20 May 2021 03:23:59 +0000 (20:23 -0700)]
[clang-offload-bundler] Delimit input/output file names by '--' for llvm-objcopy
That fixes a problem of using bundler with file names starting with dash.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D102752
Xiang1 Zhang [Wed, 19 May 2021 02:27:47 +0000 (10:27 +0800)]
[HWASAN] Update the tag info for X86_64.
In LAM model X86_64 will use bits 57-62 (of 0-63) as HWASAN tag.
So here we make sure the tag shift position and tag mask is correct for x86-64.
Differential Revision: https://reviews.llvm.org/D102472
Sergey Dmitriev [Thu, 20 May 2021 02:56:00 +0000 (19:56 -0700)]
[llvm-objcopy] Update LIT test to resolve bot failure [NFC]
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D102823
Johannes Doerfert [Wed, 19 May 2021 02:52:53 +0000 (21:52 -0500)]
[OpenMP][NFC] Remove SIMD check lines for non-simd tests
If a test does not contain an " simd" but -fopenmp-simd RUN lines we can
just check that we do not create __kmpc|__tgt calls.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D101973
Zhiwei Chen [Thu, 20 May 2021 02:18:49 +0000 (19:18 -0700)]
[sanitizer] Reduce redzone size for small size global objects
Currently 1 byte global object has a ridiculous 63 bytes redzone.
This patch reduces the redzone size to be less than 32 if the size of global object is less than or equal to half of 32 (the minimal size of redzone).
A 12 bytes object has a 20 bytes redzone, a 20 bytes object has a 44 bytes redzone.
Reviewed By: MaskRay, #sanitizers, vitalybuka
Differential Revision: https://reviews.llvm.org/D102469
Jon Roelofs [Thu, 20 May 2021 00:42:19 +0000 (17:42 -0700)]
Fix warnings in windows bots. NFC
River Riddle [Wed, 19 May 2021 23:53:35 +0000 (16:53 -0700)]
[mlir] Refactor the implementation of pass crash reproducers
The current implementation has several key limitations and weirdness, e.g local reproducers don't support dynamic pass pipelines, error messages don't include the passes that failed, etc. This revision refactors the implementation to support more use cases, and also be much cleaner.
The main change in this revision, aside from moving the implementation out of Pass.cpp and into its own file, is the addition of a crash recovery pass instrumentation. For local reproducers, this instrumentation handles setting up the recovery context before executing each pass. For global reproducers, the instrumentation is used to provide a more detailed error message, containing information about which passes are running and on which operations.
Example of new message:
```
error: Failures have been detected while processing an MLIR pass pipeline
note: Pipeline failed while executing [`TestCrashRecoveryPass` on 'module' operation: @foo]: reproducer generated at `crash-recovery.mlir.tmp`
```
Differential Revision: https://reviews.llvm.org/D101854
River Riddle [Wed, 19 May 2021 23:53:23 +0000 (16:53 -0700)]
[mlir] Add a new `print-ir-after-failure` IR pass printing flag
This flag will print the IR after a pass only in the case where the pass failed. This can be useful to more easily view the invalid IR, without needing to print after every pass in the pipeline.
Differential Revision: https://reviews.llvm.org/D101853
Fangrui Song [Wed, 19 May 2021 23:23:52 +0000 (16:23 -0700)]
[test] Fix test
Fangrui Song [Wed, 19 May 2021 23:08:28 +0000 (16:08 -0700)]
-fno-semantic-interposition: Don't set dso_local on GlobalVariable
`clang -fpic -fno-semantic-interposition` may set dso_local on variables for -fpic.
GCC folks consider there are 'address interposition' and 'semantic interposition',
and 'disabling semantic interposition' can optimize function calls but
cannot change variable references to use local aliases
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483).
This patch removes dso_local for variables in
`clang -fpic -fno-semantic-interposition` mode so that the built shared objects can
work with copy relocations. Building llvm-project tiself with
-fno-semantic-interposition (D102453) should now be safe with trunk Clang.
Example:
```
// a.c
int var;
int *addr() { return var; }
// old: cannot be interposed
movslq .Lvar$local(%rip), %rax
// new: can be interposed
movq var@GOTPCREL(%rip), %rax
movslq (%rax), %rax
```
The local alias lowering for `GlobalVariable`s is kept in case there is a
future option allowing local aliases.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D102583
Richard Smith [Wed, 19 May 2021 23:01:45 +0000 (16:01 -0700)]
PR50402: Use proper constant evaluation rules for checking constraint
satisfaction.
Previously we used the rules for constant folding in a non-constant
context, meaning that we'd incorrectly accept foldable non-constant
expressions and that std::is_constant_evaluated() would evaluate to
false.
LLVM GN Syncbot [Wed, 19 May 2021 22:27:27 +0000 (22:27 +0000)]
[gn build] Port
4bf69fb52b3c
Sam Clegg [Wed, 19 May 2021 20:33:24 +0000 (13:33 -0700)]
[lld][WebAssembly] Fix for string tail merging and -r/--relocatable
Ensure that both SyntheticMergedChunk and all MergeInfoChunks that it
comprises are assigned the correct output section. Without this we
would crash when outputting relocations in --relocatable mode.
Fixes: https://github.com/emscripten-core/emscripten/issues/14220
Differential Revision: https://reviews.llvm.org/D102806
Ahmed Bougacha [Tue, 20 Apr 2021 17:31:26 +0000 (10:31 -0700)]
[docs] Describe reporting security issues on the chromium tracker.
To track security issues, we're starting with the chromium bug tracker
(using the llvm project there).
We considered using Github Security Advisories. However, they are
currently intended as a way for project owners to publicize their
security advisories, and aren't well-suited to reporting issues.
This also moves the issue-reporting paragraph to the beginning of the
document, in part to make it more discoverable, in part to allow the
anchor-linking to actually display the paragraph at the top of the page.
Note that this doesn't update the concrete list of security-sensitive
areas, which is still an open item. When we do, we may want to move the
list of security-sensitive areas next to the issue-reporting paragraph
as well, as it seems like relevant information needed in the reporting
process.
Finally, when describing the discission medium, this splits the topics
discussed into two: the concrete security issues, discussed in the
issue tracker, and the logistics of the group, in our mailing list,
as patches on public lists, and in the monthly sync-up call.
While there, add a SECURITY.md page linking to the relevant paragraph.
Differential Revision: https://reviews.llvm.org/D100873
Jon Roelofs [Tue, 18 May 2021 23:11:44 +0000 (16:11 -0700)]
[Remarks] Add analysis remarks for memset/memcpy/memmove lengths
Differential revision: https://reviews.llvm.org/D102452
Ryan Prichard [Wed, 19 May 2021 22:05:17 +0000 (15:05 -0700)]
[MC][ARM] Reject Thumb "ror rX, #0"
The ROR instruction can only handle immediates between 1 and 31. The
would-be encoding for ROR #0 is actually the RRX instruction.
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D102455
Petr Hosek [Tue, 18 May 2021 23:08:42 +0000 (16:08 -0700)]
[CMake] Don't LTO optimize targets that aren't part of any distribution
When using distributions, targets that aren't included in any
distribution don't need to be as optimized as targets that are
included since those targets are typically only used for tests.
We might consider avoiding LTO for these targets altogether, see
https://lists.llvm.org/pipermail/llvm-dev/2021-April/149843.html
Differential Revision: https://reviews.llvm.org/D102732
hasheddan [Wed, 19 May 2021 21:18:44 +0000 (14:18 -0700)]
[mlir][docs] Fix minor typos in vector dialect docs
Updates a minor typo in vector dialect documentation.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D101203
Martin Storsjö [Wed, 19 May 2021 21:16:41 +0000 (00:16 +0300)]
Revert "[Driver] Delete -mimplicit-it="
This reverts commit
2919222d8017f2425a85765b95e4b7c6f8e70ca4.
That commit broke backwards compatibility. Additionally, the
replacement, -Wa,-mimplicit-it, isn't yet supported by any stable
release of Clang.
See D102812 for a fix for the error cases when callers specify both
-mimplicit-it and -Wa,-mimplicit-it.
Vitaly Buka [Wed, 19 May 2021 21:03:40 +0000 (14:03 -0700)]
[NFC][tsan] clang-format the test
Aart Bik [Wed, 19 May 2021 17:13:40 +0000 (10:13 -0700)]
[mlir][sparse] skip sparsification for unannotated (or unhandled) cases
Skip the sparsification pass for Linalg ops without annotated tensors
(or cases that are not properly handled yet).
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D102787
River Riddle [Wed, 19 May 2021 20:37:04 +0000 (13:37 -0700)]
[mlir] Properly align StorageUniquer::BaseStorage to fix 32 bit build
We allow stealing up to 3 bits of pointers to BaseStorage, so we need to make sure that we align by at least 8.
Marius Brehler [Wed, 19 May 2021 20:16:38 +0000 (20:16 +0000)]
[mlir] Harmonize TOSA include guards
Reviewed By: sjarus
Differential Revision: https://reviews.llvm.org/D102802