OSDN Git Service

android-x86/external-llvm.git
6 years ago[ARM] Add support for SETCCCARRY instead of SETCCE
Amaury Sechet [Wed, 9 May 2018 22:15:51 +0000 (22:15 +0000)]
[ARM] Add support for SETCCCARRY instead of SETCCE

Summary: As per title. SETCCE is deprecated and will eventually be removed.

Reviewers: rogfer01, efriedma, rengolin, javed.absar

Subscribers: kristof.beyls, chrib, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331929 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel][Legalizer] Widening the second src op of shifts bug fix
Roman Tereshin [Wed, 9 May 2018 21:43:30 +0000 (21:43 +0000)]
[GlobalISel][Legalizer] Widening the second src op of shifts bug fix

The second source operand of G_SHL, G_ASHR, and G_LSHR must preserve its
value as a (small) unsigned integer, therefore its incorrect to widen it
in any way but by zero extending it.

G_SHL was using G_ANYEXT and G_ASHR - G_SEXT (which is correct for their
destination and first source operands, but not the "number of bits to
shift" operand).

Generally, shifts aren't as similar to regular binary operations as it
might seem, for instance, they aren't commutative nor associative and
the second source operand usually requires a special treatment.

Reviewers: bogner, javed.absar, aivchenk, rovka

Reviewed By: bogner

Subscribers: igorb, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331926 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Add --strip-symbol (-N) option
Paul Semel [Wed, 9 May 2018 21:36:54 +0000 (21:36 +0000)]
[llvm-objcopy] Add --strip-symbol (-N) option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331924 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Support horizontal vectorization of min/max.
Farhana Aleen [Wed, 9 May 2018 21:18:34 +0000 (21:18 +0000)]
[AMDGPU] Support horizontal vectorization of min/max.

Author: FarhanaAleen

Reviewed By: rampitec

Subscribers: AMDGPU

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331920 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Ignore any_extend in mul24 combine
Matt Arsenault [Wed, 9 May 2018 21:11:35 +0000 (21:11 +0000)]
AMDGPU: Ignore any_extend in mul24 combine

If a multiply is truncated, SimplifyDemandedBits
sometimes turns a zero_extend of the inputs into an
any_extend, which makes the known bits computation unhelpful.
Ignore these and compute known bits for the underlying value,
since we insert the correct extend type after.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331919 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Add patterns for vector shift-and-accumulate
Krzysztof Parzyszek [Wed, 9 May 2018 21:10:41 +0000 (21:10 +0000)]
[Hexagon] Add patterns for vector shift-and-accumulate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331918 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Handle partial shift reduction for variable shifts
Matt Arsenault [Wed, 9 May 2018 20:52:54 +0000 (20:52 +0000)]
AMDGPU: Handle partial shift reduction for variable shifts

If the variable shift amount has known bits, we can still reduce
the shift.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331917 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Partially shrink 64-bit shifts if reduced to 16-bit
Matt Arsenault [Wed, 9 May 2018 20:52:43 +0000 (20:52 +0000)]
AMDGPU: Partially shrink 64-bit shifts if reduced to 16-bit

This is an extension of an existing combine to reduce wider
shls if the result fits in the final result type. This
introduces the same combine, but reduces the shift to a middle
sized type to avoid the slow 64-bit shift.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331916 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Fix Broadwell's Shuffle256 schedule classes load latency values.
Simon Pilgrim [Wed, 9 May 2018 19:27:48 +0000 (19:27 +0000)]
[X86] Fix Broadwell's Shuffle256 schedule classes load latency values.

Allows us to remove some unnecessary InstRW overrides.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331913 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Merge instregex patterns to reduce InstrRW compile time.
Simon Pilgrim [Wed, 9 May 2018 19:04:15 +0000 (19:04 +0000)]
[X86] Merge instregex patterns to reduce InstrRW compile time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331911 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add combine for trunc of bitcast from build_vector
Matt Arsenault [Wed, 9 May 2018 18:37:39 +0000 (18:37 +0000)]
AMDGPU: Add combine for trunc of bitcast from build_vector

If the truncate is only accessing the first element of the vector,
we can use the original source value.

This helps with some combine ordering issues after operations are
lowered to integer operations between bitcasts of build_vector.
In particular it stops unnecessarily materializing the unused
top half of a vector in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331909 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Check the end of the correct container (fix typo)
Krzysztof Parzyszek [Wed, 9 May 2018 18:33:59 +0000 (18:33 +0000)]
[Hexagon] Check the end of the correct container (fix typo)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331907 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Stop special casing constant indexes of extract_vector_elt
Matt Arsenault [Wed, 9 May 2018 18:29:26 +0000 (18:29 +0000)]
AMDGPU: Stop special casing constant indexes of extract_vector_elt

The same result folds out of the dynamic expansion logic if the
index is constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331906 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Handle C preprocessor output
Martin Storsjo [Wed, 9 May 2018 18:21:03 +0000 (18:21 +0000)]
[llvm-rc] Handle C preprocessor output

When preprocessing resource scripts (which can easily be done outside
of llvm-rc), included headers can leave behind C declarations (despite
preprocessing with -DRC_INVOKED), that can't be parsed by a resource
compiler.

This is handled in all of rc.exe, by parsing the preprocessor output
line markers and ignoring content from files named *.h and *.c,
documented at [1].

In addition to this filtering, strip out any other preprocessor directive
that is left behind (like pragmas) which also can't be handled by the
tokenizer.

The added test uses both standard #line markers (supported by rc.exe) and
GNU style extended line markers, thus this test doesn't pass with rc.exe,
but passes with GNU windres. (Windres on the other hand doesn't filter
out files named *.c, only *.h.)

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

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa381033(v=vs.85).aspx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331903 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Add support for the RCDATA resource type
Martin Storsjo [Wed, 9 May 2018 18:20:56 +0000 (18:20 +0000)]
[llvm-rc] Add support for the RCDATA resource type

This is the same as any other user defined resource, but with
a specific allocated resource type number.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331902 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Allow -1 for control IDs in old style dialogs with 16 bit fields
Martin Storsjo [Wed, 9 May 2018 18:20:49 +0000 (18:20 +0000)]
[llvm-rc] Allow -1 for control IDs in old style dialogs with 16 bit fields

-1 is commonly used as ID for controls that one don't want to
refer to later. For DIALOG resources, the IDs are 16 bit numbers,
and -1 gets interpreted as UINT32_MAX earlier, which then later is
too large to write into a uint16_t.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331901 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago Reapplying r331819 [GlobalISel][Legalizer] More concise and faster widenScalar...
Roman Tereshin [Wed, 9 May 2018 17:28:18 +0000 (17:28 +0000)]
Reapplying r331819 [GlobalISel][Legalizer] More concise and faster widenScalar, NFC

    The commit was a suspect for clang-cmake-aarch64-global-isel and
    clang-cmake-aarch64-quick bot failures, proved to be innocent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331898 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agollvm-mca: Add missing includes
David Blaikie [Wed, 9 May 2018 17:28:10 +0000 (17:28 +0000)]
llvm-mca: Add missing includes

Move the header include in the primary source file to the top to
validate that it doesn't depend on any other inclusions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331897 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner] In visitBITCAST when trying to constant fold the bitcast, only call...
Craig Topper [Wed, 9 May 2018 17:14:27 +0000 (17:14 +0000)]
[DAGCombiner] In visitBITCAST when trying to constant fold the bitcast, only call getBitcast if its an fp->int or int->fp conversion even when before legalize ops.

Previously if !LegalOperations we would blindly call getBitcast and hope that getNode would constant fold it. But if the conversion is between a vector and a scalar, getNode has no simplification.

This means we would just get back the original N. We would then return that N which would make the caller of visitBITCAST think that we used CombineTo and did our own worklist management. This prevents target specific optimizations from being called for vector/scalar bitcasts until after legal operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331896 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] snprintf optimizations
David Bolvansky [Wed, 9 May 2018 16:09:31 +0000 (16:09 +0000)]
[InstCombine] snprintf optimizations

Reviewers: spatel, efriedma, majnemer, rja, bkramer

Reviewed By: rja, bkramer

Subscribers: rja, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331889 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombine] Change store merge candidates check cut off to 1024.
Amara Emerson [Wed, 9 May 2018 15:53:06 +0000 (15:53 +0000)]
[DAGCombine] Change store merge candidates check cut off to 1024.

The previous value of 8192 resulted in severe compile time hits in
some pathological cases.

rdar://39781410

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331888 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Fix sanitizer error about using -1u in variable of enum type
Krzysztof Parzyszek [Wed, 9 May 2018 15:44:40 +0000 (15:44 +0000)]
[Hexagon] Fix sanitizer error about using -1u in variable of enum type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331887 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LV] Change MaxVectorSize bound to 256 in assertion, NFC otherwise
Krzysztof Parzyszek [Wed, 9 May 2018 15:18:12 +0000 (15:18 +0000)]
[LV] Change MaxVectorSize bound to 256 in assertion, NFC otherwise

It's possible to have a vector of 256 bytes in HVX code on Hexagon
(vector pair in 128-byte mode).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331885 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAPFloat/x87: Fix string conversion for "unnormal" values (pr35860)
Pavel Labath [Wed, 9 May 2018 15:13:45 +0000 (15:13 +0000)]
APFloat/x87: Fix string conversion for "unnormal" values (pr35860)

Summary:
Unnormal values are a feature of some very old x87 processors. We handle
them correctly for the most part -- the only exception was an unnormal
value whose significand happened to be zero. In this case the APFloat
was still initialized as normal number (category = fcNormal), but a
subsequent toString operation would assert because the math would
produce nonsensical values for the zero significand.

During review, it was decided that the correct way to fix this is to
treat all unnormal values as NaNs (as that is what any >=386 processor
will do).

The issue was discovered because LLDB would crash when trying to print
some "long double" values.

Reviewers: skatkov, scanon, gottesmm

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331884 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Simplify MCCodeEmitter, move data to tables
Krzysztof Parzyszek [Wed, 9 May 2018 15:02:04 +0000 (15:02 +0000)]
[Hexagon] Simplify MCCodeEmitter, move data to tables

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331883 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LV] Add lit testcase for bitcast problem. NFC
Karl-Johan Karlsson [Wed, 9 May 2018 13:34:57 +0000 (13:34 +0000)]
[LV] Add lit testcase for bitcast problem. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331878 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support/Path] Make handling of paths like "///" consistent
Pavel Labath [Wed, 9 May 2018 13:21:16 +0000 (13:21 +0000)]
[Support/Path] Make handling of paths like "///" consistent

Summary:
Various path functions were not treating paths consisting of slashes
alone consistently. For example, the iterator-based accessors decomposed the
path "///" into two elements: "/" and ".". This is not too bad, but it
is different from the behavior specified by posix:
```
A pathname that contains ***at least one non-slash character*** and that
ends with one or more trailing slashes shall be resolved as if a single
dot character ( '.' ) were appended to the pathname.
```
More importantly, this was different from how we treated the same path
in the filename+parent_path functions, which decomposed this path into
"." and "". This was completely wrong as it lost the information that
this was an absolute path which referred to the root directory.

This patch fixes this behavior by making sure all functions treat paths
consisting of (back)slashes alone the same way as "/". I.e., the
iterator-based functions will just report one component ("/"), and the
filename+parent_path will decompose them into "/" and "".

A slightly controversial topic here may be the treatment of "//". Posix
says that paths beginning with "//" may have special meaning and indeed
we have code which parses paths like "//net/foo/bar" specially. However,
as we were already not being consistent in parsing the "//" string
alone, and any special parsing for it would complicate the code further,
I chose to treat it the same way as longer sequences of slashes (which
are guaranteed to be the same as "/").

Another slight change of behavior is in the parsing of paths like
"//net//". Previously the last component of this path was ".". However,
as in our parsing the "//net" part in this path was the same as the
"drive" part in "c:\" and the next slash was the "root directory", it
made sense to treat "//net//" the same way as "//net/" (i.e., not to add
the extra "." component at the end).

Reviewers: zturner, rnk, dblaikie, Bigcheese

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331876 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Improve cost of vector division by constant
Adhemerval Zanella [Wed, 9 May 2018 12:48:22 +0000 (12:48 +0000)]
[AArch64] Improve cost of vector division by constant

With custom lowering for vector MULLH{S,U}, it is now profitable to
vectorize a divide by constant loop for the custom types (v16i8, v8i16,
and v4i32).  The cost if based on TargetLowering::Build{S,U}DIV which
uses a multiply by constant plus adjustment to express a divide by
constant.

Both {u,s}mull{2} are expressed as Instruction::Mul and shifts by
Instruction::AShr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331873 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove 'abi-breaking-checks' lit feature.
Nico Weber [Wed, 9 May 2018 12:39:39 +0000 (12:39 +0000)]
Remove 'abi-breaking-checks' lit feature.

Its only two uses were removed in r311730.
Effectively reverts r304851 (but that code has removed around a bit since then).
https://reviews.llvm.org/D46619

clang side done in r331871.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331872 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "DWARFVerifier: Check "completeness" of .debug_names section"
Pavel Labath [Wed, 9 May 2018 12:26:19 +0000 (12:26 +0000)]
Revert "DWARFVerifier: Check "completeness" of .debug_names section"

The new verifier check has found an error in the
debug-names-name-collisions.ll test on the PS4 bot:

error: Name Index @ 0x0: Entry @ 0xdc: mismatched Name of DIE @ 0x23: index - _ZN3foo3fooE; debug_info - foo.

Reverting while I investigate whether this is a bug in the verifier or
the generator.

This reverts commit r331868.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331869 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDWARFVerifier: Check "completeness" of .debug_names section
Pavel Labath [Wed, 9 May 2018 12:06:17 +0000 (12:06 +0000)]
DWARFVerifier: Check "completeness" of .debug_names section

Summary:
This patch implements a check which makes sure all entries required by
the DWARF v5 specification are present in the Name Index. The algorithm
tries to follow the wording of Section 6.1.1.1 of the spec as closely as
possible.

The main deviation from it is that instead of a whitelist-based approach
in the spec "The name index must contain an entry for each debugging
information entry that defines a named subprogram, label, variable,
type, or namespace" I chose a blacklist-based one, where I consider
everything to be "in" and then remove the entries that don't make sense.
I did this because it has more potential for catching interesting cases
and the above is a bit vague (it uses plain words like "variable" and
"subprogram", but the rest of the section speaks about specific TAGs).

This approach has raised some interesting questions, the main one being
whether enumerator values should be indexed. The consensus seems to be
that they should, although it does not follow from section 6.1.1.1.
For the time being I made the verifier ignore these, as LLVM does not do
this yet, and I wanted to get a clean run when verifying generated debug
info.

Another interesting case was the DW_TAG_imported_declaration. It was not
immediately clear to me whether this should go in or not, but currently
it is not indexed, and (unlike the enumerators) in does not seem to cause
problems for LLDB, so I've also ignored it.

Reviewers: JDevlieghere, aprantl, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331868 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CostModel][X86] Split off SLM checks
Simon Pilgrim [Wed, 9 May 2018 11:42:34 +0000 (11:42 +0000)]
[CostModel][X86] Split off SLM checks

A future patch will require this and the diff is much better if we perform the split separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331867 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[InstCombine] snprintf optimizations"
Benjamin Kramer [Wed, 9 May 2018 11:38:57 +0000 (11:38 +0000)]
Revert "[InstCombine] snprintf optimizations"

This reverts commit r331849. It miscompiles
snprintf(buf, sizeof(buf), "%s", "any constant string); into
memcpy(buf, "%s", sizeof("any constant string"));

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331866 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Mark tests using -debug-only as REQUIRES: asserts
Benjamin Kramer [Wed, 9 May 2018 11:17:30 +0000 (11:17 +0000)]
[DebugInfo] Mark tests using -debug-only as REQUIRES: asserts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331865 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Cleanup WriteFStore/WriteVecStore schedules
Simon Pilgrim [Wed, 9 May 2018 11:01:16 +0000 (11:01 +0000)]
[X86] Cleanup WriteFStore/WriteVecStore schedules

MOVNTPD/MOVNTPS should be WriteFStore

Standardized BDW/HSW/SKL/SKX WriteFStore/WriteVecStore - fixes some missed instregex patterns. (V)MASKMOVDQU was already using the default, its costs gets increased but is still nowhere near the real cost of that nasty instruction....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331864 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Move conditional moves out of isCodeGenOnly
Simon Dardis [Wed, 9 May 2018 10:33:21 +0000 (10:33 +0000)]
[mips] Move conditional moves out of isCodeGenOnly

Reviewers: atanasyan, smaksimovic, abeserminji

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331863 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[COFF] Improve correctness of def parsing for GNU features
Martin Storsjo [Wed, 9 May 2018 09:21:53 +0000 (09:21 +0000)]
[COFF] Improve correctness of def parsing for GNU features

The operator == used for exporting a function with a different
name in the DLL compared to the name in the import library
(which is useful for adding linker level aliases for function
in the import library) is a feature distinct and different from
the operator = used for exporting a function with a different
name (both in import library and DLL) than in the implementation
producing the DLL.

When creating an import library using dlltool, from a def file that
contains forwards (Func = OtherDll.Func), this shouldn't affect the
produced import library, which should still behave just as if it
was a normal exported function.

This clears a lot of confusion and subtle misunderstandings, and
avoids a parameter that was used to avoid creating weak aliases
when invoked from lld. (This parameter was added previously due to
the existing conflation of the two features.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331859 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd a test for r331746.
Hans Wennborg [Wed, 9 May 2018 08:20:14 +0000 (08:20 +0000)]
Add a test for r331746.

Thanks to pcc for creating the test file!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331854 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix test failed due to debug-label-mi.ll and debug-label-opt.ll
Shiva Chen [Wed, 9 May 2018 07:09:28 +0000 (07:09 +0000)]
[DebugInfo] Fix test failed due to debug-label-mi.ll and debug-label-opt.ll

Make these two test cases more generic for other architectures.
Please refer to '[DebugInfo] Convert intrinsic llvm.dbg.label to
MachineInstr.'

Patch by Hsiangkai Wang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331853 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MergedLoadStoreMotion] Fix a debug invariant bug in mergeStores
Bjorn Pettersson [Wed, 9 May 2018 06:52:12 +0000 (06:52 +0000)]
[MergedLoadStoreMotion] Fix a debug invariant bug in mergeStores

Summary:
MergedLoadStoreMotion::mergeStores is using some heuristics
to limit the amount of stores that it tries to sink (see
MagicCompileTimeControl in MergedLoadStoreMotion.cpp). The
heuristic involves counting the number of instructions in
one of the basic blocks that is part of the transformation.

We now ignore dbg intrinsics when counting instruction for
the MagicCompileTimeControl heuristic. This to make sure that
the amount of stores that are sunk doesn't depend on the amount
of debug information (if -g is used or not).

Reviewers: Gerolf, davide, majnemer

Reviewed By: davide

Subscribers: dberlin, bjope, aprantl, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331852 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Correct types in Go bindings
Robert Widmann [Wed, 9 May 2018 06:45:28 +0000 (06:45 +0000)]
[LLVM-C] Correct types in Go bindings

Summary: Fixes a test failure introduced in rL331114.

Reviewers: whitequark

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331850 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] snprintf optimizations
David Bolvansky [Wed, 9 May 2018 06:34:20 +0000 (06:34 +0000)]
[InstCombine] snprintf optimizations

Reviewers: spatel, efriedma, majnemer, rja

Reviewed By: rja

Subscribers: rja, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331849 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix test failed due to new DISubprogram attributes.
Shiva Chen [Wed, 9 May 2018 06:22:39 +0000 (06:22 +0000)]
[DebugInfo] Fix test failed due to new DISubprogram attributes.

Please refer to '[DebugInfo] Add DILabel metadata and intrinsic
llvm.dbg.label'. I have renamed the 'variables' attributes to
'retainedNodes' to include local variables and local labels for the
function.

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331848 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Combine (vXi1 (bitcast (-1)))) and (vXi1 (bitcast (0))) to all ones or all...
Craig Topper [Wed, 9 May 2018 06:07:20 +0000 (06:07 +0000)]
[X86] Combine (vXi1 (bitcast (-1)))) and (vXi1 (bitcast (0))) to all ones or all zeros vXi1 vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331847 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r331816 and r331820 - [globalisel] Add a combiner helpers for extending loads...
Daniel Sanders [Wed, 9 May 2018 05:00:17 +0000 (05:00 +0000)]
Revert r331816 and r331820 - [globalisel] Add a combiner helpers for extending loads and use them in a pre-legalize combiner for AArch64

Reverting this to see if the clang-cmake-aarch64-global-isel and
clang-cmake-aarch64-quick bots are failing because of this commit.
We know it wasn't r331819.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331846 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Examine all uses of isDebugValue() for debug instructions.
Shiva Chen [Wed, 9 May 2018 02:42:00 +0000 (02:42 +0000)]
[DebugInfo] Examine all uses of isDebugValue() for debug instructions.

Because we create a new kind of debug instruction, DBG_LABEL, we need to
check all passes which use isDebugValue() to check MachineInstr is debug
instruction or not. When expelling debug instructions, we should expel
both DBG_VALUE and DBG_LABEL. So, I create a new function,
isDebugInstr(), in MachineInstr to check whether the MachineInstr is
debug instruction or not.

This patch has no new test case. I have run regression test and there is
no difference in regression test.

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

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331844 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr.
Shiva Chen [Wed, 9 May 2018 02:41:08 +0000 (02:41 +0000)]
[DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr.

In order to convert LLVM IR to MachineInstr, we need a new TargetOpcode,
DBG_LABEL, to â€˜lower’ intrinsic llvm.dbg.label. The patch
creates this new TargetOpcode and convert intrinsic llvm.dbg.label to
MachineInstr through SelectionDAG.

In SelectionDAG, debug information is stored in SDDbgInfo. We create a
new data member of SDDbgInfo for labels and use the new data member,
SDDbgLabel, to create DBG_LABEL MachineInstr.

The new DBG_LABEL MachineInstr uses label metadata from LLVM IR as its
parameter. So, the backend could get metadata information of labels from
DBG_LABEL MachineInstr.

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

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331842 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.
Shiva Chen [Wed, 9 May 2018 02:40:45 +0000 (02:40 +0000)]
[DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label.

In order to set breakpoints on labels and list source code around
labels, we need collect debug information for labels, i.e., label
name, the function label belong, line number in the file, and the
address label located. In order to keep these information in LLVM
IR and to allow backend to generate debug information correctly.
We create a new kind of metadata for labels, DILabel. The format
of DILabel is

!DILabel(scope: !1, name: "foo", file: !2, line: 3)

We hope to keep debug information as much as possible even the
code is optimized. So, we create a new kind of intrinsic for label
metadata to avoid the metadata is eliminated with basic block.
The intrinsic will keep existing if we keep it from optimized out.
The format of the intrinsic is

llvm.dbg.label(metadata !1)

It has only one argument, that is the DILabel metadata. The
intrinsic will follow the label immediately. Backend could get the
label metadata through the intrinsic's parameter.

We also create DIBuilder API for labels to be used by Frontend.
Frontend could use createLabel() to allocate DILabel objects, and use
insertLabel() to insert llvm.dbg.label intrinsic in LLVM IR.

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

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331841 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert r331819 [GlobalISel][Legalizer] More concise and faster widenScalar, NFC
Roman Tereshin [Wed, 9 May 2018 01:43:12 +0000 (01:43 +0000)]
Revert r331819 [GlobalISel][Legalizer] More concise and faster widenScalar, NFC

Reverting this to see if the clang-cmake-aarch64-global-isel and
clang-cmake-aarch64-quick bots are failing because of this commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331839 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RuntimeDyld][MachO] Properly handle thumb to thumb calls within a section.
Lang Hames [Wed, 9 May 2018 01:38:13 +0000 (01:38 +0000)]
[RuntimeDyld][MachO] Properly handle thumb to thumb calls within a section.

Previously thumb bits were only checked for external relocations (thumb to arm
code and vice-versa). This patch adds detection for thumb callees in the same
section asthe (also thumb) caller.

The MachO/Thumb test case is updated to cover this, and redundant checks
(handled by the MachO/ARM test) are removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331838 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake CMakeLists.txt formatting more consistent with the rest of LLVM.
Nico Weber [Wed, 9 May 2018 01:15:38 +0000 (01:15 +0000)]
Make CMakeLists.txt formatting more consistent with the rest of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331837 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agofix path to llvm-cfi-verify unittests in docs
Nico Weber [Wed, 9 May 2018 01:15:06 +0000 (01:15 +0000)]
fix path to llvm-cfi-verify unittests in docs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331836 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake llvm-cfi-verify CMakeLists.txt formatting more consistent with the rest of LLVM.
Nico Weber [Wed, 9 May 2018 01:07:02 +0000 (01:07 +0000)]
Make llvm-cfi-verify CMakeLists.txt formatting more consistent with the rest of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331835 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport a funclet operand bundle in LowerInvoke
Heejin Ahn [Wed, 9 May 2018 00:53:50 +0000 (00:53 +0000)]
Support a funclet operand bundle in LowerInvoke

Summary:
The current LowerInvoke pass cannot handle invoke instructions with a
funclet bundle operand. The order of operands for an invoke instruction
is {call arguments, callee, funclet operand (if any), normal dest,
unwind dest}. The current code assumes there is no funclet operand and
incorrectly includes a funclet operand into call arguments.

Reviewers: rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331832 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoInline contents of LLVM_XRAY_TOOLS variable into its only use.
Nico Weber [Wed, 9 May 2018 00:42:17 +0000 (00:42 +0000)]
Inline contents of LLVM_XRAY_TOOLS variable into its only use.

No behavior change.
https://reviews.llvm.org/D46402

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331830 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug info
Petr Hosek [Wed, 9 May 2018 00:07:42 +0000 (00:07 +0000)]
[CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug info

Don't hardcode objcopy and strip names, rather use CMAKE_OBJCOPY and
CMAKE_STRIP variables which allows users to override the tools used
such as using llvm-objcopy and llvm-strip instead of binutils versions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331827 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SimplifyCFG] Fix a crash when folding PHIs.
Davide Italiano [Tue, 8 May 2018 23:28:15 +0000 (23:28 +0000)]
[SimplifyCFG] Fix a crash when folding PHIs.

We enter MergeBlockIntoPredecessor with a block looking like this:

for.inc.us-lcssa:                                 ; preds = %cond.end
  %k.1.lcssa.ph = phi i32 [ %conv15, %cond.end ]
  %t.3.lcssa.ph = phi i32 [ %k.1.lcssa.ph, %cond.end ]
  br label %for.inc, !dbg !66

[note the first arg of the PHI being a PHI].
FoldSingleEntryPHINodes gets rid of both PHIs (calling, eraseFromParent).
But right before we call the function, we push into IncomingValues the
only argument of the PHIs, and shortly after we try to iterate over
something which has been invalidated before :(

The fix its not trying to remove PHIs which have an incoming value
coming from the same BB we're looking at.

Fixes PR37300 and rdar://problem/39910460

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331824 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Remove dead code. NFCI.
Peter Collingbourne [Tue, 8 May 2018 22:59:05 +0000 (22:59 +0000)]
MC: Remove dead code. NFCI.

We should never emit an SHT_DYNSYM into an object file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331821 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel] Correct r331816 to check the opcode before calling getOperand().
Daniel Sanders [Tue, 8 May 2018 22:58:35 +0000 (22:58 +0000)]
[globalisel] Correct r331816 to check the opcode before calling getOperand().

Fix a silly mistake in my pre-commit changes for r331816. It should check what
opcode the insn is before extracting the operands.

NFC at the moment since the caller already checked the opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331820 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalISel][Legalizer] More concise and faster widenScalar, NFC
Roman Tereshin [Tue, 8 May 2018 22:53:09 +0000 (22:53 +0000)]
[GlobalISel][Legalizer] More concise and faster widenScalar, NFC

Refactoring LegalizerHelper::widenScalar member function reducing its
size by approximately a factor of 2 and (hopefuly) making it more
straightforward and regular by introducing widenScalarSrc and
widenScalarDst helper methods.

The new widenScalar* methods mutate the instructions in place instead
of recreating them from scratch and removing the originals. The
compile time implications of this were measured on sqlite3
amalgamation, targeting AArch64 in -O0:

LegalizerHelper::widenScalar: > 25% faster
Legalizer::runOnMachineFunction: ~ 4.0 - 4.5% faster

Also adding MachineOperand::setCImm and refactoring out
MachineIRBuilder::recordInsertion methods to make the change possible.

Reviewers: aditya_nandakumar, bogner, javed.absar, t.p.northover, ab, dsanders, arsenm

Reviewed By: aditya_nandakumar

Subscribers: wdng, rovka, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331819 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel] Add a combiner helpers for extending loads and use them in a pre-legaliz...
Daniel Sanders [Tue, 8 May 2018 22:26:39 +0000 (22:26 +0000)]
[globalisel] Add a combiner helpers for extending loads and use them in a pre-legalize combiner for AArch64

Summary: Depends on D45541

Reviewers: ab, aditya_nandakumar, bogner, rtereshin, volkan, rovka, javed.absar, aemerson

Reviewed By: aemerson

Subscribers: aemerson, rengolin, mgorny, javed.absar, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331816 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[X86][CET] Shadow stack fix for setjmp/longjmp"
Jessica Paquette [Tue, 8 May 2018 22:00:57 +0000 (22:00 +0000)]
Revert "[X86][CET] Shadow stack fix for setjmp/longjmp"

This reverts commit 30962eca38ef02666ebcdded72a94f2cd0292d68.

This commit has been causing test asan failures on a build bot.

http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/45108/

Original commit: https://reviews.llvm.org/D46181

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331813 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AsmPrinter] Allow emitting codeview for any windows target
Martin Storsjo [Tue, 8 May 2018 20:56:04 +0000 (20:56 +0000)]
[AsmPrinter] Allow emitting codeview for any windows target

Before SVN r244158, codeview debug info was emitted always
emitted for msvc if debug info was enabled, but that commit
added a module flag.

Since it's still restricted by the flag, we can allow it
for any target if the user requests it, not only msvc (and
windows-itanium, added in SVN r287567).

Add a test for emitting it for a mingw target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331809 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Add support for all missing dialog controls
Martin Storsjo [Tue, 8 May 2018 20:55:58 +0000 (20:55 +0000)]
[llvm-rc] Add support for all missing dialog controls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Coverage] Take filenames into account when loading function records.
Max Moroz [Tue, 8 May 2018 19:26:51 +0000 (19:26 +0000)]
[Coverage] Take filenames into account when loading function records.

Summary:
Don't skip functions with the same name but from different files.

That change makes it possible to generate code coverage reports from
different binaries compiled from different sources even if there are functions
with non-unique names. Without that change, code coverage for such functions is
missing except of the first function processed.

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: llvm-commits, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331801 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoChanging constants in a test (NFC)
Daniel Neilson [Tue, 8 May 2018 19:08:12 +0000 (19:08 +0000)]
Changing constants in a test (NFC)

Summary:
Changing the lengths of the atomic memory intrinsics in a test to make sure
that they don't get lowered into loads/stores if/when expansion of these
occurs in selectiondag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331800 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LV] Fix for PR37248, Broadcast codegen incorrectly assumed vector loop body is singl...
Hideki Saito [Tue, 8 May 2018 18:57:34 +0000 (18:57 +0000)]
[LV] Fix for PR37248, Broadcast codegen incorrectly assumed vector loop body is single basic block

Summary:
Broadcast code generation emitted instructions in pre-header, while the instruction they are dependent on in the vector loop body.
This resulted in an IL verification error ---- value used before defined.

Reviewers: rengolin, fhahn, hfinkel

Reviewed By: rengolin, fhahn

Subscribers: dcaballe, Ka-Ka, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331799 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Provide machine -> name mapping
Tim Renouf [Tue, 8 May 2018 18:53:04 +0000 (18:53 +0000)]
[AMDGPU] Provide machine -> name mapping

Summary:
AMDGPU stores a numerical code for the particular GPU variant in EFlags
in the ELF file. This commit provides a mapping from that number into
the machine name for use by objdump-type tools.

Change-Id: Id37fc0bebad443bd89c0080985ce298c4e7e9319

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331798 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Power9]Legalize and emit code for truncate and convert QP to HW and Byte
Lei Huang [Tue, 8 May 2018 18:52:06 +0000 (18:52 +0000)]
[Power9]Legalize and emit code for truncate and convert QP to HW and Byte

Legalize and emit code for truncate and convert float128 to (un)signed short
and (un)signed char.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331797 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Fix broken check lines in test
Matt Arsenault [Tue, 8 May 2018 18:43:44 +0000 (18:43 +0000)]
AMDGPU: Fix broken check lines in test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331796 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Don't use undef in a test
Matt Arsenault [Tue, 8 May 2018 18:43:34 +0000 (18:43 +0000)]
AMDGPU: Don't use undef in a test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331795 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[docs] Fix a typo in KaleidoscopeJIT tutorial
Stephane Sezer [Tue, 8 May 2018 18:43:27 +0000 (18:43 +0000)]
[docs] Fix a typo in KaleidoscopeJIT tutorial

Summary: Just a missing end quote.

Reviewers: lhames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331794 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Fix broken dynamic vector indexing for packed types
Matt Arsenault [Tue, 8 May 2018 18:43:25 +0000 (18:43 +0000)]
AMDGPU: Fix broken dynamic vector indexing for packed types

The intention of this was to multiply by 16, not shift by 16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331793 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Use correct shift width type
Matt Arsenault [Tue, 8 May 2018 18:43:05 +0000 (18:43 +0000)]
DAG: Use correct shift width type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331792 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Power9]Legalize and emit code for truncate and convert Quad-Precision to Word
Lei Huang [Tue, 8 May 2018 18:34:00 +0000 (18:34 +0000)]
[Power9]Legalize and emit code for truncate and convert Quad-Precision to Word

Legalize and emit code for:

  * xscvqpswz : VSX Scalar truncate & Convert Quad-Precision to Signed Word
  * xscvqpuwz : VSX Scalar truncate & Convert Quad-Precision to Unsigned Word

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331790 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Use eraseFromParent to delete am instruction when it is no longer needed.
Changpeng Fang [Tue, 8 May 2018 18:32:35 +0000 (18:32 +0000)]
AMDGPU: Use eraseFromParent to delete am instruction when it is no longer needed.

Reviewer: Nicolai

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331788 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Power9]Legalize and emit code for truncate and convert QP to DW
Lei Huang [Tue, 8 May 2018 18:23:31 +0000 (18:23 +0000)]
[Power9]Legalize and emit code for truncate and convert QP to DW

Legalize and emit code for:

  * xscvqpsdz : VSX Scalar truncate & Convert Quad-Precision to Signed Dword
  * xscvqpudz : VSX Scalar truncate & Convert Quad-Precision to Unsigned Dword

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331787 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions
Guozhi Wei [Tue, 8 May 2018 17:58:32 +0000 (17:58 +0000)]
[CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions

CodeGenPrepare pass move extension instructions close to load instructions in different BB, so they can be combined later. But the extension instructions can't move through logical and shift instructions in current implementation. This patch enables this enhancement, so we can eliminate more extension instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331783 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PowerPC] Unify handling for conversion of FP_TO_INT feeding a store
Lei Huang [Tue, 8 May 2018 17:36:40 +0000 (17:36 +0000)]
[PowerPC] Unify handling for conversion of FP_TO_INT feeding a store

Existing DAG combine only handles conversions for FP_TO_SINT:
"{f32, f64} x { i32, i16 }"

This patch simplifies the code to handle:
"{ FP_TO_SINT, FP_TO_UINT } x { f64, f32 } x { i64, i32, i16, i8 }"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331778 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objcopy] Fix exit code
Alexander Shaposhnikov [Tue, 8 May 2018 17:12:54 +0000 (17:12 +0000)]
[llvm-objcopy] Fix exit code

Set the exit code to 1 if no arguments are specified.

Test plan: make check-all

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331776 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Added checks for dpp_ctrl value
Stanislav Mekhanoshin [Tue, 8 May 2018 16:53:02 +0000 (16:53 +0000)]
[AMDGPU] Added checks for dpp_ctrl value

- Report error for invalid dpp_ctrl values.
- Changed the way it is reported, now the error will be emitted into
  asm and will work with release build as well.
- Added dpp_ctrl value verifier for codegen.
- Added symbolic constants for dpp_ctrl.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331775 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Tag PCONFIG instruction with WriteSystem scheduler class
Simon Pilgrim [Tue, 8 May 2018 15:55:14 +0000 (15:55 +0000)]
[X86] Tag PCONFIG instruction with WriteSystem scheduler class

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331773 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips][msa] Pattern match the splat.d instruction
Stefan Maksimovic [Tue, 8 May 2018 15:12:29 +0000 (15:12 +0000)]
[mips][msa] Pattern match the splat.d instruction

Introduced a new pattern for matching splat.d explicitly.

Both splat.d and splati.d can now be generated from the @llvm.mips.splat.d
intrinsic depending on whether an immediate value has been passed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331771 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Split off WriteIMul64 from WriteIMul schedule class (PR36931)
Simon Pilgrim [Tue, 8 May 2018 14:55:16 +0000 (14:55 +0000)]
[X86] Split off WriteIMul64 from WriteIMul schedule class (PR36931)

This fixes a couple of BtVer2 missing instructions that weren't been handled in the override.

NOTE: There are still a lot of overrides that still need cleaning up!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331770 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm][x86] SandyBridge/IvyBridge don't support BMI1/BMI2
Simon Pilgrim [Tue, 8 May 2018 14:20:25 +0000 (14:20 +0000)]
[llvm][x86] SandyBridge/IvyBridge don't support BMI1/BMI2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331769 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Split WriteIDiv into div/idiv 8/16/32/64 implementations (PR36930)
Simon Pilgrim [Tue, 8 May 2018 13:51:45 +0000 (13:51 +0000)]
[X86] Split WriteIDiv into div/idiv 8/16/32/64 implementations (PR36930)

I've created the necessary classes but there are still a lot of overrides that need cleaning up.

NOTE: The Znver1 model was missing some div/idiv variants in the instregex patterns and wasn't setting the resource cycles at all in the overrides.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331767 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca][x86] Add div/idiv, mul/imul and inc/dec/neg/nop instruction tests
Simon Pilgrim [Tue, 8 May 2018 13:30:58 +0000 (13:30 +0000)]
[llvm-mca][x86] Add div/idiv, mul/imul and inc/dec/neg/nop instruction tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331765 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Update a stale comment. NFC.
Martin Storsjo [Tue, 8 May 2018 12:33:54 +0000 (12:33 +0000)]
[llvm-rc] Update a stale comment. NFC.

The tokenizer handles comments since SVN r315207.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331761 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add vector masked load/store scheduler classes (PR32857)
Simon Pilgrim [Tue, 8 May 2018 12:17:55 +0000 (12:17 +0000)]
[X86] Add vector masked load/store scheduler classes (PR32857)

Split off from existing vector load/store classes to remove InstRW overrides.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331760 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64][SVE] Asm: Support for LD1R load-and-replicate scalar instructions.
Sander de Smalen [Tue, 8 May 2018 10:46:55 +0000 (10:46 +0000)]
[AArch64][SVE] Asm: Support for LD1R load-and-replicate scalar instructions.

Reviewers: fhahn, rengolin, samparker, SjoerdMeijer, javed.absar

Reviewed By: fhahn

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331758 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add SchedWriteFTest/SchedWriteVecTest TEST scheduler classes
Simon Pilgrim [Tue, 8 May 2018 10:28:03 +0000 (10:28 +0000)]
[X86] Add SchedWriteFTest/SchedWriteVecTest TEST scheduler classes

Split off from SchedWriteVecLogic to remove InstRW overrides.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331757 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Mark various memory instructions as being in microMIPS (NFC)
Simon Dardis [Tue, 8 May 2018 10:16:21 +0000 (10:16 +0000)]
[mips] Mark various memory instructions as being in microMIPS (NFC)

Reviewers: atanasyan, abeserminji, smaksimovic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331756 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AArch64] Disallow vector operand if FPR128 Q register is required.
Sander de Smalen [Tue, 8 May 2018 10:01:04 +0000 (10:01 +0000)]
[AArch64] Disallow vector operand if FPR128 Q register is required.

Patch https://reviews.llvm.org/D41445 changed the behaviour of 'isReg()'
to also return 'true' if the parsed register operand is a vector
register. Code in the AsmMatcher checks if a register is a subclass of the
expected register class. However, even though both parsed registers map
to the same physical register, the 'v' register is of kind 'NeonVector',
where 'q' is of type Scalar, where isSubclass() does not distinguish
between the two cases.

The solution is to use an AsmOperand instead of the register directly,
and use the PredicateMethod to distinguish the two operands.

This fixes for example:
  ldr v0, [x0]    // 'v0' is an invalid operand for this instruction
  ldr q0, [x0]    // valid

Reviewers: aemerson, Gerolf, SjoerdMeijer, javed.absar

Reviewed By: aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331755 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Correct clo/clz predicates
Simon Dardis [Tue, 8 May 2018 09:50:37 +0000 (09:50 +0000)]
[mips] Correct clo/clz predicates

Reviewers: smaksimovic, abeserminji, atanasyan

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331754 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Mark all byval parameters as aliased
Jeremy Morse [Tue, 8 May 2018 09:18:01 +0000 (09:18 +0000)]
[X86] Mark all byval parameters as aliased

This is a fix for PR30290: by marking all byval stack slots as being aliased,
the instruction scheduler is more conservative about rescheduling memory
accesses to such stack slots as an LLVM Value* might alias it. This fixes
errors such as in the patched test case, where reads and writes to a data
structure are illegally mixed.

This could be fixed better in the future with better analysis for the
instruction scheduler to know what Values alias what stack slots.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331749 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][CET] Shadow stack fix for setjmp/longjmp
Alexander Ivchenko [Tue, 8 May 2018 09:04:07 +0000 (09:04 +0000)]
[X86][CET] Shadow stack fix for setjmp/longjmp

This patch adds a shadow stack fix when compiling
setjmp/longjmp with the shadow stack enabled. This
allows setjmp/longjmp to work correctly with CET.

Patch by mike.dvoretsky

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331748 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-rc] Don't strictly require quotes around external file names
Martin Storsjo [Tue, 8 May 2018 08:47:37 +0000 (08:47 +0000)]
[llvm-rc] Don't strictly require quotes around external file names

Regardless of what docs may say, existing resource files in the
wild can use this syntax.

Rename a file used in an existing test, to make it usable for unquoted
paths.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331747 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoObject: Find terminator correctly when reading long filenames in GNU archives (PR37244)
Hans Wennborg [Tue, 8 May 2018 08:22:58 +0000 (08:22 +0000)]
Object: Find terminator correctly when reading long filenames in GNU archives (PR37244)

The code was previously relying on there being a null terminator
somewhere in (or after) the string table, something made less likely by
r330786.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331746 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] Introduce the enclv instruction
Gabor Buella [Tue, 8 May 2018 07:11:05 +0000 (07:11 +0000)]
[x86] Introduce the enclv instruction

Summary:
and use the -msgx flag as a requirement
for the SGX instructions.

Reviewers: craig.topper, zvi

Reviewed By: craig.topper

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331742 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LCSSA] Do not remove used PHI nodes in formLCSSAForInstructions
Bjorn Pettersson [Tue, 8 May 2018 06:59:47 +0000 (06:59 +0000)]
[LCSSA] Do not remove used PHI nodes in formLCSSAForInstructions

Summary:
In formLCSSAForInstructions we speculatively add new PHI
nodes, that sometimes ends up without having any uses. It
has been discovered that sometimes an added PHI node can
appear as being unused in one iteration of the Worklist,
although it can end up being used by a PHI node added in
a later iteration. We now check, a second time, that the
PHI node still is unused before we remove it. This avoids
an assert about "Trying to remove a phi with uses." for the
added test case.

Reviewers: davide, mzolotukhin, mattd, dberlin

Reviewed By: mzolotukhin, dberlin

Subscribers: dberlin, mzolotukhin, davide, bjope, uabelho, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331741 91177308-0d34-0410-b5e6-96231b3b80d8