Commit Graph

2459 Commits

Author SHA1 Message Date
Owen Anderson
f8dad7a926 Fix typo in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29078 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-09 21:35:40 +00:00
Owen Anderson
e4e1ecd37c Add a fix for an issue where LCSSA would fail to insert undef's in some corner
cases.  Ideally, this issue will go away in the future as LCSSA gets smarter
about which Phi nodes it inserts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29076 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-09 08:14:06 +00:00
Chris Lattner
7cd580f0b7 Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29071 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 21:37:01 +00:00
Chris Lattner
9525528a7d Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28975 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 23:17:24 +00:00
Chris Lattner
f4b546110c Shrink libllvmgcc.dylib by another 23K
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28972 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 22:08:15 +00:00
Owen Anderson
372994be25 Switch to a very conservative heuristic for determining when loop-unswitching
will be profitable.  This is mainly to remove some cases where excessive
unswitching would result in long compile times and/or huge generated code.

Once someone comes up with a better heuristic that avoids these cases, this
should be switched out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28962 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 17:47:50 +00:00
Chris Lattner
d228018396 Fix Transforms/InstCombine/2006-06-28-infloop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28961 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 17:34:50 +00:00
Chris Lattner
daa2bf9a19 Don't unswitch really large loops even if they are mostly filled with empty
blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28959 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 16:38:55 +00:00
Andrew Lenharth
b8e604c29a Catch more function pointer casting problems
Remove the Function pointer cast in these calls, converting it to
a cast of argument.
%tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( int 10 )
%tmp60 = tail call int cast (int (ulong)* %str to int (int)*)( uint %tmp51 )


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28953 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 01:01:52 +00:00
Owen Anderson
bef8508737 Fix for 2006-06-27-DeadSwitchCase.ll
Be more careful when updating Phi nodes after eliminating dead switch cases.  Fix
proposed by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28947 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-27 22:26:09 +00:00
Chris Lattner
92044ce4e9 Fix Transforms/DeadArgElim/2006-06-27-struct-ret.ll. -deadargelim should not
remove the struct return argument of a csret function, even if it is obviously
dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28943 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-27 21:05:04 +00:00
Owen Anderson
f9b238e93d De-pessimize the handling of LCSSA Phi nodes in IndVarSimplify. Hopefully this
will make Shootout-C/nestedloop faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28924 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-27 02:17:08 +00:00
Chris Lattner
3c80a51cfd random code cleanups, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28914 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-26 19:10:05 +00:00
Owen Anderson
2b67f07d2b Make LoopUnswitch able to unswitch loops with live-out values by taking advantage
of LCSSA.  This results several times the number of unswitchings occurring on
tests such and timberwolfmc, unix-tbl, and ldecod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28912 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-26 07:44:36 +00:00
Chris Lattner
eb83f4e6cd Fix IndVarsSimplify/2006-06-16-Indvar-LCSSA-Crash.ll, a case where a
"LCSSA" phi node causes indvars to break dominance properties.  This fixes
causes indvars to avoid inserting aggressive code in this case, instead
indvars should be fixed to be more aggressive in the face of lcssa phi's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28850 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-17 01:02:31 +00:00
Evan Cheng
fb9d0dce97 Add missing casts. This fixed some regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28834 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 18:37:15 +00:00
Evan Cheng
21abac2757 More libcall transformations:
printf("%s\n", str) -> puts(str)
printf("%c", c) -> putchar(c)
Also fixed fprintf(file, "%c", c) -> fputc(c, file)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28815 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 08:36:35 +00:00
Evan Cheng
952895243e Simplify fprintf(file, "%s", str) to fputs(str, file).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 04:52:30 +00:00
Chris Lattner
afe91a5f26 Implement Transforms/InstCombine/bswap.ll, turning common shift/and/or bswap
idioms into bswap intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28803 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-15 19:07:26 +00:00
Chris Lattner
f7a1212850 Fix Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll, a loop unswitch
bug exposed by the recent lcssa work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 04:46:17 +00:00
Chris Lattner
13a68e4257 Use the PotDoms map to memoize 'dominating value' lookup. With this patch,
LCSSA is still the slowest pass when gccas'ing 252.eon, but now it only takes
39s instead of 289s. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28776 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 01:13:57 +00:00
Owen Anderson
8b92d0cae1 Fix another instance where PHI nodes need special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28774 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 20:50:09 +00:00
Owen Anderson
7be3f1e078 Fix a bug that was causing major slowdowns in povray. This was due to LCSSA
not handling PHI nodes correctly when determining if a value was live-out.

This patch reduces the number of detected live-out variables in the testcase
from 6565 to 485.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 19:37:18 +00:00
Owen Anderson
6edf399bb4 Reapply my 6/9 changes. The bug Evan saw no longer occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28759 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 21:49:21 +00:00
Chris Lattner
7f2e1dd5d4 Fix an infinite loop on Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 20:18:01 +00:00
Owen Anderson
3d2aa47bd3 Fix for 2006-06-26-MultipleExitsSingleBlock.
If a single exit block has multiple predecessors within the loop, it will
appear in the exit blocks list more than once.  LCSSA needs to take that into
account so that it doesn't double process that exit block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 07:10:16 +00:00
Owen Anderson
c2cc15cf9d Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 19:22:28 +00:00
Evan Cheng
b9b2b309d3 Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28747 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 09:32:57 +00:00
Owen Anderson
fcaf345c88 Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch preserves
LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28739 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 18:40:32 +00:00
Owen Anderson
f25c19c6b5 Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert
on this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 18:33:30 +00:00
Evan Cheng
86c75d3113 RewriteExpr, either the new PHI node of induction variable or the
post-increment value, should be first cast to the appropriated type (to the
type of the common expr). Otherwise, the rewrite of a use based on (common +
iv) may end up with an incorrect type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 00:12:42 +00:00
Owen Anderson
a452932171 Update some comments, and expose LCSSAID in preparation for having other passes
require LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28734 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 20:02:53 +00:00
Reid Spencer
6296b3cac5 Fix a spello in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28714 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 21:24:10 +00:00
Chris Lattner
18a4af2ba6 Fix a bug in a recent patch. This fixes UnitTests/Vector/Altivec/casts.c on
PPC/altivec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 22:26:02 +00:00
Owen Anderson
e9d93d5d70 Fix some formatting, and use inLoop() when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:36:36 +00:00
Owen Anderson
92deacf2f7 Stop a memory leak, and update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:28:30 +00:00
Owen Anderson
c14c1d472a Some more clean-up, and squash an IDF-Phi related bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:55:19 +00:00
Owen Anderson
9e1c1ddd4b Various clean-ups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:02:23 +00:00
Owen Anderson
30019c88f4 Fix a bug in Phi-noded insertion. Also, update some comments to reflect what's
actually going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-03 23:22:50 +00:00
Chris Lattner
0c1262c9f9 Remove unneeded hook. Patch by Anton K. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28664 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 19:11:46 +00:00
Chris Lattner
191b0ba97e Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.h
to link in the implementation.  Thanks to Anton Korobeynikov for figuring out
what was going on here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:40:06 +00:00
Chris Lattner
ecf626fedf Remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28642 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 20:02:28 +00:00
Chris Lattner
35033efd08 Make the "pruning cloner" smarter. As it propagates constants through the
code (while cloning) it often gets the branch/switch instructions.  Since it
knows that edges of the CFG are dead, it need not clone (or even look) at
the obviously dead blocks.  This should speed up the inliner substantially on
code where there are lots of inlinable calls to functions with constant
arguments.  On C++ code in particular, this kicks in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28641 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:19:23 +00:00
Chris Lattner
5180b29cb0 Silence a -pedantic warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28632 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 17:16:21 +00:00
Owen Anderson
ff99366919 Remove a FIXME that was fixed with my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:07:40 +00:00
Owen Anderson
2824da4738 More cleanups. Also, add a special case for updating PHI nodes, and
reimplement getValueDominatingFunction to walk the DominanceTree rather than
just searching blindly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:05:47 +00:00
Chris Lattner
13d4ab4009 Swap the order of operands created here. For +&|^, the order doesn't matter,
but for sub, it really does!  Fix fixes a miscompilation of fibheap_cut in
llvmgcc4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28600 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 21:14:00 +00:00
Owen Anderson
408a4061d8 Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28599 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 20:55:06 +00:00
Owen Anderson
00ea74c27e Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 01:00:00 +00:00
Owen Anderson
bd82277cbb Major think-o. Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-28 19:33:28 +00:00