summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Emit gcov data files to the directory specified in the metadata produced by theNick Lewycky2011-05-041-4/+23
| | | | | | frontend, if applicable. llvm-svn: 130835
* 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
* Remove unused variables caught by GCC's -Wunused-but-set-variable.Benjamin Kramer2011-05-031-2/+0
| | | | llvm-svn: 130755
* 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
* Scanning entire basic block may be too expensive in terms of compile time. ↵Devang Patel2011-05-021-6/+4
| | | | | | Instead, just use whatever location info first non-phi instruction has. llvm-svn: 130729
* Remove unused variable.Duncan Sands2011-05-021-1/+1
| | | | llvm-svn: 130705
* Move some rem transforms out of instcombine and into instsimplify.Duncan Sands2011-05-021-42/+19
| | | | | | | This automagically provides a transform noticed by my super-optimizer as occurring quite often: "rem x, (select cond, x, 1)" -> 0. llvm-svn: 130694
* enhance memcpyopt to obey -fno-builtin and friends. This addresses aChris Lattner2011-05-011-0/+17
| | | | | | problem reported on cfe-dev. llvm-svn: 130661
* InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for ↵Benjamin Kramer2011-04-301-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | urem or constant B. This obviously helps a lot if the division would be turned into a libcall (think i64 udiv on i386), but div is also one of the few remaining instructions on modern CPUs that become more expensive when the bitwidth gets bigger. This also helps register pressure on i386 when dividing chars, divb needs two 8-bit parts of a 16 bit register as input where divl uses two registers. int foo(unsigned char a) { return a/10; } int bar(unsigned char a, unsigned char b) { return a/b; } compiles into (x86_64) _foo: imull $205, %edi, %eax shrl $11, %eax ret _bar: movzbl %dil, %eax divb %sil, %al movzbl %al, %eax ret llvm-svn: 130615
* Use SimplifyDemandedBits on div instructions.Benjamin Kramer2011-04-301-0/+4
| | | | | | This folds away silly stuff like (a&255)/1000 -> 0. llvm-svn: 130614
* Assing line number info to new PHIs created by SSA updater.Devang Patel2011-04-292-0/+17
| | | | llvm-svn: 130551
* Preserve line number information.Devang Patel2011-04-291-1/+2
| | | | llvm-svn: 130536
* SimplifyCFG: Expose phi node folding cost threshold as command line parameterPeter Collingbourne2011-04-291-1/+6
| | | | llvm-svn: 130528
* SimplifyCFG: Add CostRemaining parameter to DominatesMergePointPeter Collingbourne2011-04-291-9/+38
| | | | llvm-svn: 130527
* SimplifyCFG: Add Trunc, ZExt and SExt to the list of cheap instructions for ↵Peter Collingbourne2011-04-291-0/+3
| | | | | | phi node folding llvm-svn: 130526
* Balance parentheses.Benjamin Kramer2011-04-291-1/+1
| | | | llvm-svn: 130489
* InstCombine: turn (C1 << A) << C2) into (C1 << C2) << A)Benjamin Kramer2011-04-291-1/+8
| | | | | | Fixes PR9809. llvm-svn: 130485
* Preserve line number information.Devang Patel2011-04-281-0/+7
| | | | llvm-svn: 130450
* We require threse bits to be zero, too.Benjamin Kramer2011-04-281-2/+2
| | | | | | | This shouldn't happen in practice because the icmp would be a constant. Add a check so we don't miscompile code if something goes wrong. llvm-svn: 130446
* Only read *predecessor once so as to fix a theoretical issue where it changesNick Lewycky2011-04-281-7/+10
| | | | | | | | | | | | | | | | | | | between two reads (threading). Fix an off-by-one in the indirect counter table that I meant to revert after an earlier experiment. Whoops! Implement GCOV_PREFIX. Doesn't handle GCOV_PREFIX_STRIP yet. Fix an off-by-one in string emission. Extra whoops! Tolerate DISubprograms that have null Function*'s attached to them. I don't yet understand what this means, but it happens when you have a global static with a non-trivial constructor/destructor. Fix a crash on switch statements with a single successor (default-only). llvm-svn: 130443
* Remove DbgDeclare only if all uses are converted.Devang Patel2011-04-281-1/+5
| | | | llvm-svn: 130431
* Fix a comment.Benjamin Kramer2011-04-281-1/+1
| | | | llvm-svn: 130428
* 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
* InstCombine: Merge "(trunc x) == C1 & (and x, CA) == C2" into a single and+icmp.Benjamin Kramer2011-04-281-0/+36
| | | | | | This happens when GVN widens loads. Part of PR6627. llvm-svn: 130405
* 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
* Stop trying to have instcombine preserve LCSSA form: this was notDuncan Sands2011-04-273-6/+0
| | | | | | | | | | effective in avoiding recomputation of LCSSA form; the widespread use of instsimplify (which looks through phi nodes) means it was not preserving LCSSA form anyway; and instcombine is no longer scheduled in the middle of the loop passes so this doesn't matter anymore. llvm-svn: 130301
* Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"Chris Lattner2011-04-261-0/+25
| | | | | | | | | | when X has multiple uses. This is useful for exposing secondary optimizations, but the X86 backend isn't ready for this when X has a single use. For example, this can disable load folding. This is inching towards resolving PR6627. llvm-svn: 130238
* some random cleanups, no functionality change.Chris Lattner2011-04-261-5/+5
| | | | llvm-svn: 130237
* 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
* Rename everything to follow LLVM style ... I think.Nick Lewycky2011-04-261-207/+300
| | | | | | | | | | | | | | Add support for switch and indirectbr edges. This works by densely numbering all blocks which have such terminators, and then separately numbering the possible successors. The predecessors write down a number, the successor knows its own number (as a ConstantInt) and sends that and the pointer to the number the predecessor wrote down to the runtime, who looks up the counter in a per-function table. Coverage data should now be functional, but I haven't tested it on anything other than my 2-file synthetic test program for coverage. llvm-svn: 130186
* 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-236-6/+0
| | | | llvm-svn: 130068
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-212-3/+3
| | | | llvm-svn: 129932
* In gcov profiling, give all functions an extra unified return block. This isNick Lewycky2011-04-211-5/+17
| | | | | | | necessary since gcov counts transitions between blocks. It can't see if you've run every line in a straight-line function, so we add an edge for it to notice. llvm-svn: 129905
* Fix think-o: emit all 8 bytes of the EOF marker. Also reflow a line in aNick Lewycky2011-04-211-3/+3
| | | | | | comment for 80 columns. llvm-svn: 129904
* Add independent controls for whether GCOV profiling should emit .gcno files orNick Lewycky2011-04-211-4/+16
| | | | | | | instrument the program to emit .gcda. TODO: we should emit slightly different .gcda files when .gcno emission is off. llvm-svn: 129903
* 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
OpenPOWER on IntegriCloud