oota-llvm.git
15 years agoGraduate LLVM to the big leagues by embedding a LISP processor into TableGen.
David Greene [Thu, 14 May 2009 22:38:31 +0000 (22:38 +0000)]
Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.

Ok, not really, but do support some common LISP functions:

* car
* cdr
* null

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

15 years agoImplement a !foreach operator analogous to GNU make's $(foreach).
David Greene [Thu, 14 May 2009 22:23:47 +0000 (22:23 +0000)]
Implement a !foreach operator analogous to GNU make's $(foreach).
Use it on dags and lists like this:

class decls {
  string name;
}

def Decls : decls;

class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>;

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

15 years agoImplement a !subst operation simmilar to $(subst) in GNU make to do
David Greene [Thu, 14 May 2009 21:54:42 +0000 (21:54 +0000)]
Implement a !subst operation simmilar to $(subst) in GNU make to do
def/var/string substitution on generic pattern templates.  For example:

def Type;
def v4f32 : Type;
def TYPE : Type;

class GenType<Type t> {
  let type = !(subst TYPE, v4f32, t);
}

def TheType : GenType<TYPE>;

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

15 years agoDropped this #include by accident.
Owen Anderson [Thu, 14 May 2009 21:33:57 +0000 (21:33 +0000)]
Dropped this #include by accident.

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

15 years agoMake ManagedStatic threadsafe by using atomic operations.
Owen Anderson [Thu, 14 May 2009 21:26:50 +0000 (21:26 +0000)]
Make ManagedStatic threadsafe by using atomic operations.

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

15 years agoAdd CompareAndSwap.
Owen Anderson [Thu, 14 May 2009 21:24:15 +0000 (21:24 +0000)]
Add CompareAndSwap.

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

15 years agoImplement !cast.
David Greene [Thu, 14 May 2009 21:22:49 +0000 (21:22 +0000)]
Implement !cast.

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

15 years agoOperation Enhancements
David Greene [Thu, 14 May 2009 20:54:48 +0000 (20:54 +0000)]
Operation Enhancements

Create an OpInit class to serve as a base for all operation Inits.

Move parsing of operation constructs to separate functions and reference
from multiple places.

Add some commented out new operations.  Coming soon.

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

15 years agoFix PR4207.
David Greene [Thu, 14 May 2009 20:38:52 +0000 (20:38 +0000)]
Fix PR4207.

If we're resolving a list element access and we're given a VarInit,
return a new VarListElementInit referencing the VarInit.

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

15 years agoDown with static variables!
Owen Anderson [Thu, 14 May 2009 19:17:24 +0000 (19:17 +0000)]
Down with static variables!

Part one of many.

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

15 years agoTag blocks with DW_AT_APPLE_block.
Mike Stump [Thu, 14 May 2009 18:45:49 +0000 (18:45 +0000)]
Tag blocks with DW_AT_APPLE_block.

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

15 years agoReuse existing getUnderlyingObject instead of
Dale Johannesen [Thu, 14 May 2009 18:41:18 +0000 (18:41 +0000)]
Reuse existing getUnderlyingObject instead of
adding another copy.

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

15 years agoNon-functionality changes:
Bill Wendling [Thu, 14 May 2009 18:26:15 +0000 (18:26 +0000)]
Non-functionality changes:

- Reformatting.
- Use while() instead of do-while().
- Move simple constructors into .h file.

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

15 years agoClean up this file fixing 80-column violations, bad formatting, etc. No functionality...
Bill Wendling [Thu, 14 May 2009 18:16:46 +0000 (18:16 +0000)]
Clean up this file fixing 80-column violations, bad formatting, etc. No functionality change.

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

15 years agoRevert r71744. I must not have understood this correctly, because the
Bob Wilson [Thu, 14 May 2009 18:08:41 +0000 (18:08 +0000)]
Revert r71744.  I must not have understood this correctly, because the
assertion is failing for some tests.

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

15 years agoUse abs64 in one more place.
Dale Johannesen [Thu, 14 May 2009 16:47:34 +0000 (16:47 +0000)]
Use abs64 in one more place.

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

15 years agoclean up line-wrapping
Jim Grosbach [Thu, 14 May 2009 15:44:15 +0000 (15:44 +0000)]
clean up line-wrapping

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

15 years agoAdd an Atomic.h to the System library, for providing a platform independent API
Owen Anderson [Thu, 14 May 2009 05:54:36 +0000 (05:54 +0000)]
Add an Atomic.h to the System library, for providing a platform independent API
to low-level sync operations.

The only one present at the moment is MemoryFence(), and only for the platforms
for which I could easily discern the proper way to do it.  If your favorite platform
isn't represented, patches are welcome!

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

15 years agoFix for PR4124. Make TwoAddressFormPass::FindLastUseInMBB return the real last use.
Lang Hames [Thu, 14 May 2009 04:26:30 +0000 (04:26 +0000)]
Fix for PR4124. Make TwoAddressFormPass::FindLastUseInMBB return the real last use.

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

15 years agoUpdate the names of the exception handling sjlj instrinsics to
Jim Grosbach [Thu, 14 May 2009 00:46:35 +0000 (00:46 +0000)]
Update the names of the exception handling sjlj instrinsics to
llvm.eh.sjlj.* for better clarity as to their purpose and scope. Add
a description of llvm.eh.sjlj.setjmp to ExceptionHandling.html.
(llvm.eh.sjlj.longjmp documentation coming when that implementation is
added).

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

15 years agoAdd an assert to turn a segfault on an unsupported inline
Dan Gohman [Thu, 14 May 2009 00:30:16 +0000 (00:30 +0000)]
Add an assert to turn a segfault on an unsupported inline
asm construct into an assertion failure.

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

15 years agoAdd dumping support for DW_AT_APPLE_isa and DW_AT_APPLE_block.
Mike Stump [Thu, 14 May 2009 00:03:51 +0000 (00:03 +0000)]
Add dumping support for DW_AT_APPLE_isa and DW_AT_APPLE_block.
Radar 6867696

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

15 years agoThere's yet more ugliness (surprise!) in DebugInfo. This needs major reworking.
Bill Wendling [Wed, 13 May 2009 23:55:49 +0000 (23:55 +0000)]
There's yet more ugliness (surprise!) in DebugInfo. This needs major reworking.

Basically, there was a situation where it was getting an empty vector and doing
a .back() on that. Which isn't cool.

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

15 years agoThe IfConverter::MergeBlocks method appears to be used only to merge a basic
Bob Wilson [Wed, 13 May 2009 23:54:13 +0000 (23:54 +0000)]
The IfConverter::MergeBlocks method appears to be used only to merge a basic
block with its unique predecessor.  Change the code to assert if that is not
the case, instead of trying to handle situations where the block has
multiple predecessors.

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

15 years agoRemoving the HasBuiltinSetjmp flag and associated bits. Flagging the presence
Jim Grosbach [Wed, 13 May 2009 23:50:53 +0000 (23:50 +0000)]
Removing the HasBuiltinSetjmp flag and associated bits. Flagging the presence
of exception handling builtin sjlj targets in functions turns out not to
be necessary. Marking the intrinsic implementation in the .td file as
defining all registers is sufficient to get the context saved properly by
the containing function.

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

15 years agoRevert a portion of Dan's change r71018 that I'm convinced is wrong.
Bob Wilson [Wed, 13 May 2009 23:48:58 +0000 (23:48 +0000)]
Revert a portion of Dan's change r71018 that I'm convinced is wrong.
Dan was trying to catch the case where a basic block ends with a conditional
branch to the fall-through block.  In this case, all the instructions have
been moved out of FromBBI, leaving it empty.  It cannot end with a
conditional branch.  As the existing comment indicates, it will always fall
through to the next block.  If the block already had the next block (NBB)
listed as a successor, the preceding loop has a check for that and does not
remove it.  Thus, we need to check and add the successor only when it is
not already listed.

With Dan's change, the empty block often ends up with the fall-through
successor listed twice.  This exposed the problem in pr4195, where
CodePlacementOpt did not handle the same predecessor listed more than once.
It is also at least partially responsible for pr4202 and probably a similar
issue with Thumb branches being out of range.

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

15 years agoMerge adjacent conditional.
Bob Wilson [Wed, 13 May 2009 23:35:38 +0000 (23:35 +0000)]
Merge adjacent conditional.

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

15 years agoRemove an unused variable.
Bob Wilson [Wed, 13 May 2009 23:31:30 +0000 (23:31 +0000)]
Remove an unused variable.

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

15 years agoFix some typos and spelling and grammar, mostly in comments, but also one
Bob Wilson [Wed, 13 May 2009 23:25:24 +0000 (23:25 +0000)]
Fix some typos and spelling and grammar, mostly in comments, but also one
field name.  No functional changes.

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

15 years agoFix whitespacing (space after switch).
Mike Stump [Wed, 13 May 2009 23:23:20 +0000 (23:23 +0000)]
Fix whitespacing (space after switch).

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

15 years agoSpelling correction s/builting/builtin/ and remove trailing whitespace in a few places
Jim Grosbach [Wed, 13 May 2009 22:32:43 +0000 (22:32 +0000)]
Spelling correction s/builting/builtin/ and remove trailing whitespace in a few places

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

15 years agoAdd nounwind to this test.
Dan Gohman [Wed, 13 May 2009 22:29:12 +0000 (22:29 +0000)]
Add nounwind to this test.

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

15 years agoRemove too large testcase.
Bill Wendling [Wed, 13 May 2009 21:51:26 +0000 (21:51 +0000)]
Remove too large testcase.

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

15 years agoRun code placement optimization for targets that want it (arm and x86 for now).
Evan Cheng [Wed, 13 May 2009 21:42:09 +0000 (21:42 +0000)]
Run code placement optimization for targets that want it (arm and x86 for now).

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

15 years agoIndentation.
Evan Cheng [Wed, 13 May 2009 21:39:20 +0000 (21:39 +0000)]
Indentation.

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

15 years agoChange MachineInstrBuilder::addReg() to take a flag instead of a list of
Bill Wendling [Wed, 13 May 2009 21:33:08 +0000 (21:33 +0000)]
Change MachineInstrBuilder::addReg() to take a flag instead of a list of
booleans. This gives a better indication of what the "addReg()" is
doing. Remembering what all of those booleans mean isn't easy, especially if you
aren't spending all of your time in that code.

I took Jakob's suggestion and made it illegal to pass in "true" for the
flag. This should hopefully prevent any unintended misuse of this (by reverting
to the old way of using addReg()).

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

15 years agoHandle some additonal cases of external weak globals.
Dale Johannesen [Wed, 13 May 2009 20:55:30 +0000 (20:55 +0000)]
Handle some additonal cases of external weak globals.

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

15 years agoMove the bookkeeping of the debug scopes back to the place where it
Bill Wendling [Wed, 13 May 2009 20:33:33 +0000 (20:33 +0000)]
Move the bookkeeping of the debug scopes back to the place where it
belonged. The variable declaration stuff wasn't happy with it where it
was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it
successfully.

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

15 years agoTestcase for 71688.
Dale Johannesen [Wed, 13 May 2009 18:33:24 +0000 (18:33 +0000)]
Testcase for 71688.

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

15 years agoDon't generate a select whose operand is load of a weak
Dale Johannesen [Wed, 13 May 2009 18:25:07 +0000 (18:25 +0000)]
Don't generate a select whose operand is load of a weak
external.  These may have address 0 and are not safe
to execute unconditionally.

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

15 years agogarbage allocation is not a good idea :)
Chris Lattner [Wed, 13 May 2009 18:02:09 +0000 (18:02 +0000)]
garbage allocation is not a good idea :)

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

15 years agoPEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standard
John Mosby [Wed, 13 May 2009 17:52:11 +0000 (17:52 +0000)]
PEI: rename PEI.h to PrologEpilogInserter.h to adhere to file naming standard

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

15 years agocalls in nothrow functions can be marked nothrow even if the callee
Chris Lattner [Wed, 13 May 2009 17:39:14 +0000 (17:39 +0000)]
calls in nothrow functions can be marked nothrow even if the callee
is not known to be nothrow.  This allows readnone/readonly functions
to be deleted even if we don't know whether the callee can throw.

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

15 years agoRun through the list of globals once and sectionize all types of globlas includeing...
Sanjiv Gupta [Wed, 13 May 2009 15:13:17 +0000 (15:13 +0000)]
Run through the list of globals once and sectionize all types of globlas includeing declarations. Later emit them from their section lists.

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

15 years agoFix typo.
Duncan Sands [Wed, 13 May 2009 13:13:18 +0000 (13:13 +0000)]
Fix typo.

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

15 years agoAvoid getting a compiler warning
Duncan Sands [Wed, 13 May 2009 12:52:44 +0000 (12:52 +0000)]
Avoid getting a compiler warning
 IVUsers.cpp: In member function â€˜bool llvm::IVUsers::AddUsersIfInteresting(llvm::Instruction*)’:
 IVUsers.cpp:221: warning: â€˜isSigned’ may be used uninitialized in this function
with gcc-4.3.

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

15 years agoadd IVUsers.cpp
Chris Lattner [Wed, 13 May 2009 06:28:04 +0000 (06:28 +0000)]
add IVUsers.cpp

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

15 years agoadd ShrinkWrapping.cpp
Chris Lattner [Wed, 13 May 2009 06:27:38 +0000 (06:27 +0000)]
add ShrinkWrapping.cpp

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

15 years agoFix PR4206 - crash in simplify lib calls
Chris Lattner [Wed, 13 May 2009 06:26:11 +0000 (06:26 +0000)]
Fix PR4206 - crash in simplify lib calls

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

15 years agoFix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regB
Lang Hames [Wed, 13 May 2009 04:18:47 +0000 (04:18 +0000)]
Fix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regB
operand was killed, the kill needs to be removed from regB's VarInfo.

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

15 years agoAdd three new helper routines, getNoopOrZeroExtend,
Dan Gohman [Wed, 13 May 2009 03:46:30 +0000 (03:46 +0000)]
Add three new helper routines, getNoopOrZeroExtend,
getNoopOrSignExtend, and getTruncateOrNoop. These are similar
to getTruncateOrZeroExtend etc., except that they assert that
the conversion is either not widening or narrowing, as
appropriate. These will be used in some upcoming fixes.

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

15 years agoAdd an int64_t variant of abs, for host environments
Dale Johannesen [Wed, 13 May 2009 00:24:22 +0000 (00:24 +0000)]
Add an int64_t variant of abs, for host environments
without one.  Use it where we were using abs on
int64_t objects.
(I strongly suspect the casts to unsigned in the
fragments in LoopStrengthReduce are not doing whatever
the original intent was, but the obvious change to
uint64_t doesn't work.  Maybe later.)

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

15 years agoAdd support for GCC compatible builtin setjmp and longjmp intrinsics. This is
Jim Grosbach [Tue, 12 May 2009 23:59:14 +0000 (23:59 +0000)]
Add support for GCC compatible builtin setjmp and longjmp intrinsics. This is
a supporting preliminary patch for GCC-compatible SjLJ exception handling. Note that these intrinsics are not designed to be invoked directly by the user, but
rather used by the front-end as target hooks for exception handling.

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

15 years agoIf header of inner loop is aligned, do not align the outer loop header. We don't...
Evan Cheng [Tue, 12 May 2009 23:58:14 +0000 (23:58 +0000)]
If header of inner loop is aligned, do not align the outer loop header. We don't want to add nops in the outer loop for the sake of aligning the inner loop.

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

15 years agoTeach TransferDeadness to delete truly dead instructions if they do not produce side...
Evan Cheng [Tue, 12 May 2009 23:07:00 +0000 (23:07 +0000)]
Teach TransferDeadness to delete truly dead instructions if they do not produce side effects.

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

15 years agoSlightly improve generated code in a degenerate case.
Dale Johannesen [Tue, 12 May 2009 22:32:29 +0000 (22:32 +0000)]
Slightly improve generated code in a degenerate case.
Should remove a warning from MSVC.

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

15 years agocorrect register class for tADDspi to GPR since the register will always be SP
Jim Grosbach [Tue, 12 May 2009 22:30:18 +0000 (22:30 +0000)]
correct register class for tADDspi to GPR since the register will always be SP

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

15 years agoMore MSVC fixes -- class/struct conflicts.
Bill Wendling [Tue, 12 May 2009 21:55:29 +0000 (21:55 +0000)]
More MSVC fixes -- class/struct conflicts.

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

15 years agoUse struct instead of class to make MCVS compile.
Bill Wendling [Tue, 12 May 2009 21:50:43 +0000 (21:50 +0000)]
Use struct instead of class to make MCVS compile.

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

15 years agoRestructure PEI code:
John Mosby [Tue, 12 May 2009 20:33:29 +0000 (20:33 +0000)]
Restructure PEI code:

- moved shrink wrapping code from PrologEpilogInserter.cpp to
  new file ShrinkWrapping.cpp.

- moved PEI pass definition into new shared header PEI.h.

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

15 years agoSwitch to using IRBuilder throughout.
Jay Foad [Tue, 12 May 2009 20:27:44 +0000 (20:27 +0000)]
Switch to using IRBuilder throughout.

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

15 years ago80 col violations.
Evan Cheng [Tue, 12 May 2009 20:17:52 +0000 (20:17 +0000)]
80 col violations.

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

15 years agoAdd nounwind.
Evan Cheng [Tue, 12 May 2009 18:35:43 +0000 (18:35 +0000)]
Add nounwind.

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

15 years agoFixed a stack slot coloring with reg bug: do not update implicit use / def when doing...
Evan Cheng [Tue, 12 May 2009 18:31:57 +0000 (18:31 +0000)]
Fixed a stack slot coloring with reg bug: do not update implicit use / def when doing forward / backward propagation.

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

15 years agoUse llvm::raw_stream instead of llvm::Streams.
Bill Wendling [Tue, 12 May 2009 18:29:42 +0000 (18:29 +0000)]
Use llvm::raw_stream instead of llvm::Streams.

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

15 years agoFix up a few minor typos in comments.
Bob Wilson [Tue, 12 May 2009 17:35:29 +0000 (17:35 +0000)]
Fix up a few minor typos in comments.

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

15 years agoFix 80-col violations and remove trailing whitespace. No functional changes.
Bob Wilson [Tue, 12 May 2009 17:09:30 +0000 (17:09 +0000)]
Fix 80-col violations and remove trailing whitespace.  No functional changes.

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

15 years agoClarify a comment.
Dan Gohman [Tue, 12 May 2009 17:08:34 +0000 (17:08 +0000)]
Clarify a comment.

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

15 years agoIterate over globals once and sectionize them into appropriate sections.
Sanjiv Gupta [Tue, 12 May 2009 17:07:27 +0000 (17:07 +0000)]
Iterate over globals once and sectionize them into appropriate sections.
Later in asmprinter, go over thsese sections and print them.
Do not print empty sections.

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

15 years agoAllow client Makefiles control over whether they want -pedantic by
Daniel Dunbar [Tue, 12 May 2009 07:26:49 +0000 (07:26 +0000)]
Allow client Makefiles control over whether they want -pedantic by
defining NO_PEDANTIC.
  - Pedantic C89 is a painful language...

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

15 years agoWe do not need to create a label for external defs and decls,
Sanjiv Gupta [Tue, 12 May 2009 06:52:41 +0000 (06:52 +0000)]
We do not need to create a label for external defs and decls,
just emit a comment for readability.

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

15 years agoSet svn:ignore on a slew of +Coverage directories
Daniel Dunbar [Tue, 12 May 2009 06:47:12 +0000 (06:47 +0000)]
Set svn:ignore on a slew of +Coverage directories

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

15 years agoRefactor dependency generation for .ll files.
Daniel Dunbar [Tue, 12 May 2009 06:35:50 +0000 (06:35 +0000)]
Refactor dependency generation for .ll files.
 - This matches the normal dependency generation code.

 - This also fixes the problem that when building a normal and bitcode
   archive from the same source, the dependency files would overwrite
   one another. Which was bad.

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

15 years agoRemove obsolete Makefile magic for calling llvm-upgrade
Daniel Dunbar [Tue, 12 May 2009 05:49:22 +0000 (05:49 +0000)]
Remove obsolete Makefile magic for calling llvm-upgrade

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

15 years agoInstall bytecode libraries with a .bca suffix, otherwise it isn't
Daniel Dunbar [Tue, 12 May 2009 05:35:40 +0000 (05:35 +0000)]
Install bytecode libraries with a .bca suffix, otherwise it isn't
possible to build both a .a and a .bca.
 - My understanding is no one else is using this stuff, please let me
   know if I am wrong.

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

15 years agoMark mayLoad, mayStore for insns correctly and use them
Sanjiv Gupta [Tue, 12 May 2009 04:30:38 +0000 (04:30 +0000)]
Mark mayLoad, mayStore for insns correctly and use them
to check if an insn is accessing memory during mem sel optimization.

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

15 years agoFix pr4195: When iterating through predecessor blocks, break out of the loop
Bob Wilson [Tue, 12 May 2009 03:48:10 +0000 (03:48 +0000)]
Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor.  Sometimes a block may be listed
more than once, and processing it more than once in this loop can lead to
inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not
clear these values.  There's no point in continuing the loop regardless.
The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource
test.

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

15 years agoFactor the code for collecting IV users out of LSR into an IVUsers class,
Dan Gohman [Tue, 12 May 2009 02:17:14 +0000 (02:17 +0000)]
Factor the code for collecting IV users out of LSR into an IVUsers class,
and generalize it so that it can be used by IndVarSimplify. Implement the
base IndVarSimplify transformation code using IVUsers. This removes
TestOrigIVForWrap and associated code, as ScalarEvolution now has enough
builtin overflow detection and folding logic to handle all the same cases,
and more. Run "opt -iv-users -analyze -disable-output" on your favorite
loop for an example of what IVUsers does.

This lets IndVarSimplify eliminate IV casts and compute trip counts in
more cases. Also, this happens to finally fix the remaining testcases
in PR1301.

Now that IndVarSimplify is being more aggressive, it occasionally runs
into the problem where ScalarEvolutionExpander's code for avoiding
duplicate expansions makes it difficult to ensure that all expanded
instructions dominate all the instructions that will use them. As a
temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function
to fix up instructions inserted by SCEVExpander. Fortunately, this code
is contained, and can be easily removed once a more comprehensive
solution is available.

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

15 years agoWhen forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.
Dan Gohman [Tue, 12 May 2009 01:27:58 +0000 (01:27 +0000)]
When forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.
These values aren't analyzable, so they don't care if more information
about the loop trip count can be had. Also, SCEVUnknown is used for
a PHI while the PHI itself is being analyzed, so it needs to be left
in the Scalars map. This fixes a variety of subtle issues.

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

15 years agoFix GetMinTrailingZeros for SCEVSignExtend and SCEVZeroExtendExpr to
Dan Gohman [Tue, 12 May 2009 01:23:18 +0000 (01:23 +0000)]
Fix GetMinTrailingZeros for SCEVSignExtend and SCEVZeroExtendExpr to
return the correct value when the cast operand is all zeros. This ought
to be pretty rare, because it would mean that the regular SCEV folding
routines missed a case, though there are cases they might legitimately
miss. Also, it's unlikely anything currently using GetMinTrailingZeros
cares about this case.

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

15 years agoAvoid unneeded SIB byte encoding. Patch by Zoltan Varga.
Evan Cheng [Tue, 12 May 2009 00:07:35 +0000 (00:07 +0000)]
Avoid unneeded SIB byte encoding. Patch by Zoltan Varga.

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

15 years ago- Record that the debug info is actually used so that the label folder doesn't
Bill Wendling [Tue, 12 May 2009 00:06:59 +0000 (00:06 +0000)]
- Record that the debug info is actually used so that the label folder doesn't
  blast it away.
- Move InlineInfo bookkeeping to bookkeep the correct debug info object.

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

15 years agoFixed PR4090.
Lang Hames [Mon, 11 May 2009 23:14:13 +0000 (23:14 +0000)]
Fixed PR4090.

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

15 years agoTeach LSR to optimize more loop exit compares, i.e. change them to use postinc iv...
Evan Cheng [Mon, 11 May 2009 22:33:01 +0000 (22:33 +0000)]
Teach LSR to optimize more loop exit compares, i.e. change them to use postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values.

Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch.

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

15 years agoAdd DW_AT_APPLE_isa and DW_AT_APPLE_block. Radar 6867696
Mike Stump [Mon, 11 May 2009 21:58:01 +0000 (21:58 +0000)]
Add DW_AT_APPLE_isa and DW_AT_APPLE_block.  Radar 6867696

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

15 years agoFix PR4188. TailMerging can't tolerate inexact
Dale Johannesen [Mon, 11 May 2009 21:54:13 +0000 (21:54 +0000)]
Fix PR4188.  TailMerging can't tolerate inexact
sucessor info.

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

15 years agoApply patch review feedback.
Evan Cheng [Mon, 11 May 2009 20:53:52 +0000 (20:53 +0000)]
Apply patch review feedback.

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

15 years agoDon't #include DerivedTypes.h from TargetData.h.
Jay Foad [Mon, 11 May 2009 19:38:09 +0000 (19:38 +0000)]
Don't #include DerivedTypes.h from TargetData.h.

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

15 years agoAdd a comment about the special meaning of VoidTy in this context.
Dan Gohman [Mon, 11 May 2009 19:11:53 +0000 (19:11 +0000)]
Add a comment about the special meaning of VoidTy in this context.

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

15 years agoFix two wording errors that Duncan spotted.
Dan Gohman [Mon, 11 May 2009 18:51:16 +0000 (18:51 +0000)]
Fix two wording errors that Duncan spotted.

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

15 years agoMake this grep line a little more specific so that it doesn't
Dan Gohman [Mon, 11 May 2009 18:49:56 +0000 (18:49 +0000)]
Make this grep line a little more specific so that it doesn't
accidentally match something unrelated.

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

15 years agoUnbreak non-debug build.
Evan Cheng [Mon, 11 May 2009 18:40:52 +0000 (18:40 +0000)]
Unbreak non-debug build.

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

15 years agoEliminate a compiler warning.
Evan Cheng [Mon, 11 May 2009 18:40:35 +0000 (18:40 +0000)]
Eliminate a compiler warning.

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

15 years agoWhen scalarizing a vector BITCAST, check whether the operand has vector
Dan Gohman [Mon, 11 May 2009 18:30:42 +0000 (18:30 +0000)]
When scalarizing a vector BITCAST, check whether the operand has vector
type, rather than assume that it does. If the operand is not vector, it
shouldn't be run through ScalarizeVectorOp. This fixes one of the
testcases in PR3886.

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

15 years agoLLVM has unaligned loads and stores now.
Dan Gohman [Mon, 11 May 2009 18:06:05 +0000 (18:06 +0000)]
LLVM has unaligned loads and stores now.

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

15 years agoAdd terminal width detection to llvm::sys::Process. This is needed to
Douglas Gregor [Mon, 11 May 2009 18:05:52 +0000 (18:05 +0000)]
Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.

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

15 years agoUpgrade this example to new-style syntax.
Dan Gohman [Mon, 11 May 2009 18:04:52 +0000 (18:04 +0000)]
Upgrade this example to new-style syntax.

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

15 years agoConvert a subtract into a negate and an add when it helps x86
Dan Gohman [Mon, 11 May 2009 18:02:53 +0000 (18:02 +0000)]
Convert a subtract into a negate and an add when it helps x86
address folding.

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

15 years agoAdd an svn:ignore.
Dan Gohman [Mon, 11 May 2009 17:57:43 +0000 (17:57 +0000)]
Add an svn:ignore.

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

15 years agoremove some done things: we have nocapture and SROA is smarter.
Chris Lattner [Mon, 11 May 2009 17:41:40 +0000 (17:41 +0000)]
remove some done things: we have nocapture and SROA is smarter.

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