1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
Commit Graph

3206 Commits

Author SHA1 Message Date
Chris Lattner
c5d0dc3554 simplify this code and fix PR1493, now that llvm-gcc3 is dead.
llvm-svn: 37478
2007-06-06 20:51:41 +00:00
Lauro Ramos Venancio
27fa43f343 Fix PR1499.
llvm-svn: 37472
2007-06-06 17:08:48 +00:00
Nick Lewycky
65199a504b Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487.

llvm-svn: 37457
2007-06-06 03:51:56 +00:00
Owen Anderson
501e5873d4 Add simple full redundancy elimination.
llvm-svn: 37455
2007-06-06 01:27:49 +00:00
Chris Lattner
a874ddba43 Fix PR1495 and CodeGen/X86/2007-06-05-LSR-Dominator.ll
llvm-svn: 37454
2007-06-06 01:23:55 +00:00
Devang Patel
61661c6774 Avoid non-trivial loop unswitching while optimizing for size.
llvm-svn: 37446
2007-06-06 00:21:03 +00:00
Owen Anderson
3aa2107b02 Fix a misunderstanding of the algorithm. Really, we should be tracking values
and expression separately.  We can get around this, however, by only keeping
opaque values in TMP_GEN.

llvm-svn: 37443
2007-06-05 23:46:12 +00:00
Owen Anderson
3c9c199f2d Don't leak memory.
llvm-svn: 37442
2007-06-05 22:11:49 +00:00
Owen Anderson
25a0068940 Fix a small bug, some 80 cols violations, and add some more debugging output.
llvm-svn: 37436
2007-06-05 17:31:23 +00:00
Dan Gohman
08d77288c1 Allow insertelement, extractelement, and shufflevector to be hoisted/sunk
by LICM.

llvm-svn: 37435
2007-06-05 16:05:55 +00:00
Bill Wendling
d2b1274d1b Patches by Chuck Rose to unbreak V Studio builds.
Thanks Chuck!

llvm-svn: 37428
2007-06-04 23:52:59 +00:00
Devang Patel
ba29e5e591 s/ETNode::getChildren/ETNode::getETNodeChildren/g
llvm-svn: 37426
2007-06-04 23:45:02 +00:00
Owen Anderson
dde6943d82 Don't use std::set_difference when the two sets are sorted differently. Compute
the difference manually instead.

This allows GVNPRE to produce correct analysis for the example in the GVNPRE
paper.

llvm-svn: 37425
2007-06-04 23:34:56 +00:00
Owen Anderson
0cab4450c3 Fix a bunch of small bugs, and improve the debugging output significantly.
llvm-svn: 37424
2007-06-04 23:28:33 +00:00
Chris Lattner
7726564331 When rebuilding constant structs, make sure to honor the isPacked bit.
This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll

llvm-svn: 37423
2007-06-04 22:23:42 +00:00
Owen Anderson
2043bb65a4 Make phi_translate correct.
llvm-svn: 37418
2007-06-04 18:05:26 +00:00
Devang Patel
74785c1f3c s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g
llvm-svn: 37415
2007-06-04 16:43:25 +00:00
Devang Patel
26d8a86df7 Add basic block level interface to change immediate dominator
and create new node.

llvm-svn: 37414
2007-06-04 16:22:33 +00:00
Devang Patel
2ef6caf14f s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Owen Anderson
39e6d31260 Don't use the custom comparator where it's not necessary.
llvm-svn: 37406
2007-06-03 22:02:14 +00:00
Devang Patel
d58b82f83a s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Owen Anderson
76e8d46c1b Remove an unused method.
llvm-svn: 37402
2007-06-03 05:58:25 +00:00
Owen Anderson
d7388dc4ce There's no need to have an Expression class... Value works just as well! This simplifies a lot of code.
llvm-svn: 37401
2007-06-03 05:55:58 +00:00
Devang Patel
bdacf6c9c9 Insert new instructions in AliasSet.
llvm-svn: 37390
2007-06-01 22:15:31 +00:00
Owen Anderson
fadd9e4a7a clean() needs to process things in topological order.
llvm-svn: 37389
2007-06-01 22:00:37 +00:00
Owen Anderson
da27462cea Fix Expression comparison, which in turn fixes a value numbering error.
llvm-svn: 37386
2007-06-01 17:34:47 +00:00
Owen Anderson
6e39e65e7f Add a topological sort function.
llvm-svn: 37376
2007-05-31 22:44:11 +00:00
Owen Anderson
919ee81e51 Attempt to fix up phi_translate.
llvm-svn: 37366
2007-05-31 00:42:15 +00:00
Devang Patel
044601033f Fix typo.
llvm-svn: 37360
2007-05-30 15:29:37 +00:00
Chris Lattner
fd963f9138 Fix Transforms/ScalarRepl/2007-05-29-MemcpyPreserve.ll and the second
half of PR1421, by not decimating structs with holes that are the source and
destination of a memcpy.

llvm-svn: 37358
2007-05-30 06:11:23 +00:00
Owen Anderson
328c980fad Fix a typo
llvm-svn: 37350
2007-05-29 23:34:14 +00:00
Owen Anderson
0f46c29ffd Re-fix a bug, where I was now being too aggressive.
llvm-svn: 37348
2007-05-29 23:26:30 +00:00
Owen Anderson
cfeeaac401 Use proper debugging facilities so other people don't have to look at my commented-out
debugging lines.

llvm-svn: 37347
2007-05-29 23:15:21 +00:00
Owen Anderson
1e1d693893 Comment debug code out that I accidentally uncommented last time.
llvm-svn: 37346
2007-05-29 22:43:03 +00:00
Owen Anderson
707e37c6a6 Add a place where I missed using the maximal set. Note that using the maximal
set this way is _SLOW_.  Somewhere down the line, I'll look at speeding it up.

llvm-svn: 37345
2007-05-29 22:35:41 +00:00
Owen Anderson
83bd7bcf6c Very first part of a GVN-PRE implementation. It currently performs a bunch of analysis, and nothing more. It is also quite slow for the moment. However,
it should give a sense of what's going on.

llvm-svn: 37343
2007-05-29 21:53:49 +00:00
Chris Lattner
8d43dc619d Fix PR1446 by not scalarrepl'ing giant structures.
llvm-svn: 37326
2007-05-24 18:43:04 +00:00
Dan Gohman
2c5d31ee81 Minor comment cleanups.
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Chris Lattner
4cc07421ee fix a miscompilation when passing a float through varargs
llvm-svn: 37297
2007-05-23 01:17:04 +00:00
Chris Lattner
dda5066a5e Fix Transforms/InstCombine/2007-05-18-CastFoldBug.ll, a bug that devastates
objc code due to the way the FE lowers objc message sends.

llvm-svn: 37256
2007-05-19 06:51:32 +00:00
Chris Lattner
a13d75f270 Handle negative strides much more optimally. This compiles X86/lsr-negative-stride.ll
into:

_t:
        movl 8(%esp), %ecx
        movl 4(%esp), %eax
        cmpl %ecx, %eax
        je LBB1_3       #bb17
LBB1_1: #bb
        cmpl %ecx, %eax
        jg LBB1_4       #cond_true
LBB1_2: #cond_false
        subl %eax, %ecx
        cmpl %ecx, %eax
        jne LBB1_1      #bb
LBB1_3: #bb17
        ret
LBB1_4: #cond_true
        subl %ecx, %eax
        cmpl %ecx, %eax
        jne LBB1_1      #bb
        jmp LBB1_3      #bb17

instead of:

_t:
        subl $4, %esp
        movl %esi, (%esp)
        movl 12(%esp), %ecx
        movl 8(%esp), %eax
        cmpl %ecx, %eax
        je LBB1_4       #bb17
LBB1_1: #bb.outer
        movl %ecx, %edx
        negl %edx
LBB1_2: #bb
        cmpl %ecx, %eax
        jle LBB1_5      #cond_false
LBB1_3: #cond_true
        addl %edx, %eax
        cmpl %ecx, %eax
        jne LBB1_2      #bb
LBB1_4: #bb17
        movl (%esp), %esi
        addl $4, %esp
        ret
LBB1_5: #cond_false
        movl %ecx, %edx
        subl %eax, %edx
        movl %eax, %esi
        addl %esi, %esi
        cmpl %ecx, %esi
        je LBB1_4       #bb17
LBB1_6: #cond_false.bb.outer_crit_edge
        movl %edx, %ecx
        jmp LBB1_1      #bb.outer

llvm-svn: 37252
2007-05-19 01:22:21 +00:00
Devang Patel
6e8f1aa332 Fix PR1431
Test case at Transformations/SCCP/2007-05-16-InvokeCrash.ll

llvm-svn: 37185
2007-05-17 22:10:15 +00:00
Chris Lattner
701ec7ae28 selects can also reach here
llvm-svn: 37081
2007-05-15 06:42:04 +00:00
Chris Lattner
dfc6f4a06c Fix Transforms/InstCombine/2007-05-14-Crash.ll
llvm-svn: 37057
2007-05-15 00:16:00 +00:00
Dan Gohman
7616b6f30c Correct a few comments.
llvm-svn: 37034
2007-05-14 14:31:17 +00:00
Chris Lattner
8ed56b8c48 Fix Transforms/GlobalOpt/2007-05-13-Crash.ll
llvm-svn: 37020
2007-05-13 21:28:07 +00:00
Chris Lattner
119ece07be significantly improve debug output of lsr
llvm-svn: 36996
2007-05-11 22:40:34 +00:00
Dan Gohman
167379e73a Fix typos.
llvm-svn: 36994
2007-05-11 21:10:54 +00:00
Dan Gohman
2e4ac0dea5 This patch extends the LoopUnroll pass to be able to unroll loops
with unknown trip counts. This is left off by default, and a
command-line option enables it. It also begins to separate loop
unrolling into a utility routine; eventually it might be made usable
from other passes.

It currently works by inserting conditional branches between each
unrolled iteration, unless it proves that the trip count is a
multiple of a constant integer > 1, which it currently only does in
the rare case that the trip count expression is a Mul operator with
a ConstantInt operand. Eventually this information might be provided
by other sources, for example by a pass that peels/splits the loop
for this purpose.

llvm-svn: 36990
2007-05-11 20:53:41 +00:00
Chris Lattner
3936efb43b fix regressions from my previous checking, including
Transforms/InstCombine/2006-12-08-ICmp-Combining.ll

llvm-svn: 36989
2007-05-11 16:58:45 +00:00