1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

534 Commits

Author SHA1 Message Date
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner
d9aa90ded4 Fix SimplifyCFG/2006-10-19-UncondDiv.ll by disabling a bad xform.
llvm-svn: 31061
2006-10-20 00:42:07 +00:00
Chris Lattner
c8225bc92a This case isn't implemented yet. It seems unlikely to be needed, but if it
ever is, we want to get an assert instead of silent bad codegen.

llvm-svn: 30716
2006-10-04 04:58:58 +00:00
Chris Lattner
bfbe137f4c Fix PR932 and Analysis/Dominators/2006-10-02-BreakCritEdges.ll:
The critical edge block dominates the dest block if the destblock dominates
all edges other than the one incoming from the critical edge.

llvm-svn: 30696
2006-10-03 07:02:02 +00:00
Chris Lattner
d9c79b9349 simplify code
llvm-svn: 30656
2006-09-28 22:58:25 +00:00
Chris Lattner
c0f674b9fd Be far more careful when splitting a loop header, either to form a preheader
or when splitting loops with a common header into multiple loops.  In particular
the old code would always insert the preheader before the old loop header.  This
is disasterous in cases where the loop hasn't been rotated.  For example, it can
produce code like:

        .. outside the loop...
        jmp LBB1_2      #bb13.outer
LBB1_1: #bb1
        movsd 8(%esp,%esi,8), %xmm1
        mulsd (%edi), %xmm1
        addsd %xmm0, %xmm1
        addl $24, %edi
        incl %esi
        jmp LBB1_3      #bb13
LBB1_2: #bb13.outer
        leal (%edx,%eax,8), %edi
        pxor %xmm1, %xmm1
        xorl %esi, %esi
LBB1_3: #bb13
        movapd %xmm1, %xmm0
        cmpl $4, %esi
        jl LBB1_1       #bb1

Note that the loop body is actually LBB1_1 + LBB1_3, which means that the
loop now contains an uncond branch WITHIN it to jump around the inserted
loop header (LBB1_2).  Doh.

This patch changes the preheader insertion code to insert it in the right
spot, producing this code:

        ... outside the loop, fall into the header ...
LBB1_1: #bb13.outer
        leal (%edx,%eax,8), %esi
        pxor %xmm0, %xmm0
        xorl %edi, %edi
        jmp LBB1_3      #bb13
LBB1_2: #bb1
        movsd 8(%esp,%edi,8), %xmm0
        mulsd (%esi), %xmm0
        addsd %xmm1, %xmm0
        addl $24, %esi
        incl %edi
LBB1_3: #bb13
        movapd %xmm0, %xmm1
        cmpl $4, %edi
        jl LBB1_2       #bb1

Totally crazy, no branch in the loop! :)

llvm-svn: 30587
2006-09-23 08:19:21 +00:00
Chris Lattner
56c1c10ca1 Teach UpdateDomInfoForRevectoredPreds to handle revectored preds that are not
reachable, making it general purpose enough for use by InsertPreheaderForLoop.
Eliminate custom dominfo updating code in InsertPreheaderForLoop, using
UpdateDomInfoForRevectoredPreds instead.

llvm-svn: 30586
2006-09-23 07:40:52 +00:00
Chris Lattner
60207ce1f7 Second half of the fix for Transforms/Inline/inline_cleanup.ll
This folds unconditional branches that are often produced by code
specialization.

llvm-svn: 30307
2006-09-13 21:27:00 +00:00
Chris Lattner
e55d70cedc Implement the first half of Transforms/Inline/inline_cleanup.ll
llvm-svn: 30303
2006-09-13 19:23:57 +00:00
Chris Lattner
f17002a907 Fix Duraid's changes to work when TLI is null. This fixes the failing
lowerinvoke regtests.

llvm-svn: 30115
2006-09-05 17:48:07 +00:00
Duraid Madina
51396ffd3e add setJumpBufSize() and setJumpBufAlignment() to target-lowering.
Call these from your backend to enjoy setjmp/longjmp goodness, see
lib/Target/IA64/IA64ISelLowering.cpp for an example

llvm-svn: 30095
2006-09-04 06:21:35 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
33bd5dcfb7 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
llvm-svn: 29911
2006-08-27 12:54:02 +00:00
Chris Lattner
a75d3b6d0d Don't attempt to split subloops out of a loop with a huge number of backedges.
Not only will this take huge amounts of compile time, the resultant loop nests
won't be useful for optimization.  This reduces loopsimplify time on
Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll from ~32s to ~0.4s
with a debug build of llvm on a 2.7Ghz G5.

llvm-svn: 29647
2006-08-12 05:25:00 +00:00
Chris Lattner
0885025198 Reimplement the loopsimplify code which deletes edges from unreachable
blocks that target loop blocks.

Before, the code was run once per loop, and depended on the number of
predecessors each block in the loop had.  Unfortunately, scanning preds can
be really slow when huge numbers of phis exist or when phis with huge numbers
of inputs exist.

Now, the code is run once per function and scans successors instead of preds,
which is far faster.  In addition, the new code is simpler and is goto free,
woo.

This change speeds up a nasty testcase Duraid provided me from taking hours to
taking ~72s with a debug build.  The functionality this implements is already
tested in the testsuite as Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll.

llvm-svn: 29644
2006-08-12 04:51:20 +00:00
Chris Lattner
b7442c1f8b Fix PR867 (and maybe 868) and testcsae:
Transforms/SimplifyCFG/2006-08-03-Crash.ll

llvm-svn: 29515
2006-08-03 21:40:24 +00:00
Chris Lattner
1768e89248 Add special check to avoid isLoop call. Simple, but doesn't seem to speed
up lcssa much in practice.

llvm-svn: 29465
2006-08-02 00:16:47 +00:00
Chris Lattner
a07bbb37e4 Replace the SSA update code in LCSSA with a bottom-up approach instead of a top
down approach, inspired by discussions with Tanya.

This approach is significantly faster, because it does not need dominator
frontiers and it does not insert extraneous unused PHI nodes.  For example, on
252.eon, in a release-asserts build, this speeds up LCSSA (which is the slowest
pass in gccas) from 9.14s to 0.74s on my G5.  This code is also slightly smaller
and significantly simpler than the old code.

Amusingly, in a normal Release build (which includes the
"assert(L->isLCSSAForm());" assertion), asserting that the result of LCSSA
is in LCSSA form is actually slower than the LCSSA transformation pass
itself on 252.eon.  I will see if Loop::isLCSSAForm can be sped up next.

llvm-svn: 29463
2006-08-02 00:06:09 +00:00
Chris Lattner
92a0b69813 Add some advice
llvm-svn: 29324
2006-07-27 04:24:14 +00:00
Chris Lattner
e1054a6cfe silence warnings in a release build
llvm-svn: 29189
2006-07-18 21:48:57 +00:00
Chris Lattner
3a664f7dc0 eliminate some ugly code, using ConstantExpr::getWithOperands instead.
llvm-svn: 29149
2006-07-14 22:21:31 +00:00
Chris Lattner
b77e687f6f Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000.

llvm-svn: 29127
2006-07-12 21:37:11 +00:00
Chris Lattner
0d4c198ecd In addition to deleting calls, the inliner can constant fold them as well.
Handle this case, which doesn't require a new callgraph edge.  This fixes
a crash compiling MallocBench/gs.

llvm-svn: 29121
2006-07-12 18:37:18 +00:00
Chris Lattner
e5e2e8d917 Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll

llvm-svn: 29120
2006-07-12 18:29:36 +00:00
Owen Anderson
7c03596d93 Fix typo in the comment.
llvm-svn: 29078
2006-07-09 21:35:40 +00:00
Owen Anderson
5812f5d7a8 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.

llvm-svn: 29076
2006-07-09 08:14:06 +00:00
Chris Lattner
496bd3fbf6 Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K

llvm-svn: 28975
2006-06-28 23:17:24 +00:00
Chris Lattner
1b42069db1 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. :)

llvm-svn: 28776
2006-06-14 01:13:57 +00:00
Owen Anderson
c50df7da72 Fix another instance where PHI nodes need special treatment.
llvm-svn: 28774
2006-06-13 20:50:09 +00:00
Owen Anderson
f43ab30bc0 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.

llvm-svn: 28771
2006-06-13 19:37:18 +00:00
Chris Lattner
649af38df3 Fix an infinite loop on Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
llvm-svn: 28758
2006-06-12 20:18:01 +00:00
Owen Anderson
a947d699dd 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.

llvm-svn: 28750
2006-06-12 07:10:16 +00:00
Owen Anderson
15b85dbfa5 Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
llvm-svn: 28748
2006-06-11 19:22:28 +00:00
Evan Cheng
d99c8e2e5f Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).
llvm-svn: 28747
2006-06-11 09:32:57 +00:00
Owen Anderson
6c2f7512a6 Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert
on this.

llvm-svn: 28738
2006-06-09 18:33:30 +00:00
Owen Anderson
0d9583aa41 Update some comments, and expose LCSSAID in preparation for having other passes
require LCSSA.

llvm-svn: 28734
2006-06-08 20:02:53 +00:00
Owen Anderson
04f6f0775a Fix some formatting, and use inLoop() when appropriate.
llvm-svn: 28694
2006-06-06 04:36:36 +00:00
Owen Anderson
dc8495f4ad Stop a memory leak, and update some comments.
llvm-svn: 28693
2006-06-06 04:28:30 +00:00
Owen Anderson
4343713be4 Some more clean-up, and squash an IDF-Phi related bug.
llvm-svn: 28680
2006-06-04 00:55:19 +00:00
Owen Anderson
1a72d98dd2 Various clean-ups suggested by Chris.
llvm-svn: 28678
2006-06-04 00:02:23 +00:00
Owen Anderson
b83c3beb44 Fix a bug in Phi-noded insertion. Also, update some comments to reflect what's
actually going on.

llvm-svn: 28677
2006-06-03 23:22:50 +00:00
Chris Lattner
0f5ef733cc 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.

llvm-svn: 28660
2006-06-02 18:40:06 +00:00
Chris Lattner
3300df2fb9 Remove dead #include
llvm-svn: 28642
2006-06-01 20:02:28 +00:00
Chris Lattner
93c46b83b6 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.

llvm-svn: 28641
2006-06-01 19:19:23 +00:00
Owen Anderson
1b0cd45469 Remove a FIXME that was fixed with my last patch.
llvm-svn: 28619
2006-06-01 06:07:40 +00:00
Owen Anderson
facd63d07c More cleanups. Also, add a special case for updating PHI nodes, and
reimplement getValueDominatingFunction to walk the DominanceTree rather than
just searching blindly.

llvm-svn: 28618
2006-06-01 06:05:47 +00:00
Owen Anderson
aae280d83c Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.
llvm-svn: 28599
2006-05-31 20:55:06 +00:00
Owen Anderson
d46a77c3c8 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.

llvm-svn: 28529
2006-05-29 01:00:00 +00:00
Owen Anderson
a857559867 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.

llvm-svn: 28527
2006-05-28 19:33:28 +00:00
Owen Anderson
703f6baab0 Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.

llvm-svn: 28524
2006-05-27 18:47:11 +00:00