OSDN Git Service

android-x86/external-llvm.git
5 years ago[X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation from other...
Craig Topper [Tue, 30 Apr 2019 17:56:28 +0000 (17:56 +0000)]
[X86] Initial cleanups on the FixupLEAs pass. Separate Atom LEA creation from other LEA optimizations.

This removes some of the class variables. Merge basic block processing into
runOnMachineFunction to keep the flags local.

Pass MachineBasicBlock around instead of an iterator. We can get the iterator in
the few places that need it. Allows a range-based outer for loop.

Separate the Atom optimization from the rest of the optimizations. This allows
fixupIncDec to create INC/DEC and still allow Atom to turn it back into LEA
when profitable by its heuristics.

I'd like to improve fixupIncDec to turn LEAs into ADD any time the base or index
register is equal to the destination register. This is profitable regardless of
the various slow flags. But again we would want Atom to be able to undo that.

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

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

5 years agoRe-reland "[Option] Fix PR37006 prefix choice in findNearest"
Nico Weber [Tue, 30 Apr 2019 17:46:00 +0000 (17:46 +0000)]
Re-reland "[Option] Fix PR37006 prefix choice in findNearest"

This was first reviewed in https://reviews.llvm.org/D46776 and
landed in r332299, but got reverted because it broke the PS4
bots.

https://reviews.llvm.org/D50410 fixed this, and then this
change was re-reviewed at https://reviews.llvm.org/D50515 and
relanded in r341329. It got reverted due to causing MSan issues.
However, nobody wrote down the error message and the bot link
is dead, so I'm relanding this to capture the MSan error.
I'll then either fix it, or copy it somewhere and revert if
fixing looks difficult.

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

5 years agogn build: Add check-clangd target after r3359424
Nico Weber [Tue, 30 Apr 2019 15:36:02 +0000 (15:36 +0000)]
gn build: Add check-clangd target after r3359424

r359527 already merged some of that to the GN build,
but it was missing some bits as well.

The check-clangd target works (at least for now) differently than all
the other check-foo targets, see https://reviews.llvm.org/D61187

For that reason, there's no gni file and the generated lit configs are
not (yet?) added to llvm-lit/BUILD.gn.

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

5 years agoAdd llvm-profdata to LLVM_TOOLCHAIN_TOOLS
Russell Gallop [Tue, 30 Apr 2019 15:35:16 +0000 (15:35 +0000)]
Add llvm-profdata to LLVM_TOOLCHAIN_TOOLS

This is required for using PGO on Windows but isn't in the Windows
release packages. Windows packages are built with
LLVM_INSTALL_TOOLCHAIN_ONLY so only includes llvm "tools" listed here.

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

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

5 years ago[llvm-objcopy] Add RISC-V support for -B/-O
Jordan Rupprecht [Tue, 30 Apr 2019 15:21:36 +0000 (15:21 +0000)]
[llvm-objcopy] Add RISC-V support for -B/-O

Reviewers: jorgbrown, espindola, alexshap, jhenderson

Subscribers: emaste, arichardson, fedor.sergeev, jakehehrlich, kito-cheng, shiva0217, MaskRay, rogfer01, rkruppe, llvm-commits

Tags: #llvm

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

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

5 years ago[SelectionDAG] remove div-by-zero constant folding restriction
Sanjay Patel [Tue, 30 Apr 2019 14:37:15 +0000 (14:37 +0000)]
[SelectionDAG] remove div-by-zero constant folding restriction

We don't have this restriction in IR, so it should not be here
either simply out of consistency. Code that wants to handle FP
exceptions is expected to use the 'strict' variants of these
nodes.

We don't get the frem case because frem by 0.0 produces NaN (invalid),
and that's the remaining check here (so the removed check for frem
was dead code AFAIK).

This is the only place in SDAG that uses "HasFPExceptions", so I
think we should remove that entirely as a follow-up patch.

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

5 years ago[llvm-nm] Add --special-syms no-op flag
Eugene Leviant [Tue, 30 Apr 2019 13:51:48 +0000 (13:51 +0000)]
[llvm-nm] Add --special-syms no-op flag

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

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

5 years agogn build: Merge r359455
Nico Weber [Tue, 30 Apr 2019 13:45:16 +0000 (13:45 +0000)]
gn build: Merge r359455

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

5 years ago[AArch64] add tests for fdiv/frem constant folding (PR41668); NFC
Sanjay Patel [Tue, 30 Apr 2019 13:43:17 +0000 (13:43 +0000)]
[AArch64] add tests for fdiv/frem constant folding (PR41668); NFC

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

5 years ago[TableGen] Fix null pointer dereferencing in token parser.
Simon Pilgrim [Tue, 30 Apr 2019 13:09:55 +0000 (13:09 +0000)]
[TableGen] Fix null pointer dereferencing in token parser.

Reported in https://www.viva64.com/en/b/0629/

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

5 years agovs integration: vs2019 support
Hans Wennborg [Tue, 30 Apr 2019 12:41:33 +0000 (12:41 +0000)]
vs integration: vs2019 support

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

5 years ago[cmake] Fix error message on simulated VS version check
Russell Gallop [Tue, 30 Apr 2019 12:37:10 +0000 (12:37 +0000)]
[cmake] Fix error message on simulated VS version check

For clang-cl self hosts in VS2015 environment this was reporting: "Host
Clang must have at least -fms-compatibility-version=19.00.24213.1, your
version is 9.0.0".

This check fires as CMake detects the simulated environment as _MSC_VER
1900, which is truncated. This makes it less than the required
19.00.24213.1.

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

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

5 years agoRevert rL359519 : [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.
Simon Pilgrim [Tue, 30 Apr 2019 12:34:21 +0000 (12:34 +0000)]
Revert rL359519 : [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.

Summary:
MemorySSA keeps internal pointers of AA and DT.
If these get invalidated, so should MemorySSA.

Reviewers: george.burgess.iv, chandlerc

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61043
........
This was causing windows build bot failures

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

5 years ago[SLP] Lit test that cannot get vectorized due to lack of look-ahead operand reorderin...
Simon Pilgrim [Tue, 30 Apr 2019 11:03:09 +0000 (11:03 +0000)]
[SLP] Lit test that cannot get vectorized due to lack of look-ahead operand reordering heuristic.

The code in this test is not vectorized by SLP because its operand reordering cannot look beyond the immediate predecessors.
This will get fixed in a follow-up patch that introduces the look-ahead operand reordering heuristic.

Committed on behalf of @vporpo (Vasileios Porpodas)

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

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

5 years ago[llvm-objcopy] - Check dynamic relocation sections for broken references.
George Rimar [Tue, 30 Apr 2019 11:02:09 +0000 (11:02 +0000)]
[llvm-objcopy] - Check dynamic relocation sections for broken references.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41371.

Currently, it is possible to break the sh_link field of the dynamic relocation section
by removing the section it refers to. The patch fixes an issue and adds 2 test cases.

One of them shows that it does not seem possible to break the sh_info field.
I added an assert to verify this.

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

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

5 years agoUpdate checks in an instcombine test, NFC
Jeremy Morse [Tue, 30 Apr 2019 10:56:33 +0000 (10:56 +0000)]
Update checks in an instcombine test, NFC

This reduces the delta in some incoming work that changes this test.

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

5 years ago[ARM] Implement TTI::getMemcpyCost
Sjoerd Meijer [Tue, 30 Apr 2019 10:28:50 +0000 (10:28 +0000)]
[ARM] Implement TTI::getMemcpyCost

This implements TargetTransformInfo method getMemcpyCost, which estimates the
number of instructions to which a memcpy instruction expands to.

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

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

5 years agoFix for bug 41512: lower INSERT_VECTOR_ELT(ZeroVec, 0, Elt) to SCALAR_TO_VECTOR(Elt...
Simon Pilgrim [Tue, 30 Apr 2019 10:18:25 +0000 (10:18 +0000)]
Fix for bug 41512: lower INSERT_VECTOR_ELT(ZeroVec, 0, Elt) to SCALAR_TO_VECTOR(Elt) for all SSE flavors

Current LLVM uses pxor+pinsrb on SSE4+ for INSERT_VECTOR_ELT(ZeroVec, 0, Elt) insead of much simpler movd.
INSERT_VECTOR_ELT(ZeroVec, 0, Elt) is idiomatic construct which is used e.g. for _mm_cvtsi32_si128(Elt) and for lowest element initialization in _mm_set_epi32.
So such inefficient lowering leads to significant performance digradations in ceratin cases switching from SSSE3 to SSE4.
https://bugs.llvm.org/show_bug.cgi?id=41512

Here INSERT_VECTOR_ELT(ZeroVec, 0, Elt) is simply converted to SCALAR_TO_VECTOR(Elt) when applicable since latter is closer match to desired behavior and always efficiently lowered to movd and alike.

Committed on behalf of @Serge_Preis (Serge Preis)

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

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

5 years agoRevert r359520
David Bolvansky [Tue, 30 Apr 2019 10:09:28 +0000 (10:09 +0000)]
Revert r359520

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

5 years ago[TargetLowering] findOptimalMemOpLowering. NFCI.
Sjoerd Meijer [Tue, 30 Apr 2019 10:09:15 +0000 (10:09 +0000)]
[TargetLowering] findOptimalMemOpLowering. NFCI.

This was a local static funtion in SelectionDAG, which I've promoted to
TargetLowering so that I can reuse it to estimate the cost of a memory
operation in D59787.

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

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

5 years ago[ARM GlobalISel] Widen small shift operands
Diana Picus [Tue, 30 Apr 2019 09:24:43 +0000 (09:24 +0000)]
[ARM GlobalISel] Widen small shift operands

The legalizer was already widening the shift amount. Add tests for that
behaviour, and also support widening the shifted value.

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

5 years ago[AsmPrinter] Make AsmPrinter::HandlerInfo::Handler a unique_ptr
Fangrui Song [Tue, 30 Apr 2019 09:14:02 +0000 (09:14 +0000)]
[AsmPrinter] Make AsmPrinter::HandlerInfo::Handler a unique_ptr

Handlers.clear() in AsmPrinter::doFinalization() will destroy these handlers.
A unique_ptr makes the ownership clearer.

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

5 years ago[ARM GlobalISel] Be more careful about bailing out
Diana Picus [Tue, 30 Apr 2019 09:05:25 +0000 (09:05 +0000)]
[ARM GlobalISel] Be more careful about bailing out

Bail out on function arguments/returns with types aggregating an
unsupported type. This fixes cases where we would happily and
incorrectly lower functions taking e.g. [1 x i64] parameters, when we
don't even support plain i64 yet.

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

5 years ago[TargetLowering] Change getOptimalMemOpType to take a function attribute list
Sjoerd Meijer [Tue, 30 Apr 2019 08:38:12 +0000 (08:38 +0000)]
[TargetLowering] Change getOptimalMemOpType to take a function attribute list

The MachineFunction wasn't used in getOptimalMemOpType, but more importantly,
this allows reuse of findOptimalMemOpLowering that is calling getOptimalMemOpType.

This is the groundwork for the changes in D59766 and D59787, that allows
implementation of TTI::getMemcpyCost.

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

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

5 years agoMSan: handle llvm.lifetime.start intrinsic
Alexander Potapenko [Tue, 30 Apr 2019 08:35:14 +0000 (08:35 +0000)]
MSan: handle llvm.lifetime.start intrinsic

Summary:
When a variable goes into scope several times within a single function
or when two variables from different scopes share a stack slot it may
be incorrect to poison such scoped locals at the beginning of the
function.
In the former case it may lead to false negatives (see
https://github.com/google/sanitizers/issues/590), in the latter - to
incorrect reports (because only one origin remains on the stack).

If Clang emits lifetime intrinsics for such scoped variables we insert
code poisoning them after each call to llvm.lifetime.start().
If for a certain intrinsic we fail to find a corresponding alloca, we
fall back to poisoning allocas for the whole function, as it's now
impossible to tell which alloca was missed.

The new instrumentation may slow down hot loops containing local
variables with lifetime intrinsics, so we allow disabling it with
-mllvm -msan-handle-lifetime-intrinsics=false.

Reviewers: eugenis, pcc

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[DebugInfo] DW_OP_deref_size in PrologEpilogInserter.
Markus Lavin [Tue, 30 Apr 2019 07:58:57 +0000 (07:58 +0000)]
[DebugInfo] DW_OP_deref_size in PrologEpilogInserter.

The PrologEpilogInserter need to insert a DW_OP_deref_size before
prepending a memory location expression to an already implicit
expression to avoid having the existing expression act on the memory
address instead of the value behind it.

The reason for using DW_OP_deref_size and not plain DW_OP_deref is that
big-endian targets need to read the right size as simply truncating a
larger read would yield the wrong result (LSB bytes are not at the lower
address).

This re-commit fixes issues reported in the first one. Namely deref was
inserted under wrong conditions and additionally the deref_size argument
was incorrectly encoded.

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

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

5 years ago[NFC][PowerPC] Use -check-prefixes to simplify the check in code-align.ll
Kang Zhang [Tue, 30 Apr 2019 03:39:05 +0000 (03:39 +0000)]
[NFC][PowerPC] Use -check-prefixes to simplify the check in code-align.ll

Summary:
When checking the same output, we can use the `-check-prefixes` to simplify the check.
For example, if we want to check below output.
```
; GENERIC-LABEL: .globl  foo
; BASIC-LABEL: .globl  foo
; PWR-LABEL: .globl  foo
; GENERIC: .p2align  2
; BASIC: .p2align  4
; PWR: .p2align  4
; GENERIC: @foo
; BASIC: @foo
; PWR: @foo

```
If we use `-check-prefixes`
```
... -check-prefixes=CHECK,GENERAL
... -check-prefixes=CHECK,BASIC
... -check-prefixes=CHECK,PWR
```
Above check can be simplify to:
```
; CHECK-LABEL: .globl  foo
; GENERIC: .p2align  2
; BASIC: .p2align  4
; PWR: .p2align  4
; CHECK: @foo
```

Reviewed By: hfinkel
Differential Revision: https://reviews.llvm.org/D61227

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

5 years ago[DAGCombiner] Do not generate ISD::ADDE node if adde is not legal for the target...
Zi Xuan Wu [Tue, 30 Apr 2019 03:01:14 +0000 (03:01 +0000)]
[DAGCombiner] Do not generate ISD::ADDE node if adde is not legal for the target when combine ISD::TRUNC node

Do not combine (trunc adde(X, Y, Carry)) into (adde trunc(X), trunc(Y), Carry),
if adde is not legal for the target. Even it's at type-legalize phase.
Because adde is special and will not be legalized at operation-legalize phase later.

This fixes: PR40922
https://bugs.llvm.org/show_bug.cgi?id=40922

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

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

5 years ago[ORC] Fix an ambiguous call in a unit test.
Lang Hames [Tue, 30 Apr 2019 02:43:01 +0000 (02:43 +0000)]
[ORC] Fix an ambiguous call in a unit test.

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

5 years ago[clangd] Fix GN build
Vitaly Buka [Tue, 30 Apr 2019 01:35:42 +0000 (01:35 +0000)]
[clangd] Fix GN build

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

5 years ago[CommandLine} Wire-up cl::list::setDefault() so it will work correctly with cl::Reset...
Don Hinton [Tue, 30 Apr 2019 00:09:49 +0000 (00:09 +0000)]
[CommandLine} Wire-up cl::list::setDefault() so it will work correctly with cl::ResetAllOptionOccurrences() in unittests.  Part 2 of 5

Summary:
With this change, cl::ResetAllOptionOccurrences() clears
cl::list just like cl::opt, allowing users to call
cl::ParseCommandLineOptions() multiple times without interference from
previous calls.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[ORC] Allow JITDylib definition generators to return Errors.
Lang Hames [Tue, 30 Apr 2019 00:03:26 +0000 (00:03 +0000)]
[ORC] Allow JITDylib definition generators to return Errors.

Background: A definition generator can be attached to a JITDylib to generate
new definitions in response to queries. For example: a generator that forwards
calls to dlsym can map symbols from a dynamic library into the JIT process on
demand.

If definition generation fails then the generator should be able to return an
error. This allows the JIT API to distinguish between the case where a
generator does not provide a definition, and the case where it was not able to
determine whether it provided a definition due to an error.

The immediate motivation for this is cross-process symbol lookups: If the
remote-lookup generator is attached to a JITDylib early in the search list, and
if a generator failure is misinterpreted as "no definition in this JITDylib" then
lookup may continue and bind to a different definition in a later JITDylib, which
is a bug.

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

5 years ago[PDB] Fixed null pointer dereference
David Bolvansky [Mon, 29 Apr 2019 23:57:20 +0000 (23:57 +0000)]
[PDB] Fixed null pointer dereference

Reviewers: zturner, rnk

Reviewed By: rnk

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.
Alina Sbirlea [Mon, 29 Apr 2019 23:53:04 +0000 (23:53 +0000)]
[MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.

Summary:
MemorySSA keeps internal pointers of AA and DT.
If these get invalidated, so should MemorySSA.

Reviewers: george.burgess.iv, chandlerc

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

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

5 years agoAdd __builtin_dcbf support for PPC
Ahsan Saghir [Mon, 29 Apr 2019 23:25:33 +0000 (23:25 +0000)]
Add __builtin_dcbf support for PPC

Summary:
This patch adds support for __builtin_dcbf for PPC.

__builtin_dcbf copies the contents of a modified block from the data cache
to main memory and flushes the copy from the data cache.

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

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

5 years ago[PDB] Fix hash function used to write /src/headerblock
Nico Weber [Mon, 29 Apr 2019 23:09:35 +0000 (23:09 +0000)]
[PDB] Fix hash function used to write /src/headerblock

lld-link used to write PDB files that DIA couldn't recover natvis
files from if:

- The global strings table was > 64kiB
- There were at least 3 natvis files

The cause was that the hash function for the /src/headerblock stream
was incorrect: It needs to be truncated to 16 bit.

If the global strings table was <= 64kiB, truncating to 16 bit is a
no-op, so this wasn't needed for small programs.

If there are only 1 or 2 natvis files, then the growth strategy in
HashTable::grow() would mean the hash table would have 2 buckets (for 1
natvis file) or 4 buckets (for 4 natvis files), and since the hash
function is used modulo number of buckets, and since 2 and 4 divide
0x10000, the missing `% 0x10000` is a no-op there too. For 3 natvis
files, the hash table grows to 6 buckets, which has a factor that's not
common with 0x10000 and the difference starts to matter.

Fixes PR41626.

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

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

5 years agogn build: Merge r359252
Nico Weber [Mon, 29 Apr 2019 23:06:03 +0000 (23:06 +0000)]
gn build: Merge r359252

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

5 years ago[ORC] Replace the LLJIT/LLLazyJIT Create methods with Builder utilities.
Lang Hames [Mon, 29 Apr 2019 22:37:27 +0000 (22:37 +0000)]
[ORC] Replace the LLJIT/LLLazyJIT Create methods with Builder utilities.

LLJITBuilder and LLLazyJITBuilder construct LLJIT and LLLazyJIT instances
respectively. Over time these will allow more configurable options to be
added while remaining easy to use in the default case, which for default
in-process JITing is now:

auto J = ExitOnErr(LLJITBuilder.create());

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

5 years ago[JITLink] Move a typedef.
Lang Hames [Mon, 29 Apr 2019 22:37:16 +0000 (22:37 +0000)]
[JITLink] Move a typedef.

The FinalizeContinuation typedef belongs on the Allocation class, not the
allocator.

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

5 years ago[WebAssembly] Make an assertion message prettier. NFC.
Dan Gohman [Mon, 29 Apr 2019 22:37:08 +0000 (22:37 +0000)]
[WebAssembly] Make an assertion message prettier. NFC.

This is a follow-up to https://reviews.llvm.org/D59521.

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

5 years ago[ThinLTO] Adding architecture name into saved object filename
Steven Wu [Mon, 29 Apr 2019 21:39:54 +0000 (21:39 +0000)]
[ThinLTO] Adding architecture name into saved object filename

Summary:
For ThinLTOCodegenerator, it has an option to save the object file
outputs into a directory which is essential for debug info. Tools like lldb
and dsymutil will look for these object files for debug info.

On Darwin platform, you can link fat binaries with one single clang
driver invocation like:
 $ clang -arch x86_64 -arch i386 -Wl,-object_path_lto,$TMPDIR ...
Unfornately, the output object files for one architecture is going to
overwrite the previous ones and one architecture slice will end up with
no debug info. One example for this is to turn on ThinLTO for sanitizer
dylibs in compiler-rt project.

To fix the issue, add the name for the architecture into the name of the
output object file.

rdar://problem/35482935

Reviewers: tejohnson, bd1976llvm, dexonsmith, JDevlieghere

Reviewed By: dexonsmith

Subscribers: mehdi_amini, aprantl, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits

Tags: #llvm

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

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

5 years ago[WebAssembly] Define the signature for __stack_chk_fail
Dan Gohman [Mon, 29 Apr 2019 21:09:44 +0000 (21:09 +0000)]
[WebAssembly] Define the signature for __stack_chk_fail

The WebAssembly backend needs to know the signatures of all runtime
libcall functions. This adds the signature for __stack_chk_fail which was
previously missing.

Also, make the error message for a missing libcall include the name of
the function.

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

Reviewed By: sbc100

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

5 years ago[PowerPC] Try harder to avoid load/move-to VSR for partial vector loads
Roland Froese [Mon, 29 Apr 2019 21:08:35 +0000 (21:08 +0000)]
[PowerPC] Try harder to avoid load/move-to VSR for partial vector loads

Change the PPCISelLowering.cpp function that decides to avoid update form in
favor of partial vector loads to know about newer load types and to not be
confused by the chain operand.

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

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

5 years ago[GlobalISel][AArch64] Select llvm.aarch64.crypto.sha1h
Jessica Paquette [Mon, 29 Apr 2019 20:58:17 +0000 (20:58 +0000)]
[GlobalISel][AArch64] Select llvm.aarch64.crypto.sha1h

This was falling back and gives us a reason to create a selectIntrinsic function
which we would need eventually anyway. Update arm64-crypto.ll to show that we
correctly select it.

Also factor out the code for finding an intrinsic ID.

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

5 years ago[UpdateTestChecks] Allow Lbegin_func without a leading period
Martin Storsjo [Mon, 29 Apr 2019 20:25:56 +0000 (20:25 +0000)]
[UpdateTestChecks] Allow Lbegin_func without a leading period

On mingw/i686, local labels don't start with a leading period.

Also escape the leading period, as it previously could match
any char.

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

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

5 years ago[X86] Run CFIInstrInserter on Windows if Dwarf is used
Martin Storsjo [Mon, 29 Apr 2019 20:25:51 +0000 (20:25 +0000)]
[X86] Run CFIInstrInserter on Windows if Dwarf is used

This is necessary since SVN r330706, as tail merging can include
CFI instructions since then.

This fixes PR40322 and PR40012.

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

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

5 years agoFix one more case of passing options with too many dashes.
Don Hinton [Mon, 29 Apr 2019 20:13:35 +0000 (20:13 +0000)]
Fix one more case of passing options with too many dashes.

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

5 years ago[gn] Use label_name rather than target_output_name for objects
Petr Hosek [Mon, 29 Apr 2019 20:04:20 +0000 (20:04 +0000)]
[gn] Use label_name rather than target_output_name for objects

Multiple targets in the same output directory can use the same
target_output_name. The typical example of that is having a shared
and a static library of the same, e.g. libc++.so and libc++.a.
When that's the case, the object files produced for each target
are going to conflict. Using the label_name avoids this conflict
since labels are guaranteed to be unique within a single BUILD.gn
file which corresponds to a single output directory.

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

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

5 years agoFix string UAF in new FileCheck test
Reid Kleckner [Mon, 29 Apr 2019 19:56:46 +0000 (19:56 +0000)]
Fix string UAF in new FileCheck test

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

5 years ago[X86][SSE] isHorizontalBinOp - add support for target shuffles
Simon Pilgrim [Mon, 29 Apr 2019 19:52:59 +0000 (19:52 +0000)]
[X86][SSE] isHorizontalBinOp - add support for target shuffles

Add target shuffle decoding to isHorizontalBinOp as well as ISD::VECTOR_SHUFFLE support.

This does mean we can go through bitcasts so we need to bitcast the extracted args to ensure they are the correct type

Fixes PR39936 and should help with PR39920/PR39921

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

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

5 years ago[llvm-pdbutil] FunctionDumper::dump(PDBSymbolTypeFunctionArg) - fix null dereference...
Simon Pilgrim [Mon, 29 Apr 2019 19:40:12 +0000 (19:40 +0000)]
[llvm-pdbutil] FunctionDumper::dump(PDBSymbolTypeFunctionArg) - fix null dereference warning

Reported in https://www.viva64.com/en/b/0629/

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

5 years agocomputePolynomialFromPointer - add missing early-out return for non-pointer types.
Simon Pilgrim [Mon, 29 Apr 2019 19:25:16 +0000 (19:25 +0000)]
computePolynomialFromPointer - add missing early-out return for non-pointer types.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Mon, 29 Apr 2019 19:23:44 +0000 (19:23 +0000)]
[InstCombine] reduce code duplication; NFC

Follow-up to:
rL359482

Avoid this potential problem throughout by giving the type a name
and verifying the assumption that both operands are the same type.

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

5 years agoFix additional cases of more that two dashes for options in tests.
Don Hinton [Mon, 29 Apr 2019 18:58:52 +0000 (18:58 +0000)]
Fix additional cases of more that two dashes for options in tests.

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

5 years agoRemove duplicate line. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 18:58:32 +0000 (18:58 +0000)]
Remove duplicate line. NFCI.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[InstCombine] visitFCmpInst - appease copy+paste pattern warning. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 18:52:19 +0000 (18:52 +0000)]
[InstCombine] visitFCmpInst - appease copy+paste pattern warning. NFCI.

PVS Studio's copy+paste recognizer was seeing this as a typo, technically Op0/Op1 in a fcmp should always be the same type, but we might as well avoid the issue.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[globalisel] Improve Legalizer debug output
Daniel Sanders [Mon, 29 Apr 2019 18:45:59 +0000 (18:45 +0000)]
[globalisel] Improve Legalizer debug output

* LegalizeAction should be printed by name rather than number
* Newly created instructions are incomplete at the point the observer first sees
  them. They are therefore recorded in a small vector and printed just before
  the legalizer moves on to another instruction. By this point, the instruction
  must be complete.

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

5 years ago[CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5
Don Hinton [Mon, 29 Apr 2019 18:34:18 +0000 (18:34 +0000)]
[CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5

Summary:
Prior to this patch, the CommandLine parser would strip an
unlimitted number of dashes from options.  This patch limits it to
two.

Reviewers: rnk

Reviewed By: rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] scaleShuffleMask - avoid potential signed overflow warning.
Simon Pilgrim [Mon, 29 Apr 2019 18:32:06 +0000 (18:32 +0000)]
[X86] scaleShuffleMask - avoid potential signed overflow warning.

Use size_t assignment to prevent a bad explicit type conversion warning.

Given the typical size of shuffle masks this was never going to happen, but this at least stops the warning.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[TextAPI] Fix Symbol::dump which was failing to append the SymbolKind string.
Simon Pilgrim [Mon, 29 Apr 2019 18:25:04 +0000 (18:25 +0000)]
[TextAPI] Fix Symbol::dump which was failing to append the SymbolKind string.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[llvm-mca][x86] Fix MMX PMOVMSKB test
Simon Pilgrim [Mon, 29 Apr 2019 18:24:30 +0000 (18:24 +0000)]
[llvm-mca][x86] Fix MMX PMOVMSKB test

This is defined as part of SSE1, XMM PMOVMSKB doesn't appear until SSE2

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

5 years ago[DAG] Refactor DAGCombiner::ReassociateOps
Bjorn Pettersson [Mon, 29 Apr 2019 17:50:10 +0000 (17:50 +0000)]
[DAG] Refactor DAGCombiner::ReassociateOps

Summary:
Extract the logic for doing reassociations
from DAGCombiner::reassociateOps into a helper
function DAGCombiner::reassociateOpsCommutative,
and use that helper to trigger reassociation
on the original operand order, or the commuted
operand order.

Codegen is not identical since the operand order will
be different when doing the reassociations for the
commuted case. That causes some unfortunate churn in
some test cases. Apart from that this should be NFC.

Reviewers: spatel, craig.topper, tstellar

Reviewed By: spatel

Subscribers: dmgreen, dschuff, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, hiraditya, aheejin, llvm-commits

Tags: #llvm

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

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

5 years agoFileCheck [3/12]: Stricter parsing of @LINE expressions
Thomas Preud'homme [Mon, 29 Apr 2019 17:46:26 +0000 (17:46 +0000)]
FileCheck [3/12]: Stricter parsing of @LINE expressions

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch gives earlier and better
diagnostics for the @LINE expressions.

Rather than detect parsing errors at matching time, this commit adds
enhance parsing to detect issues with @LINE expressions at parse time
and diagnose them more accurately.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

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

5 years ago[TableGen] Fix null pointer dereferencing.
Simon Pilgrim [Mon, 29 Apr 2019 17:41:27 +0000 (17:41 +0000)]
[TableGen] Fix null pointer dereferencing.

Reported in https://www.viva64.com/en/b/0629/

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

5 years agoAvoid "checking a pointer after dereferencing" warning. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 17:38:18 +0000 (17:38 +0000)]
Avoid "checking a pointer after dereferencing" warning. NFCI.

Reported in https://www.viva64.com/en/b/0629/

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

5 years agoMove if() to newline to stop ambiguity over whether it should be else if. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 17:34:26 +0000 (17:34 +0000)]
Move if() to newline to stop ambiguity over whether it should be else if. NFCI.

Reported in https://www.viva64.com/en/b/0629/

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

5 years agoFix operator precedence warning. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 17:04:14 +0000 (17:04 +0000)]
Fix operator precedence warning. NFCI.

Reported in https://www.viva64.com/en/b/0629/

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

5 years agoRemove superfluous break from switch statement. NFCI.
Simon Pilgrim [Mon, 29 Apr 2019 16:45:35 +0000 (16:45 +0000)]
Remove superfluous break from switch statement. NFCI.

Reported in https://www.viva64.com/en/b/0629/

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

5 years ago[llvm-extract] Expose the group extraction feature of the BlockExtractor
Quentin Colombet [Mon, 29 Apr 2019 16:14:03 +0000 (16:14 +0000)]
[llvm-extract] Expose the group extraction feature of the BlockExtractor

This patch extends the `-bb` option to be able to use the group
extraction feature from the BlockExtractor.
In particular, `-bb=func:bb` is modified to support a list of basic
blocks per function: `-bb=func:bb1[;bb2...]` that will be extracted
together if at all possible (region must be single entry.)

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

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

5 years ago[BlockExtractor] Expose a constructor for the group extraction
Quentin Colombet [Mon, 29 Apr 2019 16:14:02 +0000 (16:14 +0000)]
[BlockExtractor] Expose a constructor for the group extraction

NFC

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

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

5 years ago[BlockExtractor] Change the basic block separator from ',' to ';'
Quentin Colombet [Mon, 29 Apr 2019 16:14:00 +0000 (16:14 +0000)]
[BlockExtractor] Change the basic block separator from ',' to ';'

This change aims at making the file format be compatible with the
way LLVM handles command line options.

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

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

5 years agoAdd AVX support to this test.
Kevin P. Neal [Mon, 29 Apr 2019 16:06:04 +0000 (16:06 +0000)]
Add AVX support to this test.

Requested by Craig Topper and Andrew Kaylor as part of D55897.

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

5 years ago[X86] Remove duplicate string comparison
Simon Pilgrim [Mon, 29 Apr 2019 16:03:35 +0000 (16:03 +0000)]
[X86] Remove duplicate string comparison

Fix typo introduced in rL332824 where we simplified the extact string matches for "avx512.mask.permvar.sf.256" and "avx512.mask.permvar.si.256" to a string startswith test for "avx512.mask.permvar."

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

5 years ago[AArch64][SVE] Asm: add aliases for unpredicated bitwise logical instructions
Cullen Rhodes [Mon, 29 Apr 2019 15:27:27 +0000 (15:27 +0000)]
[AArch64][SVE] Asm: add aliases for unpredicated bitwise logical instructions

This patch adds aliases for element sizes .B/.H/.S to the
AND/ORR/EOR/BIC bitwise logical instructions. The assembler now accepts
these instructions with all element sizes up to 64-bit (.D). The
preferred disassembly is .D.

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

5 years ago[X86][SSE] Add scalar horizontal add/sub tests for non-0/1 element extractions
Simon Pilgrim [Mon, 29 Apr 2019 14:26:27 +0000 (14:26 +0000)]
[X86][SSE] Add scalar horizontal add/sub tests for non-0/1 element extractions

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

5 years agoFileCheck [2/12]: Stricter parsing of -D option
Thomas Preud'homme [Mon, 29 Apr 2019 13:32:36 +0000 (13:32 +0000)]
FileCheck [2/12]: Stricter parsing of -D option

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch gives earlier and better
diagnostics for the -D option.

Prior to this change, parsing of -D option was very loose: it assumed
that there is an equal sign (which to be fair is now checked by the
FileCheck executable) and that the part on the left of the equal sign
was a valid variable name. This commit adds logic to ensure that this
is the case and gives diagnostic when it is not, making it clear that
the issue came from a command-line option error. This is achieved by
sharing the variable parsing code into a new function ParseVariable.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

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

5 years ago[LoopSimplifyCFG] Suppress expensive DomTree verification
Yevgeny Rouban [Mon, 29 Apr 2019 13:29:55 +0000 (13:29 +0000)]
[LoopSimplifyCFG] Suppress expensive DomTree verification

This patch makes verification level lower for builds with
inexpensive checks.

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

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

5 years ago[yaml2obj] - Simplify and reduce the code. NFC.
George Rimar [Mon, 29 Apr 2019 12:25:01 +0000 (12:25 +0000)]
[yaml2obj] - Simplify and reduce the code. NFC.

This inlines 2 single line static methods
and simplifies the code.

It is also possible to remove the `Is64Bit`
variable since it is used only once,
but I am not sure it will be better for readability.

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

5 years ago[yaml2obj] - Replace a loop with write_zeros(). NFCI.
George Rimar [Mon, 29 Apr 2019 12:05:53 +0000 (12:05 +0000)]
[yaml2obj] - Replace a loop with write_zeros(). NFCI.

This looks better.

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

5 years ago[yaml2obj] - Cleanup and simplify the code. NFCI.
George Rimar [Mon, 29 Apr 2019 11:54:10 +0000 (11:54 +0000)]
[yaml2obj] - Cleanup and simplify the code. NFCI.

The current code has the following problems:
`initSymtabSectionHeader` and `initStrtabSectionHeader` method
names saying us they are going to initialize the section headers.
Though for a few cases sh_flags field is initialized outside of them.
It does not look clean. This patch moves initialization of the
sh_flags inside these methods.

Also, it removes an excessive variable, what together with the above
change hopefully makes the code a bit more readable.

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

5 years ago[X86][SSE] Moved haddps test from phaddsub.ll to haddsub.ll (D61245)
Simon Pilgrim [Mon, 29 Apr 2019 11:30:47 +0000 (11:30 +0000)]
[X86][SSE] Moved haddps test from phaddsub.ll to haddsub.ll (D61245)

Also merged duplicate PR39921 + PR39936 tests

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

5 years ago[InstCombine][X86] Add PACKSS tests for truncation of sign-extended comparisons
Simon Pilgrim [Mon, 29 Apr 2019 10:36:20 +0000 (10:36 +0000)]
[InstCombine][X86] Add PACKSS tests for truncation of sign-extended comparisons

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

5 years ago[ARM] Add bitcast/extract_subvec. of fp16 vectors
Diogo N. Sampaio [Mon, 29 Apr 2019 10:28:07 +0000 (10:28 +0000)]
[ARM] Add bitcast/extract_subvec. of fp16 vectors

Summary:
This patch adds some basic operations for fp16
vectors, such as bitcast from fp16 to i16,
required to perform extract_subvector (also added
here) and extract_element.

Reviewers: SjoerdMeijer, DavidSpickett, t.p.northover, ostannard

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

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

5 years ago[ARM] Add v4f16 and v8f16 types to the CallingConv
Diogo N. Sampaio [Mon, 29 Apr 2019 10:10:37 +0000 (10:10 +0000)]
[ARM] Add v4f16 and v8f16 types to the CallingConv

Summary:
The Procedure Call Standard for the Arm Architecture
states that float16x4_t and float16x8_t behave just
as uint16x4_t and uint16x8_t for argument passing.
This patch adds the fp16 vectors to the
ARMCallingConv.td file.

Reviewers: miyuki, ostannard

Reviewed By: ostannard

Subscribers: ostannard, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

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

5 years agovs integration: Use llvm-lib for librarian
Russell Gallop [Mon, 29 Apr 2019 10:10:17 +0000 (10:10 +0000)]
vs integration: Use llvm-lib for librarian

This uses llvm-lib.exe for the librarian instead of Visual Studio
provided lib.exe. Without this it is not possible to create static
libraries with -flto using the plugin.

Original patch by Steven Noonan

This fixes: PR41147

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

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

5 years agogn: Fix check-clang build after r359179
Hans Wennborg [Mon, 29 Apr 2019 09:58:48 +0000 (09:58 +0000)]
gn: Fix check-clang build after r359179

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

5 years agoTry to use /proc on FreeBSD for getExecutablePath
David Chisnall [Mon, 29 Apr 2019 09:24:51 +0000 (09:24 +0000)]
Try to use /proc on FreeBSD for getExecutablePath

Currently, clang's libTooling passes this function a fake argv0, which
means that no libTooling tools can find the standard headers on FreeBSD.
With this change, these will now work on any FreeBSD systems that have
procfs mounted.  This isn't the right fix for the libTooling issue, but
it does bring the FreeBSD implementation of getExecutablePath closer to
the Linux and macOS implementations.

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

5 years ago[DebugInfo] Terminate more location-list ranges at the end of blocks
Jeremy Morse [Mon, 29 Apr 2019 09:13:16 +0000 (09:13 +0000)]
[DebugInfo] Terminate more location-list ranges at the end of blocks

This patch fixes PR40795, where constant-valued variable locations can
"leak" into blocks placed at higher addresses. The root of this is that
DbgEntityHistoryCalculator terminates all register variable locations at
the end of each block, but not constant-value variable locations.

Fixing this requires constant-valued DBG_VALUE instructions to be
broadcast into all blocks where the variable location remains valid, as
documented in the LiveDebugValues section of SourceLevelDebugging.rst,
and correct termination in DbgEntityHistoryCalculator.

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

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

5 years ago[DWARF] Fix dump of local/foreign TU lists in .debug_names
Fangrui Song [Mon, 29 Apr 2019 08:55:10 +0000 (08:55 +0000)]
[DWARF] Fix dump of local/foreign TU lists in .debug_names

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

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

5 years ago[DWARF] Delete a redundant check in getFileNameByIndex()
Fangrui Song [Mon, 29 Apr 2019 08:15:13 +0000 (08:15 +0000)]
[DWARF] Delete a redundant check in getFileNameByIndex()

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

5 years ago[X86] Remove some intel syntax aliases on (v)cvtpd2(u)dq, (v)cvtpd2ps, (v)cvt(u)qq2ps...
Craig Topper [Mon, 29 Apr 2019 06:13:41 +0000 (06:13 +0000)]
[X86] Remove some intel syntax aliases on (v)cvtpd2(u)dq, (v)cvtpd2ps, (v)cvt(u)qq2ps. Add 'x' and'y' suffix aliases to masked version of the same in att syntax.

The 128/256 bit version of these instructions require an 'x' or 'y' suffix to
disambiguate the memory form in att syntax.

We were allowing the same suffix in intel syntax, but it appears gas does not
do that.

gas does allow the 'x' and 'y' suffix on register and broadcast forms even
though its not needed. We were allowing it on unmasked register form, but not on
masked versions or on masked or unmasked broadcast form.

While there fix some test coverage holes so they can be extended with the 'x'
and 'y' suffix tests.

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

5 years ago[llvm-nm] -print-size => --print-size
Fangrui Song [Mon, 29 Apr 2019 06:03:59 +0000 (06:03 +0000)]
[llvm-nm] -print-size => --print-size

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

5 years ago[llvm-nm] Simplify and fix a buffer overflow
Fangrui Song [Mon, 29 Apr 2019 05:38:22 +0000 (05:38 +0000)]
[llvm-nm] Simplify and fix a buffer overflow

* char SymbolAddrStr[18] can't hold "%" PRIo64 which may need 22 characters.
* Use range-based for
* Delete unnecessary typedef
* format(...).print(Str, sizeof(Str)) + outs() << Str => outs() << format(...)
* Use cascading outs() << .. << ..
* Use iterator_range(Container &&c)
* (A & B) == B => A & B   if B is a power of 2
* replace null sentinel in constants with makeArrayRef

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

5 years agollvm-cvtres: Attempt to make llvm-cvtres/duplicate.test work on big-endian systems
Nico Weber [Mon, 29 Apr 2019 00:51:41 +0000 (00:51 +0000)]
llvm-cvtres: Attempt to make llvm-cvtres/duplicate.test work on big-endian systems

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

5 years ago[X86] Add PR39921 HADD pairwise reduction test and AVX2 test coverage
Simon Pilgrim [Sun, 28 Apr 2019 21:04:47 +0000 (21:04 +0000)]
[X86] Add PR39921 HADD pairwise reduction test and AVX2 test coverage

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

5 years ago[X86][AVX] Add fast-hops target for add/fadd reduction tests
Simon Pilgrim [Sun, 28 Apr 2019 20:04:08 +0000 (20:04 +0000)]
[X86][AVX] Add fast-hops target for add/fadd reduction tests

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

5 years ago[X86] Add PR39936 HADD Tests
Simon Pilgrim [Sun, 28 Apr 2019 20:03:11 +0000 (20:03 +0000)]
[X86] Add PR39936 HADD Tests

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

5 years ago[X86][SSE] combineExtractVectorElt - add early-out to return zero/undef for out-of...
Simon Pilgrim [Sun, 28 Apr 2019 19:12:58 +0000 (19:12 +0000)]
[X86][SSE] combineExtractVectorElt - add early-out to return zero/undef for out-of-range extraction indices.

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

5 years ago[ConstantRange] Add makeExactNoWrapRegion()
Nikita Popov [Sun, 28 Apr 2019 15:40:56 +0000 (15:40 +0000)]
[ConstantRange] Add makeExactNoWrapRegion()

I got confused on the terminology, and the change in D60598 was not
correct. I was thinking of "exact" in terms of the result being
non-approximate. However, the relevant distinction here is whether
the result is

 * Largest range such that:
   Forall Y in Other: Forall X in Result: X BinOp Y does not wrap.
   (makeGuaranteedNoWrapRegion)
 * Smallest range such that:
   Forall Y in Other: Forall X not in Result: X BinOp Y wraps.
   (A hypothetical makeAllowedNoWrapRegion)
 * Both. (makeExactNoWrapRegion)

I'm adding a separate makeExactNoWrapRegion method accepting a
single APInt (same as makeExactICmpRegion) and using it in the
places where the guarantee is relevant.

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

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

5 years ago[X86][AVX] Enabled AVX512F tests and add PR40815 test case
Simon Pilgrim [Sun, 28 Apr 2019 15:04:30 +0000 (15:04 +0000)]
[X86][AVX] Enabled AVX512F tests and add PR40815 test case

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