summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Ignore loads from and stores to local memory (i.e. allocas)Duncan Sands2008-10-041-9/+26
| | | | | | | | when deciding whether to mark a function readnone/readonly. Since the pass is currently run before SROA, this may be quite helpful. Requested by Chris on IRC. llvm-svn: 57050
* Clean up some multiple-return-value code that is no longerDan Gohman2008-10-031-5/+1
| | | | | | applicable. llvm-svn: 57033
* Nick Lewycky's patch.Devang Patel2008-10-031-1/+1
| | | | | | While hosting instruction check PHI node. llvm-svn: 57025
* Teach internalize to preserve the callgraph.Duncan Sands2008-10-031-0/+7
| | | | | | Why? Because it was there! llvm-svn: 56996
* SplitBlock should only attempt to update LoopInfo if it is actually being used.Owen Anderson2008-10-031-4/+3
| | | | llvm-svn: 56994
* Factorize code: remove variants of "strip offDuncan Sands2008-10-013-72/+18
| | | | | | | | | | | pointer bitcasts and GEP's", and centralize the logic in Value::getUnderlyingObject. The difference with stripPointerCasts is that stripPointerCasts only strips GEPs if all indices are zero, while getUnderlyingObject strips GEPs no matter what the indices are. llvm-svn: 56922
* revert the addition of Preverves(CallGraph), per Duncan's commentsNuno Lopes2008-10-011-2/+0
| | | | llvm-svn: 56917
* Call ScalarEvolution's deleteValueFromRecords before deleting anDan Gohman2008-10-011-3/+3
| | | | | | instruction, not after. This fixes some uses of free'd memory. llvm-svn: 56908
* add preserversCFG() + preservers(CallGraph)Nuno Lopes2008-09-301-0/+6
| | | | llvm-svn: 56887
* add AU.setPreservesCFG() since this pass only adds and removes function ↵Nuno Lopes2008-09-301-0/+5
| | | | | | attributes llvm-svn: 56868
* Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))Nick Lewycky2008-09-301-2/+3
| | | | llvm-svn: 56834
* Speed up these passes when the callgraph hasDuncan Sands2008-09-292-4/+16
| | | | | | | huge simply connected components. Suggested by Chris. llvm-svn: 56787
* remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)Nuno Lopes2008-09-291-1/+1
| | | | llvm-svn: 56786
* Tweak some comments.Duncan Sands2008-09-291-4/+6
| | | | llvm-svn: 56784
* Rename isWeakForLinker to mayBeOverridden. Use itDuncan Sands2008-09-294-8/+12
| | | | | | | instead of hasWeakLinkage in a bunch of optimization passes. llvm-svn: 56782
* Implement function notes as function attributes. Devang Patel2008-09-265-5/+6
| | | | llvm-svn: 56716
* Now Attributes are divided in three groupsDevang Patel2008-09-266-28/+61
| | | | | | | | | | | | | - return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. llvm-svn: 56704
* Large mechanical patch.Devang Patel2008-09-2517-131/+131
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* Commit CodeGenPrepare.cpp changes which was accidentially left out of 56526.Evan Cheng2008-09-241-19/+2
| | | | llvm-svn: 56549
* Fix fallout in CodeGenPrepare from 56526. Will likely need more work.Eric Christopher2008-09-241-119/+136
| | | | llvm-svn: 56546
* s/ParamAttrsWithIndex/FnAttributeWithIndex/gDevang Patel2008-09-244-27/+27
| | | | llvm-svn: 56535
* Put FN_NOTE_AlwaysInline and others in FnAttr namespace.Devang Patel2008-09-245-5/+5
| | | | llvm-svn: 56527
* Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.Devang Patel2008-09-235-5/+5
| | | | | | Do not check isDeclaration() in hasNote(). It is clients' responsibility. llvm-svn: 56524
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-238-26/+25
| | | | llvm-svn: 56513
* Use parameter attribute store (soon to be renamed) forDevang Patel2008-09-235-5/+5
| | | | | | Function Notes also. Function notes are stored at index ~0. llvm-svn: 56511
* Add hasNote() to check note associated with a function.Devang Patel2008-09-225-5/+5
| | | | llvm-svn: 56477
* Initial support for the CMake build system.Oscar Fuentes2008-09-225-0/+91
| | | | llvm-svn: 56419
* Implement review feedback from Devang: make useDuncan Sands2008-09-201-26/+11
| | | | | | of mayReadFromMemory and mayWriteToMemory. llvm-svn: 56387
* Remove the MarkModRef pass (use AddReadAttrs instead).Duncan Sands2008-09-191-69/+0
| | | | | | | | Unfortunately this means removing one regression test of GlobalsModRef because I couldn't work out how to perform it without MarkModRef. llvm-svn: 56342
* Add a new pass AddReadAttrs which works out which functionsDuncan Sands2008-09-191-0/+135
| | | | | | | | | 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. llvm-svn: 56341
* splitLoop does not handle split condition EQ.Devang Patel2008-09-181-0/+6
| | | | | | Fixes PR 2805 llvm-svn: 56321
* Decrementing the iterator here could be wrong if the worklist is empty after ↵Bill Wendling2008-09-181-4/+5
| | | | | | | | the "erase". Thanks to Ji Young Park for the patch! llvm-svn: 56316
* Try to place hoisted instructions befoe icmp instruction.Devang Patel2008-09-181-2/+23
| | | | llvm-svn: 56315
* Do not hoist instruction above branch condition. The instruction may use ↵Devang Patel2008-09-171-9/+2
| | | | | | branch condition. llvm-svn: 56286
* Do not ignore iv uses outside the loop.Devang Patel2008-09-171-1/+21
| | | | | | This one slipped through cracks very well. llvm-svn: 56284
* Improve instcombine's handling of integer min and max in two ways:Dan Gohman2008-09-161-29/+115
| | | | | | | | | | | | | | | | - 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. llvm-svn: 56246
* Teach LSR to optimize away SMAX operations for tripcounts in commonDan Gohman2008-09-151-0/+127
| | | | | | | | | 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. llvm-svn: 56230
* On 64-bit targets, change 32-bit getelementptr indices to be 64-bitDan Gohman2008-09-111-1/+12
| | | | | | | getelementptr indices, inserting an explicit cast if necessary. This helps expose the sign-extension operation to other optimizations. llvm-svn: 56133
* Fix a vectorshuffle instcombine bug introduced by r55995.Dan Gohman2008-09-111-1/+4
| | | | | | Patch by Nicolas Capens! llvm-svn: 56129
* Fix a copy+paste bug that Duncan spotted. For severalDan Gohman2008-09-111-1/+1
| | | | | | | cases it was still getting lucky and detecting overflow but it was clearly incorrect. llvm-svn: 56113
* In my analysis for r56076 I missed the case where the originalDan Gohman2008-09-111-1/+2
| | | | | | multiplication overflows. llvm-svn: 56082
* Fix an icmp+sdiv optimization to check for and handle an overflowDan Gohman2008-09-101-1/+16
| | | | | | condition. This fixes PR2740. llvm-svn: 56076
* fix white spaces.Devang Patel2008-09-101-5/+5
| | | | llvm-svn: 56056
* Fix a warning about comparing signed and unsigned values.Dan Gohman2008-09-101-1/+1
| | | | llvm-svn: 56040
* if loop induction variable is always sign or zero extended then Devang Patel2008-09-091-1/+118
| | | | | | extend the type of induction variable. llvm-svn: 56017
* fix overflow check.Devang Patel2008-09-091-2/+1
| | | | llvm-svn: 56011
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-091-2/+1
| | | | llvm-svn: 56005
* Resolve aliases, when possibleAnton Korobeynikov2008-09-091-0/+22
| | | | llvm-svn: 56001
* Make SimplifyDemandedVectorElts simplify vectors with multipleDan Gohman2008-09-091-34/+82
| | | | | | | | | | | | 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. llvm-svn: 55995
* Fix simplifycfg crash in handing block merge.Devang Patel2008-09-091-1/+11
| | | | llvm-svn: 55971
OpenPOWER on IntegriCloud