platform/upstream/llvm.git
7 years ago[globalisel] Add support for intrinsic_w_chain.
Daniel Sanders [Tue, 19 Sep 2017 12:56:36 +0000 (12:56 +0000)]
[globalisel] Add support for intrinsic_w_chain.

This maps directly to G_INTRINSIC_W_SIDE_EFFECTS.

llvm-svn: 313627

7 years ago[Nios2] Subtarget, basic infrastructure for frame, instructions and registers
Nikolai Bozhenov [Tue, 19 Sep 2017 11:54:29 +0000 (11:54 +0000)]
[Nios2] Subtarget, basic infrastructure for frame, instructions and registers

This is the second minimal patch keeping Nios2 target buildable.
I'm adding subtarget here and other stuff for frame lowering, instruction,
register information methods. I do not add any test cases, as still there
are missing parts like DAG selector and assembly printing. I plan to include
them into the next patch.

Patch by Andrei Grischenko <andrei.l.grischenko@intel.com>

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

llvm-svn: 313626

7 years ago[x86] Lowering Mask Set1 intrinsics to LLVM IR
Jina Nahias [Tue, 19 Sep 2017 11:03:06 +0000 (11:03 +0000)]
[x86] Lowering Mask Set1 intrinsics to LLVM IR

This patch, together with a matching clang patch (https://reviews.llvm.org/D37668), implements the lowering of X86 mask set1 intrinsics to IR.

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

llvm-svn: 313625

7 years agoLowering Mask Set1 intrinsics to LLVM IR
Jina Nahias [Tue, 19 Sep 2017 11:00:27 +0000 (11:00 +0000)]
Lowering Mask Set1 intrinsics to LLVM IR

This patch, together with a matching llvm patch (https://reviews.llvm.org/D37669), implements the lowering of X86 mask set1 intrinsics to IR.

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

llvm-svn: 313624

7 years ago[GPUJIT] Improved temporary file handling.
Philipp Schaad [Tue, 19 Sep 2017 10:41:29 +0000 (10:41 +0000)]
[GPUJIT] Improved temporary file handling.

Summary: Imporved the way the GPUJIT handles temporary files for Intel's Beignet.

Reviewers: bollu, grosser

Reviewed By: grosser

Subscribers: philip.pfaffe, pollydev

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

llvm-svn: 313623

7 years agoFix formatting of lambda introducers with initializers.
Manuel Klimek [Tue, 19 Sep 2017 09:59:30 +0000 (09:59 +0000)]
Fix formatting of lambda introducers with initializers.

Most of the work was already done when we introduced a look-behind based
lambda introducer detection.

This patch finishes the transition by completely relying on the simple
lambda introducer detection and simply recursing into normal
brace-parsing code to parse until the end of the introducer.

This fixes initializers in lambdas, including nested lambdas.

Before:
  auto a = [b = [c = 42]{}]{};
  auto b = [c = &i + 23]{};

After:
  auto a = [b = [c = 42] {}] {};
  auto b = [c = &i + 23] {};

llvm-svn: 313622

7 years ago[ELF] - Do not merge sections from SHT_GROUP when -relocatable
George Rimar [Tue, 19 Sep 2017 09:40:31 +0000 (09:40 +0000)]
[ELF] - Do not merge sections from SHT_GROUP when -relocatable

This is PR34506.

Imagine we have 2 sections the same name but different COMDAT groups:

.section        .foo,"axG",@progbits,bar,comdat
.section        .foo,"axG",@progbits,zed,comdat
When linking relocatable we do not merge SHT_GROUP sections. But still would merge
both input sections .foo into single output section .foo.
As a result we will have 2 different SHT_GROUPs containing the same section, what
is wrong.

Patch fixes the issue, preventing merging SHF_GROUP sections with any others.

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

llvm-svn: 313621

7 years ago[ELF] - Don't crash when --emit-relocs is used with --gc-sections
George Rimar [Tue, 19 Sep 2017 09:28:03 +0000 (09:28 +0000)]
[ELF] - Don't crash when --emit-relocs is used with --gc-sections

We crashed when --emit-relocs was used
and relocated section was collected by GC.

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

llvm-svn: 313620

7 years ago[ELF] - Introduce std::vector<InputFile *> global arrays.
George Rimar [Tue, 19 Sep 2017 09:20:54 +0000 (09:20 +0000)]
[ELF] - Introduce std::vector<InputFile *> global arrays.

This patch removes lot of static Instances arrays from different input file
classes and introduces global arrays for access instead. Similar to arrays we
have for InputSections/OutputSectionCommands.

It allows to iterate over input files in a non-templated code.

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

llvm-svn: 313619

7 years ago[ARM] Use ADDCARRY / SUBCARRY
Roger Ferrer Ibanez [Tue, 19 Sep 2017 09:05:39 +0000 (09:05 +0000)]
[ARM] Use ADDCARRY / SUBCARRY

This is a preparatory step for D34515.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045
 - fixes PR34564

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

llvm-svn: 313618

7 years agoTest commit.
Andrei Elovikov [Tue, 19 Sep 2017 07:56:20 +0000 (07:56 +0000)]
Test commit.

llvm-svn: 313617

7 years agoAMDGPU: Run internalize symbols at -O0
Matt Arsenault [Tue, 19 Sep 2017 07:40:11 +0000 (07:40 +0000)]
AMDGPU: Run internalize symbols at -O0

The relocations used for externally visible functions
aren't supported, so the direct call emitted ends
up hitting a linker error.

llvm-svn: 313616

7 years ago[ubsan-minimal] Test exported symbol set against RTUBsan
Vedant Kumar [Tue, 19 Sep 2017 06:46:36 +0000 (06:46 +0000)]
[ubsan-minimal] Test exported symbol set against RTUBsan

Check that the symbol sets exported by the minimal runtime and the full
runtime match (making exceptions for special cases as needed).

This test uses some possibly non-standard nm options, and needs to
inspect the symbols in runtime dylibs. I haven't found a portable way to
do this, so it's limited to x86-64/Darwin for now.

llvm-svn: 313615

7 years ago[ubsan-minimal] Make the interface more compatible with RTUBSan
Vedant Kumar [Tue, 19 Sep 2017 06:46:36 +0000 (06:46 +0000)]
[ubsan-minimal] Make the interface more compatible with RTUBSan

This eliminates a few inconsistencies between the symbol sets exported
by RTUBSan and RTUBSan_minimal:

  * Handlers for nonnull_return were missing from the minimal RT, and
    are now added in.

  * The minimal runtime exported recoverable handlers for
    builtin_unreachable and missing_return. These are not supposed to
    exist, and are now removed.

llvm-svn: 313614

7 years ago[X86][Skylake] Adding the scheduling information for the SkylakeClient target
Gadi Haber [Tue, 19 Sep 2017 06:19:27 +0000 (06:19 +0000)]
[X86][Skylake] Adding the scheduling information for the SkylakeClient target

This patch adds the instruction scheduling information for the SkylakeClient (SKL) architecture target by adding the file X86SchedSkylakeClient.td located under the X86 Target.
We used the scheduling information retrieved from the Skylake architects in order to create the file.
The scheduling information includes latency, number of micro-Ops and used ports by each SKL instruction.
The patch continues the scheduling replacement and insertion effort started with the SNB target in r307529 and r310792 and for HSW in r311879.

Please expect some performance fluctuations due to code alignment effects.

Reviewers: craig.topper, zvi, chandlerc, igorb, aymanmus, RKSimon, delena
Differential Revision: https://reviews.llvm.org/D37294

llvm-svn: 313613

7 years ago[X86] Remove some unnecessary patterns for truncate with X86ISD::SELECT and undef...
Craig Topper [Tue, 19 Sep 2017 05:30:24 +0000 (05:30 +0000)]
[X86] Remove some unnecessary patterns for truncate with X86ISD::SELECT and undef preserved source.

We canonicalize undef preserved sources to zero during intrinsic lowering.

llvm-svn: 313612

7 years ago[LLVM] [RegionInfo] Introduce getExitingBlocks to get all predecessors of Exit in...
Hongbin Zheng [Tue, 19 Sep 2017 04:59:27 +0000 (04:59 +0000)]
[LLVM] [RegionInfo] Introduce getExitingBlocks to get all predecessors of Exit in the current region.

This function will return true if all predecessors of Exit are in the current region, false otherwise.

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

llvm-svn: 313611

7 years ago[X86] Add VPERMPD/VPERMQ and VPERMPS/VPERMD to the execution domain fixing table.
Craig Topper [Tue, 19 Sep 2017 04:39:55 +0000 (04:39 +0000)]
[X86] Add VPERMPD/VPERMQ and VPERMPS/VPERMD to the execution domain fixing table.

llvm-svn: 313610

7 years agodocs: Fix formatting in HowToReleaseLLVM
Tom Stellard [Tue, 19 Sep 2017 03:27:26 +0000 (03:27 +0000)]
docs: Fix formatting in HowToReleaseLLVM

This is a follow up to r313608.

llvm-svn: 313609

7 years agodocs: Add instructions for how to submit a merge request
Tom Stellard [Tue, 19 Sep 2017 03:23:03 +0000 (03:23 +0000)]
docs: Add instructions for how to submit a merge request

Reviewers: hansw, hans

Reviewed By: hans

Subscribers: hans, llvm-commits

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

llvm-svn: 313608

7 years agoRevert "Fix llvm-lit script generation in libcxx."
Zachary Turner [Tue, 19 Sep 2017 03:11:35 +0000 (03:11 +0000)]
Revert "Fix llvm-lit script generation in libcxx."

This reverts commit 4ad71811d45268d81b60f27e3b8b2bcbc23bd7b9.

There is a bot that is checking out libcxx and lit with nothing
else and then running lit.py against the test tree.  Since there's
no LLVM source tree, there's no LLVM CMake.  CMake actually
reports this as a warning saying unsupported libcxx configuration,
but I guess someone is depending on it anyway.

llvm-svn: 313607

7 years agoFix llvm-lit script generation in libcxx.
Zachary Turner [Tue, 19 Sep 2017 02:46:28 +0000 (02:46 +0000)]
Fix llvm-lit script generation in libcxx.

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

llvm-svn: 313606

7 years agoAllow public Triple deduction from ObjectFiles.
Vlad Tsyrklevich [Tue, 19 Sep 2017 02:22:48 +0000 (02:22 +0000)]
Allow public Triple deduction from ObjectFiles.

Move logic that allows for Triple deduction from an ObjectFile object
out of llvm-objdump.cpp into a public factory, found in the ObjectFile
class.

This should allow other tools in the future to use this logic without
reimplementation.

Patch by Mitch Phillips

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

llvm-svn: 313605

7 years ago[llvm-cov] Make report metrics agree with line exec counts, fixes PR34615
Vedant Kumar [Tue, 19 Sep 2017 02:00:12 +0000 (02:00 +0000)]
[llvm-cov] Make report metrics agree with line exec counts, fixes PR34615

Use the same logic as the line-oriented coverage view to determine the
number of covered lines in a function.

Fixes llvm.org/PR34615.

llvm-svn: 313604

7 years ago[Coverage] Remove deferred region for trailing return, fixes PR34611
Vedant Kumar [Tue, 19 Sep 2017 00:29:46 +0000 (00:29 +0000)]
[Coverage] Remove deferred region for trailing return, fixes PR34611

As a special case, throw away deferred regions for trailing returns.
This allows the closing curly brace to have a count, and is less
distracting.

llvm-svn: 313603

7 years ago[profile] Update Linux-only tests after r313597
Vedant Kumar [Tue, 19 Sep 2017 00:15:18 +0000 (00:15 +0000)]
[profile] Update Linux-only tests after r313597

Addresses bot failure:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/9803

llvm-svn: 313602

7 years agoSet svn:ignore property on *.pyc.
Zachary Turner [Tue, 19 Sep 2017 00:13:42 +0000 (00:13 +0000)]
Set svn:ignore property on *.pyc.

I think this is what is causing the build to constantly encounter tree conflicts.

llvm-svn: 313601

7 years agoDrop -O1 case from nrvo-string.cpp
Hans Wennborg [Mon, 18 Sep 2017 23:54:43 +0000 (23:54 +0000)]
Drop -O1 case from nrvo-string.cpp

It relied on r313400 which was reverted in r313589.

llvm-svn: 313600

7 years ago[profile] Update InstrProfData.inc
Vedant Kumar [Mon, 18 Sep 2017 23:37:32 +0000 (23:37 +0000)]
[profile] Update InstrProfData.inc

llvm-svn: 313599

7 years ago[Coverage] Use a new API to label gap areas
Vedant Kumar [Mon, 18 Sep 2017 23:37:30 +0000 (23:37 +0000)]
[Coverage] Use a new API to label gap areas

This will make it possible for llvm-cov to pick better line execution
counts, and is part of the fix for llvm.org/PR34612.

llvm-svn: 313598

7 years ago[Coverage] Use gap regions to select better line exec counts
Vedant Kumar [Mon, 18 Sep 2017 23:37:28 +0000 (23:37 +0000)]
[Coverage] Use gap regions to select better line exec counts

After clang started emitting deferred regions (r312818), llvm-cov has
had a hard time picking reasonable line execuction counts. There have
been one or two generic improvements in this area (e.g r310012), but
line counts can still report coverage for whitespace instead of code
(llvm.org/PR34612).

To fix the problem:

 * Introduce a new region kind so that frontends can explicitly label
   gap areas.

   This is done by changing the encoding of the columnEnd field of
   MappingRegion. This doesn't substantially increase binary size, and
   makes it easy to maintain backwards-compatibility.

 * Don't set the line count to a count from a gap area, unless the count
   comes from a wrapped segment.

 * Don't highlight gap areas as uncovered.

Fixes llvm.org/PR34612.

llvm-svn: 313597

7 years ago[llvm-cov] Repair a test. NFC.
Vedant Kumar [Mon, 18 Sep 2017 23:37:27 +0000 (23:37 +0000)]
[llvm-cov] Repair a test. NFC.

The checks with the MARKER prefix were not being run over the right
input, because stderr was not redirected properly.

llvm-svn: 313596

7 years ago[llvm-cov] Simplify code to find the first uncovered segment. NFC.
Vedant Kumar [Mon, 18 Sep 2017 23:37:27 +0000 (23:37 +0000)]
[llvm-cov] Simplify code to find the first uncovered segment. NFC.

Now that that segment builder is guaranteed to produce segments in
sorted order, we don't need a linear scan to get the right result.

llvm-svn: 313595

7 years ago[lit] Use realpath when adding to the config map.
Zachary Turner [Mon, 18 Sep 2017 23:36:35 +0000 (23:36 +0000)]
[lit] Use realpath when adding to the config map.

Since the path a user specifies to the llvm-lit script might be
different than the source tree they built from (since they could
be behind different symlinks), we need to use realpath to make
sure that path comparisons work as expected.

Even better would be to use a custom dictionary comparison with
actual file equivalence comparison semantics, but this is the
least friction to unbreak things for now.

llvm-svn: 313594

7 years agobpf: add inline-asm support
Yonghong Song [Mon, 18 Sep 2017 23:29:36 +0000 (23:29 +0000)]
bpf: add inline-asm support

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 313593

7 years ago[ThinLTO/gold] Implement ThinLTO cache pruning support
Yi Kong [Mon, 18 Sep 2017 23:24:55 +0000 (23:24 +0000)]
[ThinLTO/gold] Implement ThinLTO cache pruning support

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

llvm-svn: 313592

7 years ago[Docs] Document cache pruning support for gold
Yi Kong [Mon, 18 Sep 2017 23:24:01 +0000 (23:24 +0000)]
[Docs] Document cache pruning support for gold

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

llvm-svn: 313591

7 years agoFix inverted regex search.
Zachary Turner [Mon, 18 Sep 2017 23:14:15 +0000 (23:14 +0000)]
Fix inverted regex search.

I was using the pattern as the source string and vice versa
causing strange regular expression errors.

llvm-svn: 313590

7 years agoRevert r313400 "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
Hans Wennborg [Mon, 18 Sep 2017 23:08:42 +0000 (23:08 +0000)]
Revert r313400 "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"

This caused asserts in Chromium. See http://crbug.com/766261

> Summary:
> This comes up in optimized debug info for C++ programs that pass and
> return objects indirectly by address. In these programs,
> llvm.dbg.declare survives optimization, which causes us to emit indirect
> DBG_VALUE instructions. The fast register allocator knows to insert
> DW_OP_deref when spilling indirect DBG_VALUE instructions, but the
> LiveDebugVariables did not until this change.
>
> This fixes part of PR34513. I need to look into why this doesn't work at
> -O0 and I'll send follow up patches to handle that.
>
> Reviewers: aprantl, dblaikie, probinson
>
> Subscribers: qcolombet, hiraditya, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D37911

llvm-svn: 313589

7 years agoRename EhSectionPiece::ID -> EhSectionPiece::Sec.
Rui Ueyama [Mon, 18 Sep 2017 23:07:33 +0000 (23:07 +0000)]
Rename EhSectionPiece::ID -> EhSectionPiece::Sec.

ID sounds like an identifier, but this is actually a pointer to a section.

llvm-svn: 313588

7 years agoDo not use inheritance for EhSectionPiece.
Rui Ueyama [Mon, 18 Sep 2017 23:07:21 +0000 (23:07 +0000)]
Do not use inheritance for EhSectionPiece.

EhSectionPiece inherited from SectionPiece, but we did not actually use
EhSectionPiece objects as SectionPiece ojbects. They were handled as
distinct types. So it didn't make much sense to use inheritance.

llvm-svn: 313587

7 years agoRemove useless accessor.
Rui Ueyama [Mon, 18 Sep 2017 23:07:09 +0000 (23:07 +0000)]
Remove useless accessor.

llvm-svn: 313586

7 years agoRevert "[ubsan] Split ubsan_init_standalone"
Vitaly Buka [Mon, 18 Sep 2017 22:47:36 +0000 (22:47 +0000)]
Revert "[ubsan] Split ubsan_init_standalone"

Breaks build.

This reverts commit r313583 and r313584.

llvm-svn: 313585

7 years ago[ubsan] Add file missing from r313583
Vitaly Buka [Mon, 18 Sep 2017 22:43:28 +0000 (22:43 +0000)]
[ubsan] Add file missing from r313583

llvm-svn: 313584

7 years ago[ubsan] Split ubsan_init_standalone
Vitaly Buka [Mon, 18 Sep 2017 22:38:18 +0000 (22:38 +0000)]
[ubsan] Split ubsan_init_standalone

On Linux we may need preinit_array in static lib and
ubsan_standalone_initializer in shared lib.

llvm-svn: 313583

7 years ago[lit] Fix a Python 3 compatibility issue.
Zachary Turner [Mon, 18 Sep 2017 22:30:45 +0000 (22:30 +0000)]
[lit] Fix a Python 3 compatibility issue.

llvm-svn: 313580

7 years ago[lit] Update clang and lld to use new config helpers.
Zachary Turner [Mon, 18 Sep 2017 22:26:48 +0000 (22:26 +0000)]
[lit] Update clang and lld to use new config helpers.

NFC intended here, this only updates clang and lld's lit configs
to use some helper functionality in the lit.llvm submodule.

llvm-svn: 313579

7 years agoReplace for_each with a range-based for. NFC.
Adrian Prantl [Mon, 18 Sep 2017 22:11:33 +0000 (22:11 +0000)]
Replace for_each with a range-based for. NFC.

llvm-svn: 313578

7 years ago[DAGCombiner] fold assertzexts separated by trunc
Sanjay Patel [Mon, 18 Sep 2017 22:05:35 +0000 (22:05 +0000)]
[DAGCombiner] fold assertzexts separated by trunc

If we have an AssertZext of a truncated value that has already been AssertZext'ed,
we can assert on the wider source op to improve the zext-y knowledge:
 assert (trunc (assert X, i8) to iN), i1 --> trunc (assert X, i1) to iN

This moves a fold from being Mips-specific to general combining, and x86 shows
improvements.

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

llvm-svn: 313577

7 years agoFix failing ASAN test
Eric Fiselier [Mon, 18 Sep 2017 22:01:18 +0000 (22:01 +0000)]
Fix failing ASAN test

llvm-svn: 313576

7 years ago[InstCombine] auto-generate complete checks; NFC
Sanjay Patel [Mon, 18 Sep 2017 21:57:56 +0000 (21:57 +0000)]
[InstCombine] auto-generate complete checks; NFC

The code responsible for these transforms has the potential to add 2
instructions and break min/max patterns (PR33301).

llvm-svn: 313575

7 years ago[cmake] Add a simple function to dump all variables.
Zachary Turner [Mon, 18 Sep 2017 21:52:02 +0000 (21:52 +0000)]
[cmake] Add a simple function to dump all variables.

This is useful when debugging CMake problems.

llvm-svn: 313574

7 years agollvm-dwarfdump: use more efficient API (NFC)
Adrian Prantl [Mon, 18 Sep 2017 21:44:40 +0000 (21:44 +0000)]
llvm-dwarfdump: use more efficient API (NFC)

llvm-svn: 313573

7 years ago[ubsan] Fix conflict with previous declaration on Mac
Vitaly Buka [Mon, 18 Sep 2017 21:35:49 +0000 (21:35 +0000)]
[ubsan] Fix conflict with previous declaration on Mac

llvm-svn: 313572

7 years ago[gcov] Emit errors when opening the notes file fails
Reid Kleckner [Mon, 18 Sep 2017 21:31:48 +0000 (21:31 +0000)]
[gcov] Emit errors when opening the notes file fails

No time to write a test case, on to the next bug. =P

Discovered while investigating PR34659

llvm-svn: 313571

7 years ago[Sema] Fix a pair of crashes when generating exception specifiers with an
Erich Keane [Mon, 18 Sep 2017 21:28:55 +0000 (21:28 +0000)]
[Sema] Fix a pair of crashes when generating exception specifiers with an
error'ed field for a template class' default ctor.

The two examples in the test would both cause a compiler assert when attempting
to calculate the exception specifier for the default constructor for the
template classes. The problem was that dependents of this function expect that
Field->getInClassInitializer (including canThrow) is not nullptr. However, if
the template's initializer has an error, exactly that situation happens.

This patch simply sets the field to be invalid.

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

llvm-svn: 313569

7 years agoFix indentation.
Adrian Prantl [Mon, 18 Sep 2017 21:28:13 +0000 (21:28 +0000)]
Fix indentation.

llvm-svn: 313568

7 years agollvm-dwarfdump: add a --show-parents options when selectively dumping DIEs.
Adrian Prantl [Mon, 18 Sep 2017 21:27:44 +0000 (21:27 +0000)]
llvm-dwarfdump: add a --show-parents options when selectively dumping DIEs.

llvm-svn: 313567

7 years agoFix typo in testcase.
Adrian Prantl [Mon, 18 Sep 2017 21:27:42 +0000 (21:27 +0000)]
Fix typo in testcase.

llvm-svn: 313566

7 years agoAMDGPU: Start selecting s_xnor_{b32, b64}
Konstantin Zhuravlyov [Mon, 18 Sep 2017 21:22:45 +0000 (21:22 +0000)]
AMDGPU: Start selecting s_xnor_{b32, b64}

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

llvm-svn: 313565

7 years ago[DAG, x86] allow store merging before and after legalization (PR34217)
Sanjay Patel [Mon, 18 Sep 2017 20:54:26 +0000 (20:54 +0000)]
[DAG, x86] allow store merging before and after legalization (PR34217)

rL310710 allowed store merging to occur after legalization to catch stores that are created late,
but this exposes a logic hole seen in PR34217:
https://bugs.llvm.org/show_bug.cgi?id=34217

We will miss merging stores if the target lowers vector extracts into target-specific operations.
This patch allows store merging to occur both before and after legalization if the target chooses
to get maximum merging.

I don't think the potential regressions in the other tests are relevant. The tests are for
correctness of weird IR constructs rather than perf tests, and I think those are still correct.

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

llvm-svn: 313564

7 years ago[X86] Make sure we still emit zext for GR32 to GR64 when the source of the zext is...
Craig Topper [Mon, 18 Sep 2017 20:49:13 +0000 (20:49 +0000)]
[X86] Make sure we still emit zext for GR32 to GR64 when the source of the zext is AssertZext

The AssertZext we might see in this case is only giving information about the lower 32 bits. It isn't providing information about the upper 32 bits. So we should emit a zext.

This fixes PR28540.

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

llvm-svn: 313563

7 years ago[libFuzzer] one more trophy
Kostya Serebryany [Mon, 18 Sep 2017 20:48:35 +0000 (20:48 +0000)]
[libFuzzer] one more trophy

llvm-svn: 313562

7 years ago[scudo] Additional modifications for Android tests support
Kostya Kortchinsky [Mon, 18 Sep 2017 20:31:57 +0000 (20:31 +0000)]
[scudo] Additional modifications for Android tests support

Summary:
With the recent move of `android_commands` to `sanitizer_common`, some things
have to be updated with regard to Scudo on Android.

Notably:
- `config.android` is dealt with in the common code
- `config.compile_wrapper` can be prepended to allow for the use of the android
  commands
- `SCUDO_OPTIONS` must be passed with the environment when running a test
- `preinit.cpp` fails with some API levels, not sure why, I will have to dig
  into this later.

Note that `check-scudo` is not enabled yet in the bots. It's all local testing
for now until everything looks good.

Reviewers: alekseyshl, vitalybuka

Reviewed By: vitalybuka

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 313561

7 years agollvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.
Adrian Prantl [Mon, 18 Sep 2017 19:55:00 +0000 (19:55 +0000)]
llvm-dwarfdump: Sink the handling of ShowChildren into DWARFDie::dump(). NFC.

llvm-svn: 313560

7 years ago[SLP] Add a test for PR34635, NFC.
Alexey Bataev [Mon, 18 Sep 2017 19:33:30 +0000 (19:33 +0000)]
[SLP] Add a test for PR34635, NFC.

llvm-svn: 313559

7 years ago[X86] Don't emit COPY_TO_REG to ABCD registers before EXTRACT_SUBREG of sub_8bit
Craig Topper [Mon, 18 Sep 2017 19:21:21 +0000 (19:21 +0000)]
[X86] Don't emit COPY_TO_REG to ABCD registers before EXTRACT_SUBREG of sub_8bit

This is similar to D37843, but for sub_8bit. This fixes all of the patterns except for the 2 that emit only an EXTRACT_SUBREG. That causes a verifier error with global isel because global isel doesn't know to issue the ABCD when doing this extract on 32-bits targets.

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

llvm-svn: 313558

7 years ago[X86] Don't emit COPY_TO_REG to ABCD registers before EXTRACT_SUBREG of sub_8bit_hi
Craig Topper [Mon, 18 Sep 2017 19:21:19 +0000 (19:21 +0000)]
[X86] Don't emit COPY_TO_REG to ABCD registers before EXTRACT_SUBREG of sub_8bit_hi

I'm pretty sure that InstrEmitter::EmitSubregNode will take care of this itself by calling ConstrainForSubReg which in turn calls TRI->getSubClassWithSubReg.

I think Jakob Stoklund Olesen alluded to this in his commit message for r141207 which added the code to EmitSubregNode.

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

llvm-svn: 313557

7 years agoRemove redundant cast<> and null check.
Rui Ueyama [Mon, 18 Sep 2017 19:15:54 +0000 (19:15 +0000)]
Remove redundant cast<> and null check.

"Repl" member is guranteed to have a non-null pointer. If an input
section is not merged by ICF, "Repl" points to "this". Otherwise, it
points to some other section. It must not be NULL.

llvm-svn: 313556

7 years ago[AArch64] Adjust the cost model for Exynos M1 and M2
Evandro Menezes [Mon, 18 Sep 2017 19:00:38 +0000 (19:00 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2

Refine the model of FP loads and stores.

llvm-svn: 313555

7 years ago[AArch64] Adjust the cost model for Exynos M1 and M2
Evandro Menezes [Mon, 18 Sep 2017 19:00:36 +0000 (19:00 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2

Refine the model of loads and stores using the register offset addressing
modes.

llvm-svn: 313554

7 years ago[AArch64] Adjust the cost model for Exynos M1 and M2
Evandro Menezes [Mon, 18 Sep 2017 19:00:31 +0000 (19:00 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2

Fix formatting in the predicate function AArch64InstrInfo::isExynosShiftLeftFast().

llvm-svn: 313553

7 years ago[GlobalISel] Only build expensive remarks if they're enabled. NFC.
Ahmed Bougacha [Mon, 18 Sep 2017 18:50:09 +0000 (18:50 +0000)]
[GlobalISel] Only build expensive remarks if they're enabled. NFC.

r313390 taught 'allowExtraAnalysis' to check whether remarks are
enabled at all.  Use that to only do the expensive instruction printing
if they are.

llvm-svn: 313552

7 years ago[ubsan] Fix interface_symbols_windows test
Vitaly Buka [Mon, 18 Sep 2017 18:46:19 +0000 (18:46 +0000)]
[ubsan] Fix interface_symbols_windows test

Summary:
1. Update ubsan_interface.inc to make the test happy.
2. Switch interface_symbols_linux and interface_symbols_darwin to C++ to import __ubsan_handle_dynamic_type_cache_miss
3. Switch interface_symbols_windows to C++ for consistency.

Reviewers: rnk, zturner

Subscribers: llvm-commits, kubamracek

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

llvm-svn: 313551

7 years ago[ELF] Remove default argument for lambda.
Davide Italiano [Mon, 18 Sep 2017 18:31:49 +0000 (18:31 +0000)]
[ELF] Remove default argument for lambda.

This is not really OK in C++11, and GCc triggers a warning.
We can switch back to default arguments when C++14 will be the
minimum version of the standard supported, see:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#974

Ack'ed by Rafael.

llvm-svn: 313550

7 years ago[cmake] Make it possible to build and test profile without sanitizers
Vedant Kumar [Mon, 18 Sep 2017 18:13:47 +0000 (18:13 +0000)]
[cmake] Make it possible to build and test profile without sanitizers

This should fix an issue which arises when running check-compiler-rt on
the coverage bot:
http://green.lab.llvm.org/green/job/clang-stage2-coverage-R_build/1590/

The bot doesn't build the sanitizers, but the check-compiler-rt target
always expects the profile runtime to exist.

llvm-svn: 313549

7 years ago[x86] add tests for PR34217; NFC
Sanjay Patel [Mon, 18 Sep 2017 18:07:50 +0000 (18:07 +0000)]
[x86] add tests for PR34217; NFC

llvm-svn: 313548

7 years ago[X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.
Simon Pilgrim [Mon, 18 Sep 2017 17:58:31 +0000 (17:58 +0000)]
[X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.

As commented on D37849, AVX1 targets were missing a chance to use vmovmskps for v8f32/v8i32 results for bool vector bitcasts

llvm-svn: 313547

7 years ago[ForwardOpTree] Test the max operations quota.
Michael Kruse [Mon, 18 Sep 2017 17:43:50 +0000 (17:43 +0000)]
[ForwardOpTree] Test the max operations quota.

cl::opt<unsigned long> is not specialized and hence the option
-polly-optree-max-ops impossible to use.

Replace by supported option cl::opt<unsigned>.

Also check for an error state when computing the written value, which
happens when the quota runs out.

llvm-svn: 313546

7 years ago[x86] regenerate checks; NFC
Sanjay Patel [Mon, 18 Sep 2017 17:33:47 +0000 (17:33 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 313545

7 years ago[LoopVectorizer] Add more testcases for PR33804.
Manoj Gupta [Mon, 18 Sep 2017 17:28:15 +0000 (17:28 +0000)]
[LoopVectorizer] Add more testcases for PR33804.

Summary:
Add test cases when float <-> pointer types conversion is triggered
in presence of load instructions.

Reviewers: Ayal, srhines, mkuper, rengolin

Reviewed By: rengolin

Subscribers: javed.absar, llvm-commits

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

llvm-svn: 313544

7 years ago[SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.
Simon Pilgrim [Mon, 18 Sep 2017 16:45:05 +0000 (16:45 +0000)]
[SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.

For cases where we are BITCASTing to vectors of smaller elements, then if the entire source was a splatted sign (src's NumSignBits == SrcBitWidth) we can say that the dst's NumSignBit == DstBitWidth, as we're just splitting those sign bits across multiple elements.

We could generalize this but at the moment the only use case I have is to peek through bitcasts to vector comparison results.

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

llvm-svn: 313543

7 years ago[X86] Fix two more places to prefer VPERMQ/PD over VPERM2X128 when AVX2 is enabled
Craig Topper [Mon, 18 Sep 2017 16:39:49 +0000 (16:39 +0000)]
[X86] Fix two more places to prefer VPERMQ/PD over VPERM2X128 when AVX2 is enabled

The shuffle combining and lowerVectorShuffleAsLanePermuteAndBlend were both still trying to use VPERM2XF128 for unary shuffles when AVX2 is enabled. VPERM2X128 takes two inputs meaning when we use it for a unary shuffle one of those inputs is left undefined creating a false dependency on whatever register gets allocated there.

If we have VPERMQ/PD we should prefer those since they only have a single input.

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

llvm-svn: 313542

7 years ago[SLP] clean up for vector store case; NFCI
Sanjay Patel [Mon, 18 Sep 2017 16:20:15 +0000 (16:20 +0000)]
[SLP] clean up for vector store case; NFCI

llvm-svn: 313541

7 years agoRevert "Fix for bug 34532 - A few rough corners related to post-mortem debugging...
Adrian McCarthy [Mon, 18 Sep 2017 15:59:44 +0000 (15:59 +0000)]
Revert "Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump)"

Broke Windows and FreeBSD (at least).

This reverts commit 628ca7052b4a5dbace0f6205409113e12c8a78fa.

llvm-svn: 313540

7 years agoRevert "Use ThreadLauncher to launch TaskPool threads"
Francis Ricci [Mon, 18 Sep 2017 15:43:59 +0000 (15:43 +0000)]
Revert "Use ThreadLauncher to launch TaskPool threads"

This reverts commit r313537 because it fails to link on linux buildbots

llvm-svn: 313539

7 years ago[scudo] Android build support
Kostya Kortchinsky [Mon, 18 Sep 2017 15:40:53 +0000 (15:40 +0000)]
[scudo] Android build support

Summary:
Mark Android as supported in the cmake configuration for Scudo.

Scudo is not added yet in the Android build bots, but code builds and tests
pass locally. It is for a later CL. I also checked that Scudo builds as part
of the Android toolchain.

A few modifications had to be made:
- Android defaults to `abort_on_error=1`, which doesn't work well with the
  current tests. So change the default way to pass `SCUDO_OPTIONS` to the tests
  to account for this, setting it to 0 by default;
- Disable the `valloc.cpp` & `random_shuffle.cpp` tests on Android;
- There is a bit of gymnatic to be done with the `SCUDO_TEST_TARGET_ARCH`
  string, due to android using the `-android` suffix, and `i686` instead of
  `i386`;
- Android doesn't need `-lrt`.

Reviewers: alekseyshl, eugenis

Reviewed By: alekseyshl

Subscribers: srhines, mgorny, llvm-commits

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

llvm-svn: 313538

7 years agoUse ThreadLauncher to launch TaskPool threads
Francis Ricci [Mon, 18 Sep 2017 15:18:48 +0000 (15:18 +0000)]
Use ThreadLauncher to launch TaskPool threads

Summary:
This allows for the stack size to be configured, which isn't
possible with std::thread. Prevents overflowing the stack when
performing complex operations in the task pool on darwin,
where the default pthread stack size is only 512kb.

Reviewers: labath, tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 313537

7 years ago[clangd] Fix codeAction not decoded properly when sent from some clients
Marc-Andre Laperle [Mon, 18 Sep 2017 15:02:59 +0000 (15:02 +0000)]
[clangd] Fix codeAction not decoded properly when sent from some clients

Summary:
Fix for bug https://bugs.llvm.org/show_bug.cgi?id=34559
Also log unknown fields instead of aborting the JSON parsing because it's
common that new optional fields are added either in new versions of the protocol
or extensions.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ilya-biryukov

Tags: #clang-tools-extra

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

llvm-svn: 313536

7 years ago[AArch64] Add V8_2aOps feature to Cortex-A55 and 75
Sam Parker [Mon, 18 Sep 2017 14:46:14 +0000 (14:46 +0000)]
[AArch64] Add V8_2aOps feature to Cortex-A55 and 75

Add the missing hardware features the ProcA55 and ProcA75 feature.
These are already enabled via the target parser, but I had missed
them in the backend.

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

llvm-svn: 313535

7 years agoAdd myself to CREDITS.txt
Alex Bradbury [Mon, 18 Sep 2017 14:33:39 +0000 (14:33 +0000)]
Add myself to CREDITS.txt

llvm-svn: 313534

7 years ago[ARM] Implement isTruncateFree
Sam Parker [Mon, 18 Sep 2017 14:28:51 +0000 (14:28 +0000)]
[ARM] Implement isTruncateFree

Implement the isTruncateFree hooks, lifted from AArch64, that are
used by TargetTransformInfo. This allows simplifycfg to reduce the
test case into a single basic block.

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

llvm-svn: 313533

7 years ago[X86][SSE] Improve support for vselect(Cond, 0, X) -> ANDN(Cond, X)
Simon Pilgrim [Mon, 18 Sep 2017 14:23:23 +0000 (14:23 +0000)]
[X86][SSE] Improve support for vselect(Cond, 0, X) -> ANDN(Cond, X)

As discussed on PR28925 and D37849.

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

llvm-svn: 313532

7 years ago[ARM] Fix for indexed dot product instruction descriptions
Sjoerd Meijer [Mon, 18 Sep 2017 14:17:57 +0000 (14:17 +0000)]
[ARM] Fix for indexed dot product instruction descriptions

The indexed dot product instructions only accept the lower 16 D-registers as
the indexed register, but we were e.g. incorrectly accepting:

vudot.u8 d16,d16,d18[0]

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

llvm-svn: 313531

7 years ago[dwarfdump] Make .eh_frame an alias for .debug_frame
Jonas Devlieghere [Mon, 18 Sep 2017 14:15:57 +0000 (14:15 +0000)]
[dwarfdump] Make .eh_frame an alias for .debug_frame

This patch makes the `.eh_frame` extension an alias for `.debug_frame`.
Up till now it was only possible to dump the section using objdump, but
not with dwarfdump. Since the two are essentially interchangeable, we
dump whichever of the two is present.

As a workaround, this patch also adds parsing for 3 currently
unimplemented CFA instructions: `DW_CFA_def_cfa_expression`,
`DW_CFA_expression`, and `DW_CFA_val_expression`. Because I lack the
required knowledge, I just parse the fields without actually creating
the instructions.

Finally, this also fixes the typo in the `.debug_frame` section name
which incorrectly contained a trailing `s`.

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

llvm-svn: 313530

7 years ago[X86][SSE] Add vselect with zero tests (PR28925)
Simon Pilgrim [Mon, 18 Sep 2017 13:32:33 +0000 (13:32 +0000)]
[X86][SSE] Add vselect with zero tests (PR28925)

llvm-svn: 313529

7 years ago[X86] combineVSelectWithAllOnesOrZeros - cleanup variable names. NFCI.
Simon Pilgrim [Mon, 18 Sep 2017 12:55:54 +0000 (12:55 +0000)]
[X86] combineVSelectWithAllOnesOrZeros - cleanup variable names. NFCI.

We were reusing the 'false' select value 'is zero' variable name for the 'true' select value 'is zero' variable name.

llvm-svn: 313528

7 years ago[test] Enable -polly-codegen-verify for regression tests.
Michael Kruse [Mon, 18 Sep 2017 12:34:11 +0000 (12:34 +0000)]
[test] Enable -polly-codegen-verify for regression tests.

In r301670 IR verification was disabled. Since then, CodeGen writing
malformed IR would only be noticed by unpredictable behavior in
follow-up passes (e.g. segfaults, infinite loops) or IR verification in
the backend assert builds.

Re-enable -polly-codegen-verify at for the regression tests to ensure
that malformed IR is detected where Polly generated malformed IR in the
past and changes in CodeGen are at least partially covered by
check-polly
(otherwise malformed IR may only get noticed when the buildbots run the
test-suite).

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

llvm-svn: 313527

7 years ago[ForwardOptTree] Remove redundant simplify(). NFC.
Michael Kruse [Mon, 18 Sep 2017 12:28:07 +0000 (12:28 +0000)]
[ForwardOptTree] Remove redundant simplify(). NFC.

The result of computeKnown has already been simplified.

llvm-svn: 313526

7 years agoFix Linux remote debugging after r313442
Tamas Berghammer [Mon, 18 Sep 2017 10:24:48 +0000 (10:24 +0000)]
Fix Linux remote debugging after r313442

On Linux lldb-server sends an OK response to qfThreadInfo if no process
is started yet. I don't know why would LLDB issue a qfThreadInfo packet
before starting a process but creating a fake thread ID in case of an
OK or Error respoinse sounds bad anyway so lets not do it.

llvm-svn: 313525