summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Make CanFallThrough more intelligent (so it can handle blocks with (e.g.) noChris Lattner2006-10-291-62/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | successors), and make island block movement more general. This compiles CodeGen/X86/2006-04-27-ISelFoldingBug.ll to: _loadAndRLEsource_no_exit_2E_1_label_2E_0: subl $8, %esp movl %esi, 4(%esp) movl %ebx, (%esp) movl 16(%esp), %eax movl 12(%esp), %ecx LBB1_3: #label.0 movl _last, %edx movl %edx, %esi incl %esi movl %esi, _last movl %ecx, %ebx # TRUNCATE movb %bl, %bl movl _block, %esi movb %bl, 1(%esi,%edx) cmpl %eax, _last jge LBB1_2 #codeRepl5.exitStub LBB1_4: #label.0 cmpl $257, %ecx je LBB1_2 #codeRepl5.exitStub LBB1_1: #label.0.no_exit.1_crit_edge.exitStub movl $1, %eax movl (%esp), %ebx movl 4(%esp), %esi addl $8, %esp ret LBB1_2: #codeRepl5.exitStub xorl %eax, %eax movl (%esp), %ebx movl 4(%esp), %esi addl $8, %esp ret instead of: _loadAndRLEsource_no_exit_2E_1_label_2E_0: subl $8, %esp movl %esi, 4(%esp) movl %ebx, (%esp) movl 16(%esp), %eax movl 12(%esp), %ecx jmp LBB1_3 #label.0 LBB1_1: #label.0.no_exit.1_crit_edge.exitStub movl $1, %eax movl (%esp), %ebx movl 4(%esp), %esi addl $8, %esp ret LBB1_2: #codeRepl5.exitStub xorl %eax, %eax movl (%esp), %ebx movl 4(%esp), %esi addl $8, %esp ret LBB1_3: #label.0 movl _last, %edx movl %edx, %esi incl %esi movl %esi, _last movl %ecx, %ebx # TRUNCATE movb %bl, %bl movl _block, %esi movb %bl, 1(%esi,%edx) cmpl %eax, _last jge LBB1_2 #codeRepl5.exitStub LBB1_4: #label.0 cmpl $257, %ecx jne LBB1_1 #label.0.no_exit.1_crit_edge.exitStub jmp LBB1_2 #codeRepl5.exitStub ... which is much better layout :) llvm-svn: 31282
* fix Generic/2006-10-29-Crash.llChris Lattner2006-10-291-1/+9
| | | | llvm-svn: 31281
* Fix a load folding issue that Evan noticed: there is no need to export valuesChris Lattner2006-10-291-7/+17
| | | | | | used by comparisons in the main block. llvm-svn: 31279
* VLOAD is not the LoadSDNode opcode.Evan Cheng2006-10-291-1/+0
| | | | llvm-svn: 31276
* Remove spurious case. EXTLOAD is not one of the node opcodes.Nick Lewycky2006-10-291-1/+0
| | | | llvm-svn: 31275
* split critical edges more carefully and intelligently. In particular, criticalChris Lattner2006-10-281-4/+61
| | | | | | | | edges whose destinations are not phi nodes don't bother us. Also, share split edges, since the split edge can't have a phi. This significantly reduces the complexity of generated code in some cases. llvm-svn: 31274
* Teach branch folding to fold identical jump tables together and to deleteChris Lattner2006-10-281-5/+53
| | | | | | jump tables that are dead. llvm-svn: 31273
* const'ify jump table stuffChris Lattner2006-10-281-1/+1
| | | | llvm-svn: 31269
* add an assertChris Lattner2006-10-281-0/+1
| | | | llvm-svn: 31267
* don't print dead jump tablesChris Lattner2006-10-281-0/+3
| | | | llvm-svn: 31266
* improve deletion of blocks that just contain branches by knowing thatChris Lattner2006-10-281-33/+38
| | | | | | the pred block doesn't fall through into them if it's a jumptable. llvm-svn: 31263
* Load and stores have not been uniqued properly.Jim Laskey2006-10-281-13/+42
| | | | llvm-svn: 31261
* Split *all* critical edges before isel. This resolves issues with spill codeChris Lattner2006-10-281-44/+8
| | | | | | | | | being inserted on unsplit critical edges, which introduces (sometimes large amounts of) partially dead spill code. This also fixes PR925 + CodeGen/Generic/switch-crit-edge-constant.ll llvm-svn: 31260
* Fix a serious bug that caused any x86 vector stuff to infinite loopChris Lattner2006-10-281-1/+1
| | | | llvm-svn: 31254
* Clean up.Jim Laskey2006-10-271-2/+12
| | | | llvm-svn: 31243
* Fix a bug in merged condition handling ↵Chris Lattner2006-10-271-67/+110
| | | | | | | | | | (CodeGen/Generic/2006-10-27-CondFolding.ll). Add many fewer CFG edges and PHI node entries. If there is a switch which has the same block as multiple destinations, only add that block once as a successor/phi node (in the jumptable case) llvm-svn: 31242
* Switch over from SelectionNodeCSEMap to FoldingSet.Jim Laskey2006-10-272-399/+211
| | | | llvm-svn: 31240
* remove debug codeChris Lattner2006-10-271-2/+0
| | | | llvm-svn: 31233
* Codegen cond&cond with two branches. This compiles (f.e.) ↵Chris Lattner2006-10-271-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | PowerPC/and-branch.ll to: cmpwi cr0, r4, 4 bgt cr0, LBB1_2 ;UnifiedReturnBlock LBB1_3: ;entry cmplwi cr0, r3, 0 bne cr0, LBB1_2 ;UnifiedReturnBlock instead of: cmpwi cr7, r4, 4 mfcr r2 addic r4, r3, -1 subfe r3, r4, r3 rlwinm r2, r2, 30, 31, 31 or r2, r2, r3 cmplwi cr0, r2, 0 bne cr0, LBB1_2 ;UnifiedReturnBlock LBB1_1: ;cond_true llvm-svn: 31232
* Turn conditions like x<Y|z==q into multiple blocks.Chris Lattner2006-10-271-19/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This compiles Regression/CodeGen/X86/or-branch.ll into: _foo: subl $12, %esp call L_bar$stub movl 20(%esp), %eax movl 16(%esp), %ecx cmpl $5, %eax jl LBB1_1 #cond_true LBB1_3: #entry testl %ecx, %ecx jne LBB1_2 #UnifiedReturnBlock LBB1_1: #cond_true call L_bar$stub addl $12, %esp ret LBB1_2: #UnifiedReturnBlock addl $12, %esp ret instead of: _foo: subl $12, %esp call L_bar$stub movl 20(%esp), %eax movl 16(%esp), %ecx cmpl $4, %eax setg %al testl %ecx, %ecx setne %cl testb %cl, %al jne LBB1_2 #UnifiedReturnBlock LBB1_1: #cond_true call L_bar$stub addl $12, %esp ret LBB1_2: #UnifiedReturnBlock addl $12, %esp ret And on ppc to: cmpwi cr0, r29, 5 blt cr0, LBB1_1 ;cond_true LBB1_3: ;entry cmplwi cr0, r30, 0 bne cr0, LBB1_2 ;UnifiedReturnBlock instead of: cmpwi cr7, r4, 4 mfcr r2 addic r4, r3, -1 subfe r30, r4, r3 rlwinm r29, r2, 30, 31, 31 and r2, r29, r30 cmplwi cr0, r2, 0 bne cr0, LBB1_2 ;UnifiedReturnBlock llvm-svn: 31230
* getPreIndexedLoad -> getIndexedLoad.Evan Cheng2006-10-261-21/+7
| | | | llvm-svn: 31209
* For PR950:Reid Spencer2006-10-261-24/+44
| | | | | | | | 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
* simplify codeChris Lattner2006-10-251-1/+1
| | | | llvm-svn: 31188
* turn off tail merging for nowChris Lattner2006-10-251-0/+2
| | | | llvm-svn: 31180
* be more aggressive about matching identical instructions.Chris Lattner2006-10-251-1/+1
| | | | llvm-svn: 31179
* Move getPreferredAlignmentLog from AsmPrinter to TargetDataDevang Patel2006-10-241-23/+0
| | | | llvm-svn: 31171
* visitSwitchCase knows how to insert conditional branches well. ChangeChris Lattner2006-10-241-37/+8
| | | | | | visitBr to just call visitSwitchCase, eliminating duplicate logic. llvm-svn: 31167
* Generalize CaseBlock a bit more:Chris Lattner2006-10-241-57/+74
| | | | | | | 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
* generalize 'CaseBlock'. It really allows any comparison to be inserted.Chris Lattner2006-10-241-3/+2
| | | | llvm-svn: 31161
* Don't do dead block elimination in fast mode.Jim Laskey2006-10-241-1/+2
| | | | llvm-svn: 31155
* LinearScanner hotspot.Jim Laskey2006-10-241-3/+2
| | | | llvm-svn: 31153
* Tighter data structure for deleted debug labels.Jim Laskey2006-10-242-4/+20
| | | | llvm-svn: 31152
* move single basic blocks that are neither fallen into nor fall out of intoChris Lattner2006-10-241-13/+96
| | | | | | | | | | | 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
* add moveBefore/moveAfter helper methodsChris Lattner2006-10-241-0/+12
| | | | llvm-svn: 31145
* Enable tail merging by default.Chris Lattner2006-10-231-4/+0
| | | | llvm-svn: 31140
* Minor tweak. Instead of generating:Chris Lattner2006-10-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* More complete solution to deleting blocks and debug info.Jim Laskey2006-10-233-14/+28
| | | | llvm-svn: 31129
* Fix phi node updating for switches lowered to linear sequences of branches.Chris Lattner2006-10-221-1/+13
| | | | llvm-svn: 31125
* disable this code for now, it's not yet safely updating phi nodesChris Lattner2006-10-221-3/+3
| | | | llvm-svn: 31124
* Implement PR964 and Regression/CodeGen/Generic/SwitchLowering.llChris Lattner2006-10-221-5/+44
| | | | llvm-svn: 31119
* don't break infinite loopsChris Lattner2006-10-211-6/+19
| | | | llvm-svn: 31102
* Use branch reversal to do stuff like this:Chris Lattner2006-10-211-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Transform code like:Chris Lattner2006-10-211-2/+13
| | | | | | | | | | | | | | | jle FOO jmp BAR BAR: into: jle FOO BAR: ... whoa! llvm-svn: 31098
* Three changes:Chris Lattner2006-10-211-117/+117
| | | | | | | | | | | | 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
* Add an experimental cross-jumping implementation.Chris Lattner2006-10-211-13/+231
| | | | | | | This is currently disabled by default and limited in several ways, but does have a positive effect. llvm-svn: 31090
* implement MachineOperand::isIdenticalToChris Lattner2006-10-201-0/+29
| | | | llvm-svn: 31088
* Make flag and chain edges visually distinguishable from value edges in DOTChris Lattner2006-10-201-1/+16
| | | | | | output. llvm-svn: 31067
* For PR950:Reid Spencer2006-10-205-79/+84
| | | | | | | | 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
* Partially in response to PR926: insert the newly created machine basicBill Wendling2006-10-191-8/+17
| | | | | | | | 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
* Add option for controlling inclusion of global AA.Jim Laskey2006-10-181-6/+12
| | | | llvm-svn: 31040
OpenPOWER on IntegriCloud