Commit Graph

20307 Commits

Author SHA1 Message Date
Craig Topper
095734c578 [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206254 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 07:20:03 +00:00
Nick Lewycky
9393eb354f Add a DenseMapInfo specialization for PointerUnion. In tree user to land shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206253 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 07:08:40 +00:00
Craig Topper
0b6cb7104b [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 06:32:26 +00:00
Chandler Carruth
eb19b8f58b [Allocator] Constrain the Deallocate templated overloads to only apply
to types which we can compute the size of. The comparison with zero
isn't actually interesting here, it's mostly about putting sizeof into
a sfinae context.

This is particular important for Deallocate as otherwise the void*
overload can quickly become ambiguous.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206251 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 06:29:04 +00:00
David Blaikie
3229c698e4 Use unique_ptr to manage ownership of GCFunctionInfos in GCStrategy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206249 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 06:07:26 +00:00
David Blaikie
9c94042083 Use unique_ptr for the result of Registry entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206248 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 05:53:26 +00:00
David Blaikie
5a21a893c0 Use unique_ptr to manage ownership of GCStrategy objects in GCMetadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206246 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 05:34:49 +00:00
David Blaikie
ff2bf1bb8d Use unique_ptr to own MCFunctions within MCModule.
MCModule's ctor had to be moved out of line so the definition of
MCFunction was available. (ctor requires the dtor of members (in case
the ctor throws) which required access to the dtor of MCFunction)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 05:15:19 +00:00
Craig Topper
570e52c6f1 [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206243 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 04:59:12 +00:00
David Blaikie
a8ae0ad11f Use std::unique_ptr to manage MCBasicBlocks in MCFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206242 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 04:56:29 +00:00
Lang Hames
508bd63046 [MC] Require an MCContext when constructing an MCDisassembler.
This patch re-introduces the MCContext member that was removed from
MCDisassembler in r206063, and requires that an MCContext be passed in at
MCDisassembler construction time. (Previously the MCContext member had been
initialized in an ad-hoc fashion after construction). The MCCContext member
can be used by MCDisassembler sub-classes to construct constant or
target-specific MCExprs.

This patch updates disassemblers for in-tree targets, and provides the
MCRegisterInfo instance that some disassemblers were using through the
MCContext (previously those backends were constructing their own
MCRegisterInfo instances).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206241 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 04:40:56 +00:00
Jim Grosbach
c17bcb8b34 Add iterator_range for MachineInstr defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206238 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 02:14:06 +00:00
Chandler Carruth
159976c271 [Allocator] Add Deallocate support to the AllocatorBase CRTP class,
along with templated overloads much like we have for Allocate. These
will facilitate switching the Deallocate interface of all the Allocator
classes to accept the size by pre-filling it from the type size where we
can do so. I plan to convert several uses to the template variants in
subsequent patches prior to adding the Size parameter.

No functionality changed, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 00:47:47 +00:00
Chandler Carruth
75ba212653 [Allocator] Hack around the fact that GCC can't compile the
static_assert added in r206225. I'm looking into a proper fix, but
wanted the bots back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 00:22:53 +00:00
Chandler Carruth
ebfe4d7fee [Allocator] Factor the Allocate template overloads into a base class
rather than defining them (differently!) in both allocators. This also
serves as a basis for documenting and even enforcing some of the
LLVM-style "allocator" concept methods which must exist with various
signatures.

I plan on extending and changing the signatures of these to further
simplify our allocator model in subsequent commits, so I wanted to
factor things as best as I could first. Notably, I'm working to add the
'Size' to the deallocation method of all allocators. This has several
implications not the least of which are faster deallocation times on
certain allocation libraries (tcmalloc). It also will allow the JIT
allocator to fully model the existing allocation interfaces and allow
sanitizer poisoning of deallocated regions. The list of advantages goes
on. =] But by factoring things first I'll be able to make this easier by
first introducing template helpers for the deallocation path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206225 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 00:19:41 +00:00
Chandler Carruth
1a77583742 [cleanup] Run clang-format over most of YAMLParser.h to fix a bunch of
small formatting inconsistencies with the rest of LLVM and even this
file. I looked at all the changes and they seemed like just better
formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206209 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 21:12:15 +00:00
James Molloy
1f1bced6e7 [ARM64] Add big endian target arm64_be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206197 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 17:37:53 +00:00
James Molloy
555f97f2bc Teach llvm-lto to respect the given RelocModel.
Patch by Nick Tomlinson!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 13:54:16 +00:00
Chandler Carruth
1907f75445 [Allocator] Hoist the external helper function into a namespace scope
declaration. GCC 4.7 appears to get hopelessly confused by declaring
this function within a member function of a class template. Go figure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206152 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 06:42:56 +00:00
Chandler Carruth
273a62f9ac [cleanup] Normalize YAMLParser.h's doxygen markers with '\foo' instead
of '@foo'. The slash variant is prefered in LLVM and the file was
already using a mixture. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 06:22:03 +00:00
Chandler Carruth
17f9c2e35b [Allocator] Make the underlying allocator a template instead of an
abstract interface. The only user of this functionality is the JIT
memory manager and it is quite happy to have a custom type here. This
removes a virtual function call and a lot of unnecessary abstraction
from the common case where this is just a *very* thin vaneer around
a call to malloc.

Hopefully still no functionality changed here. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206149 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 05:11:27 +00:00
Chandler Carruth
e20c45d2d8 Fix the compile from r206147 in release builds by moving a variable
declaration outside of #ifndef NDEBUG -- its used elsewhere. Sorry for
the noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 04:46:30 +00:00
Chandler Carruth
cb7ead25c2 [Allocator] Switch the BumpPtrAllocator to use a vector of pointers to
slabs rather than embedding a singly linked list in the slabs
themselves. This has a few advantages:

- Better utilization of the slab's memory by not wasting 16-bytes at the
  front.
- Simpler allocation strategy by not having a struct packed at the
  front.
- Avoids paging every allocated slab in just to traverse them for
  deallocating or dumping stats.

The latter is the really nice part. Folks have complained from time to
time bitterly that tearing down a BumpPtrAllocator, even if it doesn't
run any destructors, pages in all of the memory allocated. Now it won't.
=]

Also resolves a FIXME with the scaling of the slab sizes. The scaling
now disregards specially sized slabs for allocations larger than the
threshold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206147 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 03:55:11 +00:00
Craig Topper
01b72784c9 Add back some typecasts I accidentally lost in r206142.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206143 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 01:11:34 +00:00
Craig Topper
4ba844388c [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206142 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 00:51:57 +00:00
Craig Topper
4266ae8067 [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206129 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-13 04:57:38 +00:00
Saleem Abdulrasool
b77944d5ff tools: teach objdump about FILE aux records
Add support for file auxiliary symbol entries in COFF symbol tables.  A COFF
symbol table with a FILE entry is followed by sizeof(__FILE__) / 18 auxiliary
symbol records which contain the filename.  Read them and form the original
filename that the record contains.  Then display the name in the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206126 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-13 03:11:08 +00:00
Benjamin Kramer
15c435a367 Retire llvm::array_endof in favor of non-member std::end.
While there make array_lengthof constexpr if we have support for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206112 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-12 16:15:53 +00:00
Benjamin Kramer
479151ab7f Move MDBuilder's methods out of line.
Making them inline was a historical accident, they're neither hot nor
templated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206109 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-12 14:26:59 +00:00
Duncan P. N. Exon Smith
670060dddf blockfreq: Rename BlockProbInfoT to BranchProbabilityInfoT
No functionality change.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 23:21:04 +00:00
Duncan P. N. Exon Smith
3c371e995a blockfreq: Remove unnecessary template parameters
Moves redundant template parameters into an implementation detail of
BlockFrequencyInfoImpl.

No functionality change.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206084 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 23:21:02 +00:00
Duncan P. N. Exon Smith
e9139c68d4 blockfreq: Rename BlockFrequencyImpl to BlockFrequencyInfoImpl
This is a shared implementation class for BlockFrequencyInfo and
MachineBlockFrequencyInfo, not for BlockFrequency, a related (but
distinct) class.

No functionality change.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206083 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 23:20:58 +00:00
David Blaikie
0f6d8c6c8d Format fixes for r205990
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 22:11:50 +00:00
Benjamin Kramer
71e50b4d97 Make doxygen comment match the declaration.
Found by -Wdocumentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 21:58:11 +00:00
Lang Hames
a02c32f31d Remove redundant symbolization support from MCDisassembler interface.
MCDisassembler has an MCSymbolizer member that is meant to take care of
symbolizing during disassembly, but it also has several methods that enable the
disassembler to do symbolization internally (i.e. without an attached symbolizer
object). There is no need for this duplication, but ARM64 had been making use of
it. This patch moves the ARM64 symbolization logic out of ARM64Disassembler and
into an ARM64ExternalSymbolizer class, and removes the duplicated MCSymbolizer
functionality from the MCDisassembler interface. Symbolization will now be
done exclusively through MCSymbolizers.

There should be no impact on disassembly for any platform, but this allows us to
tidy up the MCDisassembler interface and simplify the process of (and invariants
related to) disassembler setup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206063 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 20:07:58 +00:00
Matt Arsenault
d879166376 Move ExtractVectorElements to SelectionDAG.
This seems generally useful, and makes sense to
go along with SplitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206041 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 17:47:30 +00:00
Tom Stellard
fdde7d2110 SelectionDAG: Factor ISD::MUL lowering code out of DAGTypeLegalizer
This code has been moved to a new function in the TargetLowering
class called expandMUL().  The purpose of this is to be able
to share lowering code between the SelectionDAGLegalize and
DAGTypeLegalizer classes.

No functionality changed intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206036 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 16:11:58 +00:00
Diego Novillo
bb7b423bdc Fix use-after-free bug caught by address sanitizer:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2959

The location string is returned as a std::string, not a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 13:55:56 +00:00
Simon Atanasyan
eb0c9094ac [yaml2obj][ELF] ELF Relocations Support.
The patch implements support for both relocation record formats: Elf_Rel
and Elf_Rela. It is possible to define relocation against symbol only.
Relocations against sections will be implemented later. Now yaml2obj
recognizes X86_64, MIPS and Hexagon relocation types.

Example of relocation section specification:
Sections:
- Name: .text
  Type: SHT_PROGBITS
  Content: "0000000000000000"
  AddressAlign: 16
  Flags: [SHF_ALLOC]

- Name: .rel.text
  Type: SHT_REL
  Info: .text
  AddressAlign: 4
  Relocations:
    - Offset: 0x1
      Symbol: glob1
      Type: R_MIPS_32
    - Offset: 0x2
      Symbol: glob2
      Type: R_MIPS_CALL16

The patch reviewed by Michael Spencer, Sean Silva, Shankar Easwaran.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 04:13:39 +00:00
David Blaikie
77cf856e56 Implement depth_first and inverse_depth_first range factory functions.
Also updated as many loops as I could find using df_begin/idf_begin -
strangely I found no uses of idf_begin. Is that just used out of tree?

Also a few places couldn't use df_begin because either they used the
member functions of the depth first iterators or had specific ordering
constraints (I added a comment in the latter case).

Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T>
where you needed iterator_range<idf_iterator<T>>)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206016 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 01:50:01 +00:00
David Blaikie
e6cd1ac2d5 Use value types instead of 'new'd objects to store dwarf labels for asm files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 00:43:52 +00:00
Jim Grosbach
fb4b420326 SDNode: Add uses() iterator_range convenience methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206005 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 00:27:17 +00:00
David Blaikie
42382d3e37 Remove lazy-initialization of section caches in MCContext
This seems to have been a cargo-culted habit from the very first such
cache which didn't have any specific justification (but might've been a
layering constraint at the time).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206003 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 23:55:11 +00:00
Reid Kleckner
bc1fd917f0 Move the segmented stack switch to a function attribute
This removes the -segmented-stacks command line flag in favor of a
per-function "split-stack" attribute.

Patch by Luqman Aden and Alex Crichton!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205997 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 22:58:43 +00:00
David Blaikie
83ee956104 Simplify make_range by using move semantics
Move the iterators into the range the same way the range's ctor moves
them into the members.

Also remove some redundant top level parens in the return statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205993 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 22:03:48 +00:00
David Blaikie
fe25521451 Reimplement debug info compression by compressing the whole section, rather than a fragment.
To support compressing the debug_line section that contains multiple
fragments (due, I believe, to variation in choices of line table
encoding depending on the size of instruction ranges in the actual
program code) we needed to support compressing multiple MCFragments in a
single pass.

This patch implements that behavior by mutating the post-relaxed and
relocated section to be the compressed form of its former self,
including renaming the section.

This is a more flexible (and less invasive, to a degree) implementation
that will allow for other features such as "use compression only if it's
smaller than the uncompressed data".

Compressing debug_frame would be a possible further extension to this
work, but I've left it for now. The hurdle there is alignment sections -
which might require going as far as to refactor
MCAssembler.cpp:writeFragment to handle writing to a byte buffer or an
MCObjectWriter (there's already a virtual call there, so it shouldn't
add substantial compile-time cost) which could in turn involve
refactoring MCAsmBackend::writeNopData to use that same abstraction...
which involves touching all the backends. This would remove the limited
handling of fragment writing seen in
ELFObjectWriter.cpp:getUncompressedData which would be nice - but it's
more invasive.

I did discover that I (perhaps obviously) don't need to handle
relocations when I rewrite the fragments - since the relocations have
already been applied and computed (and stored into
ELFObjectWriter::Relocations) by this stage (necessarily, because we
need to have written any immediate values or assembly-time relocations
into the data already before we compress it, which we have). The test
case doesn't necessarily cover that in detail - I can add more test
coverage if that's preferred.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205990 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 21:53:53 +00:00
David Blaikie
22f3236dd6 Revert debug info compression support.
To support compression for debug_line and debug_frame a different
approach is required. To simplify review, revert the old implementation
and XFAIL the test case. New implementation to follow shortly.

Reverts r205059 and r204958.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205989 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 21:53:47 +00:00
Jim Grosbach
b4dd10a723 iterator_range: Add an llvm::make_range() helper method.
Convenience wrapper to make dealing with sub-ranges easier. Like the
iterator_range<> itself, if/when this sort of thing gets standards
blessing, it will be replaced by the official version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205987 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 21:49:22 +00:00
Adrian Prantl
a7ff9e9e6a Revert "Follow-up to r205973: change the return type to const MDNode*."
This reverts commit r205974, it turns out that this wasn't such a great idea
after all. Using DIVariable as return value is self-documenting and marginally
more type safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205979 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 18:37:53 +00:00
Adrian Prantl
cccac6162d Follow-up to r205973: change the return type to const MDNode*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205974 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 17:50:30 +00:00
Adrian Prantl
b7b9bf458b Debug info: Factor the retrieving of the DIVariable from a MachineInstr
into a function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205973 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 17:39:48 +00:00
Dmitri Gribenko
7aca6639c2 SaveAndRestore: fix coding style and Doxygenify comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205959 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 09:44:32 +00:00
David Majnemer
878657074a YAMLIO: Allow scalars to dictate quotation rules
Introduce ScalarTraits::mustQuote which determines whether or not a
StringRef needs quoting before it is acceptable to output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205955 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-10 07:37:33 +00:00
Justin Holewinski
77f268945e [NVPTX] Add preliminary intrinsics and codegen support for textures/surfaces
This commit adds intrinsics and codegen support for the surface read/write and texture read instructions that take an explicit sampler parameter. Codegen operates on image handles at the PTX level, but falls back to direct replacement of handles with kernel arguments if image handles are not enabled. Note that image handles are explicitly disabled for all target architectures in this change (to be enabled later).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205907 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 15:39:15 +00:00
Alp Toker
46d36be2eb Fix some doc and comment typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205899 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 14:47:27 +00:00
Arnold Schwaighofer
b0ee2374ce SLPVectorizer: Only vectorize intrinsics whose operands are widened equally
The vectorizer only knows how to vectorize intrinics by widening all operands by
the same factor.

Patch by Tyler Nowicki!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205855 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 14:20:47 +00:00
Craig Topper
ec0f0bc6af [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 06:08:46 +00:00
Craig Topper
8a0d1c8f06 [C++11] Make use of 'nullptr' in TableGen library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205830 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 04:50:04 +00:00
Craig Topper
725011e72f [C++11] Replace some comparisons with 'nullptr' with simple boolean checks to reduce verbosity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 04:20:00 +00:00
Diego Novillo
ccbf1d2a05 Add support for optimization reports.
Summary:
This patch adds backend support for -Rpass=, which indicates the name
of the optimization pass that should emit remarks stating when it
made a transformation to the code.

Pass names are taken from their DEBUG_NAME definitions.

When emitting an optimization report diagnostic, the lack of debug
information causes the diagnostic to use "<unknown>:0:0" as the
location string.

This is the back end counterpart for

http://llvm-reviews.chandlerc.com/D3226

Reviewers: qcolombet

CC: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205774 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-08 16:42:34 +00:00
Richard Smith
0bd8ea3823 The LLVM C API shouldn't be including a file from the C++ API. Especially not a
file that it doesn't use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-08 10:47:04 +00:00
David Majnemer
de6256c938 obj2yaml: Use the correct relocation type for different machine types
The IO normalizer would essentially lump I386 and AMD64 relocations
together.  Relocation types with the same numeric value would then get
mapped in appropriately.

For example:
IMAGE_REL_AMD64_ADDR64 and IMAGE_REL_I386_DIR16 both have a numeric
value of one.  We would see IMAGE_REL_I386_DIR16 in obj2yaml conversions
of object files with a machine type of IMAGE_FILE_MACHINE_AMD64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 23:12:20 +00:00
Richard Smith
4db84a0687 Remove an unused file.
Using this file would result in an odr violation: it defines an llvm::Interval
class that conflicts with the one in Analysis/Interval.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205726 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 17:17:00 +00:00
Simon Atanasyan
503334ab44 Fix a typo in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205707 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 12:59:36 +00:00
Craig Topper
a661c91aa4 Use 'false' for a bool instead of '0'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205699 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 06:59:39 +00:00
Craig Topper
34bc6b6e78 [C++11] Make use of 'nullptr' in the Support library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 04:17:22 +00:00
NAKAMURA Takumi
2e858fcaad Quick fix: Triple::isOSMSVCRT() should be false for targeting cygwin.
It affected callee's stack pop in x86. It is one of devergences between cygwin and mingw since mingw-gcc-4.6.

Added testcases to llvm/test/CodeGen/X86/win32_sret.ll for cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205688 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-06 10:01:23 +00:00
David Blaikie
1c41705d34 DebugInfo: Support namespace aliases as DW_TAG_imported_declaration instead of DW_TAG_imported_module
I really should read the spec more often (and test GCC more often too).
I just assumed that namespace aliases would be the same as using
directives, except with a name. But apparently that's not how the DWARF
standards suggests they be implemented. DWARF4 provides an example and
other non-normative text suggesting that namespace aliases be
implemented by named imported declarations intsead of named imported
modules.

So be it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205685 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-06 06:29:01 +00:00
Argyrios Kyrtzidis
20384a5583 [Support] Modify LockFileManager::waitForUnlock() to return info about how the lock was released.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205683 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-06 03:19:31 +00:00
David Blaikie
ec37734d3c Remove unused parameter
Also update a few null pointers in this function to be consistent with
new null pointers being added.

Patch by Robert Matusewicz!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 23:33:25 +00:00
David Blaikie
b29a2b0c4c MachineInstr: introduce explicit_operands and implicit_operands ranges
Makes iteration over implicit and explicit machine operands more
explicit (har har). Insipired by code review discussion for r205565.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205680 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 22:42:04 +00:00
David Blaikie
553e40036a Remove unnecessary "inline" of inline defined member functions
Member functions defined within a class definition are implicitly
'inline' for linkage purposes. Compilers might slightly favor inlining
functions explicitly marked 'inline', but LLVM doesn't make a stylistic
habit of doing this generally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205679 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 22:20:50 +00:00
David Blaikie
b4074c010b Simplify compression API by compressing into a SmallVector rather than a MemoryBuffer
This is the other half of r205676.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205677 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 21:53:04 +00:00
David Blaikie
b206103abc Simplify compression API by decompressing into a SmallVector rather than a MemoryBuffer
This avoids an extra copy during decompression and avoids the use of
MemoryBuffer which is a weirdly esoteric device that includes unrelated
concepts like "file name" (its rather generic name is a bit misleading).

Similar refactoring of zlib::compress coming up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205676 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 21:26:44 +00:00
David Blaikie
eb22ac0886 Remove unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205672 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-05 20:20:46 +00:00
Matt Arsenault
a134cec06b Add DAG parameter to ComputeNumSignBitsForTargetNode
This way, you can check the number of sign bits in the
operands. The depth parameter it already has is pretty useless
without this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205649 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04 20:13:13 +00:00
Jim Grosbach
f2decb2ea8 Tidy up naming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205633 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04 17:36:55 +00:00
Craig Topper
84f7f350c3 Make consistent use of MCPhysReg instead of uint16_t throughout the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205610 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04 05:16:06 +00:00
Jim Grosbach
84c21b38a9 Fix spelling. Sigh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205605 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04 02:14:38 +00:00
Jim Grosbach
ab585ff20e Add iterator_ranges for block pred/succ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-04 02:10:59 +00:00
Rafael Espindola
7df9059541 Implement getRelocationAddress for MachO and ET_REL elf files.
With that, fix the symbolizer to work with any ELF file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205588 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 23:54:35 +00:00
Rafael Espindola
67c46d286f Remove section_rel_empty. Just compare begin() and end() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 22:42:22 +00:00
Rafael Espindola
da7ea68f0d Reuse existing variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205572 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 21:48:41 +00:00
Dmitri Gribenko
d5ba2d296e ArrayRef: use std::vector::data() now that we are building in C++11 mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 16:29:11 +00:00
Rafael Espindola
46aa8c8dae Handle getting UnknownAddressOrSize or section_end().
These should probably be error conditions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205509 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 03:57:03 +00:00
Rafael Espindola
051c948bbe Implement get getSymbolFileOffset with getSymbolAddress.
This has the following advantages:
* Less code.
* The old ELF implementation was wrong for non-relocatable objects.
* The old ELF implementation (and I think MachO) was wrong for thumb.

No current testcase since this is only used from MCJIT and it only uses
relocatable objects and I don't think it supports thumb yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 03:13:33 +00:00
Rafael Espindola
3539519223 Remove getSymbolValue.
All existing users explicitly ask for an address or a file offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205503 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 02:32:47 +00:00
Rafael Espindola
2f913e3c6c Add support for the R_ARM_ABS32 relocation.
This should bring the arm buildbots back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205502 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 02:27:00 +00:00
Rafael Espindola
ee2bf5b607 Only clear the thumb bit from function addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205500 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 02:20:43 +00:00
Rafael Espindola
96b816800e Simplify ELFObjectFile<ELFT>::getSymbolAddress.
In particular, we only need to fetch the section if this is a relocatable
object.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205499 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 01:51:15 +00:00
Rafael Espindola
14ae43449c Revert "Fix a nomenclature error in llvm-nm."
This reverts commit r205479.

It turns out that nm does use addresses, it is just that every reasonable
relocatable ELF object has sections with address 0. I have no idea if those
exist in reality, but it at least it shows that llvm-nm should use the name
address.

The added test was includes an unusual .o file with non 0 section addresses. I
created it by hacking ELFObjectWriter.cpp.

Really sorry for the churn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205493 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 00:19:35 +00:00
Rafael Espindola
5a61b72493 Fix a nomenclature error in llvm-nm.
What llvm-nm prints depends on the file format. On ELF for example, if the
file is relocatable, it prints offsets. If it is not, it prints addresses.
Since it doesn't really need to care what it is that it is printing, use the
generic term value.

Fix or implement getSymbolValue to keep llvm-nm working.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 22:52:46 +00:00
Duncan P. N. Exon Smith
3845c071a7 Revert "Reapply "LTO: add API to set strategy for -internalize""
This reverts commit r199244.

Conflicts:
	include/llvm-c/lto.h
	include/llvm/LTO/LTOCodeGenerator.h
	lib/LTO/LTOCodeGenerator.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 22:05:57 +00:00
Rafael Espindola
04194e05db Add back an assert that was lost in the ELFObjectFile.h split.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205456 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 20:00:33 +00:00
Jim Grosbach
bc07242d9b Simplify resolveFrameIndex() signature.
Just pass a MachineInstr reference rather than an MBB iterator.
Creating a MachineInstr& is the first thing every implementation did
anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205453 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 19:28:18 +00:00
Adrian Prantl
f1d7924f61 fix a comment to use ASCII aprostrophes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205428 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-02 15:49:37 +00:00
David Blaikie
e8907d6649 Add inequality operator for MachineLocation.
Fixes the build I broke in r205360

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205361 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 21:54:52 +00:00
Adrian Prantl
2f1e34736e Add a comment about the DIDescriptor class hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205358 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 21:04:24 +00:00
Hal Finkel
0d5c0629bb Add some additional fields to TTI::UnrollingPreferences
In preparation for an upcoming commit implementing unrolling preferences for
x86, this adds additional fields to the UnrollingPreferences structure:

 - PartialThreshold and PartialOptSizeThreshold - Like Threshold and
   OptSizeThreshold, but used when not fully unrolling. These are necessary
   because we need different thresholds for full unrolling from those used when
   partially unrolling (the full unrolling thresholds are generally going to be
   larger).

 - MaxCount - A cap on the unrolling factor when partially unrolling. This can
   be used by a target to prevent the unrolled loop from exceeding some
   resource limit independent of the loop size (such as number of branches).

There should be no functionality change for any in-tree targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205347 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 18:50:30 +00:00
Matt Arsenault
1ff5f1a061 Add helpers for checking if a value is a target boolean constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205335 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-01 18:13:22 +00:00