Commit Graph

27102 Commits

Author SHA1 Message Date
Chris Lattner
34ea07692f add two helper methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31143 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 23:35:35 +00:00
Devang Patel
f2ca21f88f Add removeModule().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31142 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 23:12:26 +00:00
Chris Lattner
a4bcfe12d1 Enable tail merging by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31140 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 22:10:12 +00:00
Evan Cheng
2cd931fee5 Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31139 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 21:47:11 +00:00
Rafael Espindola
c391d16b49 implement STRB and STRH
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31138 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 20:34:27 +00:00
Rafael Espindola
d8ed7f8cde expand ISD::MEMSET
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31137 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 20:08:22 +00:00
Andrew Lenharth
12711dfb16 Make these hack flags hidden, like other dsa hack flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31136 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 19:55:24 +00:00
Andrew Lenharth
72be6e63b1 Revert the aggressive inlining for now, it doesn't handle external correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31135 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 19:53:37 +00:00
Andrew Lenharth
9a9aa4c1ad change this back
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31134 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 19:52:54 +00:00
Andrew Lenharth
21c04a3c8b restore these tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31133 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 19:52:27 +00:00
Chris Lattner
ddaaa37487 Handle fallout from the recent branch-on-undef changes. This fixes
Prolangs-C/agrep and SCCP/2006-10-23-IPSCCP-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31132 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 18:57:02 +00:00
Chris Lattner
e285d59ee6 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31131 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 18:54:35 +00:00
Chris Lattner
b354343af7 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31130 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 18:38:22 +00:00
Jim Laskey
66ebf0973d More complete solution to deleting blocks and debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31129 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 14:56:37 +00:00
Jim Laskey
978b35e502 [SU]int update - inactive code may get activated someday
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31128 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 14:39:22 +00:00
Evan Cheng
937e87ad2a Fix test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31127 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 05:11:09 +00:00
Nick Lewycky
c17229d591 Remove the Backwards operation. Resolving now works at the time when a
property is added by running through the list of uses of the value and
adding resolved properties to the property set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-23 01:56:02 +00:00
Chris Lattner
b2e806eecd Fix phi node updating for switches lowered to linear sequences of branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31125 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 23:00:53 +00:00
Chris Lattner
e236ac64a2 disable this code for now, it's not yet safely updating phi nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31124 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 22:47:10 +00:00
Nick Lewycky
7e189d095e Fix similar missing optimization opportunity in XOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31123 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 22:22:58 +00:00
Chris Lattner
ecb8d06356 this part implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31122 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:40:12 +00:00
Nick Lewycky
92a8b71dc1 Whoops! Add missing NULL check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31121 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:38:24 +00:00
Anton Korobeynikov
1a3ecbb4a6 Do section switching right way for Mingw\Cygwin and Linux.
This will allow (after llvm-gcc linkage fix) more dummy tests using
libstdc++ to pass on mingw :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31120 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:37:13 +00:00
Chris Lattner
d2c1d2200b Implement PR964 and Regression/CodeGen/Generic/SwitchLowering.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31119 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:36:53 +00:00
Nick Lewycky
5062250f36 Handle "if ((x|y) != 0)" for ints like we do for bools. Fixes missed
optimization opportunity pointed out by Chris Lattner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31118 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:36:41 +00:00
Chris Lattner
96f5362ff2 new testcase for PR964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31117 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 21:36:06 +00:00
Nick Lewycky
802fe27d3e AllocaInst can't return a null pointer. Fixes missed optimization
opportunity pointed out by Andrew Lewycky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31115 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 19:53:27 +00:00
Chris Lattner
32b1e87f11 Add a workaround for PR962, disabling the more aggressive form of this
transformation.  This speeds up a C++ app 2.25x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31113 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 18:42:26 +00:00
Reid Spencer
2cb46e18cb Don't generate a prototype for _setjmp. At least on Linux, this function
has a different prototype than the one #included from <setjmp.h>. This
patch fixes siod and a number of other test cases on Linux that were
failing the CBE because of this _setjmp issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31112 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 09:58:21 +00:00
Reid Spencer
21be86535b Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31111 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 07:03:43 +00:00
Reid Spencer
fd6131b5a8 Remove unneeded CHECK_FOR_ERROR invocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31110 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 07:03:09 +00:00
Chris Lattner
1ae022f647 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31109 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 06:08:13 +00:00
Chris Lattner
10b271152a change keyword to datalayout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31108 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 06:07:41 +00:00
Chris Lattner
d2f9e609aa Change keyword to datalayout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31107 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 06:06:56 +00:00
Chris Lattner
d2d86703f0 3 Changes:
1. Better document what is going on here.
2. Only hack on one branch per iteration, making the results less conservative.
3. Handle the problematic case by marking edges executable instead of by
   playing with value lattice states.  This is far less pessimistic, and fixes
   SCCP/ipsccp-gvar.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31106 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 05:59:17 +00:00
Chris Lattner
cd5bad3711 New, wonderful isSuccessor method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31103 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 06:50:05 +00:00
Chris Lattner
4bc135e93b don't break infinite loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31102 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 06:11:43 +00:00
Chris Lattner
7c4fe259f8 Implement support for branch reversal, fix a bug in branch analysis.
This provides stuff like:

        cmpw cr0, r15, r29
        mr r14, r15
-       bge cr0, LBB3_111       ;bb656
-       b LBB3_90       ;bb501
+       blt cr0, LBB3_90        ;bb501
 LBB3_111:      ;bb656
        lwz r18, 68(r1)

which is particularly good for dispatch group formation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31101 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 06:03:11 +00:00
Chris Lattner
a2d799531a 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31100 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:54:00 +00:00
Chris Lattner
9cd6875917 Implement support for branch condition reversal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31099 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:52:40 +00:00
Chris Lattner
2d47bd937c Transform code like:
jle FOO
  jmp BAR
BAR:

into:

  jle FOO
BAR:

... whoa!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31098 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:43:30 +00:00
Chris Lattner
879d09cf13 Simplify code, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31097 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:42:09 +00:00
Chris Lattner
54108068b7 implement support for inserting a cond branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31096 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:36:13 +00:00
Chris Lattner
34a84ac81c allow insertion of a conditional branch with fall-through
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31095 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:34:23 +00:00
Chris Lattner
386e29065d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31094 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 05:08:28 +00:00
Chris Lattner
2a445add12 update assert message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31093 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 04:42:29 +00:00
Chris Lattner
12143054aa Add an experimental cross-jumping implementation.
This is currently disabled by default and limited in several ways, but does
have a positive effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31090 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-21 00:47:49 +00:00
Chris Lattner
846c1b4936 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31089 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 22:44:45 +00:00
Chris Lattner
8ace2cd034 implement MachineOperand::isIdenticalTo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31088 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 22:39:59 +00:00
Chris Lattner
fcfcb6cb50 add isIdenticalTo method to machineinstr/operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31087 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 22:39:36 +00:00