summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* Initial support for the CMake build system.Oscar Fuentes2008-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement review feedback from Devang: make useDuncan Sands2008-09-20
| | | | | | | of mayReadFromMemory and mayWriteToMemory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56387 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the MarkModRef pass (use AddReadAttrs instead).Duncan Sands2008-09-19
| | | | | | | | | Unfortunately this means removing one regression test of GlobalsModRef because I couldn't work out how to perform it without MarkModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56342 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new pass AddReadAttrs which works out which functionsDuncan Sands2008-09-19
| | | | | | | | | | can get the readnone/readonly attributes, and gives them it. The plan is to remove markmodref (which did the same thing by querying GlobalsModRef) and delete the analogous functionality from GlobalsModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56341 91177308-0d34-0410-b5e6-96231b3b80d8
* splitLoop does not handle split condition EQ.Devang Patel2008-09-18
| | | | | | | Fixes PR 2805 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56321 91177308-0d34-0410-b5e6-96231b3b80d8
* Decrementing the iterator here could be wrong if the worklist is empty after ↵Bill Wendling2008-09-18
| | | | | | | | | the "erase". Thanks to Ji Young Park for the patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56316 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to place hoisted instructions befoe icmp instruction.Devang Patel2008-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56315 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not hoist instruction above branch condition. The instruction may use ↵Devang Patel2008-09-17
| | | | | | branch condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56286 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not ignore iv uses outside the loop.Devang Patel2008-09-17
| | | | | | | This one slipped through cracks very well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56284 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve instcombine's handling of integer min and max in two ways:Dan Gohman2008-09-16
| | | | | | | | | | | | | | | | | - Recognize expressions like "x > -1 ? x : 0" as min/max and turn them into expressions like "x < 0 ? 0 : x", which is easily recognizable as a min/max operation. - Refrain from folding expression like "y/2 < 1" to "y < 2" when the comparison is being used as part of a min or max idiom, like "y/2 < 1 ? 1 : y/2". In that case, the division has another use, so folding doesn't eliminate it, and obfuscates the min/max, making it harder to recognize as a min/max operation. These benefit ScalarEvolution, CodeGen, and anything else that wants to recognize integer min and max. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56246 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LSR to optimize away SMAX operations for tripcounts in commonDan Gohman2008-09-15
| | | | | | | | | | cases. See the comment above OptimizeSMax for the full story, and the testcase for an example. This cancels out a pessimization commonly attributed to indvars, and will allow us to lift some of the artificial throttles in indvars, rather than add new ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56230 91177308-0d34-0410-b5e6-96231b3b80d8
* On 64-bit targets, change 32-bit getelementptr indices to be 64-bitDan Gohman2008-09-11
| | | | | | | | getelementptr indices, inserting an explicit cast if necessary. This helps expose the sign-extension operation to other optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56133 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a vectorshuffle instcombine bug introduced by r55995.Dan Gohman2008-09-11
| | | | | | | Patch by Nicolas Capens! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56129 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a copy+paste bug that Duncan spotted. For severalDan Gohman2008-09-11
| | | | | | | | cases it was still getting lucky and detecting overflow but it was clearly incorrect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56113 91177308-0d34-0410-b5e6-96231b3b80d8
* In my analysis for r56076 I missed the case where the originalDan Gohman2008-09-11
| | | | | | | multiplication overflows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56082 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an icmp+sdiv optimization to check for and handle an overflowDan Gohman2008-09-10
| | | | | | | condition. This fixes PR2740. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56076 91177308-0d34-0410-b5e6-96231b3b80d8
* fix white spaces.Devang Patel2008-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56056 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a warning about comparing signed and unsigned values.Dan Gohman2008-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56040 91177308-0d34-0410-b5e6-96231b3b80d8
* if loop induction variable is always sign or zero extended then Devang Patel2008-09-09
| | | | | | | extend the type of induction variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56017 91177308-0d34-0410-b5e6-96231b3b80d8
* fix overflow check.Devang Patel2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56011 91177308-0d34-0410-b5e6-96231b3b80d8
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve aliases, when possibleAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SimplifyDemandedVectorElts simplify vectors with multipleDan Gohman2008-09-09
| | | | | | | | | | | | | users, and teach it about shufflevector instructions. Also, fix a subtle bug in SimplifyDemandedVectorElts' insertelement code. This is a patch that was originally written by Eli Friedman, with some fixes and cleanup by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55995 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix simplifycfg crash in handing block merge.Devang Patel2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55971 91177308-0d34-0410-b5e6-96231b3b80d8
* s/RemoveUnreachableBlocks/RemoveUnreachableBlocksFromFn/gDevang Patel2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55965 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused counter.Devang Patel2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55924 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove OptimizeIVType()Devang Patel2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55913 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the callgraph correctly.Duncan Sands2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the callgraph correctly in ArgumentPromotion.Duncan Sands2008-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55895 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 55859. This doesn't change anything asDuncan Sands2008-09-08
| | | | | | | | long as the callgraph is correct. It checks for wrong callgraphs more strictly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct a comment and strip trailing whitespace.Duncan Sands2008-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55883 91177308-0d34-0410-b5e6-96231b3b80d8
* fix crash when the malloc/free function is defined or is a declaration with ↵Nuno Lopes2008-09-06
| | | | | | | | 0 parameters. this pass doesnt seem to be used, but still it's now a little more correct git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55873 91177308-0d34-0410-b5e6-96231b3b80d8
* When PruneEH turned an invoke into an ordinaryDuncan Sands2008-09-06
| | | | | | | | | | | | | call (thus changing the call site) it didn't inform the callgraph about this. But the call site does matter - as shown by the testcase, the callgraph become invalid after the inliner ran (with an edge between two functions simply missing), resulting in wrong deductions by GlobalsModRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r55859. This is breaking the build in the abscence of its companion ↵Owen Anderson2008-09-05
| | | | | | commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused map.Devang Patel2008-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55861 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete the removeCallEdgeTo callgraph method,Duncan Sands2008-09-05
| | | | | | | | | | | | | | | | because it does not maintain a correct list of callsites. I discovered (see following commit) that the inliner will create a wrong callgraph if it is fed a callgraph with correct edges but incorrect callsites. These were created by Prune-EH, and while it wasn't done via removeCallEdgeTo, it could have been done via removeCallEdgeTo, which is an accident waiting to happen. Use removeCallEdgeFor instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
* Use removeAllCalledFunctions rather than removingDuncan Sands2008-09-05
| | | | | | | edges one by one by hand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespace.Duncan Sands2008-09-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55835 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this pass return that it made a change ifDuncan Sands2008-09-05
| | | | | | | it modifies a functions attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55831 91177308-0d34-0410-b5e6-96231b3b80d8
* A loop may be unswitched multiple times. Reconstruct dom info. at the end.Devang Patel2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55806 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize loop data first.Devang Patel2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55792 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not unswitch if the function notes say we're optimizing this function for ↵Devang Patel2008-09-04
| | | | | | size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55786 91177308-0d34-0410-b5e6-96231b3b80d8
* try to seperate the mechanism into something others can useAndrew Lenharth2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55785 91177308-0d34-0410-b5e6-96231b3b80d8
* Add intrinsic forms of pow and exp2. The non-intrinsicDale Johannesen2008-09-04
| | | | | | | | forms remain to handle older IR files, but will go away soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55781 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* cleanup as per Duncan's reviewAndrew Lenharth2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55766 91177308-0d34-0410-b5e6-96231b3b80d8
* Update inline threshold for current function if the notes say, optimize for ↵Devang Patel2008-09-03
| | | | | | size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55745 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that prevented PRE from applying in some cases.Owen Anderson2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55744 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial version of a Partial Specialization IPO pass. It triggers a couple ↵Andrew Lenharth2008-09-03
| | | | | | hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55734 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in a comment.Devang Patel2008-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55720 91177308-0d34-0410-b5e6-96231b3b80d8