139421 Commits

Author SHA1 Message Date
Matthias Braun
ddd1430cb0 Fix warning; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 04:32:03 +00:00
Matthias Braun
48d33540b6 MIRParser: generic register operands with types
This should fix the fallout of r283848.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 04:22:29 +00:00
Matthias Braun
8ee2011aa7 MIRParser: Rewrite register info initialization; mostly NFC
This changes MachineRegisterInfo to be initializes after parsing all
instructions. This is in preparation for upcoming commits that allow the
register class specification on the operand or deduce them from the
MCInstrDesc.

This commit removes the unused feature of having nonsequential register
numbers. This was confusing anyway as the vreg numbers would be
different after parsing when you had "holes" in your numbering.

This patch also introduces the concept of an incomplete virtual
register. An incomplete virtual register may be used during .mir parsing
to construct MachineOperands without knowing the exact register class
(or register bank) yet.

NFC except for some error messages.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 03:13:01 +00:00
Kyle Butt
be53d7c9c4 Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

Issue with early tail-duplication of blocks that branch to a fallthrough
predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:20:33 +00:00
Kostya Serebryany
bb0318af25 [libFuzzer] implement value profile for switch, increase the size of the PCs array, make sure we don't overflow it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:14:41 +00:00
Kostya Serebryany
a0151b6ab1 [libFuzzer] add switch tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:13:32 +00:00
Dylan McKay
25d9f1156f [RegAllocGreedy] Attempt to split unspillable live intervals
Summary:
Previously, when allocating unspillable live ranges, we would never
attempt to split. We would always bail out and try last ditch graph
recoloring.

This patch changes this by attempting to split all live intervals before
performing recoloring.

This fixes LLVM bug PR14879.

I can't add test cases for any backends other than AVR because none of
them have small enough register classes to trigger the bug.

Reviewers: qcolombet

Subscribers: MatzeB

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:04:36 +00:00
David Majnemer
365654256b [InstCombine] Transform !range metadata to !nonnull when combining loads
When combining an integer load with !range metadata that does not include 0 to a pointer load, make sure emit !nonnull metadata on the newly-created pointer load. This prevents the !nonnull metadata from being dropped during a ptrtoint/inttoptr pair.

This fixes PR30597.

Patch by Ariel Ben-Yehuda!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:00:45 +00:00
Quentin Colombet
7d96c0b8ac [AArch64][InstructionSelector] Teach how to select FP load/store.
This patch allows to select 32 and 64-bit FP load and store.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 00:21:14 +00:00
Quentin Colombet
082e838555 [AArch64][InstructionSelector] Teach the selector how to handle vector OR.
This only adds the support for 64-bit vector OR. Adding more sizes is
not difficult, but it requires a bigger refactoring because ORs work on
any size, not necessarly the ones that match the width of the register
width. Right now, this is not expressed in the legalization, so don't
bother pushing the refactoring yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 00:21:11 +00:00
Quentin Colombet
589c5da43d [AArch64][MachineLegalizer] Mark v2s32 G_LOAD as legal.
Actually every 64-bit loads are legal, but right now the API does not
offer a simple way to express that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 00:21:08 +00:00
Rui Ueyama
51c08b777e Revert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream.
This reverts commit r283824 and r283823 to fix buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 00:15:50 +00:00
Rui Ueyama
9c78fe67ca Fix a bug in DbiStreamBuilder::addDbgStream.
This feature will be tested in LLD unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:44:04 +00:00
Rui Ueyama
7ca968808b Define DbiStreamBuilder::addDbgStream to add stream.
Previously, there is no way to create a stream other than pre-defined
special stream such as DBI or IPI. This patch adds a new method,
addDbgStream, to add a debug stream to a PDB file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:35:36 +00:00
Chris Matthews
420b9a4e2b Fix issue which cases lit installed with setup.py to not resolve main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:22:11 +00:00
NAKAMURA Takumi
cf0683e0fd Fix llvm-lit.in corresponding to r283710.
Traceback (most recent call last):
    File "bin/llvm-lit", line 44, in <module>
      lit.main(builtin_parameters)
  AttributeError: 'module' object has no attribute 'main'

Suggested by Artem Belevich.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 23:02:42 +00:00
Peter Collingbourne
d735fd7ffe Revert r283690, "MC: Remove unused entities."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:49:37 +00:00
Sanjay Patel
8e372b2022 [x86] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:04:12 +00:00
Sanjay Patel
1a78cfa49c [x86] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 22:01:42 +00:00
Tim Northover
b725b3cddf GlobalISel: select G_GLOBAL_VALUE uses on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:50:00 +00:00
Tim Northover
138850bfa1 GlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:53 +00:00
Tim Northover
f3542eee12 GlobalISel: support selecting G_GEP instructions.
They're basically just an alias for G_ADD on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:49 +00:00
Tim Northover
4344a2817f GlobalISel: support selecting constants on AArch64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:49:42 +00:00
Dehao Chen
d9a6f657d8 Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC)
This is in preparation for https://reviews.llvm.org/D25048


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:47:28 +00:00
Zachary Turner
b260e3ad99 Revert "Disallow ArrayRef assignment from temporaries."
This reverts commit r283798, as it causes static asserts on
MSVC 2015 with the following errors:

ArrayRefTest.cpp(38): error C2338: Assigning from single prvalue element
ArrayRefTest.cpp(41): error C2338: Assigning from single xvalue element
ArrayRefTest.cpp(47): error C2338: Assigning from an initializer list

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:36:23 +00:00
Zachary Turner
1793ab4506 Rename llvm::apply -> llvm::apply_tuple.
llvm::cl already has a function called llvm::apply() so this is
causing an ODR violation.  The STLExtras version should win the
vote on which one gets to be called apply() since it is named
after the equivalent STL function, but since renaiming the cl
version is more difficult, let's do this for now to get the
bots green.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 21:24:34 +00:00
Jordan Rose
31b90a7187 Disallow ArrayRef assignment from temporaries.
Without this, the following statements will create ArrayRefs that
refer to temporary storage that goes out of scope by the end of the
line:

  someArrayRef = getSingleElement();
  someArrayRef = {elem1, elem2};

Note that the constructor still has this problem:

  ArrayRef<Element> someArrayRef = getSingleElement();
  ArrayRef<Element> someArrayRef = {elem1, elem2};

but that's a little harder to get rid of because we want to be able to
use this in calls:

  takesArrayRef(getSingleElement());
  takesArrayRef({elem1, elem2});

Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 20:57:33 +00:00
Hal Finkel
779825d20e [SelectionDAGBuilder] Support llvm.flt.rounds on targets where i32 is not legal
Add integer expansion for FLT_ROUNDS_ for targets where i32 is not a legal
type.

Patch by Edward Jones, thanks!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 20:45:15 +00:00
Justin Lebar
5556ebb365 [ADT] Use () instead of {} in an attempt to work around MSVC 2012 ICEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 20:18:02 +00:00
Justin Lebar
58ae36f407 [ADT] Don't use make_pointee_iterator in IteratorTest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 19:56:52 +00:00
Mehdi Amini
15796d29d8 Use StringRef in TableGen generated Intrinsics.gen file (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 19:31:09 +00:00
Justin Lebar
ec2f01d444 [ADT] Remove make_pointe{e,r}_iterator, because it seems to crash MSVC 2015.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 19:29:37 +00:00
Adrian Prantl
4970f010ca Teach llvm::StripDebugInfo() about global variable !dbg attachments.
This is a regression introduced by the global variable ownership
reversal performed in r281284.

rdar://problem/28448075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 17:53:33 +00:00
Justin Lebar
f52f4a488f [ADT] Attempt to fix MSVC 2015 ICE via judicious addition of std::decay to make_pointe{r,e}_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 17:18:45 +00:00
Mehdi Amini
c02fe89250 Update documentation after r283671 ("Turn cl::values() (for enum) from a vararg function to using C++ variadic template")
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 17:13:14 +00:00
Zachary Turner
bd90bcccca Add llvm::apply to STLExtras.
This is equivalent to the C++14 std::apply().  Since we are not
using C++14 yet, this allows us to still make use of apply anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:44:09 +00:00
Justin Lebar
a2e3c5a457 Use unique_ptr in LLVMContextImpl's constant maps.
Reviewers: timshen

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:26:13 +00:00
Justin Lebar
a5afae3a31 [ADT] Add make_pointe{e,r}_iterator.
Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:26:03 +00:00
Justin Lebar
f086ef8c8b [ADT] Let MapVector handle non-copyable values.
Summary: The keys must still be copyable, because we store two copies of them.

Reviewers: timshen

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:25:59 +00:00
Alexandros Lamprineas
e587b6cff8 [ARM] Fix invalid VLDM/VSTM access when targeting Big Endian with NEON
The instructions VLDM/VSTM can only access word-aligned memory
locations and produce alignment fault if the condition is not met.

The compiler currently generates VLDM/VSTM for v2f64 load/store
regardless the alignment of the memory access. Instead, if a v2f64
load/store is not word-aligned, the compiler should generate
VLD1/VST1. For each non double-word-aligned VLD1/VST1, a VREV
instruction should be generated when targeting Big Endian.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 16:01:54 +00:00
Nirav Dave
86a17fdcc1 Add return type for checkForValidSection parsing function. NFC Intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 15:24:54 +00:00
Zvi Rackover
bca70faf12 [X86] Prefer rotate by 1 over rotate by imm
Summary:
Rotate by 1 is translated to 1 micro-op, while rotate with imm8 is translated to 2 micro-ops.

Fixes pr30644.

Reviewers: delena, igorb, craig.topper, spatel, RKSimon

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:43:55 +00:00
Simon Pilgrim
5ba17d7d92 [SLPVectorizer][X86] Add 512-bit sitofp/uitofp tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:28:06 +00:00
Simon Pilgrim
be507f5389 [SLPVectorizer][X86] Add avx512 sitofp/uitofp tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:14:31 +00:00
Simon Pilgrim
155a6ef6c7 [SLPVectorizer][X86] Fixed alignments of scalar loads in sitofp/uitofp tests
Fixed copy+paste vector alignment to correct for per-element scalar loads

Increased to 512-bit data sizes in preparation of avx512 tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283748 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 14:10:41 +00:00
Simon Pilgrim
5d0ca9b5b0 Fixed windows stdout/stderr redirection in inline asm constraint tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 11:11:27 +00:00
George Rimar
a281f4e2f6 [Object/ELF] - Do not crash on invalid Header->e_shoff value.
sections_begin() may return unalignment pointer when Header->e_shoff isinvalid.
That may result in a crash in clients, for example we have one in LLD:

assert((PtrWord & ~PointerBitMask) == 0 &&
       "Pointer is not sufficiently aligned");
fails when trying to push_back Elf_Shdr* (unaligned) into TinyPtrVector.

Patch forces check for alignment of Header->e_shoff.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 10:51:38 +00:00
Chris Dewhurst
2bf22e30a5 This pass, fixing an erratum in some LEON 2 processors ensures that the SDIV instruction is not issued, but replaced by SDIVcc instead, which does not exhibit the error. Unit test included.
Differential Review: https://reviews.llvm.org/D24660

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 08:53:06 +00:00
Daniel Jasper
a56b5b5487 Fix WebAssembly build after r283702.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283723 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:49:55 +00:00
Craig Topper
a9268c4935 [AVX-512] Add missing pattern sext or zext from bytes to quad words with a 128-bit load as input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283720 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-10 06:25:48 +00:00