summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
...
* Added SCEV::NoWrapFlags to manage unsigned, signed, and self wrapAndrew Trick2011-03-142-10/+20
| | | | | | | | | properties. Added the self-wrap flag for SCEV::AddRecExpr. A slew of temporary FIXMEs indicate the intention of the no-self-wrap flag without changing behavior in this revision. llvm-svn: 127590
* whitespaceAndrew Trick2011-03-141-66/+66
| | | | llvm-svn: 127589
* Roll r127459 back in:Cameron Zwarich2011-03-111-0/+14
| | | | | | | | | | | Optimize trivial branches in CodeGenPrepare, which often get created from the lowering of objectsize intrinsics. Unfortunately, a number of tests were relying on llc not optimizing trivial branches, so I had to add an option to allow them to continue to test what they originally tested. This fixes <rdar://problem/8785296> and <rdar://problem/9112893>. llvm-svn: 127498
* Revert r127459, "Optimize trivial branches in CodeGenPrepare, which often getDaniel Dunbar2011-03-111-14/+0
| | | | | | created from the", it broke some GCC test suite tests. llvm-svn: 127477
* Optimize trivial branches in CodeGenPrepare, which often get created from theCameron Zwarich2011-03-111-0/+14
| | | | | | | | | | lowering of objectsize intrinsics. Unfortunately, a number of tests were relying on llc not optimizing trivial branches, so I had to add an option to allow them to continue to test what they originally tested. This fixes <rdar://problem/8785296> and <rdar://problem/9112893>. llvm-svn: 127459
* RecursivelyDeleteTriviallyDeadInstructions only needs aDan Gohman2011-03-101-3/+2
| | | | | | | | Value, not an Instruction, so casting is not necessary. Also, it's theoretically possible that the Value is not an Instruction, since WeakVH follows RAUWs. llvm-svn: 127427
* Fix reassociate to postpone certain instruction deletions untilDan Gohman2011-03-101-3/+11
| | | | | | | | | | after it has finished all of its reassociations, because its habit of unlinking operands and holding them in a datastructure while working means that it's not easy to determine when an instruction is really dead until after all its regular work is done. rdar://9096268. llvm-svn: 127424
* Preserve line number information while simplifying libcalls.Devang Patel2011-03-091-0/+3
| | | | llvm-svn: 127362
* Fix a crasher introduced by r127317 that is seen on the bots when using anCameron Zwarich2011-03-091-18/+21
| | | | | | | alloca as both integer and floating-point vectors of the same size. Bugpoint is not cooperating with me, but I'll try to find a manual testcase tomorrow. llvm-svn: 127320
* Add support to scalar replacement for partial vector accesses of an alloca, e.g.Cameron Zwarich2011-03-091-12/+127
| | | | | | | | | | | | | | | | | a union of a float, <2 x float>, and <4 x float>. This mostly comes up with the use of vector intrinsics, especially in NEON when programmers know the layout of the register file. This enables codegen to eliminate a lot of the subregister traffic it would otherwise generate. This commit only enables this for a small number of floating-point cases, but a lot more integer cases. I assume this is okay for all ports, but I did not do extensive testing of the quality of code involving i512 vectors and the like. If there is a use case where this generates worse code than before, let me know and we can scale it back. This fixes <rdar://problem/9036264>. llvm-svn: 127317
* Move vector type merging to a separate function in preparation for it gettingCameron Zwarich2011-03-091-12/+23
| | | | | | more complicated. llvm-svn: 127316
* While sinking an instruction, do not lose llvm.dbg.value intrinsic.Devang Patel2011-03-081-1/+2
| | | | llvm-svn: 127214
* Preserve line no. info.Devang Patel2011-03-071-2/+2
| | | | | | Radar 9097659 llvm-svn: 127182
* Fix PR9398 - 10% of llc compile time is spent in Value::getNumUses. This reducesCameron Zwarich2011-03-051-7/+22
| | | | | | | the percentage of time spent in CodeGenPrepare when llcing 403.gcc from 12.6% to 1.8% of total llc time. llvm-svn: 127069
* Fix typo in comment.Richard Osborne2011-03-031-1/+1
| | | | llvm-svn: 126941
* Optimize fprintf -> iprintf if there are no floating point argumentsRichard Osborne2011-03-031-8/+28
| | | | | | and siprintf is available on the target. llvm-svn: 126940
* Optimize sprintf -> siprintf if there are no floating point argumentsRichard Osborne2011-03-031-8/+28
| | | | | | and siprintf is available on the target. llvm-svn: 126937
* Optimize printf -> iprintf if there are no floating point argumentsRichard Osborne2011-03-031-10/+42
| | | | | | | and iprintf is available on the target. Currently iprintf is only marked as being available on the XCore. llvm-svn: 126935
* Remove some more unused code that I missed.Cameron Zwarich2011-03-021-19/+0
| | | | llvm-svn: 126826
* Eliminate the unused CodeGenPrepare option to split critical edges.Cameron Zwarich2011-03-021-128/+1
| | | | llvm-svn: 126825
* Stop computing the number of uses twice per value in CodeGenPrepare's sinking ofCameron Zwarich2011-03-011-3/+4
| | | | | | | | addressing code. On 403.gcc this almost halves CodeGenPrepare time and reduces total llc time by 9.5%. Unfortunately, getNumUses() is still the hottest function in llc. llvm-svn: 126782
* Unbreak CMake build.Ted Kremenek2011-02-281-1/+0
| | | | llvm-svn: 126715
* update cmakeChris Lattner2011-02-281-1/+0
| | | | llvm-svn: 126694
* Delete the GEPSplitter experiment.Dan Gohman2011-02-282-84/+0
| | | | llvm-svn: 126671
* Delete the SimplifyHalfPowrLibCalls pass, which was unused, andDan Gohman2011-02-282-161/+0
| | | | | | only existed as the result of a misunderstanding. llvm-svn: 126669
* wire TargetLibraryInfo into simplify libcalls and use it in a couple ofChris Lattner2011-02-241-7/+17
| | | | | | trivial places. This pass needs a lot of work. llvm-svn: 126367
* move a massive amount of code out into its own helper functionChris Lattner2011-02-241-676/+643
| | | | | | to reduce nesting. This needs to be turned into a table. llvm-svn: 126366
* Make LoopDeletion work on loops with multiple edges, as long as the incomingCameron Zwarich2011-02-221-8/+15
| | | | | | values from all of the loop's exiting blocks are equal. Patch by Andrew Clinton. llvm-svn: 126253
* fix a crasher in disabled code (on variable stride loops)Chris Lattner2011-02-211-1/+1
| | | | llvm-svn: 126125
* Add some (disabled code) to print out negative strides.Chris Lattner2011-02-211-3/+15
| | | | llvm-svn: 126102
* rewrite the memset_pattern pattern generation stuff to accept any 2/4/8/16-byteChris Lattner2011-02-191-32/+12
| | | | | | | | | | | | | | | | | | constant, including globals. This makes us generate much more "pretty" pattern globals as well because it doesn't break it down to an array of bytes all the time. This enables us to handle stores of relocatable globals. This kicks in about 48 times in 254.gap, giving us stuff like this: @.memset_pattern40 = internal constant [2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*] [%struct.TypHeader* (%struct.TypHeader*, %struct .TypHeader*)* @IsFalse, %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)* @IsFalse], align 16 ... call void @memset_pattern16(i8* %scevgep5859, i8* bitcast ([2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*]* @.memset_pattern40 to i8* ), i64 %tmp75) nounwind llvm-svn: 126044
* Implement rdar://9009151, transforming strided loop stores ofChris Lattner2011-02-191-32/+125
| | | | | | | | | | | unsplatable values into memset_pattern16 when it is available (recent darwins). This transforms lots of strided loop stores of ints for example, like 5 in vpr: Formed memset: call void @memset_pattern16(i8* %4, i8* getelementptr inbounds ([16 x i8]* @.memset_pattern9, i32 0, i32 0), i64 %tmp25) from store to: {%3,+,4}<%11> at: store i32 3, i32* %scevgep, align 4, !tbaa !4 llvm-svn: 126040
* Make loop-idiom use TargetLibraryInfo to determine whether it is allowedChris Lattner2011-02-181-1/+18
| | | | | | to hack on memset, memcpy etc. llvm-svn: 125974
* prevent jump threading from merging blocks when their address isChris Lattner2011-02-181-1/+11
| | | | | | | | | | | | | | | | | taken (and used!). This prevents merging the blocks (invalidating the block addresses) in a case like this: #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) void foo() { printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); } which fixes PR4151. llvm-svn: 125829
* fix PR9215, preventing -reassociate from clearing nsw/nuw whenChris Lattner2011-02-171-3/+4
| | | | | | it swaps the LHS/RHS of a single binop. llvm-svn: 125700
* Spelling fix: consequtive -> consecutive.Duncan Sands2011-02-152-2/+2
| | | | llvm-svn: 125563
* convert ConstantVector::get to use ArrayRef.Chris Lattner2011-02-151-1/+1
| | | | llvm-svn: 125537
* Do not hoist @llvm.dbg.value. Here, @llvm.dbg.value is "referring" a value ↵Devang Patel2011-02-141-1/+2
| | | | | | that is modified inside loop. llvm-svn: 125529
* revert my ConstantVector patch, it seems to have made the llvm-gccChris Lattner2011-02-141-1/+1
| | | | | | builders unhappy. llvm-svn: 125504
* Switch ConstantVector::get to use ArrayRef instead of a pointer+sizeChris Lattner2011-02-141-1/+1
| | | | | | idiom. Change various clients to simplify their code. llvm-svn: 125487
* SimplifyLibCalls: Add missing legalize check on various printf to puts andDaniel Dunbar2011-02-121-5/+9
| | | | | | putchar transforms, their return values are not compatible. llvm-svn: 125442
* Make LoopUnswitch preserve ScalarEvolution by just forgetting everything aboutCameron Zwarich2011-02-111-0/+5
| | | | | | | a loop when unswitching it. It only does this in the complex case, because everything should be fine already in the simple case. llvm-svn: 125369
* LoopInstSimplify preserves ScalarEvolution.Cameron Zwarich2011-02-111-0/+1
| | | | llvm-svn: 125368
* If we can't avoid running loop-simplify twice for now, at least avoid runningCameron Zwarich2011-02-101-0/+3
| | | | | | iv-users twice. llvm-svn: 125318
* Revert this in an attempt to bring the builders back.Eric Christopher2011-02-101-4/+4
| | | | llvm-svn: 125257
* Turn this pass ordering:Cameron Zwarich2011-02-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Natural Loop Information Loop Pass Manager Canonicalize natural loops Scalar Evolution Analysis Loop Pass Manager Induction Variable Users Canonicalize natural loops Induction Variable Users Loop Strength Reduction into this: Scalar Evolution Analysis Loop Pass Manager Canonicalize natural loops Induction Variable Users Loop Strength Reduction This fixes <rdar://problem/8869639>. I also filed PR9184 on doing this sort of thing automatically, but it seems easier to just change the ordering of the passes if this is the only case. llvm-svn: 125254
* Don't split any loop backedges, including backedges of loops other thanDan Gohman2011-02-081-15/+17
| | | | | | | | the active loop. This is generally desirable, and it avoids trouble in situations such as the testcase in PR9123, though the failure mode depends on use-list order, so it is infeasible to test. llvm-svn: 125065
* Fix reassociate to clear optional flags, such as nsw.Dan Gohman2011-02-021-0/+16
| | | | llvm-svn: 124712
* Unbreak the MSVC build.Francois Pichet2011-01-291-0/+1
| | | | | | The DEBUG() call at line 606 demands to see raw_ostream's definition. I have no idea why this seems to only break MSVC. llvm-svn: 124545
* Add a test for TCE return duplication.Evan Cheng2011-01-291-0/+2
| | | | llvm-svn: 124527
OpenPOWER on IntegriCloud