Commit Graph

20307 Commits

Author SHA1 Message Date
Tim Northover
ed839120c4 ARM64: add intrinsic for pmull (p64 x p64 = p128) operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 12:22:37 +00:00
David Blaikie
a07c1ab4e6 DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference
This moves one case of raw text checking down into the MCStreamer
interfaces in the form of a virtual function, even if we ultimately end
up consolidating on the one-or-many line tables issue one day, this is
nicer in the interim. This just generally streamlines a bunch of use
cases into a common code path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205287 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 08:07:52 +00:00
David Blaikie
5b2de5dd3d DebugInfo: Emit relocation to debug_line section when emitting asm for asm
I don't think this is reachable by any frontend (why would you transform
asm to asm+debug info?) but it helps tidy up some of this code, avoid
the weird special case of "emit the first CU, store the label, then emit
the rest" in MCDwarfLineTable::Emit by instead having the
DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by
registering the label of the debug_line section, thus causing it to be
emitted. (with a special case in asm output to just emit the label since
asm output uses the .loc directives, etc, rather than the debug_loc
directly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205286 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 07:35:52 +00:00
Adrian Prantl
75b7b95687 Remove FIXMEs. The scope of a Variable is always a lexical scope; there is
nothing to be gained from switching this over to a DIScopeRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205281 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 03:50:01 +00:00
Adrian Prantl
1a2786b900 LTO type uniquing: store the Decl field of a DIImportedEntity as a DIRef.
No other functionality changes, DIBuilder testcase is included in a paired
CFE commit.

This relaxes the assertion in isScopeRef to also accept subclasses of
DIScope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205279 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 03:41:04 +00:00
Adrian Prantl
e977127a9d Add a comment about type-uniquing ObjC types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205277 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 03:40:59 +00:00
David Blaikie
e94fe0423e Comment to describe the debug_loc.dwo constants
Code review feedback from Eric Christopher on r204697

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205268 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 23:50:20 +00:00
Hal Finkel
6bbb01bbf8 Move partial/runtime unrolling late in the pipeline
The generic (concatenation) loop unroller is currently placed early in the
standard optimization pipeline. This is a good place to perform full unrolling,
but not the right place to perform partial/runtime unrolling. However, most
targets don't enable partial/runtime unrolling, so this never mattered.

However, even some x86 cores benefit from partial/runtime unrolling of very
small loops, and follow-up commits will enable this. First, we need to move
partial/runtime unrolling late in the optimization pipeline (importantly, this
is after SLP and loop vectorization, as vectorization can drastically change
the size of a loop), while keeping the full unrolling where it is now. This
change does just that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 23:23:51 +00:00
Joerg Sonnenberger
d73449481d Shifting into the sign bit is UB as discussed on IRC. Explicitly use the
BitWord type for the constants to avoid this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 22:53:57 +00:00
Juergen Ributzka
d8c9577764 [Stackmaps] Update the stackmap format to use 64-bit relocations for the function address and properly align all entries.
This commit updates the stackmap format to version 1 to indicate the
reorganizaion of several fields. This was done in order to align stackmap
entries to their natural alignment and to minimize padding.

Fixes <rdar://problem/16005902>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205254 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 22:14:04 +00:00
Matt Arsenault
8d8c507bbf Change shouldSplitVectorElementType to better match the description.
Pass the entire vector type, and not just the element.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 20:54:58 +00:00
Rui Ueyama
f2529ba127 Fix MSVC warning.
This patch is to fix the following warning when compiled with MSVC 64 bit.

  warning C4334: '<<' : result of 32-bit shift implicitly converted to 64
  bits (was 64-bit shift intended?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205245 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 20:04:37 +00:00
Rafael Espindola
c298307ae6 Don't relocate with sections if there might be a paired relocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205240 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 19:00:23 +00:00
Hal Finkel
adbf9764ae Add a TLI hook to control when BUILD_VECTOR might be expanded using shuffles
There are two general methods for expanding a BUILD_VECTOR node:
  1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle
     them together.
  2. Build the vector on the stack and then load it.

Currently, we use a fixed heuristic: If there are only one or two unique
defined values, then we attempt an expansion in terms of SCALAR_TO_VECTOR and
vector shuffles (provided that the required shuffle mask is legal). Otherwise,
always expand via the stack. Even when SCALAR_TO_VECTOR is not legal, this
can still be a good idea depending on what tricks the target can play when
lowering the resulting shuffle. If the target can't do anything special,
however, and if SCALAR_TO_VECTOR is expanded via the stack, this heuristic
leads to sub-optimal code (two stack loads instead of one).

Because only the target knows whether the SCALAR_TO_VECTORs and shuffles for a
build vector of a particular type are likely to be optimial, this adds a new
TLI function: shouldExpandBuildVectorWithShuffles which takes the vector type
and the count of unique defined values. If this function returns true, then
method (1) will be used, subject to the constraint that all of the necessary
shuffles are legal (as determined by isShuffleMaskLegal). If this function
returns false, then method (2) is always used.

This commit does not enhance the current code to support expanding a
build_vector with more than two unique values using shuffles, but I'll commit
an implementation of the more-general case shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 17:48:10 +00:00
Tim Northover
13277a78bc ARM64: add more scalar patterns for reciprocal ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 15:46:22 +00:00
Tim Northover
8f93e159ed ARM64: add i64 scalar pattern for @llvm.arm64.abs
This will be used by the Clang front-end code for vabsd_s64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 15:46:17 +00:00
Daniel Sanders
857d651ba4 [mips] Remove R_MIPS_GOT which isn't used and shares the same number as R_MIPS_GOT16
Unlike my previous commit, don't try to remove the corresponding VK_Mips_GOT yet
even though it shares the same assembly text since that is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 14:47:41 +00:00
Daniel Sanders
1df2ed27dd Revert r205194 - [mips] Removed R_MIPS_GOT. It's identical to R_MIPS_GOT16.
There's a couple additional bits I missed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 14:34:36 +00:00
Daniel Sanders
1200528f17 [mips] Removed R_MIPS_GOT. It's identical to R_MIPS_GOT16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 14:30:05 +00:00
Dmitri Gribenko
9982159d26 Remove unused private typedef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205190 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 14:14:13 +00:00
Daniel Sanders
002ba57eb7 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205173 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31 09:44:05 +00:00
Chandler Carruth
368a977298 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205143 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 12:07:07 +00:00
Chandler Carruth
7c5042f86b [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205140 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 11:36:29 +00:00
Chandler Carruth
6da21c0e33 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205137 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 11:20:25 +00:00
Lang Hames
79300d8d9a [MC] Remove an unused (and broken) variant of the setupForSymbolicDisassembly
method in MCDisassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 04:27:33 +00:00
Lang Hames
b926af7274 [PBQP] Move invalid graph nodeId/edgeId methods into base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205122 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 03:47:00 +00:00
Rafael Espindola
6c449e8fa6 Remove dead declarations.
Patch by Tobias Güntner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205119 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 02:33:01 +00:00
Benjamin Kramer
0d71a03100 Remove outdated comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205117 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 20:16:23 +00:00
Benjamin Kramer
190e0a1d63 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205114 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 19:21:20 +00:00
Benjamin Kramer
abe43b546b tblgen: Twinify PrintFatalError.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205110 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 17:17:15 +00:00
Tim Northover
7b837d8c75 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205090 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 10:18:08 +00:00
Tim Northover
bc702ae152 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205087 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 09:03:13 +00:00
Tim Northover
1db780ba22 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205086 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 08:22:29 +00:00
Tim Northover
8a272f00a0 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 08:22:20 +00:00
Tim Northover
1330ee3189 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205084 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 07:34:53 +00:00
Tim Northover
c5d592d5d2 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205081 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 07:05:06 +00:00
Tim Northover
42529ad33a Make GetCPISymbol a virtual method.
ARM64 for iOS is going to want to emit these symbols in a
linker-private style for efficiency, but other targets probably don't
want that behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 07:04:59 +00:00
Tim Northover
7c3e057ff4 Intrinsics: add LLVMHalfElementsVectorType constraint
This is like the LLVMMatchType, except the verifier checks that the
second argument is a vector with the same base type and half the
number of elements.

This will be used by the ARM64 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205079 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 07:04:54 +00:00
Rafael Espindola
224dbf4aec Completely rewrite ELFObjectWriter::RecordRelocation.
I started trying to fix a small issue, but this code has seen a small fix too
many.

The old code was fairly convoluted. Some of the issues it had:

* It failed to check if a symbol difference was in the some section when
  converting a relocation to pcrel.
* It failed to check if the relocation was already pcrel.
* The pcrel value computation was wrong in some cases (relocation-pc.s)
* It was missing quiet a few cases where it should not convert symbol
  relocations to section relocations, leaving the backends to patch it up.
* It would not propagate the fact that it had changed a relocation to pcrel,
  requiring a quiet nasty work around in ARM.
* It was missing comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-29 06:26:49 +00:00
Justin Bogner
a655710ce0 Support: Functions for writing endian specific data to streams.
This adds a new header, EndianStream.h, which supplies an adaptor for
writing endian specific data to a raw_ostream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 19:14:43 +00:00
Rafael Espindola
3a2bbc9bf4 Add const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205013 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 16:06:09 +00:00
Christian Pirker
1f072c36d0 Add ARM big endian Target (armeb, thumbeb)
Reviewed at http://llvm-reviews.chandlerc.com/D3095



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205007 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 14:35:30 +00:00
Tim Northover
b7de4288bc Intrinsics: expand semantics of LLVMExtendedVectorType (& trunc)
These are used in the ARM backends to aid type-checking on patterns involving
intrinsics. By making sure one argument is an extended/truncated version of
another.

However, there's no reason to limit them to just vectors types. For example
AArch64 has the instruction "uqshrn sD, dN, #imm" which would naturally use an
intrinsic taking an i64 and returning an i32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205003 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 12:31:39 +00:00
Chandler Carruth
efb8deb640 [Allocator Cleanup] Sink the private data members and methods to the
bottom of the interface to make it easier to scan and find the public
API.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204996 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 09:18:42 +00:00
Chandler Carruth
0e4c26eedc [Allocator Cleanup] Move generic pointer alignment helper out of an
out-of-line private static method and into the collection of inline
alignment helpers in MathExtras.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 09:08:14 +00:00
Chandler Carruth
415a008ad2 [Allocator Cleanup] Make the growth of the "slab" size of the
BumpPtrAllocator significantly less strange by making it a simple
function of the number of slabs allocated rather than by making it
a recurrance. I *think* the previous behavior was essentially that the
size of the slabs would be doubled after the first 128 were allocated,
and then doubled again each time 64 more were allocated, but only if
every allocation packed perfectly into the slab size. If not, the wasted
space wouldn't be counted toward increasing the size, but allocations
over the size threshold *would*. And since the allocations over the size
threshold might be much larger than the slab size, this could have
somewhat surprising consequences where we rapidly grow the slab size.

This currently requires adding state to the allocator to track the
number of slabs currently allocated, but that isn't too bad. I'm
planning further changes to the allocator that will make this state fall
out even more naturally.

It still doesn't fully decouple the growth rate from the allocations
which are over the size threshold. That fix is coming later.

This specific fix will allow making the entire thing into a more
stateless device and lifting the parameters into template parameters
rather than runtime parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204993 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 08:53:25 +00:00
David Blaikie
2559cde2e8 PBQP: Minor cleanups to r204857
* Use assignment instead of swap (since the original value is being
  destroyed anyway)

* Rename "updateAdjEdgeId" to "setAdjEdgeId"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204983 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 23:42:21 +00:00
Manman Ren
d9524d66cd Provide a target override for the cost of using a callee-saved register
for the first time.

Thanks Andy for the discussion.
rdar://16162005


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204979 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 23:10:04 +00:00
Saleem Abdulrasool
2ea701e67a Canonicalise Windows target triple spellings
Construct a uniform Windows target triple nomenclature which is congruent to the
Linux counterpart.  The old triples are normalised to the new canonical form.
This cleans up the long-standing issue of odd naming for various Windows
environments.

There are four different environments on Windows:

MSVC: The MS ABI, MSVCRT environment as defined by Microsoft
GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries
Itanium: The MSVCRT environment + libc++ built with Itanium ABI
Cygnus: The Cygwin environment which uses custom libraries for everything

The following spellings are now written as:

i686-pc-win32 => i686-pc-windows-msvc
i686-pc-mingw32 => i686-pc-windows-gnu
i686-pc-cygwin => i686-pc-windows-cygnus

This should be sufficiently flexible to allow us to target other windows
environments in the future as necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204977 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 22:50:05 +00:00
Lang Hames
d21857ce15 Temporarily remove assert while I dig in to issues that it's causing for LLDB.
<rdar://problem/16349536>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204975 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 22:45:42 +00:00
Rui Ueyama
e159d3ec4a Revert "[C++11] Do not check __GXX_EXPERIMENTAL_CXX0X__."
This reverts commit r204964 because it disabled "= delete", "constexpr"
and "explicit" on GCC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204973 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 22:36:06 +00:00
Rui Ueyama
72f0f26d3b [C++11] Do not check __GXX_EXPERIMENTAL_CXX0X__.
Summary: Checking the experimental flag for C++0x is no longer needed.

Differential Revision: http://llvm-reviews.chandlerc.com/D3206

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204964 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 21:56:29 +00:00
Rafael Espindola
74dcb03fa9 Remove another unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204961 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:49:35 +00:00
David Blaikie
0a0c4cc56f DebugInfo: Support for compressed debug info sections
1) When creating a .debug_* section and instead create a .zdebug_
   section.
2) When creating a fragment in a .zdebug_* section, make it a compressed
   fragment.
3) When computing the size of a compressed section, compress the data
   and use the size of the compressed data.
4) Emit the compressed bytes.

Also, check that only if a section has a compressed fragment, then that
is the only fragment in the section.

Assert-fail if the fragment's data is modified after it is compressed.

Initial review on llvm-commits by Eric Christopher and Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204958 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:45:58 +00:00
David Blaikie
8040d49d85 DebugInfo: TargetOptions/MCAsmInfo support for compressed debug info sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204957 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:45:41 +00:00
Rafael Espindola
0c0cd3a4ee Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204956 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:41:17 +00:00
Rafael Espindola
f165cf7ce8 Prevent alias from pointing to weak aliases.
This adds back r204781.

Original message:

Aliases are just another name for a position in a file. As such, the
regular symbol resolutions are not applied. For example, given

define void @my_func() {
  ret void
}
@my_alias = alias weak void ()* @my_func
@my_alias2 = alias void ()* @my_alias

We produce without this patch:

        .weak   my_alias
my_alias = my_func
        .globl  my_alias2
my_alias2 = my_alias

That is, in the resulting ELF file my_alias, my_func and my_alias are
just 3 names pointing to offset 0 of .text. That is *not* the
semantics of IR linking. For example, linking in a

@my_alias = alias void ()* @other_func

would require the strong my_alias to override the weak one and
my_alias2 would end up pointing to other_func.

There is no way to represent that with aliases being just another
name, so the best solution seems to be to just disallow it, converting
a miscompile into an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204934 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 15:26:56 +00:00
Chandler Carruth
a7a255f8af [cleanup] Run clang-format over these routines to remove formatting
differences from subsequent diffs, and ease review. Going to be
performing some major surgery to simplify this stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204908 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 09:56:23 +00:00
Chandler Carruth
9e7e3e32c8 [cleanup] Modernize doxygen comments for the BumpPtrAllocator and
rewrite some of them to be more clear.

The terminology being used in our allocators is making me really sad. We
call things slab allocators that aren't at all slab allocators. It is
quite confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204907 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 09:53:31 +00:00
Lang Hames
229897211b Add missing #include <cassert> to MCSymbolizer.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204894 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 02:58:32 +00:00
Lang Hames
af0682b887 Assert that MCSymbolizer is constructed with a valid (or at least non-null)
RelocationInfo argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204893 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 02:49:18 +00:00
Lang Hames
7f8e6b9a5d Move MCSymbolizer's constructor into header. It's trivial - there's no need for
it to be out-of-line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204892 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 02:42:52 +00:00
Lang Hames
7fd03c55f3 Update MCSymbolizer and its subclasses' constructors to reflect the fact that
they take ownership of the RelocationInfo they're constructed with.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204891 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 02:39:01 +00:00
Justin Bogner
11d89f4c27 llvm-cov: When reading strings in gcov data, skip leading zeros
It seems that gcov, when faced with a string that is apparently zero
length, just keeps reading words until it finds a length it likes
better. I'm not really sure why this is, but it's simple enough to
make llvm-cov follow suit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204881 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 00:06:36 +00:00
Lang Hames
3a0a1f68ff Simplify PBQP graph removeAdjEdgeId implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204857 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 21:21:53 +00:00
Eli Bendersky
1003e8fbfa Fix problem with r204836
In CallInst, op_end() points at the callee, which we don't want to iterate over
when just iterating over arguments. Now take this into account when returning
a iterator_range from arg_operands. Similar reasoning for InvokeInst.

Also adds a unit test to verify this actually works as expected.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204851 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 20:41:15 +00:00
Lang Hames
2ca8b98cdb Remove PBQP-cost dimension sanity assertion in PBQP::Graph::addConstructedEdge.
We're already effectively checking sanity for that in PBQP::Graph::addEdge.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204844 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 19:22:51 +00:00
Lang Hames
ec97f95442 Change the PBQP graph adjacency list structure from std::set to std::vector.
The edge data structure (EdgeEntry) now holds the indices of its entries in the
adjacency lists of the nodes it connects. This trades a little ugliness for
faster insertion/removal, which is now O(1) with a cheap constant factor. All
of this is implementation detail within the PBQP graph, the external API remains
unchanged.

Individual register allocations are likely to change, since the adjacency lists
will now be ordered differently (or rather, will now be unordered). This
shouldn't affect the average quality of allocations however.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204841 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 18:58:00 +00:00
Juergen Ributzka
50c385683c [MCJIT] Check if there have been errors during RuntimeDyld execution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204837 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 18:19:27 +00:00
Eli Bendersky
65a3ced86f Enable range-for iteration over call/invoke arguments.
Similar to r204835



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204836 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 18:18:02 +00:00
Eli Bendersky
cf2de5a970 Add args() iteartor adapter to Function, for range-for loops.
This patch is in similar vein to what done earlier to Module::globals/aliases
etc. It allows to iterate over function arguments like this:

  for (Argument Arg : F.args()) {
    ...
  }



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 18:04:27 +00:00
Tim Northover
fc4fa22846 ARM: add intrinsics for the v8 ldaex/stlex
We've already got versions without the barriers, so this just adds IR-level
support for generating the new v8 ones.

rdar://problem/16227836

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204813 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 14:39:31 +00:00
Renato Golin
58839f43de Change @llvm.clear_cache default to call rt-lib
After some discussion on IRC, emitting a call to the library function seems
like a better default, since it will move from a compiler internal error to
a linker error, that the user can work around until LLVM is fixed.

I'm also adding a note on the responsibility of the user to confirm that
the cache was cleared on platforms where nothing is done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204806 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 14:01:32 +00:00
Renato Golin
c4b058f9e7 Add @llvm.clear_cache builtin
Implementing the LLVM part of the call to __builtin___clear_cache
which translates into an intrinsic @llvm.clear_cache and is lowered
by each target, either to a call to __clear_cache or nothing at all
incase the caches are unified.

Updating LangRef and adding some tests for the implemented architectures.
Other archs will have to implement the method in case this builtin
has to be compiled for it, since the default behaviour is to bail
unimplemented.

A Clang patch is required for the builtin to be lowered into the
llvm intrinsic. This will be done next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204802 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 12:52:28 +00:00
Rafael Espindola
72db10a995 Revert "Prevent alias from pointing to weak aliases."
This reverts commit r204781.

I will follow up to with msan folks to see what is what they
were trying to do with aliases to weak aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204784 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 06:14:40 +00:00
Rafael Espindola
33845aa8c4 Prevent alias from pointing to weak aliases.
Aliases are just another name for a position in a file. As such, the
regular symbol resolutions are not applied. For example, given

define void @my_func() {
  ret void
}
@my_alias = alias weak void ()* @my_func
@my_alias2 = alias void ()* @my_alias

We produce without this patch:

        .weak   my_alias
my_alias = my_func
        .globl  my_alias2
my_alias2 = my_alias

That is, in the resulting ELF file my_alias, my_func and my_alias are
just 3 names pointing to offset 0 of .text. That is *not* the
semantics of IR linking. For example, linking in a

@my_alias = alias void ()* @other_func

would require the strong my_alias to override the weak one and
my_alias2 would end up pointing to other_func.

There is no way to represent that with aliases being just another
name, so the best solution seems to be to just disallow it, converting
a miscompile into an error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204781 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 04:48:47 +00:00
Rafael Espindola
78f7e6f04f Use Endian.h to simplify this code a bit.
While at it, factor some logic into FragmentWriter. This will allow more code
to be factored out of the fairly large ELFObjectWriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204765 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 22:43:53 +00:00
Duncan P. N. Exon Smith
27e1ca8189 blockfreq: Implement Pass::releaseMemory()
Implement Pass::releaseMemory() in BlockFrequencyInfo and
MachineBlockFrequencyInfo.  Just delete the private implementation when
not in use.  Switch to a std::unique_ptr to make the logic more clear.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204741 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 18:01:38 +00:00
Duncan P. N. Exon Smith
8451e1baa9 blockfreq: Use const in MachineBlockFrequencyInfo
<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204740 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 18:01:32 +00:00
Benjamin Kramer
33ffbdf057 Add missing slash to make the doxygen output less confusing.
PR19187.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204731 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 17:20:28 +00:00
David Blaikie
b13d54f588 DebugInfo: Support debug_loc under fission
Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping
this section.

Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the
debug_loc.dwo section has more variation than the standard debug_loc,
allowing 3 different forms of entry (plus the end of list entry). GCC
seems to, and Clang certainly, only use one form, so I've just
implemented dumping support for that for now.

It wasn't immediately obvious that there was a good refactoring to share
the implementation of dumping support between debug_loc and
debug_loc.dwo, so they're separate for now - ideas welcome or I may come
back to it at some point.

As per a comment in the code, we could choose different forms that may
reduce the number of debug_addr entries we emit, but that will require
further study.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 01:44:02 +00:00
Justin Bogner
93065647b8 Support: Functions for consuming endian specific data from a buffer.
This adds a function to Endian.h that reads from and updates a pointer
into a buffer with endian specific data. This is more convenient for
stream-like reading of data than endian::read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204693 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 01:04:44 +00:00
Justin Bogner
2563e201c1 Support: Document Endian.h functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24 21:30:55 +00:00
Nuno Lopes
2ca626570f remove a bunch of unused private methods
found with a smarter version of -Wunused-member-function that I'm playwing with.
Appologies in advance if I removed someone's WIP code.

 include/llvm/CodeGen/MachineSSAUpdater.h            |    1 
 include/llvm/IR/DebugInfo.h                         |    3 
 lib/CodeGen/MachineSSAUpdater.cpp                   |   10 --
 lib/CodeGen/PostRASchedulerList.cpp                 |    1 
 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp    |   10 --
 lib/IR/DebugInfo.cpp                                |   12 --
 lib/MC/MCAsmStreamer.cpp                            |    2 
 lib/Support/YAMLParser.cpp                          |   39 ---------
 lib/TableGen/TGParser.cpp                           |   16 ---
 lib/TableGen/TGParser.h                             |    1 
 lib/Target/AArch64/AArch64TargetTransformInfo.cpp   |    9 --
 lib/Target/ARM/ARMCodeEmitter.cpp                   |   12 --
 lib/Target/ARM/ARMFastISel.cpp                      |   84 --------------------
 lib/Target/Mips/MipsCodeEmitter.cpp                 |   11 --
 lib/Target/Mips/MipsConstantIslandPass.cpp          |   12 --
 lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp              |   21 -----
 lib/Target/NVPTX/NVPTXISelDAGToDAG.h                |    2 
 lib/Target/PowerPC/PPCFastISel.cpp                  |    1 
 lib/Transforms/Instrumentation/AddressSanitizer.cpp |    2 
 lib/Transforms/Instrumentation/BoundsChecking.cpp   |    2 
 lib/Transforms/Instrumentation/MemorySanitizer.cpp  |    1 
 lib/Transforms/Scalar/LoopIdiomRecognize.cpp        |    8 -
 lib/Transforms/Scalar/SCCP.cpp                      |    1 
 utils/TableGen/CodeEmitterGen.cpp                   |    2 
 24 files changed, 2 insertions(+), 261 deletions(-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204560 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-23 17:09:26 +00:00
Duncan P. N. Exon Smith
0695b20d9a InstrProf: Check pointer size in raw profile
Since the profile can come from 32-bit machines, we need to check the
pointer size.  Change the magic number to facilitate this.

Adds tests for reading 32-bit and 64-bit binaries (both big- and
little-endian).  The tests write a binary using printf in RUN lines
(like raw-magic-but-no-header.test).  Assuming the bots don't complain,
this seems like a better way forward for testing RawInstrProfReader than
committing binary files.

<rdar://problem/16400648>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204557 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-23 03:38:12 +00:00
Andrea Di Biagio
d47cb57ab8 [DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode::isConstantSplat'
This patch renames method 'isConstantSplat' as 'getConstantSplatValue'
(mainly for consistency reasons), and rewrites its logic to ensure
that we always perform a legal 'cast<ConstantSDNode>'.

Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-22 01:47:22 +00:00
Duncan P. N. Exon Smith
50f9696f1d InstrProf: Move constructor to the header
Fixes 80-column violation at the same time.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:59:19 +00:00
Duncan P. N. Exon Smith
bc2740a598 InstrProf: Use move semantics with unique_ptr
<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204512 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:34 +00:00
Duncan P. N. Exon Smith
bb56c4808e InstrProf: Detect magic numbers in a more scalable way
No functionality change.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204511 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:31 +00:00
Duncan P. N. Exon Smith
ebaeaa934e InstrProf: Actually detect bad headers
<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 20:42:28 +00:00
Justin Bogner
218c7c821b ProfileData: Avoid double underscores in header guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:46:29 +00:00
Duncan P. N. Exon Smith
ddfcb21b3f InstrProf: Read raw binary profile in llvm-profdata
Read a raw binary profile that corresponds to a memory dump from the
runtime profile.

The test is a binary file generated from
cfe/trunk/test/Profile/c-general.c with the new compiler-rt runtime and
the matching text version of the input.  It includes instructions on how
to regenerate.

<rdar://problem/15950346>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204496 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 18:26:05 +00:00
Justin Bogner
496d7f66a0 ProfileData: Introduce InstrProfWriter using the naive text format
This isn't a format we'll want to write out in practice, but moving it
to the writer library simplifies llvm-profdata and isolates it from
further changes to the format.

This also allows us to update the tests to not rely on the text output
format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204489 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:46:22 +00:00
Justin Bogner
c0f3b72555 ProfileData: Introduce the InstrProfReader interface and a text reader
This introduces the ProfileData library and updates llvm-profdata to
use this library for reading profiles. InstrProfReader is an abstract
base class that will be subclassed for both the raw instrprof data
from compiler-rt and the efficient instrprof format that will be used
for PGO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 17:24:48 +00:00
Juergen Ributzka
4923eea4f6 [RuntimeDyld] Allow processRelocationRef to process more than one relocation entry at a time.
Some targets require more than one relocation entry to perform a relocation.
This change allows processRelocationRef to process more than one relocation
entry at a time by passing the relocation iterator itself instead of just
the relocation entry.

Related to <rdar://problem/16199095>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 07:26:41 +00:00
Juergen Ributzka
d3cf783ed1 [Constant Hoisting] Make the constant materialization cost operand dependent
Extend the target hook to take also the operand index into account when
calculating the cost of the constant materialization.

Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 06:04:45 +00:00
Rui Ueyama
99995267ae Object/COFF: Support large relocation table.
NumberOfRelocations field in COFF section table is only 16-bit wide. If an
object has more than 65535 relocations, the number of relocations is stored
to VirtualAddress field in the first relocation field, and a special flag
(IMAGE_SCN_LNK_NRELOC_OVFL) is set to Characteristics field.

In test we cheated a bit. I made up a test file so that it has
IMAGE_SCN_LNK_NRELOC_OVFL flag but the number of relocations is much smaller
than 65535. This is to avoid checking in a large test file just to test a
file with many relocations.

Differential Revision: http://llvm-reviews.chandlerc.com/D3139

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-21 00:44:19 +00:00
Lang Hames
20425d92df Add an option to MCJIT to have it forward all sections to the
RTDyldMemoryManager, regardless of whether it thinks they're "required for
execution".

Currently, RuntimeDyld only passes sections that are "required for execution"
to the RTDyldMemoryManager, and takes "required for execution" to mean exactly
"contains symbols or relocations". There are two problems with this:
(1) It can drop sections with anonymous data that is referenced by code.
(2) It leaves the JIT client no way to inspect interesting sections that aren't
    actually required to run the program (e.g dwarf sections).

A test case is still in the works.

Future work: We may want to replace this with a generic section filtering
mechanism, but that will require more consideration. For now, this flag at least
allows clients to volunteer to do the filtering themselves.

Fixes <rdar://problem/15177691>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204398 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 21:06:46 +00:00
Juergen Ributzka
ee3242ed0b Revert "[Constant Hoisting] Extend coverage of the constant hoisting pass."
I will break this up into smaller pieces for review and recommit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 20:17:13 +00:00
Juergen Ributzka
228c72a841 [Constant Hoisting] Extend coverage of the constant hoisting pass.
This commit extends the coverage of the constant hoisting pass, adds additonal
debug output and updates the function names according to the style guide.

Related to <rdar://problem/16381500>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 19:55:52 +00:00
Mark Seaborn
9bb9615e1f Remove LowerInvoke's obsolete "-enable-correct-eh-support" option
This option caused LowerInvoke to generate code using SJLJ-based
exception handling, but there is no code left that interprets the
jmp_buf stack that the resulting code maintained (llvm.sjljeh.jblist).
This option has been obsolete for a while, and replaced by
SjLjEHPrepare.

This leaves the default behaviour of LowerInvoke, which is to convert
invokes to calls.

Differential Revision: http://llvm-reviews.chandlerc.com/D3136

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204388 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 19:54:47 +00:00
Rafael Espindola
faec753dd4 Remove dead and incorrect code.
is_symlink was always false since it was using stat instead of lstat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204361 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 17:39:04 +00:00
Zoran Jovanovic
b71fd20f2d Mark alias symbols as microMIPS if necessary. Differential Revision: http://llvm-reviews.chandlerc.com/D3080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204323 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 09:44:49 +00:00
David Majnemer
b000c172ed Object: Abstract out the determination of function line symbols
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 06:28:55 +00:00
Rafael Espindola
0a70f9b3b9 Look through variables when computing relocations.
Given

bar = foo + 4
	.long bar

MC would eat the 4. GNU as includes it in the relocation. The rule seems to be
that a variable that defines a symbol is used in the relocation and one that
does not define a symbol is evaluated and the result included in the relocation.

Fixing this unfortunately required some other changes:

* Since the variable is now evaluated, it would prevent the ELF writer from
  noticing the weakref marker the elf streamer uses. This patch then replaces
  that with a VariantKind in MCSymbolRefExpr.

* Using VariantKind then requires us to look past other VariantKind to see

	.weakref	bar,foo
	call	bar@PLT

  doing this also fixes

	zed = foo +2
	call zed@PLT

  so that is a good thing.

* Looking past VariantKind means that the relocation selection has to use
  the fixup instead of the target.

This is a reboot of the previous fixes for MC. I will watch the sanitizer
buildbot and wait for a build before adding back the previous fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204294 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 02:12:01 +00:00
Justin Bogner
eb7dcd71d6 Support: Add postincrement and include guards to LineIterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204279 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 22:58:31 +00:00
David Majnemer
875b3c9afd COFF: Fix a typo
Introduced when I rebased my changes to use isReservedSectionNumber.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204260 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 20:16:23 +00:00
David Majnemer
6d191534f6 Object: Provide a richer means of describing auxiliary symbols
The current state of affairs has auxiliary symbols described as a big
bag of bytes. This is less than satisfying, it detracts from the YAML
file as being human readable.

Instead, allow for symbols to optionally contain their auxiliary data.
This allows us to have a much higher level way of describing things like
weak symbols, function definitions and section definitions.

This depends on D3105.

Differential Revision: http://llvm-reviews.chandlerc.com/D3092

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 04:47:47 +00:00
David Majnemer
92c5a193e0 Object: Move auxiliary symbol definitions from llvm-readobj
Summary: These definitions are useful to other aspects of LLVM, move them out.

Reviewers: rafael, nrieck, ruiu

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3105

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204213 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 04:33:27 +00:00
David Majnemer
75141e6c47 Object: Clean up COFF.h
The file violated the coding standard.  Make it conform.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204212 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 02:37:19 +00:00
Justin Bogner
fb007bb98c llvm-profdata: Update to use the naive text format with function hash
This also uses line_iterator to simplify the parsing logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 02:20:42 +00:00
Pete Cooper
f7efbb1906 When destroying a StringMap, just iterate over the map and destroy the contained elements. Don't reset them back to 0 as their values aren't needed any more. This results in ~StringMap() being mostly empty for POD types in BumpPtrAllocators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204204 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 00:23:30 +00:00
Rafael Espindola
025e94d7dc Revert "Add back r203962, r204028 and r204059."
This reverts commit r204178.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 00:13:43 +00:00
David Blaikie
56ce2f5ab8 DebugInfo: Use the comp_dir of the referencing type units when building debug_line.dwo
This isn't a complete fix - it falls back to non-comp_dir when multiple
compile units are in play. Adding a map of comp_dir to table is part of
the more general solution, but I gave up (in the short term) when I
realized I'd also have to calculate the size of each type unit so as to
produce correct DW_AT_stmt_list attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-19 00:11:28 +00:00
Eli Bendersky
21354ec60d Expose "noduplicate" attribute as a property for intrinsics.
The "noduplicate" function attribute exists to prevent certain optimizations
from duplicating calls to the function. This is important on platforms where
certain function call duplications are unsafe (for example execution barriers
for CUDA and OpenCL).

This patch makes it possible to specify intrinsics as "noduplicate" and
translates that to the appropriate function attribute.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204200 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 23:51:07 +00:00
Rui Ueyama
cae25dcbf7 Object/COFF: Add function to check if section number is reserved one.
Differential Revision: http://llvm-reviews.chandlerc.com/D3103

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204199 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 23:37:53 +00:00
Jim Grosbach
6d1980d0ca C++ style comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 22:13:13 +00:00
Jim Grosbach
d55fc3f151 Darwin: Add assembler directives to create version-min load commands.
Allow object files to be tagged with a version-min load command for iOS
or MacOSX.

Teach macho-dump to understand the version-min load commands for
testcases.

rdar://11337778

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204190 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 22:09:05 +00:00
Jim Grosbach
802d81591a MachO: Comment fields in the version_min load command.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 22:08:58 +00:00
Rafael Espindola
4af106a677 Add back r203962, r204028 and r204059.
This reverts commit r204137.

This includes a fix for handling aliases of aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204178 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 20:40:38 +00:00
Evgeniy Stepanov
610469f4c2 [msan] Origin tracking with history.
LLVM part of MSan implementation of advanced origin tracking,
when we record not only creation point, but all locations where
an uninitialized value was stored to memory, too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 13:30:56 +00:00
Alexander Kornienko
8a99824c5a Revert r203962 and two revisions depending on it: r204028 and r204059.
The revision I'm reverting breaks handling of transitive aliases. This blocks us
and breaks sanitizer bootstrap:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2651
(and checked locally by Alexey).

This revision is the result of:

  svn merge -r204059:204058 -r204028:204027 -r203962:203961 .

+ the regression test added to test/MC/ELF/alias.s

Another way to reproduce the regression with clang:
  $ cat q.c
  void a1();
  void a2() __attribute__((alias("a1")));
  void a3() __attribute__((alias("a2")));
  void a1() {}

  $ ~/work/llvm-build/bin/clang-3.5-good -c q.c && mv q.o good.o && \
      ~/work/llvm-build/bin/clang-3.5-bad -c q.c && mv q.o bad.o && \
      objdump -t good.o bad.o

    good.o:     file format elf64-x86-64

    SYMBOL TABLE:
    0000000000000000 l    df *ABS*  0000000000000000 q.c
    0000000000000000 l    d  .text  0000000000000000 .text
    0000000000000000 l    d  .data  0000000000000000 .data
    0000000000000000 l    d  .bss   0000000000000000 .bss
    0000000000000000 l    d  .comment       0000000000000000 .comment
    0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
    0000000000000000 l    d  .eh_frame      0000000000000000 .eh_frame
    0000000000000000 g     F .text  0000000000000006 a1
    0000000000000000 g     F .text  0000000000000006 a2
    0000000000000000 g     F .text  0000000000000006 a3



    bad.o:     file format elf64-x86-64

    SYMBOL TABLE:
    0000000000000000 l    df *ABS*  0000000000000000 q.c
    0000000000000000 l    d  .text  0000000000000000 .text
    0000000000000000 l    d  .data  0000000000000000 .data
    0000000000000000 l    d  .bss   0000000000000000 .bss
    0000000000000000 l    d  .comment       0000000000000000 .comment
    0000000000000000 l    d  .note.GNU-stack        0000000000000000 .note.GNU-stack
    0000000000000000 l    d  .eh_frame      0000000000000000 .eh_frame
    0000000000000000 g     F .text  0000000000000006 a1
    0000000000000000 g     F .text  0000000000000006 a2
    0000000000000000 g       .text  0000000000000000 a3




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204137 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 10:36:11 +00:00
Alon Mishne
086494730d [C++11] Change DebugInfoFinder to use range-based loops
Also changes the iterators to return actual DI type over MDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204130 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 09:41:07 +00:00
Alexey Samsonov
5b645797db [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make it work with range-based for loops.
Reviewers: ruiu

Reviewed By: ruiu

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3097

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 06:53:02 +00:00
Adrian Prantl
5e8144df32 Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.
This allows us to catch more opportunities for ODR-based type uniquing
during LTO.
Paired commit with CFE which updates some testcases to verify the new
DIBuilder behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:34:58 +00:00
David Blaikie
c5b39af329 DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers where opcodes are never used anyway
Introduce a slightly tighter wrapper around the header structure that
handles this use case. (MCDwarfDwoLineTable)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204101 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:13:23 +00:00
David Blaikie
2879a6caa8 DebugInfo: Move line table zero-directory-index (compilation dir) handling into MCDwarf
Our handling of compilation directory in DwarfDebug was broken
(incorrectly using the 'last' compilation directory (that of the last
CU in the metadata list) for all function emission in any CU). By moving
this handling down into MCDwarf the issue is fixed as the compilation
dir is tracked correctly per line table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204089 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 23:29:40 +00:00
Owen Anderson
7ad87e4d3b Really REALLY finish adding const to the MachineRegisterInfo iterator range methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204074 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 19:34:51 +00:00
Matt Arsenault
94bdb453a4 Make DAGCombiner work on vector bitshifts with constant splat vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204071 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:58:01 +00:00
Owen Anderson
63d93faa9b Add one more const marker that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:16:10 +00:00
David Blaikie
daeeb37373 DebugInfo: Use MC line table file entry uniquing for non-asm input as well.
See r204027 for the precursor to this that applied to asm debug info.

This required some non-obvious API changes to handle the case of asm
output (we never go asm->asm so this didn't come up in r204027): the
modification of the file/directory name by MCDwarfLineTableHeader needed
to be reflected in the MCAsmStreamer caller so it could print the
appropriate .file directive, so those StringRef parameters are now
non-const ref (in/out) parameters rather than just const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204069 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:13:58 +00:00
Owen Anderson
03a3f643b1 Mark MachineRegisterInfo's iterator range methods as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204067 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:05:05 +00:00
Owen Anderson
3645c32163 Add iterator range definitions for the MachineRegisterInfo iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204066 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 18:01:41 +00:00
Adam Nemet
8c8fe42a0d [VectorLegalizer/X86] Don't unvectorize fp_to_uint for v8f32->v8i16
Rather than LegalizeAction::Expand, this needs LegalizeAction::Promote to get
promoted to fp_to_sint v8f32->v8i32.  This is a legal operation on AVX.

For that to work properly, we also need to teach the legalizer about the
specific promotion required here.  The default vector promotion uses
bitcasting to a vector type of the same total size.  We want to promote the
vector element type, effectively widening the operation and then truncating
the result.  This is analogous to the current logic of how int_to_fp is
promoted.

The change also factors out some code from the int_to_fp promotion code to
ValueType::widenIntegerVectorElementType.  This is now shared between
int_to_fp and fp_to_int.

There is no longer need for the custom lowering of fp_to_sint f32->v8i16 in
X86.  It can now go through the new target-independent fp_to_*int promotion
logic.

I also checked that no other target uses Promote for these ops yet, so there
shouldn't be any unexpected change in behavior.

Fixes <rdar://problem/16202247>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204058 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 17:06:14 +00:00
Eli Bendersky
bbbc2b1140 Consistent use of the noduplicate attribute.
The "noduplicate" attribute of call instructions is sometimes queried directly
and sometimes through the cannotDuplicate() predicate. This patch streamlines
all queries to use the cannotDuplicate() predicate. It also adds this predicate
to InvokeInst, to mirror what CallInst has.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204049 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 16:19:07 +00:00
Alexey Samsonov
133aacf0dd [C++11] Introduce ObjectFile::symbols() to use range-based loops.
Reviewers: rafael

Reviewed By: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204031 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 07:28:19 +00:00
David Blaikie
fd69cf9ba4 DebugInfo: Improve reuse of file table entries in asm debug info
The previous deduping strategy was woefully inadequate - it only
considered the most recent file used and avoided emitting a duplicate in
that case - never considering the a/b/a scenario.

It was also lacking when it came to directory paths as the previous
filename would never match the current if the filename had been split
into file and directory components.

This change builds caching functionality into the line table at the
lowest level in an optional form (a file number of 0 indicates that one
should be chosen and returned) and will eventually be reused by the
normal source level debugging DWARF emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204027 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 01:52:11 +00:00
Lang Hames
f6c2ab8a0e Deleted copy-constructor/copy-assignment broke a buildbot. Removing while I
investigate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 01:51:51 +00:00
Lang Hames
960c80d8a9 Rename PBQP RegAllocSolver local variables to conform to LLVM coding style.
No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 01:33:21 +00:00
NAKAMURA Takumi
7f0871c97f Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204020 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-16 23:58:43 +00:00
Manman Ren
8142bc1a26 Add FIXMEs to use DIScopeRef instead of DIScope for LTO type uniqueing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-16 18:44:23 +00:00
Benjamin Kramer
571832b930 Make some assertions on constant expressions static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204011 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-15 18:47:07 +00:00
Benjamin Kramer
80d3b1e708 PointerIntPair: Avoid an (academic) case of undefined behavior in the DenseMapInfo specialization.
If we use a pair with an enum type this could create values outside
of the enum range. Avoid it by creating the bit pattern directly.
While there turn a dynamic assert into a static one. No functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204010 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-15 18:10:49 +00:00
Justin Bogner
c0a42c263e Support: Make error_category's constructor public
Since our error_category is based on the std one, we should have the
same visibility for the constructor.  This also allows us to avoid
using the _do_message implementation detail in our own categories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-15 04:05:59 +00:00
Rui Ueyama
7aa478d944 Object/COFF: change data type of SymbolNumber from int16 to uint16.
Microsoft PE/COFF Spec clearly states that the field is of signed interger
type. However, in reality, it's unsigned. If cl.exe needs to create a large
number of sections for COMDAT sections, it will just create more than 32768
sections. Handling large section number as negative number is not correct.
I think this is a spec bug.

Differential Revision: http://llvm-reviews.chandlerc.com/D3088

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203986 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-15 00:04:08 +00:00
Diego Novillo
3f7c2f31ff Use DiagnosticInfo facility.
Summary:
The sample profiler pass emits several error messages. Instead of
just aborting the compiler with report_fatal_error, we can emit
better messages using DiagnosticInfo.

This adds a new sub-class of DiagnosticInfo to handle the sample
profiler.

Reviewers: chandlerc, qcolombet

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3086

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203976 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 21:58:59 +00:00
David Blaikie
c75ec15881 MCDwarf: Initialize MCLineTableHeader::Label
This sometimes remains null into MCLineTableHeader::Emit where we
conditionally construct a label if one isn't provided for us. We need it
to remain null (rather than just always constructing the label) so we
can identify unused line tables... which is a bit weird and maybe we can
do away with that logic one day (& on that day we can always construct
the label up-front and just have compilation units query the line table
for its label, etc)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203967 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 20:36:44 +00:00
Rafael Espindola
54e582179f Correctly handle an ELF symbol defined with "a = b + expr".
We were marking the symbol as absolute instead of computing b's offset + the
expression value.

This fixes pr19126.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203962 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 20:09:04 +00:00
David Blaikie
419e5ffe4a Remove unnecessary StringRef::str() call where an implicit conversion works just fine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203960 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 19:53:39 +00:00
Alexey Samsonov
385303b358 Delete unused ObjectFile::{begin,end}_symbols()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203928 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 14:52:03 +00:00
Alexey Samsonov
6f07b35b8f [C++11] Introduce SectionRef::relocations() to use range-based loops
Reviewers: rafael

Reviewed By: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203927 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 14:22:49 +00:00
Patrik Hagglund
0eba2c94fd Separate out MVT in a separate header file: MachineValueType.h
The idea behind this split of ValueTypes.h, is to make it easier to
ensure that stuff after type legalization only use MVT (rather than
EVT), by watching include dependencies.

Reviewed By: Tim Northover

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203926 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 13:41:09 +00:00
Simon Atanasyan
dfbd26215e [Mips] Add one more MIPS relocation type constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203896 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 06:53:10 +00:00
Owen Anderson
b6f478aa66 Revert r203883 (which was more of a bandaid) and fix the real underlying
issue in that the new MachineRegisterInfo bundle iterators didn't
dereference to the START of the bundle, while the old skipBundle()
method did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203890 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 05:02:18 +00:00
Sebastian Pop
beaa95d97f static link polly into tools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203886 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 04:04:14 +00:00
Rafael Espindola
1f21e0dd0d Remove the linker_private and linker_private_weak linkages.
These linkages were introduced some time ago, but it was never very
clear what exactly their semantics were or what they should be used
for. Some investigation found these uses:

* utf-16 strings in clang.
* non-unnamed_addr strings produced by the sanitizers.

It turns out they were just working around a more fundamental problem.
For some sections a MachO linker needs a symbol in order to split the
section into atoms, and llvm had no idea that was the case. I fixed
that in r201700 and it is now safe to use the private linkage. When
the object ends up in a section that requires symbols, llvm will use a
'l' prefix instead of a 'L' prefix and things just work.

With that, these linkages were already dead, but there was a potential
future user in the objc metadata information. I am still looking at
CGObjcMac.cpp, but at this point I am convinced that linker_private
and linker_private_weak are not what they need.

The objc uses are currently split in

* Regular symbols (no '\01' prefix). LLVM already directly provides
whatever semantics they need.
* Uses of a private name (start with "\01L" or "\01l") and private
linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm
agrees with clang on L being ok or not for a given section. I have two
patches in code review for this.
* Uses of private name and weak linkage.

The last case is the one that one could think would fit one of these
linkages. That is not the case. The semantics are

* the linker will merge these symbol by *name*.
* the linker will hide them in the final DSO.

Given that the merging is done by name, any of the private (or
internal) linkages would be a bad match. They allow llvm to rename the
symbols, and that is really not what we want. From the llvm point of
view, these objects should really be (linkonce|weak)(_odr)?.

For now, just keeping the "\01l" prefix is probably the best for these
symbols. If we one day want to have a more direct support in llvm,
IMHO what we should add is not a linkage, it is just a hidden_symbol
attribute. It would be applicable to multiple linkages. For example,
on weak it would produce the current behavior we have for objc
metadata. On internal, it would be equivalent to private (and we
should then remove private).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203866 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 23:18:37 +00:00
Owen Anderson
bf63022492 Phase 2 of the great MachineRegisterInfo cleanup. This time, we're changing
operator* on the by-operand iterators to return a MachineOperand& rather than
a MachineInstr&.  At this point they almost behave like normal iterators!

Again, this requires making some existing loops more verbose, but should pave
the way for the big range-based for-loop cleanups in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203865 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 23:12:04 +00:00
David Blaikie
43d5e074aa MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTable
This type now represents all the data for the DWARF line table:
directory names, file names, and the line table proper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203858 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 21:59:51 +00:00
David Blaikie
91d5586086 MCDwarf: Extract the DWARF line table header handling into its own type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203856 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 21:47:12 +00:00
Owen Anderson
b8b4d3e0eb Fix a subtle issue introduced my my recent changes to MachineRegisterInfo iterators.
When initializing an iterator, we may have to step forward to find the first
operand that passes the current filter set.  When doing that stepping, we should
always step one operand at a time, even if this is by-instr or by-bundle iterator,
as we're stepping between invalid values, so the stride doesn't make sense there.

Fixes a miscompilation of YASM on Win32 reported by Hans Wennborg.  I have not
yet figured out how to reduce it to something testcase-able, because it's sensitive
to the details of how the registers get spilled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203852 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 21:25:10 +00:00
David Blaikie
b60d2ba5c4 MCDwarf: Sink file/directory creation down into MCDwarfFileTable form MCContext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203836 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 19:15:04 +00:00
David Blaikie
43e7eb8ff4 MCDwarf: Oh, and move the directory string over to std::string as well
(see r203831 for similar stuff)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 19:05:33 +00:00
David Blaikie
8c987f5340 MCDwarf: Simplify MCDwarfFile to just use std::string instead of cunning use of MCContext's allocator.
There aren't /that/ many files, and we are already using various maps
and other standard containers that don't use MCContext's allocator to
store these values, so this doesn't seem to be critical and simplifies
the design (I'll be moving construction out of MCContext shortly so it'd
be annoying to have to pass the allocator around to allocate these
things... and we'll have non-MCContext users (debug_line.dwo) shortly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203831 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 18:55:04 +00:00
Ekaterina Romanova
ed2ca70ccf Fix for http://llvm.org/bugs/show_bug.cgi?id=18590
This patch fixes the bug in peephole optimization that folds a load which defines one vreg into the one and only use of that vreg. With debug info, a DBG_VALUE that referenced the vreg considered to be a use, preventing the optimization. The fix is to ignore DBG_VALUE's during the optimization, and undef a DBG_VALUE that references a vreg that gets removed.
Patch by Trevor Smigiel!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 18:47:12 +00:00
David Blaikie
4ad41871eb MCDwarf: Simply MCDwarfFile since it really is just a StringRef and unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203827 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 18:21:24 +00:00
Rafael Espindola
7e9df19d5f Use printable names to implement directional labels.
This changes the implementation of local directional labels to use a dedicated
map. With that it can then just use CreateTempSymbol, which is what the rest
of MC uses.

CreateTempSymbol doesn't do a great job at making sure the names are unique
(or being efficient when the names are not needed), but that should probably
be fixed in a followup patch.

This fixes pr18928.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203826 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 18:09:26 +00:00
David Blaikie
a2f9a2c30d MCDwarf: Refactor line table handling into a single data structure
This replaces several "compile unit ID -> thing" mappings in favor of
one mapping from CUID to the whole line table structure (files,
directories, and lines).

This is another step along the way to refactoring out reusable
components of line table handling for use when generating debug_line.dwo
for fission type units.

Also, might be a good basis to fold some of this handling down into
MCStreamers to avoid the special case of "One line table when doing asm
printing, line table per CU otherwise" by building it into the different
MCStreamer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 17:55:28 +00:00
Hans Wennborg
c8ed0db5aa [ARM] Use symbolic register names in .cfi directives only with IAS (PR19110)
This is a follow-up to r203635. Saleem pointed out that since symbolic register
names are much easier to read, it would be good if we could turn them off only
when we really need to because we're using an external assembler.

Differential Revision: http://llvm-reviews.chandlerc.com/D3056

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203806 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 15:56:41 +00:00
Alexey Samsonov
b920dfe02b [C++11] Introduce ObjectFile::sections().
Summary:
This adds ObjectFile::section_iterator_range, that allows to write
range-based for-loops running over all sections of a given file.
Several files from lib/ are converted to the new interface. Similar fixes
should be applied to a variety of llvm-* tools.

Reviewers: rafael

Reviewed By: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3069

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203799 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 13:52:54 +00:00
Elena Demikhovsky
3d1ae71813 AVX-512: masked load/store + intrinsics for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203790 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 12:05:52 +00:00
Chandler Carruth
2d74092f5f [PM] As was pointed out in review, I need to define a custom swap in
order to use the single assignment. That's probably worth doing for
a lot of these types anyways as they may have non-trivial moves and so
getting copy elision in more places seems worthwhile.

I've tried to add some tests that actually catch this mistake, and one
of the types is now well tested but the others' tests still fail to
catch this. I'll keep working on tests, but this gets the core pattern
right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203780 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 10:42:18 +00:00
Chandler Carruth
04239506f1 [PM] Stop playing fast and loose with rebinding of references. However
convenient it is to imagine a world where this works, that is not C++ as
was pointed out in review. The standard even goes to some lengths to
preclude any attempt at this, for better or worse. Maybe better. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203775 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 09:50:31 +00:00
Hal Finkel
79c15b23c9 [TableGen] Optionally forbid overlap between named and positional operands
There are currently two schemes for mapping instruction operands to
instruction-format variables for generating the instruction encoders and
decoders for the assembler and disassembler respectively: a) to map by name and
b) to map by position.

In the long run, we'd like to remove the position-based scheme and use only
name-based mapping. Unfortunately, the name-based scheme currently cannot deal
with complex operands (those with suboperands), and so we currently must use
the position-based scheme for those. On the other hand, the position-based
scheme cannot deal with (register) variables that are split into multiple
ranges. An upcoming commit to the PowerPC backend (adding VSX support) will
require this capability. While we could teach the position-based scheme to
handle that, since we'd like to move away from the position-based mapping
generally, it seems silly to teach it new tricks now. What makes more sense is
to allow for partial transitioning: use the name-based mapping when possible,
and only use the position-based scheme when necessary.

Now the problem is that mixing the two sensibly was not possible: the
position-based mapping would map based on position, but would not skip those
variables that were mapped by name. Instead, the two sets of assignments would
overlap. However, I cannot currently change the current behavior, because there
are some backends that rely on it [I think mistakenly, but I'll send a message
to llvmdev about that]. So I've added a new TableGen bit variable:
noNamedPositionallyEncodedOperands, that can be used to cause the
position-based mapping to skip variables mapped by name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203767 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 07:57:54 +00:00
Owen Anderson
76604af774 Phase 1 of refactoring the MachineRegisterInfo iterators to make them suitable
for use with C++11 range-based for-loops.

The gist of phase 1 is to remove the skipInstruction() and skipBundle()
methods from these iterators, instead splitting each iterator into a version
that walks operands, a version that walks instructions, and a version that
walks bundles.  This has the result of making some "clever" loops in lib/CodeGen
more verbose, but also makes their iterator invalidation characteristics much
more obvious to the casual reader. (Making them concise again in the future is a
good motivating case for a pre-incrementing range adapter!)

Phase 2 of this undertaking with consist of removing the getOperand() method,
and changing operator*() of the operand-walker to return a MachineOperand&.  At
that point, it should be possible to add range views for them that work as one
might expect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203757 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 06:02:25 +00:00
David Blaikie
16300ca843 MCDwarf: Invert the Section+CU->LineEntries mapping so the CU is the primary dimension
This makes the mapping consistent with other CU->X mappings in the
MCContext, helping pave the way to refactor all these values into a
single data structure per CU and thus a single map.

I haven't renamed the data structure as that would make the patch churn
even higher (the MCLineSection name no longer makes sense, as this
structure now contains lines for multiple sections covered by a single
CU, rather than lines for a single section in multiple CUs) and further
refactorings will follow that may remove this type entirely.

For convenience, I also gave the MCLineSection value semantics so we
didn't have to do the lazy construction, manual delete, etc.

(& for those playing at home, refactoring the line printing into a
single data structure will eventually alow that data structure to be
reused to own the debug_line.dwo line table used for type unit file name
resolution)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203726 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 22:28:56 +00:00
Justin Bogner
efa9416a21 Back out Profile library and dependent commits
Chandler voiced some concern with checking this in without some
discussion first. Reverting for now.

This reverts r203703, r203704, r203708, and 203709.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 22:00:57 +00:00
Justin Bogner
1b2c73aa67 Profile: Avoid an unnecessary __attribute__((packed))
MSVC doesn't understand it, and it wasn't really necessary anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 20:40:14 +00:00
Justin Bogner
f3e1756648 Profile: Remove an inefficient and unnecessary API function
This was leftover from an approach I abandoned, but I forgot to update
it before committing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203708 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 20:26:37 +00:00
Justin Bogner
4207c6759c llvm-profdata: Use the Profile library, implement show and generate
This replaces the llvm-profdata tool with a version that uses the
recently introduced Profile library. The new tool has the ability to
generate and summarize profdata files as well as merging them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203704 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 20:14:17 +00:00
Justin Bogner
02da814a94 Profile: Add a library for the instrumentation based profiling format
This provides a library to work with the instrumentation based
profiling format that is used by clang's -fprofile-instr-* options and
by the llvm-profdata tool. This is a binary format, rather than the
textual one that's currently in use.

The tests are in the subsequent commits that use this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203703 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 20:14:05 +00:00
Evan Cheng
9225686155 Revert r203488 and r203520.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203687 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 18:09:37 +00:00
Rafael Espindola
3b8cc2299b Try harder to evaluate expressions when printing assembly.
When printing assembly we don't have a Layout object, but we can still
try to fold some constants.

Testcase by Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203677 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 16:55:59 +00:00
Eli Bendersky
ce306f9f99 Move duplicated code into a helper function (exposed through overload).
There's a bit of duplicated "magic" code in opt.cpp and Clang's CodeGen that
computes the inliner threshold from opt level and size opt level.

This patch moves the code to a function that lives alongside the inliner itself,
providing a convenient overload to the inliner creation.

A separate patch can be committed to Clang to use this once it's committed to
LLVM. Standalone tools that use the inlining pass can also avoid duplicating
this code and fearing it will go out of sync.

Note: this patch also restructures the conditinal logic of the computation to
be cleaner.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203669 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 16:12:36 +00:00
Alon Mishne
e74c0bf111 Cloning a function now also clones its debug metadata if 'ModuleLevelChanges' is true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203662 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 14:42:51 +00:00
Patrik Hagglund
792a1d7191 Replace '#include ValueTypes.h' with forward declarations.
In some cases the include is pushed "downstream" (or removed if
unused).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203644 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 08:00:24 +00:00
David Blaikie
0932a749a3 Accept Twine's to AsmPrinter::getTempSymbol (refactoring for an incoming change)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203617 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 23:12:08 +00:00
Saleem Abdulrasool
404a72729b support: add a utility function to normalise path separators
Add a utility function to convert the Windows path separator to Unix style path
separators.  This is used by a subsequent change in clang to enable the use of
Windows SDK headers on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203611 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 22:05:42 +00:00
Rafael Espindola
d1742f6136 Simplify a really complicated check for Arch == X86_64.
The function hasReliableSymbolDifference had exactly one use in the MachO
writer. It is also only true for X86_64. In fact, the comments refers to
"Darwin x86_64" and everything else, so this makes the code match the
comment.

If this is to be abstracted again, it should be a property of
TargetObjectWriter, like useAggressiveSymbolFolding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 21:22:57 +00:00
Rafael Espindola
819af77aa3 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203604 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 21:10:44 +00:00
Rafael Espindola
8acff70de1 Cleanup the interface for creating soft or hard links.
Before this patch the unix code for creating hardlinks was unused. The code
for creating symbolic links was implemented in lib/Support/LockFileManager.cpp
and the code for creating hard links in lib/Support/*/Path.inc.

The only use we have for these is in LockFileManager.cpp and it can use both
soft and hard links. Just have a create_link function that creates one or the
other depending on the platform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203596 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 18:40:24 +00:00
Benjamin Kramer
dabc5073b2 Remove copy ctors that did the same thing as the default one.
The code added nothing but potentially disabled move semantics and made
types non-trivially copyable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203563 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 11:32:49 +00:00
Tim Northover
ca396e391e IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:

	cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic

where the second ordering argument gives the required semantics in the case
that no exchange takes place. It should be no stronger than the first ordering
constraint and cannot be either "release" or "acq_rel" (since no store will
have taken place).

rdar://problem/15996804

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203559 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 10:48:52 +00:00
Erik Verbruggen
d4b9957d1f Fix fixme: remove unused method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203552 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 09:32:50 +00:00
Saleem Abdulrasool
afe381c0a9 Object: rename ARMV7 to ARMNT
The official specifications state the name to be ARMNT (as per the Microsoft
Portable Executable and Common Object Format Specification v8.3).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203530 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 03:08:37 +00:00
Matt Arsenault
67ad03b1ef Add helpers for getting scalar sizes of vector value types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203526 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 01:38:48 +00:00
Manuel Jacob
e45534d027 Test commit: Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203502 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 22:24:07 +00:00
Mark Lacey
d522121f24 Fix a couple typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203499 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 21:59:28 +00:00
Evan Cheng
d89b0f200c For functions with ARM target specific calling convention, when simplify-libcall
optimize a call to a llvm intrinsic to something that invovles a call to a C
library call, make sure it sets the right calling convention on the call.

e.g.
extern double pow(double, double);
double t(double x) {
  return pow(10, x);
}

Compiles to something like this for AAPCS-VFP:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
  %0 = call double @llvm.pow.f64(double 1.000000e+01, double %x)
  ret double %0
}

declare double @llvm.pow.f64(double, double) #1

Simplify libcall (part of instcombine) will turn the above into:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
  %__exp10 = call double @__exp10(double %x) #1
  ret double %__exp10
}

declare double @__exp10(double)

The pre-instcombine code works because calls to LLVM builtins are special.
Instruction selection will chose the right calling convention for the call.
However, the code after instcombine is wrong. The call to __exp10 will use
the C calling convention.

I can think of 3 options to fix this.

1. Make "C" calling convention just work since the target should know what CC
   is being used.

   This doesn't work because each function can use different CC with the "pcs"
   attribute.

2. Have Clang add the right CC keyword on the calls to LLVM builtin.

   This will work but it doesn't match the LLVM IR specification which states
   these are "Standard C Library Intrinsics".

3. Fix simplify libcall so the resulting calls to the C routines will have the
   proper CC keyword. e.g.
   %__exp10 = call arm_aapcs_vfpcc double @__exp10(double %x) #1

   This works and is the solution I implemented here.

Both solutions #2 and #3 would work. After carefully considering the pros and
cons, I decided to implement #3 for the following reasons.

1. It doesn't change the "spec" of the intrinsics.
2. It's a self-contained fix.

There are a couple of potential downsides.
1. There could be other places in the optimizer that is broken in the same way
   that's not addressed by this.
2. There could be other calling conventions that need to be propagated by
   simplify-libcall that's not handled.

But for now, this is the fix that I'm most comfortable with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 20:49:45 +00:00
Tim Northover
b7dec2139c llvm-c: expose unnamedaddr field of globals
Patch by Manuel Jacob.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 19:24:35 +00:00
Benjamin Kramer
6e9eeab69f [C++11] Modernize the IR library a bit.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203465 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 15:03:06 +00:00