aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* add a little helper function that does PHI translation.Chris Lattner2008-12-022-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60405 91177308-0d34-0410-b5e6-96231b3b80d8
* add a noteChris Lattner2008-12-021-0/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60404 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some errors that crept in. No functionality change.Bill Wendling2008-12-021-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60403 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge two if-statements into one.Bill Wendling2008-12-021-7/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60402 91177308-0d34-0410-b5e6-96231b3b80d8
* More styalistic changes. No functionality change.Bill Wendling2008-12-021-15/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60401 91177308-0d34-0410-b5e6-96231b3b80d8
* add densemap range insertion method.Chris Lattner2008-12-021-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60400 91177308-0d34-0410-b5e6-96231b3b80d8
* - Remove the buggy -X/C -> X/-C transform. This isn't valid when X isn't aBill Wendling2008-12-022-12/+10
| | | | | | | | | | constant. If X is a constant, then this is folded elsewhere. - Added a note to Target/README.txt to indicate that we'd like to implement this when we're able. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60399 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve comment.Bill Wendling2008-12-021-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60398 91177308-0d34-0410-b5e6-96231b3b80d8
* - Reduce nesting.Bill Wendling2008-12-021-24/+18
| | | | | | | | | - No need to do a swap on a canonicalized pattern. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60397 91177308-0d34-0410-b5e6-96231b3b80d8
* some random comment improvements.Chris Lattner2008-12-021-11/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60395 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for my previous PRE fix.Owen Anderson2008-12-021-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60394 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue that Chris noticed, where local PRE was not properly instantiatingOwen Anderson2008-12-021-2/+7
| | | | | | | | a new value numbering set after splitting a critical edge. This increases the number of instances of PRE on 403.gcc from ~60 to ~570. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60393 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3124: overly strict assert.Evan Cheng2008-12-022-2/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60392 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a few more transformations.Dale Johannesen2008-12-021-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60391 91177308-0d34-0410-b5e6-96231b3b80d8
* Second stab at target-dependent lowering of everyone's favorite nodes: [SU]ADDOBill Wendling2008-12-023-28/+36
| | | | | | | | | | | | - LowerXADDO lowers [SU]ADDO into an ADD with an implicit EFLAGS define. The EFLAGS are fed into a SETCC node which has the conditional COND_O or COND_C, depending on the type of ADDO requested. - LowerBRCOND now recognizes if it's coming from a SETCC node with COND_O or COND_C set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60388 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r60382. This time, don't mark "ADC" nodes with "implicit EFLAGS".Bill Wendling2008-12-023-29/+110
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60385 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r60382. It caused CodeGen/X86/i2k.ll and others to fail.Bill Wendling2008-12-013-135/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60383 91177308-0d34-0410-b5e6-96231b3b80d8
* - Have "ADD" instructions return an implicit EFLAGS.Bill Wendling2008-12-013-40/+135
| | | | | | | - Add support for seto, setno, setc, and setnc instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60382 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand getVTList, getNodeValueTypes, and SelectNodeTo to handle more value ↵Bill Wendling2008-12-012-0/+42
| | | | | | types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60381 91177308-0d34-0410-b5e6-96231b3b80d8
* Add rdar reference, make this actually fail when the patch isn't applied.Chris Lattner2008-12-011-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60376 91177308-0d34-0410-b5e6-96231b3b80d8
* Consider only references to an IV within the loop whenDale Johannesen2008-12-012-6/+54
| | | | | | | | | | | figuring out the base of the IV. This produces better code in the example. (Addresses use (IV) instead of (BASE,IV) - a significant improvement on low-register machines like x86). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60374 91177308-0d34-0410-b5e6-96231b3b80d8
* reenable array_pod_sort, this time hopefully happy on 64-bit Chris Lattner2008-12-011-9/+12
| | | | | | | and big endian systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60371 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't rebuild RHSNeg. Just use the one that's already there.Bill Wendling2008-12-011-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60370 91177308-0d34-0410-b5e6-96231b3b80d8
* Document what this check is doing. Also, no need to cast to ConstantInt.Bill Wendling2008-12-011-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60369 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a simple comparison. Overflow on integer negation can only occur when theBill Wendling2008-12-011-13/+2
| | | | | | | integer is "minint". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60366 91177308-0d34-0410-b5e6-96231b3b80d8
* don't #include <algorithm> into the llvm namespace.Chris Lattner2008-12-011-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60365 91177308-0d34-0410-b5e6-96231b3b80d8
* CellSPU:Scott Michel2008-12-014-99/+154
| | | | | | | | | | - Fix v2[if]64 vector insertion code before IBM files a bug report. - Ensure that zero (0) offsets relative to $sp don't trip an assert (add $sp, 0 gets legalized to $sp alone, tripping an assert) - Shuffle masks passed to SPUISD::SHUFB are now v16i8 or v4i32 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60358 91177308-0d34-0410-b5e6-96231b3b80d8
* switch to std::sort until I have time to sort this out.Chris Lattner2008-12-011-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60354 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanups suggested by duncan, thanks!Chris Lattner2008-12-011-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60353 91177308-0d34-0410-b5e6-96231b3b80d8
* define array_pod_sort in terms of operator< instead of my brainChris Lattner2008-12-011-13/+9
| | | | | | | | damaged approximation. This should fix it on big endian platforms and on 64-bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60352 91177308-0d34-0410-b5e6-96231b3b80d8
* There are no longer any places that require aDuncan Sands2008-12-0111-52/+48
| | | | | | | | | MERGE_VALUES node with only one operand, so get rid of special code that only existed to handle that possibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60349 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the interface to the type legalization methodDuncan Sands2008-12-0120-378/+377
| | | | | | | | | | | | ReplaceNodeResults: rather than returning a node which must have the same number of results as the original node (which means mucking around with MERGE_VALUES, and which is also easy to get wrong since SelectionDAG folding may mean you don't get the node you expect), return the results in a vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60348 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the FoldOrWithConstant method to fold for any two constants whichBill Wendling2008-12-011-23/+22
| | | | | | | don't have overlapping bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60344 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce copy-and-paste code by splitting out the code into its own function.Bill Wendling2008-12-011-58/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60343 91177308-0d34-0410-b5e6-96231b3b80d8
* Use m_Specific() instead of double matching.Bill Wendling2008-12-012-19/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60341 91177308-0d34-0410-b5e6-96231b3b80d8
* Move pattern check outside of the if-then statement. This prevents us from ↵Bill Wendling2008-12-011-10/+12
| | | | | | fiddling with constants unless we have to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60340 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename some variables, only increment BI once at the start of the loop ↵Chris Lattner2008-12-011-38/+30
| | | | | | instead of throughout it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60339 91177308-0d34-0410-b5e6-96231b3b80d8
* pull the predMap densemap out of the inner loop of performPRE, soChris Lattner2008-12-011-2/+4
| | | | | | | | that it isn't reallocated all the time. This is a tiny speedup for GVN: 3.90->3.88s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60338 91177308-0d34-0410-b5e6-96231b3b80d8
* switch a couple more calls to use array_pod_sort.Chris Lattner2008-12-012-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60337 91177308-0d34-0410-b5e6-96231b3b80d8
* don't assume iterators implicitly convert to pointers.Chris Lattner2008-12-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60336 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new array_pod_sort function and switch LSR to use itChris Lattner2008-12-012-2/+39
| | | | | | | | | | instead of std::sort. This shrinks the release-asserts LSR.o file by 1100 bytes of code on my system. We should start using array_pod_sort where possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60335 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate use of setvector for the DeadInsts set, just use a smallvector.Chris Lattner2008-12-011-17/+31
| | | | | | | This is a lot cheaper and conceptually simpler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60332 91177308-0d34-0410-b5e6-96231b3b80d8
* DeleteTriviallyDeadInstructions is always passed theChris Lattner2008-12-011-10/+9
| | | | | | | DeadInsts ivar, just use it directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60330 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify DeleteTriviallyDeadInstructions again, unlike my previousChris Lattner2008-12-011-20/+13
| | | | | | | | | buggy rewrite, this notifies ScalarEvolution of a pending instruction about to be removed and then erases it, instead of erasing it then notifying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60329 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify these patterns using m_Specific. No need to grep for Chris Lattner2008-12-012-19/+7
| | | | | | | xor in testcase (or is a substring). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60328 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach jump threading to clean up after itself, DCE and constfolding theChris Lattner2008-12-011-1/+24
| | | | | | | | | | new instructions it simplifies. Because we're threading jumps on edges with constants coming in from PHI's, we inherently are exposing a lot more constants to the new block. Folding them and deleting dead conditions allows the cost model in jump threading to be more accurate as it iterates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60327 91177308-0d34-0410-b5e6-96231b3b80d8
* The PreVerifier pass preserves everything. In practice, thisChris Lattner2008-12-011-0/+4
| | | | | | | | prevents the passmgr from adding yet-another domtree invocation for Verifier if there is already one live. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60326 91177308-0d34-0410-b5e6-96231b3b80d8
* Change instcombine to use FoldPHIArgGEPIntoPHI to fold two operand PHIsChris Lattner2008-12-011-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of using FoldPHIArgBinOpIntoPHI. In addition to being more obvious, this also fixes a problem where instcombine wouldn't merge two phis that had different variable indices. This prevented instcombine from factoring big chunks of code in 403.gcc. For example: insn_cuid.exit: - %tmp336 = load i32** @uid_cuid, align 4 - %tmp337 = getelementptr %struct.rtx_def* %insn_addr.0.ph.i, i32 0, i32 3 - %tmp338 = bitcast [1 x %struct.rtunion]* %tmp337 to i32* - %tmp339 = load i32* %tmp338, align 4 - %tmp340 = getelementptr i32* %tmp336, i32 %tmp339 br label %bb62 bb61: - %tmp341 = load i32** @uid_cuid, align 4 - %tmp342 = getelementptr %struct.rtx_def* %insn, i32 0, i32 3 - %tmp343 = bitcast [1 x %struct.rtunion]* %tmp342 to i32* - %tmp344 = load i32* %tmp343, align 4 - %tmp345 = getelementptr i32* %tmp341, i32 %tmp344 br label %bb62 bb62: - %iftmp.62.0.in = phi i32* [ %tmp345, %bb61 ], [ %tmp340, %insn_cuid.exit ] + %insn.pn2 = phi %struct.rtx_def* [ %insn, %bb61 ], [ %insn_addr.0.ph.i, %insn_cuid.exit ] + %tmp344.pn.in.in = getelementptr %struct.rtx_def* %insn.pn2, i32 0, i32 3 + %tmp344.pn.in = bitcast [1 x %struct.rtunion]* %tmp344.pn.in.in to i32* + %tmp341.pn = load i32** @uid_cuid + %tmp344.pn = load i32* %tmp344.pn.in + %iftmp.62.0.in = getelementptr i32* %tmp341.pn, i32 %tmp344.pn %iftmp.62.0 = load i32* %iftmp.62.0.in git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60325 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach inst combine to merge GEPs through PHIs. This is reallyChris Lattner2008-12-012-17/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | important because it is sinking the loads using the GEPs, but not the GEPs themselves. This triggers 647 times on 403.gcc and makes the .s file much much nicer. For example before: je LBB1_87 ## bb78 LBB1_62: ## bb77 leal 84(%esi), %eax LBB1_63: ## bb79 movl (%eax), %eax ... LBB1_87: ## bb78 movl $0, 4(%esp) movl %esi, (%esp) call L_make_decl_rtl$stub jmp LBB1_62 ## bb77 after: jne LBB1_63 ## bb79 LBB1_62: ## bb78 movl $0, 4(%esp) movl %esi, (%esp) call L_make_decl_rtl$stub LBB1_63: ## bb79 movl 84(%esi), %eax The input code was (and the GEPs are merged and the PHI is now eliminated by instcombine): br i1 %tmp233, label %bb78, label %bb77 bb77: %tmp234 = getelementptr %struct.tree_node* %t_addr.3, i32 0, i32 0, i32 22 br label %bb79 bb78: call void @make_decl_rtl(%struct.tree_node* %t_addr.3, i8* null) nounwind %tmp235 = getelementptr %struct.tree_node* %t_addr.3, i32 0, i32 0, i32 22 br label %bb79 bb79: %iftmp.12.0.in = phi %struct.rtx_def** [ %tmp235, %bb78 ], [ %tmp234, %bb77 ] %iftmp.12.0 = load %struct.rtx_def** %iftmp.12.0.in git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60322 91177308-0d34-0410-b5e6-96231b3b80d8
* testcase for my previous commit.Chris Lattner2008-12-011-0/+42
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60315 91177308-0d34-0410-b5e6-96231b3b80d8