Evgeniy Stepanov [Mon, 31 Mar 2014 13:50:13 +0000 (13:50 +0000)]
[sanitizer] Test that we can compile C++ code on the target platform.
llvm-svn: 205184
Alexey Samsonov [Mon, 31 Mar 2014 13:45:36 +0000 (13:45 +0000)]
[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
Soon there will be an option to build compiler-rt parts as shared libraries
on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042
by Yuri Gribov.
llvm-svn: 205183
NAKAMURA Takumi [Mon, 31 Mar 2014 13:30:02 +0000 (13:30 +0000)]
llvm/test/MC/Mips/mips64r2/valid-xfail.s: This REQUIRES asserts. Seems it doesn't fail with -Asserts.
llvm-svn: 205182
Aaron Ballman [Mon, 31 Mar 2014 13:14:44 +0000 (13:14 +0000)]
Reapplying r204952 a second time.
Clean up the __has_attribute implementation without modifying its behavior.
Replaces the tablegen-driven AttrSpellings.inc, which lived in the lexing layer with AttrHasAttributeImpl.inc, which lives in the basic layer. Updates the preprocessor to call through to this new functionality which can take additional information into account (such as scopes and syntaxes).
Expose the ability for parts of the compiler to ask whether an attribute is supported for a given spelling (including scope), syntax, triple and language options.
llvm-svn: 205181
Daniel Sanders [Mon, 31 Mar 2014 12:13:12 +0000 (12:13 +0000)]
[mips] Added a full set of instruction test cases for all ISA's (but not ASE's).
Summary:
Where those ISA's are not currently supported, the test is run with the smallest
superset of that ISA.
Some instructions are valid but don't pass yet. These have been placed in the
valid-xfail.s's which will XPASS if _any_ instruction starts working.
The valid.s's do not verify the encoding yet. There are also no tests checking that instructions from neighbouring ISA's are not accepted.
Reviewers: matheusalmeida
Reviewed By: matheusalmeida
Differential Revision: http://llvm-reviews.chandlerc.com/D3214
llvm-svn: 205180
Hal Finkel [Mon, 31 Mar 2014 11:43:19 +0000 (11:43 +0000)]
Look at shuffles of build_vectors in DAGCombiner::visitEXTRACT_VECTOR_ELT
When the loop vectorizer vectorizes code that uses the loop induction variable,
we often end up with IR like this:
%b1 = insertelement <2 x i32> undef, i32 %v, i32 0
%b2 = shufflevector <2 x i32> %b1, <2 x i32> undef, <2 x i32> zeroinitializer
%i = add <2 x i32> %b2, <i32 2, i32 3>
If the add in this example is not legal (as is the case on PPC with VSX), it
will be scalarized, and we'll end up with a number of extract_vector_elt nodes
with the vector shuffle as the input operand, and that vector shuffle is fed by
one or more build_vector nodes. By the time that vector operations are
expanded, visitEXTRACT_VECTOR_ELT will not create new extract_vector_elt by
looking through the vector shuffle (to make sure that no illegal operations are
created), and so the extract_vector_elt -> vector shuffle -> build_vector is
never simplified to an operand of the build vector.
By looking at build_vectors through a shuffle we fix this particular situation,
preventing a vector from being built, only to be deconstructed again (for the
scalarized add) -- an expensive proposition when this all needs to be done via
the stack. We probably want a more comprehensive fix here where we look back
recursively through any shuffles to any build_vectors or scalar_to_vectors,
etc. but that can come later.
llvm-svn: 205179
Timur Iskhodzhanov [Mon, 31 Mar 2014 11:01:51 +0000 (11:01 +0000)]
Slightly improve the readability of MicrosoftVTableContext::computeVTablePaths(). No functionality changes.
llvm-svn: 205178
Daniel Sanders [Mon, 31 Mar 2014 11:00:04 +0000 (11:00 +0000)]
[mips] Check emitted code for llvm.bswap.i32 on MIPS16/MIPS64 and llvm.bswap.i64 on MIPS16.
While reviewing r204163, I noticed that the MIPS16 test only checked for a .ent
directive and didn't actually check the code emitted. Fixed this and added a
check for llvm.bswap.i32 on MIPS64 at the same time.
llvm-svn: 205177
Alexander Potapenko [Mon, 31 Mar 2014 10:51:13 +0000 (10:51 +0000)]
[TSan] Follow-up for r205175: typo fix in the test.
llvm-svn: 205176
Alexander Potapenko [Mon, 31 Mar 2014 10:46:07 +0000 (10:46 +0000)]
[TSan] Replace several Printf() calls with Report() to ease debugging.
llvm-svn: 205175
Tim Northover [Mon, 31 Mar 2014 10:21:36 +0000 (10:21 +0000)]
ARM64: fix a couple of signed/unsigned comparison warnings.
llvm-svn: 205174
Daniel Sanders [Mon, 31 Mar 2014 09:44:05 +0000 (09:44 +0000)]
[yaml2obj] Add support for ELF e_flags.
Summary:
The FileHeader mapping now accepts an optional Flags sequence that accepts
the EF_<arch>_<flag> constants. When not given, Flags defaults to zero.
Reviewers: atanasyan
Reviewed By: atanasyan
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3213
llvm-svn: 205173
Alexey Volkov [Mon, 31 Mar 2014 08:08:46 +0000 (08:08 +0000)]
Added _rdtsc intrinsics by Robert Khasanov
Differential Revision: http://llvm-reviews.chandlerc.com/D3212
llvm-svn: 205172
Alexey Samsonov [Mon, 31 Mar 2014 07:59:33 +0000 (07:59 +0000)]
Try to fix MSan bootstrap bot: make ARM64Disassembler::getInstruction() always initialize Size argument.
llvm-svn: 205171
Yaron Keren [Mon, 31 Mar 2014 07:59:14 +0000 (07:59 +0000)]
Correct OS conditionals following r204977 and r204978.
Previously, MinGW OS was Triple::MinGW and Cygwin was Triple::Cygwin
and now it is Triple::Win32 with Environment being GNU or Cygwin.
So,
TheTriple.getOS() == Triple::Win32
is replaced by
TheTriple.isWindowsMSVCEnvironment()
and
(TheTriple.getOS() == Triple::MinGW32 || TheTriple.getOS() == Triple::Cygwin)
is replaced by
TheTriple.isOSCygMing()
llvm-svn: 205170
Dmitri Gribenko [Mon, 31 Mar 2014 07:52:35 +0000 (07:52 +0000)]
Remove unused variable
llvm-svn: 205169
Kostya Serebryany [Mon, 31 Mar 2014 07:23:50 +0000 (07:23 +0000)]
[sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over)
llvm-svn: 205168
Tim Northover [Mon, 31 Mar 2014 07:20:13 +0000 (07:20 +0000)]
ARM64: remove currently trivial switch statement
llvm-svn: 205167
Craig Topper [Mon, 31 Mar 2014 06:53:13 +0000 (06:53 +0000)]
[C++11] Mark more classes in the X86 target as 'final'.
llvm-svn: 205166
Craig Topper [Mon, 31 Mar 2014 06:22:15 +0000 (06:22 +0000)]
Mark a couple of the X86 target classes as final. Allows the compiler to de-virtualize some internal calls.
llvm-svn: 205165
Alexey Bataev [Mon, 31 Mar 2014 03:36:38 +0000 (03:36 +0000)]
[OPENMP] Implemented 'copyin' clause
llvm-svn: 205164
Shankar Easwaran [Mon, 31 Mar 2014 03:16:37 +0000 (03:16 +0000)]
[core] support .gnu.linkonce sections
.gnu.linkonce sections are similar to section groups. They were supported before
section groups existed and provided a way to resolve COMDAT sections using a
different design. There are few implementations that use .gnu.linkonce sections
to store simple floating point constants which doesnot require complex section
group support but need a way to store only one copy of the floating point
constant. .gnu.linkonce based symbol resolution achieves that.
llvm-svn: 205163
NAKAMURA Takumi [Mon, 31 Mar 2014 01:10:26 +0000 (01:10 +0000)]
ARM64CollectLOH.cpp: Tweak \param. [-Wdocumentation]
llvm-svn: 205162
Chandler Carruth [Mon, 31 Mar 2014 00:02:10 +0000 (00:02 +0000)]
[ARM64] Fix materialization of an fp128 zero immediate. There currently
is not a pattern to lower this with clever instructions that zero the
register, so restrict the zero immediate legality special case to f64
and f32 (the only two sizes which fmov seems to directly support). Fixes
backend errors when building code such as libxml.
llvm-svn: 205161
Nico Weber [Sun, 30 Mar 2014 19:45:58 +0000 (19:45 +0000)]
Add documentation for the pcs attribute, based on r129534's commit message.
llvm-svn: 205160
Adam Nemet [Sun, 30 Mar 2014 18:07:13 +0000 (18:07 +0000)]
[X86] Adjust cost of FP_TO_UINT v8f32->v8i32
There is no direct AVX instruction to convert to unsigned. I have some ideas
how we may be able to do this with three vector instructions but the current
backend just bails on this to get it scalarized.
See the comment why we need to adjust the cost returned by BasicTTI.
The test is a bit roundabout (and checks assembly rather than bit code) because
I'd like it to work even if at some point we could vectorize this conversion.
Fixes <rdar://problem/
16371920>
llvm-svn: 205159
Tim Northover [Sun, 30 Mar 2014 17:32:48 +0000 (17:32 +0000)]
RTTI: refactor the uniqueness question into CGCXXABI.
This also brings the code into closer conformance with usual LLVM
coding style and other surrounding conventions.
llvm-svn: 205158
Stepan Dyatkovskiy [Sun, 30 Mar 2014 17:09:54 +0000 (17:09 +0000)]
PR18929:
According to ARM assembler language hash symbol is optional before immediates.
For example, see here for more details:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473j/dom1359731154529.html
llvm-svn: 205157
David Majnemer [Sun, 30 Mar 2014 16:38:02 +0000 (16:38 +0000)]
MS ABI: Correct typo in mangleStringLiteral
No functionality change.
llvm-svn: 205156
David Majnemer [Sun, 30 Mar 2014 16:30:54 +0000 (16:30 +0000)]
MS ABI: Simplify mangleTemplateArgs
No functionality change.
llvm-svn: 205154
Hal Finkel [Sun, 30 Mar 2014 15:10:18 +0000 (15:10 +0000)]
Make use of previously generated stores in SelectionDAGLegalize::ExpandExtractFromVectorThroughStack
When expanding EXTRACT_VECTOR_ELT and EXTRACT_SUBVECTOR using
SelectionDAGLegalize::ExpandExtractFromVectorThroughStack, we store the entire
vector and then load the piece we want. This is fine in isolation, but
generating a new store (and corresponding stack slot) for each extraction ends
up producing code of poor quality. When we scalarize a vector operation (using
SelectionDAG::UnrollVectorOp for example) we generate one EXTRACT_VECTOR_ELT
for each element in the vector. This used to generate one stored copy of the
vector for each element in the vector. Now we search the uses of the vector for
a suitable store before generating a new one, which results in much more
efficient scalarization code.
llvm-svn: 205153
NAKAMURA Takumi [Sun, 30 Mar 2014 15:09:08 +0000 (15:09 +0000)]
clang/test/Preprocessor/headermap-rel2.c: Recognize dos path.
llvm-svn: 205152
Tim Northover [Sun, 30 Mar 2014 14:59:12 +0000 (14:59 +0000)]
Use defined(__APPLE__) rather than __APPLE__
llvm-svn: 205150
Chandler Carruth [Sun, 30 Mar 2014 14:04:32 +0000 (14:04 +0000)]
Force a header file input to the headermap test to have different
contents than the header file by the same name under the system header
search root. Surprisingly, this is required to get the test to pass on
some systems.
So, it turns out that there exist filesystems in the world which unique
the inode of all files based on their contents. This results in two
files with the same contents at different paths suddenly having the same
inode. This doesn't actually cause any problems in practice as the
contents are the same, and the path used to access the files are the
same. However, it can cause tests like this one to be more brittle
because the file manager ends up de-duplicating the file entries by
inode. We don't have any other really easy ways to observe the behavior
shift because the whole point is that the #include written in the source
code doesn't contain the information -- instead it is contained in the
header map.
If folks have other solutions they would prefer, I'm more than happy to
work on them, but this seems a reasonable way to ensure that the test in
question exercises the code it wants to exercise.
llvm-svn: 205149
NAKAMURA Takumi [Sun, 30 Mar 2014 14:04:00 +0000 (14:04 +0000)]
llvm/test/MC/ELF/nocompression.s: Loosen an expression to match "llvm-mc.EXE".
llvm-svn: 205148
Chandler Carruth [Sun, 30 Mar 2014 13:40:57 +0000 (13:40 +0000)]
[ARM64] Use %clang_cc1 consistently in the new arm64 codegen tests.
Really, all tests outside of the Driver tree should use %clang_cc1, but
these are new and easy to fix, and many of them use buitlin headers
which don't work as well without using %clang_cc1.
llvm-svn: 205147
Hal Finkel [Sun, 30 Mar 2014 13:22:59 +0000 (13:22 +0000)]
[PowerPC] Handle VSX v2i64 SIGN_EXTEND_INREG
sitofp from v2i32 to v2f64 ends up generating a SIGN_EXTEND_INREG v2i64 node
(and similarly for v2i16 and v2i8). Even though there are no sign-extension (or
algebraic shifts) for v2i64 types, we can handle v2i32 sign extensions by
converting two and from v2i64. The small trick necessary here is to shift the
i32 elements into the right lanes before the i32 -> f64 step. This is because
of the big Endian nature of the system, we need the i32 portion in the high
word of the i64 elements.
For v2i16 and v2i8 we can do the same, but we first use the default Altivec
shift-based expansion from v2i16 or v2i8 to v2i32 (by casting to v4i32) and
then apply the above procedure.
llvm-svn: 205146
Hal Finkel [Sun, 30 Mar 2014 13:00:06 +0000 (13:00 +0000)]
[PowerPC] Make -pg generate calls to _mcount not mcount
At least on REL6 (Linux/glibc 2.12), the proper symbol for generating gprof
data is _mcount, not mcount. Prior to this change, compiling with -pg would
generate linking errors (because of unresolved references to mcount), after
this change -pg seems at least minimally functional.
llvm-svn: 205144
Chandler Carruth [Sun, 30 Mar 2014 12:07:07 +0000 (12:07 +0000)]
[Allocator] Lift the slab size and size threshold into template
parameters rather than runtime parameters.
There is only one user of these parameters and they are compile time for
that user. Making these compile time seems to better reflect their
intended usage as well.
llvm-svn: 205143
Chandler Carruth [Sun, 30 Mar 2014 12:05:24 +0000 (12:05 +0000)]
[Allocator] Remove forward declarations of BumpPtrAllocator. These
aren't necessary and will break when it changes to be a typedef of
a class template.
llvm-svn: 205142
Chandler Carruth [Sun, 30 Mar 2014 11:36:32 +0000 (11:36 +0000)]
[Allocator] Simplify unittests by using the default size parameters in
more places.
llvm-svn: 205141
Chandler Carruth [Sun, 30 Mar 2014 11:36:29 +0000 (11:36 +0000)]
[Allocator] Stop forward-declaring BumpPtrAllocator in a few places.
This is a necessary step to lifting some of its configuration into
template parameters rather than runtime parameters.
llvm-svn: 205140
Tim Northover [Sun, 30 Mar 2014 11:34:26 +0000 (11:34 +0000)]
ARM64: compare RTTI names as strings
ARM64 generates RTTI with hidden visibility, which means that typeinfo
must be compared char-by-char since it's not guaranteed to be uniqued
across the whole program.
llvm-svn: 205139
Tim Northover [Sun, 30 Mar 2014 11:34:22 +0000 (11:34 +0000)]
ARM64: use the alternate string layout on Apple platforms.
llvm-svn: 205138
Chandler Carruth [Sun, 30 Mar 2014 11:20:25 +0000 (11:20 +0000)]
Don't mark the declarations of the TSan annotation functions as weak.
That causes references to them to be weak references which can collapse
to null if no definition is provided. We call these functions
unconditionally, so a definition *must* be provided. Make the
definitions provided in the .cpp file weak by re-declaring them as weak
just prior to defining them. This should keep compilers which cannot
attach the weak attribute to the definition happy while actually
resolving the symbols correctly during the link.
You might ask yourself upon reading this commit log: how did *any* of
this work before? Well, fun story. It turns out we have some code in
Support (BumpPtrAllocator) which both uses virtual dispatch and has
out-of-line vtables used by that virtual dispatch. If you move the
virtual dispatch into its header in *just* the right way, the optimizer
gets to devirtualize, and remove all references to the vtable. Then the
sad part: the references to this one vtable were the only strong symbol
uses in the support library for llvm-tblgen AFAICT. At least, after
doing something just like this, these symbols stopped getting their weak
definition and random calls to them would segfault instead.
Yay software.
llvm-svn: 205137
Guillaume Papin [Sun, 30 Mar 2014 10:50:25 +0000 (10:50 +0000)]
clang-modernize: fix invalid assignment in findClangApplyReplacements()
Summary:
When clang-apply-replacements wasn't in the PATH or sitting next to
clang-modernize, findClangApplyReplacements() was finding the wrong path
(pointing to clang-modernize instead of nothing).
See the related PR at http://llvm.org/bugs/show_bug.cgi?id=18421
Reviewers: klimek
CC: silvas, cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3217
llvm-svn: 205136
Chandler Carruth [Sun, 30 Mar 2014 09:08:07 +0000 (09:08 +0000)]
[ARM64] Fix a heap-use-after-free spotted by ASan.
StringRef::lower() returns a std::string. Better yet, we can now stop
thinking about what it returns and write 'auto'. It does the right
thing. =]
llvm-svn: 205135
Tim Northover [Sun, 30 Mar 2014 08:30:28 +0000 (08:30 +0000)]
ARM64: uncopy/paste helper function
It was doing functional but highly suspect operations on bools due to
the more limited shifting operands supported by memory instructions.
Should fix some MSVC warnings.
llvm-svn: 205134
Tim Northover [Sun, 30 Mar 2014 07:35:48 +0000 (07:35 +0000)]
ARM64: remove unused variables
llvm-svn: 205133
Tim Northover [Sun, 30 Mar 2014 07:25:23 +0000 (07:25 +0000)]
ARM64: remove -m32/-m64 mapping with ARM.
This is causing the ARM build-bots to fail since they only include
the ARM backend and can't create an ARM64 target.
llvm-svn: 205132
Tim Northover [Sun, 30 Mar 2014 07:25:18 +0000 (07:25 +0000)]
ARM64: override all the things.
Actually, mostly only those in the top-level directory that already
had a "virtual" attached. But it's the thought that counts and it's
been a long day.
llvm-svn: 205131
Saleem Abdulrasool [Sun, 30 Mar 2014 07:19:31 +0000 (07:19 +0000)]
Support: correct Windows normalisation
If the environment is unknown and no object file is provided, then assume an
"MSVC" environment, otherwise, set the environment to the object file format.
In the case that we have a known environment but a non-native file format for
Windows (COFF) which is used for MCJIT, then append the custom file format to
the triple as an additional component.
This fixes the MCJIT tests on Windows.
llvm-svn: 205130
David Majnemer [Sun, 30 Mar 2014 06:44:54 +0000 (06:44 +0000)]
Sema: Implement DR317
Summary:
Declaring a function as inline after it has been defined is in violation
of [dcl.fct.spec]p4. The program would get a strong definition instead
of getting a function with linkonce_odr linkage.
Reviewers: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3220
llvm-svn: 205129
David Majnemer [Sun, 30 Mar 2014 06:34:26 +0000 (06:34 +0000)]
MS ABI: Simplify MangleByte
The delta between '\xe1' and '\xc1' is equivalent to the one between 'a'
and 'A'. This allows us to reuse the computation between '\xe1' and
'\xfa' for the '\xc1' to '\xda' case.
No functionality change.
llvm-svn: 205128
Richard Smith [Sun, 30 Mar 2014 06:05:29 +0000 (06:05 +0000)]
Tests for dr475-dr500.
llvm-svn: 205127
NAKAMURA Takumi [Sun, 30 Mar 2014 05:01:17 +0000 (05:01 +0000)]
Suppress llvm/test/CodeGen/ARM64 for targeting pecoff. ARM64 is unaware of that.
FIXME: Could we support them?
llvm-svn: 205126
NAKAMURA Takumi [Sun, 30 Mar 2014 05:01:04 +0000 (05:01 +0000)]
llvm/test/Transforms/LoopStrengthReduce/ARM64/lsr-*.ll: Add explicit triple arm64-unknown for targeting pecoff.
llvm-svn: 205125
NAKAMURA Takumi [Sun, 30 Mar 2014 04:35:00 +0000 (04:35 +0000)]
X86Subtarget.h: isTargetWindows() should tell whether he is targeting msvc.
FYI, !isWindowsGNUEnvironment() is insufficient. It missed cygwin.
FIXME: The name "isTargetWindows" should be fixed.
llvm-svn: 205124
Lang Hames [Sun, 30 Mar 2014 04:27:33 +0000 (04:27 +0000)]
[MC] Remove an unused (and broken) variant of the setupForSymbolicDisassembly
method in MCDisassembler.
llvm-svn: 205123
Lang Hames [Sun, 30 Mar 2014 03:47:00 +0000 (03:47 +0000)]
[PBQP] Move invalid graph nodeId/edgeId methods into base class.
llvm-svn: 205122
Rafael Espindola [Sun, 30 Mar 2014 03:26:17 +0000 (03:26 +0000)]
Add a missing break.
Patch by Tobias Güntner.
I tried to write a test, but the only difference is the Changed value that
gets returned. It can be tested with "opt -debug-pass=Executions -functionattrs,
but that doesn't seem worth it.
llvm-svn: 205121
Saleem Abdulrasool [Sun, 30 Mar 2014 03:22:37 +0000 (03:22 +0000)]
Support: normalize the default triple on Unix
This will fix cross-compiling buildbots (e.g. cygwin). This is in the same vein
as SVN r205070. Apply this to fix the cross-compiling scenario, even though the
preferred solution is to update the build system to normalize the embedded
triple rather than perform this at runtime every time. This is meant to tide us
over until that approach is fleshed out and applied.
llvm-svn: 205120
Rafael Espindola [Sun, 30 Mar 2014 02:33:01 +0000 (02:33 +0000)]
Remove dead declarations.
Patch by Tobias Güntner.
llvm-svn: 205119
Benjamin Kramer [Sat, 29 Mar 2014 20:16:23 +0000 (20:16 +0000)]
Remove outdated comment.
llvm-svn: 205117
Dmitri Gribenko [Sat, 29 Mar 2014 19:40:32 +0000 (19:40 +0000)]
Fix a few -Wdocumentation warnings
llvm-svn: 205116
Jason Molenda [Sat, 29 Mar 2014 19:29:04 +0000 (19:29 +0000)]
Include string.h for memset() prototype. Thanks Dmitri.
llvm-svn: 205115
Benjamin Kramer [Sat, 29 Mar 2014 19:21:20 +0000 (19:21 +0000)]
Detemplatize LOHDirective.
The ARM64 backend uses it only as a container to keep an MCLOHType and
Arguments around so give it its own little copy. The other functionality
isn't used and we had a crazy method specialization hack in place to
keep it working. Unfortunately that was incompatible with MSVC.
Also range-ify a couple of loops while at it.
llvm-svn: 205114
Jason Molenda [Sat, 29 Mar 2014 18:54:20 +0000 (18:54 +0000)]
lldb arm64 import.
These changes were written by Greg Clayton, Jim Ingham, Jason Molenda.
It builds cleanly against TOT llvm with xcodebuild. I updated the
cmake files by visual inspection but did not try a build. I haven't
built these sources on any non-Mac platforms - I don't think this
patch adds any code that requires darwin, but please let me know if
I missed something.
In debugserver, MachProcess.cpp and MachTask.cpp were renamed to
MachProcess.mm and MachTask.mm as they picked up some new Objective-C
code needed to launch processes when running on iOS.
llvm-svn: 205113
Benjamin Kramer [Sat, 29 Mar 2014 18:00:49 +0000 (18:00 +0000)]
ARM64: Remove unused helper function, make others static.
llvm-svn: 205112
Tim Northover [Sat, 29 Mar 2014 17:35:34 +0000 (17:35 +0000)]
Install: add arm_neon.h header back
I'd gone too far pruning aarch64_simd.h this time and took out one
instance of arm_neon.h. This should restore us to the status quo.
llvm-svn: 205111
Benjamin Kramer [Sat, 29 Mar 2014 17:17:15 +0000 (17:17 +0000)]
tblgen: Twinify PrintFatalError.
No functionality change.
llvm-svn: 205110
Tim Northover [Sat, 29 Mar 2014 16:59:27 +0000 (16:59 +0000)]
TableGen: don't save a StringRef to a local std::string.
This caused a failure in some Windows builds.
llvm-svn: 205109
Benjamin Kramer [Sat, 29 Mar 2014 16:54:29 +0000 (16:54 +0000)]
Avoid storing Twines.
While there nested ifs into a helper function. No functionality change.
llvm-svn: 205108
Benjamin Kramer [Sat, 29 Mar 2014 16:54:24 +0000 (16:54 +0000)]
Avoid a local Twine variable.
Harmless in this case but potentially dangerous if it gets extended some day.
llvm-svn: 205107
Hal Finkel [Sat, 29 Mar 2014 16:04:40 +0000 (16:04 +0000)]
[PowerPC] Handle v2i64 comparisons
v2i64 is a legal type under VSX, however we don't have native vector
comparisons. We can handle eq/ne by casting it to an Altivec type, but
everything else must be expanded.
llvm-svn: 205106
Tim Northover [Sat, 29 Mar 2014 15:35:57 +0000 (15:35 +0000)]
ARM64: format register strings without creating a local Twine.
It was causing horrible failures on some build-bots.
llvm-svn: 205105
Tim Northover [Sat, 29 Mar 2014 15:26:07 +0000 (15:26 +0000)]
ARM64: Fix GCC warning in CGBuiltin.cpp
llvm-svn: 205104
Tim Northover [Sat, 29 Mar 2014 15:21:06 +0000 (15:21 +0000)]
Remove stray references to aarch64_simd.h
They were causing the autotools builds to fail.
llvm-svn: 205103
Logan Chien [Sat, 29 Mar 2014 15:10:22 +0000 (15:10 +0000)]
llvm-mc: Fix build breakage caused by r205050.
When LLVM is not built with zlib, nocompression.s will test
for the error message. But this test case will cause breakage
because the exit code is non-zero. This commit fix this issue
by adding "not" to the command.
llvm-svn: 205102
Tim Northover [Sat, 29 Mar 2014 15:09:55 +0000 (15:09 +0000)]
CodeGen: Allow different RTTI emission strategies
Some ABIs and C++ libraries may make different trade-offs in how RTTI
is emitted (currently with respect to visibility and so on). This
implements one scheme, as used by ARM64.
llvm-svn: 205101
Tim Northover [Sat, 29 Mar 2014 15:09:45 +0000 (15:09 +0000)]
ARM64: initial clang support commit.
This adds Clang support for the ARM64 backend. There are definitely
still some rough edges, so please bring up any issues you see with
this patch.
As with the LLVM commit though, we think it'll be more useful for
merging with AArch64 from within the tree.
llvm-svn: 205100
David Majnemer [Sat, 29 Mar 2014 14:19:55 +0000 (14:19 +0000)]
CodeGen: Don't crash when replacing functions
The peculiarities of C99 create scenario where an LLVM IR function
declaration may need to be replaced with a definition baring a different
type because the prototype and definition are not required to agree.
However, we were not properly deferring this when it occurred.
This fixes PR19280.
llvm-svn: 205099
Tim Northover [Sat, 29 Mar 2014 13:42:40 +0000 (13:42 +0000)]
ARM64: parametrise IVar offset type (long on ARM64, int elsewhere).
This is part of the ARM64 patch, but can only be tested properly when
the full codegen gets committed.
llvm-svn: 205098
Tim Northover [Sat, 29 Mar 2014 13:28:05 +0000 (13:28 +0000)]
ObjC: allow targets to decide when to use stret for blocks.
This was originally part of the ARM64 patch, but seems semantically
separate.
llvm-svn: 205097
Hal Finkel [Sat, 29 Mar 2014 13:20:31 +0000 (13:20 +0000)]
[PowerPC] VSX instruction latency corrections
The vector divide and sqrt instructions have high latencies, and the scalar
comparisons are like all of the others. On the P7, permutations take an extra
cycle over purely-simple vector ops.
llvm-svn: 205096
Tim Northover [Sat, 29 Mar 2014 13:16:12 +0000 (13:16 +0000)]
Driver: implement addClangWarningOptions
This function allows certain platforms to enable or disable diagnostics
by default.
llvm-svn: 205095
Stepan Dyatkovskiy [Sat, 29 Mar 2014 13:12:40 +0000 (13:12 +0000)]
Recommitted fix for PR18931, with extended tests set.
Issue subject: Crash using integrated assembler with immediate arithmetic
Fix description:
Expressions like 'cmp r0, #(l1 - l2) >> 3' could not be evaluated on asm parsing stage,
since it is impossible to resolve labels on this stage. In the end of stage we still have
expression (MCExpr).
Then, when we want to encode it, we expect it to be an immediate, but it still an expression.
Patch introduces a Fixup (MCFixup instance), that is processed after main encoding stage.
llvm-svn: 205094
Tim Northover [Sat, 29 Mar 2014 11:51:49 +0000 (11:51 +0000)]
ARM64: use 64-bit constant even on 32-bit machines
Another existing bot failure so no tests.
llvm-svn: 205093
Tim Northover [Sat, 29 Mar 2014 11:47:07 +0000 (11:47 +0000)]
ARM64: change format specifier to work on 32-bit targets
Existing tests were failing.
llvm-svn: 205092
Chandler Carruth [Sat, 29 Mar 2014 11:07:40 +0000 (11:07 +0000)]
[ARM64] Fix 'assert("...")' to be 'assert(0 && "...")'. Otherwise, it is
no assert at all. ;] Some of these should probably be switched to
llvm_unreachable, but I didn't want to perturb the behavior in this
patch.
Found by -Wstring-conversion, which I'll try to turn on in CMake builds
at least as it is finding useful things.
llvm-svn: 205091
Tim Northover [Sat, 29 Mar 2014 10:18:08 +0000 (10:18 +0000)]
ARM64: initial backend import
This adds a second implementation of the AArch64 architecture to LLVM,
accessible in parallel via the "arm64" triple. The plan over the
coming weeks & months is to merge the two into a single backend,
during which time thorough code review should naturally occur.
Everything will be easier with the target in-tree though, hence this
commit.
llvm-svn: 205090
Tim Northover [Sat, 29 Mar 2014 09:03:22 +0000 (09:03 +0000)]
TableGen: avoid dereferencing nullptr variable
ARM64 ended up reaching odder parts of TableGen alias generation than
current backends and caused a segfault.
llvm-svn: 205089
Tim Northover [Sat, 29 Mar 2014 09:03:18 +0000 (09:03 +0000)]
CodeGen: add sensible defaults for the ISD::FROUND operation
Some exotic types didn't know how to handle FROUND, which ARM64 uses.
llvm-svn: 205088
Tim Northover [Sat, 29 Mar 2014 09:03:13 +0000 (09:03 +0000)]
MC-exceptions: add support for compact-unwind without .eh_frame
ARM64 has compact-unwind information, but doesn't necessarily want to
emit .eh_frame directives as well. This teaches MC about such a
situation so that it will skip .eh_frame info when compact unwind has
been successfully produced.
For functions incompatible with compact unwind, the normal information
is still written.
llvm-svn: 205087
Tim Northover [Sat, 29 Mar 2014 08:22:29 +0000 (08:22 +0000)]
CodeGenPrep: wrangle IR to exploit AArch64 tbz/tbnz inst.
Given IR like:
%bit = and %val, #imm-with-1-bit-set
%tst = icmp %bit, 0
br i1 %tst, label %true, label %false
some targets can emit just a single instruction (tbz/tbnz in the
AArch64 case). However, with ISel acting at the basic-block level, all
three instructions need to be together for this to be possible.
This adds another transformation to CodeGenPrep to expose these
opportunities, if targets opt in via the hook.
llvm-svn: 205086
Tim Northover [Sat, 29 Mar 2014 08:22:20 +0000 (08:22 +0000)]
MC: add a RefKind field to MCValue
This is principally to allow neater mapping of fixups to relocations
in ARM64 ELF. Without this, there isn't enough information available
to GetRelocType, leading to many more fixup_arm64_... enumerators.
llvm-svn: 205085
Tim Northover [Sat, 29 Mar 2014 07:34:53 +0000 (07:34 +0000)]
MachO: Add linker-optimisation hint framework to MC.
Another part of the ARM64 backend (so tests will be following soon).
This is currently used by the linker to relax adrp/ldr pairs into nops
where possible, though could well be more broadly applicable.
llvm-svn: 205084
Tim Northover [Sat, 29 Mar 2014 07:33:24 +0000 (07:33 +0000)]
MachO: actually set linker-private prefix at MC level.
This was accidentally omitted from r205081.
llvm-svn: 205083
Jason Molenda [Sat, 29 Mar 2014 07:11:52 +0000 (07:11 +0000)]
Link against the zlib solib, required to build against TOT llvm.
llvm-svn: 205082
Tim Northover [Sat, 29 Mar 2014 07:05:06 +0000 (07:05 +0000)]
MachO: allow each section to have a linker-private symbol
The upcoming ARM64 backend doesn't have section-relative relocations,
so we give each section its own symbol to provide this functionality.
Of course, it doesn't need to appear in the final executable, so
linker-private is the best kind for this purpose.
llvm-svn: 205081