Commit Graph

2963 Commits

Author SHA1 Message Date
Devang Patel f7188325ef Now Bitcode reader bug is fixed. Reapply 80839.
Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80868
2009-09-03 01:39:20 +00:00
Gabor Greif 14dfba6d66 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Devang Patel c180029be4 Revert 80839 for now. It causes test failures.
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel 36309cd391 Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80839
2009-09-02 21:22:09 +00:00
Torok Edwin 82131d6ad7 Opaque types didn't work if llvm_is_multithreaded().
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.

llvm-svn: 80780
2009-09-02 12:23:05 +00:00
Torok Edwin 18e03dd70c Fix DbgStopPointInst->getFileName/getDirectory, broken by the MDNodification in
r80406, and readd a -print-dbginfo test.

llvm-svn: 80778
2009-09-02 11:13:56 +00:00
Sandeep Patel 68c5f477fa Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Devang Patel 8c7f86e698 For now disable MDNode uniquing. This fixes llvm-gcc bootstrap failure on certain Mac OS X 10.5. I am working on a proper fix.
llvm-svn: 80738
2009-09-01 23:56:42 +00:00
Torok Edwin d18e668fbc Free the constants that have no uses in ~LLVMContext.
This fixes leaks from LLVMContext in multithreaded apps.
Since constants are only deleted if they have no uses, it is safe to not delete
a Module on shutdown, as many single-threaded tools do.
Multithreaded apps should however delete the Module before destroying the
Context to ensure that there are no leaks (assuming they use a different context
for each thread).

llvm-svn: 80590
2009-08-31 16:14:59 +00:00
Dan Gohman 062d378603 Cleanup whitespace and indentation.
llvm-svn: 80451
2009-08-29 23:35:16 +00:00
Dan Gohman 07d0a55a9b Remove some unused fields.
llvm-svn: 80450
2009-08-29 23:34:14 +00:00
Devang Patel 80ae34974b Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Dan Gohman 4ce5ade09d Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
llvm-svn: 80265
2009-08-27 17:55:13 +00:00
Devang Patel 7b8f61f3c8 Remove an entry from ValueMap before removing elements.
llvm-svn: 80247
2009-08-27 15:32:38 +00:00
Devang Patel f08e35d9dc Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Dale Johannesen 2aaf539564 Add an 'inline hint' attribute to represent source
code hints that it would be a good idea to inline
a function ("inline" keyword).  No functional change
yet; FEs do not emit this and inliner does not use it.

llvm-svn: 80063
2009-08-26 01:08:21 +00:00
Dan Gohman e5af8cd13b Fix the InsertAtEnd form of ShuffleVectorInst constructor to use
the correct type.

llvm-svn: 80050
2009-08-25 23:27:45 +00:00
Dan Gohman ad1f0a1101 Eliminate the unused Context argument on one of the ICmpInst and FCmpInst
constructors.

llvm-svn: 80049
2009-08-25 23:17:54 +00:00
Dan Gohman faf516f34d Use covariant return types for Instruction::clone, and eliminate
the forms of ExtractElementInst and InsertElementInst that are
equivalent to clone.

llvm-svn: 80041
2009-08-25 22:29:08 +00:00
Dan Gohman 23d2c76f31 This should use isIndenticalToWhenDefined.
llvm-svn: 80039
2009-08-25 22:24:20 +00:00
Dan Gohman c8a27f2a5c Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!

llvm-svn: 80038
2009-08-25 22:11:20 +00:00
Dan Gohman 97d2cb8394 Allocate the basic types inside the LLVMContextImpl instance,
rather than separately with new. Move the members above the
TypeMap members to avoid destruction order issues. This fixes
a leak of these objects, and eliminates an extra level of
indirection in Type::getInt32Ty and friends.

llvm-svn: 79997
2009-08-25 16:00:35 +00:00
Devang Patel 02aac922b4 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Benjamin Kramer 1a25d733f9 Kill off more cerr/cout uses and prune includes a bit.
llvm-svn: 79852
2009-08-23 11:37:21 +00:00
Chris Lattner 1362602eb2 Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Chris Lattner b1d782bec9 eliminate the std::ostream form of WriteAsOperand and update clients.
This also updates dominator related stuff.

llvm-svn: 79825
2009-08-23 05:17:37 +00:00
Chris Lattner 3924bb5792 remove the std::ostream version of module and type printing.
llvm-svn: 79823
2009-08-23 04:52:46 +00:00
Chris Lattner 34822f6ec7 remove some DOUTs
llvm-svn: 79821
2009-08-23 04:44:11 +00:00
Chris Lattner b25de3ff60 eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.

llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Owen Anderson 3fb4aabc06 Use standard LLVM-style headers.
llvm-svn: 79817
2009-08-23 04:24:24 +00:00
Chris Lattner 78683a7013 switch a couple things off std::ostream
llvm-svn: 79816
2009-08-23 04:02:03 +00:00
Chris Lattner 213a9f933d switch from std::ostream to raw ostream, fix file header.
llvm-svn: 79815
2009-08-23 03:56:06 +00:00
Owen Anderson c1a3a471c4 Reduce contention on the Attributes lock by using atomic operations for reference counting rather than locking.
llvm-svn: 79560
2009-08-20 19:03:20 +00:00
Dan Gohman 16f5415f5b Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Daniel Dunbar cb13b48969 Add a fast path for setName("") on an unnamed value.
llvm-svn: 79492
2009-08-19 23:37:23 +00:00
Owen Anderson d6f7af652e AttrListPtr operations need to be atomic.
llvm-svn: 79486
2009-08-19 22:58:34 +00:00
Daniel Dunbar 948f82b8e4 Change ValueSymbolTable to use raw_svector_ostream for string concatenation.
llvm-svn: 79449
2009-08-19 19:22:52 +00:00
Owen Anderson 6d549d6450 Reapply my less-lock-contention-in-leak-detector patch, now with new files
actually added.

llvm-svn: 79429
2009-08-19 17:07:46 +00:00
Daniel Dunbar acf0b258de Make a SmallVector size more reasonable.
llvm-svn: 79403
2009-08-19 05:08:06 +00:00
Owen Anderson 077df2c4ce Revert my last patch temporarily.
llvm-svn: 79388
2009-08-19 00:52:13 +00:00
Owen Anderson 3042539089 Privatize part of the leak detector mechanism, which turned out to be heavily contended
when trying to run opt in parallel.  This lets parallel opt crunch 403.gcc in about a third
of the time.

llvm-svn: 79387
2009-08-19 00:37:02 +00:00
Owen Anderson e8f2185a2f Privatize the ValueHandle global map. Because this is used so heavily throughout the code base, locking all accesses to
it is not practical performance-wise.

llvm-svn: 79355
2009-08-18 18:28:58 +00:00
Devang Patel c6faffde6c Add prefix only if it is needed.
llvm-svn: 79289
2009-08-17 23:17:17 +00:00
Owen Anderson 9801560ace Privatize the last bits of static type state.
llvm-svn: 79258
2009-08-17 17:59:35 +00:00
Owen Anderson 286b3af6ae Move the TypeMap lock to a member on LLVMContextImpl.
llvm-svn: 79256
2009-08-17 17:34:27 +00:00
Owen Anderson d91e6b097d Add locking around the attributes list.
llvm-svn: 79255
2009-08-17 17:10:58 +00:00
Chris Lattner ee97b8b11c the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Dan Gohman d04f9bf01a Fix printing of instructions with null operands.
llvm-svn: 79243
2009-08-17 15:28:08 +00:00
Dan Gohman d0cc3f31c0 Always print at least one space before adding a comment.
llvm-svn: 79242
2009-08-17 15:27:30 +00:00
Erick Tryzelaar dd99135721 Expose creating constant ints and floats from strings in llvm-c.
llvm-svn: 79213
2009-08-16 23:36:46 +00:00