summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Move ConstantStruct back to 2.5 API.Owen Anderson2009-07-271-2/+2
| | | | llvm-svn: 77266
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-263-13/+14
| | | | llvm-svn: 77152
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-256-25/+32
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-243-16/+14
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Convert several more passes to use getAnalysisIfAvailable<TargetData>()Dan Gohman2009-07-241-4/+3
| | | | | | instead of getAnalysis<TargetData>(). llvm-svn: 76982
* Switch to getNameStr().Daniel Dunbar2009-07-241-1/+1
| | | | llvm-svn: 76962
* Remove unnecessary store to temporary std::string.Daniel Dunbar2009-07-221-3/+4
| | | | llvm-svn: 76782
* Get rid of the Pass+Context magic.Owen Anderson2009-07-2218-152/+147
| | | | llvm-svn: 76702
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-4/+4
| | | | llvm-svn: 76598
* Update CMake files.Ted Kremenek2009-07-211-3/+4
| | | | llvm-svn: 76595
* implement a new magic global "llvm.compiler.used" which is like llvm.used, butChris Lattner2009-07-202-21/+18
| | | | | | doesn't cause ".no_dead_strip" to be emitted on darwin. llvm-svn: 76399
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-201-0/+1
| | | | | | | | | "private" symbols which the assember shouldn't strip, but which the linker may remove after evaluation. This is mostly useful for Objective-C metadata. This is plumbing, so we don't have a use of it yet. More to come, etc. llvm-svn: 76385
* Add line breaks to make the debug output a bit more readable.Eli Friedman2009-07-181-4/+4
| | | | llvm-svn: 76284
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-1615-0/+24
| | | | | | | | number of issues in our current context-passing stuff, which is also fixed here llvm-svn: 76089
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-156-13/+11
| | | | | | AllocaInst and MallocInst. llvm-svn: 75863
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-146-13/+15
| | | | llvm-svn: 75703
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-142-7/+7
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Move more functionality over to LLVMContext.Owen Anderson2009-07-131-1/+1
| | | | llvm-svn: 75497
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-112-7/+9
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-7/+7
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Switch GlobalVariable ctors to a sane API, where *either* a context or a ↵Owen Anderson2009-07-082-22/+17
| | | | | | module is required. llvm-svn: 75025
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-082-10/+16
| | | | llvm-svn: 74985
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-20/+20
| | | | llvm-svn: 74878
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-061-1/+1
| | | | | | through the ValueTracking API. llvm-svn: 74873
* Thread LLVMContext through the constant folding APIs, which touches a lot of ↵Owen Anderson2009-07-061-22/+27
| | | | | | files. llvm-svn: 74844
* More LLVMContext-ification.Owen Anderson2009-07-0611-135/+181
| | | | llvm-svn: 74811
* Add newline at end of file.Duncan Sands2009-07-031-1/+1
| | | | llvm-svn: 74773
* improve the APIs for creating struct and function types with no ↵Chris Lattner2009-07-012-8/+4
| | | | | | | | arguments/elements to not have to create a temporary vector (in the API at least). Patch by Jay Foad! llvm-svn: 74584
* Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprogramsDevang Patel2009-06-261-1/+20
| | | | | | and llvm.dbg.global_variables. llvm-svn: 74251
* >> What if my global variable was into a different address space than stack?Sanjiv Gupta2009-06-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | >> > > It doesn't matter in terms of semantics: because AnalyzeGlobal > returned false, we're guaranteed the address of the global is never > taken. I wouldn't be surprised if we end up generating invalid IR in > some cases, though, because of the semantics of replaceAllUsesWith. > Do you have a testcase that breaks? > > The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld. assert(New->getType() == getType() && "replaceAllUses of value with new value of different type!"); Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match. The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have a way to do that ?). But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking GV->getType()->getAddressSpace() == 0. llvm-svn: 73605
* Merge PartialInliner changes.Owen Anderson2009-06-151-0/+5
| | | | llvm-svn: 73412
* Fix old-style type names in comments.Dan Gohman2009-06-141-2/+2
| | | | llvm-svn: 73362
* Fix CMake build. Patch from Ingmar Vanhassel.Torok Edwin2009-06-141-0/+1
| | | | llvm-svn: 73342
* Add an early implementation of a partial inlining pass. The idea behind thisOwen Anderson2009-06-141-0/+171
| | | | | | | | | | is that, for functions whose bodies are entirely guarded by an if-statement, it can be profitable to pull the test out of the callee and into the caller. This code has had some cursory testing, but still has a number of known issues on the LLVM test suite. llvm-svn: 73338
* Unlike the other instructions, GEP really does need to look at the type of aNick Lewycky2009-06-131-0/+14
| | | | | | pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review! llvm-svn: 73299
* Give Instruction::isSameOperationAs a corresponding comment to noteDan Gohman2009-06-121-2/+3
| | | | | | | | | | | the relationship with MergeFunctions.cpp's isEquivalentOperation, and make a trivial code reordering so that the two functions are easier to compare. Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's isEquivalentOperation's comment, and fix a nearby 80-column violation. llvm-svn: 73241
* Keep callers of a weak function calling it, instead of the non-weak equivalent.Nick Lewycky2009-06-121-0/+1
| | | | llvm-svn: 73235
* Don't forget to match the calling convention when producing a thunk.Nick Lewycky2009-06-121-2/+2
| | | | llvm-svn: 73231
* Given two identical weak functions, produce one internal function and two weakNick Lewycky2009-06-121-4/+17
| | | | | | thunks. llvm-svn: 73230
* Add an "are types equivalent" operation that ignores the types that a pointerNick Lewycky2009-06-121-99/+354
| | | | | | | | | | | | | | | points to while analyzing all other fields. Use FoldingSetNodeID to produce a good hash. This dramatically decreases run times. Emit thunks. This means that it can look at all functions regardless of what the linkage is or if the address is taken, but unfortunately some small functions can be even shorter than the thunk because our backend doesn't yet realize it can just turn these into jumps. This means that this pass will pessimize code on average. llvm-svn: 73222
* Implement and use new method Function::hasAddressTaken().Jay Foad2009-06-103-38/+6
| | | | llvm-svn: 73164
* Remove an unused function SafeToDestroyConstant(). Rename an almostJay Foad2009-06-092-24/+9
| | | | | | | identical function ConstantIsDead() to SafeToDestroyConstant(), to emphasise the connection with Constant::destroyConstant(). llvm-svn: 73149
* Use cast<> instead of dyn_cast<> for things that are known to beJay Foad2009-06-062-7/+2
| | | | | | Instructions. llvm-svn: 73002
* Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This ↵Evan Cheng2009-06-021-6/+16
| | | | | | can happen when PHI uses are recursively dependent on each other. llvm-svn: 72710
* available_externall linkage is not local, this was confusing the codegenerator,Torok Edwin2009-05-232-3/+4
| | | | | | | | | and it wasn't generating calls through @PLT for these functions. hasLocalLinkage() is now false for available_externally, I attempted to fix the inliner and dce to handle available_externally properly. It passed make check. llvm-svn: 72328
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-2/+2
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Fix PR3754: don't mark functions that wrap MallocInst withDuncan Sands2009-05-061-0/+5
| | | | | | | | the readnone. Since MallocInst is scheduled for deletion it doesn't seem worth doing anything more subtle, such as having mayWriteToMemory return true for MallocInst. llvm-svn: 71077
* Revert r70630. Go back to appending ".b" to internal globals when shrinkingNick Lewycky2009-05-031-4/+2
| | | | | | them to bool. llvm-svn: 70653
* The second argument to RecursivelyDeleteTriviallyDeadInstructions hasDan Gohman2009-05-021-2/+2
| | | | | | a default value, and will hopefully be going away soon. llvm-svn: 70642
* Don't append ".b" to the names of globals that are being shrunk to booleans.Nick Lewycky2009-05-021-2/+4
| | | | llvm-svn: 70630
OpenPOWER on IntegriCloud