summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Filter loops that subtract induction variables.Devang Patel2008-01-291-17/+17
| | | | | | | | These loops are not yet handled. Fix PR 1912. llvm-svn: 46484
* Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.Chris Lattner2008-01-281-0/+30
| | | | llvm-svn: 46433
* Handle some more combinations of extend and icmp. Fixes PR1940.Nick Lewycky2008-01-281-8/+12
| | | | llvm-svn: 46431
* Fix PR1932 by disabling an xform invalid for fdiv.Chris Lattner2008-01-281-9/+10
| | | | llvm-svn: 46429
* Fix PR1938 by forcing the code that uses an undefined value to branch oneChris Lattner2008-01-281-4/+19
| | | | | | | | way or the other. Rewriting the code itself prevents subsequent analysis passes from making contradictory conclusions about the code that could cause an infeasible path to be made feasible. llvm-svn: 46427
* Be more careful modifying the use_list while also iterating through it.Nick Lewycky2008-01-271-1/+2
| | | | llvm-svn: 46417
* Revert r46393: readonly/readnone functions are noDuncan Sands2008-01-271-9/+6
| | | | | | longer allowed to write through byval arguments. llvm-svn: 46416
* The CorrelatedExpressionElimination pass is known to be buggy. Remove it.Bill Wendling2008-01-271-1486/+0
| | | | | | This fixes PR1769. llvm-svn: 46408
* Fold fptrunc(add (fpextend x), (fpextend y)) -> add(x,y), as GCC does.Chris Lattner2008-01-271-3/+75
| | | | llvm-svn: 46406
* If there are no machine instructions emitted for a function, then insertBill Wendling2008-01-261-14/+1
| | | | | | | a "nop" instruction so that we don't have the function's label associated with something that it's not supposed to be associated with. llvm-svn: 46394
* Create an explicit copy for byval parameters evenDuncan Sands2008-01-261-6/+9
| | | | | | when inlining a readonly function. llvm-svn: 46393
* If we have a function like this:Bill Wendling2008-01-261-1/+14
| | | | | | | | | | | | | | | | | | | | | | void bork() { int *address = 0; *address = 0; } It's compiled into LLVM code that looks like this: define void @bork() noreturn nounwind { entry: unreachable } This is bad on some platforms (like PPC) because it will generate the label for the function but no body. The label could end up being associated with some non-code related stuff, like a section. This places a "trap" instruction if the SimplifyCFG pass removed all code from the function leaving only one "unreachable" instruction. llvm-svn: 46387
* Do this more neatly.Duncan Sands2008-01-251-2/+1
| | | | llvm-svn: 46369
* DeadStoreElimination can treat byval parameters as if there were alloca's ↵Owen Anderson2008-01-251-5/+6
| | | | | | for the purpose of removing end-of-function stores. llvm-svn: 46351
* Enable the fix I just checked in, silly me.Nick Lewycky2008-01-221-1/+0
| | | | llvm-svn: 46247
* Multiply can be evaluated in a different type, so long as the target type hasNick Lewycky2008-01-221-0/+10
| | | | | | a smaller bitwidth. llvm-svn: 46244
* Make sure the caller doesn't use freed memory.Duncan Sands2008-01-201-1/+3
| | | | | | Fixes PR1935. llvm-svn: 46203
* Initializing an unsigned with ~0UL causes the compilerDuncan Sands2008-01-201-9/+9
| | | | | | to complain on x86-64 (gcc 4.1). Use ~0U instead. llvm-svn: 46197
* DAE bug fix. Don't lose parameter attributes on vararg arguments.Evan Cheng2008-01-171-5/+9
| | | | llvm-svn: 46113
* Fix arg promotion to propagate the correct attrs on the calls toChris Lattner2008-01-171-14/+25
| | | | | | | promoted functions. This is important for varargs calls in particular. Thanks to duncan for providing a great testcase. llvm-svn: 46108
* Handle attribute(used) global variables that are i8.Chris Lattner2008-01-161-14/+13
| | | | llvm-svn: 46090
* Do not strip llvm.used values.Devang Patel2008-01-161-3/+25
| | | | llvm-svn: 46045
* I noticed that the trampoline straightening transformation couldDuncan Sands2008-01-141-21/+28
| | | | | | | | | drop attributes on varargs call arguments. Also, it could generate invalid IR if the transformed call already had the 'nest' attribute somewhere (this can never happen for code coming from llvm-gcc, but it's a theoretical possibility). Fix both problems. llvm-svn: 45973
* Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan'sChris Lattner2008-01-141-59/+97
| | | | | | | byval work. This miscompilation is due to the program indexing an array out of range and us doing a transformation that broke this. llvm-svn: 45949
* The isNotSuitableForSRA property is now dead, don't compute it.Chris Lattner2008-01-141-45/+1
| | | | llvm-svn: 45948
* Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very Chris Lattner2008-01-141-2/+75
| | | | | | difficult to understand the invariants. llvm-svn: 45947
* Make the 'shrink global to bool' optimization more self contained, and thus Chris Lattner2008-01-141-10/+25
| | | | | | easier to show that its safe. No functionality change. llvm-svn: 45946
* Turn a memcpy from a double* into a load/store of double instead ofChris Lattner2008-01-141-9/+46
| | | | | | | | | | a load/store of i64. The later prevents promotion/scalarrepl of the source and dest in many cases. This fixes the 300% performance regression of the byval stuff on stepanov_v1p2. llvm-svn: 45945
* factor memcpy/memmove simplification out to its own SimplifyMemTransfer Chris Lattner2008-01-131-35/+42
| | | | | | method, no functionality change. llvm-svn: 45944
* simplify some code. If we can infer alignment for source and dest that are Chris Lattner2008-01-131-21/+22
| | | | | | | greater than memcpy alignment, and if we lower to load/store, use the best alignment info we have. llvm-svn: 45943
* simplify some code by adding a InsertBitCastBefore method,Chris Lattner2008-01-131-30/+25
| | | | | | make memmove->memcpy conversion a bit simpler. llvm-svn: 45942
* Fix PR1907, a nasty miscompilation because instcombine didn'tChris Lattner2008-01-131-2/+8
| | | | | | | realize that ne & sgt was a signed comparison (it was only looking at whether the left compare was signed). llvm-svn: 45937
* Small simplification.Duncan Sands2008-01-131-4/+1
| | | | llvm-svn: 45932
* When turning a call to a bitcast function into a direct call,Duncan Sands2008-01-131-12/+17
| | | | | | | if this becomes a varargs call then deal correctly with any parameter attributes on the newly vararg call arguments. llvm-svn: 45931
* we don't have to make an explicit copy of a byval argument when Chris Lattner2008-01-121-4/+6
| | | | | | | inlining a function if we know that the function does not write to *any* memory. This implements test/Transforms/Inline/byval2.ll llvm-svn: 45912
* Allow clients to specify the inline threshold when creatingChris Lattner2008-01-122-0/+8
| | | | | | the inliner pass. Patch by Robert Zeh. llvm-svn: 45903
* When DAE drops the varargs part of a function, ensure anyDuncan Sands2008-01-111-2/+15
| | | | | | attributes on the vararg call arguments are also dropped. llvm-svn: 45892
* Teach argpromote to ruthlessly hack small byval structs when it canChris Lattner2008-01-111-70/+150
| | | | | | | | | | | | | | | | | | | | | | get away with it, which exposes opportunities to eliminate the memory objects entirely. For example, we now compile byval.ll to: define internal void @f1(i32 %b.0, i64 %b.1) { entry: %tmp2 = add i32 %b.0, 1 ; <i32> [#uses=0] ret void } define i32 @main() nounwind { entry: call void @f1( i32 1, i64 2 ) ret i32 0 } This seems like it would trigger a lot for code that passes around small structs (e.g. SDOperand's or _Complex)... llvm-svn: 45886
* Use smallptrset instead of std::set for efficiency.Chris Lattner2008-01-111-2/+3
| | | | llvm-svn: 45878
* a byval argument is guaranteed to be valid to load.Chris Lattner2008-01-111-4/+19
| | | | llvm-svn: 45877
* Update this code to use eraseFromParent where possible. ComputeChris Lattner2008-01-111-26/+27
| | | | | | whether an argument is byval and pass into isSafeToPromoteArgument. llvm-svn: 45876
* replace a loop with a constant time check.Chris Lattner2008-01-111-3/+2
| | | | llvm-svn: 45875
* another minor datastructure tweak.Chris Lattner2008-01-111-1/+1
| | | | llvm-svn: 45874
* start using smallvector to avoid vector heap thrashing.Chris Lattner2008-01-111-6/+7
| | | | llvm-svn: 45873
* When inlining a functino with a byval argument, make an explicit Chris Lattner2008-01-111-6/+57
| | | | | | copy of it in case the callee modifies the struct. llvm-svn: 45853
* Implement PR1795, an instcombine hack for forming GEPs with integer pointer ↵Chris Lattner2008-01-081-3/+53
| | | | | | arithmetic. llvm-svn: 45745
* Small cleanup for handling of type/parameter attributeDuncan Sands2008-01-072-10/+13
| | | | | | incompatibility. llvm-svn: 45704
* Deleting an empty file. Thanks, /usr/bin/patch!Gordon Henriksen2008-01-071-0/+0
| | | | llvm-svn: 45675
* With this patch, the LowerGC transformation becomes theGordon Henriksen2008-01-071-350/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ShadowStackCollector, which additionally has reduced overhead with no sacrifice in portability. Considering a function @fun with 8 loop-local roots, ShadowStackCollector introduces the following overhead (x86): ; shadowstack prologue movl L_llvm_gc_root_chain$non_lazy_ptr, %eax movl (%eax), %ecx movl $___gc_fun, 20(%esp) movl $0, 24(%esp) movl $0, 28(%esp) movl $0, 32(%esp) movl $0, 36(%esp) movl $0, 40(%esp) movl $0, 44(%esp) movl $0, 48(%esp) movl $0, 52(%esp) movl %ecx, 16(%esp) leal 16(%esp), %ecx movl %ecx, (%eax) ; shadowstack loop overhead (none) ; shadowstack epilogue movl 48(%esp), %edx movl %edx, (%ecx) ; shadowstack metadata .align 3 ___gc_fun: # __gc_fun .long 8 .space 4 In comparison to LowerGC: ; lowergc prologue movl L_llvm_gc_root_chain$non_lazy_ptr, %eax movl (%eax), %ecx movl %ecx, 48(%esp) movl $8, 52(%esp) movl $0, 60(%esp) movl $0, 56(%esp) movl $0, 68(%esp) movl $0, 64(%esp) movl $0, 76(%esp) movl $0, 72(%esp) movl $0, 84(%esp) movl $0, 80(%esp) movl $0, 92(%esp) movl $0, 88(%esp) movl $0, 100(%esp) movl $0, 96(%esp) movl $0, 108(%esp) movl $0, 104(%esp) movl $0, 116(%esp) movl $0, 112(%esp) ; lowergc loop overhead leal 44(%esp), %eax movl %eax, 56(%esp) leal 40(%esp), %eax movl %eax, 64(%esp) leal 36(%esp), %eax movl %eax, 72(%esp) leal 32(%esp), %eax movl %eax, 80(%esp) leal 28(%esp), %eax movl %eax, 88(%esp) leal 24(%esp), %eax movl %eax, 96(%esp) leal 20(%esp), %eax movl %eax, 104(%esp) leal 16(%esp), %eax movl %eax, 112(%esp) ; lowergc epilogue movl 48(%esp), %edx movl %edx, (%ecx) ; lowergc metadata (none) llvm-svn: 45670
* The transform that tries to turn calls to bitcast functions intoDuncan Sands2008-01-062-13/+47
| | | | | | | | | direct calls bails out unless caller and callee have essentially equivalent parameter attributes. This is illogical - the callee's attributes should be of no relevance here. Rework the logic, which incidentally fixes a crash when removed arguments have attributes. llvm-svn: 45658
OpenPOWER on IntegriCloud