Owen Anderson
446169df49
Guard the listeners list. Unfortunately, this requires a real static rather
...
than a managed static because other managed statics can (and do) access this
list in their destructors. Yes, I know it's horrible.
llvm-svn: 74029
2009-06-24 00:25:42 +00:00
Owen Anderson
c11dfb46c1
Revert my last series of commits related to Timer and 64-bit atomics. Not all the targets
...
we care about are capable of supporting it.
llvm-svn: 73993
2009-06-23 20:17:22 +00:00
Owen Anderson
c2d02066d0
Atomic ops that do arithmetic use signed arithmetic.
...
llvm-svn: 73980
2009-06-23 18:30:27 +00:00
Owen Anderson
1bea9b9158
Label the existing atomic functions as 32-bit specific, and add a 64-bit one that will be useful in
...
the near future.
llvm-svn: 73971
2009-06-23 18:01:04 +00:00
Nick Lewycky
4020821885
Expand this test to handle more cases (remainder and shifts) of zero.
...
llvm-svn: 73839
2009-06-21 01:56:41 +00:00
Chris Lattner
affcc71da2
implement PR4424: 0/x is always 0 for integer division.
...
llvm-svn: 73835
2009-06-21 01:15:55 +00:00
Owen Anderson
56b666e12a
Forgot this file.
...
llvm-svn: 73802
2009-06-20 00:26:26 +00:00
Owen Anderson
733fa621f6
Revert r73790, and replace it with a significantly less ugly solution. Rather than trying to make the global reader-writer lock work,
...
create separate recursive mutexes for each value map. The recursive-ness fixes the double-acquiring issue, which having one per ValueMap
lets us continue to maintain some concurrency.
llvm-svn: 73801
2009-06-20 00:24:58 +00:00
Owen Anderson
295610c408
Fix a serious bug that would cause deadlock during abstract type refinement. The constant creation
...
gets involved, and we end up trying to recursively acquire a writer lock. The fix for this is slightly horrible,
and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and
unlocked versions of most of the code.
llvm-svn: 73790
2009-06-19 23:16:19 +00:00
Owen Anderson
7f70078b63
Forgot to remove some explicit locking when it became implicit in the ValueMap.
...
llvm-svn: 73778
2009-06-19 18:34:09 +00:00
Owen Anderson
12e12ed0d4
Move the memory fences out of the path for single-threaded mode.
...
llvm-svn: 73775
2009-06-19 17:45:12 +00:00
Owen Anderson
c17c15cb23
Fix incorrect comment pointed out by Duncan.
...
llvm-svn: 73773
2009-06-19 17:20:50 +00:00
Owen Anderson
939dedb16c
Simplify.
...
llvm-svn: 73725
2009-06-18 21:35:56 +00:00
Owen Anderson
06820ef1ca
Simplify.
...
llvm-svn: 73723
2009-06-18 20:56:48 +00:00
Owen Anderson
b7742c5035
Add a SmartScopedLock, and use it to simplify code.
...
llvm-svn: 73722
2009-06-18 20:51:00 +00:00
Owen Anderson
376f7669a3
Simplify with SmartRWMutex.
...
llvm-svn: 73721
2009-06-18 20:44:31 +00:00
Owen Anderson
844cf0aa3f
Simplify by using no-op-when-not-multithreaded locks.
...
llvm-svn: 73719
2009-06-18 20:36:21 +00:00
Owen Anderson
cc8947381f
Simplify using mutexes that become no-ops when not in multithreaded mode.
...
llvm-svn: 73716
2009-06-18 20:15:26 +00:00
Owen Anderson
5d40f51e4e
Simplify a lot of code by using a R/W mutex that becomes a no-op when multithreading is disabled.
...
llvm-svn: 73714
2009-06-18 19:10:19 +00:00
Owen Anderson
377fe286ca
Use SmartMutex to simplify.
...
llvm-svn: 73712
2009-06-18 18:36:34 +00:00
Owen Anderson
a59f91c08d
Move Threading.[h|cpp] from Support to System.
...
llvm-svn: 73707
2009-06-18 16:54:52 +00:00
Owen Anderson
7d2d5c974e
Fix the double checked locking in this file too.
...
llvm-svn: 73703
2009-06-18 16:17:42 +00:00
Owen Anderson
a74e3d8a1c
As pointed out by Duncan, I accidentally dropped the first MemoryFence of the
...
double-checked locking pattern here.
llvm-svn: 73701
2009-06-18 16:08:27 +00:00
Nick Lewycky
bd1de19b3f
Add braces to clarify if/else structure and remove warning.
...
llvm-svn: 73673
2009-06-18 03:01:42 +00:00
Owen Anderson
00e7ebbc38
Reapply r73647 in a non-broken form.
...
llvm-svn: 73662
2009-06-17 23:49:06 +00:00
Owen Anderson
66eb50a125
Use double-checked locking for this lazy initialization.
...
llvm-svn: 73653
2009-06-17 22:53:57 +00:00
Owen Anderson
0e2a78e820
Protect the GC table in Function.cpp
...
llvm-svn: 73647
2009-06-17 22:23:31 +00:00
Owen Anderson
2db8ec3635
Use atomic increment here.
...
llvm-svn: 73643
2009-06-17 22:01:09 +00:00
Owen Anderson
327464c4d3
Thread-safe (and ManagedStatic-ized) LeakDetector!
...
llvm-svn: 73642
2009-06-17 21:56:05 +00:00
Owen Anderson
4874790cb9
Guard mutation of the timing info global.
...
llvm-svn: 73639
2009-06-17 21:28:54 +00:00
Owen Anderson
a4471607bc
We need to use double-checked locking for lazy initialization in this case when running multithreaded.
...
llvm-svn: 73636
2009-06-17 21:16:20 +00:00
Owen Anderson
b43a8ba8e5
Factor out some common code.
...
llvm-svn: 73631
2009-06-17 20:43:39 +00:00
Owen Anderson
f8776799ec
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.
llvm-svn: 73630
2009-06-17 20:34:43 +00:00
Owen Anderson
3bf7bd1297
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.
llvm-svn: 73628
2009-06-17 20:10:08 +00:00
Owen Anderson
fedb566872
Type safety for Constants.cpp! Some of this is temporary, as I'm planning to push some of the R/W locking into FoldingSet.
...
llvm-svn: 73624
2009-06-17 18:40:29 +00:00
Owen Anderson
d7312aff32
Protect the ValueHandle table.
...
llvm-svn: 73620
2009-06-17 17:36:57 +00:00
Owen Anderson
5b8615fcbd
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.
llvm-svn: 73617
2009-06-17 17:13:54 +00:00
Owen Anderson
179a1f49dc
Type safety for TypeSymbolTable!
...
llvm-svn: 73614
2009-06-17 16:56:27 +00:00
Owen Anderson
b34766ddc8
Add locking around the accessors for AbstractTypeUsers.
...
llvm-svn: 73586
2009-06-17 00:12:30 +00:00
Owen Anderson
d1fbbd8273
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.
llvm-svn: 73575
2009-06-16 22:51:18 +00:00
Anton Korobeynikov
cc8d0058e2
Address review comments: add 3 ARM calling conventions.
...
Dispatch C calling conv. to one of these conventions based on
target triple and subtarget features.
llvm-svn: 73530
2009-06-16 18:50:49 +00:00
Dan Gohman
0b9e2dc359
Use Type::isIntOrIntVector and Type::isFPOrFPVector.
...
llvm-svn: 73433
2009-06-15 22:25:12 +00:00
Dan Gohman
2e737ac21f
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.
llvm-svn: 73431
2009-06-15 22:12:54 +00:00
Dan Gohman
111f127d23
Fix old-style type names in comments.
...
llvm-svn: 73362
2009-06-14 23:30:43 +00:00
Dan Gohman
43f66023c3
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.
llvm-svn: 73241
2009-06-12 19:03:05 +00:00
Duncan Sands
9b5e3effef
Cosmetic changes to parameter attribute verification.
...
llvm-svn: 73188
2009-06-11 08:11:03 +00:00
Jay Foad
5affd7b2c9
Implement and use new method Function::hasAddressTaken().
...
llvm-svn: 73164
2009-06-10 08:41:11 +00:00
Nick Lewycky
71dc3c5d85
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.
llvm-svn: 73016
2009-06-07 07:26:46 +00:00
Nick Lewycky
a96000f2bf
Remove cyclic MDNode detection. Any attempt to create a cyclic MDNode will
...
crash LLVM first.
llvm-svn: 73011
2009-06-07 04:03:01 +00:00
Devang Patel
8d170194e8
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.
llvm-svn: 72959
2009-06-05 21:57:13 +00:00