127252 Commits

Author SHA1 Message Date
Matt Arsenault
4b9655d7ac Fix printing of f16 machine operands
Only single and double FP immediates are correctly printed by
MachineInstr::print() during debug output. Half float type goes to
APFloat::convertToDouble() and hits assertion it is not a double
semantics. This diff prints half machine operands correctly.

This cannot currently be hit by any in-tree target.

Patch by Stanislav Mekhanoshin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 00:50:18 +00:00
Easwaran Raman
99c3bc5b64 Fix build breakage introduced by r259846.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 00:45:02 +00:00
George Burgess IV
8114867d8b Add a test for MemorySSA. NFC.
We don't currently have many tests that deal with operations on multiple
local MemoryLocations. This new test helps out a bit in that regard.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 00:42:02 +00:00
Amaury Sechet
12e138e326 Add Support to llvm-c-test dependancies
Summary: As per title. It is required and don't get linked in in some builds.

Reviewers: chapuni, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 00:19:50 +00:00
Xinliang David Li
51000e37d1 Function name change /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:59:09 +00:00
Easwaran Raman
4bf45e8313 Refactor profile summary support code. NFC.
Summary computation is not just for instrumented profiling and so I have moved
the ProfileSummary class to ProfileCommon.h (named so to allow code unrelated
to summary but common to instrumented and sampled profiling to be placed there)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:34:31 +00:00
Amaury Sechet
88242800f7 Improve testing for the C API
Summary:
This basically add an echo test case in C. The support is limited right now, but full support would just be too much to review at once.

The echo test case simply get a module as input and try to output the same exact module. This allow to check the both reading and writing API are working as expected.

I want to improve this test over time to support more and more of the API, in order to improve coverage (coverage is quite poor right now).

Test Plan: Run the test.

Reviewers: chandlerc, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:26:19 +00:00
Nemanja Ivanovic
e0a5f73cd5 Fix for PR 26356
Using the load immediate only when the immediate (whether signed or unsigned)
can fit in a 16-bit signed field. Namely, from -32768 to 32767 for signed and
0 to 65535 for unsigned. This patch also ensures that we sign-extend under the
right conditions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:14:42 +00:00
Evandro Menezes
cb8e306b6b Fix typo and test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 23:07:57 +00:00
Nemanja Ivanovic
4141af9452 Provide a test case for rl259798
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 22:36:10 +00:00
Chad Rosier
6f9d22989f [AArch64] Bound the number of instructions we scan when searching for updates.
This only impacts the creation of pre-/post-index instructions.  The bound was
set high enough such that it did not change code generation for SPEC200X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 21:26:02 +00:00
Vedant Kumar
2cf81c9f96 [docs] Fix typo in YamlIO.rst
Patch by Mario Lang!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 20:42:43 +00:00
Niels Ole Salscheider
891198c2e4 Install cmake files to lib/cmake/llvm
This is the right location for platform-specific files.

On some distributions (e. g. Exherbo), a package can be installed for several
architectures in parallel, but the architecture-independent files are shared.
Therefore, we must not install architecture-dependent files (like the CMake
config and export files) to share/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 20:08:19 +00:00
Simon Pilgrim
7042dc4c2a [X86][SSE] Select domain for 32/64-bit partial loads for EltsFromConsecutiveLoads
Choose between MOVD/MOVSS and MOVQ/MOVSD depending on the target vector type.

This has a lot fewer test changes than trying to add this to X86InstrInfo::setExecutionDomain.....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 19:27:51 +00:00
Wei Mi
f6118416e1 Fix a regression for r259736.
When SCEV expansion tries to reuse an existing value, it is needed to ensure
that using the Value at the InsertPt will not break LCSSA. The fix adds a
check that InsertPt is either inside the candidate Value's parent loop, or
the candidate Value's parent loop is nullptr.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 19:17:33 +00:00
Xinliang David Li
0e7060e78c Fix format in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 19:14:10 +00:00
Xinliang David Li
f45c13d3a1 [PGO] Add interfaces to annotate instr with VP data
Add interfaces to do value profile data IR annnotation
  and read. Needed by both FE and IR based PGO.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 19:11:43 +00:00
Chad Rosier
6cced9c3cd [AArch64] Improve load/store optimizer to handle LDUR + LDR (take 3).
This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

PR24465
http://reviews.llvm.org/D12116
Many thanks to Ahmed and Michael for fixes and code review.

This is a reapplication of r246769 and r259790.  The tramp3d failure was caused
by an incorrect refactoring in the patch.  Specifically, we weren't always
properly clearing the SExtIdx flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 18:59:49 +00:00
Sanjoy Das
ae47d9e783 [SCEV] Add boolean accessors for NSW, NUW and NW; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 18:21:54 +00:00
David Majnemer
b4612d8832 Correctly handle {Always,Never}StepIntoLine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 17:57:12 +00:00
David Majnemer
75a2a42e95 Add support for S_DEFRANGE and S_DEFRANGE_SUBFIELD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 17:37:30 +00:00
David Majnemer
cae51a87c8 Make the dumper's output for variable ranges easier to read
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 17:29:13 +00:00
Sanjay Patel
1268fa4230 use 'auto' for iterators; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 17:00:35 +00:00
Silviu Baranga
9223f15729 [AArch64] Multiply extended 32-bit ints with `[U|S]MADDL'
During instruction selection, the AArch64 backend can recognise the
following pattern and generate an [U|S]MADDL instruction, i.e. a
multiply of two 32-bit operands with a 64-bit result:

(mul (sext i32), (sext i32))
However, when one of the operands is constant, the sign extension
gets folded into the constant in SelectionDAG::getNode(). This means
that the instruction selection sees this:

(mul (sext i32), i64)
...which doesn't match the pattern. Sign-extension and 64-bit
multiply instructions are generated, which are slower than one 32-bit
multiply.

Add a pattern to match this and generate the correct instruction, for
both signed and unsigned multiplies.

Patch by Chris Diamand!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:47:09 +00:00
Benjamin Kramer
67256b88e5 The canonical way to XFAIL a test for all targets is XFAIL: *, not XFAIL:
Fix the lit bug that enabled this "feature" (empty triple is substring
of all possible target triples) and change the two outliers to use the
documented * syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:21:38 +00:00
Nemanja Ivanovic
60f6cd1467 Enable the %s modifier in inline asm template string
This patch corresponds to review:
http://reviews.llvm.org/D16847

There are some files in glibc that use the output operand modifier even though
it was deprecated in GCC. This patch just adds support for it to prevent issues
with such files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:18:08 +00:00
Renato Golin
1f5cad4a99 [PPC] Move PPC test to a PPC-specific dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:14:59 +00:00
Simon Pilgrim
3024052619 [X86][SSE] Add general 32-bit LOAD + VZEXT_MOVL support to EltsFromConsecutiveLoads
This patch adds support for consecutive (load/undef elements) 32-bit loads, followed by trailing undef/zero elements to be combined to a single MOVD load.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:12:56 +00:00
Chad Rosier
954ec75da9 Revert "[AArch64] Improve load/store optimizer to handle LDUR + LDR."
This reverts commit r259790. tramp3d-v4 is still having problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:01:40 +00:00
Simon Pilgrim
eb525ad4e4 [X86][SSE] Added i686 target tests to make sure we are correctly loading consecutive entries as 64-bit integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 15:51:55 +00:00
Elena Demikhovsky
0358bb5180 AVX-512: Fixed a bug in FMA instruction selection on KNL
The FMA instruction was selected from AVX2 set instead of AVX-512

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 15:11:11 +00:00
Petar Jovanovic
8ed0526e77 [Power PC] softening long double type
This patch implements softening of long double type (ppcf128) on ppc32
architecture and enables operations for this type for soft float.

Patch by Strahinja Petrovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 14:43:50 +00:00
Chad Rosier
1f06a18efb [AArch64] Improve load/store optimizer to handle LDUR + LDR.
This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

PR24465
http://reviews.llvm.org/D12116
Many thanks to Ahmed and Michael for fixes and code review.

This is a reapplication of r246769, which was reverted in r246782 due to a
test-suite failure.  I'm unable to reproduce the issue at this time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 14:42:55 +00:00
Michael Zuckerman
2fcbaf1285 [AVX512] add vfmadd132ss and vfmadd132sd Intrinsic
Differential Revision: http://reviews.llvm.org/D16589


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 14:41:08 +00:00
Simon Pilgrim
0906424967 [X86] Add AVX512 vector zext tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 14:06:19 +00:00
Jonas Paulsson
ebc5f75de7 [ScheduleDagInstrs] Improved comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 13:08:48 +00:00
Simon Pilgrim
2dc44bed38 [X86] Moved SEXT -> SIGN_EXTEND_VECTOR_INREG combine into helper. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 09:27:19 +00:00
Andrey Turetskiy
be1b2fc159 [X86] Use hash table in LEA optimization pass.
Use hash table (key is a memory operand) to store found LEA instructions to reduce compile time.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 08:57:03 +00:00
Justin Bogner
125c5460fd cmake: Add a flag to enable LTO
This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 07:28:30 +00:00
Craig Topper
50db127cda [Support] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 06:51:41 +00:00
Craig Topper
a7bacb76b2 [Support] Use hexdigit instead of manually coding the same thing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 06:51:38 +00:00
Xinliang David Li
730d9343ca [PGO] Profile interface cleanup
- Remove unused valuemapper parameter
  - add totalcount optional parameter





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 05:29:51 +00:00
Jingyue Wu
fb3aa174ce [NVPTX] Disable performance optimizations when OptLevel==None
Reviewers: jholewinski, tra, eliben

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 04:15:36 +00:00
Nemanja Ivanovic
0e71de1a92 Test case for PR 26381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 01:58:20 +00:00
Wei Mi
eafb39b656 [SCEV] Try to reuse existing value during SCEV expansion
Current SCEV expansion will expand SCEV as a sequence of operations
and doesn't utilize the value already existed. This will introduce
redundent computation which may not be cleaned up throughly by
following optimizations.

This patch introduces an ExprValueMap which is a map from SCEV to the
set of equal values with the same SCEV. When a SCEV is expanded, the
set of values is checked and reused whenever possible before generating
a sequence of operations.

The original commit triggered regressions in Polly tests. The regressions
exposed two problems which have been fixed in current version.

1. Polly will generate a new function based on the old one. To generate an
instruction for the new function, it builds SCEV for the old instruction,
applies some tranformation on the SCEV generated, then expands the transformed
SCEV and insert the expanded value into new function. Because SCEV expansion
may reuse value cached in ExprValueMap, the value in old function may be
inserted into new function, which is wrong.
   In SCEVExpander::expand, there is a logic to check the cached value to
be used should dominate the insertion point. However, for the above
case, the check always passes. That is because the insertion point is
in a new function, which is unreachable from the old function. However
for unreachable node, DominatorTreeBase::dominates thinks it will be
dominated by any other node.
   The fix is to simply add a check that the cached value to be used in
expansion should be in the same function as the insertion point instruction.

2. When the SCEV is of scConstant type, expanding it directly is cheaper than
reusing a normal value cached. Although in the cached value set in ExprValueMap,
there is a Constant type value, but it is not easy to find it out -- the cached
Value set is not sorted according to the potential cost. Existing reuse logic
in SCEVExpander::expand simply chooses the first legal element from the cached
value set.
   The fix is that when the SCEV is of scConstant type, don't try the reuse
logic. simply expand it.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 01:27:38 +00:00
Richard Smith
21c303e9ea Fix undefined behavior when compiling in C++14 mode (with sized deletion
enabled): ensure that we do not invoke the sized deallocator for MemoryBuffer
subclasses that have tail-allocated data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259735 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 01:21:16 +00:00
Reid Kleckner
65ece990a3 [codeview] Don't attempt a cross-section label diff
This only comes up when we're trying to find the next .cv_loc label.

Fixes PR26467

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259733 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 00:21:42 +00:00
Kostya Serebryany
5a91878f44 [libFuzzer] hot fix a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 00:12:28 +00:00
Kostya Serebryany
598f7017b4 [libFuzzer] don't write the test unit when a leak is detected (since we don't know which unit causes the leak)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 00:02:17 +00:00
Gerolf Hoflehner
8a70ce27fd [SimplifyCFG] Fix for "endless" loop after dead code removal (Alternative to
D16251)

Summary:
This is a simpler fix to the problem than the dominator approach in
http://reviews.llvm.org/D16251. It adds only values into the gather() while loop
that have been seen before.

The actual endless loop is in the constant compare gather() routine in
Utils/SimplifyCFG.cpp. The same value ret.0.off0.i is pushed back into the
queue:
%.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i

Here is what happens at the IR level:

for.cond.i:                                       ; preds = %if.end6.i,
%if.end.i54
%ix.0.i = phi i32 [ 0, %if.end.i54 ], [ %inc.i55, %if.end6.i ]
%ret.0.off0.i = phi i1 [false, %if.end.i54], [%.ret.0.off0.i, %if.end6.i] <<<
%cmp2.i = icmp ult i32 %ix.0.i, %11
br i1 %cmp2.i, label %for.body.i, label %LBJ_TmpSimpleNeedExt.exit

if.end6.i:                                        ; preds = %for.body.i
%cmp10.i = icmp ugt i32 %conv.i, %add9.i
%.ret.0.off0.i = or i1 %ret.0.off0.i, %cmp10.i <<<

When if.end.i54 gets eliminated which removes the definition of ret.0.off0.i.
The result is the expression %.ret.0.off0.i = or i1 %.ret.0.off0.i, %cmp10.i
(Note the first ‘or’ operand is now %.ret.0.off0.i, and *NOT* %ret.0.off0.i).
And
now there is use of .ret.0.off0.i before a definition which triggers the
“endless” loop in gather():

while(!DFT.empty()) {

    V = DFT.pop_back_val();   // V is .ret.0.off0.i

    if (Instruction *I = dyn_cast<Instruction>(V)) {
      // If it is a || (or && depending on isEQ), process the operands.
      if (I->getOpcode() == (isEQ ? Instruction::Or : Instruction::And)) {
        DFT.push_back(I->getOperand(1));  // This is now .ret.0.off0.i also
        DFT.push_back(I->getOperand(0));

        continue; // “endless loop” for .ret.0.off0.i
      }

Reviewers: reames, ahatanak

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 23:54:25 +00:00