Commit Graph

2779 Commits

Author SHA1 Message Date
Owen Anderson
1f0ba8c57b Forgot to remove some explicit locking when it became implicit in the ValueMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-19 18:34:09 +00:00
Owen Anderson
8e1c17aa5a Move the memory fences out of the path for single-threaded mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-19 17:45:12 +00:00
Owen Anderson
ae60c0f78e Fix incorrect comment pointed out by Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-19 17:20:50 +00:00
Owen Anderson
e454067f97 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 21:35:56 +00:00
Owen Anderson
b2c0fe4d93 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 20:56:48 +00:00
Owen Anderson
3c8031df6d Add a SmartScopedLock, and use it to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 20:51:00 +00:00
Owen Anderson
f0f220a07e Simplify with SmartRWMutex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 20:44:31 +00:00
Owen Anderson
bcf9737f1e Simplify by using no-op-when-not-multithreaded locks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 20:36:21 +00:00
Owen Anderson
6cf69cfdee Simplify using mutexes that become no-ops when not in multithreaded mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 20:15:26 +00:00
Owen Anderson
ee6aefcaa3 Simplify a lot of code by using a R/W mutex that becomes a no-op when multithreading is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 19:10:19 +00:00
Owen Anderson
0e4d606684 Use SmartMutex to simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 18:36:34 +00:00
Owen Anderson
e3cd5ca7e7 Move Threading.[h|cpp] from Support to System.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 16:54:52 +00:00
Owen Anderson
1d36e4fa7c Fix the double checked locking in this file too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 16:17:42 +00:00
Owen Anderson
3cfc62aa08 As pointed out by Duncan, I accidentally dropped the first MemoryFence of the
double-checked locking pattern here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 16:08:27 +00:00
Nick Lewycky
b4b0fc28bc Add braces to clarify if/else structure and remove warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 03:01:42 +00:00
Owen Anderson
bf5ec1b9db Reapply r73647 in a non-broken form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 23:49:06 +00:00
Owen Anderson
a23d2c1262 Use double-checked locking for this lazy initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 22:53:57 +00:00
Owen Anderson
b983d67465 Protect the GC table in Function.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 22:23:31 +00:00
Owen Anderson
de17e9940e Use atomic increment here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 22:01:09 +00:00
Owen Anderson
92f2c87110 Thread-safe (and ManagedStatic-ized) LeakDetector!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 21:56:05 +00:00
Owen Anderson
f005a6466a Guard mutation of the timing info global.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 21:28:54 +00:00
Owen Anderson
f2986e6ca9 We need to use double-checked locking for lazy initialization in this case when running multithreaded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 21:16:20 +00:00
Owen Anderson
32a25568fc Factor out some common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 20:43:39 +00:00
Owen Anderson
dd561e1539 Add an RAII ScopedWriter, which allows one to acquire a writer lock for the duration of a scope. Simplify a lot of uses of
writer locks in Constants.cpp by using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 20:34:43 +00:00
Owen Anderson
31c36f02f2 Simplify the locking on the Constants tables, and make it more efficient, by pushing it into the ValueMap from the callers.
Document those ValueMap functions that are _not_ locked, so that callers are aware that they need to do the locking themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 20:10:08 +00:00
Owen Anderson
3e456abde2 Type safety for Constants.cpp! Some of this is temporary, as I'm planning to push some of the R/W locking into FoldingSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 18:40:29 +00:00
Owen Anderson
f2aac28d30 Protect the ValueHandle table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 17:36:57 +00:00
Owen Anderson
4f0ac58da1 We need to guard reads of the AbstractTypeUsers list, as well as writes to it. While it would be nice to use a R/W lock here,
we can't, because it HAS to be recursive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 17:13:54 +00:00
Owen Anderson
ea808c98d8 Type safety for TypeSymbolTable!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 16:56:27 +00:00
Owen Anderson
142fb2acdd Add locking around the accessors for AbstractTypeUsers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 00:12:30 +00:00
Owen Anderson
845e7e812c Use a reader-writer lock to guard large portions of the Type infrastructure, including abstract type refinement.
There's still some more work to be done here, such as guarding removeAbstractTypeUser() and the printers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16 22:51:18 +00:00
Anton Korobeynikov
385f5a99ec Address review comments: add 3 ARM calling conventions.
Dispatch C calling conv. to one of these conventions based on
target triple and subtarget features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-16 18:50:49 +00:00
Dan Gohman
f57478f381 Use Type::isIntOrIntVector and Type::isFPOrFPVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:25:12 +00:00
Dan Gohman
6de29f8d96 Support vector casts in more places, fixing a variety of assertion
failures.

To support this, add some utility functions to Type to help support
vector/scalar-independent code. Change ConstantInt::get and
ConstantFP::get to support vector types, and add an overload to
ConstantInt::get that uses a static IntegerType type, for
convenience.

Introduce a new getConstant method for ScalarEvolution, to simplify
common use cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-15 22:12:54 +00:00
Dan Gohman
a119de86a0 Fix old-style type names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-14 23:30:43 +00:00
Dan Gohman
194ae785e1 Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.

Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 19:03:05 +00:00
Duncan Sands
d6de30ceea Cosmetic changes to parameter attribute verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-11 08:11:03 +00:00
Jay Foad
757068f3ba Implement and use new method Function::hasAddressTaken().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-10 08:41:11 +00:00
Nick Lewycky
a5f54a06b0 Create FunctionType::isValidArgumentType to go along with isValidReturnType.
Also create isValidElementType for ArrayType, PointerType, StructType and
VectorType.

Make LLParser use them. This closes up some holes like an assertion failure on:

  %x = type {label}

but largely doesn't change any semantics. The only thing we accept now which
we didn't before is vectors of opaque type such as "<4 x opaque>". The opaque
can be resolved to an int or float when linking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 07:26:46 +00:00
Nick Lewycky
dcef849ab0 Remove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
crash LLVM first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-07 04:03:01 +00:00
Devang Patel
578efa920a Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 21:57:13 +00:00
Dan Gohman
f38fd690ad Fix a copy+pasto in an assertion string that Jay Foad noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 18:34:16 +00:00
Dan Gohman
11cc35de41 Update the Verifier to be aware of the difference between Add and FAdd, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:10:00 +00:00
Dan Gohman
ae3a0be92e Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:49:04 +00:00
Devang Patel
d18e31ae17 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:05:33 +00:00
Nick Lewycky
7a0370f66a Give embedded metadata its own type instead of relying on EmptyStructTy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 05:06:04 +00:00
Bill Wendling
51b16f4737 Untabification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 01:09:53 +00:00
Duncan Sands
44008257a4 Dan noticed that the verifier wasn't thoroughly checking uses of
invoke results (see the testcases).  Tighten up the checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-29 19:39:36 +00:00
Nick Lewycky
d67a1666ec Audit the type constructors. Previously it was possible to create [0 x void]
or use labels as members of structures for example. Also included a couple of
whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-25 21:28:11 +00:00
Duncan Sands
d6752d1666 Always verify dominfo if expensive checking is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 08:52:53 +00:00