aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* eliminate calls to deprecated Use::init() interfaceGabor Greif2008-05-265-139/+139
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51570 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor code to copy global value attributes likeDuncan Sands2008-05-269-42/+47
| | | | | | | | | | | | | | | | the section or the visibility from one global value to another: copyAttributesFrom. This is particularly useful for duplicating functions: previously this was done by explicitly copying each attribute in turn at each place where a new function was created out of an old one, with the result that obscure attributes were regularly forgotten (like the collector or the section). Hopefully now everything is uniform and nothing is forgotten. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a DenseMap instead of an std::map, speeding up the testcase in PR2368 by ↵Owen Anderson2008-05-261-3/+3
| | | | | | about a third. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51565 91177308-0d34-0410-b5e6-96231b3b80d8
* The enabling of remat in 2-address conversion breaks this test:Bill Wendling2008-05-261-23/+30
| | | | | | | | | | | | | Running /Users/void/llvm/llvm.src/test/CodeGen/X86/dg.exp ... FAIL: /Users/void/llvm/llvm.src/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll Failed with exit(1) at line 1 while running: llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll | llc -march=x86 -mattr=+sse2 -stats |& grep {1 .*folded into instructions} child process exited abnormally Make this conditional for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51563 91177308-0d34-0410-b5e6-96231b3b80d8
* A problem that's exposed when machine LICM is enabled. Consider this code:Bill Wendling2008-05-261-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | LBB1_3: # bb ... xorl %ebp, %ebp subl (%ebx), %ebp ... incl %ecx cmpl %edi, %ecx jl LBB1_3 # bb Whe using machine LICM, LLVM converts it into: xorl %esi, %esi LBB1_3: # bb ... movl %esi, %ebp subl (%ebx), %ebp ... incl %ecx cmpl %edi, %ecx jl LBB1_3 # bb Two address conversion inserts the copy instruction. However, it's cheaper to rematerialize it, and remat helps reduce register pressure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51562 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't treat values as signed when looking at loop steppings in HowForToNonZero.Nick Lewycky2008-05-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51560 91177308-0d34-0410-b5e6-96231b3b80d8
* "ret (constexpr)" can't be folded into a Constant. Add a method toNick Lewycky2008-05-252-16/+55
| | | | | | | | | | | Analysis/ConstantFolding to fold ConstantExpr's, then make instcombine use it to try to use targetdata to fold constant expressions on void instructions. Also extend the icmp(inttoptr, inttoptr) folding to handle the case where int size != ptr size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51559 91177308-0d34-0410-b5e6-96231b3b80d8
* Create archives with the same permissions are ar.Owen Anderson2008-05-241-0/+7
| | | | | | | Patch by Mikael Lepistö. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51540 91177308-0d34-0410-b5e6-96231b3b80d8
* Add FreeBSD/PPC support, patch by Marcel Moolenaar!Chris Lattner2008-05-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51538 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a serious brain-o. Obviously no-one reviewed my patch :(Chris Lattner2008-05-241-2/+4
| | | | | | | This fixes PR2359 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51536 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR2358 by resolving calls with undef arguments to overdefined.Chris Lattner2008-05-241-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51535 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.Evan Cheng2008-05-242-14/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51533 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and ↵Evan Cheng2008-05-242-21/+43
| | | | | | x86.sse2.unpckl.pd intrinsics. These will be lowered into shuffles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51531 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak how ConstantFP80Ty constants are outputDuncan Sands2008-05-241-1/+1
| | | | | | | so that gcc doesn't warn about them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51529 91177308-0d34-0410-b5e6-96231b3b80d8
* Put initialized const weak objects into correctDale Johannesen2008-05-241-1/+9
| | | | | | | | sections on ppc32 darwin. g++.dg/abi/key2.C git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51527 91177308-0d34-0410-b5e6-96231b3b80d8
* This is done.Evan Cheng2008-05-241-46/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51526 91177308-0d34-0410-b5e6-96231b3b80d8
* Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.Evan Cheng2008-05-241-19/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51523 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into ↵Evan Cheng2008-05-241-4/+0
| | | | | | load and shuffle instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51522 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove x86.sse2.loadh.pd and x86.sse2.loadl.pd. These will be lowered into ↵Evan Cheng2008-05-241-5/+0
| | | | | | load and shuffle instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51521 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 51440 as it breaks a bunch of PIC tests.Evan Cheng2008-05-231-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51513 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't silently truncate array extents to 32 bits.Dan Gohman2008-05-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51505 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missed CommonLinkage check.Dale Johannesen2008-05-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51503 91177308-0d34-0410-b5e6-96231b3b80d8
* Use movlps / movhps to modify low / high half of 16-byet memory location.Evan Cheng2008-05-233-62/+69
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51501 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places toDan Gohman2008-05-2315-61/+34
| | | | | | | use it instead of duplicating its functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #includes to make some dependencies explicit.Dan Gohman2008-05-234-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51496 91177308-0d34-0410-b5e6-96231b3b80d8
* Issue errors in several situations instead of aborting.Dan Gohman2008-05-231-7/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51493 91177308-0d34-0410-b5e6-96231b3b80d8
* Elaborate on the entry on integer vector multiplication by constants.Dan Gohman2008-05-231-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51491 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a duplicated pattern.Evan Cheng2008-05-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51490 91177308-0d34-0410-b5e6-96231b3b80d8
* Use PMULDQ for v2i64 multiplies when SSE4.1 is available. And addDan Gohman2008-05-233-7/+13
| | | | | | | load-folding table entries for PMULDQ and PMULLD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51489 91177308-0d34-0410-b5e6-96231b3b80d8
* New entry.Evan Cheng2008-05-231-0/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51487 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite a loop to avoid using iterators pointing toDale Johannesen2008-05-231-4/+6
| | | | | | | | | elements that have been erased. Based on a patch by Nicolas Capens. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51485 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another isFirstClassType that now needs to be isSingleValueType.Dan Gohman2008-05-231-1/+1
| | | | | | | This fixes recent CBE regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51483 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace some weird usage of UserOp1 introduced in r49492 by a plain if.Matthijs Kooijman2008-05-231-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51482 91177308-0d34-0410-b5e6-96231b3b80d8
* Restucture a part of the SimplifyCFG pass and include a testcase.Matthijs Kooijman2008-05-231-65/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SimplifyCFG pass looks at basic blocks that contain only phi nodes, followed by an unconditional branch. In a lot of cases, such a block (BB) can be merged into their successor (Succ). This merging is performed by TryToSimplifyUncondBranchFromEmptyBlock. It does this by taking all phi nodes in the succesor block Succ and expanding them to include the predecessors of BB. Furthermore, any phi nodes in BB are moved to Succ and expanded to include the predecessors of Succ as well. Before attempting this merge, CanPropagatePredecessorsForPHIs checks to see if all phi nodes can be properly merged. All functional changes are made to this function, only comments were updated in TryToSimplifyUncondBranchFromEmptyBlock. In the original code, CanPropagatePredecessorsForPHIs looks quite convoluted and more like stack of checks added to handle different kinds of situations than a comprehensive check. In particular the first check in the function did some value checking for the case that BB and Succ have a common predecessor, while the last check in the function simply rejected all cases where BB and Succ have a common predecessor. The first check was still useful in the case that BB did not contain any phi nodes at all, though, so it was not completely useless. Now, CanPropagatePredecessorsForPHIs is restructured to to look a lot more similar to the code that actually performs the merge. Both functions now look at the same phi nodes in about the same order. Any conflicts (phi nodes with different values for the same source) that could arise from merging or moving phi nodes are detected. If no conflicts are found, the merge can happen. Apart from only restructuring the checks, two main changes in functionality happened. Firstly, the old code rejected blocks with common predecessors in most cases. The new code performs some extra checks so common predecessors can be handled in a lot of cases. Wherever common predecessors still pose problems, the blocks are left untouched. Secondly, the old code rejected the merge when values (phi nodes) from BB were used in any other place than Succ. However, it does not seem that there is any situation that would require this check. Even more, this can be proven. Consider that BB is a block containing of a single phi node "%a" and a branch to Succ. Now, since the definition of %a will dominate all of its uses, BB will dominate all blocks that use %a. Furthermore, since the branch from BB to Succ is unconditional, Succ will also dominate all uses of %a. Now, assume that one predecessor of Succ is not dominated by BB (and thus not dominated by Succ). Since at least one use of %a (but in reality all of them) is reachable from Succ, you could end up at a use of %a without passing through it's definition in BB (by coming from X through Succ). This is a contradiction, meaning that our original assumption is wrong. Thus, all predecessors of Succ must also be dominated by BB (and thus also by Succ). This means that moving the phi node %a from BB to Succ does not pose any problems when the two blocks are merged, and any use checks are not needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51478 91177308-0d34-0410-b5e6-96231b3b80d8
* Indent fix.Matthijs Kooijman2008-05-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51477 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant integer vectors may also be negated.Nick Lewycky2008-05-231-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51476 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Nick Lewycky2008-05-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51475 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert X + X --> X * 2 optz'n which pessimizes heavily on x86.Nick Lewycky2008-05-231-13/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51474 91177308-0d34-0410-b5e6-96231b3b80d8
* we compile multiply-by-constant into horrible code. Doesn't sse4 have someChris Lattner2008-05-231-0/+38
| | | | | | | instruction for doing this? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51473 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement X + X for vectors.Nick Lewycky2008-05-231-5/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51472 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a recently added optimization to not crash on vectors.Nick Lewycky2008-05-231-2/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51471 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the new code in instcombine's ComputeNumSignBits for handlingDan Gohman2008-05-232-51/+22
| | | | | | | | and/or to handle more cases (such as this add-sitofp.ll testcase), and port it to selectiondag's ComputeNumSignBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51469 91177308-0d34-0410-b5e6-96231b3b80d8
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-238-1261/+1633
| | | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-231-2/+2
| | | | | | | exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51467 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove warnings about comparison between signed and unsigned expressions.Bill Wendling2008-05-231-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51465 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow for switch with no cases. Was causing faultDale Johannesen2008-05-231-0/+2
| | | | | | | | in gcc.dg/pr27531-1.c. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51464 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug: rcpps can only folds a load if the address is 16-byte aligned. Fixed ↵Evan Cheng2008-05-231-57/+79
| | | | | | | | | many 'ps' load folding patterns in X86InstrSSE.td which are missing the proper alignment checks. Also fixed some 80 col. violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51462 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more IR support for the new extractvalue and insertvalueDan Gohman2008-05-232-12/+79
| | | | | | | instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-231-2/+2
| | | | | | | exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51460 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-233-6/+6
| | | | | | | exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8