]> granicus.if.org Git - llvm/log
llvm
8 years agoAdd interface to compute number of physical cores on host system
Teresa Johnson [Thu, 13 Oct 2016 17:43:20 +0000 (17:43 +0000)]
Add interface to compute number of physical cores on host system

Summary:
For now I have only added support for x86_64 Linux, but other systems
can be added incrementally.

This is to be used for setting the default parallelism for ThinLTO
backends (instead of thread::hardware_concurrency which includes
hyperthreading and is too aggressive). I'll send this as a follow-on
patch, and it will fall back to hardware_concurrency when the new
getHostNumPhysicalCores returns -1 (when not supported for a given
host system).

I also added an interface to MemoryBuffer to force reading a file
as a stream - this is required for /proc/cpuinfo which is a special
file that looks like a normal file but appears to have 0 size.
The existing readers of this file in Host.cpp are reading the first
1024 or so bytes from it, because the necessary info is near the top.
But for the new functionality we need to be able to read the entire
file. I can go back and change the other readers to use the new
getFileAsStream as a follow-on patch since it seems much more robust.

Added a unittest.

Reviewers: mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

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

8 years agoTruncate long names in type records
Reid Kleckner [Thu, 13 Oct 2016 17:33:22 +0000 (17:33 +0000)]
Truncate long names in type records

In the MS ABI, the frontend is supposed to MD5 such pathologically long
names. LLVM should still defend itself from long names, though.

Fixes part of PR29098.

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

8 years ago[unittests] Remove a redundant test fixture (NFC)
Vedant Kumar [Thu, 13 Oct 2016 17:22:44 +0000 (17:22 +0000)]
[unittests] Remove a redundant test fixture (NFC)

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

8 years ago[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Igor Breger [Thu, 13 Oct 2016 17:20:38 +0000 (17:20 +0000)]
[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Fix PR30600.

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

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

8 years ago[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix...
Kostya Serebryany [Thu, 13 Oct 2016 16:19:09 +0000 (16:19 +0000)]
[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix for gcc build

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

8 years agoFix for PR30687. Avoid dereferencing MBB.end().
Reid Kleckner [Thu, 13 Oct 2016 15:48:48 +0000 (15:48 +0000)]
Fix for PR30687. Avoid dereferencing MBB.end().

We don't need to return a MachineInstr* from these stack probe insertion
calls anyway. If we ever need to add it back, we can return an iterator
instead.

Based on a patch by David Kreitzer

This bug is a consequence of

r279314 | dexonsmith | 2016-08-19 13:40:12 -0700 (Fri, 19 Aug 2016) | 110 lines

We hit the "Assertion `!NodePtr->isKnownSentinel()' failed" assertion,
but only when inserting a stack probe call at the end of an MBB, which
isn't necessarily a common situation.

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

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

8 years agoDo not delete leading ../ in remove_dots.
Eric Liu [Thu, 13 Oct 2016 15:07:14 +0000 (15:07 +0000)]
Do not delete leading ../ in remove_dots.

Reviewers: bkramer

Subscribers: llvm-commits

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

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

8 years ago[ARM]: Assign cost of scaling used in addressing mode for ARM cores
Javed Absar [Thu, 13 Oct 2016 14:57:43 +0000 (14:57 +0000)]
[ARM]: Assign cost of scaling used in addressing mode for ARM cores

This patch assigns cost of the scaling used in addressing.
On many ARM cores, a negated register offset takes longer than a
non-negated register offset, in a register-offset addressing mode.

For instance:

LDR R0, [R1, R2 LSL #2]
LDR R0, [R1, -R2 LSL #2]

Above, (1) takes less cycles than (2).

By assigning appropriate scaling factor cost, we enable the LLVM
to make the right trade-offs in the optimization and code-selection phase.

Differential Revision: http://reviews.llvm.org/D24857

Reviewers: jmolloy, rengolin

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

8 years ago[LV] Account for predicated stores in instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:54:31 +0000 (14:54 +0000)]
[LV] Account for predicated stores in instruction costs

This patch ensures that we scale the estimated cost of predicated stores by
block probability. This is a follow-on patch for r284123.

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

8 years ago[x86] add negate-i1 run for 32-bit target
Sanjay Patel [Thu, 13 Oct 2016 14:27:08 +0000 (14:27 +0000)]
[x86] add negate-i1 run for 32-bit target

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

8 years ago[LV] Avoid rounding errors for predicated instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:19:48 +0000 (14:19 +0000)]
[LV] Avoid rounding errors for predicated instruction costs

This patch modifies the cost calculation of predicated instructions (div and
rem) to avoid the accumulation of rounding errors due to multiple truncating
integer divisions. The calculation for predicated stores will be addressed in a
follow-on patch since we currently don't scale the cost of predicated stores by
block probability.

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

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

8 years ago[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style...
Simon Pilgrim [Thu, 13 Oct 2016 14:04:35 +0000 (14:04 +0000)]
[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style combines

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

8 years agoAMDGPU: Assume spilling will occur at -O0
Matt Arsenault [Thu, 13 Oct 2016 13:10:00 +0000 (13:10 +0000)]
AMDGPU: Assume spilling will occur at -O0

Because everything live is spilled at the end of a
block by fast regalloc, assume this will happen and
avoid the copies of the resource descriptor.

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

8 years agoCopy+pasts typo in comment describing combine test
Simon Pilgrim [Thu, 13 Oct 2016 12:54:32 +0000 (12:54 +0000)]
Copy+pasts typo in comment describing combine test

Repeated the "fold (mul x, 0) -> 0" instead of "fold (mul x, 1) -> x"

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

8 years ago[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding
Simon Pilgrim [Thu, 13 Oct 2016 12:49:31 +0000 (12:49 +0000)]
[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding

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

8 years agoAMDGPU: Fix truncate to bool warnings
Matt Arsenault [Thu, 13 Oct 2016 12:45:16 +0000 (12:45 +0000)]
AMDGPU: Fix truncate to bool warnings

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

8 years ago[mips] Add IAS support for dvp, evp
Simon Dardis [Thu, 13 Oct 2016 12:12:56 +0000 (12:12 +0000)]
[mips] Add IAS support for dvp, evp

These instructions were only defined for microMIPSR6 previously. Add
definitions for MIPSR6, correct definitions for microMIPSR6, flag these
instructions as having unmodelled side effects (they disable/enable
virtual processors) and add missing disassember tests for microMIPSR6.

Reviewers: vkalintiris

Differential Review: https://reviews.llvm.org/D24291

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

8 years ago[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization
Simon Pilgrim [Thu, 13 Oct 2016 12:05:20 +0000 (12:05 +0000)]
[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization

Improves commutation potential

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

8 years ago[X86] Basic additions to support RegCall Calling Convention.
Oren Ben Simhon [Thu, 13 Oct 2016 07:53:43 +0000 (07:53 +0000)]
[X86] Basic additions to support RegCall Calling Convention.

The Register Calling Convention (RegCall) was introduced by Intel to optimize parameter transfer on function call.
This calling convention ensures that as many values as possible are passed or returned in registers.
This commit presents the basic additions to LLVM CodeGen in order to support RegCall in X86.

Differential Revision: http://reviews.llvm.org/D25022

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

8 years agoSilence unused warning in non-assert builds.
Daniel Jasper [Thu, 13 Oct 2016 06:39:44 +0000 (06:39 +0000)]
Silence unused warning in non-assert builds.

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

8 years ago[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.
Craig Topper [Thu, 13 Oct 2016 05:41:01 +0000 (05:41 +0000)]
[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.

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

8 years ago[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.
Craig Topper [Thu, 13 Oct 2016 05:29:41 +0000 (05:29 +0000)]
[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.

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

8 years ago[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will...
Craig Topper [Thu, 13 Oct 2016 05:29:37 +0000 (05:29 +0000)]
[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will be improved in a future commit.

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

8 years agoRemove a FIXME that I forgot about. NFC.
Diana Picus [Thu, 13 Oct 2016 05:28:55 +0000 (05:28 +0000)]
Remove a FIXME that I forgot about. NFC.

Sorry about the noise.

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

8 years ago[X86] Simplify the lowering code for extracting and inserting subvectors.
Craig Topper [Thu, 13 Oct 2016 04:14:47 +0000 (04:14 +0000)]
[X86] Simplify the lowering code for extracting and inserting subvectors.

We don't need to check if AVX is enabled. It's implied by the operation action being set to Custom.
We don't need to check both the input and output type widths. We only need to check the type that's being inserted or extracted. The other type is known to be a legal type and we can assume its a different width.

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

8 years agoMemory-SSA: strengthen defClobbersUseOrDef interface
Sebastian Pop [Thu, 13 Oct 2016 03:23:33 +0000 (03:23 +0000)]
Memory-SSA: strengthen defClobbersUseOrDef interface

As Danny pointed out, defClobbersUseOrDef should use MemoryLocOrCall to make
sure fences are properly handled.

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

8 years agocommit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Sebastian Pop [Thu, 13 Oct 2016 01:39:10 +0000 (01:39 +0000)]
commit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This is with an extra change to avoid calling MemoryLocation::get() on a call instruction.

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

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

8 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load
Quentin Colombet [Thu, 13 Oct 2016 01:01:23 +0000 (01:01 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load

This allows RegBankSelect in greedy mode to get rid some of the cross
register bank copies when loads are involved in the chain of
computation.

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

8 years agoCorrect PrivateLinkage for COFF
Reid Kleckner [Thu, 13 Oct 2016 00:55:24 +0000 (00:55 +0000)]
Correct PrivateLinkage for COFF

- Use storage class C_STAT for 'PrivateLinkage' The storage class for
  PrivateLinkage should equal to the Internal Linkage.

- Set 'PrivateGlobalPrefix' from "L" to ".L" for MM_WinCOFF (includes
  x86_64) MM_WinCOFF has empty GlobalPrefix '\0' so PrivateGlobalPrefix
  "L" may conflict to the normal symbol name starting with 'L'.

Based on a patch by Han Sangjin! Manually updated test cases.

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

8 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.
Quentin Colombet [Thu, 13 Oct 2016 00:34:48 +0000 (00:34 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.

Thanks to this patch, RegBankSelect is able to get rid of some register
bank copies as demonstrated in the test case.

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

8 years agoRevert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Reid Kleckner [Thu, 13 Oct 2016 00:18:26 +0000 (00:18 +0000)]
Revert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This CL didn't actually address the test case in PR30499, and clang
still crashes.

Also revert dependent change "Memory-SSA cleanup of clobbers interface, NFC"

Reverts r283965 and r283967.

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

8 years ago[AArch64][RegisterBankInfo] Describe cross regbank copies statically.
Quentin Colombet [Thu, 13 Oct 2016 00:12:06 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Describe cross regbank copies statically.

NFC.

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

8 years ago[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.
Quentin Colombet [Thu, 13 Oct 2016 00:12:04 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.

NFC.

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

8 years ago[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.
Quentin Colombet [Thu, 13 Oct 2016 00:12:01 +0000 (00:12 +0000)]
[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.

Basically any vector types that fits in a 32-bit register is also valid
as far as copies are concerned.

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

8 years ago[AArch64][RegisterBankInfo] Bump the cost of vector loads.
Quentin Colombet [Thu, 13 Oct 2016 00:11:59 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Bump the cost of vector loads.

This does not change anything yet, because we do not offer any
alternative mapping.

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

8 years ago[AArch64][RegisterBankInfo] Use a proper cost for cross regbank G_BITCASTs.
Quentin Colombet [Thu, 13 Oct 2016 00:11:57 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Use a proper cost for cross regbank G_BITCASTs.

This does not change anything yet, because we do not offer any
alternative mapping.

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

8 years ago[AArch64][RegisterBankInfo] Provide more realistic copy costs.
Quentin Colombet [Thu, 13 Oct 2016 00:11:55 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Provide more realistic copy costs.

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

8 years agofix function label name in addressofreturnaddress test
Albert Gutowski [Wed, 12 Oct 2016 23:58:45 +0000 (23:58 +0000)]
fix function label name in addressofreturnaddress test

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

8 years ago[GitHubMove Doc] Properly nest a subsection in the proposal
Mehdi Amini [Wed, 12 Oct 2016 23:36:11 +0000 (23:36 +0000)]
[GitHubMove Doc] Properly nest a subsection in the proposal

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

8 years agofix title underline length
Albert Gutowski [Wed, 12 Oct 2016 23:10:02 +0000 (23:10 +0000)]
fix title underline length

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

8 years agoMoving to GitHub - Unified Proposal
Mehdi Amini [Wed, 12 Oct 2016 23:02:02 +0000 (23:02 +0000)]
Moving to GitHub - Unified Proposal

This document describes the proposal to move to GitHub, and
compare the two proposals through various workflow examples,
presenting the current set of commands following by the ones
involved in each of the two proposals.

It is intended to supersede the previous "submodule proposal"
document entirely, and drive the discussion at the BoF during
the next Dev Meeting.

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

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

8 years agoHandle lane masks in LivePhysRegs when adding live-ins
Krzysztof Parzyszek [Wed, 12 Oct 2016 22:53:41 +0000 (22:53 +0000)]
Handle lane masks in LivePhysRegs when adding live-ins

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

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

8 years agoGlobalISel: support G_TRUNC selection on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:15 +0000 (22:49 +0000)]
GlobalISel: support G_TRUNC selection on AArch64.

Ahmed's patch again.

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

8 years agoGlobalISel: support int <-> float conversions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:11 +0000 (22:49 +0000)]
GlobalISel: support int <-> float conversions on AArch64.

More of Ahmed's work.

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

8 years agoGlobalISel: select G_FCMP instructions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:07 +0000 (22:49 +0000)]
GlobalISel: select G_FCMP instructions on AArch64.

Another of Ahmed's patches.

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

8 years agoGlobalISel: support selection of G_ICMP on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:04 +0000 (22:49 +0000)]
GlobalISel: support selection of G_ICMP on AArch64.

Patch from Ahmed Bougaca again.

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

8 years agoGlobalISel: select G_BRCOND instructions on AArch64.
Tim Northover [Wed, 12 Oct 2016 22:49:01 +0000 (22:49 +0000)]
GlobalISel: select G_BRCOND instructions on AArch64.

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

8 years agoGlobalISel: mark G_BRCOND on s1 as legal.
Tim Northover [Wed, 12 Oct 2016 22:48:36 +0000 (22:48 +0000)]
GlobalISel: mark G_BRCOND on s1 as legal.

It's going to be a TBNZ (at -O0) anyway, so the high bits don't matter.

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

8 years ago[unittests] Delete even more copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:44:50 +0000 (22:44 +0000)]
[unittests] Delete even more copy constructors (NFC)

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

8 years ago[unittests] Delete some copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:54 +0000 (22:27 +0000)]
[unittests] Delete some copy constructors (NFC)

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

8 years ago[unittest] Pass a reference instead of making a copy (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:52 +0000 (22:27 +0000)]
[unittest] Pass a reference instead of making a copy (NFC)

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

8 years ago[Coverage] Delete some copy constructors (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:49 +0000 (22:27 +0000)]
[Coverage] Delete some copy constructors (NFC)

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

8 years ago[Coverage] Factor out logic to create FunctionRecords (NFC)
Vedant Kumar [Wed, 12 Oct 2016 22:27:45 +0000 (22:27 +0000)]
[Coverage] Factor out logic to create FunctionRecords (NFC)

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

8 years agoCreate llvm.addressofreturnaddress intrinsic
Albert Gutowski [Wed, 12 Oct 2016 22:13:19 +0000 (22:13 +0000)]
Create llvm.addressofreturnaddress intrinsic

Summary: We need a new LLVM intrinsic to implement MS _AddressOfReturnAddress builtin on 64-bit Windows.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

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

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

8 years agoUpdate _MSC_VER equality checks for msdiaNNN.dll
Reid Kleckner [Wed, 12 Oct 2016 21:51:14 +0000 (21:51 +0000)]
Update _MSC_VER equality checks for msdiaNNN.dll

Use inequality instead of equality to defend against minor version
increases in _MSC_VER. An _MSC_VER value of 1901 should still use
msdia140.dll, as described in this blog post:
https://blogs.msdn.microsoft.com/vcblog/2016/10/05/visual-c-compiler-version/

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

8 years ago[lit] Fix test shtest-timeout.py for modern output
Michal Gorny [Wed, 12 Oct 2016 21:40:08 +0000 (21:40 +0000)]
[lit] Fix test shtest-timeout.py for modern output

Update the CHECK lines in the shtest-timeout.py lit test to account for
the current output. The output has been changed in r271610 without
adjusting the tests.

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

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

8 years ago[lit] Fix FormatError on individual test timeout
Michal Gorny [Wed, 12 Oct 2016 21:40:04 +0000 (21:40 +0000)]
[lit] Fix FormatError on individual test timeout

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

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

8 years agoReapply "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll...
Haicheng Wu [Wed, 12 Oct 2016 21:29:38 +0000 (21:29 +0000)]
Reapply "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop"

Reappy r284044 after revert in r284051. Krzysztof fixed the error in r284049.

The original summary:

This patch tries to fully unroll loops having break statement like this

for (int i = 0; i < 8; i++) {
    if (a[i] == value) {
        found = true;
        break;
    }
}

GCC can fully unroll such loops, but currently LLVM cannot because LLVM only
supports loops having exact constant trip counts.

The upper bound of the trip count can be obtained from calling
ScalarEvolution::getMaxBackedgeTakenCount(). Part of the patch is the
refactoring work in SCEV to prevent duplicating code.

The feature of using the upper bound is enabled under the same circumstance
when runtime unrolling is enabled since both are used to unroll loops without
knowing the exact constant trip count.

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

8 years ago[MIRParser] Parse lane masks for register live-ins
Krzysztof Parzyszek [Wed, 12 Oct 2016 21:06:45 +0000 (21:06 +0000)]
[MIRParser] Parse lane masks for register live-ins

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

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

8 years agoRevert "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll...
Haicheng Wu [Wed, 12 Oct 2016 21:02:22 +0000 (21:02 +0000)]
Revert "[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop"

This reverts commit r284044.

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

8 years agoFix testcases failing after r284036
Krzysztof Parzyszek [Wed, 12 Oct 2016 20:39:33 +0000 (20:39 +0000)]
Fix testcases failing after r284036

The codegen has changed slightly between my tests and the commit.

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

8 years ago[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop
Haicheng Wu [Wed, 12 Oct 2016 20:24:32 +0000 (20:24 +0000)]
[LoopUnroll] Use the upper bound of the loop trip count to fullly unroll a loop

This patch tries to fully unroll loops having break statement like this

for (int i = 0; i < 8; i++) {
    if (a[i] == value) {
        found = true;
        break;
    }
}

GCC can fully unroll such loops, but currently LLVM cannot because LLVM only
supports loops having exact constant trip counts.

The upper bound of the trip count can be obtained from calling
ScalarEvolution::getMaxBackedgeTakenCount(). Part of the patch is the
refactoring work in SCEV to prevent duplicating code.

The feature of using the upper bound is enabled under the same circumstance
when runtime unrolling is enabled since both are used to unroll loops without
knowing the exact constant trip count.

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

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

8 years agoLTO: Use the correct mangler function in LTOCodeGenerator::applyScopeRestrictions().
Peter Collingbourne [Wed, 12 Oct 2016 20:12:19 +0000 (20:12 +0000)]
LTO: Use the correct mangler function in LTOCodeGenerator::applyScopeRestrictions().

We need to use the overload of Mangler::getNameWithPrefix that takes a
GlobalValue in order to mangle in the stdcall stack byte count for Windows
targets.

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

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

8 years ago[ThinLTO] Fix bot failure due to unused variable with NDEBUG
Teresa Johnson [Wed, 12 Oct 2016 20:06:02 +0000 (20:06 +0000)]
[ThinLTO] Fix bot failure due to unused variable with NDEBUG

Put variable only used in assert under #ifndef NDEBUG.

This should fix bot failure at
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/28537

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

8 years agoRevert "[ADT] Zip range adapter"
Mehdi Amini [Wed, 12 Oct 2016 19:54:08 +0000 (19:54 +0000)]
Revert "[ADT] Zip range adapter"

This reverts commit r284035, which breaks with MSVC 2013.

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

8 years agoDo not remove implicit defs in BranchFolder
Krzysztof Parzyszek [Wed, 12 Oct 2016 19:50:57 +0000 (19:50 +0000)]
Do not remove implicit defs in BranchFolder

Branch folder removes implicit defs if they are the only non-branching
instructions in a block, and the branches do not use the defined registers.
The problem is that in some cases these implicit defs are required for
the liveness information to be correct.

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

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

8 years ago[ADT] Zip range adapter
Mehdi Amini [Wed, 12 Oct 2016 19:43:02 +0000 (19:43 +0000)]
[ADT] Zip range adapter

This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first krange.

Patch by: Bryant Wong <github.com/bryant>

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

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

8 years agoAMDGPU: Initial implementation of VGPR indexing mode
Matt Arsenault [Wed, 12 Oct 2016 18:49:05 +0000 (18:49 +0000)]
AMDGPU: Initial implementation of VGPR indexing mode

This is the most basic handling of the indirect access
pseudos using GPR indexing mode. This currently only enables
the mode for a single v_mov_b32 and then disables it.
This is much more complicated to use than the movrel instructions,
so a new optimization pass is probably needed to fold the access
into the uses and keep the mode enabled for them.

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

8 years ago[ThinLTO] Don't link module level assembly when importing
Teresa Johnson [Wed, 12 Oct 2016 18:39:29 +0000 (18:39 +0000)]
[ThinLTO] Don't link module level assembly when importing

Module inline asm was always being linked/concatenated
when running the IRLinker. This is correct for full LTO but not when
we are importing for ThinLTO, as it can result in multiply defined
symbols when the module asm defines a global symbol.

In order to test with llvm-lto2, I had to work around PR30396,
where a symbol that is defined in module assembly but defined in the
LLVM IR appears twice. Added workaround to llvm-lto2 with a FIXME.

Fixes PR30610.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

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

8 years ago[SimplifyCFG] Don't create PHI nodes for constant bundle operands
Sanjoy Das [Wed, 12 Oct 2016 18:15:33 +0000 (18:15 +0000)]
[SimplifyCFG] Don't create PHI nodes for constant bundle operands

Summary:
Constant bundle operands may need to retain their constant-ness for
correctness.  I'll admit that this is slightly odd, but it looks like
SimplifyCFG already does this for things like @llvm.frameaddress and
@llvm.stackmap, so I suppose adding one more case is not a big deal.

It is possible to add a mechanism to denote bundle operands that need to
remain constants, but that's probably too complicated for the time
being.

Reviewers: jmolloy

Subscribers: mcrosier, llvm-commits

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

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

8 years agoAMDGPU: Add instruction definitions for VGPR indexing
Matt Arsenault [Wed, 12 Oct 2016 18:00:51 +0000 (18:00 +0000)]
AMDGPU: Add instruction definitions for VGPR indexing

VI added a second method of indexing into VGPRs
besides using v_movrel*

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

8 years ago[X86] Add the v4i32 flavor test-case for pr30371
Zvi Rackover [Wed, 12 Oct 2016 17:06:30 +0000 (17:06 +0000)]
[X86] Add the v4i32 flavor test-case for pr30371

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

8 years agoAMDGPU/SI: Change mimg intrinsic signatures
Tom Stellard [Wed, 12 Oct 2016 16:35:29 +0000 (16:35 +0000)]
AMDGPU/SI: Change mimg intrinsic signatures

This makes more fields overridable and removes redundant bits.

Patch by: Changpeng Fang

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

8 years ago[ValueTracking] An improvement to IR ValueTracking on Non-negative Integers
Artur Pilipenko [Wed, 12 Oct 2016 16:18:43 +0000 (16:18 +0000)]
[ValueTracking] An improvement to IR ValueTracking on Non-negative Integers

Since this change is known to cause performance degradations in some cases it's commited under a temporary flag which is turned off by default.

Patch by Li Huang

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

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

8 years agoBranchRelaxation: Unique live ins when creating block
Matt Arsenault [Wed, 12 Oct 2016 15:32:04 +0000 (15:32 +0000)]
BranchRelaxation: Unique live ins when creating block

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

8 years ago[MC] Fix Error Location for ParseIdentifier
Nirav Dave [Wed, 12 Oct 2016 13:58:07 +0000 (13:58 +0000)]
[MC] Fix Error Location for ParseIdentifier

Prevent partial parsing of '$' or '@' of invalid identifiers and fixup
workaround points. NFC Intended.

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

8 years ago[DAGCombiner] Update most ADD combines to support general vector combines
Simon Pilgrim [Wed, 12 Oct 2016 13:48:10 +0000 (13:48 +0000)]
[DAGCombiner] Update most ADD combines to support general vector combines

Add a number of helper functions to match scalar or vector equivalent constant/splat values to allow most of the combine patterns to be used by vectors.

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

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

8 years ago[DAGCombiner] Do not remove the load of stored values when optimizations are disabled
Konstantin Zhuravlyov [Wed, 12 Oct 2016 13:44:24 +0000 (13:44 +0000)]
[DAGCombiner] Do not remove the load of stored values when optimizations are disabled

This combiner breaks debug experience and should not be run when optimizations are disabled.

For example:
  int main() {
    int j = 0;
    j += 2;
    if (j == 2)
      return 0;
    return 5;
  }
When debugging this code compiled in /O0, it should be valid to break at line "j+=2;" and edit the value of j. It should change the return value of the function.

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

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

8 years ago[CVP] Convert an AShr to a LShr if 1st operand is known to be nonnegative.
Chad Rosier [Wed, 12 Oct 2016 13:41:38 +0000 (13:41 +0000)]
[CVP] Convert an AShr to a LShr if 1st operand is known to be nonnegative.

An arithmetic shift can be safely changed to a logical shift if the first
operand is known positive. This allows ComputeKnownBits (and similar analysis)
to determine the sign bit of the shifted value in some cases. In turn, this
allows InstCombine to canonicalize a signed comparison (a > 0) into an equality
check (a != 0).

PR30577

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

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

8 years agoNFC: The Cost Model specialization, by Andrey Tischenko
Alexey Bataev [Wed, 12 Oct 2016 13:24:13 +0000 (13:24 +0000)]
NFC: The Cost Model specialization, by Andrey Tischenko

The current Cost Model implementation is very inaccurate and has to be
updated, improved, re-implemented to be able to take into account the
concrete CPU models and the concrete targets where this Cost Model is
being used. For example, the Latency Cost Model should be differ from
Code Size Cost Model, etc.
This patch is the first step to launch the developing and implementation
of a new Cost Model generation.

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

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

8 years ago[InstCombine] Fix constexpr issue in select combining
Simon Pilgrim [Wed, 12 Oct 2016 10:20:15 +0000 (10:20 +0000)]
[InstCombine] Fix constexpr issue in select combining

As discussed by Andrea on PR30486, we have an unsafe cast to an Instruction type in the select combine which doesn't take into account that it could be a ConstantExpr instead.

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

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

8 years ago[Support][CommandLine] Display subcommands in help when there are less than 3
Alex Lorenz [Wed, 12 Oct 2016 10:04:35 +0000 (10:04 +0000)]
[Support][CommandLine] Display subcommands in help when there are less than 3
subcommands

This commit fixes a bug where the help output doesn't display subcommands when
a tool has less than 3 subcommands.

This change doesn't include a corresponding unittest as there is no viable way
to provide a unittest for it.

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

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

8 years ago[Support/ELF] - Sort PT_OPENBSD_* added previously. NFC.
George Rimar [Wed, 12 Oct 2016 09:20:28 +0000 (09:20 +0000)]
[Support/ELF] - Sort PT_OPENBSD_* added previously. NFC.

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

8 years agoAdd AArch64 unit tests
Diana Picus [Wed, 12 Oct 2016 09:00:44 +0000 (09:00 +0000)]
Add AArch64 unit tests

Add unit tests for checking a few tricky instruction sizes. Also remove the old
tests for the instruction sizes, which were clunky and brittle.

Since this is the first set of target-specific unit tests, we need to add some
CMake plumbing. In the future, adding unit tests for a given target will be as
simple as creating a directory with the same name as the target under
unittests/Target. The tests are only run if the target is enabled in
LLVM_TARGETS_TO_BUILD.

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

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

8 years ago[LCG] Cleanup various places where comments said `SCC` but meant
Chandler Carruth [Wed, 12 Oct 2016 08:40:51 +0000 (08:40 +0000)]
[LCG] Cleanup various places where comments said `SCC` but meant
`RefSCC`.

Also improve the comments surrounding the lazy post-order iterator as
they had grown stale since the RefSCC/SCC split.

I'm sure there are more comments that need updating here, but I saw and
fixed these and didn't want to lose them. I've not gotten to doing
a really complete audit of every comment yet.

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

8 years ago[LCG] Add the necessary functionality to the LazyCallGraph to support inlining.
Chandler Carruth [Wed, 12 Oct 2016 07:59:56 +0000 (07:59 +0000)]
[LCG] Add the necessary functionality to the LazyCallGraph to support inlining.

The basic inlining operation makes the following changes to the call graph:
1) Add edges that were previously transitive edges. This is always trivial and
   this patch gives the LCG helper methods to make this more convenient.
2) Remove the inlined edge. We had existing support for this, but it contained
   bugs that needed to be fixed. Testing in the same pattern as the inliner
   exposes these bugs very nicely.
3) Delete a function when it becomes dead because it is internal and all calls
   have been inlined. The LCG had no support at all for this operation, so this
   adds that support.

Two unittests have been added that exercise this specific mutation pattern to
the call graph. They were extremely effective in uncovering bugs. Sadly,
a large fraction of the code here is just to implement those unit tests, but
I think they're paying for themselves. =]

This was split out of a patch that actually uses the routines to
implement inlining in the new pass manager in order to isolate (with
unit tests) the logic that was entirely within the LCG.

Many thanks for the careful review from folks! There will be a few minor
follow-up patches based on the comments in the review as well.

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

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

8 years agoRevert "[libFuzzer] refactoring to speed things up, NFC"
Daniel Jasper [Wed, 12 Oct 2016 07:26:46 +0000 (07:26 +0000)]
Revert "[libFuzzer] refactoring to speed things up, NFC"

This reverts commit r283946.

This breaks when build with GCC:
lib/Fuzzer/FuzzerTracePC.cpp:169:6: error: always_inline function might not be inlinable [-Werror=attributes]
lib/Fuzzer/FuzzerTracePC.cpp:169:6: error: inlining failed in call to always_inline 'void fuzzer::TracePC::HandleCmp(void*, T, T) [with T = long unsigned int]': target specific option mismatch
lib/Fuzzer/FuzzerTracePC.cpp:198:65: error: called from here

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

8 years ago[AArch64][InstructionSelector] Fix unintended test changes in r283973.
Quentin Colombet [Wed, 12 Oct 2016 04:12:44 +0000 (04:12 +0000)]
[AArch64][InstructionSelector] Fix unintended test changes in r283973.

I screwed up my merge conflict and lost some of the CHECK lines.

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

8 years ago[AArch64][InstrustionSelector] Teach the selector about G_BITCAST.
Quentin Colombet [Wed, 12 Oct 2016 03:57:52 +0000 (03:57 +0000)]
[AArch64][InstrustionSelector] Teach the selector about G_BITCAST.

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

8 years ago[AArch64][InstructionSelector] Refactor the handling of copies.
Quentin Colombet [Wed, 12 Oct 2016 03:57:49 +0000 (03:57 +0000)]
[AArch64][InstructionSelector] Refactor the handling of copies.

Although Copies are not specific to preISel, we still have to assign them
a proper register class. However, given they are not constrained to
anything we do not have to handle the source register at the copy. It
will be properly mapped when reaching the related definition.

In the process, the handlong of G_ANYEXT is slightly modified as those
end up being selected as copy. The difference is that when register size
do not match on both sides, we need to insert SUBREG_TO_REG operation,
otherwise the post RA copy expansion will not be happy!

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

8 years ago[AArch64][InstructionSelector] Fix typos in the related mir file. NFC.
Quentin Colombet [Wed, 12 Oct 2016 03:57:46 +0000 (03:57 +0000)]
[AArch64][InstructionSelector] Fix typos in the related mir file. NFC.

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

8 years ago[AArch64][MachineLegalizer] Mark more bitcasts as legal.
Quentin Colombet [Wed, 12 Oct 2016 03:57:43 +0000 (03:57 +0000)]
[AArch64][MachineLegalizer] Mark more bitcasts as legal.

Those are copies, we do not have to do any legalization action for them.

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

8 years ago[lit] Run unit tests as part of lit test suite
Brian Gesiak [Wed, 12 Oct 2016 03:35:04 +0000 (03:35 +0000)]
[lit] Run unit tests as part of lit test suite

Summary:
The Python file `utils/lit/lit/ShUtil.py` contains:

1. Logic used by lit itself
2. A set of unit tests for that logic, which can be run by invoking
  `python utils/lit/lit/ShUtil.py`

Move these unit tests to a `tests/unit` subdirectory of lit, and run
the tests as part of lit's test suite. This ensures that, should the
lit test suite be included in LLVM's own regression test suite, these
unit tests will also be run.

(Instructions on how to run lit's test suite can be found in
`utils/lit/README.txt`.)

Reviewers: ddunbar, echristo, delcypher, beanz

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoMemory-SSA cleanup of clobbers interface, NFC
Sebastian Pop [Wed, 12 Oct 2016 03:08:40 +0000 (03:08 +0000)]
Memory-SSA cleanup of clobbers interface, NFC

This implements the cleanup that Danny asked to commit separately from the
previous fix to GVN-hoist in https://reviews.llvm.org/D25476#inline-219818

Tested with ninja check on x86_64-linux.

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

8 years agoGVN-hoist: fix store past load dependence analysis (PR30216, PR30499)
Sebastian Pop [Wed, 12 Oct 2016 02:23:39 +0000 (02:23 +0000)]
GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)

This is a refreshed version of a patch that was reverted: it fixes
the problems reported in both PR30216 and PR30499, and
contains all the test-cases from both bugs.

To hoist stores past loads, we used to search for potential
conflicting loads on the hoisting path by following a MemorySSA
def-def link from the store to be hoisted to the previous
defining memory access, and from there we followed the def-use
chains to all the uses that occur on the hoisting path. The
problem is that the def-def link may point to a store that does
not alias with the store to be hoisted, and so the loads that are
walked may not alias with the store to be hoisted, and even as in
the testcase of PR30216, the loads that may alias with the store
to be hoisted are not visited.

The current patch visits all loads on the path from the store to
be hoisted to the hoisting position and uses the alias analysis
to ask whether the store may alias the load. I was not able to
use the MemorySSA functionality to ask for whether load and
store are clobbered: I'm not sure which function to call, so I
used a call to AA->isNoAlias().

Store past store is still working as before using a MemorySSA
query: I added an extra test to pr30216.ll to make sure store
past store does not regress.

Tested on x86_64-linux with check and a test-suite run.

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

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

8 years ago[PPCMIPeephole] Fix splat elimination
Tim Shen [Wed, 12 Oct 2016 00:48:25 +0000 (00:48 +0000)]
[PPCMIPeephole] Fix splat elimination

Summary:
In PPCMIPeephole, when we see two splat instructions, we can't simply do the following transformation:
  B = Splat A
  C = Splat B
=>
  C = Splat A
because B may still be used between these two instructions. Instead, we should make the second Splat a PPC::COPY and let later passes decide whether to remove it or not:
  B = Splat A
  C = Splat B
=>
  B = Splat A
  C = COPY B

Fixes PR30663.

Reviewers: echristo, iteratee, kbarton, nemanjai

Subscribers: mehdi_amini, llvm-commits

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

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

8 years agoFix the stage2 MSVC 2013 build with less constexpr in RNG
Reid Kleckner [Tue, 11 Oct 2016 23:02:21 +0000 (23:02 +0000)]
Fix the stage2 MSVC 2013 build with less constexpr in RNG

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

8 years ago[DAG] Fix crash in build_vector -> vector_shuffle combine
Michael Kuperstein [Tue, 11 Oct 2016 22:44:31 +0000 (22:44 +0000)]
[DAG] Fix crash in build_vector -> vector_shuffle combine

Fixes a crash in the build_vector -> vector_shuffle combine
when the first vector input is twice as wide as the output,
and the second input vector is even wider.

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

8 years agoGlobalISel: support same-size casts on AArch64.
Tim Northover [Tue, 11 Oct 2016 22:29:23 +0000 (22:29 +0000)]
GlobalISel: support same-size casts on AArch64.

Mostly Ahmed's work again, I'm just sprucing things up slightly before
committing.

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

8 years ago[InstrProf] Add support for dead_strip+live_support functionality
Vedant Kumar [Tue, 11 Oct 2016 21:48:16 +0000 (21:48 +0000)]
[InstrProf] Add support for dead_strip+live_support functionality

On Darwin, marking a section as "regular,live_support" means that a
symbol in the section should only be kept live if it has a reference to
something that is live. Otherwise, the linker is free to dead-strip it.

Turn this functionality on for the __llvm_prf_data section.

This means that counters and data associated with dead functions will be
removed from dead-stripped binaries. This will result in smaller
profiles and binaries, and should speed up profile collection.

Tested with check-profile, llvm-lit test/tools/llvm-{cov,profdata}, and
check-llvm.

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

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