summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/GlobalOpt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-14/+14
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Use hasDefinitiveInitializer() instead of testing the same thingDan Gohman2009-08-191-3/+3
| | | | | | | by hand, and fix a few places that were using hasInitializer() that appear to depend on the initializer value. llvm-svn: 79441
* Fix a bug that caused globalopt to miscompile tramp3d: don't missDan Gohman2009-08-181-3/+8
| | | | | | unruly indices for arrays that are members of structs. llvm-svn: 79337
* Don't access the first element of a potentially emptyDuncan Sands2009-08-171-6/+7
| | | | | | | | | | | vector (&Formals[0]). With this change llvm-gcc builds with expensive checking enabled for C, C++ and Fortran. While there, change a std::vector into a SmallVector. This is partly gratuitous, but mostly because not all STL vector implementations define the data method (and it should be faster). llvm-svn: 79237
* Make TargetData optional in GlobalOpt and ArgumentPromotion.Dan Gohman2009-08-141-12/+13
| | | | llvm-svn: 78967
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-20/+25
| | | | llvm-svn: 78948
* Remove a bunch more now-unnecessary Context arguments.Dan Gohman2009-08-121-1/+1
| | | | llvm-svn: 78809
* Privatize the StructType table, which unfortunately involves routing ↵Owen Anderson2009-08-051-2/+2
| | | | | | contexts through a number of APIs. llvm-svn: 78258
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-15/+15
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-311-4/+4
| | | | llvm-svn: 77685
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-6/+6
| | | | llvm-svn: 77635
* Twines: Don't allow implicit conversion from integers, this is too tricky.Daniel Dunbar2009-07-301-7/+7
| | | | llvm-svn: 77605
* Switch obvious clients to Twine instead of utostr (when they were already usingDaniel Dunbar2009-07-301-8/+7
| | | | | | | | | a Twine, e.g., for names). - I am a little ambivalent about this; we don't want the string conversion of utostr, but using overload '+' mixed with string and integer arguments is sketchy. On the other hand, this particular usage is something of an idiom. llvm-svn: 77579
* Move types back to the 2.5 API.Owen Anderson2009-07-291-5/+5
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-11/+11
| | | | llvm-svn: 77494
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-281-2/+2
| | | | llvm-svn: 77347
* Move ConstantStruct back to 2.5 API.Owen Anderson2009-07-271-2/+2
| | | | llvm-svn: 77266
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-3/+4
| | | | | | | | | | - 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-241-6/+6
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-86/+86
| | | | llvm-svn: 76702
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-4/+4
| | | | llvm-svn: 76598
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-161-0/+1
| | | | | | | | 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-151-5/+4
| | | | | | AllocaInst and MallocInst. llvm-svn: 75863
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-4/+5
| | | | llvm-svn: 75703
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-4/+4
| | | | | | | | | 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-111-4/+5
| | | | | | | | | 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-081-20/+15
| | | | | | module is required. llvm-svn: 75025
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-081-9/+15
| | | | llvm-svn: 74985
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-20/+20
| | | | llvm-svn: 74878
* 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-061-89/+118
| | | | llvm-svn: 74811
* improve the APIs for creating struct and function types with no ↵Chris Lattner2009-07-011-2/+1
| | | | | | | | arguments/elements to not have to create a temporary vector (in the API at least). Patch by Jay Foad! llvm-svn: 74584
* >> 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
* Implement and use new method Function::hasAddressTaken().Jay Foad2009-06-101-18/+2
| | | | llvm-svn: 73164
* Remove an unused function SafeToDestroyConstant(). Rename an almostJay Foad2009-06-091-9/+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-061-2/+1
| | | | | | 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
* 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
* Revert r70630. Go back to appending ".b" to internal globals when shrinkingNick Lewycky2009-05-031-4/+2
| | | | | | them to bool. llvm-svn: 70653
* Don't append ".b" to the names of globals that are being shrunk to booleans.Nick Lewycky2009-05-021-2/+4
| | | | llvm-svn: 70630
* Ignore debug info while evaluating function.Devang Patel2009-03-091-1/+7
| | | | llvm-svn: 66490
* use MemTransferInst.Chris Lattner2009-03-081-1/+1
| | | | llvm-svn: 66362
* fix a serious pessimization that Tron on IRC pointed out where we wouldChris Lattner2009-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | "boolify" pointers, generating really awful code because getting the pointer value requires a load itself. Before: _foo: movb $1, _X.b ret _get: xorl %ecx, %ecx movb _X.b, %al testb %al, %al movl $_Y, %eax cmove %ecx, %eax ret With the xform disabled: _foo: movl $_Y, _X ret _get: movl _X, %eax ret llvm-svn: 66351
* While thinking about the one-definition-rule and tryingDuncan Sands2009-03-061-3/+12
| | | | | | | | | | | | | to find a tiny mouse hole to squeeze through, it struck me that globals without a name can be considered internal since they can't be referenced from outside the current module. This patch makes GlobalOpt give them internal linkage. Also done for aliases even though they always have names, since in my opinion anonymous aliases should be allowed for consistency with global variables and functions. So if that happens one day, this code is ready! llvm-svn: 66267
* Revert 66224.Devang Patel2009-03-061-9/+7
| | | | llvm-svn: 66233
* Revert rev. 66167. Devang Patel2009-03-061-31/+9
| | | | | | We are still not out of woods yet. llvm-svn: 66232
* Do not let debug info prevert globalopt from shriking a global vars to boolean.Devang Patel2009-03-061-7/+9
| | | | llvm-svn: 66224
* GlobalOpt only process non constant local GVs while optimizing global vars.Devang Patel2009-03-051-9/+31
| | | | | | | | | | | | If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B. In other words, debug info should not interfere in removal of unused GV. --This life, and those below, will be ignored-- M test/Transforms/GlobalOpt/2009-03-03-dbg.ll M lib/Transforms/IPO/GlobalOpt.cpp llvm-svn: 66167
OpenPOWER on IntegriCloud