1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

2951 Commits

Author SHA1 Message Date
Evan Cheng
88c050f772 getPreIndexedLoad -> getIndexedLoad.
llvm-svn: 31209
2006-10-26 21:53:40 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Chris Lattner
2258020df2 simplify code
llvm-svn: 31188
2006-10-25 22:21:37 +00:00
Chris Lattner
df59442a74 turn off tail merging for now
llvm-svn: 31180
2006-10-25 18:08:50 +00:00
Chris Lattner
5bb7f41bca be more aggressive about matching identical instructions.
llvm-svn: 31179
2006-10-25 18:08:14 +00:00
Devang Patel
0691019e12 Move getPreferredAlignmentLog from AsmPrinter to TargetData
llvm-svn: 31171
2006-10-24 20:32:14 +00:00
Chris Lattner
a797dd393f visitSwitchCase knows how to insert conditional branches well. Change
visitBr to just call visitSwitchCase, eliminating duplicate logic.

llvm-svn: 31167
2006-10-24 18:07:37 +00:00
Chris Lattner
79a1ca0a61 Generalize CaseBlock a bit more:
Rename LHSBB/RHSBB to TrueBB/FalseBB.  Allow the RHS value to be null,
in which case the LHS is treated as a bool.

llvm-svn: 31166
2006-10-24 17:57:59 +00:00
Chris Lattner
fc8e70297e generalize 'CaseBlock'. It really allows any comparison to be inserted.
llvm-svn: 31161
2006-10-24 17:03:35 +00:00
Jim Laskey
55d57252c3 Don't do dead block elimination in fast mode.
llvm-svn: 31155
2006-10-24 16:11:49 +00:00
Jim Laskey
47b2dcf17f LinearScanner hotspot.
llvm-svn: 31153
2006-10-24 14:35:25 +00:00
Jim Laskey
605cf8cc6a Tighter data structure for deleted debug labels.
llvm-svn: 31152
2006-10-24 11:50:43 +00:00
Chris Lattner
533b205309 move single basic blocks that are neither fallen into nor fall out of into
a place more useful.  In particular, if we can put them in a place where code
will be able to fall into it, do so.  Otherwise, put it in a place it can fall
through into a successor.  Otherwise, if preventing a fallthrough, move to the
end of the function, out of the way.

This deletes several hundred unconditional branches from spass.

llvm-svn: 31149
2006-10-24 01:12:32 +00:00
Chris Lattner
131eb21cc7 add moveBefore/moveAfter helper methods
llvm-svn: 31145
2006-10-24 00:02:26 +00:00
Chris Lattner
0c3fabc9a4 Enable tail merging by default.
llvm-svn: 31140
2006-10-23 22:10:12 +00:00
Chris Lattner
06236f7928 Minor tweak. Instead of generating:
movl 32(%esp), %eax
        cmpl $1, %eax
        je LBB1_1       #bb
LBB1_4: #entry
        cmpl $2, %eax
        je LBB1_2       #bb2
        jmp LBB1_3      #UnifiedReturnBlock
LBB1_1: #bb

notice that we would miss the fall through and emit this instead:

        movl 32(%esp), %eax
        cmpl $2, %eax
        je LBB1_2       #bb2
LBB1_4: #entry
        cmpl $1, %eax
        jne LBB1_3      #UnifiedReturnBlock
LBB1_1: #bb

llvm-svn: 31130
2006-10-23 18:38:22 +00:00
Jim Laskey
f6a28d7161 More complete solution to deleting blocks and debug info.
llvm-svn: 31129
2006-10-23 14:56:37 +00:00
Chris Lattner
d91d082100 Fix phi node updating for switches lowered to linear sequences of branches.
llvm-svn: 31125
2006-10-22 23:00:53 +00:00
Chris Lattner
f592f04e3f disable this code for now, it's not yet safely updating phi nodes
llvm-svn: 31124
2006-10-22 22:47:10 +00:00
Chris Lattner
a07b38f113 Implement PR964 and Regression/CodeGen/Generic/SwitchLowering.ll
llvm-svn: 31119
2006-10-22 21:36:53 +00:00
Chris Lattner
9e7d74961b don't break infinite loops
llvm-svn: 31102
2006-10-21 06:11:43 +00:00
Chris Lattner
210d322b1f Use branch reversal to do stuff like this:
call L_strcmp$stub
        testl %eax, %eax
-       jne LBB26_208   #cond_true6020
-       jmp LBB26_227   #bb7119
+       je LBB26_227    #bb7119
 LBB26_208:     #cond_true6020
        movl $l31_str14, 4(%esp)

        testl %eax, %eax
-       jne LBB26_704   #cond_true13042
-       jmp LBB26_713   #bb13151
+       je LBB26_713    #bb13151
 LBB26_704:     #cond_true13042
        movl $_str52, 4(%esp)

        cmpl 76(%ecx), %eax
-       jge LBB26_1628  #cond_false63.i.i
-       jmp LBB26_1769  #_Z8makeGridP13mrSurfaceListidiidd.exit.i
+       jl LBB26_1769   #_Z8makeGridP13mrSurfaceListidiidd.exit.i
 LBB26_1628:    #cond_false63.i.i
        movl $0, 48964(%esp)

llvm-svn: 31100
2006-10-21 05:54:00 +00:00
Chris Lattner
cf7f500cfd Transform code like:
jle FOO
  jmp BAR
BAR:

into:

  jle FOO
BAR:

... whoa!

llvm-svn: 31098
2006-10-21 05:43:30 +00:00
Chris Lattner
d4cb8dc857 Three changes:
1. Remove a bunch of ifdef'd code.
2. When a block just contains an uncond branch, change all blocks branching
   to it to jump to the destination instead.
3. If branch analysis tells us some edges in the machinecfg are not actually
   possible, remove them.

#2 triggers a suprisingly large number of times.

llvm-svn: 31094
2006-10-21 05:08:28 +00:00
Chris Lattner
52a4558cf2 Add an experimental cross-jumping implementation.
This is currently disabled by default and limited in several ways, but does
have a positive effect.

llvm-svn: 31090
2006-10-21 00:47:49 +00:00
Chris Lattner
cf4137d0b9 implement MachineOperand::isIdenticalTo
llvm-svn: 31088
2006-10-20 22:39:59 +00:00
Chris Lattner
2f54afc364 Make flag and chain edges visually distinguishable from value edges in DOT
output.

llvm-svn: 31067
2006-10-20 18:06:09 +00:00
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
Bill Wendling
edce5ede57 Partially in response to PR926: insert the newly created machine basic
blocks into the basic block list when lowering the switch inst. into a
binary tree of if-then statements. This allows the "visitSwitchCase" func
to allow for fall-through behavior.

llvm-svn: 31057
2006-10-19 21:46:38 +00:00
Jim Laskey
c06a0bc853 Add option for controlling inclusion of global AA.
llvm-svn: 31040
2006-10-18 19:08:31 +00:00
Jim Laskey
288c230cbd Use global info for alias analysis.
llvm-svn: 31035
2006-10-18 12:29:57 +00:00
Chris Lattner
cd00328fad Teach the branch folder to update debug info if it removes blocks with line
# notes in it.

llvm-svn: 31026
2006-10-17 23:17:27 +00:00
Chris Lattner
22e311fe77 add a method to remove a line # record.
llvm-svn: 31025
2006-10-17 23:16:42 +00:00
Chris Lattner
dd39b9d358 Do not leak all of the SourceLineInfo objects. Do not bother mallocing each
one separately.

llvm-svn: 31022
2006-10-17 22:06:46 +00:00
Chris Lattner
8708a62f93 Trivial patch to speed up legalizing common i64 constants.
llvm-svn: 31020
2006-10-17 21:47:13 +00:00
Chris Lattner
bfbb76e103 Fix CodeGen/PowerPC/2006-10-17-brcc-miscompile.ll
llvm-svn: 31019
2006-10-17 21:24:15 +00:00
Evan Cheng
3be6b15cd9 Fix printer for StoreSDNode.
llvm-svn: 31017
2006-10-17 21:18:26 +00:00
Evan Cheng
2113bdf34d Reflect MemOpAddrMode change; added a helper to create pre-indexed load.
llvm-svn: 31016
2006-10-17 21:14:32 +00:00
Jim Laskey
7f16ca4872 Make it simplier to dump DAGs while in DAGCombiner. Remove a nasty optimization.
llvm-svn: 31009
2006-10-17 19:33:52 +00:00
Chris Lattner
ef7c2e1dc8 Enable deleting branches to successor blocks. With the previous patches,
branch folding can now compile stuff like this:

void foo(int W, int X, int Y, int Z) {
  if (W & 1) {
    for (; X;--X) bar();
  } else if (W & 2) {
    for (; Y;--Y) bar();
  } else if (W & 4) {
    for (; Z;--Z) bar();
  } else if (W & 8) {
    for (; W;--W) bar();
  }

  if (W) {
    bar();
  }
}

contrived testcase where loops exits all end up merging together.  To have
the loop merges be:

...
        cmplw cr0, r30, r27
        bne cr0, LBB1_14        ;bb38
LBB1_16:        ;cond_next48.loopexit
        mr r27, r29
LBB1_20:        ;cond_next48
        cmplwi cr0, r27, 0
        beq cr0, LBB1_22        ;UnifiedReturnBlock
...

instead of:


...
        cmplw cr0, r30, r27
        bne cr0, LBB1_14        ;bb38
LBB1_16:        ;cond_next48.loopexit
        mr r27, r29
        b LBB1_20       ;cond_next48
LBB1_17:        ;cond_next48.loopexit1
        b LBB1_20       ;cond_next48
LBB1_18:        ;cond_next48.loopexit2
        b LBB1_20       ;cond_next48
LBB1_19:        ;cond_next48.loopexit3
LBB1_20:        ;cond_next48
        cmplwi cr0, r27, 0
        beq cr0, LBB1_22        ;UnifiedReturnBlock
...


This is CodeGen/PowerPC/branch-opt.ll

llvm-svn: 31006
2006-10-17 18:16:40 +00:00
Jim Laskey
37679253ae Clean up interface to getGlobalLinkName.
llvm-svn: 31001
2006-10-17 17:17:24 +00:00
Chris Lattner
8464c7e3e1 Reenable this pass, fixing the bugs in it.
It now correctly deletes unreachable blocks and blocks that are empty.

llvm-svn: 31000
2006-10-17 17:13:52 +00:00
Evan Cheng
d9bec725a2 Make sure operand does have size and element type operands.
llvm-svn: 30999
2006-10-17 17:06:35 +00:00
Jim Laskey
620df3ea5f Basic support for getGlobalLinkName.
llvm-svn: 30997
2006-10-17 13:41:07 +00:00
Evan Cheng
2d9318cff1 Be careful when looking through a vbit_convert. Optimizing this:
(vector_shuffle
  (vbitconvert (vbuildvector (copyfromreg v4f32), 1, v4f32), 4, f32),
  (undef, undef, undef, undef), (0, 0, 0, 0), 4, f32)
to the
  vbitconvert
is a very bad idea.

llvm-svn: 30989
2006-10-16 22:49:37 +00:00
Jim Laskey
06f4428abc Pass AliasAnalysis thru to DAGCombiner.
llvm-svn: 30984
2006-10-16 20:52:31 +00:00
Jim Laskey
5fe261bc52 Global name regression.
llvm-svn: 30982
2006-10-16 19:38:41 +00:00
Jim Laskey
1070dfefba Tidy up after truncstore changes.
llvm-svn: 30961
2006-10-14 12:14:27 +00:00
Evan Cheng
bfd74c6d9c Debug tweak.
llvm-svn: 30959
2006-10-14 08:34:06 +00:00
Chris Lattner
08aa96b824 Make sure that the node returned by SimplifySetCC is added to the worklist
so that it can be deleted if unused.

llvm-svn: 30955
2006-10-14 03:52:46 +00:00