summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Fix misoptimization of: xor i1 (icmp eq (X, C1), icmp s[lg]t (X, C2))Nick Lewycky2008-09-301-2/+3
| | | | llvm-svn: 56834
* Implement function notes as function attributes. Devang Patel2008-09-261-1/+1
| | | | llvm-svn: 56716
* Now Attributes are divided in three groupsDevang Patel2008-09-261-9/+17
| | | | | | | | | | | | | - 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-253-34/+34
| | | | | | | | | | | | | | | 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-241-8/+8
| | | | llvm-svn: 56535
* Put FN_NOTE_AlwaysInline and others in FnAttr namespace.Devang Patel2008-09-241-1/+1
| | | | llvm-svn: 56527
* Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.Devang Patel2008-09-231-1/+1
| | | | | | Do not check isDeclaration() in hasNote(). It is clients' responsibility. llvm-svn: 56524
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-233-10/+9
| | | | llvm-svn: 56513
* Use parameter attribute store (soon to be renamed) forDevang Patel2008-09-231-1/+1
| | | | | | 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-221-1/+1
| | | | llvm-svn: 56477
* Initial support for the CMake build system.Oscar Fuentes2008-09-221-0/+32
| | | | llvm-svn: 56419
* 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
* 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
* 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 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
* s/RemoveUnreachableBlocks/RemoveUnreachableBlocksFromFn/gDevang Patel2008-09-081-8/+9
| | | | llvm-svn: 55965
* Remove unused counter.Devang Patel2008-09-081-1/+0
| | | | llvm-svn: 55924
* Remove OptimizeIVType()Devang Patel2008-09-081-206/+0
| | | | llvm-svn: 55913
* Remove unused map.Devang Patel2008-09-051-1/+0
| | | | llvm-svn: 55861
* A loop may be unswitched multiple times. Reconstruct dom info. at the end.Devang Patel2008-09-041-5/+8
| | | | llvm-svn: 55806
* Initialize loop data first.Devang Patel2008-09-041-2/+1
| | | | llvm-svn: 55792
* Do not unswitch if the function notes say we're optimizing this function for ↵Devang Patel2008-09-041-1/+7
| | | | | | size. llvm-svn: 55786
* Add intrinsic forms of pow and exp2. The non-intrinsicDale Johannesen2008-09-041-0/+10
| | | | | | forms remain to handle older IR files, but will go away soon. llvm-svn: 55781
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-0430-31/+31
| | | | llvm-svn: 55779
* Fix a bug that prevented PRE from applying in some cases.Owen Anderson2008-09-031-3/+5
| | | | llvm-svn: 55744
* Don't apply this transform to vectors. Fixes PR2756.Nick Lewycky2008-09-031-3/+4
| | | | llvm-svn: 55690
* Add additional check to ensure that iv is canonicalized.Devang Patel2008-09-031-0/+1
| | | | llvm-svn: 55682
* Check iteration count.Devang Patel2008-09-031-0/+4
| | | | llvm-svn: 55680
* While removing PHI, use basicblock to identify incoming value.Devang Patel2008-09-031-2/+3
| | | | llvm-svn: 55678
* If all IV uses are extending integer IV then change the type of IV itself, ↵Devang Patel2008-09-021-0/+201
| | | | | | if possible. llvm-svn: 55674
* Add a small pass that sets the readnone/readonlyDuncan Sands2008-09-011-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | attributes on functions, based on the result of alias analysis. It's not hardwired to use GlobalsModRef even though this is the only (AFAIK) alias analysis that results in this pass actually doing something. Enable as follows: opt ... -globalsmodref-aa -markmodref ... Advantages of this pass: (1) records the result of globalsmodref in the bitcode, meaning it is available for use by later passes (currently the pass manager isn't smart enough to magically make an advanced alias analysis available to all later passes), which may expose more optimization opportunities; (2) hopefully speeds up compilation when code is optimized twice, for example when a file is compiled to bitcode, then later LTO is done on it: marking functions readonly/readnone when producing the initial bitcode should speed up alias analysis during LTO; (3) good for discovering that globalsmodref doesn't work very well :) Not currently turned on by default. llvm-svn: 55604
* Do not apply the transformation if the target does not support DestTy natively.Devang Patel2008-08-271-2/+9
| | | | llvm-svn: 55433
* Fix typos and whitespaces. Other cosmetic changes based on feedback.Devang Patel2008-08-271-12/+9
| | | | llvm-svn: 55424
* Put a heuristic in place to prevent GVN from falling into bad cases with ↵Owen Anderson2008-08-261-0/+6
| | | | | | | | massively complicated CFGs. This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality. llvm-svn: 55391
* If IV is used in a int-to-float cast inside the loop then try to eliminate ↵Devang Patel2008-08-261-2/+118
| | | | | | the cast operation. llvm-svn: 55374
* improve encapsulation of the BBExecutable set.Chris Lattner2008-08-231-8/+4
| | | | llvm-svn: 55271
OpenPOWER on IntegriCloud