oota-llvm.git
15 years agoFix build when disable thread support.
Owen Anderson [Thu, 18 Jun 2009 04:44:46 +0000 (04:44 +0000)]
Fix build when disable thread support.

Patch by Howard Su.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73680 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoinclude header for uint8_t.
Zhongxing Xu [Thu, 18 Jun 2009 04:11:43 +0000 (04:11 +0000)]
include header for uint8_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73675 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd braces to clarify if/else structure and remove warning.
Nick Lewycky [Thu, 18 Jun 2009 03:01:42 +0000 (03:01 +0000)]
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

15 years ago- Update register allocation hint after coalescing. This is done by the target since...
Evan Cheng [Thu, 18 Jun 2009 02:04:01 +0000 (02:04 +0000)]
- Update register allocation hint after coalescing. This is done by the target since the hint is target dependent. This is important for ARM register pair hints.
- Register allocator should resolve the second part of the hint (register number) before passing it to the target since it knows virtual register to physical register mapping.
- More fixes to get ARM load / store double word working.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73671 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIt looks like nobody is working on PR 4158, so I'm
Dale Johannesen [Thu, 18 Jun 2009 01:07:23 +0000 (01:07 +0000)]
It looks like nobody is working on PR 4158, so I'm
adding a check to catch this case at compile time
instead of quietly generating incorrect code.
That will at least let us identify CBE failures
that are not due to this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73668 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix trailing whitespace from ScalarEvolution::print.
Dan Gohman [Thu, 18 Jun 2009 00:37:45 +0000 (00:37 +0000)]
Fix trailing whitespace from ScalarEvolution::print.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73666 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoARM unified syntax is not specific to ELF; use it for Darwin, too.
Bob Wilson [Thu, 18 Jun 2009 00:36:17 +0000 (00:36 +0000)]
ARM unified syntax is not specific to ELF; use it for Darwin, too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73665 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach ScalarEvolution how to recognize another xor(and(x, C), C) case.
Dan Gohman [Thu, 18 Jun 2009 00:00:20 +0000 (00:00 +0000)]
Teach ScalarEvolution how to recognize another xor(and(x, C), C) case.
If C is a single bit and the and gets analyzed as a truncate and
zero-extend, the xor can be represnted as an add.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73664 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete unnecessary braces.
Dan Gohman [Wed, 17 Jun 2009 23:54:37 +0000 (23:54 +0000)]
Delete unnecessary braces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73663 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReapply r73647 in a non-broken form.
Owen Anderson [Wed, 17 Jun 2009 23:49:06 +0000 (23:49 +0000)]
Reapply r73647 in a non-broken form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73662 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix asm string from MOVi16
Anton Korobeynikov [Wed, 17 Jun 2009 23:43:36 +0000 (23:43 +0000)]
Fix asm string from MOVi16

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73661 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThumb2 instructions are enabled only in unified assembler mode.
Anton Korobeynikov [Wed, 17 Jun 2009 23:43:18 +0000 (23:43 +0000)]
Thumb2 instructions are enabled only in unified assembler mode.
Emit switch directive for it. I have no idea whether this is
requirement for Darwin or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73660 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInstcombine zext(trunc(x) & mask) to x&mask, even if the trunc has
Dan Gohman [Wed, 17 Jun 2009 23:17:05 +0000 (23:17 +0000)]
Instcombine zext(trunc(x) & mask) to x&mask, even if the trunc has
multiple users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73656 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse double-checked locking for this lazy initialization.
Owen Anderson [Wed, 17 Jun 2009 22:53:57 +0000 (22:53 +0000)]
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

15 years agoProtect the GC table in Function.cpp
Owen Anderson [Wed, 17 Jun 2009 22:23:31 +0000 (22:23 +0000)]
Protect the GC table in Function.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73647 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHonour calling convention and attributes of Callee by default.
Anton Korobeynikov [Wed, 17 Jun 2009 22:20:46 +0000 (22:20 +0000)]
Honour calling convention and attributes of Callee by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73646 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse atomic increment here.
Owen Anderson [Wed, 17 Jun 2009 22:01:09 +0000 (22:01 +0000)]
Use atomic increment here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73643 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThread-safe (and ManagedStatic-ized) LeakDetector!
Owen Anderson [Wed, 17 Jun 2009 21:56:05 +0000 (21:56 +0000)]
Thread-safe (and ManagedStatic-ized) LeakDetector!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73642 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGuard mutation of the timing info global.
Owen Anderson [Wed, 17 Jun 2009 21:28:54 +0000 (21:28 +0000)]
Guard mutation of the timing info global.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73639 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWe need to use double-checked locking for lazy initialization in this case when runni...
Owen Anderson [Wed, 17 Jun 2009 21:16:20 +0000 (21:16 +0000)]
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

15 years agoFix link to BasicBlock doxygen documentation in Programmer's Manual
Stefanus Du Toit [Wed, 17 Jun 2009 21:12:26 +0000 (21:12 +0000)]
Fix link to BasicBlock doxygen documentation in Programmer's Manual

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73635 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoVNInfo cleanup.
Lang Hames [Wed, 17 Jun 2009 21:01:20 +0000 (21:01 +0000)]
VNInfo cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73634 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd -disable-output to a bunch of tests that don't care about the output.
Dan Gohman [Wed, 17 Jun 2009 20:56:26 +0000 (20:56 +0000)]
Add -disable-output to a bunch of tests that don't care about the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73633 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis fixes a bug introduced in 72661, which can
Dale Johannesen [Wed, 17 Jun 2009 20:48:23 +0000 (20:48 +0000)]
This fixes a bug introduced in 72661, which can
move loads back past a check that the load address
is valid, see new testcase.  The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer.  It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73632 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFactor out some common code.
Owen Anderson [Wed, 17 Jun 2009 20:43:39 +0000 (20:43 +0000)]
Factor out some common code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73631 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd an RAII ScopedWriter, which allows one to acquire a writer lock for the duration...
Owen Anderson [Wed, 17 Jun 2009 20:34:43 +0000 (20:34 +0000)]
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

15 years agoSimplify the locking on the Constants tables, and make it more efficient, by pushing...
Owen Anderson [Wed, 17 Jun 2009 20:10:08 +0000 (20:10 +0000)]
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

15 years agoAdd debug message about non-local loads being clobbered.
Torok Edwin [Wed, 17 Jun 2009 18:48:18 +0000 (18:48 +0000)]
Add debug message about non-local loads being clobbered.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73625 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoType safety for Constants.cpp! Some of this is temporary, as I'm planning to push...
Owen Anderson [Wed, 17 Jun 2009 18:40:29 +0000 (18:40 +0000)]
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

15 years agoInitial support for some Thumb2 instructions.
Anton Korobeynikov [Wed, 17 Jun 2009 18:13:58 +0000 (18:13 +0000)]
Initial support for some Thumb2 instructions.
Patch by Viktor Kutuzov and Anton Korzh from Access Softek, Inc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73622 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate comments to use doxygen syntax.
Dan Gohman [Wed, 17 Jun 2009 17:51:33 +0000 (17:51 +0000)]
Update comments to use doxygen syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73621 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProtect the ValueHandle table.
Owen Anderson [Wed, 17 Jun 2009 17:36:57 +0000 (17:36 +0000)]
Protect the ValueHandle table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73620 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWe need to guard reads of the AbstractTypeUsers list, as well as writes to it. While...
Owen Anderson [Wed, 17 Jun 2009 17:13:54 +0000 (17:13 +0000)]
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

15 years agoDefine LLVM_NATIVE_ARCH in CMake, so that lli can actually JIT
Douglas Gregor [Wed, 17 Jun 2009 17:01:56 +0000 (17:01 +0000)]
Define LLVM_NATIVE_ARCH in CMake, so that lli can actually JIT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73616 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd RWMutex.cpp to the CMake makefiles
Douglas Gregor [Wed, 17 Jun 2009 17:01:30 +0000 (17:01 +0000)]
Add RWMutex.cpp to the CMake makefiles

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73615 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoType safety for TypeSymbolTable!
Owen Anderson [Wed, 17 Jun 2009 16:56:27 +0000 (16:56 +0000)]
Type safety for TypeSymbolTable!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73614 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake sure that JIT examples link in their appropriate target.
Chris Lattner [Wed, 17 Jun 2009 16:48:44 +0000 (16:48 +0000)]
make sure that JIT examples link in their appropriate target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73613 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove two headers subsumed by TargetSelect.h
Chris Lattner [Wed, 17 Jun 2009 16:45:02 +0000 (16:45 +0000)]
remove two headers subsumed by TargetSelect.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73612 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoswitch to using llvm/Target/TargetSelect.h
Chris Lattner [Wed, 17 Jun 2009 16:42:19 +0000 (16:42 +0000)]
switch to using llvm/Target/TargetSelect.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73611 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a utility header that makes it easy to link in the right set
Chris Lattner [Wed, 17 Jun 2009 16:42:01 +0000 (16:42 +0000)]
Add a utility header that makes it easy to link in the right set
of targets for various purposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73610 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove the Win32 reader-writer lock implementation by making it just a normal
Owen Anderson [Wed, 17 Jun 2009 09:10:42 +0000 (09:10 +0000)]
Improve the Win32 reader-writer lock implementation by making it just a normal
lock.  This is obviously bad, but at least it's threadsafe!  If you know how
to improve this in a pre-Vista friendly well, patches welcome!

Patch by Max Burke.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73607 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix libLTO by #include'ing the initializers for all targets and all asm
Nick Lewycky [Wed, 17 Jun 2009 06:52:10 +0000 (06:52 +0000)]
Fix libLTO by #include'ing the initializers for all targets and all asm
printers.

While I'm here, alphabetize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73606 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago>> What if my global variable was into a different address space than stack?
Sanjiv Gupta [Wed, 17 Jun 2009 06:47:15 +0000 (06:47 +0000)]
>> What if my global variable was into a different address space than stack?
>>
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken.  I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.

assert(New->getType() == getType() &&
        "replaceAllUses of value with new value of different type!");

Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have  a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking

GV->getType()->getAddressSpace() == 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73605 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake CreateFMul forward to CreateFMul, not CreateMul.
Chris Lattner [Wed, 17 Jun 2009 06:31:02 +0000 (06:31 +0000)]
make CreateFMul forward to CreateFMul, not CreateMul.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73603 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix grammaro, and bad indentation.
Nick Lewycky [Wed, 17 Jun 2009 04:23:52 +0000 (04:23 +0000)]
Fix grammaro, and bad indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73602 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix comment.
Mikhail Glushenkov [Wed, 17 Jun 2009 03:10:10 +0000 (03:10 +0000)]
Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73601 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFormatting fix.
Mikhail Glushenkov [Wed, 17 Jun 2009 03:09:39 +0000 (03:09 +0000)]
Formatting fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73600 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCorrect an accidental duplication of the test (patch doesn't handle
Eli Friedman [Wed, 17 Jun 2009 03:05:00 +0000 (03:05 +0000)]
Correct an accidental duplication of the test (patch doesn't handle
creating new files very well).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73599 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR3439: Correct a silly mistake in the SimplifyDemandedUseBits code for
Eli Friedman [Wed, 17 Jun 2009 02:57:36 +0000 (02:57 +0000)]
PR3439: Correct a silly mistake in the SimplifyDemandedUseBits code for
SRem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73598 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRegenerate.
Mikhail Glushenkov [Wed, 17 Jun 2009 02:56:48 +0000 (02:56 +0000)]
Regenerate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73597 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAnother small documentation update.
Mikhail Glushenkov [Wed, 17 Jun 2009 02:56:08 +0000 (02:56 +0000)]
Another small documentation update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73596 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse Doug's new LLVM_NATIVE_ARCH macro in config.h to link in the native
Chris Lattner [Wed, 17 Jun 2009 02:15:40 +0000 (02:15 +0000)]
Use Doug's new LLVM_NATIVE_ARCH macro in config.h to link in the native
target so that the JIT works in LLI, not just the interpreter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73595 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix ScalarEvolution's Xor handling to not assume that an And
Dan Gohman [Wed, 17 Jun 2009 01:22:39 +0000 (01:22 +0000)]
Fix ScalarEvolution's Xor handling to not assume that an And
that gets recognized with a SCEVZeroExtendExpr must be an And
with a low-bits mask. With r73540, this is no longer the case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73594 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not use first actual instruction's location for prologue. The debug wants to skip...
Devang Patel [Wed, 17 Jun 2009 00:48:26 +0000 (00:48 +0000)]
Do not use first actual instruction's location for prologue. The debug wants to skip prologue while setting a breakpoint for the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73592 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate auto-generated configuration files
Douglas Gregor [Wed, 17 Jun 2009 00:43:20 +0000 (00:43 +0000)]
Update auto-generated configuration files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73591 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDefine LLVM_NATIVE_ARCH in llvm/Config/config.h to be the LLVM back end that correspo...
Douglas Gregor [Wed, 17 Jun 2009 00:42:33 +0000 (00:42 +0000)]
Define LLVM_NATIVE_ARCH in llvm/Config/config.h to be the LLVM back end that corresponds to the native executable, but only when that LLVM back end is being built

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73590 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse atomic increment/decrement for reference counting of Type's.
Owen Anderson [Wed, 17 Jun 2009 00:28:49 +0000 (00:28 +0000)]
Use atomic increment/decrement for reference counting of Type's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73588 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd an atomic increment and decrement implementation, which will be used for
Owen Anderson [Wed, 17 Jun 2009 00:13:00 +0000 (00:13 +0000)]
Add an atomic increment and decrement implementation, which will be used for
thread-safe reference counting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73587 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd locking around the accessors for AbstractTypeUsers.
Owen Anderson [Wed, 17 Jun 2009 00:12:30 +0000 (00:12 +0000)]
Add locking around the accessors for AbstractTypeUsers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73586 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove support for building LLVM libraries into "relinked"
Chris Lattner [Tue, 16 Jun 2009 23:00:42 +0000 (23:00 +0000)]
Remove support for building LLVM libraries into "relinked"
object files.  Now we always build LLVM libraries into archives (.a files).

This makes the 'make' build work more like the cmake build, among other
things.  Doing this exposed some latent circular library dependencies, so
I think that llvm-config wasn't quite right for .o files anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73579 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoForgot this file in my last commit.
Owen Anderson [Tue, 16 Jun 2009 22:56:04 +0000 (22:56 +0000)]
Forgot this file in my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73578 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse a reader-writer lock to guard large portions of the Type infrastructure, includin...
Owen Anderson [Tue, 16 Jun 2009 22:51:18 +0000 (22:51 +0000)]
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

15 years agofix a circular dependency between the mips code generator
Chris Lattner [Tue, 16 Jun 2009 22:38:04 +0000 (22:38 +0000)]
fix a circular dependency between the mips code generator
and its asmprinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73573 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the EE bindings to use the proper EE interfaces for creating a JIT.
Chris Lattner [Tue, 16 Jun 2009 22:26:13 +0000 (22:26 +0000)]
Fix the EE bindings to use the proper EE interfaces for creating a JIT.
Calling into createJIT directly creates a circular dependency between libjit and lib ee.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73567 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCMake: Only include LLVM example executables in the build if requested by the user
Douglas Gregor [Tue, 16 Jun 2009 22:25:45 +0000 (22:25 +0000)]
CMake: Only include LLVM example executables in the build if requested by the user

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73566 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest for llvm-gcc patch 73564.
Dale Johannesen [Tue, 16 Jun 2009 22:18:33 +0000 (22:18 +0000)]
Test for llvm-gcc patch 73564.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73565 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAccidentally broke this file.
Owen Anderson [Tue, 16 Jun 2009 20:57:51 +0000 (20:57 +0000)]
Accidentally broke this file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73552 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd newline at end of file.
Owen Anderson [Tue, 16 Jun 2009 20:53:09 +0000 (20:53 +0000)]
Add newline at end of file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73551 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the Win32 implementation, since it doesn't compile pre-Vista.
Owen Anderson [Tue, 16 Jun 2009 20:49:20 +0000 (20:49 +0000)]
Remove the Win32 implementation, since it doesn't compile pre-Vista.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73550 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix #include guards.
Owen Anderson [Tue, 16 Jun 2009 20:26:04 +0000 (20:26 +0000)]
Fix #include guards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73548 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake the test target-neutral
Anton Korobeynikov [Tue, 16 Jun 2009 20:25:25 +0000 (20:25 +0000)]
Make the test target-neutral

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73547 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix/cleanup trailing newlines.
Owen Anderson [Tue, 16 Jun 2009 20:23:05 +0000 (20:23 +0000)]
Fix/cleanup trailing newlines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73546 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a portable wrapper for reader-writer locks.
Owen Anderson [Tue, 16 Jun 2009 20:19:28 +0000 (20:19 +0000)]
Add a portable wrapper for reader-writer locks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73545 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduce new headers whose inclusion forces linking and
Douglas Gregor [Tue, 16 Jun 2009 20:12:29 +0000 (20:12 +0000)]
Introduce new headers whose inclusion forces linking and
initialization of all targets (InitializeAllTargets.h) or assembler
printers (InitializeAllAsmPrinters.h). This is a step toward the
elimination of relinked object files, so that we can build normal
archives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73543 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGeneralize a few more instcombines to be vector/scalar-independent.
Dan Gohman [Tue, 16 Jun 2009 19:55:29 +0000 (19:55 +0000)]
Generalize a few more instcombines to be vector/scalar-independent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73541 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInstcombine's ShrinkDemandedConstant may strip bits out of constants,
Dan Gohman [Tue, 16 Jun 2009 19:52:01 +0000 (19:52 +0000)]
Instcombine's ShrinkDemandedConstant may strip bits out of constants,
obscuring what would otherwise be a low-bits mask.  Use ComputeMaskedBits
to compute what ShrinkDemandedConstant knew about to reconstruct a
low-bits mask value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73540 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCALL64pcrel32 immediate field is 32-bit. Patch by Abhinav Duggal.
Evan Cheng [Tue, 16 Jun 2009 19:44:27 +0000 (19:44 +0000)]
CALL64pcrel32 immediate field is 32-bit. Patch by Abhinav Duggal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73536 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAddress review comments: add 3 ARM calling conventions.
Anton Korobeynikov [Tue, 16 Jun 2009 18:50:49 +0000 (18:50 +0000)]
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

15 years agoGNU as refuses to assemble "pop {}" instruction. Do not emit such
Anton Korobeynikov [Tue, 16 Jun 2009 18:49:08 +0000 (18:49 +0000)]
GNU as refuses to assemble "pop {}" instruction. Do not emit such
(this is the case when we have thumb vararg function with single
callee-saved register, which is handled separately).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73529 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a configure check for pthread_rwlock_init.
Owen Anderson [Tue, 16 Jun 2009 18:20:20 +0000 (18:20 +0000)]
Add a configure check for pthread_rwlock_init.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73523 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate the threading section to reflect current plans/implementation.
Owen Anderson [Tue, 16 Jun 2009 18:04:19 +0000 (18:04 +0000)]
Update the threading section to reflect current plans/implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73521 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Threading.cpp to the CMake project files
Douglas Gregor [Tue, 16 Jun 2009 17:45:38 +0000 (17:45 +0000)]
Add Threading.cpp to the CMake project files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73516 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix validation errors.
Owen Anderson [Tue, 16 Jun 2009 17:40:28 +0000 (17:40 +0000)]
Fix validation errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73515 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit the thread-related APIs out into their own file, and add a few more
Owen Anderson [Tue, 16 Jun 2009 17:33:51 +0000 (17:33 +0000)]
Split the thread-related APIs out into their own file, and add a few more
calls for convenience.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73512 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTestcase for r73506
Chris Lattner [Tue, 16 Jun 2009 17:23:25 +0000 (17:23 +0000)]
Testcase for r73506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73508 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGeneralize instcombine's isSafeToLoadUnconditionally() function
Chris Lattner [Tue, 16 Jun 2009 17:23:12 +0000 (17:23 +0000)]
Generalize instcombine's isSafeToLoadUnconditionally() function
to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes.  Patch by Frits van Bommel!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73506 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded missing libcalls for floating point to int conversions.
Sanjiv Gupta [Tue, 16 Jun 2009 16:17:35 +0000 (16:17 +0000)]
Added missing libcalls for floating point to int conversions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73491 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the "llvm.umul.with.overflow is broken" warning; it should be
Eli Friedman [Tue, 16 Jun 2009 10:24:13 +0000 (10:24 +0000)]
Remove the "llvm.umul.with.overflow is broken" warning; it should be
essentially working now, at least for common cases, and it shouldn't
silently generate bad code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73484 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed names of libcalls checked in r73480.
Sanjiv Gupta [Tue, 16 Jun 2009 10:22:58 +0000 (10:22 +0000)]
Fixed names of libcalls checked in r73480.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73483 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCode Restructuring. No functionality change.
Sanjiv Gupta [Tue, 16 Jun 2009 09:45:18 +0000 (09:45 +0000)]
Code Restructuring. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73481 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded required libcalls for PIC16 (mostly floating points to integer casting operations).
Sanjiv Gupta [Tue, 16 Jun 2009 09:03:58 +0000 (09:03 +0000)]
Added required libcalls for PIC16 (mostly floating points to integer casting operations).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73480 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename RemoveCopiesFromValNo to TurnCopiesFromValNoToImpDefs.
Evan Cheng [Tue, 16 Jun 2009 07:15:05 +0000 (07:15 +0000)]
Rename RemoveCopiesFromValNo to TurnCopiesFromValNoToImpDefs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73479 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIf a val# is defined by an implicit_def and it is being removed, all of the copies...
Evan Cheng [Tue, 16 Jun 2009 07:12:58 +0000 (07:12 +0000)]
If a val# is defined by an implicit_def and it is being removed, all of the copies off the val# were removed. This causes problem later since the scavenger will see uses of registers without defs. The proper solution is to change the copies into implicit_def's instead.

TurnCopyIntoImpDef turns a copy into implicit_def and remove the val# defined by it. This causes an scavenger assertion later if the def reaches other blocks. Disable the transformation if the value live interval extends beyond its def block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73478 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some generic expansion logic for SMULO and UMULO. Fixes UMULO
Eli Friedman [Tue, 16 Jun 2009 06:58:29 +0000 (06:58 +0000)]
Add some generic expansion logic for SMULO and UMULO.  Fixes UMULO
support for x86, and UMULO/SMULO for many architectures, including PPC
(PR4201), ARM, and Cell. The resulting expansion isn't perfect, but it's
not bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73477 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMisc accumulated tweaks to legalization logic for various targets.
Eli Friedman [Tue, 16 Jun 2009 06:40:59 +0000 (06:40 +0000)]
Misc accumulated tweaks to legalization logic for various targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73476 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoanother xform that is target-independent (should be done in instcombine).
Chris Lattner [Tue, 16 Jun 2009 06:15:56 +0000 (06:15 +0000)]
another xform that is target-independent (should be done in instcombine).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73472 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoI think instcombine should unconditionally do this xform.
Chris Lattner [Tue, 16 Jun 2009 06:11:35 +0000 (06:11 +0000)]
I think instcombine should unconditionally do this xform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73471 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR4336: Iterating over use-def chains doesn't seem to be deterministic.
Chris Lattner [Tue, 16 Jun 2009 05:15:21 +0000 (05:15 +0000)]
Fix PR4336: Iterating over use-def chains doesn't seem to be deterministic.

The problem was that BitcodeReader::materializeModule would read functions
from the bc file in densemap pointer key order (doubly non-deterministic!),
which would cause the use-def chains to be set up for globals in
non-determinstic order.  Non-determinstic use/def chains can cause
nondeterminism in many places down-stream.

Many thanks to Julien Lerouge for putting together the pass in the PR that
shows the issue!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73470 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThere doesn't seem to be a reason to move the save FP stuff.
Bill Wendling [Tue, 16 Jun 2009 04:12:45 +0000 (04:12 +0000)]
There doesn't seem to be a reason to move the save FP stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73468 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe DWARF to compact encoding converter assumes that the DW_CFA_def_cfa_offset
Bill Wendling [Tue, 16 Jun 2009 04:06:15 +0000 (04:06 +0000)]
The DWARF to compact encoding converter assumes that the DW_CFA_def_cfa_offset
comes after the DW_CFA_def_cfa_register, because the CFA is really ESP from the
start of the function and only gets an offset when the "subl $xxx,%esp"
instruction happens, not the other way around.

And reapply r72898:

The DWARF unwind info was incorrect. While compiling with
`-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a
lot of function, and then they would be `0'. The linker (at least on Darwin)
needs to encode the stack size. In some cases, the stack size is too large to
directly encode. So the linker checks to see if there is a "subl $xxx,%esp"
instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If
so, the compact encoding records the offset in the function to where the stack
size is embedded. But because the `DW_CFA_advance_loc' instructions are missing,
it looks before the function and dies.

So, instead of emitting the EH debug label before the stack adjustment
operations, emit it afterwards, right before the frame move stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73465 91177308-0d34-0410-b5e6-96231b3b80d8