Commit Graph

70535 Commits

Author SHA1 Message Date
Stepan Dyatkovskiy
83ac8b35e9 MergeFunctions Pass, removed unused methods from old implementation.
Patch removed next old FunctionComparator methods:
    * enumerate
    * isEquivalentOperation
    * isEquivalentGEP
    * isEquivalentType 
    
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211444 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 20:13:24 +00:00
Stepan Dyatkovskiy
768231880a MergeFunctions, doSanityCheck: fixed body comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 19:07:51 +00:00
Stepan Dyatkovskiy
e298b1ce98 MergeFunctions Pass, introduced sanity check, that checks order relation,
introduced among functions set.
    
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211442 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 18:58:11 +00:00
Stepan Dyatkovskiy
23a7bfce97 MergeFunctions Pass, introduced total ordering among top-level comparison
methods.
    
Patch changes return type of FunctionComparator::compare() and
FunctionComparator::compare(const BasicBlock*, const BasicBlock*)
methods from bool (equal or not) to {-1, 0, 1} (less, equal, great).
    
This patch belongs to patch series that improves MergeFunctions
performance time from O(N*N) to O(N*log(N)).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 17:55:51 +00:00
Benjamin Kramer
6b7ff6be9c LoopUnrollRuntime: Check for overflow in the trip count calculation.
Fixes PR19823.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 13:46:25 +00:00
Benjamin Kramer
636a9bece4 Legalizer: Add support for splitting insert_subvectors.
We handle this by spilling the whole thing to the stack and doing the
insertion as a store.

PR19492. This happens in real code because the vectorizer creates v2i128 when AVX is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 12:56:42 +00:00
Benjamin Kramer
b7f1fb47e6 SCEVExpander: Fold constant PHIs harder. The logic below only understands proper IVs.
PR20093.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 11:47:18 +00:00
Richard Trieu
7921239c41 Add back functionality removed in r210497.
Instead of asserting, output a message stating that a null pointer was found.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211430 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 02:43:02 +00:00
Andrea Di Biagio
5d0ff9c928 [X86] Add ISel patterns to select SSE3/AVX ADDSUB instructions.
This patch adds ISel patterns to select SSE3/AVX ADDSUB instructions
from a sequence of "vadd + vsub + blend".

Example:

///
typedef float float4 __attribute__((ext_vector_type(4)));

float4 foo(float4 A, float4 B) {
  float4 X = A - B;
  float4 Y = A + B;
  return (float4){X[0], Y[1], X[2], Y[3]};
}
///

Before this patch, (with flag -mcpu=corei7) llc produced the following
assembly sequence:
  movaps  %xmm0, %xmm2
  addps   %xmm1, %xmm2
  subps   %xmm1, %xmm0
  blendps $10, %xmm2, %xmm0


With this patch, we now get a single
  addsubps  %xmm1, %xmm0



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211427 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 01:31:15 +00:00
Zachary Turner
9222a2375f Fix the MinGW builder. Apparently std::call_once and
std::recursive_mutex are not available on MinGW and breaks the
builder.  Revert to using a function local static and sys::Mutex
just to get the tree green until we figure out a better solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-21 00:24:51 +00:00
Rafael Espindola
45fdc3d534 Always use a temp symbol for CIE.
Fixes pr19185.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211423 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 23:54:32 +00:00
Rafael Espindola
32b14f80c2 Use compact unwind for the iOS simulator.
Another step in fixing pr19185.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211416 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 22:40:55 +00:00
Rafael Espindola
a896f2bddb Use a helper function and clang-format.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211415 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 22:37:01 +00:00
Rafael Espindola
b019bb82be Delete dead code.
The compact unwind info is only used by code that knows it is supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211412 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 22:30:31 +00:00
Duncan P. N. Exon Smith
67291098a6 Support: Write ScaledNumber::getQuotient() and getProduct()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211409 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 21:47:47 +00:00
Rafael Espindola
85fdfe8efc Don't produce eh_frame relocations when targeting the IOS simulator.
First step for fixing pr19185.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211404 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 21:15:27 +00:00
Zachary Turner
91e18f7639 Revert "Replace Execution Engine's mutex with std::recursive_mutex."
This reverts commit 1f502bd9d7, due to
GCC / MinGW's lack of support for C++11 threading.

It's possible this will go back in after we come up with a
reasonable solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211401 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 21:07:14 +00:00
Reid Kleckner
5b8e73ef81 Generate native unwind info on Win64
This patch enables LLVM to emit Win64-native unwind info rather than
DWARF CFI.  It handles all corner cases (I hope), including stack
realignment.

Because the unwind info is not flexible enough to describe stack frames
with a gap of unknown size in the middle, such as the one caused by
stack realignment, I modified register spilling code to place all spills
into the fixed frame slots, so that they can be accessed relative to the
frame pointer.

Patch by Vadim Chugunov!

Reviewed By: rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211399 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 20:35:47 +00:00
Stepan Dyatkovskiy
81ed09a1d1 Commited patch from Björn Steinbrink:
Summary:
Different range metadata can lead to different optimizations in later
passes, possibly breaking the semantics of the merged function. So range
metadata must be taken into consideration when comparing Load
instructions.

Thanks!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211391 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 19:11:56 +00:00
Ulrich Weigand
e29fc75ea5 [RuntimeDyld] Fix ppc64 stub relocations on little-endian
When RuntimeDyldELF creates stub functions, it needs to install
relocations that will resolve to the final address of the target
routine. Since those are 16-bit relocs, they need to be applied to the
least-significant halfword of the instruction.  On big-endian ppc64,
this means that addresses have to be adjusted by 2, which is what the
code currently does.

However, on a little-endian system, the address must *not* be adjusted;
the least-significant halfword is the first one.  This patch updates the
RuntimeDyldELF code to take the target byte order into account.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211384 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 18:17:56 +00:00
Kevin Enderby
602941c737 Fix a warning about the use of const being ignored with a cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 18:07:34 +00:00
Ulrich Weigand
2a069ac1f3 [RuntimeDyld] Support more PPC64 relocations
This adds support for several missing PPC64 relocations in the
straight-forward manner to RuntimeDyldELF.cpp.

Note that this actually fixes a failure of a large-model test case on
PowerPC, allowing the XFAIL to be removed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211382 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:51:47 +00:00
Tom Stellard
c0bf939e80 R600/SI: Add patterns for ctpop inside a branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:06:11 +00:00
Tom Stellard
61d64acd0c R600/SI: Add a pattern for f32 ftrunc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211377 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:06:09 +00:00
Tom Stellard
2cda6e8ca6 R600: Expand vector flog2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211376 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:06:07 +00:00
Tom Stellard
2d245e2da4 R600: Expand vector fexp2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:06:05 +00:00
Tom Stellard
98b0736565 R600/SI: SI Control Flow Annotation bug fixed
Mixing of AddAvailableValue and GetValueAtEndOfBlock methods of SSAUpdater
leaded to the endless loop generation when the nested loops annotated.

This fixes a bug in the OCL_ML/KNN OpenCV test.  The test case is too
complex for FileCheck and would be very fragile.

Patch by: Elena Denisova

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211374 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:06:02 +00:00
Tom Stellard
538c95179c R600/SI: Add a VALU pattern for i64 xor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211373 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 17:05:57 +00:00
Ulrich Weigand
69e4786797 [PowerPC] Fix small argument stack slot offset for LE
When small arguments (structures < 8 bytes or "float") are passed in a
stack slot in the ppc64 SVR4 ABI, they must reside in the least
significant part of that slot.  On BE, this means that an offset needs
to be added to the stack address of the parameter, but on LE, the least
significant part of the slot has the same address as the slot itself.

This changes the PowerPC back-end ABI code to only add the small
argument stack slot offset for BE.  It also adds test cases to verify
the correct behavior on both BE and LE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211368 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 16:34:05 +00:00
Rafael Espindola
61b696f1fa Allow a target to create a null streamer.
Targets can assume that a target streamer is present, so they have to be able
to construct a null streamer in order to set the target streamer in it to.

Fixes a crash when using the null streamer with arm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211358 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 13:11:28 +00:00
Yaron Keren
ed4e8a839f The count() function for STL datatypes returns unsigned, even where it's
only 1/0 result like std::set. Some of the LLVM ADT already return unsigned
count(), while others still return bool count().

In continuation to r197879, this patch modifies DenseMap, DenseSet, 
ScopedHashTable, ValueMap:: count() to return size_type instead of bool,
1 instead of true and 0 instead of false.

size_type is typedef-ed locally within each class to size_t.

http://reviews.llvm.org/D4018

Reviewed by dblaikie.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211350 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 10:26:56 +00:00
Oliver Stannard
e5241cc488 Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size.
Emit the ARM build attributes ABI_PCS_wchar_t and ABI_enum_size based on
module flags metadata.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 10:08:11 +00:00
Zoran Jovanovic
a5efeb6b39 ps][mips64r6] Added LSA/DLSA instructions
Differential Revision: http://reviews.llvm.org/D3897


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211346 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 09:28:09 +00:00
Matt Arsenault
7d1f7798db R600: Trivial subtarget feature cleanups.
Remove an unused AMDIL leftover, correct extra periods
appearing in the help menu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211341 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 06:50:05 +00:00
Justin Bogner
14d8c9e550 ArgList: use MakeArgList overloads in subclasses and clean up some calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211340 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 04:36:29 +00:00
Karthik Bhat
d2ce9392dc Add Support to Recognize and Vectorize NON SIMD instructions in SLPVectorizer.
This patch adds support to recognize patterns such as fadd,fsub,fadd,fsub.../add,sub,add,sub... and
vectorizes them as vector shuffles if they are profitable.
These patterns of vector shuffle can later be converted to instructions such as addsubpd etc on X86.
Thanks to Arnold and Hal for the reviews. http://reviews.llvm.org/D4015 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211339 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 04:32:48 +00:00
Hans Wennborg
caa2bd600c Fix .cpp files claiming to be header files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211334 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 01:36:00 +00:00
Chandler Carruth
c577e71bf5 [x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW
instructions available as synthetic SDNodes PACKSS and PACKUS that will
select to the correct instruction variants based on the return type.
This allows us to use these rather important instructions when lowering
vector shuffles.

Also moves the relevant instruction definitions to be split out from
the fully generic multiclasses to allow them to match these new SDNodes
in the same way that the UNPCK instructions do.

No functionality should actually be changed here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211332 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 01:05:28 +00:00
Hans Wennborg
160dcf5b61 Don't build switch lookup tables for dllimport or TLS variables
We would previously put dllimport variables in switch lookup tables, which
doesn't work because the address cannot be used in a constant initializer.
This is basically the same problem that we have in PR19955.

Putting TLS variables in switch tables also desn't work, because the
address of such a variable is not constant.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211331 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 00:38:12 +00:00
Rafael Espindola
6fda71e05e Revert "Add StringMap::insert(pair) consistent with the standard associative container concept."
This reverts commit r211309.

It looks like it broke some bots:

http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211328 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-20 00:23:03 +00:00
Rafael Espindola
5c2871c781 Use the assignment operator.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 22:27:46 +00:00
Rafael Espindola
9eb38b233e Set missing options in LTOCodeGenerator::setTargetOptions.
Patch by Tom Roeder, I just added the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 22:14:12 +00:00
Kevin Enderby
c28016e413 Change the output of llvm-nm and llvm-size for Mach-O universal files (aka
fat files) to print “ (for architecture XYZ)” for fat files with more than
one architecture to be like what the darwin tools do for fat files.

Also clean up the Mach-O printing of archive membernames in llvm-nm to use
the darwin form of "libx.a(foo.o)".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 22:03:18 +00:00
Eric Christopher
d2f9358649 Add a new subtarget hook for whether or not we'd like to enable
the atomic load linked expander pass to run for a particular
subtarget. This requires a check of the subtarget and so save
the TargetMachine rather than only TargetLoweringInfo and update
all callers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 21:03:04 +00:00
David Blaikie
4110a7ac7a Add StringMap::insert(pair) consistent with the standard associative container concept.
Patch by Agustín Bergé.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211309 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 20:08:56 +00:00
Eric Christopher
edd372aba2 Fix up a few formatting issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 20:00:09 +00:00
Alp Toker
d06976aba7 Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211304 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 19:41:26 +00:00
Justin Bogner
f21de942f3 Support: Add llvm::sys::fs::copy_file
A function to copy one file's contents to another.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 19:35:39 +00:00
David Blaikie
f25c2015b3 Remove use of removed function, llvm_stop_multithreading
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211291 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 18:26:28 +00:00
Zachary Turner
a4d0ff9cd1 Remove support for LLVM runtime multi-threading.
After a number of previous small iterations, the functions
llvm_start_multithreaded() and llvm_stop_multithreaded() have
been reduced essentially to no-ops.  This change removes them
entirely.

Reviewed by: rnk, dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211287 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-19 18:18:23 +00:00