Commit Graph

17575 Commits

Author SHA1 Message Date
Michael Ilseman
afe77f33b2 Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.
A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:18:53 +00:00
Chris Lattner
fd0543d9be rename "SkipToWord" to "SkipToFourByteBoundary" since a word is not always 4 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173062 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:04:19 +00:00
Chandler Carruth
a5157e68d1 Switch CodeMetrics itself over to use TTI to determine if an instruction
is free. The whole CodeMetrics API should probably be reworked more, but
this is enough to allow deleting the duplicate code there for computing
whether an instruction is free.

All of the passes using this have been updated to pull in TTI and hand
it to the CodeMetrics stuff. Further, a dead CodeMetrics API
(analyzeFunction) is nuked for lack of users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 13:04:33 +00:00
Chandler Carruth
6097e774fc Fix indentation and formatting.
This change brought to by clang-format. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 12:14:42 +00:00
Chandler Carruth
8d6c0f4dee Now that the inline cost analysis is a pass, we can easily have it
depend on and use other analyses (as long as they're either immutable
passes or CGSCC passes of course -- nothing in the pass manager has been
fixed here). Leverage this to thread TargetTransformInfo down through
the inline cost analysis.

No functionality changed here, this just threads things through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 11:55:09 +00:00
Chandler Carruth
86953b5795 Make the inline cost a proper analysis pass. This remains essentially
a dynamic analysis done on each call to the routine. However, now it can
use the standard pass infrastructure to reference other analyses,
instead of a silly setter method. This will become more interesting as
I teach it about more analysis passes.

This updates the two inliner passes to use the inline cost analysis.
Doing so highlights how utterly redundant these two passes are. Either
we should find a cheaper way to do always inlining, or we should merge
the two and just fiddle with the thresholds to get the desired behavior.
I'm leaning increasingly toward the latter as it would also remove the
Inliner sub-class split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173030 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 11:39:18 +00:00
Chandler Carruth
78e1cdaba3 Fix an old-style doxygen comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173027 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 11:39:12 +00:00
Chandler Carruth
4ef13242ab Cleanup the formatting of this header. This removes the namespace indent
and reformats a few constructors using clang-format. Only whitespace
changes here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173018 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 10:08:42 +00:00
Michael J. Spencer
77c27f4394 Revert "[Object] .bss sections have no content. PR15005."
This reverts commit r173007.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173012 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 08:13:04 +00:00
Michael J. Spencer
07d5617ca8 [Object] .bss sections have no content. PR15005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 06:46:11 +00:00
Chandler Carruth
c61aa59bcc Remove the comma from the last enumerator to fix -pedantic warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172999 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 02:17:36 +00:00
Chandler Carruth
1e05bd9e71 Introduce a generic interface for querying an operation's expected
lowered cost.

Currently, this is a direct port of the logic implementing
isInstructionFree in CodeMetrics. The hope is that the interface can be
improved (f.ex. supporting un-formed instruction queries) and the
implementation abstracted so that as we have test cases and target
knowledge we can expose increasingly accurate heuristics to clients.

I'll start switching existing consumers over and kill off the routine in
CodeMetrics in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172998 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 01:27:39 +00:00
NAKAMURA Takumi
f3c437b167 Support/Compiler.h: MSC1600, aka VS2010, is not C++11-ready.
LLVM_HAS_CXX11_TYPETRAITS -- std::is_constructible
LLVM_HAS_CXX11_STDLIB -- std::unique_ptr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 00:30:31 +00:00
Renato Golin
053a211983 Revert CostTable algorithm, will re-write
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 20:57:20 +00:00
Michael J. Spencer
01812bebcc [Support] Port ErrorOr<T> from lld to C++03.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 20:32:30 +00:00
Michael Gottesman
ec98d2ce5e Changed IRBuilder::CreateZExtOrTrunc and IRBuilder::CreateSExtOrTrunc so they also work with vectors.
I also changed the name of a variable in IRBuilder::CreateFPExtOrFPTrunc to
match the names used in its two matching brethern as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172967 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 07:33:26 +00:00
Michael Gottesman
0e1a9f27bd More copy editing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172962 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 05:12:35 +00:00
Michael Gottesman
a1456e1cb8 Doxygenified and copy edited BasicBlock.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 05:03:42 +00:00
Michael Gottesman
b6b8ba6269 Doxygenified Argument.h and performed some copy editing of the documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 05:03:39 +00:00
Michael Gottesman
864c2a261a Converted all method comments in IRBuilder.h to use doxygen style comments.
This implies changing method documentation from the following style:

/// MethodName - Method description...

to

/// \brief Method description...

ala the LLVM Style Guide.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172959 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 05:03:37 +00:00
Michael Gottesman
bd12e22d7a Corrected assert messages for CreateZExtOrTrunc/CreateSExtOrTrunc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 04:19:39 +00:00
Michael Gottesman
8b28998777 Added IRBuilder::CreateFPExtOrFPTrunc.
This method serves an analogous purpose to CreateZExtOrTrunc/CreateSExtOrTrunc
but for floating point types.

In detail, it provides a manner when one is handling conversions of floating
point types of automatically selecting fpext, fptrunc, or identity depending on
the relative bitsize of the source and destination types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172957 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 03:56:31 +00:00
Chris Lattner
1ca114a66b trivial micro-optimization: lazily call the virtual method instead of eagerly calling it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172953 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:54:05 +00:00
Chris Lattner
4156ca76e3 switch llvm-bcanalyzer onto the new cursor APIs, allowing deletion of
the old ReadRecord methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172952 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:50:32 +00:00
Chris Lattner
099b636562 add an option to not auto-process abbreviations in advance()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 02:12:39 +00:00
Chris Lattner
194ef24dfe stringref'ize readRecord and properly capitalize it. Add a compatibility method to easy
the transition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 01:06:48 +00:00
Chris Lattner
f9147c41d8 move some private methods out of line, add a skipRecord() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20 00:00:00 +00:00
Chris Lattner
344fc23d23 add some optional flags to affect the way advance works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 23:31:15 +00:00
Chris Lattner
63246aa04f Add a new BitstreamEntry concept, and add two helper methods for walking
through a BitstreamCursor that produce it: advance() and 
advanceSkippingSubblocks(), representing the two most common ways clients
want to walk through bitcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172919 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 21:35:24 +00:00
Jakub Staszak
e37dd04b10 Include Support/ELF.h instead of Object/ELF.h. It is much lighter and completely
sufficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172916 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 19:56:11 +00:00
Chris Lattner
312c7d9dc1 BitstreamReader hasn't aged well. It's been hacked on by various people and
has past the point of making sense.  Lets tidy things up: first step, moving
a ton of big functions out of line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 18:19:39 +00:00
Chandler Carruth
90230c8466 Sort all of the includes. Several files got checked in with mis-sorted
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172891 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:03:47 +00:00
Andrew Kaylor
6fff325fb6 Fixing behavior of ELFObjectFile::getSymbolFileOffset().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172872 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 23:40:42 +00:00
Bill Wendling
1b0c54f1c5 Use AttributeSet accessor methods instead of Attribute accessor methods.
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:53:16 +00:00
Bill Wendling
1a17bd21ff Remove unused parameter. Also use the AttributeSet query methods instead of the Attribute query methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172852 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:50:24 +00:00
Jordan Rose
8a53a8329f Add llvm::hexDigitValue to convert single characters to hex.
This is duplicated in a couple places in the codebase. Adopt this in APFloat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172851 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:45:30 +00:00
Jack Carter
c91cbb9b0c This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.
Support for Mips register information sections.

Mips ELF object files have a section that is dedicated
to register use info. Some of this information such as
the assumed Global Pointer value is used by the linker
in relocation resolution.

The register info file is .reginfo in o32 and .MIPS.options
in 64 and n32 abi files.

This patch contains the changes needed to create the sections,
but leaves the actual register accounting for a future patch.


Contributer: Jack Carter
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172847 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:20:38 +00:00
Bill Wendling
956f13440a Push some more methods down to hide the use of the Attribute class.
Because the Attribute class is going to stop representing a collection of
attributes, limit the use of it as an aggregate in favor of using AttributeSet.
This replaces some of the uses for querying the function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172844 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 21:11:39 +00:00
Daniel Dunbar
39dff21348 [Linker] Zap a dead typedef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172841 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 20:08:09 +00:00
Daniel Dunbar
92d8cc6362 [Linker] Kill Linker::LoadObject which is dead, and drop the BitReader dependency again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 19:37:11 +00:00
Will Dietz
ae36eccdfb Move Blacklist.h to include/ to enable use from clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 11:29:21 +00:00
Daniel Dunbar
a94c339423 [MC/Mach-O] Add support for linker options in Mach-O files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 01:26:07 +00:00
Daniel Dunbar
cddd236e8a [MC/Mach-O] Add AsmParser support for .linker_option directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172778 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 01:25:48 +00:00
Daniel Dunbar
bfdcc70d34 [MC] Expose ParseEscapedString to target AsmParser implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172777 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18 01:25:33 +00:00
Bill Wendling
167ede898a Reverting r171325 & r172363. This was causing a mis-compile on the self-hosted LTO build bots.
Okay, here's how to reproduce the problem:

1) Build a Release (or Release+Asserts) version of clang in the normal way.

2) Using the clang & clang++ binaries from (1), build a Release (or
   Release+Asserts) version of the same sources, but this time enable LTO ---
   specify the `-flto' flag on the command line.

3) Run the ARC migrator tests:

    $ arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ ./src/tools/clang/test/ARCMT/cxx-rewrite.mm

You'll see that the output isn't correct (the whitespace is off).

The mis-compile is in the function `RewriteBuffer::RemoveText' in the
clang/lib/Rewrite/Core/Rewriter.cpp file. When that function and RewriteRope.cpp
are compiled with LTO and the `arcmt-test' executable is regenerated, you'll see
the error. When those files are not LTO'ed, then the output of the `arcmt-test'
is fine.

It is *really* hard to get a testcase out of this. I'll file a PR with what I
have currently.

--- Reverse-merging r172363 into '.':
U    include/llvm/Analysis/MemoryBuiltins.h
U    lib/Analysis/MemoryBuiltins.cpp

--- Reverse-merging r171325 into '.':
U    test/Transforms/InstCombine/objsize.ll
G    include/llvm/Analysis/MemoryBuiltins.h
G    lib/Analysis/MemoryBuiltins.cpp




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 21:28:46 +00:00
Aaron Ballman
cb4830cc99 Reverting back to the fallback instead of using the 64-bit popcnt instruction as it doesn't exist on all x64 CPU architectures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172751 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 20:04:28 +00:00
Daniel Dunbar
634bd8512a [Linker] Drop support for IR-level extended linking support (archives, etc.).
- This code is dead, and the "right" way to get this support is to use the
   platform-specific linker-integrated LTO mechanisms, or the forthcoming LLVM
   linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172749 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 19:52:25 +00:00
Chad Rosier
505bca3617 [ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.
Part of rdar://12576868


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 19:21:48 +00:00
Aaron Ballman
67828056dd Reverting back to the fallback instead of using popcnt; this instruction doesn't exist on all CPU architectures. Fixes PR14982
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172734 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 18:27:30 +00:00
Alexey Samsonov
11af9a873f ASan: add optional 'zero-based shadow' option to ASan passes. Always tell the values of shadow scale and offset to the runtime
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172709 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 11:12:32 +00:00
Jakob Stoklund Olesen
5ed625c3cf Move MachineTraceMetrics.h into include/llvm/CodeGen.
Let targets use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 01:06:04 +00:00
Jakob Stoklund Olesen
02c6325a45 Provide a place for targets to insert ILP optimization passes.
Move the early if-conversion pass into this group.

ILP optimizations usually need to find the right balance between
register pressure and ILP using the MachineTraceMetrics analysis to
identify critical paths and estimate other costs. Such passes should run
together so they can share dominator tree and loop info analyses.

Besides if-conversion, future passes to run here here could include
expression height reduction and ARM's MLxExpansion pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17 00:58:38 +00:00
Aaron Ballman
69877d6db9 Wrapping __popcnt64 for MSVC so that it's only used on 64-bit builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 23:17:21 +00:00
Daniel Dunbar
5db391c67d [IR] Add 'Append' and 'AppendUnique' module flag behaviors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 21:38:56 +00:00
Renato Golin
d3c965d625 Change CostTable model to be global to all targets
Moving the X86CostTable to a common place, so that other back-ends
can share the code. Also simplifying it a bit and commoning up
tables with one and two types on operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172658 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 21:29:55 +00:00
Michael J. Spencer
c8b909ae49 [Support] Include the intrisics header and check for definition properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172655 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 20:50:43 +00:00
Michael J. Spencer
2dcc27367c [Support] Add MSVC intrinsic for CountPopulation.
Patch by Jakub Staszak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172645 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 19:52:12 +00:00
Michael J. Spencer
235c022296 [Support] Update MSVC compiler support in Compiler.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 19:51:59 +00:00
Eli Bendersky
665c34bd01 Clean up some unnecessary headers and forward declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 19:00:21 +00:00
Eli Bendersky
f9f40bd158 Now that GenericAsmParser was folded into AsmParser, some methods and types can
return into the safe harbor of AsmParser's private areas.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172637 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 18:56:50 +00:00
Kevin Enderby
75c9b9384f We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is the first of two steps to allow us to do that.  This is the llvm-mc
change to provide a method to set the AT_producer string.  The second step,
coming soon to a clang near you, will have the clang driver pass the value
of getClangFullVersion() via an flag when invoking the integrated assembler
on assembly source files.

rdar://12955296


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172630 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 17:46:23 +00:00
Peter Collingbourne
fbb662f840 Introduce llvm::sys::getProcessTriple() function.
In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
as part of work to allow the user to supply a different default
target triple at configure time.  This change also affected the JIT.
However, it is inappropriate to use the default target triple in the
JIT in most circumstances because this will not necessarily match
the current architecture used by the process, leading to illegal
instruction and other such errors at run time.

Introduce the getProcessTriple() function for use in the JIT and
its clients, and cause the JIT to use it.  On architectures with a
single bitness, the host and process triples are identical.  On other
architectures, the host triple represents the architecture of the
host CPU, while the process triple represents the architecture used
by the host CPU to interpret machine code within the current process.
For example, when executing 32-bit code on a 64-bit Linux machine,
the host triple may be 'x86_64-unknown-linux-gnu', while the process
triple may be 'i386-unknown-linux-gnu'.

This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple
platforms.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 17:27:22 +00:00
Eli Bendersky
6a3cbc35a7 Replace virtual hasFixups with explicit fragment type checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 16:52:08 +00:00
Benjamin Kramer
9c79d01173 Remove unused leftover header (it moved to llvm/IR).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 13:43:56 +00:00
Eric Christopher
6b6061f011 Define metadata interfaces for describing a static data member
of a class. Emit static data member declarations and definitions
through correctly.

Part of PR14471.

Patch by Paul Robinson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 01:22:23 +00:00
Eli Bendersky
171192f149 Use the ExtensionDirectiveHandler type in other places where it makes sense.
Since we already have this type it's a shame to keep dragging a pair of object
and method around explicitly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 00:50:52 +00:00
Dmitri Gribenko
6623730296 Improve r172577 by using the correct type when declaring constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172580 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16 00:14:15 +00:00
Eric Christopher
72f7bfbf0e Split address information for DWARF5 split dwarf proposal. This involves
using the DW_FORM_GNU_addr_index and a separate .debug_addr section which
stays in the executable and is fully linked.

Sneak in two other small changes:

a) Print out the debug_str_offsets.dwo section.
b) Change form we're expecting the entries in the debug_str_offsets.dwo
   section to take from ULEB128 to U32.

Add tests for all of this in the fission-cu.ll test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172578 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 23:56:56 +00:00
David Greene
af50dda410 Avoid Enum Compare Warnings
Avoid a compiler warning about comparing disjoint enums but casting
them to int first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 23:46:58 +00:00
Eli Bendersky
9ccb76998f Optimize the memory usage of MC bundling, by creating a new type of fragment
into which we can emit single instructions without fixups (which is most
instructions). This is an optimization required because MCDataFragment
is prety large (240 bytes on x64), with no change in functionality.

For large programs, this reduces memory usage overhead required for bundling
by 40%.

To make the code as palatable as possible, the MCEncodedFragment interface was
further fragmented (no pun intended) and MCEncodedFragmentWithFixups is used
as the interface to work against when the user expects fixups. MCDataFragment
and MCRelaxableFragment implement this interface, while the new
MCCompactEncodedInstFragment implements MCEncodeFragment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172572 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 23:22:09 +00:00
Michael J. Spencer
34461e554a [Object][ELF] Fix -Wenum-compare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 22:00:16 +00:00
Evgeniy Stepanov
e1c49906dc Fix operand type conditions in one of ICmpInst constructors.
It was out of sync with the conditions in the other two constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 15:30:33 +00:00
Michael J. Spencer
ac97f5ce48 [Object][ELF] Simplify ELFObjectFile by using ELFType.
This simplifies the usage and implementation of ELFObjectFile by using ELFType
to replace:

<endianness target_endianness, std::size_t max_alignment, bool is64Bits>

This does complicate the base ELF types as they must now use template template
parameters to partially specialize for the 32 and 64bit cases. However these
are only defined once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 07:44:25 +00:00
Michael J. Spencer
b5f8cd5bb0 [Support] Add LLVM_CONSTEXPR.
Marks a decl as constexpr if the compiler supports it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 05:01:39 +00:00
Argyrios Kyrtzidis
47f3934021 [ADT/StringMap] Follow-up to r172455, use the correct constructor for setting the InitialSize,
previously it was calling the "StringMapImpl(unsigned itemSize)" constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172500 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 01:58:45 +00:00
Eli Bendersky
c0c67b03b0 Properly encapsulate additional methods and data from AsmParser.
This finally allows AsmParser to no longer list GenericAsmParser as a friend.
All member vars directly accessed by GenericAsmParser have been properly
encapsulated and exposed through the MCAsmParser interface. This reduces the
coupling between AsmParser and GenericAsmParser.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 23:22:36 +00:00
Quentin Colombet
398db9368d Complete the existing support of ARM v6m, v7m, and v7em, i.e., respectively cortex-m0, cortex-m3, and cortex-m4 on the backend side.
Adds new subtype values for the MachO format and use them when the related triple are set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 21:07:43 +00:00
Andrew Trick
1ba5769676 SCEVExpander fix. RAUW needs to update the InsertedExpressions cache.
Note that this bug is only exposed because LTO fails to use TTI.

Fixes self-LTO of clang. rdar://13007381.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172462 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 21:00:37 +00:00
Argyrios Kyrtzidis
3735573343 [ADT/StringMap] Add a constructor in StringMap that accepts both an
initial size and an allocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172455 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:41:09 +00:00
Joe Groff
289148afcb Fix DenseMap when LLVM_HAS_RVALUE_REFERENCES is defined but equals 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172454 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:37:42 +00:00
Joe Groff
a662a98625 Add DenseMap::insert(value_type&&) method.
Use the existing move implementation of the internal DenseMap::InsertIntoBucket
method to provide a user-facing move insert method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:24:15 +00:00
Eli Bendersky
318cad3323 Move CheckForValidSection to the MCAsmParser interface.
Now that it behaves itself in terms of streamer independence (r172450), this
method can be moved to MCAsmParser to be available to all extensions,
overriding, etc.

-- -This line, and those below, will be ignored--

M    lib/MC/MCParser/AsmParser.cpp
M    include/llvm/MC/MCParser/MCAsmParser.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172451 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:15:01 +00:00
Eli Bendersky
030f63a397 Expose an InitToTextSection through MCStreamer.
The aim of this patch is to fix the following piece of code in the
platform-independent AsmParser:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.SwitchSection(Ctx.getMachOSection(
                        "__TEXT", "__text",
                        MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
                        0, SectionKind::getText()));
  }
}

This was added for the "-n" option of llvm-mc.

The proposed fix adds another virtual method to MCStreamer, called
InitToTextSection. Conceptually, it's similar to the existing
InitSections which initializes all common sections and switches to
text. The new method is implemented by each platform streamer in a way
that it sees fit. So AsmParser can now do this:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.InitToTextSection();
  }
}

Which is much more reasonable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172450 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:04:57 +00:00
Eli Bendersky
9bac6b29b8 Move ParseMacroArgument to the MCAsmParser interfance.
Since it's used by extensions. One further step to fully decoupling
GenericAsmParser from an intimate knowledge of the internals of AsmParser,
pointing it to the MCASmParser interface instead (like all other parser
extensions do).

Since this change moves the MacroArgument type to the interface header, it's
renamed to be a bit more descriptive in a general context.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 19:00:26 +00:00
Eli Bendersky
733c336327 Encapsulate the MacroEnabled flag in AsmParser behind accessor methods.
The methods are also exposed via the MCAsmParser interface, which allows more
than one client to control them. Previously, GenericAsmParser was playing with
a member var in AsmParser directly (by virtue of being its friend).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172440 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 18:08:41 +00:00
Nuno Lopes
29eb2cc00c fix compile-time regression report by Joerg Sonnenberger:
cache result of Size/OffsetVisitor to speedup analysis of PHI nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172363 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13 18:02:57 +00:00
Dmitri Gribenko
96f498bd9f Remove redundant 'llvm::' qualifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13 16:01:15 +00:00
Jakob Stoklund Olesen
c7a275245f Precompute some information about register costs.
Remember the minimum cost of the registers in an allocation order and
the number of registers at the end of the allocation order that have the
same cost per use.

This information can be used to limit the search space for
RAGreedy::tryEvict() when looking for a cheaper register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172280 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12 00:54:59 +00:00
Benjamin Kramer
69e42dbd00 Split TargetLowering into a CodeGen and a SelectionDAG part.
This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 20:05:37 +00:00
Andrew Trick
a125cacf7d Added -view-callgraph module pass.
-dot-callgraph similarly follows a standard module pass pattern.

Patch by Speziale Ettore!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 17:28:14 +00:00
Michael Ilseman
4d0b4a45dc Support for half intrinsics. Pushes MMX into slower encoding path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172159 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 01:45:05 +00:00
Dmitri Gribenko
caa91f8b85 Add a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 01:13:51 +00:00
Jakub Staszak
cbdb7e4b56 LoopPass.h doesn't require Function.h. Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 01:03:32 +00:00
Jakub Staszak
893a234878 Remove trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172125 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:14:33 +00:00
Jakub Staszak
81bfd711de Remove unneeded includes from FunctionLoweringInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:13:13 +00:00
Chad Rosier
c1ec207b61 [ms-inline asm] Add support for calling functions from inline assembly.
Part of rdar://12991541

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172121 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:10:27 +00:00
Jakub Staszak
48fdf9b379 Remove unneeded #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172118 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:07:29 +00:00
Jakub Staszak
244b7a4ba6 Fix indent and remove unneeded #includes in MDBuilder.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172115 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 22:00:36 +00:00
Jakub Staszak
7ccad365a7 Rename LinkAllVMCore.h to LinkAllIR.h since VMCore directory was renamed to IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172112 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 21:55:02 +00:00
Jordan Rose
9b1f44b147 Add basic fix-its to SMDiagnostic.
Like Clang's FixItHint, SMFixIt represents an insertion, replacement, or
removal of source text. One or more fix-its can be emitted as part of
a diagnostic, and will be printed below the source range line to show the
user how they can fix their code.

Currently, the only client of SMFixIt is clang-tblgen; thus, the tests for
this behavior live in clang/test/TableGen/tg-fixits.td. If/when SMFixIt is
adopted within LLVM itself, those tests should be moved to the LLVM suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:50:15 +00:00
Jordan Rose
b50df4a3df TableGen: Keep track of superclass reference ranges.
def foo : bar;
          ~~~

This allows us to produce more precise diagnostics about a certain
superclass, and even provide fixits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:50:11 +00:00
Jordan Rose
d122009e57 TableGen: record anonymous instantiations of classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:50:05 +00:00
Jakob Stoklund Olesen
4aebce8321 Allow hasProperty() to be called on bundle-internal instructions.
When calling hasProperty() on an instruction inside a bundle, it should
always behave as if IgnoreBundle was passed, and just return properties
for the current instruction.

Only attempt to aggregate bundle properties whan asked about the bundle
header.

The assertion fires on existing ARM test cases without this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:42:44 +00:00
NAKAMURA Takumi
1930fbf3eb Signal.h: Add <cstdio> for FILE*, since r171989.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172044 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 05:23:59 +00:00
Douglas Gregor
69a2d6f55a Fix a race condition in the lock-file manager: once the lock file is
gone, check for the actual file we care about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172033 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 02:01:35 +00:00
Jakob Stoklund Olesen
b11f050434 Support headerless bundles in MachineInstr::hasProperty().
This function can still work without a BUNDLE header instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172029 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 01:29:42 +00:00
Manman Ren
86441169da Stack Alignment: throw error if we can't satisfy the minimal alignment
requirement when creating stack objects in MachineFrameInfo.

Add CreateStackObjectWithMinAlign to throw error when the minimal alignment
can't be achieved and to clamp the alignment when the preferred alignment
can't be achieved. Same is true for CreateVariableSizedObject.
Will not emit error in CreateSpillStackObject or CreateStackObject.

As long as callers of CreateStackObject do not assume the object will be
aligned at the requested alignment, we should not have miscompile since
later optimizations which look at the object's alignment will have the correct
information.

rdar://12713765


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172027 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 01:10:10 +00:00
Jakub Staszak
674be02d52 Fix include guards so they exactly match file names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172025 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 00:45:19 +00:00
Bill Wendling
1db9b6957c Revert s/Raw/getBitMask/g name change. This is possibly causing LTO test hangings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172020 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 23:36:50 +00:00
Nadav Rotem
14925e6b88 ARM Cost model: Use the size of vector registers and widest vectorizable instruction to determine the max vectorization factor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172010 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 22:29:00 +00:00
Argyrios Kyrtzidis
f48acd5ecd Move the internal PrintStackTrace function that is used for llvm::sys::PrintStackTraceOnErrorSignal(),
into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171989 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 19:42:40 +00:00
Jakob Stoklund Olesen
25377c8c6d Don't require BUNDLE headers in MachineInstr::getBundleSize().
It is possible to build MI bundles that don't begin with a BUNDLE
header. Add support for such bundles, counting all instructions inside
the bundle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 18:28:16 +00:00
Adhemerval Zanella
a1db5de9e7 PowerPC: EH adjustments
This patch adjust the r171506 to make all DWARF enconding pc-relative
for PPC64. It also adds the R_PPC64_REL32 relocation handling in MCJIT
(since the eh_frame will not generate PIC-relative relocation) and also
adds the emission of stubs created by the TTypeEncoding.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 17:08:15 +00:00
Shankar Easwaran
cde8168964 add hexagon flags in ELF.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 16:34:46 +00:00
David Tweed
73b984530f For some LLVM-as-library uses it is convenient to create a
subclass of TargetMachine which "forwards" all operations to an
existing internal TargetMachine member variable. In the usage context the
specific-machine class derived from TargetMachine is not visible,
only a reference to the generic base class TargetMachine. Although
getSubtargetImpl() is public in specific-machine classes derived from
TargetMachine, the TargetMachine class unfortunately has
getSubtargetImpl() protected (and accessing non-const members makes
abusing getSubtarget() unsuitable). Making it public in the base class
allows this forwarding pattern.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 16:21:47 +00:00
Tim Northover
2c8cf4b404 Refactor to expose RTLIB calls to targets.
fp128 is almost but not quite completely illegal as a type on AArch64. As a
result it needs to have a register class (for argument passing mainly), but all
operations need to be lowered to runtime calls. Currently there's no way for
targets to do this (without duplicating code), as the relevant functions are
hidden in SelectionDAG. This patch changes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 13:18:15 +00:00
Manuel Klimek
b1349fa3c5 Incrase the number of parameters for AlignedCharArrayUnion.
We need this to correctly fix ASTMatchers/ASTTypeTraits.h in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171965 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 10:39:16 +00:00
Eric Christopher
1ced208be9 Last in the series of removing unnecessary '0' arguments for
address space. Reordered the EmitULEB128IntValue arguments to
make this easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171949 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 03:52:05 +00:00
Andrew Trick
47579cf390 MIsched: add an ILP window property to machine model.
This was an experimental option, but needs to be defined
per-target. e.g. PPC A2 needs to aggressively hide latency.

I converted some in-order scheduling tests to A2. Hal is working on
more test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 03:36:49 +00:00
NAKAMURA Takumi
2af949dddd [Object, DebugInfo] Make DWARFContext BE-aware.
test/DebugInfo/member-pointers.ll would not fail in targetting BE any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171943 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 02:45:05 +00:00
Eric Christopher
ca1dd05c3c These functions have default arguments of 0 for the last arg. Use
them and add one where it seemed obvious that we wanted one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:35:34 +00:00
Nadav Rotem
83be7b0dd3 Cost Model: Move the 'max unroll factor' variable to the TTI and add initial Cost Model support on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:15:42 +00:00
Jakob Stoklund Olesen
d700a2f9c5 Add a getBundleEnd() function to go with the existing getBundleStart().
This is easier implemented now that bundle flags are symmetric.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171927 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 01:02:19 +00:00
Bill Wendling
ff887165bc Add the integer value of the ConstantInt instead of the Constant* value.
This is causing some problems. The root cause is unknown at this time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 00:32:08 +00:00
Shuxin Yang
935e35d2b9 Consider expression "0.0 - X" as the negation of X if
- this expression is explicitly marked no-signed-zero, or
  - no-signed-zero of this expression can be derived from some context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171922 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09 00:13:41 +00:00
Eli Bendersky
0fdcef6030 Simplify the code a bit: MCRelaxableFragment doesn't need a separate getInstSize
method because getContents().size() already covers it. So computeFragmentSize
can use the generic MCEncodedFragment interface when querying both Data and
Relaxable fragments for contents sizes.

No change in functionality


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 22:05:10 +00:00
Nick Kledzik
02fa38344c Fix memory leak in YAML I/O.
Stop using BumpPtrAllocator for HNodes because
they have fields (vector, map) which require HNode 
destructors to be run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171896 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 21:04:44 +00:00
Tim Northover
24d315dc05 Add fp128 rtlib function names to LLVM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 17:09:59 +00:00
Tim Northover
0b740236b7 Allow ELF64 relocation type to be more than 8 bits.
Current targets don't have more than 256 relocations so they don't hit this
limit, but ELF64 actually allows more than 8 bits for a relocation type. These
were being truncated on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171845 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 10:12:09 +00:00
Chandler Carruth
40b2c32475 Sink a function that refers to the SelectionDAG into that library in the
one file where it is called as a static function. Nuke the declaration
and the definition in lib/CodeGen, along with the include of
SelectionDAG.h from this file.

There is no dependency edge from lib/CodeGen to
lib/CodeGen/SelectionDAG, so it isn't valid for a routine in lib/CodeGen
to reference the DAG. There is a dependency from
lib/CodeGen/SelectionDAG on lib/CodeGen. This breaks one violation of
this layering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 05:11:57 +00:00
Eric Christopher
9a1e0e252a Remove the llvm-local DW_TAG_vector_type tag and add a test to
make sure that vector types do work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171833 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 01:53:52 +00:00
Eli Bendersky
251040bc18 Renamed MCInstFragment to MCRelaxableFragment and added some comments.
No change in functionality.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 00:22:56 +00:00
Eric Christopher
72a81be374 Remove what appears to be a dead llvm-specific debug tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171821 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 00:16:33 +00:00
Jakob Stoklund Olesen
6821060509 Pack MachineOperand bitfields better.
Previously, 4 bits were unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171814 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 23:21:44 +00:00
Jakob Stoklund Olesen
b2c79f2f63 Pack MachineInstr fields better.
This shrinks MachineInstr to 64 bytes (from 72).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 23:21:41 +00:00
Eli Bendersky
6c1d4972cf Add the align_to_end option to .bundle_lock in the MC implementation of aligned
bundling. The document describing this feature and the implementation has also
been updated:

https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171797 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 21:51:08 +00:00
Jordan Rose
3ebe59c892 Change SMRange to be half-open (exclusive end) instead of closed (inclusive)
This is necessary not only for representing empty ranges, but for handling
multibyte characters in the input. (If the end pointer in a range refers to
a multibyte character, should it point to the beginning or the end of the
character in a char array?) Some of the code in the asm parsers was already
assuming this anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 19:00:49 +00:00
Shuxin Yang
7aa1c321f0 Implement APFloat::isDenormal()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 18:59:35 +00:00
Quentin Colombet
637582eaf7 When code size is the priority (Oz, MinSize attribute), help llvm
turning a code like this:

if (foo)
   free(foo)

into that:
free(foo)

Move a call to free from basic block FB into FB's predecessor, P,
when the path from P to FB is taken only if the argument of free is
not equal to NULL.

Some restrictions apply on P and FB to be sure that this code motion
is profitable. Namely:
1. FB must have only one predecessor P.
2. FB must contain only the call to free plus an unconditional
   branch to S.
3. P's successors are FB and S.

Because of 1., we will not increase the code size when moving the call
to free from FB to P.
Because of 2., FB will be empty after the move.
Because of 2. and 3., P's branch instruction becomes useless, so as FB
(simplifycfg will do the job).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 18:37:41 +00:00
Chandler Carruth
4068e1af9f Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171749 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 15:43:51 +00:00
Chandler Carruth
3251e81d79 Move CallGraphSCCPass.h into the Analysis tree; that's where the
implementation lives already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171746 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 15:26:48 +00:00
Chandler Carruth
1ada2ada3c Remove the long defunct 'DefaultPasses' header. We have a pass manager
builder these days, and this thing hasn't seen updates for a very long
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171741 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 15:16:50 +00:00
Chandler Carruth
56d433dffe Sink AddrMode back into TargetLowering, removing one of the most
peculiar headers under include/llvm.

This struct still doesn't make a lot of sense, but it makes more sense
down in TargetLowering than it did before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 15:14:13 +00:00
Chandler Carruth
e4ba75f43e Switch the SCEV expander and LoopStrengthReduce to use
TargetTransformInfo rather than TargetLowering, removing one of the
primary instances of the layering violation of Transforms depending
directly on Target.

This is a really big deal because LSR used to be a "special" pass that
could only be tested fully using llc and by looking at the full output
of it. It also couldn't run with any other loop passes because it had to
be created by the backend. No longer is this true. LSR is now just
a normal pass and we should probably lift the creation of LSR out of
lib/CodeGen/Passes.cpp and into the PassManagerBuilder. =] I've not done
this, or updated all of the tests to use opt and a triple, because
I suspect someone more familiar with LSR would do a better job. This
change should be essentially without functional impact for normal
compilations, and only change behvaior of targetless compilations.

The conversion required changing all of the LSR code to refer to the TTI
interfaces, which fortunately are very similar to TargetLowering's
interfaces. However, it also allowed us to *always* expect to have some
implementation around. I've pushed that simplification through the pass,
and leveraged it to simplify code somewhat. It required some test
updates for one of two things: either we used to skip some checks
altogether but now we get the default "no" answer for them, or we used
to have no information about the target and now we do have some.

I've also started the process of removing AddrMode, as the TTI interface
doesn't use it any longer. In some cases this simplifies code, and in
others it adds some complexity, but I think it's not a bad tradeoff even
there. Subsequent patches will try to clean this up even further and use
other (more appropriate) abstractions.

Yet again, almost all of the formatting changes brought to you by
clang-format. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171735 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 14:41:08 +00:00
NAKAMURA Takumi
32e0662db3 CallingConvLower.h: Use bitfields like unsigned:1 instead of bool:1 .
Some compilers might be confused if bool were potentially signed integer. In my case, g++-4.7.0 miscompiled CodeGen/ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171727 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 11:13:51 +00:00
Bill Wendling
a90a99a82b Rough out a new c'tor for the AttrBuilder class.
This c'tor takes the AttributeSet class as the parameter. It will eventually
grab the attributes from the specified index and create a new attribute builder
with those attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171712 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 08:24:35 +00:00
David Blaikie
62fdfb5fa7 PR14759: Debug info support for C++ member pointers.
This works fine with GDB for member variable pointers, but GDB's support for
member function pointers seems to be quite unrelated to
DW_TAG_ptr_to_member_type. (see GDB bug 14998 for details)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171698 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 05:51:15 +00:00
Chandler Carruth
5f46c3c2e8 Make SimplifyCFG simply depend upon TargetTransformInfo and pass it
through as a reference rather than a pointer. There is always *some*
implementation of this available, so this simplifies code by not having
to test for whether it is available or not.

Further, it turns out there were piles of places where SimplifyCFG was
recursing and not passing down either TD or TTI. These are fixed to be
more pedantically consistent even though I don't have any particular
cases where it would matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 03:53:25 +00:00
Chandler Carruth
bb00800ff4 Fix the enumerator names for ShuffleKind to match tho coding standards,
and make its comments doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 03:20:02 +00:00
Chandler Carruth
d1b8ef97c4 Make the popcnt support enums and methods have more clear names and
follow the conding conventions regarding enumerating a set of "kinds" of
things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 03:16:03 +00:00
Chandler Carruth
be04929f7f Move TargetTransformInfo to live under the Analysis library. This no
longer would violate any dependency layering and it is in fact an
analysis. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171686 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 03:08:10 +00:00
Sean Silva
37fda193d2 Simplify TableGen type-compatibility checks.
Patch by Elior Malul!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171684 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 02:30:19 +00:00
Chandler Carruth
aeef83c6af Switch TargetTransformInfo from an immutable analysis pass that requires
a TargetMachine to construct (and thus isn't always available), to an
analysis group that supports layered implementations much like
AliasAnalysis does. This is a pretty massive change, with a few parts
that I was unable to easily separate (sorry), so I'll walk through it.

The first step of this conversion was to make TargetTransformInfo an
analysis group, and to sink the nonce implementations in
ScalarTargetTransformInfo and VectorTargetTranformInfo into
a NoTargetTransformInfo pass. This allows other passes to add a hard
requirement on TTI, and assume they will always get at least on
implementation.

The TargetTransformInfo analysis group leverages the delegation chaining
trick that AliasAnalysis uses, where the base class for the analysis
group delegates to the previous analysis *pass*, allowing all but tho
NoFoo analysis passes to only implement the parts of the interfaces they
support. It also introduces a new trick where each pass in the group
retains a pointer to the top-most pass that has been initialized. This
allows passes to implement one API in terms of another API and benefit
when some other pass above them in the stack has more precise results
for the second API.

The second step of this conversion is to create a pass that implements
the TargetTransformInfo analysis using the target-independent
abstractions in the code generator. This replaces the
ScalarTargetTransformImpl and VectorTargetTransformImpl classes in
lib/Target with a single pass in lib/CodeGen called
BasicTargetTransformInfo. This class actually provides most of the TTI
functionality, basing it upon the TargetLowering abstraction and other
information in the target independent code generator.

The third step of the conversion adds support to all TargetMachines to
register custom analysis passes. This allows building those passes with
access to TargetLowering or other target-specific classes, and it also
allows each target to customize the set of analysis passes desired in
the pass manager. The baseline LLVMTargetMachine implements this
interface to add the BasicTTI pass to the pass manager, and all of the
tools that want to support target-aware TTI passes call this routine on
whatever target machine they end up with to add the appropriate passes.

The fourth step of the conversion created target-specific TTI analysis
passes for the X86 and ARM backends. These passes contain the custom
logic that was previously in their extensions of the
ScalarTargetTransformInfo and VectorTargetTransformInfo interfaces.
I separated them into their own file, as now all of the interface bits
are private and they just expose a function to create the pass itself.
Then I extended these target machines to set up a custom set of analysis
passes, first adding BasicTTI as a fallback, and then adding their
customized TTI implementations.

The fourth step required logic that was shared between the target
independent layer and the specific targets to move to a different
interface, as they no longer derive from each other. As a consequence,
a helper functions were added to TargetLowering representing the common
logic needed both in the target implementation and the codegen
implementation of the TTI pass. While technically this is the only
change that could have been committed separately, it would have been
a nightmare to extract.

The final step of the conversion was just to delete all the old
boilerplate. This got rid of the ScalarTargetTransformInfo and
VectorTargetTransformInfo classes, all of the support in all of the
targets for producing instances of them, and all of the support in the
tools for manually constructing a pass based around them.

Now that TTI is a relatively normal analysis group, two things become
straightforward. First, we can sink it into lib/Analysis which is a more
natural layer for it to live. Second, clients of this interface can
depend on it *always* being available which will simplify their code and
behavior. These (and other) simplifications will follow in subsequent
commits, this one is clearly big enough.

Finally, I'm very aware that much of the comments and documentation
needs to be updated. As soon as I had this working, and plausibly well
commented, I wanted to get it committed and in front of the build bots.
I'll be doing a few passes over documentation later if it sticks.

Commits to update DragonEgg and Clang will be made presently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171681 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 01:37:14 +00:00
Michael J. Spencer
95abfbe8e9 [Object][ELF] Fix incorrect size of members for the 64 version of Elf_Phdr_Impl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171650 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:57:11 +00:00
Michael J. Spencer
3e5d8ade39 [Object][ELF] Add program header iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171648 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:56:27 +00:00
Michael J. Spencer
fe23da7949 [Object][ELF] Refactor ELFRelocationIterator into ELFEntityIterator. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-06 03:56:14 +00:00
Chandler Carruth
e4b4edd72a Funnel the actual TargetTransformInfo pass from the SelectionDAGISel
pass into the SelectionDAG itself rather than snooping on the
implementation of that pass as exposed by the TargetMachine. This
removes the last direct client of the ScalarTargetTransformInfo class
outside of the TTI pass implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 12:32:17 +00:00
Chandler Carruth
7bdf6b00e0 Convert the TargetTransformInfo from an immutable pass with dynamic
interfaces which could be extracted from it, and must be provided on
construction, to a chained analysis group.

The end goal here is that TTI works much like AA -- there is a baseline
"no-op" and target independent pass which is in the group, and each
target can expose a target-specific pass in the group. These passes will
naturally chain allowing each target-specific pass to delegate to the
generic pass as needed.

In particular, this will allow a much simpler interface for passes that
would like to use TTI -- they can have a hard dependency on TTI and it
will just be satisfied by the stub implementation when that is all that
is available.

This patch is a WIP however. In particular, the "stub" pass is actually
the one and only pass, and everything there is implemented by delegating
to the target-provided interfaces. As a consequence the tools still have
to explicitly construct the pass. Switching targets to provide custom
passes and sinking the stub behavior into the NoTTI pass is the next
step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 11:43:11 +00:00
Chandler Carruth
9eac3912d3 Replicate the APIs of ScalarTargetTransformInfo and
VectorTargetTransformInfo into the TargetTransformInfo pass,
implementing them be delegating back out to the two subobjects.

This is the first step to folding the interfaces together and making
TargetTransformInfo a normal analysis pass (specifically an analysis
group which targets can provide target-specific analysis pass
implementations of).

No callers are migrated here, this just stubs out the interface. Next
step will be to migrate all the callers to directly operate on TTI
instead of STTI or VTTI respectively. That will allow replacing the
machinery for delivering TTI without changing every caller at once.

WIP, I promise all the duplicated interfaces will be removed in the end,
this just decouples the steps of the process.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 09:56:20 +00:00
Chandler Carruth
6f78fbbc63 Switch the empty and tombstone key enumerators to not have explicit
values -- that's not required to fix the bug that was cropping up, and
the values selected made the enumeration's underlying type signed and
introduced some warnings. This fixes the -Werror build.

The underlying issue here was that the DenseMapInfo was casting values
completely outside the range of the underlying storage of the
enumeration to the enumeration's type. GCC went and "optimized" that
into infloops and other misbehavior. By providing designated special
values for these keys in the dense map, we ensure they are indeed
representable and that they won't be used for anything else.

It might be better to reuse None for the empty key and have the
tombstone share the value of the sentinel enumerator, but honestly
having 2 extra enumerators seemed not to matter and this seems a bit
simpler. I'll let Bill shuffle this around (or ask me to shuffle it
around) if he prefers it to look a different way.

I also made the switch a bit more clear (and produce a better assert)
that the enumerators are *never* going to show up and are errors if they
do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:47:26 +00:00
Chandler Carruth
ba7a4e69e8 While the struct being defined in the AddressingMode.h header was
unused, there were transitive includes needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171613 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:19:20 +00:00
Chandler Carruth
acd2c2139d Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 08:12:59 +00:00
NAKAMURA Takumi
3a4779a921 IR/Attributes: Provide EmptyKey and TombstoneKey in part of enum, as workaround for gcc-4.4 take #2.
I will investigate, later, what was wrong. I am too tired for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171611 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 07:55:47 +00:00
NAKAMURA Takumi
255cd6f317 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171601 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:16:53 +00:00
NAKAMURA Takumi
5d295b41a3 DenseMap: Appease -fstrict-aliasing on g++-4.4.
With DenseMapInfo<Enum>, it is miscompiled on g++-4.4.

    static inline Enum getEmptyKey() { return Enum(<arbitrary int/unsigned value>); }

    isEauql(getEmptyKey(), ...)

The compiler mis-assumes the return value is not aliased to Enum.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:14:23 +00:00
Jakob Stoklund Olesen
84be3d5a73 Don't call destructors on MachineInstr and MachineOperand.
The series of patches leading up to this one makes llc -O0 run 8% faster.

When deallocating a MachineFunction, there is no need to visit all
MachineInstr and MachineOperand objects to deallocate them. All their
memory come from a BumpPtrAllocator that is about to be purged, and they
have empty destructors anyway.

This only applies when deallocating the MachineFunction.
DeleteMachineInstr() should still be used to recycle MI memory during
the codegen passes.

Remove the LeakDetector support for MachineInstr. I've never seen it
used before, and now it definitely doesn't work. With this patch, leaked
MachineInstrs would be much less of a problem since all of their memory
will be reclaimed by ~MachineFunction().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:05:51 +00:00
Jakob Stoklund Olesen
f1d015f342 Use ArrayRecycler for MachineInstr operand lists.
Instead of an std::vector<MachineOperand>, use MachineOperand arrays
from an ArrayRecycler living in MachineFunction.

This has several advantages:

- MachineInstr now has a trivial destructor, making it possible to
  delete them in batches when destroying MachineFunction. This will be
  enabled in a later patch.

- Bypassing malloc() and free() can be faster, depending on the system
  library.

- MachineInstr objects and their operands are allocated from the same
  BumpPtrAllocator, so they will usually be next to each other in
  memory, providing better locality of reference.

- Reduce MachineInstr footprint. A std::vector is 24 bytes, the new
  operand array representation only uses 8+4+1 bytes in MachineInstr.

- Better control over operand array reallocations. In the old
  representation, the use-def chains would be reordered whenever a
  std::vector reached its capacity. The new implementation never changes
  the use-def chain order.

Note that some decisions in the code generator depend on the use-def
chain orders, so this patch may cause different assembly to be produced
in a few cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171598 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 05:00:09 +00:00
Jakob Stoklund Olesen
bced5cd924 Add MachineRegisterInfo::moveOperands().
This function works like memmove() for MachineOperands, except it also
updates any use-def chains containing the moved operands.

The use-def chains are updated without affecting the order of operands
in the list. That isn't possible when using the
removeRegOperandFromUseList() and addRegOperandToUseList() functions.

Callers to follow soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 04:38:12 +00:00
Chandler Carruth
64e407be0d Refactor the ScalarTargetTransformInfo API for querying about the
legality of an address mode to not use a struct of four values and
instead to accept them as parameters. I'd love to have named parameters
here as most callers only care about one or two of these, but the
defaults aren't terribly scary to write out.

That said, there is no real impact of this as the passes aren't yet
using STTI for this and are still relying upon TargetLowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171595 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 03:36:17 +00:00
Chandler Carruth
b1a429fd1c Sink the AddressingModeMatcher helper class into an anonymous namespace
next to its only user. This helper relies on TargetLowering information
that shouldn't be generally used throughout the Transfoms library, and
so it made little sense as a generic utility.

This also consolidates the file where we need to remove the remaining
uses of TargetLowering in favor of the IR-layer abstract interface in
TargetTransformInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 02:09:22 +00:00
Bill Wendling
1bbd644301 Add a method to create an AttributeSet from an AttrBuilder.
The Attribute class is eventually going to represent one attribute. So we need
this class to create the set of attributes. Add some iterator methods to the
builder to access its internal bits in a nice way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 01:36:54 +00:00
Jakob Stoklund Olesen
8a0631a35e Add an ArrayRecycler class.
This is similar to the existing Recycler allocator, but instead of
recycling individual objects from a BumpPtrAllocator, arrays of
different sizes can be allocated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 00:57:11 +00:00
Eric Christopher
22f3b40d0b Make this an integer so we have enumeral types in the conditional
expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 00:32:04 +00:00
Chandler Carruth
fa511bf6c2 Provide a default constructor for TimeValue. This was used, but only in
if-ed out code paths and on Windows. Hopefully restores the Windows
build. Thanks to Reid Kleckner for helping triage this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171568 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 00:23:09 +00:00
Alex Rosenberg
319120f622 Fix warnings from llvm-gcc as seen on darwin10 (10.6).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171567 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05 00:21:12 +00:00
Bill Wendling
0319888773 Get rid of the 'Bits' mask in the attribute builder.
The bit mask thing will be a thing of the past. It's not extensible enough. Get
rid of its use here. Opt instead for using a vector to hold the attributes.

Note: Some of this code will become obsolete once the rewrite is further along.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171553 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 23:27:34 +00:00
Chandler Carruth
73c35d86b9 Add time getters to the process interface for requesting the elapsed
wall time, user time, and system time since a process started.

For walltime, we currently use TimeValue's interface and a global
initializer to compute a close approximation of total process runtime.

For user time, this adds support for an somewhat more precise timing
mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock
selected.

For system time, we have to do a full getrusage call to extract the
system time from the OS. This is expensive but unavoidable.

In passing, clean up the implementation of the old APIs and fix some
latent bugs in the Windows code. This might have manifested on Windows
ARM systems or other systems with strange 64-bit integer behavior.

The old API for this both user time and system time simultaneously from
a single getrusage call. While this results in fewer system calls, it
also results in a lower precision user time and if only user time is
desired, it introduces a higher overhead. It may be worthwhile to switch
some of the pass timers to not track system time and directly track user
and wall time. The old API also tracked walltime in a confusing way --
it just set it to the current walltime rather than providing any measure
of wall time since the process started the way buth user and system time
are tracked. The new API is more consistent here.

The plan is to eventually implement these methods for a *child* process
by using the wait3(2) system call to populate an rusage struct
representing the whole subprocess execution. That way, after waiting on
a child process its stats will become accurate and cheap to query.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171551 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 23:19:55 +00:00
Jakob Stoklund Olesen
b2e01b3707 Special case Recycler::clear(BumpPtrAllocator).
A BumpPtrAllocator has an empty Deallocate() method, but
Recycler::clear() would still call it for every single object ever
allocated, bringing all those objects into cache. As a bonus,
iplist::remove() will also write to the Prev/Next pointers on all the
objects, so all those cache lines have to be written back to RAM before
the pages are given back to the OS.

Stop wasting time and memory bandwith by using the new
clearAndLeakUnsafely() function to jettison all the recycled objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171541 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 22:35:45 +00:00
Jakob Stoklund Olesen
7c5c12bd4d Add an iplist::clearAndLeakNodesUnsafely() function.
The iplist::clear() function can be quite expensive because it traverses
the entire list, calling deleteNode() and removeNodeFromList() on each
element. If node destruction and deallocation can be handled some other
way, clearAndLeakNodesUnsafely() can be used to jettison all nodes
without bringing them into cache.

The function name is meant to be ominous.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171540 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 22:35:42 +00:00
Bill Wendling
60507d53e7 General cleanups.
* Remove dead methods.
* Use the 'operator==' method instead of 'contains', which isn't needed.
* Fix some comments.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 20:54:35 +00:00
Michael J. Spencer
4d9c5397b4 [Object][ELF] Add a maximum alignment. This is used by createELFObjectFile to create a properly aligned reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171520 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 20:36:28 +00:00
Nick Kledzik
50c3042740 Fix how YAML I/O detects flow sequences.
Update test case to verify flow sequence is
written as a flow sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 19:32:00 +00:00
Adhemerval Zanella
7b449889e7 PowerPC: Fix eh_frame relocation for PIC
This patch fixes the PPC eh_frame definitions for the personality and 
frame unwinding for PIC objects. It makes PIC build correctly creates
relative relocations in the '.rela.eh_frame' segments and thus avoiding
a text relocation that generates a DT_TEXTREL segments in link phase.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171506 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 19:08:13 +00:00
Eric Christopher
60230ef987 Add section information for the DWARF5 split debug proposal
string offset section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171474 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 17:59:22 +00:00
Eric Christopher
138f084ca5 Make comment a bit more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171473 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 17:59:17 +00:00
Nadav Rotem
e503319874 LoopVectorizer:
1. Add code to estimate register pressure.
2. Add code to select the unroll factor based on register pressure.
3. Add bits to TargetTransformInfo to provide the number of registers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171469 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 17:48:25 +00:00
Hal Finkel
be76df6ce6 Better comment on VTTI::getShuffleCost
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171459 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 05:02:41 +00:00
NAKAMURA Takumi
1eae141f19 Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in host compiler.
Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined.

Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171455 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 03:30:22 +00:00
Hal Finkel
82860f63e1 Add a subtype parameter to VTTI::getShuffleCost
In order to cost subvector insertion and extraction, we need to know
the type of the subvector being extracted.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 02:34:09 +00:00
Bill Wendling
22bd641739 Try again to revert the bad patch. The tree was reverted for some unknown reason
before the last time.

--- Reverse-merging r171442 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp
U    lib/IR/AttributeImpl.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:54:39 +00:00
Hal Finkel
467fa3ea7f Add a default Index for VTTI::getShuffleCost
When Kind == (Broadcast or Reverse) then Index is not used; make it an optional parameter.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:50:51 +00:00
Bill Wendling
ded28aca61 Revert patch. Something snuck in there that shouldn't be.
--- Reverse-merging r171441 into '.':
U    include/llvm/IR/Attributes.h
U    lib/IR/Attributes.cpp




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:46:27 +00:00
Bill Wendling
8351a60d6d Remove the 'contains' methods in favor of the 'operator==' method.
The 'operator==' method is a bit clearer and much less verbose for somethings
that should have only one value. Remove from the AttrBuilder for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171442 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:43:05 +00:00
NAKAMURA Takumi
3ac03815e1 Revert r171427, "An intermediate step in the Attributes rewrite."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03 01:42:06 +00:00
Bill Wendling
278bac3fba An intermediate step in the Attributes rewrite.
Modify the AttrBuilder class to store the attributes as a set instead of as a
bit mask. The Attribute class will represent only one attribute instead of a
collection of attributes.

This is the wave of the future!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 23:45:09 +00:00
Argyrios Kyrtzidis
23203faf0b Use a bool instead of a bitfield in llvm/ADT/Optional.
Fixes Valgrind failures and removes bitwise operations that don't provide any benefit.
Valgrind failures reported by NAKAMURA Takumi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171413 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 21:19:08 +00:00
Michael J. Spencer
3922757824 Restrict __builtin_assume_aligned to gcc 4.7+
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 20:23:49 +00:00
Michael J. Spencer
c8b18df9a7 [Support][Endian] Add support for specifying the alignment and native unaligned types.
* Add support for specifying the alignment to use.
* Add the concept of native endianness. Used for unaligned native types.

The native alignment and read/write simplification is based on a patch by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171406 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 20:14:11 +00:00
Argyrios Kyrtzidis
8da72f82be Don't #include stuff outside the include guards.
This defeats the include-guard optimization when parsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171405 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 19:42:53 +00:00
Shuxin Yang
cbf5373603 - Add comment to two functions which might be considered as dead code.
- Fix a typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 18:26:31 +00:00
Chandler Carruth
351ba145a7 Actually update the CMake and Makefile builds correctly, and update the
code that includes Intrinsics.gen directly.

This never showed up in my testing because the old Intrinsics.gen was
still kicking around in the make build system and was correct there. =[
Thankfully, some of the bots to clean rebuilds and that caught this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 12:09:16 +00:00
Chandler Carruth
0b8c9a80f2 Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 11:36:10 +00:00
Chandler Carruth
58a2cbef4a Resort the #include lines in include/... and lib/... with the
utils/sort_includes.py script.

Most of these are updating the new R600 target and fixing up a few
regressions that have creeped in since the last time I sorted the
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02 10:22:59 +00:00
Benjamin Kramer
6c30749583 Add IRBuilder::CreateVectorSplat and use it to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-01 19:55:16 +00:00
Chandler Carruth
eda54e193e Make it explicit that the only entry points to the Program object are
through the static helper functions. This is already true throughout the
codebase.

Slowly, I'm going to re-implement these static helpers in terms of a new
process based interface which can expose more information, and remove
the program object entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171335 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:44:49 +00:00
Chandler Carruth
a0d8f28a9c Remove an unused method on Program.
I'm simplifying this interface as much as I can before merging it with
the new process interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171334 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:44:47 +00:00
Chandler Carruth
2bbe466475 Remove an unused method on the Program class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171332 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:38:28 +00:00
Chandler Carruth
f5867ab717 Go ahead and get rid of the old page size interface and convert all the
users over to the new one. No sense maintaining this "compatibility"
layer it seems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:31:56 +00:00
Chandler Carruth
814afe91cc Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the
implementation on Windows which can now re-use the self_process's once
initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 23:23:35 +00:00
Chandler Carruth
02d75477cd Remove the declspecs from small alignments that we can force with
a union. These don't actually work for by-value function arguments, and
MSVC warns if they exist even while (we hope) it aligns the argument
correctly due to the other union member.

This means MSVC will miss out on optimizations based on the alignment of
the buffer, but really, there aren't that many for x86 and MSVC is
likely not doing a great job of optimizing LLVM and Clang anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171328 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 22:18:01 +00:00
Chandler Carruth
e0e1985b3b Remove an unused function in the old Process interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171327 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 22:17:59 +00:00
Nuno Lopes
0a9ff4cab3 recommit r171298 (add support for PHI nodes to ObjectSizeOffsetVisitor). Hopefully with bugs corrected now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171325 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:45:10 +00:00
Michael J. Spencer
3c6f89aa2e [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.
This adds AlignedCharArray<Alignment, Size>. A templated struct that contains
a member named buffer of type char[Size] that is aligned to Alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 19:54:45 +00:00
Rafael Espindola
5b712efd9a Fix bits check in ELFObjectFile::isSectionZeroInit().
Fixes PR14723.

Patch by Sami Liedes!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171309 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 18:20:51 +00:00
Nuno Lopes
41be2fb1f9 add support for GlobalAlias to ObjectSizeOffsetVisitor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 16:23:48 +00:00
Bill Wendling
6931055232 Remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171295 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:52:55 +00:00
Bill Wendling
92e287f5bd Add some comparison operators to compare the Attribute object with the AttrKind value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171294 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:51:54 +00:00
Chandler Carruth
0184a841d3 Begin sketching out the process interface.
The coding style used here is not LLVM's style because this is modeled
after a Boost interface and thus done in the style of a candidate C++
standard library interface. I'll probably end up proposing it as
a standard C++ library if it proves to be reasonably portable and
useful.

This is just the most basic parts of the interface -- getting the
process ID out of it. However, it helps sketch out some of the boiler
plate such as the base class, derived class, shared code, and static
factory function. It also introduces a unittest so that I can
incrementally ensure this stuff works.

However, I've not even compiled this code for Windows yet. I'll try to
fix any Windows fallout from the bots, and if I can't fix it I'll revert
and get someone on Windows to help out. There isn't a lot more that is
mandatory, so soon I'll switch to just stubbing out the Windows side and
get Michael Spencer to help with implementation as he can test it
directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 11:17:50 +00:00
Chandler Carruth
dac1eeb4b7 Start sketching out a roadmap for better subprocess management in the
LLVM libraries. Also, clean up the doxygen and formatting of the
existing interfaces.

With this change I'm calling the existing interface "legacy" because I'd
like to replace it with something much better. My end goal is to expose
a common set of interfaces for inspecting various properties of
a process, and implementations to expose those both for the current
process and for child processes. This will also expose more rich
interfaces for spawning and controling a subprocess, notably to use
system calls like wait3 and wait4 where available and gather detailed
resource usage stats about the subprocess.

My plan (discussed with Michael Spencer on IRC) is to base this loosely
around the proposed Boost.Process interface, but to implement
a relatively small subset of that functionality based around the needs
of LLVM, Clang, the Clang driver, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171285 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 09:29:16 +00:00
Bill Wendling
9d30e7208e Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 00:49:59 +00:00
Bill Wendling
94e94b3506 Use the predicate methods off of AttributeSet instead of Attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171257 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:50:49 +00:00
Bill Wendling
8b62abdd7b Remove the Function::getRetAttributes method in favor of using the AttributeSet accessor method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171256 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 13:01:51 +00:00
Bill Wendling
39cd0c8e47 Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 12:45:13 +00:00
Bill Wendling
831737d329 Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 10:32:01 +00:00
Bill Wendling
377660355c s/hasAttribute/contains/g to be more consistent with other method names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 09:17:46 +00:00
Bill Wendling
c966e08a98 s/Raw/getBitMask/g to be more in line with current naming conventions. This method won't be sticking around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-30 01:05:42 +00:00
Chandler Carruth
e949aa1c91 Teach instsimplify to use the constant folder where appropriate for
constant folding calls. Add the initial tests for this which show that
now instsimplify can simplify blindingly obvious code patterns expressed
with both intrinsics and library calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171194 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 14:23:29 +00:00
Chandler Carruth
c98bd9f1a7 Add entry points to instsimplify for simplifying calls. The entry points
are nice and decomposed so that we can simplify synthesized calls as
easily as actually call instructions. The internal utility still has the
same behavior, it just now operates on a more generic interface so that
I can extend the set of call simplifications that instsimplify knows
about.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171189 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 11:30:55 +00:00
Alexey Samsonov
f045df1b8b Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171183 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-28 09:30:44 +00:00
Chandler Carruth
a455fdd7e1 Add support to BasicBlocks for iterating backwards over the
instructions. This just exposes the already present reverse iterators of
the instruction ilist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 12:00:56 +00:00
Chandler Carruth
edf315cd71 Provide a common half-open interval map info implementation, and just
re-use that for SlotIndexes. This way other users who want half-open
semantics can share the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171158 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 11:29:17 +00:00
Nadav Rotem
3190be9c9a DAGCombinerInformation: add a getter that exposes the dagcombine level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 08:44:35 +00:00
Alexey Samsonov
44185d4908 Fix new[]/delete mismatch in FullDependence spotted by AddressSanitizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 08:40:37 +00:00
Nadav Rotem
444b4bf5c8 Refactor DAGCombinerInfo. Change the different booleans that indicate if we are before or after different runs of DAGCo, with the CombineLevel enum.
Also, added a new API for checking if we are running before or after the LegalizeVectorOps phase. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171142 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 06:47:41 +00:00
Nadav Rotem
d92ee757c3 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171129 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 02:04:12 +00:00
Eric Christopher
32b3768ec1 Right now all of the relocations are 32-bit dwarf, and the relocation
information doesn't return an addend for Rel relocations. Go ahead
and use this information to fix relocation handling inside dwarfdump
for 32-bit ELF REL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171126 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27 01:07:07 +00:00
Nadav Rotem
4595528781 white space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-26 04:58:12 +00:00
Hal Finkel
abdf75511b Loosen scheduling restrictions on the PPC dcbt intrinsic
As with the prefetch intrinsic to which it maps, simply have dcbt
marked as reading from and writing to its arguments instead of having
unmodeled side effects. While this might cause unwanted code motion
(because aliasing checks don't really capture cache-line sharing),
it is more important that prefetches in unrolled loops don't block
the scheduler from rearranging the unrolled loop body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171073 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-25 18:51:18 +00:00
Bob Wilson
04de315694 Rename LLVMContext diagnostic handler types and functions.
These are now generally used for all diagnostics from the backend, not just
for inline assembly, so this drops the "InlineAsm" from the names.  No
functional change.  (I've left aliases for the old names but only for long
enough to let me switch over clang to use the new ones.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-25 00:07:12 +00:00
Bob Wilson
a0be09f511 Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>
When the backend is used from clang, it should produce proper diagnostics
instead of just printing messages to errs(). Other clients may also want to
register their own error handlers with the LLVMContext, and the same handler
should work for warnings in the same way as the existing emitError methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171041 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 18:15:21 +00:00
Nadav Rotem
1e1c5f37c3 CostModel: We have API for checking the costs of known shuffles. This patch adds
support for the insert-subvector and extract-subvector kinds.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 10:04:03 +00:00
Elena Demikhovsky
94d7ab7da4 Added 6 more value types: v32i1, v64i1, v32i16, v32i8, v64i8, v8f64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 10:03:57 +00:00
Nadav Rotem
daf7b5c8f2 Change the codegen Cost Model API for shuffeles. This patch removes the API for broadcast and adds a more general API that accepts an enum of known shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171022 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 08:57:47 +00:00
NAKAMURA Takumi
85e910fe5c llvm/MC/MCMachObjectWriter.h: ComputeSymbolTable(): Prune one description in the comment. [-Wdocumentation]
/// \param StringIndexMap [out] - Map from symbol names to offsets in the string table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-24 01:24:04 +00:00
Nadav Rotem
6f3d81a929 CostModel: Change the default target-independent implementation for finding
the cost of arithmetic functions. We now assume that the cost of arithmetic
operations that are marked as Legal or Promote is low, but ops that are
marked as custom are higher.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-23 17:31:23 +00:00
Nadav Rotem
d54fed2786 Loop Vectorizer: Update the cost model of scatter/gather operations and make
them more expensive.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-23 07:23:55 +00:00
Craig Topper
b44c1f90e4 Add a comma to fix the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170982 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-22 08:22:01 +00:00
Craig Topper
3f92b1bda0 Use a negative value to represent INVALID_SIMPLE_VALUE_TYPE instead of 256. Its much cheaper for the isSimple() checks to look for values less than 0 rather than a value greater than 255. This shaves ~8k off the size of the llc binary on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170981 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-22 08:16:17 +00:00
Craig Topper
bf50d07625 Add vAny and Metadata to the switch in getSizeInBits for consistency since every other enum was listed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-22 03:08:37 +00:00
Bill Wendling
629fb82419 Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instead of the value of the attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-22 00:37:52 +00:00