Commit Graph

4002 Commits

Author SHA1 Message Date
Chris Lattner
9fc5cdf77c split dom frontier handling stuff out to its own DominanceFrontier header,
so that Dominators.h is *just* domtree.  Also prune #includes a bit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 22:09:33 +00:00
Chris Lattner
e562dba845 fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 01:33:36 +00:00
Chris Lattner
c0d5496b8a add methods to IRBuilder to create memcpy/memset/memmove.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 22:49:25 +00:00
Jeffrey Yasskin
8e68c38735 Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 00:58:24 +00:00
Chris Lattner
f1b4eafbfe rename MVT::Flag to MVT::Glue. "Flag" is a terrible name for
something that just glues two nodes together, even if it is
sometimes used for flags.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 02:38:05 +00:00
Owen Anderson
3b77f56194 Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowdowns on the Linux self-host configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:28:03 +00:00
Duncan Sands
0d7ce5ffa4 There is no need for isAssociative to take the type as an argument anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 13:10:23 +00:00
Nick Lewycky
476b242fe7 Add missing standard headers. Patch by Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:43:38 +00:00
Nick Lewycky
2402123413 Add missing std:: prefixes to some calls. C++ doesn't require that <cfoo>
headers provide symbols outside namespace std and the LLVM coding standards
state that we should prefix all of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122192 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19 20:42:43 +00:00
Owen Anderson
a479b23256 Add support to CallbackVH to receive notification when a Value's use-list changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 00:07:15 +00:00
Bob Wilson
26156456dd Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 23:06:32 +00:00
Michael J. Spencer
3ff9563c3e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:29:14 +00:00
Dan Gohman
5034dd318a Move Value::getUnderlyingObject to be a standalone
function so that it can live in Analysis instead of
VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 20:02:24 +00:00
Michael J. Spencer
333fb04506 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:48 +00:00
Dan Gohman
a6399ae089 Remove the code from Function::dropAllReferences which replaced
uses of the function's blocks with undef. This code isn't needed,
because BasicBlock's destructor handles such uses. Also, undef isn't
correct, since blockaddresses may still be used for comparisons
with null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:56:51 +00:00
Jay Foad
40f8f6264d PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 08:25:19 +00:00
Frits van Bommel
a4805cf6ef Fix PR 4170 by having ExtractValueInst::getIndexedType() reject out-of-bounds indexing.
Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 20:50:26 +00:00
Benjamin Kramer
3069cbf7b3 Remove unneeded zero arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 15:28:22 +00:00
Benjamin Kramer
299ee184f4 Apparently APFloat::getZero doesn't like PPCDoubleDoubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 14:43:08 +00:00
Benjamin Kramer
983839609f Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 14:22:24 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Chris Lattner
a1ac3bbec7 add a function to the C api to get the context out of a module, patch
by Eric Dobson!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 20:03:44 +00:00
Chris Lattner
5400570097 add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 02:47:22 +00:00
Benjamin Kramer
f601d6df6f Simplify code. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20 18:43:35 +00:00
Owen Anderson
9fe010ecf8 Fix an order-of-deallocation issue where the AttrListImpl could be deallocated before the global
LLVMContext, causing memory errors.  Patch by Peter Collingbourne.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 18:59:13 +00:00
Duncan Sands
23a19572b2 Now that hasConstantValue has been made simpler, it may return the
phi node itself if it occurs in an unreachable basic block.  Protect
against this.  Hopefully this will fix some more buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 10:23:23 +00:00
Chris Lattner
4afa12890f now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff.  This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling 
definition, increasing type safety and cleaning things up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 08:13:01 +00:00
Chris Lattner
aa6e350c88 fix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::init
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 05:41:46 +00:00
Duncan Sands
ff10341183 Fix a layering violation: hasConstantValue, which is part of the PHINode
class, uses DominatorTree which is an analysis.  This change moves all of
the tricky hasConstantValue logic to SimplifyInstruction, and replaces it
with a very simple literal implementation.  I already taught users of
hasConstantValue that need tricky stuff to use SimplifyInstruction instead.
I didn't update InlineFunction because the IR looks like it might be in a
funky state at the point it calls hasConstantValue, which makes calling
SimplifyInstruction dangerous since it can in theory do a lot of tricky
reasoning.  This may be a pessimization, for example in the case where
all phi node operands are either undef or a fixed constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 04:30:22 +00:00
Duncan Sands
eff0581583 If dom tree information is available, make it possible to pass
it to get better phi node simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119055 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 18:36:10 +00:00
Nick Lewycky
67b6464377 Doxygenify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 21:51:44 +00:00
Dan Gohman
4d70a29490 Factor out Instruction::isSafeToSpeculativelyExecute's code for
testing for dereferenceable pointers into a helper function,
isDereferenceablePointer.  Teach it how to reason about GEPs
with simple non-zero indices.

Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
which didn't check for weak externals or out of range gep
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 21:23:25 +00:00
Dan Gohman
67a84f1ee6 Include ImmutablePass passes in -debug-pass=Arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 16:32:17 +00:00
Owen Anderson
80f3d786ad Last try to get this reference counting right, I swear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 17:47:10 +00:00
Owen Anderson
d35b1a2f21 Really fix the leak in the attributes list. Thanks to Benjamin Kramer for pointing out how I was being stupid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 17:46:38 +00:00
Owen Anderson
a17cceceef Fix leak in my recent fix for PR8442.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 05:17:47 +00:00
Owen Anderson
3afb024907 Fix PR8441, a race condition in the static attributes list. While the reference counting was itself threadsafe,
the implicit removal of each object from the global list was not.  Make this operation atomic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 00:27:03 +00:00
Dale Johannesen
1aabe1b493 Apply patch for use-after-free in InlineAsm constant handling,
PR 8522 / 8616046.  Test reduction, analysis and patch by Tim Deegan!
(However, review by someone who understands the classes here better
is welcome.  John Krum will return!)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:59:27 +00:00
John Thompson
44ab89eb37 Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:29:13 +00:00
Charles Davis
970bfcc7d8 Add a new 'hotpatch' attribute. This attribute will insert a two-byte no-op
instruction at the beginning of each function that has the attribute, allowing
the function to be easily hooked and/or patched.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 15:37:09 +00:00
Benjamin Kramer
a3ac427507 Make some symbols static, move classes into anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 17:35:07 +00:00
Owen Anderson
75f6df283f Attempt to fix valgrind complaining about (benign) leaks in pass registration by having PassRegistry
delete PassInfo objects that were created using new-style initialization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:22:30 +00:00
Tobias Grosser
6551360535 Add RegionPass support.
A RegionPass is executed like a LoopPass but on the regions detected by the
RegionInfo pass instead of the loops detected by the LoopInfo pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 01:54:44 +00:00
Owen Anderson
081c34b725 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 17:21:58 +00:00
Benjamin Kramer
4c8a985ed5 std::string cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 07:39:34 +00:00
Oscar Fuentes
f0c55a9b97 Build with RTTI and exceptions disabled. Only in GCC for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 02:26:16 +00:00
Owen Anderson
2ab36d3502 Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client.  For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve.  I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 19:48:12 +00:00
Dan Gohman
624218f5b4 Delete a redundant check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:19:24 +00:00
Dan Gohman
9b0e47efc6 More SmallVectorImpls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:15:27 +00:00
Dan Gohman
8de206c101 Shrink a SmallVector with a known maximum size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:13:43 +00:00
Dan Gohman
568a63db96 Constify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:12:29 +00:00
Dan Gohman
ebb1834e86 Use SmallVectorImpl in a bunch of places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 00:11:18 +00:00
Dan Gohman
7c34730fb9 Fix the pass manager's search order for immutable passes, and make it
stop searching when it has found a match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 23:19:01 +00:00
Owen Anderson
ce665bd2e2 Now with fewer extraneous semicolons!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 22:25:06 +00:00
Owen Anderson
b8a1ccfc4b Add initialization routines for VMCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 19:51:21 +00:00
Owen Anderson
1a3d233621 Next step on the getting-rid-of-static-ctors train: begin adding per-library
initialization functions that initialize the set of passes implemented in
that library.  Add C bindings for these functions as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 17:55:47 +00:00
Owen Anderson
e2a268fd03 Another step towards getting rid of static ctors for pass registration: have INITIALIZE_PASS AND INITIALIZE_AG_PASS
expand to an initializeMyPass() function (in additional to the extant static ctors).  Eventually, these will be called
from a big InitializeAllPasses() function, and the PassInfo's they create (which would be leaked if this code were used
at the moment) will be handed off to a PassRegistry for ownership.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:58:16 +00:00
Bill Wendling
6cf6c79e82 The pshufw instruction came about in MMX2 when SSE was introduced. Don't place
it in with the SSSE3 instructions.

Steward! Could you place this chair by the aft sun deck? I'm trying to get away
from the Astors. They are such boors!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:24:01 +00:00
Bill Wendling
11bfe3e5bf Cleanup. Get rid of extraneous variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 00:46:06 +00:00
Dale Johannesen
bac4c52131 Attempt to outwit overly smart compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 00:21:24 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
Talin
c87cfb6a81 Allow llvm.gcroot to work with non-pointer allocas.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:23:47 +00:00
Dan Gohman
f53458f693 When an MDNode changes to become identical to another MDNode,
delete the MDNode that changed, rather than the other MDNode.
This is less work, because it doesn't require the changed node
to be re-inserted into the uniquing map and it doesn't require
the is-function-local flag to be recomputed. Also, it avoids
trouble when the existing node is part of a complicated
data structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:07:19 +00:00
Dan Gohman
f375ebeed6 Scope a varible inside an if statement, to make it clear that
it's not used afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 21:02:55 +00:00
Dan Gohman
e0214d5b19 Make this code 65-bit clean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 15:15:44 +00:00
Che-Liang Chiou
f9930da2ef Add ret instruction to PTX backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 07:46:17 +00:00
Owen Anderson
f56ba2b061 Allow the PassRegistry mutex to be lazily initialized, and clean up the global namespace at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 23:44:50 +00:00
Owen Anderson
1e3e6362c8 Do not expose the locking for the PassRegistry in the header. Be careful to
synchronize any method that might lazily initialize the pImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 23:32:35 +00:00
Owen Anderson
cb86def1c2 Fix a threaded LLVM bug due the need for operator= on reference counted AttrListImpl's. It might
be possible to implement this very carefully to allow a lock-free implementation while still
avoiding illegal interleavings, but I haven't been able to figure one out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 00:27:35 +00:00
Owen Anderson
b6d760c7d5 Since PassRegistry is currently a shared global object, it needs locking. While it might intuitively seem
that all the setup of this class currently happens at static initialization time, this misses the fact
that some later events can cause mutation of the PassRegistrationListeners list, and thus cause race issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 23:03:33 +00:00
Dale Johannesen
29fc6f35a5 Add x86MMX a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 00:52:23 +00:00
Dan Gohman
b2143b6247 Remove the experimental AliasAnalysis::getDependency interface, which
isn't a good level of abstraction for memdep. Instead, generalize
AliasAnalysis::alias and related interfaces with a new Location
class for describing a memory location. For now, this is the same
Pointer and Size as before, plus an additional field for a TBAA tag.

Also, introduce a fixed MD_tbaa metadata tag kind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 21:25:10 +00:00
Dan Gohman
5781f3e9fc When a function-local value with function-local metadata uses gets RAUWed with a
non-function-local value, it may result in the metadata no longer needing to be
function-local. Check for this condition, and clear the isFunctionLocal flag, if
it's still in the uniquing map, since any node in the uniquing map needs to have
an accurate function-local flag.

Also, add an assert to help catch problematic cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 01:37:57 +00:00
Owen Anderson
049e42f0b4 Minimize #includes in a top-level header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:47:42 +00:00
Eric Christopher
3ec73169a3 Silence some constructor ordering warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:25:05 +00:00
John Thompson
eac6e1d0c7 Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:15:37 +00:00
Dale Johannesen
bb811a2445 Add X86 MMX type to bitcode and Type.
(The Ada bindings probably need it too, but all the
obvious places to change say "do not edit this file".)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:55:01 +00:00
Bill Wendling
f9e49e86ee Use StringRef which performs the "early exit" when compared against a constant
string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:42:26 +00:00
Bill Wendling
ebd3e5f4cc Early exit with simple checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 19:06:58 +00:00
Bill Wendling
de49f360ec Auto-upgrade the magic ".llvm.eh.catch.all.value" global to
"llvm.eh.catch.all.value". Only the name needs to be changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 18:51:56 +00:00
Dan Gohman
e983438746 MDNodes are not Constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 20:54:24 +00:00
Dan Gohman
3da076ffef Print invalid metadata references as <badref>, for consistency with
regular value references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 20:53:58 +00:00
Owen Anderson
30268be89d Clarify the ownership model of LLVMContext and Module. Namely, contexts own
modules are instantiated in them.  If the context is deleted, all of its owned
modules are also deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:03:32 +00:00
Owen Anderson
381f17ee7c Fix PR7972, in which the PassRegistry was being leaked. As part of this,
switch to using a ManagedStatic for the global PassRegistry instead of a
ManagedCleanup, and fix a destruction ordering bug this exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:48:10 +00:00
Bill Wendling
d8dd5757e0 Add an MVT::x86mmx type. It will take the place of all current MMX vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 20:03:56 +00:00
Owen Anderson
6bcd3a0265 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 19:16:25 +00:00
Bob Wilson
eb0c3d3729 Replace NEON vabdl, vaba, and vabal intrinsics with combinations of the
vabd intrinsic and add and/or zext operations.  In the case of vaba, this
also avoids the need for a DAG combine pattern to combine vabd with add.
Update tests.  Auto-upgrade the old intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 01:35:08 +00:00
Chris Lattner
1dbb3879e8 lets get crazy and name the header file the exact class name,
not a scrunched version of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:09:42 +00:00
Chris Lattner
91fb4070e5 reapply 112894:
Remove #uses comments from functions: they we're padded out to column 50
and were potentially confusing for externally visible functions.

going further, remove the "<i8**> [#uses=3]" comments entirely. They
add a lot of noise, confuse people about what the IR is, and don't add 
any particular value.  When the types are long it makes it really really
hard to read IR.

If someone is interested in this sort of thing, the right way to do this
is to implement an AsmAnnotationWriter that produces the same output, and
add a flag to llvm-dis (only) to produce this output.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:52:10 +00:00
Chris Lattner
7e5c1a9790 revert patch, need to update clang tests too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:42:07 +00:00
Chris Lattner
39653a4e6c Remove #uses comments from functions: they we're padded out to column 50
and were potentially confusing for externally visible functions.

going further, remove the "<i8**> [#uses=3]" comments entirely. They
add a lot of noise, confuse people about what the IR is, and don't add 
any particular value.  When the types are long it makes it really really
hard to read IR.

If someone is interested in this sort of thing, the right way to do this
is to implement an AsmAnnotationWriter that produces the same output, and
add a flag to llvm-dis (only) to produce this output.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:41:24 +00:00
Duncan Sands
8cf2663227 Print the number of uses of a function in the .ll since it can be informative
and there seems to be no reason not to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:52:23 +00:00
Bob Wilson
d0b69cf119 Remove NEON vmull, vmlal, and vmlsl intrinsics, replacing them with multiply,
add, and subtract operations with zero-extended or sign-extended vectors.
Update tests.  Add auto-upgrade support for the old intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 23:50:19 +00:00
Dan Gohman
56b092e4cd Add comments explaining why it's not necessary to include the
is-function-local flag in metadata uniquing bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:18:41 +00:00
Bob Wilson
973a074345 Remove NEON vmovn intrinsic, replacing it with vector truncate operations.
Auto-upgrade the old intrinsic and update tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 20:02:30 +00:00
Bob Wilson
04d6c289ab Remove NEON vaddl, vaddw, vsubl, and vsubw intrinsics. Instead, use llvm
IR add/sub operations with one or both operands sign- or zero-extended.
Auto-upgrade the old intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 05:57:34 +00:00
Chris Lattner
61c70e98ac remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 04:09:24 +00:00
Chris Lattner
18303ef9e5 zap dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 03:18:45 +00:00
Bob Wilson
7a9ef44b3b Add alignment arguments to all the NEON load/store intrinsics.
Update all the tests using those intrinsics and add support for
auto-upgrading bitcode files with the old versions of the intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 17:13:24 +00:00
Dan Gohman
7548fb37f1 Don't include the is-function-local bit in the FoldingSetNodeID
for MDNodes, since this information is effectively implied by
the operands. This allow allows the code to avoid doing a
recursive is-it-really-function-local check in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 23:21:12 +00:00
Dan Gohman
97cfa7dc0a Verify that a non-uniqued non-temporary MDNode is not deleted via
MDNode::deleteTemporary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:32:05 +00:00
Owen Anderson
02dd53e1c5 Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 17:52:01 +00:00
Nick Lewycky
55e97d47c4 Verify the predicates on icmp/fcmp. Suggested by Jeff Yasskin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 23:45:14 +00:00
Benjamin Kramer
9dd3e92e1d Use MDNode::destroy(). Fixes a delete/free mismatch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 15:07:23 +00:00
Dan Gohman
990bdd50d1 Add an assert to MDNode::deleteTemporary check that the node being deleted
is not non-temporary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111713 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 02:52:29 +00:00
Bill Wendling
55ae515f9d Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:05:50 +00:00
Dan Gohman
489b29b0a4 Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:02:26 +00:00
Erick Tryzelaar
f7af931930 Expose LLVMSetOperand and LLVMGetNumOperands to llvm-c and ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 14:51:22 +00:00
Bob Wilson
b31a11b466 Replace the arm.neon.vmovls and vmovlu intrinsics with vector sign-extend and
zero-extend operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 04:54:02 +00:00
Dan Gohman
8a757aeac4 Revert r111199; it breaks -debug-pass=Structure output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111500 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 01:29:07 +00:00
Dan Gohman
3620ff9a8b The plural of analysis is analyses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 22:57:28 +00:00
Dan Gohman
65bffec2c2 Make dumpPassStructure be a PMDataManager abstraction, rather than
a Pass abstraction, since that's the level it's actually used at.
Rename Pass' dumpPassStructure to dumpPass.

This eliminates an awkward use of getAsPass() to convert a PMDataManager*
into a Pass* just to permit a dumpPassStructure call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 22:45:12 +00:00
Dan Gohman
b85b31b300 Remove redundant inline keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111192 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:57:30 +00:00
Dan Gohman
7578ea887d Eliminate the TopLevelManagerType enum; instead, just make
PMTopLevelManager's constructor take a PMDataManager *, which already
provides the needed abstraction support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-16 21:38:42 +00:00
Argyrios Kyrtzidis
8c8b9ee8c8 Revert r111082. No warnings for this common pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-15 10:27:23 +00:00
Argyrios Kyrtzidis
7268d97ae6 Add ATTRIBUTE_UNUSED to methods that are not supposed to be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-14 21:35:10 +00:00
Nate Begeman
a966af2f4c Move some code from Verifier into SVI::isValidOperands. This allows us to catch bad shufflevector operations when they are created, rather than waiting for someone to notice later on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-13 00:16:46 +00:00
Dan Gohman
ca2835411f Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:56:03 +00:00
Dan Gohman
95df619a40 Tidy up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:50:08 +00:00
Dan Gohman
9e2f6284bc Use .empty() instead of .size().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 23:46:28 +00:00
Dan Gohman
fa5c2a67c3 Remove BasicBlockPass::runOnFunction, which was unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 20:28:16 +00:00
Dan Gohman
1f9a1608a6 Delete FunctionPass::run, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:11:05 +00:00
Dan Gohman
73e8800229 Delete FunctionPass::runOnModule, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 19:05:53 +00:00
Nick Lewycky
1bb580a3aa Reject unrepresentable pointer types in intrinsics. Fixes PR7316.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-08 06:12:09 +00:00
Dan Gohman
4afefdec65 More #include cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:18:18 +00:00
Dan Gohman
12376a8df6 Oops, check in this file too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 01:04:15 +00:00
Dan Gohman
11112e0d7b Tidy some #includes and forward-declarations, and move the C binding code
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-07 00:43:20 +00:00
Owen Anderson
90c579de5a Reapply r110396, with fixes to appease the Linux buildbot gods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 18:33:48 +00:00
Owen Anderson
1f74590e9d Revert r110396 to fix buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-06 00:23:35 +00:00
Owen Anderson
9ccaf53ada Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 23:42:04 +00:00
Gabor Greif
3ecf355c7a remove the private hack from CallInst, it was not supposed to hit the branch anyway
as a positive consequence the CallSite::getCallee() methods now can be rewritten to be
a bit more efficient

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 21:25:49 +00:00
Dan Gohman
d98af0a5b8 Eliminate unnecessary empty string literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:39:08 +00:00
Dan Gohman
dacfc5d37f Fix visitInvokeInst to call visitTerminatorInst, and remove
a redundant check from checkInstruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:09:14 +00:00
Dan Gohman
3768091407 Add Verifier logic for indirectbr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 23:08:33 +00:00
Oscar Fuentes
ee56c42168 Prefix next' iterator operation with llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 06:00:15 +00:00
Benjamin Kramer
ad2b04c07f Preallocate vector, avoid unnecessary vector growth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 11:43:26 +00:00
Dan Gohman
6bbe671e1c Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:56:48 +00:00
Dan Gohman
138aa2a82b Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:12:04 +00:00
Duncan Sands
2c11046fa1 After updating value handles for RAUW, check that no weak or tracking handles
are still on the list.  This might happen if a CallbackVH created some new value
handles for the old value when doing RAUW.  Barf if it occurs, since it is almost
certainly a mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 06:53:14 +00:00
Dan Gohman
b08ba8824e Fix (at least) quadratic worst-case complexity in DominanceFrontier::splitBlock:
don't visit all blocks in the function, and don't iterate over the split blocks'
predecessor lists for each block visited.

Also, remove the special-case test for the entry block. Splitting the entry
block isn't common enough to make this worthwhile.

This fixes a major compile-time bottleneck which is exposed now that
LoopSimplify isn't being redundantly run both before and after
DominanceFrontier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:55:15 +00:00
Dan Gohman
d2d975233d Avoid copying and recopying a std::set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:45:33 +00:00
Dan Gohman
e96a6fe351 Exit a search loop when the search goal is found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:41:45 +00:00
Dan Gohman
1deeaa6467 Fix formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:39:33 +00:00
Benjamin Kramer
82d5baec32 Reduce string trashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 23:18:32 +00:00
Eli Friedman
327f4e4ab2 PR7704: A function is not allowed to return a function; make sure to enforce
this consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 22:58:04 +00:00
Duncan Sands
ffe8c8871a Clarify that if a new value handle is added while dropping value handles
hanging off a value, then the dropping code will intentionally not drop
it too (since this is almost certainly a bug).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 12:09:22 +00:00
Gabor Greif
a399781289 undo 80 column trespassing I caused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 10:37:47 +00:00
Dan Gohman
17aa92c92a Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:38:33 +00:00
Owen Anderson
d13db2c59c Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 22:09:45 +00:00
Dan Gohman
557c83c99e NamedMDNode is never an operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 20:25:43 +00:00
Dan Gohman
872814ae04 Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:54:18 +00:00
Dan Gohman
d9c86dc6d9 Use TrackingVH instead of WeakVH for NamedMDNode's operands, since nodes
referenced by NamedMDNodes shouldn't be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:01:42 +00:00
Dan Gohman
1ec7f5feb3 Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:53:53 +00:00
Owen Anderson
9650983b9a Move the smarts of AnalysisGroup registration into PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 17:52:45 +00:00
Dan Gohman
3bdfbf5d56 Give MDNode printing has access to the current Module in more
cases. This will be needed when function-local metadata can
appear in places that aren't intrinsic function arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:55:01 +00:00
Owen Anderson
539673579e Move the handling of PassRegistrationListener's to PassRegistry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:41:56 +00:00
Dan Gohman
4f1be4abba Rename removeAllMetadata to clearMetadataHashEntries and simplify
it to just do the things that need to be done when an instruction
is deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 22:25:04 +00:00
Dan Gohman
19538d1e9f Add support for remapping metadata kind IDs when reading in a
bitcode file, so that two bitcode files where the same metadata kind
name happens to have been assigned a different ID can still be
linked together.

Eliminate the restriction that metadata kind IDs can't be 0.

Change MD_dbg from 1 to 0, because we can now, and because it's
less mysterious that way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:42:28 +00:00
Owen Anderson
aac07eaeef Move more functionality from Pass.cpp to PassRegistry.cpp. This global will go away eventually, but for now we still need it around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:22:24 +00:00
Dan Gohman
a09e67af33 Remove setDbgMetadata and getDbgMetadata; their users have been
replaced with setDebugLoc and getDebugLoc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 20:18:21 +00:00
Owen Anderson
ee9886ed3d I just fail with SVN today.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 19:23:55 +00:00
Owen Anderson
39b890dfa2 Convert the internal PassRegistrar class into a new, external PassRegistry class. No intended functionality change at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108877 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 18:39:06 +00:00
Owen Anderson
2dcacabc71 Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:55:05 +00:00
Owen Anderson
8be3291f59 Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 08:26:15 +00:00
Owen Anderson
9e081004da Reapply r108794, a fix for the failing test from last time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 06:52:42 +00:00
Daniel Dunbar
e8a469cdb4 Revert r108794, "Separate PassInfo into two classes: a constructor-free
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 03:06:07 +00:00
Owen Anderson
8ba15cb709 Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 01:19:58 +00:00
Owen Anderson
7ee5d35493 Change the implemented interfaces list on PassInfo from a std::vector to a manually implemented
linked list.  This is a little slower and involves more malloc'ing, but these lists are
typically short, and it allows PassInfo to be entirely constant initializable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 21:44:48 +00:00
Duncan Sands
837a0c3b05 Expose BasicBlock::moveBefore and moveAfter in C API, patch
by Benjamin Saunders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 15:31:07 +00:00
Gabor Greif
b68f7aea33 precompute 20 tags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 14:48:15 +00:00
Gabor Greif
aa7e8b27ad fullStopTag cannot happen here, it is handled above
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 20:52:46 +00:00
Chris Lattner
93604b6de2 Fix PR7658, a problem where type refinement can trigger
constant replacement which was botching its handling of
types.  Use of getType() instead of getRawType() was causing
the type map in constant folding to be updated wrong.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:13:52 +00:00
Chris Lattner
40f9be514b tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 21:20:46 +00:00
Chris Lattner
49669e6d3a eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 20:50:13 +00:00
Gabor Greif
345ce549a9 get the first few tags from a precomputed table (count can be increased if desired)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 20:35:19 +00:00
Gabor Greif
a6aac4c5bc eliminate CallInst::ArgOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 09:38:02 +00:00
Tobias Grosser
74c740052a LoopSimplify does not update domfrontier correctly.
This fixes PR7649.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 05:59:45 +00:00
Tobias Grosser
9a7b37b8a3 Add dump() to DominanceFrontier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 05:59:39 +00:00
Benjamin Kramer
38e59891ee Don't pass StringRef by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 22:38:02 +00:00
Dan Gohman
79b78a43ec Just use getParent() instead of getModuleFromVal when the value is a Function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 21:12:44 +00:00
Dan Gohman
40cf12fe77 Rename WriteConstantInt to WriteConstantInternal, to avoid confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 20:57:55 +00:00
Dan Gohman
ac80975ea4 Add support for empty metadata nodes: !{}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:33:27 +00:00
Gabor Greif
63d024fc9a rotate CallInst operands
with this commit the callee moves to the end of
the operand array (from the start) and the call
arguments now start at index 0 (formerly 1)

this ordering is now consistent with InvokeInst

this commit only flips the switch,
functionally it is equivalent to
r101465

I intend to commit several cleanups after a few
days of soak period



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 15:31:36 +00:00
Gabor Greif
a8b9df7bd9 cache dereferenced iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 10:36:48 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Chris Lattner
dfd3626b47 fix PR7311 by avoiding breaking casts when a bitcast from scalar->vector
is involved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 01:19:22 +00:00
Chris Lattner
5a30a8574c make the prototypes for CreateMalloc and CreateFree more consistent. Patch
by Hans Vandierendonck from PR7605


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 00:57:28 +00:00
Nick Lewycky
8e82e3bf59 If it's safe to speculatively execute load(alloca) the it's safe to execute
load(gep(alloca)) where the gep is all-zeros. There's more we could do here but
this is a common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 20:36:29 +00:00
Chris Lattner
b4a9631e55 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 19:42:53 +00:00
Chris Lattner
8fff12605e use PrintEscapedString to handle attribute section with escapes in it,
PR7399.  The asm parser already handles this.  This is of dubious 
utility (see the PR) but the asmprinter was clearly broken here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 23:16:37 +00:00
Devang Patel
6db2389d69 Add fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 21:05:17 +00:00
Dan Gohman
108e3707fa IndirectBr is not safe to speculatively execute (!)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-02 00:35:34 +00:00
Bill Wendling
5e721d7682 Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

      .globl l_objc_msgSend_fixup_alloc
      .weak_definition l_objc_msgSend_fixup_alloc
      .section __DATA, __objc_msgrefs, coalesced
      .align 3
l_objc_msgSend_fixup_alloc:
       .quad   _objc_msgSend_fixup
       .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 21:55:59 +00:00
Gabor Greif
fa680ea1eb reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-01 10:41:37 +00:00
Bill Wendling
07d3177117 Revert r107205 and r107207.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 22:34:52 +00:00
Bill Wendling
207855cff9 Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

       .globl l_objc_msgSend_fixup_alloc
       .weak_definition l_objc_msgSend_fixup_alloc
       .section __DATA, __objc_msgrefs, coalesced
       .align 3
l_objc_msgSend_fixup_alloc:
        .quad   _objc_msgSend_fixup
        .quad   L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 21:24:00 +00:00
Gabor Greif
cfbb7d4329 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 16:17:26 +00:00
Gabor Greif
eff566d19a encode operand initializations (at fixed index)
in terms of Op<> and ArgOffset. This works for
values of {0, 1} for ArgOffset.
Please note that ArgOffset will become 0 soon and
will go away eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-29 11:41:38 +00:00
Dan Gohman
0dd3549edc Constant fold x == undef to undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 21:30:07 +00:00
Dan Gohman
50f424c3d0 Fix Value::stripPointerCasts and BasicAA to avoid trouble on
code in unreachable blocks, which have have use-def cycles.
This fixes PR7514.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 21:16:52 +00:00
Gabor Greif
b37a64a726 use ArgOperand accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 13:56:57 +00:00
Gabor Greif
7bbdf0c848 use ArgOperand accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 13:09:06 +00:00
Gabor Greif
bb6eabf4f5 use helper to neatly access arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 08:45:32 +00:00
Gabor Greif
f2937ac4ed use high-level accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 20:40:38 +00:00
Gabor Greif
07f639fca4 warmup ritual: use high-level argument accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 19:46:37 +00:00
Devang Patel
a762b09310 Use single interface, using twine, to get named metadata.
getNamedMetadata().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 01:19:38 +00:00
Dan Gohman
403a8cdda5 Use A.append(...) instead of A.insert(A.end(), ...) when A is a
SmallVector, and other SmallVector simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 19:47:52 +00:00
Dan Gohman
e407c1d158 Move several non-performance-critical member functinos out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 18:46:45 +00:00
Bob Wilson
54eee524f1 Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19 05:33:57 +00:00
Devang Patel
2f7d5291de Use separate named MDNode to hold each function's local variable info.
This speeds up local variable handling in DwarfDebug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 00:53:55 +00:00
Chris Lattner
2a9a8ae081 improve verifier error about unterminated block to include
function name, patch by Yuri


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-12 15:50:24 +00:00
Bill Wendling
d942df2f9e Another place where the code wanted to access the argument list and not all of
the operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-07 19:18:58 +00:00
Dan Gohman
fdbef823ad getFoldedOffsetOf no longer does anything special with vector types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-05 00:47:34 +00:00
Dan Gohman
2c048ea538 Split the logic behind CastInst::isNoopCast into a separate static function,
as is done with most other cast opcode predicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 21:41:37 +00:00
Dan Gohman
f75a7d3fbf Eliminate the restriction that the array size in an alloca must be i32.
This will help reduce the amount of casting required on 64-bit targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 01:14:11 +00:00
Dan Gohman
30377e7809 Add basic error checking to MemoryBuffer::getSTDIN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 17:31:51 +00:00
Anton Korobeynikov
ded05e34b6 Add support for thiscall calling convention.
Patch by Charles Davis and Steven Watanabe!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-16 09:08:45 +00:00
Evan Cheng
dbf67fefea Adding a v8i64 512-bit vector type. This will be used to model ARM NEON intrinsics which translate into a pair of vld / vst instructions that can load / store 8 consecutive 64-bit (D) registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-13 23:55:47 +00:00
Dan Gohman
d42718080f Revert r103493, materializing functions in the regular PassManager.
It works in simple cases, but it isn't a general solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 20:30:00 +00:00
Dan Gohman
124b55dded Teach the regular pass manager how to materialize functions as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 19:58:43 +00:00
Chris Lattner
601e768845 simplify more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:59:18 +00:00
Chris Lattner
775aba2495 Simplify by using startswith instead of substr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103430 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:58:42 +00:00
Chris Lattner
fd450c026a fix PR7105 by enumerating MDNodes on all @llvm.foo
function calls, not just recognized intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:53:17 +00:00
David Greene
e89f1c4ee7 Fix PR6875:
This includes a patch by Roman Divacky to fix the initial crash.

Move the actual addition of passes from *PassManager::add to
*PassManager::addImpl.  That way, when adding printer passes we won't
recurse infinitely.

Finally, check to make sure that we are actually adding a FunctionPass
to a FunctionPassManager before doing a print before or after it.
Immutable passes are strange in this way because they aren't
FunctionPasses yet they can be and are added to the FunctionPassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-10 20:24:27 +00:00
Dan Gohman
66797ff2e1 Minimally fix this code to not abort on mdnodes with integer data
wider than 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-07 22:15:24 +00:00
Duncan Sands
d29f5282e0 Fix a problem exposed by my previous commit and noticed by a release-asserts
buildbot: the debugging and non-debugging versions of getFunction were not
functionally equivalent: the non-debugging version wrongly assumed that if a
metadata operand was not metadata, then it had a non-null containing function.
This is not true, since the operand might be a global value, constant etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-04 14:25:42 +00:00
Duncan Sands
203f7cb68b Fix a variant of PR6112 found by thinking about it: when doing
RAUW of a global variable with a local variable in function F,
if function local metadata M in function G was using the global
then M would become function-local to both F and G, which is not
allowed.  See the testcase for an example.  Fixed by detecting
this situation and zapping the metadata operand when it occurs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-04 12:43:36 +00:00
Dan Gohman
1eaac53261 Remove the API compatibility layer which converted add, sub, and mul
to fadd, fsub, and fmul, when used with a floating-point type. LLVM
has supported the new instructions since 2.6, so it's time to get
on board.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 22:44:19 +00:00
Nick Lewycky
a75586f37e Fix function prototype mismatch in LLVMUnionType(). Fixes PR7019.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-03 21:36:51 +00:00
Duncan Sands
e704d9d89c Verify metadata harder. In particular, check that module
level metadata does not have any function local operands.
This would have caught the problem found in PR6112.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-29 16:10:30 +00:00
Chris Lattner
f3f325b82f fix PR6112 - When globalopt (or any other pass) does RAUW(@G, %G),
metadata references in non-function-local MDNodes should drop to 
null.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 20:16:12 +00:00
Eric Christopher
6d972fd087 Remove the palignr intrinsics now that we lower them to vector shuffles,
shifts and null vectors. Autoupgrade these to what we'd lower them to.

Add a testcase to exercise this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20 00:59:54 +00:00
Dan Gohman
dfd4bbfdfb Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 15:42:05 +00:00
Eric Christopher
551754c495 Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:37:20 +00:00
Gabor Greif
4ec2258ffb reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 15:33:14 +00:00
Eric Christopher
107ae0ad8b Silence an unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 04:02:04 +00:00
Gabor Greif
607a7ab3da back out r101423 and r101397, they break llvm-gcc self-host on darwin10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 01:16:20 +00:00
Gabor Greif
2ff961f668 reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 20:51:13 +00:00
Dan Gohman
b35798347e Fix a bunch of namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 17:08:50 +00:00
Dan Gohman
098406b42c Fix namespace polution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 16:23:27 +00:00
Gabor Greif
9ee1720811 back out r101364, as it trips the linux nightlybot on some clang C++ tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 12:46:56 +00:00
Gabor Greif
165dac08d1 rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 10:49:53 +00:00
Dan Gohman
7ad3b2a3f0 Move a bunch of methods from CallSite to CallSiteBase, so that they can
be used in ImmutableCallSite too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 21:47:32 +00:00
Nick Lewycky
29efad1d26 Enable RTTI again. While this works fine for LLVM, it creates an ABI
incompatibility with some clients covered by the buildbots, such as llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 05:51:59 +00:00
Nick Lewycky
0a850d6af4 Turn off RTTI for VMCore. Yay!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 05:30:13 +00:00
Nick Lewycky
beba1a31a4 Fix 80 column ruler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101229 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 04:40:35 +00:00
Daniel Dunbar
afc9a0c6b0 VMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms of
Type::getInt{1,8,...}[Ptr]Ty, so code can consistently use the methods on Type
without occasionally needed to call IntegerType::get.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 01:39:07 +00:00
Dan Gohman
3b49063a83 Simplify this code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 22:12:29 +00:00
Chris Lattner
0941534c71 add attributes and module level asm to the ocaml bindings,
patch by Patrick Walton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 17:52:58 +00:00
Dan Gohman
2c8a9f8ad9 Fix a typo and some indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 22:47:25 +00:00