Commit Graph

14650 Commits

Author SHA1 Message Date
Jay Foad
ff7782bcc9 Remove DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS, folding its
functionality into DEFINE_TRANSPARENT_OPERAND_ACCESSORS. A side-effect
of this is that the operand accessors for Constants will tolerate NULL
operands, fixing PR10663.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138230 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-22 09:37:03 +00:00
Devang Patel
93d39be530 Do not use named md nodes to track variables that are completely optimized. This does not scale while doing LTO with debug info. New approach is to include list of variables in the subprogram info directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 23:28:12 +00:00
Jakob Stoklund Olesen
cafe614035 Add IntervalMap::const_iterator::atBegin().
It returns true when operator--() can be called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 22:04:19 +00:00
Benjamin Kramer
613d13beb0 C API functions must be able to see their extern "C" definitions, or it will be impossible to call them from C.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138022 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 01:36:54 +00:00
Bill Wendling
7e8840c4d9 Add SplitLandingPadPredecessors().
SplitLandingPadPredecessors is similar to SplitBlockPredecessors in that it
splits the current block and attaches a set of predecessors to the new basic
block. However, it differs from SplitBlockPredecessors in that it's specifically
designed to handle landing pad blocks.

Two new basic blocks are created: one that is has the vector of predecessors as
its predecessors and one that has the remaining predecessors as its
predecessors. Those two new blocks then receive a cloned copy of the landingpad
instruction from the original block. The landingpad instructions are joined in a
PHI, etc. Like SplitBlockPredecessors, it updates the LLVM IR, AliasAnalysis,
DominatorTree, DominanceFrontier, LoopInfo, and LCCSA analyses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138014 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 00:05:40 +00:00
Ivan Krasin
fb23462889 Add NativeClient operating system support.
This patch adds support of NativeClient (*-*-nacl) OS support to LLVM.
It's already supported in autoconf/config.sub.

The motivation for this change is to start upstreaming PNaCl work. The
whole set of patches include llvm backends (i686, x86_64, ARM),
llvm-gcc (probably, would not be upstreamed because it's deprecated)
and clang (the work has been just started, the amount of changes is
going to be low and the most of the work is expected to be done close
to the mainline).




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 22:54:21 +00:00
Ivan Krasin
74af88a666 FastISel: avoid function calls between the materialization of the constant and its use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 22:06:10 +00:00
Chris Lattner
489fee1b64 Rip out the old StructType APIs as warned about on llvmdev last week.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 17:39:28 +00:00
Richard Osborne
c4dcf323cc Add intrinsics for SETEV, GETED, GETET.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 13:00:48 +00:00
Bill Wendling
2ac0e6be05 Add the support in code-gen for the landingpad instruction lowering.
The landingpad instruction is lowered into the EXCEPTIONADDR and EHSELECTION
SDNodes. The information from the landingpad instruction is harvested by the
'AddLandingPadInfo' function. The new EH uses the current EH scheme in the
back-end. This will change once we switch over to the new scheme. (Reviewed by
Jakob!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 21:56:44 +00:00
Bill Wendling
c1dbf0cdb4 Remove unneeded sentence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 19:33:27 +00:00
Jordy Rose
c68c8623d0 ...and make sure DynamicLibrary builds by removing "const" from the Invalid placeholder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137843 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:28:14 +00:00
Jordy Rose
77b6f2fd22 Don't use NULL to represent an invalid library; Cygwin uses this for RTLD_DEFAULT. Caught by Takumi.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137841 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:23:17 +00:00
Owen Anderson
83e3f67fb6 Allow the MCDisassembler to return a "soft fail" status code, indicating an instruction that is disassemblable, but invalid. Only used for ARM UNPREDICTABLE instructions at the moment.
Patch by James Molloy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 17:44:15 +00:00
Jordy Rose
0bce85fbfa Use DynamicLibrary instances as a way to get symbols from a specific library. Preparation for upcoming (preliminary) support for plugins for the static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 00:29:32 +00:00
Devang Patel
94c7ddb6f5 Until now all debug info MDNodes referred to a root MDNode, a compile unit. This simplified handling of these needs in dwarf writer. However, one side effect of this is that during link time optimization all these MDNodes are _not_ uniqued. In other words there will be N number of MDNodes describing "int", "char" and all other types, which would suddenly grow when each object file starts using libraries like STL.
MDNodes graph structure such that compiler unit keeps track of important MDNodes and update dwarf writer to process mdnodes top-down instead of bottom up.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 22:09:43 +00:00
Devang Patel
d6a49773ff Increment debug info version to accommodate upcoming change in debug info node structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 21:00:05 +00:00
Bill Wendling
d2e103daf8 Add getFirstInsertionPt() method.
getFirstInsertionPt() returns an iterator to the first insertion point in a
basic block. This is after all PHIs and any other instruction which is required
to be at the top of the basic block (like LandingPadInst).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137744 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 20:42:52 +00:00
Jim Grosbach
1b84cce77f Remove unused Target argument from AsmParser construction methods.
The argument is unused, and is a layering violation in any case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 18:33:49 +00:00
Jim Grosbach
ac29c0af3d Remove unused forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 18:31:36 +00:00
Jim Grosbach
0ba45d4fb3 Tidy up. Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 16:38:17 +00:00
David Chisnall
7a817eae6c Add a mechanism for optimisation plugins to register passes that all front ends can use without needing to be aware of the plugin (or the plugin be aware of the front end).
Before 3.0, I'd like to add a mechanism for automatically loading a set of plugins from a config file.  API suggestions welcome...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 13:58:41 +00:00
Rafael Espindola
48c4c6807b Remove unimplemented method. Fixes PR10658.
Thanks to Jonas Gafele for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 13:53:50 +00:00
Jim Grosbach
19cb7f491f MCTargetAsmParser target match predicate support.
Allow a target assembly parser to do context sensitive constraint checking
on a potential instruction match. This will be used, for example, to handle
Thumb2 IT block parsing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 23:03:29 +00:00
Devang Patel
6326a4238d Add a finalize() hook, that'll let DIBuilder construct compile unit lazily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 23:00:00 +00:00
Jim Grosbach
47a24ab4d7 Move MatchResultTy enum into base class definition.
No need for it to be redefined as part of every derived target asm parser
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 20:53:08 +00:00
Devang Patel
6f9d8ffe5e Refactor. Global variables are part of compile unit so let CompileUnit create new global variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 17:57:41 +00:00
Jim Grosbach
bb0752b040 Tidy up trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 17:30:25 +00:00
Nick Lewycky
53b2b73643 Remove the last improper use of getGlobalContext() from LLVM.
This caused a race condition where a thread calls ~LLVMContextImpl which calls
Module::dropAllReferences which calls begin() on an empty ilist that would
create the sentinel, which racily accesses the global context.

This can not be fixed by locking inside createSentinel because the lock would
need to be shared with all users of the global context, including those that
reside outside LLVM's own code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137546 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-13 01:04:44 +00:00
Bill Wendling
e6e8826870 Initial commit of the 'landingpad' instruction.
This implements the 'landingpad' instruction. It's used to indicate that a basic
block is a landing pad. There are several restrictions on its use (see
LangRef.html for more detail). These restrictions allow the exception handling
code to gather the information it needs in a much more sane way.

This patch has the definition, implementation, C interface, parsing, and bitcode
support in it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137501 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 20:24:12 +00:00
Devang Patel
92a36e6583 Constify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 18:18:02 +00:00
Devang Patel
cd9f6c53de Use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 18:10:19 +00:00
Chris Lattner
d95f8f6ada add ifdef's to let people easily remove these dead api for testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137483 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 18:08:19 +00:00
Chris Lattner
f4bbcaabeb add two missing function impls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 17:43:05 +00:00
Chris Lattner
2c38d65fd9 add new accessors to reflect new terminology in struct types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137468 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 17:31:02 +00:00
Duncan Sands
1f6a329f79 Silence a bunch (but not all) "variable written but not read" warnings
when building with assertions disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 14:54:45 +00:00
Chris Lattner
823eb1ca11 Fix an obscure bug in PointerUnion that would bite PointerUnion3/4. Basically,
when checking isNull(), we'd pick off the sentinel bit for the outer 
PointerUnion, but would not recursively convert the inner pointerunion to bool,
so if *its* sentinel bit is set, isNull() would incorrectly return false.

No testcase, because someone hit this when they were trying to refactor code
to use PointerUnion3, but they since found a better solution.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 04:31:38 +00:00
NAKAMURA Takumi
1221139f10 include/llvm/Config/config.h.cmake: Reorder to follow config.h.in, and import stuff from llvm-config.h.cmake and clang/config.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 03:27:54 +00:00
NAKAMURA Takumi
8776fa44d4 CMake: Eliminate unused checks and #undef(s) as below;
STACK_DIRECTION
YYTEXT_POINTER
HAVE_NAMESPACES
HAVE_STD_ITERATOR
HAVE_FWD_ITERATOR
HAVE_BI_ITERATOR
HAVE_GLOBAL_HASH_MAP
HAVE_GLOBAL_HASH_SET
HAVE_GNU_EXT_HASH_MAP
HAVE_GNU_EXT_HASH_SET
HAVE_STD_EXT_HASH_MAP
HAVE_STD_EXT_HASH_SET

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137423 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 03:27:48 +00:00
NAKAMURA Takumi
b43b09eef5 include/llvm/Config/llvm-config.h: Reorder and reword to follow (generated) config.h.in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 01:50:50 +00:00
NAKAMURA Takumi
4362c6225e configure: Update since r136721.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137412 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 01:50:43 +00:00
Nick Lewycky
2fc75d5d60 A virtual destructor for the class with virtual methods!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 00:32:15 +00:00
Andrew Trick
b1831c6640 Allow loop unrolling to get known trip counts from ScalarEvolution.
SCEV unrolling can unroll loops with arbitrary induction variables. It
is a prerequisite for -disable-iv-rewrite performance. It is also
easily handles loops of arbitrary structure including multiple exits
and is generally more robust.

This is under a temporary option to avoid affecting default
behavior for the next couple of weeks. It is needed so that I can
checkin unit tests for updateUnloop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-11 23:36:16 +00:00
NAKAMURA Takumi
4c7324d032 DataTypes.h.cmake: Tweak INT32_MIN for MSVC. MSC treats -2147483648 as -(2147483648U).
It caused an unexpected behavior since r137254.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-11 21:59:55 +00:00
Chad Rosier
78eb93c591 Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-11 00:22:48 +00:00
Devang Patel
5bc942cc3c Stay within 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137283 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 23:58:09 +00:00
Andrew Trick
fb62b8deb3 Reapplying r136844.
An algorithm for incrementally updating LoopInfo within a
LoopPassManager. The incremental update should be extremely cheap in
most cases and can be used in places where it's not feasible to
regenerate the entire loop forest.

- "Unloop" is a node in the loop tree whose last backedge has been removed.
- Perform reverse dataflow on the block inside Unloop to propagate the
  nearest loop from the block's successors.
- For reducible CFG, each block in unloop is visited exactly
  once. This is because unloop no longer has a backedge and blocks
  within subloops don't change parents.
- Immediate subloops are summarized by the nearest loop reachable from
  their exits or exits within nested subloops.
- At completion the unloop blocks each have a new parent loop, and
  each immediate subloop has a new parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137276 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 23:22:57 +00:00
Andrew Trick
d8a2f3ab91 Cleanup. Remove an extraneous GraphTraits specialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 22:55:39 +00:00
Devang Patel
b549bcfe6c Distinguish between two copies of one inlined variable. Take 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 21:50:54 +00:00
Devang Patel
103b8e653c Provide utility to extract and use lexical scoping information from machine instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 19:04:06 +00:00