136198 Commits

Author SHA1 Message Date
Kevin Enderby
b2cc749171 Remove the test/tools/llvm-objdump/malformed-archives.test for
now while I investagate the bot failures with this test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:46:24 +00:00
Simon Pilgrim
72b444d01e Fixed MSVC out of range shift warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:43:59 +00:00
Zachary Turner
85c3e3ee9c Revert "[msf] Rename Msf to MSF."
This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:38:47 +00:00
Piotr Padlewski
cc8a2a6d7e Fixing broken MSVS builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:28:07 +00:00
Zachary Turner
4d1557ffac [msf] Rename Msf to MSF.
In a previous patch, it was suggested to use all caps instead of
rolling caps for initialisms, so this patch changes everything
to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:24:26 +00:00
Andrew Kaylor
2f75f99d2f Recommitting r275284: add support to inline __builtin_mempcpy
Patch by Sunita Marathe

Third try, now following fixes to MSan to handle mempcy in such a way that this commit won't break the MSan buildbots. (Thanks, Evegenii!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:23:18 +00:00
Tim Northover
bbdb447778 GlobalISel: make translate* functions take the most specialized class possible.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:11:21 +00:00
Kyle Butt
9f1f15e084 Codegen: MachineBlockPlacement Improve probability layout.
The following pattern was being layed out poorly:

              A
             / \
            B   C
           / \ / \
          D   E   ? (Doesn't matter)

Where A->B is far more likely than A->C, and prob(B->D) = prob(B->E)

The current algorithm gives:
A,B,C,E (D goes on worklist)

It does this even if C has a frequency count of 0. This patch
adjusts the layout calculation so that if freq(B->E) >> freq(C->E)
then we go ahead and layout E rather than C. Fallthrough half the time
is better than fallthrough never, or fallthrough very rarely. The
resulting layout is:

A,B,E, (C and D are in a worklist)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:09:28 +00:00
Kyle Butt
02e59638f8 Tests: Add branch weights to non-layout tests.
Add branch weights to a few tests that aren't testing layout to make them less
sensitive to changes in the layout algorithm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 18:09:25 +00:00
Tim Northover
57c3cc8560 GlobalISel: add generic conditional branch.
Just the basic equivalent to DAG's condbr for now, we'll get to things like
br_cc when we start doing more legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:58:00 +00:00
Krzysztof Parzyszek
83fd8feb00 [Hexagon] Testcase for not merging stores into a misaligned store
The DAG combiner will try to merge consecutive stores into a bigger
store, unless the resulting store is not fast. Misaligned vector stores
are allowed on Hexagon, but are not fast. Add a testcase to make sure
this type of merging does not occur.

Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:55:37 +00:00
Krzysztof Parzyszek
227b764c52 Revert r277178, the actual change had already been applied
Will submit another patch with the testcase only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:50:47 +00:00
Krzysztof Parzyszek
36b1b46f1c [Hexagon] Misaligned loads and stores are not fast
The DAG combiner tries to merge stores to adjacent vector wide memory
locations by creating stores which are integral multiples of the vector
width. Discourage this by informing it that this is slow. This should
not affect legalization passes, because all of them ignore the "Fast"
argument.

Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:45:16 +00:00
Kevin Enderby
2a7151766d The next step along the way to getting good error messages for bad archives.
As mentioned in commit log for r276686 this next step is adding a new
method in the ArchiveMemberHeader class to get the full name that
does proper error checking, and can be use for error messages.

To do this the name of ArchiveMemberHeader::getName() is changed to
ArchiveMemberHeader::getRawName() to be consistent with
Archive::Child::getRawName().  Then the “new” method is the addition
of a new implementation of ArchiveMemberHeader::getName() which gets
the full name and provides proper error checking.  Which is mostly a rewrite
of what was Archive::Child::getName() and cleaning up incorrect uses of
llvm_unreachable() in the code which were actually just cases of errors
in the input Archives.

Then Archive::Child::getName() is changed to return Expected<> and use
the new implementation of ArchiveMemberHeader::getName() .

Also needed to change Archive::getMemoryBufferRef() with these
changes to return Expected<> as well to propagate Errors up.
As well as changing Archive::isThinMember() to return Expected<> .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:44:13 +00:00
Tim Northover
0c332fd272 CodeGen: improve MachineInstrBuilder & MachineIRBuilder interface
For MachineInstrBuilder, having to manually use RegState::Define is ugly and
makes register definitions clunkier than they need to be, so this adds two
convenience functions: addDef and addUse.

For MachineIRBuilder, we want to avoid BuildMI's first-reg-is-def rule because
it's hidden away and causes bugs. So this patch switches buildInstr to
returning a MachineInstrBuilder and adding *all* operands via addDef/addUse.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:43:52 +00:00
Ahmed Bougacha
a4174a215c [AArch64][GlobalISel] Select G_XOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:56:25 +00:00
Ahmed Bougacha
d8a8826830 [GlobalISel] Add G_XOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:56:20 +00:00
Ahmed Bougacha
8d4e8d2a52 [AArch64][GlobalISel] Select G_LOAD/G_STORE.
Mostly straightforward as we ignore addressing modes and just
use the base + unsigned immediate offset (always 0) variants.

This currently fails to select extloads because we have yet to
agree on a representation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:56:16 +00:00
Ahmed Bougacha
c9b195c22f [GlobalISel] Add LLT raw_ostream operator<< overload.
Helpful when debugging; will be used in the following commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:56:12 +00:00
Brendon Cahoon
c1359c9fbb MachinePipeliner pass that implements Swing Modulo Scheduling
Software pipelining is an optimization for improving ILP by
overlapping loop iterations. Swing Modulo Scheduling (SMS) is
an implementation of software pipelining that attempts to
reduce register pressure and generate efficient pipelines with
a low compile-time cost.

This implementaion of SMS is a target-independent back-end pass.
When enabled, the pass should run just prior to the register
allocation pass, while the machine IR is in SSA form. If the pass
is successful, then the original loop is replaced by the optimized
loop. The optimized loop contains one or more prolog blocks, the
pipelined kernel, and one or more epilog blocks.

This pass is enabled for Hexagon only. To enable for other targets,
a couple of target specific hooks must be implemented, and the
pass needs to be called from the target's TargetMachine
implementation.

Differential Review: http://reviews.llvm.org/D16829


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:44:44 +00:00
Krzysztof Parzyszek
a6ad276d07 [Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX
If the mask of a vector shuffle has alternating odd or even numbers
starting with 1 or 0 respectively up to the largest possible index
for the given type in the given HVX mode (single of double) we can
generate vpacko or vpacke instruction respectively.

E.g.
  %42 = shufflevector <32 x i16> %37, <32 x i16> %41,
                      <32 x i32> <i32 1, i32 3, ..., i32 63>
  is %42.h = vpacko(%41.w, %37.w)

Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:44:27 +00:00
Matt Masten
bbbcccbfc4 Initial support for vectorization using svml (short vector math library).
Differential Revision: https://reviews.llvm.org/D19544


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:42:44 +00:00
Ahmed Bougacha
8ad8fd6e93 [GlobalISel] Auto-brief LowLevelType. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:11:06 +00:00
Ahmed Bougacha
eda1b46b87 [GlobalISel] Add LLT::operator!=().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:11:04 +00:00
Ahmed Bougacha
ade60aa452 [GlobalISel] Fix LLT::unsized to match LLT(LabelTy).
When coming from an IR label type, we set a 0 NumElements, but not
when constructing an LLT using unsized(), causing comparisons to fail.

Pick one variant and fix the other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:11:02 +00:00
Ahmed Bougacha
1147bf697d [GlobalISel] Add unittests for LowLevelType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:10:57 +00:00
Paul Robinson
f6b677f6bf Reinstate optnone test for GVN Hoisting, removed in r276479.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:05:50 +00:00
Nirav Dave
a517bf8e06 Remove inline-comment-2.ll until I can debug why it fails on some builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277152 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 15:24:06 +00:00
Krzysztof Parzyszek
1f44345f2c [Hexagon] Improve balancing of address calculation
Rebalances address calculation trees and applies Hexagon-specific
optimizations to the trees to improve instruction selection.

Patch by Tobias Edler von Koch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 15:15:35 +00:00
Nirav Dave
2710958a68 Fix inline-comment-2.ll triple
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 15:12:00 +00:00
David L Kreitzer
af3f28bc66 Avoid unnecessary 32-bit to 64-bit zero extensions following
32-bit CMOV instructions on x86_64. The 32-bit CMOV implicitly
zero extends.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 15:09:54 +00:00
Nirav Dave
9167c0e6d7 [MC] When emitting output hash comments always use standard line comment seperator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 14:42:00 +00:00
Krzysztof Parzyszek
ee2728bb0c Fix license information in the file header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 14:04:17 +00:00
Krzysztof Parzyszek
6b032c682c Add missing files to r277143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 13:59:55 +00:00
Krzysztof Parzyszek
4f328be3df [Hexagon] Implement DFA based hazard recognizer
The post register allocator scheduler can generate poor schedules
because the scoreboard hazard recognizer is unable to identify
hazards for Hexagon precisely. Instead, Hexagon should use a DFA
based hazard recognizer.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 13:59:09 +00:00
Daniel Sanders
e2a16fdce2 Re-commit: [mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.

This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.

The previous commit had an uninitialized variable that caused the incoming
argument region to have undefined size. This has been fixed.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 12:27:28 +00:00
Nirav Dave
5b7959028f Cleanup TransferDbgValues
[DAG] Check debug values for invalidation before transferring and mark
old debug values invalid when transferring to another SDValue.

This fixes PR28613.

Reviewers: jyknight, hans, dblaikie, echristo

Subscribers: yaron.keren, ismail, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 11:49:32 +00:00
Simon Pilgrim
e6abaac391 [X86][SSE] Optimize the truncation of vector comparison results with PACKSS
We currently default to using either generic shuffles or MASK+PACKUS/PACKSS to truncate all integer vectors. For vector comparisons, we know that the result will be either all or zero bits in every element, which can be efficiently truncated by directly using PACKSS to repeatedly halve the size of each element.

Due to the limited input values (-1 or 0) we don't need to account for vector element size, so for simplicity we just use the PACKSS(vXi16,vXi16) implementation in all cases. Additionally for AVX2 PACKSS of 256bit data we must perform a PERMQ shuffle to reorder the data into the correct order. I did investigate performing a single shuffle after all the PACKSS calls but the need to cross 128bit lanes makes this difficult to achieve efficiently.

We avoid performing this on AVX512 as it should have better alternative truncation instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 10:23:10 +00:00
Simon Pilgrim
bf172ec934 Fixed MSVC out of range shift warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 10:03:39 +00:00
Sjoerd Meijer
7d72920df2 Fix for commit rL277126 that broke a build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 09:57:37 +00:00
Prakhar Bahuguna
322f342e82 [Thumb] Emit Thumb move in both Thumb modes for struct_byval predicates
Summary:
The MOV/MOVT instructions being chosen for struct_byval predicates was
conditional only on Thumb2, resulting in an ARM MOV/MOVT instruction
being incorrectly emitted in Thumb1 mode. This is especially apparent
with v8-m.base targets. This patch ensures that Thumb instructions are
emitted in both Thumb modes.

Reviewers: rengolin, t.p.northover

Subscribers: llvm-commits, aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 09:16:46 +00:00
Jacques Pienaar
3b7839bf54 [lanai] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 08:50:23 +00:00
Sjoerd Meijer
c46479857e TargetInstrInfo: add virtual function getInstSizeInBytes
This adds a target hook getInstSizeInBytes to TargetInstrInfo that a lot of
subclasses already implement.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 08:16:16 +00:00
Craig Topper
f7938da3bf [AVX512] Mark EVEX VMOVSSrm and VMOVSDrm as canFoldAsLoad and isReMaterializable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 06:06:04 +00:00
Craig Topper
8e82677ab6 [AVX512] Copy the patterns that recognize scalar arimetic operations inserting into the lower element of a packed vector from AVX/SSE so that we can use EVEX encoded instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 06:06:00 +00:00
Craig Topper
9e64e8e98b [AVX512] Add AVX512 run lines to some tests for scalar fma/add/sub/mul/div and regenerate. Follow up commits will bring AVX512 code up to the same quality as AVX/SSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 06:05:58 +00:00
David Majnemer
b9ddc3df47 [EarlyCSE] Correctly handle simplified, but live, instructions
Some instructions may have their uses replaced with a symbolic constant.
However, the instruction may still have side effects which percludes it
from being removed from the function.  EarlyCSE treated such an
instruction as if it were removed, resulting in PR28763.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 05:39:21 +00:00
David Majnemer
b9bd76d554 [ConstantFolding] Fold bitcasts of vectors w/ undef elements
An undef vector element can be treated as if it had any value.  Folding
such a vector element to 0 in a bitcast can open up further folding
opportunities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 04:06:09 +00:00
David Majnemer
6b87ada911 [ConstantFolding] Remove an unused ConstantFoldInstOperands overload
No functional change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 03:27:33 +00:00
David Majnemer
8065d776a0 [ConstantFolding] Use ConstantExpr::getWithOperands
ConstantExpr::getWithOperands does much of the hard work that
ConstantFoldInstOperandsImpl tries to do but more completely.

This lets us fold ExtractValue/InsertValue expressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277100 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 03:27:31 +00:00