Commit Graph

17388 Commits

Author SHA1 Message Date
Bill Wendling
defaca00b8 More encapsulation work.
Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173196 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 21:15:51 +00:00
Eli Bendersky
9dd2a3b1f2 Initial patch for x32 ABI support.
Add the x32 environment kind to the triple, and separate the concept of
pointer size and callee save stack slot size, since they're not equal
on x32.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173175 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 18:02:49 +00:00
Tim Northover
318b2cc86f Fix truncation of relocation types in Support/ELF.h
This is a follow-up to r171845, which fixes the same issue in the Support code.
Only targets with >256 relocations (principally AArch64) should be affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 12:01:43 +00:00
Chandler Carruth
13086a658a Begin fleshing out an interface in TTI for modelling the costs of
generic function calls and intrinsics. This is somewhat overlapping with
an existing intrinsic cost method, but that one seems targetted at
vector intrinsics. I'll merge them or separate their names and use cases
in a separate commit.

This sinks the test of 'callIsSmall' down into TTI where targets can
control it. The whole thing feels very hack-ish to me though. I've left
a FIXME comment about the fundamental design problem this presents. It
isn't yet clear to me what the users of this function *really* care
about. I'll have to do more analysis to figure that out. Putting this
here at least provides it access to proper analysis pass tools and other
such. It also allows us to more cleanly implement the baseline cost
interfaces in TTI.

With this commit, it is now theoretically possible to simplify much of
the inline cost analysis's handling of calls by calling through to this
interface. That conversion will have to happen in subsequent commits as
it requires more extensive restructuring of the inline cost analysis.

The CodeMetrics class is now really only in the business of running over
a block of code and aggregating the metrics on that block of code, with
the actual cost evaluation done entirely in terms of TTI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 11:26:02 +00:00
Tim Northover
0a29cb0454 Make APFloat constructor require explicit semantics.
Previously we tried to infer it from the bit width size, with an added
IsIEEE argument for the PPC/IEEE 128-bit case, which had a default
value. This default value allowed bugs to creep in, where it was
inappropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 09:46:31 +00:00
NAKAMURA Takumi
dc89ed7da3 SparseMultiSet.h: Add suggested parentheses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 05:41:57 +00:00
Bill Wendling
e4e85f1756 Add a new method that adds the AttributeSet at the given index. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 00:53:12 +00:00
Bill Wendling
0d8c5fb91d Remove unused method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173106 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 23:41:50 +00:00
Bill Wendling
3fc4b96b50 Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
This further restricts the use of the Attribute class to the Attribute family of
classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 22:44:49 +00:00
Bill Wendling
c5f1bc88a2 Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173094 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 21:57:28 +00:00
Chris Lattner
dc60fc1aa7 r173072 is causing some regressions on big endian hosts, I don't have time to debug it
so revert it for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 19:08:15 +00:00
Chris Lattner
02b206f6d8 rework the Bitstream reader to actually work a machine word at a time, instead of 32-bits at a time.
This cuts in half the number of virtual methods called to refill that word when compiling on a 64-bit
host, and will make 64-bit read operations faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:48:26 +00:00
Chris Lattner
69582cf6c4 Fix a heinous inefficiency introduced in r149918, wherein reading each byte of a
BLOB (i.e., large, performance intensive data) in a bitcode file was switched to
invoking one virtual method call per byte read.  Now we do one virtual call per
BLOB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173065 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 18:24:49 +00:00
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