Commit Graph

28467 Commits

Author SHA1 Message Date
Bob Wilson
4bb3374b6d 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
2009-05-14 18:08:41 +00:00
Dale Johannesen
bae7d6dbeb Use abs64 in one more place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 16:47:34 +00:00
Lang Hames
a7c9deaa2b 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
2009-05-14 04:26:30 +00:00
Jim Grosbach
f957012866 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
2009-05-14 00:46:35 +00:00
Dan Gohman
e340e84196 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
2009-05-14 00:30:16 +00:00
Mike Stump
8cf6571ec0 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
2009-05-14 00:03:51 +00:00
Bill Wendling
f59d10f1bc 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
2009-05-13 23:55:49 +00:00
Bob Wilson
df1ed67890 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
2009-05-13 23:54:13 +00:00
Jim Grosbach
2afb3b7251 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
2009-05-13 23:50:53 +00:00
Bob Wilson
8308e8fae0 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
2009-05-13 23:48:58 +00:00
Bob Wilson
596e22e2b3 Merge adjacent conditional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 23:35:38 +00:00
Bob Wilson
e19fb7de63 Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 23:31:30 +00:00
Bob Wilson
9c4856a4cf 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
2009-05-13 23:25:24 +00:00
Mike Stump
f3dc0c048a Fix whitespacing (space after switch).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 23:23:20 +00:00
Jim Grosbach
6aa7197fb5 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
2009-05-13 22:32:43 +00:00
Evan Cheng
6ebf7bc740 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
2009-05-13 21:42:09 +00:00
Bill Wendling
587daedce2 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
2009-05-13 21:33:08 +00:00
Dale Johannesen
556d0a0d15 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
2009-05-13 20:55:30 +00:00
Bill Wendling
f3cc96e1f3 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
2009-05-13 20:33:33 +00:00
Dale Johannesen
f8bc300821 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
2009-05-13 18:25:07 +00:00
John Mosby
752c1df739 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
2009-05-13 17:52:11 +00:00
Chris Lattner
aab6ec49d2 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
2009-05-13 17:39:14 +00:00
Sanjiv Gupta
ad6585b021 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
2009-05-13 15:13:17 +00:00
Duncan Sands
18395d2c3d 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
2009-05-13 12:52:44 +00:00
Chris Lattner
21c4bddacf add IVUsers.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 06:28:04 +00:00
Chris Lattner
9422e01a63 add ShrinkWrapping.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 06:27:38 +00:00
Chris Lattner
bcc2e7dc2c Fix PR4206 - crash in simplify lib calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71644 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 06:26:11 +00:00
Lang Hames
60dc7345eb 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
2009-05-13 04:18:47 +00:00
Dan Gohman
467c430316 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
2009-05-13 03:46:30 +00:00
Dale Johannesen
7b9486ad43 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
2009-05-13 00:24:22 +00:00
Jim Grosbach
0e0da734bb 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
2009-05-12 23:59:14 +00:00
Evan Cheng
9d3094b38e 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
2009-05-12 23:58:14 +00:00
Evan Cheng
eca24fba3f 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
2009-05-12 23:07:00 +00:00
Jim Grosbach
c93f961874 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
2009-05-12 22:30:18 +00:00
Bill Wendling
b877a1f545 More MSVC fixes -- class/struct conflicts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 21:55:29 +00:00
John Mosby
378553cb07 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
2009-05-12 20:33:29 +00:00
Jay Foad
e1e201416a Switch to using IRBuilder throughout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 20:27:44 +00:00
Evan Cheng
0af934eb64 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 20:17:52 +00:00
Evan Cheng
1ea7327845 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
2009-05-12 18:31:57 +00:00
Bob Wilson
39bf051ec2 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
2009-05-12 17:35:29 +00:00
Bob Wilson
8494526a23 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
2009-05-12 17:09:30 +00:00
Sanjiv Gupta
2364cfeb54 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
2009-05-12 17:07:27 +00:00
Sanjiv Gupta
429185787a 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
2009-05-12 06:52:41 +00:00
Sanjiv Gupta
ed4f4fbfba 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
2009-05-12 04:30:38 +00:00
Bob Wilson
74b0ccc577 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
2009-05-12 03:48:10 +00:00
Dan Gohman
81db61a2e6 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
2009-05-12 02:17:14 +00:00
Dan Gohman
efb9fbfdab 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
2009-05-12 01:27:58 +00:00
Dan Gohman
42a5875e10 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
2009-05-12 01:23:18 +00:00
Evan Cheng
6ed34918eb 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
2009-05-12 00:07:35 +00:00
Bill Wendling
bc12c2be18 - 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
2009-05-12 00:06:59 +00:00