Commit Graph

1678 Commits

Author SHA1 Message Date
Eli Bendersky
8bb3b098b9 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179793 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18 20:49:17 +00:00
Rafael Espindola
21a01d1ea8 Make the host endianness check an integer constant expression.
I will remove the isBigEndianHost function once I update clang.

The ifdef logic is designed to
* not use configure/cmake to avoid breaking -arch i686 -arch ppc.
* default to little endian
* be as small as possible

It looks like sys/endian.h is the preferred header on most modern BSD systems,
but it is better to change this in a followup patch as machine/endian.h is
available on FreeBSD, OpenBSD, NetBSD and OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179527 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 14:44:24 +00:00
Joe Groff
b3d25a940c Fix PointerIntPair to be enum class compatible.
Some parts of PointerIntPair assumed that the IntType of the pair was implicitly
convertible to intptr_t, which is not the case for enum class values. Add a
static_cast<intptr_t> to make these conversions explicit and allow
PointerIntPair to be used with an enum class IntType. While we're here, rename
some of the argument values so we don't have variables named "Int" floating
around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 00:01:51 +00:00
Nadav Rotem
5cb04ae563 Document the return value of SmallSet insert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178742 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04 04:54:21 +00:00
Jean-Luc Duprat
e1e9366281 SmallVector and SmallPtrSet allocations now power-of-two aligned.
This time tested on both OSX and Linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 22:07:12 +00:00
Rafael Espindola
ef484a376c Revert "Fix allocations of SmallVector and SmallPtrSet so they are more prone to"
This reverts commit 617330909f.

It broke the bots:

/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest
/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure
Value of: v[i].getValue()
  Actual: 0
Expected: value
Which is: 2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 07:11:21 +00:00
Jean-Luc Duprat
617330909f Fix allocations of SmallVector and SmallPtrSet so they are more prone to
being power-of-two sized.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 05:45:22 +00:00
Rafael Espindola
7fe65d691d Cleanup the simplify_type implementation.
As far as simplify_type is concerned, there are 3 kinds of smart pointers:

* const correct: A 'const MyPtr<int> &' produces a 'const int*'. A
'MyPtr<int> &' produces a 'int *'.
* always const: Even a 'MyPtr<int> &' produces a 'const int*'.
* no const: Even a 'const MyPtr<int> &' produces a 'int*'.

This patch then does the following:

* Removes the unused specializations. Since they are unused, it is hard
to know which kind should be implemented.
* Make sure we don't drop const.
* Fix the default forwarding so that const correct pointer only need
one specialization.
* Simplifies the existing specializations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178147 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 16:43:11 +00:00
Jakub Staszak
2adf8ccbf0 Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177608 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 23:56:19 +00:00
Rafael Espindola
80c6a66bbf Add std prefixes to fix the build with xlc.
Patch by Kai <kai@redstar.de>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177574 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 21:00:22 +00:00
Daniel Dunbar
dfe91cefd2 [ADT] Fix StringSet::insert() to not allocate on every lookup.
- The previous implementation always constructed the StringMap entry, even if
   the key was present in the set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177178 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 20:16:59 +00:00
Craig Topper
d455d4f457 Use NumBaseBits in a few more places in SmallBitVector instead of recalculating it. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 06:01:42 +00:00
Jan Wen Voung
fa785cb22d Disable statistics on Release builds and move tests that depend on -stats.
Summary:
Statistics are still available in Release+Asserts (any +Asserts builds),
and stats can also be turned on with LLVM_ENABLE_STATS.

Move some of the FastISel stats that were moved under DEBUG()
back out of DEBUG(), since stats are disabled across the board now.

Many tests depend on grepping "-stats" output.  Move those into
a orig_dir/Stats/. so that they can be marked as unsupported
when building without statistics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176733 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 22:56:31 +00:00
Aaron Ballman
8660057d18 Switching -1ULL to UINT64_MAX to fix MSVC warnings. Patch thanks to Peng Cheng!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176197 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27 18:38:33 +00:00
Matt Arsenault
54932806ac Another test commit. Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 19:33:48 +00:00
Matt Arsenault
d433902628 Test commit. Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176111 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 19:18:06 +00:00
Benjamin Kramer
70c808f5b7 An Optional<T> is pod-like if the inner type is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 18:58:26 +00:00
Pedro Artigas
633e24dc04 Clear the whole table including the tombstones, since the tombstone count will
be set to zero that is what it was intended. Should improve performance of 
the data structure when clear is invoked frequently (both compile time and
memory usage).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 21:32:00 +00:00
David Blaikie
ea72255f5b Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175729 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 07:55:39 +00:00
David Blaikie
7f838bbe45 Correct spelling of 'enumerator'.
Post commit code review feedback to r175705 from Jordan Rose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175724 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 06:08:22 +00:00
David Blaikie
2bbc19c1c6 Make Optional<T>'s operator bool 'explicit' in C++11
Provides a general way to add 'explicit' for conversion operators (a no-op when
compiling as C++98).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175723 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 06:05:57 +00:00
NAKAMURA Takumi
b8ebc9e244 ADT/Optional.h: Appease msvc. It reapplies r175626.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 02:32:25 +00:00
David Blaikie
5c43245bf4 Provide a "None" value for convenience when using Optional<T>()
This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175696 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 00:27:28 +00:00
NAKAMURA Takumi
6139b55222 Revert r175626, "ADT/Optional.h: Appease msvc."
Sorry, I didn't cover +Asserts, by accident. :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175633 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 15:52:44 +00:00
NAKAMURA Takumi
94e9d0d491 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 15:12:32 +00:00
NAKAMURA Takumi
767ad1c808 ADT/Optional.h: Appease msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 15:12:24 +00:00
Benjamin Kramer
ad4da0fc32 Move the SplatByte helper to APInt and generalize it a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 13:00:06 +00:00
David Blaikie
4318fc5e1e Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175595 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 06:25:36 +00:00
David Blaikie
a28eda7e40 Allow llvm::Optional to work with types without default constructors.
This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175580 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 00:26:04 +00:00
Jakub Staszak
9bc2c99482 Move part of APInt implementation from header to cpp file. These methods
require call cpp file anyway, so we wouldn't gain anything by keeping them
inline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175579 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 00:17:42 +00:00
Douglas Gregor
1f1713ff7a Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-19 18:26:07 +00:00
David Blaikie
a39058aaed Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.
Also removes some redundant DNI comments on function declarations already
using the macro.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175466 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 23:11:17 +00:00
Douglas Gregor
888fae7b49 Add front/back/erase to MapVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 16:03:04 +00:00
Francois Pichet
a94d32284a Add missing typename to unbreak the MSVC 2012 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175129 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-14 03:24:14 +00:00
Ryan Govostes
779a96362e Fix iterator definitions for ImmutableSet and ImmutableMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175097 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 22:37:27 +00:00
Ryan Govostes
3df02ac9d4 Add iterator_traits to ImmutableMap and ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 21:38:22 +00:00
Craig Topper
cef6cfe4a6 Remove unnecessary condtional assignment. The next line ignores the result of the assignment with the same condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 07:44:17 +00:00
Meador Inge
35b1423ee6 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174641 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 18:36:50 +00:00
Tim Northover
72062f5744 Add AArch64 as an experimental target.
This patch adds support for AArch64 (ARM's 64-bit architecture) to
LLVM in the "experimental" category. Currently, it won't be built
unless requested explicitly.

This initial commit should have support for:
    + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions
      (except the late addition CRC instructions).
    + CodeGen features required for C++03 and C99.
    + Compilation for the "small" memory model: code+static data <
      4GB.
    + Absolute and position-independent code.
    + GNU-style (i.e. "__thread") TLS.
    + Debugging information.

The principal omission, currently, is performance tuning.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174054 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 12:12:40 +00:00
Michael Gottesman
e502bba8c6 Encapsulate testing that we have an iOS Triple in Triple.h in the method isiOS
so we follow the convention that all other platforms follow by having an is*
test method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173983 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 22:38:19 +00:00
Nick Lewycky
6bbf4ff9c5 Add an insert() method to MapVector. Adds the first MapVector unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173505 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 22:11:02 +00:00
Andrew Trick
827de0520e ArrayRef reverse iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173424 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:33:52 +00:00
Andrew Trick
2f0a4e1aad whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173423 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 06:33:50 +00:00
Richard Trieu
0ac7e6f293 Add asserts to SmallVector so that calls to front() and back() only succeed
if the vector is not empty.  This will ensure that calls to these functions
will reference elements in the vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173321 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 04:29:24 +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
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
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
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
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