summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Don't drop function/call return attributes like 'nounwind'.Duncan Sands2008-02-011-0/+8
| | | | llvm-svn: 46645
* Don't let globalopt hack on volatile loads or stores.Chris Lattner2008-01-291-1/+4
| | | | llvm-svn: 46523
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.Chris Lattner2008-01-281-0/+30
| | | | llvm-svn: 46433
* 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
* 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
* Small simplification.Duncan Sands2008-01-131-4/+1
| | | | llvm-svn: 45932
* 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
* Small cleanup for handling of type/parameter attributeDuncan Sands2008-01-071-2/+2
| | | | | | incompatibility. llvm-svn: 45704
* The transform that tries to turn calls to bitcast functions intoDuncan Sands2008-01-061-3/+2
| | | | | | | | | 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
* Fix PR1896Chris Lattner2008-01-041-1/+1
| | | | llvm-svn: 45568
* add missing #includeChris Lattner2008-01-021-0/+1
| | | | llvm-svn: 45516
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-2919-38/+38
| | | | llvm-svn: 45418
* remove attribution from lib Makefiles.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45415
* Fixing several transforms which would drop the collector attributeGordon Henriksen2007-12-253-0/+8
| | | | | | when copying functions. llvm-svn: 45356
* Make DAE not wipe out attributes on calls, and not dropDuncan Sands2007-12-211-36/+55
| | | | | | | | | | | | | | | return attributes on the floor. In the case of a call to a varargs function where the varargs arguments are being removed, any call attributes on those arguments need to be dropped. I didn't do this because I plan to make it illegal to have such attributes (see next patch). With this change, compiling the gcc filter2 eh test at -O0 and then running opt -std-compile-opts on it results in a correctly working program (compiling at -O1 or higher results in the test failing due to a problem with how we output eh info into the IR). llvm-svn: 45285
* When inlining through an 'nounwind' call, mark inlinedDuncan Sands2007-12-191-7/+5
| | | | | | | | | calls 'nounwind'. It is important for correct C++ exception handling that nounwind markings do not get lost, so this transformation is actually needed for correctness. llvm-svn: 45218
* Rename isNoReturn to doesNotReturn, and isNoUnwind toDuncan Sands2007-12-181-7/+7
| | | | | | doesNotThrow. llvm-svn: 45160
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-174-38/+39
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Make PruneEH update the nounwind/noreturn attributesDuncan Sands2007-12-101-75/+80
| | | | | | on functions as it calculates them. llvm-svn: 44802
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-1/+1
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-275-8/+69
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing ↵Anton Korobeynikov2007-11-221-0/+4
| | | | | | reduction) llvm-svn: 44281
* Fix PR1788 by taking the approach suggested by Richard Smith.Chris Lattner2007-11-151-11/+16
| | | | | | Thanks to him for his detailed analysis of the problem. llvm-svn: 44162
* Allow the block extractor take to take a list of basic blocks to not extractNick Lewycky2007-11-141-1/+58
| | | | | | | | | from a file containing Function/BasicBlock pairings. This is not safe against anonymous or abnormally-named Funcs or BBs. Make bugpoint use this interface to pass the BBs list to the child bugpoint. llvm-svn: 44101
* Fix the regression on Transforms/GlobalOpt/deadglobal-2.ll from myChris Lattner2007-11-131-3/+3
| | | | | | patch on friday. llvm-svn: 44068
* Tighten up a check for folding away loads from (newly constant) globals. ThisChris Lattner2007-11-091-6/+11
| | | | | | | fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and rdar://5585488. llvm-svn: 43949
* Deleting redundant copy of block extractor pass. See also PR1775.Gordon Henriksen2007-11-051-2/+3
| | | | llvm-svn: 43694
* Finishing initial docs for all transformations in Passes.html.Gordon Henriksen2007-11-041-11/+9
| | | | | | Also cleaned up some comments in source files. llvm-svn: 43674
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* More fleshing out of docs/Passes.html, plus some typo fixes andGordon Henriksen2007-10-261-8/+8
| | | | | | improved wording in source files. llvm-svn: 43377
* Fix off by 1 bug in printf->puts lowering.Dale Johannesen2007-10-241-1/+3
| | | | llvm-svn: 43309
* Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll byChris Lattner2007-10-181-3/+3
| | | | | | fixing some obviously broken code :( llvm-svn: 43141
* Do not raise free() call that is called through invoke instruction.Devang Patel2007-10-171-0/+2
| | | | llvm-svn: 43083
* Use empty() member functions when that's what's being tested for insteadDan Gohman2007-10-032-4/+4
| | | | | | of comparing begin() and end(). llvm-svn: 42585
* Fix PR1719, by not marking llvm.global.annotations internal.Tanya Lattner2007-10-031-0/+1
| | | | llvm-svn: 42578
OpenPOWER on IntegriCloud