Commit Graph

19558 Commits

Author SHA1 Message Date
Craig Topper
98f54c09d0 [C++11] Add 'override' keyword to IR library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202939 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 06:35:38 +00:00
Craig Topper
0bfd526b6b [C++11] Add 'override' keywords to tablegen code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202937 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 05:17:42 +00:00
Hans Wennborg
2f471c83a0 Check for dynamic allocas and inline asm that clobbers sp before building
selection dag (PR19012)

In X86SelectionDagInfo::EmitTargetCodeForMemcpy we check with MachineFrameInfo
to make sure that ESI isn't used as a base pointer register before we choose to
emit rep movs (which clobbers esi).

The problem is that MachineFrameInfo wouldn't know about dynamic allocas or
inline asm that clobbers the stack pointer until SelectionDAGBuilder has
encountered them.

This patch fixes the problem by checking for such things when building the
FunctionLoweringInfo.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202930 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 02:43:26 +00:00
Chandler Carruth
d1fe495464 [C++11] Sink the iterator over a Value's users into the Value type
itself and teach it to convert between the non-const and const variants.
De-templatetize its usage in APIs to just use the const variant which
always works for those use cases. Also, rename its implementation to
reflect that it is an iterator over *users* not over *uses*.

This is a step toward providing both iterator and range support for
walking the *uses* distinct from the *users*. In a subsequent patch this
will get renamed to make it clear that this is an adaptor over the
fundamental use iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202923 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 01:50:35 +00:00
Rui Ueyama
da96b2e19f Partially roll back r202915.
I did not intend to cast a pointer to ulittle32_t there because the return
type is const void*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202916 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 00:43:02 +00:00
Rui Ueyama
e553a3ba42 Fix endianness bug.
Looks like llvm-readobj is the only customer of this code, and apparently
there's no test to cover this function. I'll write it after finishing
plumbing from llvm-objdump to there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202915 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 00:32:34 +00:00
Richard Smith
6e5887e7e6 Remove dependence on std::function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202902 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 22:13:07 +00:00
Richard Smith
943d1fdffe Add support for arbitrary functors to CrashRecoveryContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202895 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 21:48:49 +00:00
Benjamin Kramer
f0a0ceb034 APFloat: Add a move ctor and operator=
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202883 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 20:26:51 +00:00
Chandler Carruth
8f124fe884 [Modules] Move the LeakDetector header into the IR library where the
source file had already been moved. Also move the unittest into the IR
unittest library.

This may seem an odd thing to put in the IR library but we only really
use this with instructions and it needs the LLVM context to work, so it
is intrinsically tied to the IR library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202842 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:46:06 +00:00
Chandler Carruth
11d95df9b0 [cleanup] Fix a typo in the path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:33:40 +00:00
Chandler Carruth
f7591dd31f [Modules] Move the PassNameParser to the IR library as it deals in the
PassInfo structures of the legacy pass manager. Also give it the Legacy
prefix as it is not a particularly widely used header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202839 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:32:42 +00:00
Chandler Carruth
19d764fb05 [Modules] Move the ConstantRange class into the IR library. This is
a bit surprising, as the class is almost entirely abstracted away from
any particular IR, however it encodes the comparsion predicates which
mutate ranges as ICmp predicate codes. This is reasonable as they're
used for both instructions and constants. Thus, it belongs in the IR
library with instructions and constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202838 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:24:34 +00:00
Chandler Carruth
a2e32657c9 [Modules] Stop including CFG.h from GenericDomTree.h. This used to be
necessary, but is no longer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202836 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:11:55 +00:00
Chandler Carruth
5b74a01aad [Modules] Move the PredIteratorCache into the IR library -- it is
hardcoded to use IR BasicBlocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:09:19 +00:00
Chandler Carruth
ff956e7568 [Modules] Move the NoFolder into the IR library as it creates
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202834 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:05:47 +00:00
Chandler Carruth
9234e06065 [Modules] Move the ConstantFolder into the IR library where it can
reference the ConstantExpr implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 12:02:47 +00:00
Chandler Carruth
d90488f7e8 [Modules] Move the TargetFolder into the Analysis library. Historically,
this would have been required because of the use of DataLayout, but that
has moved into the IR proper. It is still required because this folder
uses the constant folding in the analysis library (which uses the
datalayout) as the more aggressive basis of its folder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202832 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:59:06 +00:00
Chandler Carruth
03e36d752c [Modules] Move CFG.h to the IR library as it defines graph traits over
IR types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202827 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:45:46 +00:00
Chandler Carruth
1fd02bc228 [Modules] Delete DataFlow.h rather than move it to the IR library. No
one in the tree (or in Polly) is using this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202825 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:33:42 +00:00
Chandler Carruth
7225e27b4c [Modules] Move ValueMap to the IR library. While this class does not
directly care about the Value class (it is templated so that the key can
be any arbitrary Value subclass), it is in fact concretely tied to the
Value class through the ValueHandle's CallbackVH interface which relies
on the key type being some Value subclass to establish the value handle
chain.

Ironically, the unittest is already in the right library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202824 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:26:31 +00:00
Chandler Carruth
eb3d76da81 [Modules] Move ValueHandle into the IR library where Value itself lives.
Move the test for this class into the IR unittests as well.

This uncovers that ValueMap too is in the IR library. Ironically, the
unittest for ValueMap is useless in the Support library (honestly, so
was the ValueHandle test) and so it already lives in the IR unittests.
Mmmm, tasty layering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:17:44 +00:00
Chandler Carruth
df3d8e8b4d [Modules] Move the LLVM IR pattern match header into the IR library, it
obviously is coupled to the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202818 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:08:18 +00:00
Chandler Carruth
4bbfbdf7d7 [Modules] Move CallSite into the IR library where it belogs. It is
abstracting between a CallInst and an InvokeInst, both of which are IR
concepts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202816 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 11:01:28 +00:00
Chandler Carruth
bd7cba0d81 [Modules] Move GetElementPtrTypeIterator into the IR library. As its
name might indicate, it is an iterator over the types in an instruction
in the IR.... You see where this is going.

Another step of modularizing the support library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202815 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 10:40:04 +00:00
Chandler Carruth
876ac60880 [Modules] Move InstIterator out of the Support library, where it had no
business.

This header includes Function and BasicBlock and directly uses the
interfaces of both classes. It has to do with the IR, it even has that
in the name. =] Put it in the library it belongs to.

This is one step toward making LLVM's Support library survive a C++
modules bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202814 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 10:30:26 +00:00
Chandler Carruth
1decd56b8d [cleanup] Re-sort all the includes with utils/sort_includes.py.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202811 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 10:07:28 +00:00
Timur Iskhodzhanov
efba32f21b Remove unused typedef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202808 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 09:57:00 +00:00
Chandler Carruth
13f0d301e8 [cleanup] Add a getOperandNo method to the Use class and implement it
out-of-line so that it can refer to the methods on User. As
a consequence, this removes the need to define one template method if
value_use_iterator in the extremely strange User.h header (!!!).

This makse Use.h slightly less peculiar. The only remaining real
peculiarity is the definition of Use::set in Value.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202805 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 09:19:43 +00:00
Patrik Hagglund
4f6b2a26da Fix gcc -Wunused-but-set-variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202800 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 08:55:18 +00:00
Chandler Carruth
2bfe24c418 [cleanup] Run clang-format over the Use code. It was *really*
inconsistent both with itself and with LLVM at large with formatting.
The *s were on the wrong side, the indent was off, etc etc. This is much
cleaner.

Also, go clang-format laying out the array of tags in nice columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202799 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 08:53:41 +00:00
Chandler Carruth
0a6057117e [cleanup] Tidy up and modernize comments and the definition order for
the Use class.

More cleanups to come here. This class just needs some TLC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202798 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 08:51:00 +00:00
NAKAMURA Takumi
d186c936bb PBQP/Graph.h: Prune @return in setNodeCosts, possibly copypasto. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202795 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 07:27:08 +00:00
NAKAMURA Takumi
e93f18ece9 PBQP/Graph.h: s/os/OS/ in @param. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202794 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 07:26:55 +00:00
Craig Topper
4a655e7064 [C+11] Add 'override' keyword to methods in the support library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202791 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 06:24:11 +00:00
Benjamin Kramer
a2e96a968d Add missing include.
libstdc++ and libc++ pulled this in transitively so I didn't notice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 20:06:13 +00:00
Diego Novillo
f05b45fdb2 Pass to emit DWARF path discriminators.
DWARF discriminators are used to distinguish multiple control flow paths
on the same source location. When this happens, instructions across
basic block boundaries will share the same debug location.

This pass detects this situation and creates a new lexical scope to one
of the two instructions. This lexical scope is a child scope of the
original and contains a new discriminator value. This discriminator is
then picked up from MCObjectStreamer::EmitDwarfLocDirective to be
written on the object file.

This fixes http://llvm.org/bugs/show_bug.cgi?id=18270.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202752 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 20:06:11 +00:00
Benjamin Kramer
9efaf2f2da [C++11] Use std::tie to simplify compare operators.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202751 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 19:58:30 +00:00
Chandler Carruth
0550e93e89 [C++11] Remove the completely unnecessary requirement on SetVector's
remove_if that its predicate is adaptable. We don't actually need this,
we can write a generic adapter for any predicate.

This lets us remove some very wrong std::function usages. We should
never be using std::function for predicates to algorithms. This incurs
an *indirect* call overhead for every evaluation of the predicate, and
makes it very hard to inline through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 19:28:52 +00:00
Diego Novillo
6f8c0c0613 Add DWARF discriminator support to DILexicalBlocks.
This adds support for emitting discriminators from DILexicalBlocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 18:53:17 +00:00
Lang Hames
98b5aaeebb Re-apply r202551, which introduced new PBQP solver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202735 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 18:50:05 +00:00
Benjamin Kramer
7515c71cb6 Revert "[C++11] Replace LLVM atomics with std::atomic."
Breaks the MSVC build.
DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202731 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 18:02:34 +00:00
Benjamin Kramer
4721e55a0c [C++11] Replace LLVM atomics with std::atomic.
With C++11 we finally have a standardized way to specify atomic operations. Use
them to replace the existing custom implemention. Sadly the translation is not
entirely trivial as std::atomic allows more fine-grained control over the
atomicity. I tried to preserve the old semantics as well as possible.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202730 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 17:53:30 +00:00
Tom Stellard
db3064e438 Add patch level to llvm version in CMake and Autoconf
The shared library generated by autoconf will now be called
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX).so
and a symlink named
libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX).so will
also be created in the install directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202720 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 15:22:00 +00:00
Tobias Grosser
75c86c9e9a [C++11] Add a basic block range view for RegionInfo
This also switches the users in LLVM to ensure this functionality is tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202705 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 13:00:39 +00:00
Chandler Carruth
8959996a75 [C++11] MSVC 2012 can't handle list-initialization that calls
a constructor either. Just call the constructor directly. I'll look into
making this work with aggregate initialization some other time (when
I have someone with MSVC 2012 handy to test ideas).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202688 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 10:59:41 +00:00
Chandler Carruth
3dfabcb249 [C++11] Add two range adaptor views to User: operands and
operand_values. The first provides a range view over operand Use
objects, and the second provides a range view over the Value*s being
used by those operands.

The naming is "STL-style" rather than "LLVM-style" because we have
historically named iterator methods STL-style, and range methods seem to
have far more in common with their iterator counterparts than with
"normal" APIs. Feel free to bikeshed on this one if you want, I'm happy
to change these around if people feel strongly.

I've switched code in SROA and LCG to exercise these mostly to ensure
they work correctly -- we don't really have an easy way to unittest this
and they're trivial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202687 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 10:42:58 +00:00
Chandler Carruth
26abef7b5a [C++11] Add an iterator_range class template. This is modeled on the
proposed std::iterator_pair which was in committee suggested to move
toward std::iterator_range. There isn't a formal paper yet, but there
seems little disagreement within the committee at this point so it seems
fine to provide our own version in the llvm namespace so we can easily
build range adaptors for the numerous iterators in LLVM's interfaces.

Note that I'm not really comfortable advocating a crazed range-based
migration just yet. The range stuff is still in a great deal of flux in
C++ and the committee hasn't entirely made up its mind (afaict) about
how it will work. So I'm mostly trying to provide the minimal
functionality needed to make writing easy and convenient range adaptors
for range based for loops easy and convenient. ;]

Subsequent patches will use this across the fundamental IR types, where
there are iterator views.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202686 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 10:28:38 +00:00
Ahmed Charles
0b949e0e9f [C++11] Pass unique_ptr by value instead of &&.
Suggestion by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202678 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 07:15:46 +00:00
Benjamin Kramer
361542afd6 Remove unnecessary copy ctors.
They didn't provide any value over the default ones but blocked move semantics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202664 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-02 21:24:52 +00:00