summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Don't do tail calls in a function that call setjmp. The stack might beRafael Espindola2011-05-161-4/+5
| | | | | | corrupted when setjmp returns again. llvm-svn: 131399
* Convert SimplifyIVUsers into a worklist instead of a single pass overAndrew Trick2011-05-131-1/+1
| | | | | | the users. llvm-svn: 131277
* indvars: Added SimplifyIVUsers.Andrew Trick2011-05-121-85/+99
| | | | | | | Interleave IV simplifications. Currently involves EliminateComparison and EliminateRemainder. Next I'll add EliminateExtend. llvm-svn: 131210
* Fix PR9820: a read-only call differs from a load in that a load doesn'tDuncan Sands2011-05-061-6/+9
| | | | | | | return the pointer being dereferenced, it returns the pointee, but a call might return the pointer itself. llvm-svn: 130979
* Set debug loc for new instructions.Devang Patel2011-05-041-3/+3
| | | | llvm-svn: 130895
* Preserve line number information while threading jumps.Devang Patel2011-05-041-2/+5
| | | | llvm-svn: 130880
* Preserve line number info.Devang Patel2011-05-041-1/+4
| | | | llvm-svn: 130876
* preserve line number info.Devang Patel2011-05-041-2/+3
| | | | llvm-svn: 130869
* indvars: Added DisableIVRewrite and WidenIVs.Andrew Trick2011-05-041-9/+115
| | | | | | | | This adds functionality to remove size/zero extension during indvars without generating a canonical IV and rewriting all IV users. It's disabled by default so should have no effect on codegen. Work in progress. llvm-svn: 130829
* indvars: Added canExpandBackEdgeTakenCount.Andrew Trick2011-05-031-32/+55
| | | | | | | | | Only create a canonical IV for backedge taken count if it will actually be used by LinearFunctionTestReplace. And some related cleanup, preparing to reduce dependence on canonical IVs. No significant effect on x86 or arm in the test-suite. llvm-svn: 130799
* Add an unfolded offset field to LSR's Formula record. This is used toDan Gohman2011-05-031-9/+62
| | | | | | | | model constants which can be added to base registers via add-immediate instructions which don't require an additional register to materialize the immediate. llvm-svn: 130743
* enhance memcpyopt to obey -fno-builtin and friends. This addresses aChris Lattner2011-05-011-0/+17
| | | | | | problem reported on cfe-dev. llvm-svn: 130661
* Preserve line number information.Devang Patel2011-04-291-1/+2
| | | | llvm-svn: 130536
* Preserve line number information.Devang Patel2011-04-281-0/+7
| | | | llvm-svn: 130450
* improve comment.Chris Lattner2011-04-281-1/+6
| | | | llvm-svn: 130426
* Do not lose line number info while eliminating tail call.Devang Patel2011-04-281-1/+3
| | | | llvm-svn: 130419
* final step needed to resolve PR6627, which allows us to flatten the code down toChris Lattner2011-04-281-3/+7
| | | | | | | | | | | | a nice and tidy: %x1 = load i32* %0, align 4 %1 = icmp eq i32 %x1, 1179403647 br i1 %1, label %if.then, label %if.end instead of doing lots of loads and branches. May the FreeBSD bootloader long fit in its allocated space. llvm-svn: 130416
* code cleanups only.Chris Lattner2011-04-281-36/+32
| | | | llvm-svn: 130414
* Reapply r130340: Fix for PR9730.Andrew Trick2011-04-281-1/+1
| | | | llvm-svn: 130408
* centralize "marking for deletion" into a helper function. Pass GVN around to Chris Lattner2011-04-281-52/+56
| | | | | | static functions instead of passing around tons of random ivars. llvm-svn: 130403
* Promote toErase to be an ivar of the GVN class.Chris Lattner2011-04-281-39/+35
| | | | llvm-svn: 130401
* teach GVN to widen integer loads when they are overaligned, when doing an Chris Lattner2011-04-281-20/+123
| | | | | | | | | | | wider load would allow elimination of subsequent loads, and when the wider load is still a native integer type. This eliminates a ton of loads on various benchmarks involving struct fields, though it is somewhat hobbled by clang not being very aggressive about field alignment. This is yet another step along the way towards resolving PR6627. llvm-svn: 130390
* Reverting r130340 in the unlikely event that it's responsible for a llvm-gcc ↵Andrew Trick2011-04-281-1/+1
| | | | | | stage2 compiler error. llvm-svn: 130350
* Fixes PR9730: indvars: An asserting value handle still pointed to this valueAndrew Trick2011-04-271-1/+1
| | | | | | | | | Modified LinearFunctionTestReplace to push the condition on the dead list instead of eagerly deleting it. This can cause unnecessary IV rewrites, which should have no effect on codegen and will not be an issue once we stop generating canonical IVs. llvm-svn: 130340
* Simplify cfg inserts a call to trap when unreachable code is detected. ↵Devang Patel2011-04-271-1/+2
| | | | | | Assign DebugLoc to this new trap instruction. llvm-svn: 130315
* Improve the bail-out predicate to really only kick in when phiChris Lattner2011-04-261-1/+2
| | | | | | | translation fails. We were bailing out in some cases that would cause us to miss GVN'ing some non-local cases away. llvm-svn: 130206
* Enhance MemDep: When alias analysis returns a partial alias result,Chris Lattner2011-04-261-24/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | return it as a clobber. This allows GVN to do smart things. Enhance GVN to be smart about the case when a small load is clobbered by a larger overlapping load. In this case, forward the value. This allows us to compile stuff like this: int test(void *P) { int tmp = *(unsigned int*)P; return tmp+*((unsigned char*)P+1); } into: _test: ## @test movl (%rdi), %ecx movzbl %ch, %eax addl %ecx, %eax ret which has one load. We already handled the case where the smaller load was from a must-aliased base pointer. llvm-svn: 130180
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* Fix another case of <rdar://problem/9184212> that only occurs with codeCameron Zwarich2011-04-201-31/+44
| | | | | | | generated by llvm-gcc, since llvm-gcc uses 2 i64s for passing a 4 x float vector on ARM rather than an i64 array like Clang. llvm-svn: 129878
* The bitcast case here is actually handled uniformly earlier in the function, soCameron Zwarich2011-04-201-8/+3
| | | | | | delete it. llvm-svn: 129877
* Cleanup some code to better use an early return style in preparation for addingCameron Zwarich2011-04-201-6/+10
| | | | | | more cases. llvm-svn: 129876
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-156-8/+8
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Fix an infinite alternation in JumpThreading where two transforms would ↵Owen Anderson2011-04-141-3/+15
| | | | | | | | | | repeatedly undo each other. The solution is to perform more aggressive constant folding to make one of the edges just folded away rather than trying to thread it. Fixes <rdar://problem/9284786>. Discovered with CSmith. llvm-svn: 129538
* Cleanup r129509 based on comments by ChrisMon P Wang2011-04-141-7/+6
| | | | llvm-svn: 129532
* Cleanup r129472 by using a utility routine as suggested by Eli.Mon P Wang2011-04-141-51/+43
| | | | llvm-svn: 129509
* fix a couple -Wsign-compare warnings.Chris Lattner2011-04-141-2/+2
| | | | llvm-svn: 129501
* Vectors with different number of elements of the same element type can haveMon P Wang2011-04-131-6/+64
| | | | | | | | the same allocation size but different primitive sizes(e.g., <3xi32> and <4xi32>). When ScalarRepl promotes them, it can't use a bit cast but should use a shuffle vector instead. llvm-svn: 129472
* Fixed the revision 129449.Junjie Gu2011-04-131-1/+1
| | | | llvm-svn: 129450
* Passing unroll parameters (unroll-count, threshold, and partial unroll) via ↵Junjie Gu2011-04-131-12/+23
| | | | | | | | | LoopUnroll class's ctor. Doing so will allow multiple context with different loop unroll parameters to run. This is a minor change and no effect on existing application. llvm-svn: 129449
* Add the alias analysis to the C api.Rafael Espindola2011-04-131-0/+9
| | | | llvm-svn: 129447
* Reapply r129401 with patch for clang.Bill Wendling2011-04-131-3/+0
| | | | llvm-svn: 129419
* Revert r129401 for now. Clang is using the old way of doing things.Bill Wendling2011-04-121-0/+3
| | | | llvm-svn: 129403
* Remove the unaligned load intrinsics in favor of using native unaligned loads.Bill Wendling2011-04-121-3/+0
| | | | | | | | | Now that we have a first-class way to represent unaligned loads, the unaligned load intrinsics are superfluous. First part of <rdar://problem/8460511>. llvm-svn: 129401
* Fix reassociate to use a worklist instead of recursing when newDan Gohman2011-04-121-59/+67
| | | | | | | | | reassociation opportunities are exposed. This fixes a bug where the nested reassociation expects to be the IR to be consistent, but it isn't, because the outer reassociation has disconnected some of the operands. rdar://9167457 llvm-svn: 129324
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-0/+1
| | | | llvm-svn: 129271
* fix PR9523, a crash in looprotate on a non-canonical loop made out of ↵Chris Lattner2011-04-091-1/+5
| | | | | | indirectbr. llvm-svn: 129203
* Fix a bug where RecursivelyDeleteTriviallyDeadInstructions couldChris Lattner2011-04-091-3/+18
| | | | | | | delete the instruction pointed to by CGP's current instruction iterator, leading to a crash on the testcase. This fixes PR9578. llvm-svn: 129200
* Expose more passes to the C API.Rafael Espindola2011-04-071-0/+16
| | | | llvm-svn: 129087
* PR9634: Don't unconditionally tell the AliasSetTracker that the PreheaderLoadEli Friedman2011-04-071-21/+4
| | | | | | | | | | | is equivalent to any other relevant value; it isn't true in general. If it is equivalent, the LoopPromoter will tell the AST the equivalence. Also, delete the PreheaderLoad if it is unused. Chris, since you were the last one to make major changes here, can you check that this is sane? llvm-svn: 129049
* * The DSE code that tested for overlapping needed to take into account the factBill Wendling2011-03-301-1/+3
| | | | | | | | | | | | that one of the numbers is signed while the other is unsigned. This could lead to a wrong result when the signed was promoted to an unsigned int. * Add the data layout line to the testcase so that it will test the appropriate thing. Patch by David Terei! llvm-svn: 128577
OpenPOWER on IntegriCloud