summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix PR1719, by not marking llvm.noinline internal.Chris Lattner2007-10-031-0/+1
| | | | llvm-svn: 42565
* minor long double related changesDale Johannesen2007-09-281-4/+2
| | | | llvm-svn: 42439
* Fix a logic error in ValueIsOnlyUsedLocallyOrStoredToOneGlobal that caused Chris Lattner2007-09-141-4/+4
| | | | | | | miscompilation of 188.ammp. Reject select and bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal because RewriteHeapSROALoadUser can't handle it. llvm-svn: 41950
* Teach GlobalLoadUsesSimpleEnoughForHeapSRA and the SROA rewriter how to handleChris Lattner2007-09-131-14/+62
| | | | | | | a limited form of PHI nodes. This finally fixes PR1639, speeding 179.art up from 7.84s to 3.13s on PPC. llvm-svn: 41933
* be tolerant of PHI nodes when rewriting heap SROA code. This is a stepChris Lattner2007-09-131-26/+50
| | | | | | along the way of PR1639 llvm-svn: 41930
* refactor some code, no functionality change. On the path to PR1639Chris Lattner2007-09-131-50/+56
| | | | llvm-svn: 41929
* Make ValueIsOnlyUsedLocallyOrStoredToOneGlobal smart enough to see throughChris Lattner2007-09-131-5/+16
| | | | | | bitcasts and phis. This is a step to fixing PR1639. llvm-svn: 41928
* Make AllUsesOfLoadedValueWillTrapIfNull strong enough to see through PHIChris Lattner2007-09-131-6/+15
| | | | | | nodes. This is the first step of the fix for PR1639. llvm-svn: 41927
* Next round of APFloat changes.Dale Johannesen2007-09-061-11/+16
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Update GEP constructors to use an iterator interface to fixDavid Greene2007-09-042-6/+6
| | | | | | GLIBCXX_DEBUG issues. llvm-svn: 41697
* Update InvokeInst to work like CallInstDavid Greene2007-08-273-4/+4
| | | | llvm-svn: 41506
* Change comments to refer to @malloc and @free instead of %malloc and %free.Dan Gohman2007-08-271-3/+3
| | | | llvm-svn: 41488
* rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()Chris Lattner2007-08-231-1/+1
| | | | | | Add an APSInt::toString() method. llvm-svn: 41309
* Use SmallVector instead of std::vector.Devang Patel2007-08-211-1/+1
| | | | llvm-svn: 41207
* More explicit keywords.Dan Gohman2007-08-014-7/+7
| | | | llvm-svn: 40673
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-015-18/+30
| | | | | | | | indexing an empty std::vector. Updates to all clients. llvm-svn: 40660
* Use SmallPtrSet.Devang Patel2007-07-271-2/+3
| | | | llvm-svn: 40560
* Add BasicInliner interface. Devang Patel2007-07-251-246/+6
| | | | | | | This interface allows clients to inline bunch of functions with module level call graph information.:wq llvm-svn: 40486
* fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functionsChris Lattner2007-06-251-4/+8
| | | | | | with weak linkage. llvm-svn: 37723
* Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.hTanya Lattner2007-06-191-65/+0
| | | | llvm-svn: 37666
* Inliner pass header file was moved.Tanya Lattner2007-06-192-2/+3
| | | | llvm-svn: 37665
* Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.Devang Patel2007-06-071-5/+3
| | | | llvm-svn: 37501
* Formating fixes.Tanya Lattner2007-06-071-4/+4
| | | | llvm-svn: 37491
* Instruct the inliner to obey the noinline attribute. Add test case.Tanya Lattner2007-06-061-1/+43
| | | | llvm-svn: 37481
* simplify this code and fix PR1493, now that llvm-gcc3 is dead.Chris Lattner2007-06-061-17/+2
| | | | llvm-svn: 37478
* When rebuilding constant structs, make sure to honor the isPacked bit.Chris Lattner2007-06-041-1/+1
| | | | | | This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll llvm-svn: 37423
* selects can also reach hereChris Lattner2007-05-151-2/+3
| | | | llvm-svn: 37081
* Fix Transforms/GlobalOpt/2007-05-13-Crash.llChris Lattner2007-05-131-1/+4
| | | | llvm-svn: 37020
* Fix PR1395, by passing the ID correctlyChris Lattner2007-05-063-5/+4
| | | | llvm-svn: 36894
* Fix typo in comment.Nick Lewycky2007-05-0618-20/+20
| | | | llvm-svn: 36873
* Drop 'const'Devang Patel2007-05-0320-44/+44
| | | | llvm-svn: 36662
OpenPOWER on IntegriCloud