platform/upstream/llvm.git
4 years ago[DebugInfo][test] Attempt to fix big endian build bots
James Henderson [Tue, 23 Jun 2020 11:33:19 +0000 (12:33 +0100)]
[DebugInfo][test] Attempt to fix big endian build bots

Commit 9782c922c broke them since it prints raw bytes, whose order will
be different dependent on the endianness of the host.

4 years agollvm-isel-fuzzer.cpp - fix implicit CommandLine.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:24:24 +0000 (12:24 +0100)]
llvm-isel-fuzzer.cpp - fix implicit CommandLine.h dependency. NFC.

llvm-isel-fuzzer uses cl::opt but don't include CommandLine.h.

4 years agollvm-dwp.cpp - fix implicit CommandLine.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:23:29 +0000 (12:23 +0100)]
llvm-dwp.cpp - fix implicit CommandLine.h dependency. NFC.

llvm-dwp uses cl::opt + cl::list but don't include CommandLine.h.

4 years agoModuleTest.cpp - fix implicit SourceMgr.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:20:44 +0000 (12:20 +0100)]
ModuleTest.cpp - fix implicit SourceMgr.h dependency. NFC.

ModuleTest.cpp was depending on other headers to define SMDiagnostic.

4 years ago[Analysis] Ensure we include CommandLine.h if we declare any cl::opt flags. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:19:09 +0000 (12:19 +0100)]
[Analysis] Ensure we include CommandLine.h if we declare any cl::opt flags. NFC.

4 years ago[libc] Add fuzz test for strcmp.
cgyurgyik [Tue, 23 Jun 2020 11:19:45 +0000 (07:19 -0400)]
[libc] Add fuzz test for strcmp.

Summary:
Adds a fuzz test for string comparison.

This takes in two strings with associated lengths.
Verifies each string contains at least one character, and that the last character is the null terminator.
Then, finds the first instance where one of the following does not hold:
1. i < min(size1, size2)
2. s1[i] == s2[i]
3. s1[i] != '\0'

The result of strcmp is then compared to the value of the difference between s1[i] and s2[i]. For thoroughness, the operands are reversed and also checked.

Reviewers: sivachandra, PaulkaToast

Reviewed By: sivachandra, PaulkaToast

Subscribers: mgorny, tschuett, ecnelises, libc-commits

Tags: #libc-project

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

4 years agoAdd strcmp fuzz test.
cgyurgyik [Sat, 20 Jun 2020 00:15:38 +0000 (20:15 -0400)]
Add strcmp fuzz test.
Reviewed-by: todo
Differential Revision: https://reviews.llvm.org/D82247

4 years agoHandle invalid types in the nullPointerConstant AST matcher
Aaron Ballman [Tue, 23 Jun 2020 11:14:33 +0000 (07:14 -0400)]
Handle invalid types in the nullPointerConstant AST matcher

Currently, using the nullPointerConstant AST matcher can lead to
assertions in situations where a node to be matched does not have a
valid type associated with it, such as a ParenListExpr. This patch
addresses that by saying such nodes cannot be a null pointer constant.
This addresses PR46353.

4 years ago[AArch64][SVE] ACLE: Add bfloat16 to struct load/stores.
Sander de Smalen [Tue, 23 Jun 2020 08:54:04 +0000 (09:54 +0100)]
[AArch64][SVE] ACLE: Add bfloat16 to struct load/stores.

This patch contains:
- Support in LLVM CodeGen for bfloat16 types for ld2/3/4 and st2/3/4.
- New bfloat16 ACLE builtins for svld(2|3|4)[_vnum] and svst(2|3|4)[_vnum]

Reviewers: stuij, efriedma, c-rhodes, fpetrogalli

Reviewed By: fpetrogalli

Tags: #clang, #lldb, #llvm

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

4 years ago[Transforms] Ensure we include CommandLine.h if we declare any cl::opt flags
Simon Pilgrim [Tue, 23 Jun 2020 11:11:16 +0000 (12:11 +0100)]
[Transforms] Ensure we include CommandLine.h if we declare any cl::opt flags

4 years agoSanitizerCoverage.h - fix implicit VirtualFileSystem.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:07:21 +0000 (12:07 +0100)]
SanitizerCoverage.h - fix implicit VirtualFileSystem.h dependency. NFC.

Was relying on other headers to define vfs::getRealFileSystem() for use in inline functions

4 years agoDWARFLinkerDeclContext.h - fix implicit FileSystem.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 11:04:05 +0000 (12:04 +0100)]
DWARFLinkerDeclContext.h - fix implicit FileSystem.h dependency. NFC.

Was relying on other headers to define sys::fs::real_path for use in CachedPathResolver::resolve inlines

4 years ago[SVE][CodeGen] Legalisation of vsetcc with scalable types
Kerry McLaughlin [Tue, 23 Jun 2020 10:34:52 +0000 (11:34 +0100)]
[SVE][CodeGen] Legalisation of vsetcc with scalable types

Summary: Changes SplitVecOp_VSETCC to use getVectorElementCount()

Reviewers: sdesmalen, efriedma, dancgr

Reviewed By: efriedma

Subscribers: david-arm, tschuett, hiraditya, rkruppe, psnobl, huihuiz, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[IndVarSimplify] Don't replace IV user with unsafe loop-invariant (PR45360)
Roman Lebedev [Tue, 23 Jun 2020 10:52:21 +0000 (13:52 +0300)]
[IndVarSimplify] Don't replace IV user with unsafe loop-invariant (PR45360)

Summary:
As [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]] reports,
with new cost-model we can sometimes end up being able to expand `udiv`/`urem` instructions.
And that exposes at least one instance of when we do that
regardless of whether or not it is safe to do.
In this particular case, it's `SimplifyIndvar::replaceIVUserWithLoopInvariant()`.

It seems to me, we simply need to check with `isSafeToExpandAt()` first.

The test isn't great. I'm not sure how to make it only run `-indvars`.

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=45360 | PR45360 ]].

Reviewers: mkazantsev, reames, helloqirun

Reviewed By: mkazantsev

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libcxx tests] Clang is more strict now about coroutines
David Zarzycki [Tue, 23 Jun 2020 10:48:02 +0000 (06:48 -0400)]
[libcxx tests] Clang is more strict now about coroutines

As of 516803dc8685ebcc5bce38b05391958ffee22643, clang is now more
strictly enforcing the coroutine specification.

See: https://reviews.llvm.org/D82029

4 years ago[PowerPC] fold addi's imm operand to its imm form consumer's displacement
Chen Zheng [Fri, 19 Jun 2020 03:31:51 +0000 (23:31 -0400)]
[PowerPC] fold addi's imm operand to its imm form consumer's displacement

This patch adds a function to do following transformation:

%0:g8rc_and_g8rc_nox0 = ADDI8 %5:g8rc_and_g8rc_nox0, 144
STD killed %7:g8rc, 16, %0:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)

------>

STD killed %7:g8rc, 160, %5:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)

Reviewed By: steven.zhang

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

4 years ago[AArch64][SVE] Guard svbfloat16_t with feature macro in ACLE
Cullen Rhodes [Fri, 19 Jun 2020 12:13:00 +0000 (12:13 +0000)]
[AArch64][SVE] Guard svbfloat16_t with feature macro in ACLE

Summary:
svbfloat16_t should only be defined if the __ARM_FEATURE_SVE_BF16
feature macro is enabled, similar to the scalar bfloat16_t type. Also,
arm_bf16.h should be included in arm_sve.h when
__ARM_FEATURE_BF16_SCALAR_ARITHMETIC is defined.

Patch also contains a fix for ld1ro intrinsic which should be guarded on
__ARM_FEATURE_SVE_BF16 rather than __ARM_FEATURE_BF16_SCALAR_ARITHMETIC,
and a fix for bfmmla test which was missing
__ARM_FEATURE_BF16_SCALAR_ARITHMETIC and -target-feature +bf16 in the
RUN line.

Reviewed By: fpetrogalli

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

4 years agoRevert "[AVR] Explicitly set the address of the data section when invoking the linker"
Dylan McKay [Tue, 23 Jun 2020 10:21:22 +0000 (22:21 +1200)]
Revert "[AVR] Explicitly set the address of the data section when invoking the linker"

This reverts commit ede6005e7092ddae454e4d365d8adefeaec1f5e3.

Ayke suggests this value varies chip-by-chip, and thus it is not safe to
hardcode to 0x800100.

Proper logic for this linker parameter will have to be wired up in a
follow up patch.

4 years ago[TableGen] Add error messages
Sebastian Neubauer [Fri, 29 May 2020 14:35:57 +0000 (16:35 +0200)]
[TableGen] Add error messages

Print an error instead of crashing in two places.

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

4 years ago[lldb] Split ClangASTSource::CompleteType
Pavel Labath [Tue, 23 Jun 2020 09:35:08 +0000 (11:35 +0200)]
[lldb] Split ClangASTSource::CompleteType

Move the part of the code which is responsible for finding a complete
definition of the type into a separate function (FindCompleteType). This
is split off from D81561, as it's a generally useful cleanup.

No functional change.

4 years ago[X86] truncateVectorWithPACK - fix outdated comment. NFC.
Simon Pilgrim [Mon, 22 Jun 2020 19:03:23 +0000 (20:03 +0100)]
[X86] truncateVectorWithPACK - fix outdated comment. NFC.

We perform PACKSS/PACKUS on AVX512 targets if the calling function wants to.

4 years ago[DAG] visitSIGN_EXTEND_INREG - rename EVT variable. NFCI.
Simon Pilgrim [Mon, 22 Jun 2020 18:45:48 +0000 (19:45 +0100)]
[DAG] visitSIGN_EXTEND_INREG - rename EVT variable. NFCI.

We had a EVT type variable called EVT, which isn't a good idea....

4 years ago[SVE] Code generation for fixed length vector loads & stores.
Paul Walker [Mon, 18 May 2020 18:12:38 +0000 (19:12 +0100)]
[SVE] Code generation for fixed length vector loads & stores.

Summary:
This patch adds base support for code generating fixed length
vector operations targeting a known SVE vector length. To achieve
this we lower fixed length vector operations to equivalent scalable
vector operations, whereby SVE predication is used to limit the
elements processed to those present within the fixed length vector.

Specifically this patch implements load and store operations, which
get lowered to their masked counterparts thusly:

  V = load(Addr) =>
    V = extract_fixed_vector(masked_load(make_pred(V.NumElts), Addr))

  store(V, (Addr)) =>
    masked_store(insert_fixed_vector(V), make_pred(V.NumElts), Addr))

Reviewers: rengolin, efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[AVR] Rewrite the function calling convention.
Dylan McKay [Fri, 19 Jun 2020 11:26:00 +0000 (23:26 +1200)]
[AVR] Rewrite the function calling convention.

Summary:
The previous version relied on the standard calling convention using
std::reverse() to try to force the AVR ABI. But this only works for
simple cases, it fails for example with aggregate types.

This patch rewrites the calling convention with custom C++ code, that
implements the ABI defined in https://gcc.gnu.org/wiki/avr-gcc.

To do that it adds a few 16-bit pseudo registers for unaligned argument
passing, such as R24R23. For example this function:

    define void @fun({ i8, i16 } %a)

will pass %a.0 in R22 and %a.1 in R24R23.

There are no instructions that can use these pseudo registers, so a new
register class, DREGSMOVW, is defined to make them apart.

Also the ArgCC_AVR_BUILTIN_DIV is no longer necessary, as it is
identical to the C++ behavior (actually the clobber list is more strict
for __div* functions, but that is currently unimplemented).

Reviewers: dylanmckay

Subscribers: Gaelan, Sh4rK, indirect, jwagen, efriedma, dsprenkels, hiraditya, Jim, llvm-commits

Tags: #llvm

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

Patch by Rodrigo Rivas Costa.

4 years agoSilence gcc warning about extra ";" [NFC]
Mikael Holmen [Tue, 23 Jun 2020 09:28:02 +0000 (11:28 +0200)]
Silence gcc warning about extra ";" [NFC]

4 years ago[PowerPC][NFC] Add tests for variadic functions on PPC64
Kai Luo [Tue, 23 Jun 2020 09:14:25 +0000 (09:14 +0000)]
[PowerPC][NFC] Add tests for variadic functions on PPC64

4 years ago[DebugInfo] Print line table extended opcode bytes if parsing fails
James Henderson [Wed, 17 Jun 2020 10:29:29 +0000 (11:29 +0100)]
[DebugInfo] Print line table extended opcode bytes if parsing fails

Previously, if there was an error whilst parsing the operands of an
extended opcode, the operands would be treated as zero and printed. This
could potentially be slightly confusing. This patch changes the
behaviour to print the raw bytes instead.

Reviewed by: ikudrin

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

4 years agoProfileSummary.cpp - fix implicit Format.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 08:43:09 +0000 (09:43 +0100)]
ProfileSummary.cpp - fix implicit Format.h dependency. NFC.

ProfileSummary was depending on other headers (notably WithColor.h) to define format().

4 years agoStatepointLowering.cpp - fix implicit CommandLine.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 08:41:14 +0000 (09:41 +0100)]
StatepointLowering.cpp - fix implicit CommandLine.h dependency. NFC.

StatepointLowering defines a cl::opt but don't include CommandLine.h.

4 years agoLowLevelTypeImpl.h - fix implicit Debug.h dependency. NFC.
Simon Pilgrim [Tue, 23 Jun 2020 08:31:38 +0000 (09:31 +0100)]
LowLevelTypeImpl.h - fix implicit Debug.h dependency. NFC.

LowLevelType was depending on other headers (notably WithColor.h) to define dbgs().

4 years ago[llvm-rc] Implement the language id option
Martin Storsjö [Sat, 20 Jun 2020 20:34:53 +0000 (23:34 +0300)]
[llvm-rc] Implement the language id option

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

4 years ago[DSE,MSSA] Treat passed by value args as invisible to caller.
Florian Hahn [Tue, 23 Jun 2020 07:58:51 +0000 (08:58 +0100)]
[DSE,MSSA] Treat passed by value args as invisible to caller.

This updates the MemorySSA backed implementation to treat arguments
passed by value similar to allocas: in they are assumed to be invisible
in the caller. This is similar to how they are treated in legacy DSE.

Reviewers: efriedma, asbirlea, george.burgess.iv

Reviewed By: efriedma

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

4 years agoAST dump: recurse into type template arguments when dumping.
Richard Smith [Tue, 23 Jun 2020 07:01:38 +0000 (00:01 -0700)]
AST dump: recurse into type template arguments when dumping.

Also, do not dump the desugared type for a TemplateSpecializationType
twice.

4 years ago[Triple] support macOS 11 os version number
Alex Lorenz [Mon, 22 Jun 2020 23:32:35 +0000 (16:32 -0700)]
[Triple] support macOS 11 os version number

macOS goes to 11! This commit adds support for the new version number by ensuring
that existing version comparison routines, and the 'darwin' OS identifier
understands the new numbering scheme. It also adds a new utility method
'getCanonicalVersionForOS', which lets users translate some uses of
macOS 10.16 into macOS 11. This utility method will be used in upcoming
clang and swift commits.

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

4 years ago[libc] Match x86 long double NaN classification with that of the compiler.
Siva Chandra Reddy [Mon, 22 Jun 2020 20:47:56 +0000 (13:47 -0700)]
[libc] Match x86 long double NaN classification with that of the compiler.

Reviewers: asteinhauser

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

4 years ago[SROA] Teach SROA to perform no-op pointer conversion.
Michael Liao [Tue, 16 Jun 2020 05:17:56 +0000 (01:17 -0400)]
[SROA] Teach SROA to perform no-op pointer conversion.

Summary:
- When promoting a pointer from memory to register, SROA skips pointers
  from different address spaces. However, as `ptrtoint` and `inttoptr`
  are defined as no-op casts if that integer type has the same as the
  pointer value, generate the pair of `ptrtoint`/`inttoptr` (no-op cast)
  sequence to convert pointers from different address spaces if they
  have the same size.

Reviewers: arsenm, chandlerc, lebedev.ri

Subscribers:

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

4 years ago[InstCombine] Replace selects with Phis
Max Kazantsev [Tue, 23 Jun 2020 04:46:59 +0000 (11:46 +0700)]
[InstCombine] Replace selects with Phis

We can sometimes replace a select with a Phi node if all of its values
are available on respective incoming edges.

Differential Revision: https://reviews.llvm.org/D82005
Reviewed By: nikic

4 years ago[SDAG] Add new AssertAlign ISD node.
Michael Liao [Mon, 25 May 2020 03:20:57 +0000 (23:20 -0400)]
[SDAG] Add new AssertAlign ISD node.

Summary:
- AssertAlign node records the guaranteed alignment on its source node,
  where these alignments are retrieved from alignment attributes in LLVM
  IR. These tracked alignments could help DAG combining and lowering
  generating efficient code.
- In this patch, the basic support of AssertAlign node is added. So far,
  we only generate AssertAlign nodes on return values from intrinsic
  calls.
- Addressing selection in AMDGPU is revised accordingly to capture the
  new (base + offset) patterns.

Reviewers: arsenm, bogner

Subscribers: jvesely, wdng, nhaehnle, tpr, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoFix rejects-valid when referencing an implicit operator== from within a
Richard Smith [Wed, 17 Jun 2020 21:06:11 +0000 (14:06 -0700)]
Fix rejects-valid when referencing an implicit operator== from within a
templated class.

When a defaulted operator<=> results in the injection of a defaulted
operator==, that operator== can be named by unqualified name within the
same class, even if the class is templated. To make this work, perform
the transform from defaulted operator<=> to defaulted operator== in the
template definition context instead of the template instantiation
context.

This results in our substituting into a declaration from a context where
we don't have a full list of template arguments (or indeed any), for
which we are now more careful to not spuriously instantiate declarations
that are not dependent on the arguments we're substituting.

4 years agoFix a corner case in vector.shape_cast when the trailing dimensions are of size 1.
Wen-Heng (Jack) Chung [Mon, 22 Jun 2020 14:52:12 +0000 (09:52 -0500)]
Fix a corner case in vector.shape_cast when the trailing dimensions are of size 1.

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

4 years ago[mlir][mlir-rocm-runner] Remove compile-time warning. NFC.
Wen-Heng (Jack) Chung [Mon, 22 Jun 2020 22:06:28 +0000 (17:06 -0500)]
[mlir][mlir-rocm-runner] Remove compile-time warning. NFC.

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes

Tags: #mlir

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

4 years agoDistinguish between template parameter substitutions that are forming
Richard Smith [Tue, 23 Jun 2020 02:30:36 +0000 (19:30 -0700)]
Distinguish between template parameter substitutions that are forming
specializations and those that are done as part of rewrites.

Do not create Subst* nodes in the latter. We previously had a hybrid of
these two behaviors where we would only create some Subst* nodes but not
others during deduction guide rewrites.

No functional change intended, but the resulting ASTs are more
principled.

4 years ago[PowerPC][Power10] Implement VSX PCV Generate Operations in LLVM/Clang
Amy Kwan [Mon, 22 Jun 2020 22:00:00 +0000 (17:00 -0500)]
[PowerPC][Power10] Implement VSX PCV Generate Operations in LLVM/Clang

This patch implements builtins for the following prototypes for the VSX Permute
Control Vector Generate with Mask Instructions:

vector unsigned char vec_genpcvm (vector unsigned char, const int);
vector unsigned short vec_genpcvm (vector unsigned short, const int);
vector unsigned int vec_genpcvm (vector unsigned int, const int);
vector unsigned long long vec_genpcvm (vector unsigned long long, const int);

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

4 years ago[InstCombine] reassociate diff of sums into sum of diffs
Sanjay Patel [Tue, 23 Jun 2020 00:45:00 +0000 (20:45 -0400)]
[InstCombine] reassociate diff of sums into sum of diffs

This is the integer sibling to D81491.

(a[0] + a[1] + a[2] + a[3]) - (b[0] + b[1] + b[2] +b[3]) -->
(a[0] - b[0]) + (a[1] - b[1]) + (a[2] - b[2]) + (a[3] - b[3])

Removing the "experimental" from these intrinsics is likely
not too far away.

4 years ago[InstCombine] add tests for integer reductions; NFC
Sanjay Patel [Mon, 22 Jun 2020 21:43:19 +0000 (17:43 -0400)]
[InstCombine] add tests for integer reductions; NFC

4 years ago[VectorCombine] do not use magic number for undef mask element; NFC
Sanjay Patel [Mon, 22 Jun 2020 20:17:06 +0000 (16:17 -0400)]
[VectorCombine] do not use magic number for undef mask element; NFC

4 years ago[AVR] Disassemble double register instructions
Ayke van Laethem [Thu, 18 Jun 2020 13:26:23 +0000 (15:26 +0200)]
[AVR] Disassemble double register instructions

Add disassembly support for the movw, adiw, and sbiw instructions.

I had previously committed test cases for the adiw and sbiw
instructions, but had accidentally made them not runnable so they were
skipped all this time. Oops. This patch fixes that by adding support for
disassembling those instructions.

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

4 years ago[AVR] Disassemble instructions with fixed Z operand
Ayke van Laethem [Thu, 18 Jun 2020 12:41:17 +0000 (14:41 +0200)]
[AVR] Disassemble instructions with fixed Z operand

Some instructions have a fixed Z register and don't have an explicit
register operand. This can be worked around by simply printing the
operand directly if the particular register class is detected.

The LPM and ELPM instructions also needed a custom decoder, which is
also included in this patch.

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

4 years ago[AVR] Disassemble multiplication instructions
Ayke van Laethem [Tue, 16 Jun 2020 21:42:43 +0000 (23:42 +0200)]
[AVR] Disassemble multiplication instructions

These can often only use a limited range of registers, and apparently
need special decoding support.

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

4 years ago[AVR] Decode single register instructions
Ayke van Laethem [Tue, 16 Jun 2020 20:50:29 +0000 (22:50 +0200)]
[AVR] Decode single register instructions

This is a set of instructions that take just a single register as an
operand, with no immediates. Because all instructions share the same
format, I haven't added exhaustive bit testing to all instructions but
just to the inc instruction.

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

4 years ago[AVR] Don't adjust for instruction size
Ayke van Laethem [Sun, 19 Apr 2020 18:58:36 +0000 (20:58 +0200)]
[AVR] Don't adjust for instruction size

I'm not entirely sure why this was ever needed, but when I remove both
adjustments all tests still pass.

This fixes a bug where a long branch (using the `jmp` instead of the
`rjmp` instruction) was incorrectly adjusted by 2 because it jumps to an
absolute address instead of a PC-relative address. I could have added
AVR::fixup_call to the list of exceptions, but it seemed more sensible
to me to just remove this code.

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

4 years ago[llvm-install-name-tool] Implement delete_rpath option
Alexander Shaposhnikov [Mon, 22 Jun 2020 23:49:14 +0000 (16:49 -0700)]
[llvm-install-name-tool] Implement delete_rpath option

This diff adds support for deleting an rpath from a Mach-O binary.

Patch by Sameer Arora!

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D81527

4 years agoFix multilevel deduction where an outer pack is used in the type of an
Richard Smith [Mon, 22 Jun 2020 23:45:12 +0000 (16:45 -0700)]
Fix multilevel deduction where an outer pack is used in the type of an
inner non-type pack at a different index.

We previously considered the index of the outer pack (which would refer
to an unrelated template parameter) to be deduced by deducing the inner
pack, because we inspected the (largely meaningless) type of an expanded
non-type template parameter pack.

4 years agoAdd -ast-dump-decl-types flag to include types of value and type
Richard Smith [Mon, 22 Jun 2020 22:55:59 +0000 (15:55 -0700)]
Add -ast-dump-decl-types flag to include types of value and type
declarations in AST dumps.

Includes a testcase for deduction guide transformation that makes use of
this new dumping feature.

4 years ago[MLIR][NFC] Adopt hasNItems() for SizedRegion predicate
Rahul Joshi [Mon, 22 Jun 2020 22:11:40 +0000 (15:11 -0700)]
[MLIR][NFC] Adopt hasNItems() for SizedRegion predicate

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

4 years ago[WebAssembly] Add support for externalref to MC and wasm-ld
Sam Clegg [Tue, 16 Jun 2020 22:41:20 +0000 (15:41 -0700)]
[WebAssembly] Add support for externalref to MC and wasm-ld

This allows code for handling externref values to be processed by the
assembler and linker.

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

4 years agoadd copy of MLIR .clang-tidy to squelch noise in phabricator reviews
Eric Schweitz [Mon, 22 Jun 2020 22:26:28 +0000 (15:26 -0700)]
add copy of MLIR .clang-tidy to squelch noise in phabricator reviews

4 years ago[SVE] Remove calls to VectorType::getNumElements from ARM
Christopher Tetreault [Mon, 22 Jun 2020 22:04:48 +0000 (15:04 -0700)]
[SVE] Remove calls to VectorType::getNumElements from ARM

Reviewers: efriedma, greened, c-rhodes, david-arm, dmgreen

Reviewed By: dmgreen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, dmgreen, danielkiss, llvm-commits

Tags: #llvm

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

4 years ago- Add hasNItemsOrLess and container variants of hasNItems, hasNItemsOrMore, and hasNI...
Rahul Joshi [Mon, 22 Jun 2020 19:46:02 +0000 (12:46 -0700)]
- Add hasNItemsOrLess and container variants of hasNItems, hasNItemsOrMore, and hasNItemsOrLess
- Fixed a bug in hasNItems()
- Extend the STLExtras unit test to test hasSingleElement() and hasNItems() and friends.

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

4 years agoFix dynamic alloca detection in CloneBasicBlock
Arthur Eubanks [Mon, 22 Jun 2020 20:22:16 +0000 (13:22 -0700)]
Fix dynamic alloca detection in CloneBasicBlock

Summary:
Simply check AI->isStaticAlloca instead of reimplementing checks for
static/dynamic allocas.

Reviewers: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Coroutines] Ensure co_await promise.final_suspend() does not throw
Xun Li [Mon, 15 Jun 2020 23:27:41 +0000 (16:27 -0700)]
[Coroutines] Ensure co_await promise.final_suspend() does not throw

Summary:
This patch addresses https://bugs.llvm.org/show_bug.cgi?id=46256
The spec of coroutine requires that the expression co_­await promise.final_­suspend() shall not be potentially-throwing.
To check this, we recursively look at every call (including Call, MemberCall, OperatorCall and Constructor) in all code
generated by the final suspend, and ensure that the callees are declared with noexcept. We also look at any returned data
type that requires explicit destruction, and check their destructors for noexcept.

This patch does not check declarations with dependent types yet, which will be done in future patches.

Updated all tests to add noexcept to the required functions, and added a dedicated test for this patch.

This patch might start to cause existing codebase fail to compile because most people may not have been strict in tagging
all the related functions noexcept.

Reviewers: lewissbaker, modocache, junparser

Reviewed By: modocache

Subscribers: arphaman, junparser, cfe-commits

Tags: #clang

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

4 years ago[mlir][ods] Allow filtering of ops
Jacques Pienaar [Mon, 22 Jun 2020 21:56:54 +0000 (14:56 -0700)]
[mlir][ods] Allow filtering of ops

Add option to filter which op the OpDefinitionsGen run on. This enables having multiple ops together in the same TD file but generating different CC files for them (useful if one wants to use multiclasses or split out 1 dialect into multiple different libraries). There is probably more general query here (e.g., split out all ops that don't have a verify method, or that are commutative) but filtering based on op name (e.g., test.a_op) seemed a reasonable start and didn't require inventing a query specification mechanism here.

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

4 years agoRecommit "[X86] Calculate the needed size of the feature arrays in _cpu_indicator_ini...
Craig Topper [Mon, 22 Jun 2020 20:29:43 +0000 (13:29 -0700)]
Recommit "[X86] Calculate the needed size of the feature arrays in _cpu_indicator_init and getHostCPUName using the size of the feature enum."

Hopefully this version will fix the previously buildbot failure

4 years agoFix the verification of DIEs with DW_AT_ranges.
Greg Clayton [Wed, 13 May 2020 23:51:44 +0000 (16:51 -0700)]
Fix the verification of DIEs with DW_AT_ranges.

Summary: Previous code would try to verify DW_AT_ranges and if any ranges would overlap, it would stop attributing any ranges after this to the DIE which caused incorrect errors to be reported that a DIE's address ranges were not contained in the parent DIE's ranges. Added a fix and a test.

Reviewers: aprantl, labath, probinson, JDevlieghere, jhenderson

Subscribers: hiraditya, MaskRay, cmtice, llvm-commits

Tags: #llvm

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

4 years agollvm-nm: Implement --special-syms.
Peter Collingbourne [Sat, 20 Jun 2020 02:06:14 +0000 (19:06 -0700)]
llvm-nm: Implement --special-syms.

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

4 years agoAdd Statically Linked Libraries
Aaron En Ye Shi [Wed, 27 May 2020 18:49:25 +0000 (18:49 +0000)]
Add Statically Linked Libraries

Add GNU Static Lib Tool, which supports the --emit-static-lib
flag. For HIP, a static library archive will be created and
consist of HIP Fat Binary host object with the device images embedded.
Using llvm-ar to create the static archive. Also, delete existing
output file to ensure a new archive is created each time.

Reviewers: yaxunl, tra, rjmccall, echristo

Subscribers: echristo, JonChesterfield, scchan, msearles

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

4 years ago[HIP] Move HIP Linking Logic into HIP ToolChain
Aaron En Ye Shi [Thu, 11 Jun 2020 18:36:10 +0000 (18:36 +0000)]
[HIP] Move HIP Linking Logic into HIP ToolChain

This patch is a follow up on https://reviews.llvm.org/D78759.

Extract the HIP Linker script from generic GNU linker,
and move it into HIP ToolChain. Update OffloadActionBuilder
Link actions feature to apply device linking and host linking
actions separately. Using MC Directives, embed the device images
and define symbols.

Reviewers: JonChesterfield, yaxunl

Subscribers: tra, echristo, jdoerfert, msearles, scchan

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

4 years agoUse std::make_tuple instead initializer list
Lei Zhang [Mon, 22 Jun 2020 19:32:21 +0000 (15:32 -0400)]
Use std::make_tuple instead initializer list

Hopefully this pleases GCC-5 and fixes the build error:

LowerExpectIntrinsic.cpp:62:53: error: converting to
'std::tuple<unsigned int, unsigned int>' from initializer list would use
explicit constructor 'constexpr std::tuple<_T1, _T2>::tuple(_U1&&,
_U2&&) [with _U1 = llvm::cl::opt<unsigned int>&; _U2 =
llvm::cl::opt<unsigned int>&; <template-parameter-2-3> = void; _T1 =
unsigned int; _T2 = unsigned int]'
     return {LikelyBranchWeight, UnlikelyBranchWeight};

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

4 years agoRevert "[X86][SSE] MatchVectorAllZeroTest - handle OR vector reductions"
Hans Wennborg [Mon, 22 Jun 2020 18:58:11 +0000 (20:58 +0200)]
Revert "[X86][SSE] MatchVectorAllZeroTest - handle OR vector reductions"

This caused a Chromium test to miscompile. See discussion on the Phabricator
review.

> This patch extends MatchVectorAllZeroTest to handle OR vector reduction patterns where the result is compared against zero.
>
> Fixes PR45378
>
> Differential Revision: https://reviews.llvm.org/D81547

This reverts 057c9c7ee00b7f7696065a3fc26a3df5ce3ebe96

4 years ago[SVE] Remove calls to VectorType::getNumElements from WebASM
Christopher Tetreault [Mon, 22 Jun 2020 17:46:53 +0000 (10:46 -0700)]
[SVE] Remove calls to VectorType::getNumElements from WebASM

Summary:
The getNumElements in base VectorType is being deprecated.

See: http://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html

Reviewers: efriedma, tlively, fpetrogalli, c-rhodes, dschuff

Reviewed By: tlively, dschuff

Subscribers: dschuff, sbc100, tschuett, jgravelle-google, hiraditya, aheejin, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agoRevert "[X86] Calculate the needed size of the feature arrays in _cpu_indicator_init...
Craig Topper [Mon, 22 Jun 2020 19:20:40 +0000 (12:20 -0700)]
Revert "[X86] Calculate the needed size of the feature arrays in _cpu_indicator_init and getHostCPUName using the size of the feature enum."

Seems to breaking build.

This reverts commit 5ac144fe64c6911b5b6011cac1d61e0f82562e7f.

4 years ago[X86] Remove encoding value from the X86_FEATURE and X86_FEATURE_COMPAT macro. NFCI
Craig Topper [Mon, 22 Jun 2020 03:20:04 +0000 (20:20 -0700)]
[X86] Remove encoding value from the X86_FEATURE and X86_FEATURE_COMPAT macro. NFCI

This was orignally done so we could separate the compatibility
values and the llvm internal only features into a separate entries
in the feature array. This was needed when we explicitly had to
convert the feature into the proper 32-bit chunk at every reference
and we didn't want things moving around.

Now everything is in an array and we have helper funtions or macros
to convert encoding to index. So we renumbering is no longer an
issue.

4 years ago[X86] Calculate the needed size of the feature arrays in _cpu_indicator_init and...
Craig Topper [Mon, 22 Jun 2020 00:30:10 +0000 (17:30 -0700)]
[X86] Calculate the needed size of the feature arrays in _cpu_indicator_init and getHostCPUName using the size of the feature enum.

Move 0 initialization up to the caller so we don't need to know
the size.

4 years ago[flang] Fix bug checking SAVE attribute
Tim Keith [Mon, 22 Jun 2020 18:32:54 +0000 (11:32 -0700)]
[flang] Fix bug checking SAVE attribute

Treat function result like dummy argument: a SAVE statement without an
entity-list does not make it saved.

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

4 years ago[mlir] Fix a doc link in LinalgBase.td
Hanhan Wang [Mon, 22 Jun 2020 18:15:44 +0000 (11:15 -0700)]
[mlir] Fix a doc link in LinalgBase.td

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

4 years ago[llvm] Fix typo in test case comment (NFC)
Tobias Gysi [Mon, 22 Jun 2020 17:53:01 +0000 (19:53 +0200)]
[llvm] Fix typo in test case comment (NFC)

4 years ago[ARM][BFloat] Implement bf16 get/set_lane without casts to i16 vectors
Mikhail Maltsev [Mon, 22 Jun 2020 17:15:11 +0000 (17:15 +0000)]
[ARM][BFloat] Implement bf16 get/set_lane without casts to i16 vectors

Currently, in order to extract an element from a bf16 vector, we cast
the vector to an i16 vector, perform the extraction, and cast the result to
bfloat. This behavior was copied from the old fp16 implementation.

The goal of this patch is to achieve optimal code generation for lane
copying intrinsics in a subsequent patch (LLVM fails to fold certain
combinations of bitcast, insertelement, extractelement and
shufflevector instructions leading to the generation of suboptimal code).

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

4 years ago[clang-tidy] RenamerClangTidy wont emit fixes in scratch space
Nathan James [Mon, 22 Jun 2020 17:26:17 +0000 (18:26 +0100)]
[clang-tidy] RenamerClangTidy wont emit fixes in scratch space

Prevent fixes being displayed if usages are found in the scratch buffer.
See [[ https://bugs.llvm.org/show_bug.cgi?id=46219 | Fix-It hints are being generated in the ScratchBuffer ]].
It may be wise down the line to put in a general fix in clang-tidy to prevent ScratchBuffer replacements being applied, but for now this will help.

Reviewed By: aaron.ballman

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

4 years ago[clang-tidy] llvm-twine-local ignores parameters
Nathan James [Mon, 22 Jun 2020 17:25:44 +0000 (18:25 +0100)]
[clang-tidy] llvm-twine-local ignores parameters

Ignore paramater declarations of type `::llvm::Twine`, These don't suffer the same use after free risks as local twines.

Reviewed By: aaron.ballman

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

4 years agoAdd support of __builtin_expect_with_probability
Zhi Zhuang [Mon, 22 Jun 2020 17:20:42 +0000 (10:20 -0700)]
Add support of __builtin_expect_with_probability

Add a new builtin-function __builtin_expect_with_probability and
intrinsic llvm.expect.with.probability.
The interface is __builtin_expect_with_probability(long expr, long
expected, double probability).
It is mainly the same as __builtin_expect besides one more argument
indicating the probability of expression equal to expected value. The
probability should be a constant floating-point expression and be in
range [0.0, 1.0] inclusive.
It is similar to builtin-expect-with-probability function in GCC
built-in functions.

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

4 years ago[PGO][PGSO] Enable non-cold size opts under partial profile sample PGO.
Hiroshi Yamauchi [Wed, 17 Jun 2020 20:11:45 +0000 (13:11 -0700)]
[PGO][PGSO] Enable non-cold size opts under partial profile sample PGO.

Summary: Similar to D81020. Follow up D78949.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[sve][acle] Add SVE BFloat16 extensions.
Francesco Petrogalli [Tue, 16 Jun 2020 22:56:00 +0000 (22:56 +0000)]
[sve][acle] Add SVE BFloat16 extensions.

Summary:
List of intrinsics:

svfloat32_t svbfdot[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3)
svfloat32_t svbfdot[_n_f32](svfloat32_t op1, svbfloat16_t op2, bfloat16_t op3)
svfloat32_t svbfdot_lane[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3, uint64_t imm_index)

svfloat32_t svbfmmla[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3)

svfloat32_t svbfmlalb[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3)
svfloat32_t svbfmlalb[_n_f32](svfloat32_t op1, svbfloat16_t op2, bfloat16_t op3)
svfloat32_t svbfmlalb_lane[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3, uint64_t imm_index)

svfloat32_t svbfmlalt[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3)
svfloat32_t svbfmlalt[_n_f32](svfloat32_t op1, svbfloat16_t op2, bfloat16_t op3)
svfloat32_t svbfmlalt_lane[_f32](svfloat32_t op1, svbfloat16_t op2, svbfloat16_t op3, uint64_t imm_index)

svbfloat16_t svcvt_bf16[_f32]_m(svbfloat16_t inactive, svbool_t pg, svfloat32_t op)
svbfloat16_t svcvt_bf16[_f32]_x(svbool_t pg, svfloat32_t op)
svbfloat16_t svcvt_bf16[_f32]_z(svbool_t pg, svfloat32_t op)

svbfloat16_t svcvtnt_bf16[_f32]_m(svbfloat16_t even, svbool_t pg, svfloat32_t op)
svbfloat16_t svcvtnt_bf16[_f32]_x(svbfloat16_t even, svbool_t pg, svfloat32_t op)

For reference, see section 7.2 of "Arm C Language Extensions for SVE - Version 00bet4"

Reviewers: sdesmalen, ctetreau, efriedma, david-arm, rengolin

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[flang] Shape analysis for result of MATMUL
peter klausler [Sat, 20 Jun 2020 01:11:46 +0000 (18:11 -0700)]
[flang] Shape analysis for result of MATMUL

Implement shape analysis for the result of the MATMUL
generic transformational intrinsic function, based on
the shapes of its arguments.  Correct the names of the
arguments to match the standard, too.

Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D82250

4 years ago[lldb/Lua] Recognize "quit" as a way to exit the script interpreter.
Jonas Devlieghere [Sun, 21 Jun 2020 07:31:46 +0000 (00:31 -0700)]
[lldb/Lua] Recognize "quit" as a way to exit the script interpreter.

Add a way to quit the interactive script interpreter from a shell tests.
Currently, the only way (that I know) to exit the interactive Lua
interpreter is to send a EOF with CTRL-D. I noticed that the embedded
Python script interpreter accepts quit (while the regular python
interpreter doesn't). I've added a special case to the Lua interpreter
to do the same.

Differential revision: https://reviews.llvm.org/D82272

4 years ago[VectorCombine] make helper function for shift-shuffle; NFC
Sanjay Patel [Mon, 22 Jun 2020 16:22:45 +0000 (12:22 -0400)]
[VectorCombine] make helper function for shift-shuffle; NFC

This will probably be useful for other extract patterns.

4 years ago[DSE,MSSA] Reorder DSE blocking checks.
Florian Hahn [Mon, 22 Jun 2020 15:24:27 +0000 (16:24 +0100)]
[DSE,MSSA] Reorder DSE blocking checks.

Currently we stop exploring candidates too early in some cases.

In particular, we can continue checking the defining accesses of
non-removable MemoryDefs and defs without analyzable write location
(read clobbers are already ruled out using MemorySSA at this point).

4 years ago[MCParser] Support quoted section name for COFF
Fangrui Song [Mon, 22 Jun 2020 16:11:44 +0000 (09:11 -0700)]
[MCParser] Support quoted section name for COFF

This features matches ELFAsmParser and makes it possible to use `.section ".llvm.call-graph-profile","n"`

Reviewed By: zequanwu

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

4 years ago[NPM] Bail out when -foo and --passes=foo are both specified
Arthur Eubanks [Sun, 21 Jun 2020 06:51:26 +0000 (23:51 -0700)]
[NPM] Bail out when -foo and --passes=foo are both specified

Summary:
Currently when --passes is used, any passes specified via -foo are
ignored. Explicitly bail out when that happens.

This requires changing some tests. Most were straightforward, but
codegenprepare-produced-address-math.ll is tricky. One of its RUNs runs
CodeGenPrepare. I tried porting CodeGenPrepare to the NPM, but ended up
getting stuck when I needed a TargetMachine. NPM doesn't have support
for MachineFunctions yet. So I just deleted that RUN line, since it was
mass-added in https://reviews.llvm.org/D54848 and is likely not that
useful.

Reviewers: echristo, hans

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[DSE,MSSA] Add additional tests with non-removable stores (NFC).
Florian Hahn [Mon, 22 Jun 2020 15:09:03 +0000 (16:09 +0100)]
[DSE,MSSA] Add additional tests with non-removable stores (NFC).

Add a few additional tests with volatile stores, which cannot be
removedt stas.

4 years ago[flang] Finish adding AbstractConverter.h
Eric Schweitz [Sat, 20 Jun 2020 21:17:17 +0000 (14:17 -0700)]
[flang] Finish adding AbstractConverter.h

This adds the abstract converter interface. The abstract converter is an
interface that supports the conversion of front-end data structures to
MLIR. This interface will be instantiated by the bridge in a future
commit.

Differential revision: https://reviews.llvm.org/D82268

4 years ago[MLIR] Remove TableGen redundant calls to native calls when creating new operations...
AlexEichenberger [Mon, 22 Jun 2020 15:10:23 +0000 (08:10 -0700)]
[MLIR] Remove TableGen redundant calls to native calls when creating new operations in DRR TableGen files

Summary:
Currently, the TableGen rewrite generates redundant native calls in MLIR DRR files. This is a problem as some native calls may involve significant computations (e.g. when performing constant propagation where every values in a large tensor is touched).

The pattern was as follow:

```c++
if (native-call(args)) tblgen_attrs.emplace_back(rewriter, attribute, native-call(args))
```

The replacement pattern compute `native-call(args)` once and then use it both in the `if` condition and the `emplace_back` call.

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

4 years agoPre-commited test update. NFC.
Stanislav Mekhanoshin [Mon, 22 Jun 2020 15:06:34 +0000 (08:06 -0700)]
Pre-commited test update. NFC.

4 years ago[AMDGPU] Generate test checks
Jay Foad [Mon, 22 Jun 2020 15:07:18 +0000 (16:07 +0100)]
[AMDGPU] Generate test checks

4 years ago[DebugInfo] Update MachineInstr to help support variadic DBG_VALUE instructions
stozer [Mon, 22 Jun 2020 15:01:12 +0000 (16:01 +0100)]
[DebugInfo] Update MachineInstr to help support variadic DBG_VALUE instructions

Following on from this RFC[0] from a while back, this is the first patch towards
implementing variadic debug values.

This patch specifically adds a set of functions to MachineInstr for performing
operations specific to debug values, and replacing uses of the more general
functions where appropriate. The most prevalent of these is replacing
getOperand(0) with getDebugOperand(0) for debug-value-specific code, as the
operands corresponding to values will no longer be at index 0, but index 2 and
upwards: getDebugOperand(x) == getOperand(x+2). Similar replacements have been
added for the other operands, along with some helper functions to replace
oft-repeated code and operate on a variable number of value operands.

[0] http://lists.llvm.org/pipermail/llvm-dev/2020-February/139376.html<Paste>

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

4 years ago[ARC] Add missing return statement
Guillaume Chatelet [Mon, 22 Jun 2020 14:56:27 +0000 (14:56 +0000)]
[ARC] Add missing return statement

4 years agoPre-commit SLP test. NFC.
Stanislav Mekhanoshin [Mon, 22 Jun 2020 14:26:39 +0000 (07:26 -0700)]
Pre-commit SLP test. NFC.

4 years ago[analyzer] Remove forbidden characters from a filename for a graph dump on Windows
Denys Petrov [Mon, 22 Jun 2020 12:35:57 +0000 (15:35 +0300)]
[analyzer] Remove forbidden characters from a filename for a graph dump on Windows

Summary:
Windows forbidden file path characters are used in a field `file`, while creating a dump `dot` file using an argument -analyzer-dump-egraph. It specifically relates to angle brackets when using `<scratch space>`, `<built-in>`, `<command line>` values in filenames. It causes that script exploded-graph-rewriter.py incorrectly parses the dump.

Fix:
Remove forbidden characters from filename for Windows platform, when creating graph dump file.

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

4 years ago[mlir][spirv] Enhance AccessChainOp index type handling
HazemAbdelhafez [Mon, 22 Jun 2020 14:04:53 +0000 (10:04 -0400)]
[mlir][spirv] Enhance AccessChainOp index type handling

This patch extends the AccessChainOp index type handling to be able to deal with
all Integer type indices (i.e., all bit-widths and signedness symantics).

There were two ways of achieving this:
1- Backward compatible: The new way of handling the indices will assume that
   an index type is i32 by default if not specified in the assembly format,
   this way all the old tests would pass correctly.
2- Enforce the format: This unifies the spv.AccessChain Op format and all the old
   tests had to be updated to reflect this change or else they fail.

I picked option-2 to unify the Op format and avoid having optional index-type fields
that can lead to somewhat confusing tests format and multiple representations for
the same Op with undocumented assumption that an index is i32 unless stated.
Nonetheless, reverting to option-1 should be straightforward if preferred or needed.

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

4 years agoImplement constexpr BinaryOperator for vector types
Erich Keane [Fri, 8 May 2020 20:14:50 +0000 (13:14 -0700)]
Implement constexpr BinaryOperator for vector types

These operations do member-wise versions of the all of the listed
operations.  This patch implements all of the binaryoperators for these
types. Note that the test is required to use codegen as I could not come
up with a good way to validate the values without the array-subscript
operator implemented (which is likely a much more involved change).

Differential Reivision: https://reviews.llvm.org/D79755

4 years ago[VectorCombine] add helper to replace uses and rename
Sanjay Patel [Mon, 22 Jun 2020 13:26:46 +0000 (09:26 -0400)]
[VectorCombine] add helper to replace uses and rename

The tests are regenerated to show a path that missed renaming,
but there should be no functional difference from this patch.