summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* available_externall linkage is not local, this was confusing the codegenerator,Torok Edwin2009-05-232-2/+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
* Teach SCEVExpander to expand arithmetic involving pointers into GEPDan Gohman2009-05-191-30/+31
| | | | | | | | | | | | | | | | instructions. It attempts to create high-level multi-operand GEPs, though in cases where this isn't possible it falls back to casting the pointer to i8* and emitting a GEP with that. Using GEP instructions instead of ptrtoint+arithmetic+inttoptr helps pointer analyses that don't use ScalarEvolution, such as BasicAliasAnalysis. Also, make the AddrModeMatcher more aggressive in handling GEPs. Previously it assumed that operand 0 of a GEP would require a register in almost all cases. It now does extra checking and can do more matching if operand 0 of the GEP is foldable. This fixes a problem that was exposed by SCEVExpander using GEPs. llvm-svn: 72093
* Reuse existing getUnderlyingObject instead ofDale Johannesen2009-05-141-24/+6
| | | | | | adding another copy. llvm-svn: 71783
* Handle some additonal cases of external weak globals.Dale Johannesen2009-05-131-4/+22
| | | | llvm-svn: 71717
* Don't generate a select whose operand is load of a weakDale Johannesen2009-05-131-0/+6
| | | | | | | external. These may have address 0 and are not safe to execute unconditionally. llvm-svn: 71688
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-092-2/+2
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* PR4123: don't crash when inlining a call which uses its own result.Eli Friedman2009-05-081-3/+10
| | | | llvm-svn: 71199
* Simplify code by using SmallVector's pop_back_val() instead ofDan Gohman2009-05-064-12/+6
| | | | | | separate back() and pop_back() calls. llvm-svn: 71089
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-7/+5
| | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. llvm-svn: 71071
* Re-apply 70645, converting ScalarEvolution to useDan Gohman2009-05-042-22/+6
| | | | | | | | | | | | CallbackVH, with fixes. allUsesReplacedWith need to walk the def-use chains and invalidate all users of a value that is replaced. SCEVs of users need to be recalcualted even if the new value is equivalent. Also, make forgetLoopPHIs walk def-use chains, since any SCEV that depends on a PHI should be recalculated when more information about that PHI becomes available. llvm-svn: 70927
* Factor loop backedge finding out of CodeGenPrepare into a new Chris Lattner2009-05-041-0/+50
| | | | | | FindFunctionBackedges function. llvm-svn: 70819
* Revert r70645 for now; it's causing a variety of regressions.Dan Gohman2009-05-032-6/+22
| | | | llvm-svn: 70661
* Convert ScalarEvolution to use CallbackVH for its internal map. ThisDan Gohman2009-05-022-22/+6
| | | | | | | | | makes ScalarEvolution::deleteValueFromRecords, and it's code that subtly needed to be called before ReplaceAllUsesWith, unnecessary. It also makes ValueDeletionListener unnecessary. llvm-svn: 70645
* Previously, RecursivelyDeleteDeadInstructions provided an optionDan Gohman2009-05-022-5/+62
| | | | | | | | | | | | | | | | | | of returning a list of pointers to Values that are deleted. This was unsafe, because the pointers in the list are, by nature of what RecursivelyDeleteDeadInstructions does, always dangling. Replace this with a simple callback mechanism. This may eventually be removed if all clients can reasonably be expected to use CallbackVH. Use this to factor out the dead-phi-cycle-elimination code from LSR utility function, and generalize it to use the RecursivelyDeleteTriviallyDeadInstructions utility function. This makes LSR more aggressive about eliminating dead PHI cycles; adjust tests to either be less trivial or to simply expect fewer instructions. llvm-svn: 70636
* Real fix for PR3549, by using caching for predecessor counts in addition to ↵Owen Anderson2009-04-221-11/+13
| | | | | | | | the predecessors themselves. This halves the time to optimize the testcase, beyond what my previous patch did. llvm-svn: 69792
* Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the ↵Owen Anderson2009-04-221-2/+5
| | | | | | testcase from PR3549. More improvements to come. llvm-svn: 69788
* use predicate instead of hand-rolled loopChris Lattner2009-04-211-11/+4
| | | | llvm-svn: 69752
* remove trailing whitespaceJim Grosbach2009-04-171-50/+50
| | | | llvm-svn: 69402
* Fix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of Eli Friedman2009-04-161-19/+11
| | | | | | incoming edges for a block with many predecessors. llvm-svn: 69312
* While inlining, clone llvm.dbg.func.start intrinsic and adjust Devang Patel2009-04-152-3/+52
| | | | | | llvm.dbg.region.end instrinsic. This nested llvm.dbg.func.start/llvm.dbg.region.end pair now enables DW_TAG_inlined_subroutine support in code generator. llvm-svn: 69118
* Update call graph after inlining invoke.Devang Patel2009-03-311-2/+19
| | | | | | Patch by Jay Foad. llvm-svn: 68120
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-2/+1
| | | | | | explicitly flush it. llvm-svn: 67526
* Factorize out a concept - no functionality change.Duncan Sands2009-03-211-2/+1
| | | | llvm-svn: 67454
* Don't load values out of global constants with weakDuncan Sands2009-03-201-1/+2
| | | | | | | | | linkage: the value may be replaced with something different at link time. (Frontends that want to allow values to be loaded out of weak constants can give their constants weak_odr linkage). llvm-svn: 67407
* Fix comment typo.Dale Johannesen2009-03-191-1/+1
| | | | llvm-svn: 67307
* Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.Zhou Sheng2009-03-181-3/+0
| | | | | | | If the instruction has no users, it is also not only used by debug info and should not be deleted. llvm-svn: 67194
* Fix a bug.Zhou Sheng2009-03-181-0/+3
| | | | | | If I->use_empty(), this method should return false. llvm-svn: 67180
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode). Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000004 start + 18446744073709543220 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000006 start + 18446744073709543222 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes --- Reverse-merging (from foreign repository) r66920 into '.': U include/llvm/Support/CallSite.h U include/llvm/Instructions.h U lib/Analysis/IPA/GlobalsModRef.cpp U lib/Analysis/IPA/Andersens.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/Instructions.cpp U lib/VMCore/Verifier.cpp U lib/VMCore/AsmWriter.cpp U lib/Transforms/Utils/LowerInvoke.cpp U lib/Transforms/Scalar/SimplifyCFGPass.cpp U lib/Transforms/IPO/PruneEH.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp llvm-svn: 66953
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-131-2/+2
| | | | | | | | | | | | | | | | | | changes. For InvokeInst now all arguments begin at op_begin(). The Callee, Cont and Fail are now faster to get by access relative to op_end(). This patch introduces some temporary uglyness in CallSite. Next I'll bring CallInst up to a similar scheme and then the uglyness will magically vanish. This patch also exposes all the reliance of the libraries on InvokeInst's operand ordering. I am thinking of taking care of that too. llvm-svn: 66920
* Fix one more place where debug info affectedDale Johannesen2009-03-131-2/+5
| | | | | | codegen (speculative execution). llvm-svn: 66859
* Previous debug info fix to this code wasn't quiteDale Johannesen2009-03-121-5/+4
| | | | | | | | right; did the wrong thing when there are exactly 11 non-debug instructions, followed by debug info. Remove a FIXME since it's apparently been fixed along the way. llvm-svn: 66840
* There already was a class to force deterministicDale Johannesen2009-03-121-23/+14
| | | | | | sorting of ConstantInt's; unreinvent wheel. llvm-svn: 66824
* Another missing check for debug intrinsics.Dale Johannesen2009-03-121-1/+1
| | | | llvm-svn: 66800
* Allow for switch values bigger than 64 bits.Dale Johannesen2009-03-121-1/+1
| | | | llvm-svn: 66751
* Fix some nondeterministic behavior when forwardingDale Johannesen2009-03-121-3/+13
| | | | | | | | | from a switch table. Multiple table entries that branch to the same place were being sorted by the pointer value of the ConstantInt*; changed to sort by the actual value of the ConstantInt. llvm-svn: 66749
* Don't consider debug intrinsics when checkingDale Johannesen2009-03-101-2/+2
| | | | | | whether a callee to be inlined is a leaf. llvm-svn: 66588
* Ignore dbg info, while estimating size of jump through block.Devang Patel2009-03-101-1/+3
| | | | llvm-svn: 66554
* If a function is marked alwaysinline, it must be inlined (possibly for ↵Evan Cheng2009-03-101-7/+7
| | | | | | correctness). Do so even if the callee has dynamic alloca and the caller doesn't. llvm-svn: 66539
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-072-7/+4
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Fix another case where debug info interferes withDale Johannesen2009-03-061-2/+6
| | | | | | an optimization. llvm-svn: 66288
* While hoisting instruction to speculatively execute simple bb, ignore dbg ↵Devang Patel2009-03-061-18/+30
| | | | | | intrinsics. llvm-svn: 66255
* Tweak the check for promotable alloca's to handleDale Johannesen2009-03-061-1/+7
| | | | | | debug intrinsics correctly. llvm-svn: 66225
* Add "check/remove dbg var" helper routines.Devang Patel2009-03-061-0/+44
| | | | llvm-svn: 66223
* Revert unintended commmit.Dale Johannesen2009-03-041-5/+2
| | | | llvm-svn: 66001
* Skip ptr-to-ptr bitcasts when counting in another case.Dale Johannesen2009-03-041-4/+4
| | | | llvm-svn: 66000
* Always skip ptr-to-ptr bitcasts when counting,Dale Johannesen2009-03-041-2/+5
| | | | | | per Chris' suggestion. Slightly faster. llvm-svn: 65999
* Marking debug info intrinsics as not touching memoryDale Johannesen2009-03-031-0/+3
| | | | | | caused them to be considered trivially dead. Fix this. llvm-svn: 65979
* Instruction counters must skip the bitcasts thatDale Johannesen2009-03-031-0/+6
| | | | | | | feed into llvm.dbg.declare nodes, as well as the debug directives themselves. llvm-svn: 65976
* When removing a store to an alloca that has only oneDale Johannesen2009-03-031-2/+1
| | | | | | | | use, check also for the case where it has two uses, the other being a llvm.dbg.declare. This is needed so debug info doesn't affect codegen. llvm-svn: 65970
* Remove accidental check-ins in r65960. :-(Bill Wendling2009-03-031-5/+1
| | | | llvm-svn: 65961
OpenPOWER on IntegriCloud