Commit Graph

367215 Commits

Author SHA1 Message Date
Alexandre Ganea 55624237be [LLD][COFF] Avoid overwriting inputs in tests
Before this patch, these two tests were emitting both a .DLL and .LIB. The output .LIB file name also happens to be an input .LIB file name. This prevented the test from executing a second time when LLD is re-entrant (LLD_IN_TEST=2).

This is a support patch for https://reviews.llvm.org/D70378.
2020-09-24 15:01:25 -04:00
Saleem Abdulrasool d34c8c70aa Basic: add an extra newline for sphinx (NFC)
This should resolve the "Bullet list ends without a blank line" warning.
2020-09-24 18:51:10 +00:00
Alexey Bataev cde7d90cc7 Revert "[OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default"
This reverts commit d1419c9fda to fix the
buffer overflow detected by address sanitiizer.
2020-09-24 14:42:04 -04:00
Jinsong Ji 29ec5901c9 [llvm-exegesis] Add whitespace between words in error message 2020-09-24 18:20:57 +00:00
Reid Kleckner b62fd436a3 Revert "Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic"
This reverts commit 8e780a1653.

DiagnosticBuilder is a value type, created on the stack everywhere. IMO
we should not be adding a vtable to it, and making very operator<< use a
virtual interface. There are other feasible designs for implementing
this. The original review, D84362, was approved by @tra, who is
responsible for Clang's CUDA support, but it wasn't reviewed by @rsmith
or anyone responsible for clang's diagnostic library.
2020-09-24 11:16:55 -07:00
Reid Kleckner 3453b6928d Revert "Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions""
This reverts commit e39da8ab6a.

This depends on a change that needs additional design review and needs
to be reverted.
2020-09-24 11:16:54 -07:00
Sanjay Patel e34bd1e0b0 [APFloat] prevent NaN morphing into Inf on conversion (PR43907)
We shift the significand right on a truncation, but that needs to be made NaN-safe:
always set at least 1 bit in the significand.
https://llvm.org/PR43907

See D88238 for the likely follow-up (but needs some plumbing fixes before it can proceed).

Differential Revision: https://reviews.llvm.org/D87835
2020-09-24 14:02:19 -04:00
Craig Topper 03f22b08e2 [SLP] Remove LHS and RHS from OperationData.
These were only really used for 2 things. One was to check if the operand matches the phi if it exists. The other was for the createOp method to build the reduction.

For the first case we still have the operation we just need to know how to index its operands. So I've modified getLHS/getRHS to just use the opcode/kind to know how to find the right operands on an instruction that is now passed in.

For the other case we had to create an OperationData object to set the LHS/RHS values and copy the opcode/kind from another object. We would then just call createOp on that temporary object. Instead I've made LHS/RHS arguments to createOp and removed all these temporary objects.

Differential Revision: https://reviews.llvm.org/D88193
2020-09-24 10:57:11 -07:00
Alexey Bataev d1419c9fda [OPENMP]Fix PR47621: Variable used by task inside a template function is not made firstprivate by default
Need to fix a check for the variable if it is declared in the inner
OpenMP region to be able to firstprivatize it.

Differential Revision: https://reviews.llvm.org/D88240
2020-09-24 13:51:21 -04:00
Simon Pilgrim 81a408808f [Scalar] ConstantHoistingPass - iterate with const references. NFCI.
Fix some clang-tidy warnings.
2020-09-24 18:40:50 +01:00
Simon Pilgrim bdd6af3a58 [AArch64] Regenerate dag-numsignbits.ll checks
To improve the codegen diff in D87502
2020-09-24 18:40:49 +01:00
Stanislav Mekhanoshin 27a62f6317 [AMDGPU] global-isel support for RT
Differential Revision: https://reviews.llvm.org/D87847
2020-09-24 10:29:45 -07:00
Alexey Bataev a9fca98ee4 [OPENMP]PR47606: Do not update the lastprivate item if it was captured by reference as firstprivate data member.
No need to make final copy from the firsptrivate/lastprivate copy to the original item if the item is a data memeber.
Firstprivate copy creates a copy by reference and the original item gets
updated correctly when updating the lastprivate shared variable.

Differential Revision: https://reviews.llvm.org/D88179
2020-09-24 13:14:13 -04:00
Momchil Velikov bd44558001 [AArch64][GlobalISel] Implement __builtin_return_address for PAC-RET
This patch implements stripping of the PAC in the return address for GlobalISel.

Implementation for when not using GLobalISel is in
https://reviews.llvm.org/D75044 The analogous GCC patch is
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=a70d5d81c41048556fd86eaa1036018a6bfba115

Differential Revision: https://reviews.llvm.org/D84502
2020-09-24 18:04:37 +01:00
Andrew Litteken 08d145e6d7 [IRSim][NFC] Removing dead variables from IRSimilarityIdentifier.cpp
As informed by danielkiss.

Follow up to Differential Revision: https://reviews.llvm.org/D86972
2020-09-24 11:43:33 -05:00
Ye Luo ffd159d8e9 [OpenMP] cmake option LIBOMPTARGET_NVPTX_MAX_SM for nvptx device RTL
It allows customizing MAX_SM for non-flagship GPU and reduces graphic memory usage.

In addition, so far the size is hard-coded up to __CUDA_ARCH__ 700 and is already a hassle for 800.
Introduce MAX_SM for 800 and protect future arch

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D88185
2020-09-24 12:39:59 -04:00
Dave Lee ada1e2ffa1 [lldb/examples] Add missing declaration in heap.py
Add missing declaration for `malloc_get_all_zones` in heap.py.

Differential Revision: https://reviews.llvm.org/D88158
2020-09-24 08:44:45 -07:00
Saleem Abdulrasool 296d8832a3 Sema: add support for `__attribute__((__swift_newtype__))`
Add the `swift_newtype` attribute which allows a type definition to be
imported into Swift as a new type.  The imported type must be either an
enumerated type (enum) or an object type (struct).

This is based on the work of the original changes in
8afaf3aad2

Differential Revision: https://reviews.llvm.org/D87652
Reviewed By: Aaron Ballman
2020-09-24 15:17:35 +00:00
Nathan Froyd 31a3c5fb45 [clang] use string tables for static diagnostic descriptions
Using a pointer for the description string in StaticDiagInfoRec causes
several problems:

1. We don't need to use a whole pointer to represent the string;
2. The use of pointers incurs runtime relocations for those pointers;
   the relocations take up space on disk and represent runtime overhead;
3. The need to relocate data implies that, on some platforms, the entire
   array containing StaticDiagInfoRecs cannot be shared between processes.

This patch changes the storage scheme for the diagnostic descriptions to
avoid these problems.  We instead generate (effectively) one large
string and then StaticDiagInfoRec conceptually holds offsets into the
string.  We elected to also move the storage of those offsets into a
separate array to further reduce the space required.

On x86-64 Linux, this change removes about 120KB of relocations and
moves about 60KB from the non-shareable .data.rel.ro section to
shareable .rodata.  (The array is about 80KB before this, but we
eliminated 4 bytes/entry by using offsets rather than pointers.)  We
actually reap this benefit twice, because these tables show up in both
libclang.so and libclang-cpp.so and we get the reduction in both places.

Differential Revision: https://reviews.llvm.org/D81865
2020-09-24 10:54:28 -04:00
Simon Pilgrim 283036394e [X86][SSE] combineVectorTruncation - enable (pre-SSSE3) vXi16->vXi8 truncation.
Shuffle combining can now handle this output, and by performing this early in combineVectorTruncation we avoid a scalarization that caused a regression on D87502.
2020-09-24 15:51:36 +01:00
Peyton, Jonathan L ee1c04a926 [OpenMP] Fix if0 task with dependencies in the runtime
The current GOMP interface for serialized tasks does not take into
account task dependencies. Add the check and wait for dependencies.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=46573

Differential Revision: https://reviews.llvm.org/D87271
2020-09-24 09:47:53 -05:00
Peyton, Jonathan L 9089b4a5c5 [OpenMP] Introduce GOMP taskwait depend in the runtime
This change introduces the GOMP_taskwait_depend() function. It implements
the OpenMP 5.0 feature of #pragma omp taskwait with depend() clause by
wrapping around __kmpc_omp_wait_deps().

Differential Revision: https://reviews.llvm.org/D87269
2020-09-24 09:45:14 -05:00
Peyton, Jonathan L 72ada5ae6c [OpenMP] Introduce GOMP mutexinoutset in the runtime
Encapsulate GOMP task dependencies in separate class and introduce the
new mutexinoutset dependency type. This separate class allows
future GOMP task APIs easier access to the task dependency functionality
and better ability to propagate new dependency types to all existing GOMP
task APIs which use task dependencies.

Differential Revision: https://reviews.llvm.org/D87267
2020-09-24 09:45:13 -05:00
Peyton, Jonathan L ea34d95e0a [OpenMP] Introduce GOMP teams support in runtime
Implement GOMP_teams_reg() function which enables GOMP support of the
standalone teams construct. The GOMP_parallel* functions were modified
to call __kmp_fork_call() unconditionally so that the teams-specific
code could be reused within __kmp_fork_call() instead of reproduced
inside the GOMP_* functions.

Differential Revision: https://reviews.llvm.org/D87167
2020-09-24 09:45:13 -05:00
Sam Parker 00ee52ae04 [NFC][ARM] Remove dead loop.
Remove a loop that just calculated a couple of values that were now
longer needed.
2020-09-24 15:37:26 +01:00
vpykhtin d9beff04a3 [RegisterCoalescer] Fix IMPLICIT_DEF init removal for a register on joining
This patch removes redundant IMPLICIT_DEF for subregs which was leading to
incorrect register initialization on joining in some cases.

Reviewed by: qcolombet

Differential revision: https://reviews.llvm.org/D82258
2020-09-24 17:37:03 +03:00
Jay Foad c05cf1ca3c [AMDGPU] Use cast instead of dyn_cast 2020-09-24 15:20:49 +01:00
Sebastian Neubauer 6f7cd16d29 [AMDGPU] Fix v3f16 handling for getresinfo
v3f32 should not be expanded to v4f32. getresinfo with a dmask of 7
created an image sample with a v3f32 return value, which was bitcasted
to a v4f32 in constructRetValue.

Differential Revision: https://reviews.llvm.org/D88206
2020-09-24 16:03:02 +02:00
Matt Arsenault dc08185ca7 IR: Have byref imply dereferenceable
The langref already states it does, but this wasn't implemented. Also
covers inalloca and preallocated. Also helps fix a dependence on
pointer element types.
2020-09-24 09:57:28 -04:00
Matt Arsenault d65a7003c4 OpaquePtr: Add helpers for sret to mirror byval
Sret should really have a type parameter like byval does.
2020-09-24 09:57:28 -04:00
George Mitenkov 8f72717ebe [MLIR][SPIRV] Fixed dialect loading in deserialization
Fixed an error when deserializing the SPIR-V binary
to MLIR SPIR-V. Before, the SPIR-V dialect was not loaded
explicitly into the context, which resulted in unregistered
operation error.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D88223
2020-09-24 16:56:14 +03:00
Sanjay Patel 2625433e77 [PhaseOrdering] move test with target requirement to x86 dir
I'm not sure if the target is actually necessary,
but since it was specified, I'm moving to the
appropriate dir to avoid bot fallout.
2020-09-24 09:54:14 -04:00
Sanjay Patel 9cf647bb3f [PhaseOrdering] move an 'opt' test from x86 codegen; NFC
This file comes from 2007, and I'm not entirely sure of the
motivation, but it was going through all of opt and llc.
The llc part is almost certainly unnecessary as shown in
the now auto-generated FileCheck lines.

This test may be affected by a logic change suggested in:
D87835
2020-09-24 09:47:38 -04:00
Sanjay Patel 8e712807e4 [InstCombine] regenerate test checks; NFC 2020-09-24 09:34:17 -04:00
Nico Weber 0389eff404 lld: Try to fix check-lld on incremental builds after 8f2c31f22b 2020-09-24 09:33:57 -04:00
Alexey Baturo 303e8cdacb [NFC][RISCV][builtins] Remove some hard-coded values from i-cache clear routine
Remove some hard-coded values from i-cache clear routine

Differential Revision: https://reviews.llvm.org/D87578
2020-09-24 14:32:16 +01:00
Haruki Imai ff00b58392 [MLIR] Normalize memrefs in LoadOp and StoreOp of Standard Ops
Added a trait, `MemRefsNormalizable` in LoadOp and StoreOp of Standard Ops
to normalize input memrefs in LoadOp and StoreOp.

Related revision: https://reviews.llvm.org/D86236

Differential Revision: https://reviews.llvm.org/D88156
2020-09-24 18:57:15 +05:30
Alexandre Ganea a6a6ccfc4c Fix f5314d15af - [Support] On Unix, let the CrashRecoveryContext return the signal code
This was causing bots to fail: http://green.lab.llvm.org/green/job/clang-stage1-RA/14828/consoleFull#6384962949ba4694-19c4-4d7e-bec5-911270d8a58c
2020-09-24 09:07:22 -04:00
Alexandre Ganea 4b64ce7428 Improve 723fea2307 - Silence 'warning: unused variable' when compiling with Clang 10.0 2020-09-24 09:07:22 -04:00
Yaxun (Sam) Liu e39da8ab6a Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"
This recommits 7f1f89ec8d and
40df06cdaf after fixing memory
sanitizer failure.
2020-09-24 08:44:37 -04:00
Simon Pilgrim a815578c31 [AArch64] Regenerate dag-combine-mul-shl.ll checks 2020-09-24 13:42:03 +01:00
Sjoerd Meijer 2fc690ac90 [ARM] LowoverheadLoops: add an option to disable tail-predication
This might be useful for testing. We already have an option -tail-predication
but that controls the MVETailPredication pass.  This
-arm-loloops-disable-tail-pred is just for disabling it in the LowoverheadLoops
pass.

Differential Revision: https://reviews.llvm.org/D88212
2020-09-24 13:30:48 +01:00
Sam Parker 9d9a11c7be [ARM] Check for LSTP side-effects.
If the LSTP instruction is inserted with an element count low enough
to immediately predicate some lanes as false, this can have some
unintended effects on any proceeding MVE instructions in the
preheader.

Differential Revision: https://reviews.llvm.org/D88209
2020-09-24 13:28:35 +01:00
Alexandre Ganea f5314d15af [Support] On Unix, let the CrashRecoveryContext return the signal code
Before this patch, the CrashRecoveryContext was returning -2 upon a signal, like ExecuteAndWait does. This didn't match the behavior on Windows, where the the exception code was returned.

We now return the signal's code, which optionally allows for re-throwing the signal later. Doing so requires all custom handlers to be removed first, through llvm::sys::unregisterHandlers() which we made a public API.

This is part of https://reviews.llvm.org/D70378
2020-09-24 08:21:43 -04:00
Zachary Turner b3418cb4eb [lit] Support running tests on Windows without GnuWin32
Historically, we have told contributors that GnuWin32 is a pre-requisite
because our tests depend on utilities such as sed, grep, diff, and more.
However, Git on Windows includes versions of these utilities in its
installation.  Furthermore, GnuWin32 has not been updated in many years.
For these reasons, it makes sense to have the ability to run llvm tests
in a way that is both:
  a) Easier on the user (less stuff to install)
  b) More up-to-date (The verions that ship with git are at least as
     new, if not newer, than the versions in GnuWin32.

We add support for this here by attempting to detect where Git is
installed using the Windows registry, confirming the existence of
several common Unix tools, and then adding this location to lit's PATH
environment.

Differential Revision: https://reviews.llvm.org/D84380
2020-09-24 08:21:43 -04:00
Alexandre Ganea 24f510570f [Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext
Before this patch, the CrashRecoveryContext would only catch the first abort(). Any further calls to abort() inside subsquent CrashRecoveryContexts would not be catched. This is because the Windows CRT removes the abort() handler before calling it.

This is part of https://reviews.llvm.org/D70378
2020-09-24 08:21:42 -04:00
Alexey Lapshin 4da6927de4 Fix a builtbot failure after 3ed04f93e3. 2020-09-24 15:09:57 +03:00
Praveen G 956a84da06 [flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs.
1. Section 2.5   : Parallel Construct
 2. Section 2.7.1 : Loop Construct
 3. Section 2.7.2 : Sections Construct
 4. Section 2.7.3 : Single Construct
 5. Section 2.7.4 : Workshare Construct
 6. Section 2.8.1 : Simd Construct
 7. Section 2.8.3 : Loop Simd Construct
 8. Section 2.9.1 : Task Construct
 9. Section 2.9.2 : Taskloop Construct
10. Section 2.9.3 : Taskloop Simd Construct

Most of the test cases added as part of this change contains semantic errors except few cases which are semantically correct but thrown a semantic error.

Currently flang is not throwing the errors for these cases and throwing semantic errors for the following correct test cases

{omp-do03.f90 , omp-loop-simd01.f90 , omp-simd02.f90 , omp-taskloop01.f90}

Hence, all the test cases are marked as XFAIL.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D87908
2020-09-24 13:09:20 +01:00
Andrzej Warzynski 10c94d8cf8 [flang][driver] Remove unnecessary includes in the unittest (NFC)
Differential Revision: https://reviews.llvm.org/D88219
2020-09-24 13:03:58 +01:00
Sanjay Patel b2c46633d1 [APFloat] add tests for convert of NAN; NFC
More coverage for the bug fix proposed in D87835.
2020-09-24 07:43:07 -04:00