summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LICM.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add 'using' declarations to suppress -Woverloaded-virtual warnings.Matt Beaumont-Gay2012-12-041-0/+2
| | | | llvm-svn: 169214
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-11/+11
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Move TargetData to DataLayout.Micah Villmow2012-10-081-3/+3
| | | | llvm-svn: 165402
* LICM may hoist an instruction with undefined behavior above a trap.Nadav Rotem2012-09-041-7/+30
| | | | | | | | | | Scan the body of the loop and find instructions that may trap. Use this information when deciding if it is safe to hoist or sink instructions. Notice that we can optimize the search of instructions that may throw in the case of nested loops. rdar://11518836 llvm-svn: 163132
* Make MemoryBuiltins aware of TargetLibraryInfo.Benjamin Kramer2012-08-291-1/+1
| | | | | | | | | | | | | | | | This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. llvm-svn: 162841
* Avoid recomputing the unique exit blocks and their insert points when doingDan Gohman2012-08-081-11/+26
| | | | | | | | | multiple scalar promotions on a single loop. This also has the effect of preserving the order of stores sunk out of loops, which is aesthetically pleasing, and it happens to fix the testcase in PR13542, though it doesn't fix the underlying problem. llvm-svn: 161459
* An instruction in a loop is not guaranteed to be executed just because the loopNick Lewycky2012-05-011-0/+5
| | | | | | has no exit blocks. Fixes PR12706! llvm-svn: 155884
* Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman2011-12-141-1/+2
| | | | | | | | | into Analysis as a standalone function, since there's no need for it to be in VMCore. Also, update it to use isKnownNonZero and other goodies available in Analysis, making it more precise, enabling more aggressive optimization. llvm-svn: 146610
* Push StringRefs through the metadata interface.Benjamin Kramer2011-12-061-1/+1
| | | | llvm-svn: 145934
* Fix a few more places where TargetData/TargetLibraryInfo is not being passed.Chad Rosier2011-12-021-1/+11
| | | | | | Add FIXMEs to places that are non-trivial to fix. llvm-svn: 145661
* LICM pass now understands invariant load metadata. Nothing generates this ↵Pete Cooper2011-11-081-0/+2
| | | | | | yet so it will currently never get used in real tests llvm-svn: 144107
* Use 'getFirstInsertionPt' when trying to insert new instructions during LICM.Bill Wendling2011-08-181-3/+3
| | | | llvm-svn: 138008
* Atomic load/store support in LICM.Eli Friedman2011-08-151-6/+10
| | | | llvm-svn: 137648
* Bring LICM into compliance with the new "Memory Model for Concurrent ↵Eli Friedman2011-07-201-18/+30
| | | | | | Operations" in LangRef. llvm-svn: 135625
* Simplify. Consolidate dbg.declare handling in AllocaPromoter.Devang Patel2011-07-061-1/+1
| | | | llvm-svn: 134538
* LICM: Remove trailing white spacesTobias Grosser2011-07-061-32/+32
| | | | llvm-svn: 134521
* LICM: Do not loose alignment on promotionTobias Grosser2011-07-061-8/+30
| | | | | | | | The promotion code lost any alignment information, when hoisting loads and stores out of the loop. This lead to incorrect aligned memory accesses. We now use the largest alignment we can prove to be correct. llvm-svn: 134520
* Attempt to preserve debug line info in LICM; as the comment in the code ↵Eli Friedman2011-05-271-4/+14
| | | | | | | | says, it's hard to pick good line numbers for this transformation, but something is better than nothing. rdar://9143729 llvm-svn: 132215
* Don't sink or hoist debug info instrinsics; it isn't useful. This also ↵Eli Friedman2011-05-271-3/+6
| | | | | | | | prevents LICM sinking from erasing debug intrinsics which don't dominate any exit block of the loop. rdar://9143943 . llvm-svn: 132201
* Oops, wasn't intending to commit this. Partial revert of r132194.Eli Friedman2011-05-271-6/+9
| | | | llvm-svn: 132195
* Fix a silly mistake (which trips over an assertion) in r132099. rdar://9515076Eli Friedman2011-05-271-9/+6
| | | | llvm-svn: 132194
* Clean up the lazy initialization of DIBuilder a bit.Cameron Zwarich2011-05-241-2/+1
| | | | llvm-svn: 131956
* Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values whenCameron Zwarich2011-05-241-2/+3
| | | | | | promoting allocas to SSA variables. Fixes <rdar://problem/9479036>. llvm-svn: 131953
* PR9634: Don't unconditionally tell the AliasSetTracker that the PreheaderLoadEli Friedman2011-04-071-21/+4
| | | | | | | | | | | is equivalent to any other relevant value; it isn't true in general. If it is equivalent, the LoopPromoter will tell the AST the equivalence. Also, delete the PreheaderLoad if it is unused. Chris, since you were the last one to make major changes here, can you check that this is sane? llvm-svn: 129049
* While sinking an instruction, do not lose llvm.dbg.value intrinsic.Devang Patel2011-03-081-1/+2
| | | | llvm-svn: 127214
* Generalize LoadAndStorePromoter a bit and switch LICMChris Lattner2011-01-151-159/+70
| | | | | | to use it. llvm-svn: 123501
* make inSubLoop much more efficient.Chris Lattner2011-01-021-4/+1
| | | | llvm-svn: 122703
* rip out isExitBlockDominatedByBlockInLoop, calling DomTree::dominates instead.Chris Lattner2011-01-021-37/+4
| | | | | | | | isExitBlockDominatedByBlockInLoop is a relic of the days when domtree was *just* a tree and didn't have DFS numbers. Checking DFS numbers is faster and easier than "limiting the search of the tree". llvm-svn: 122702
* Enhance LICM to promote alias sets whose pointers themselves are stored,Chris Lattner2010-12-191-1/+4
| | | | | | which doesn't affect the memory address being promoted. llvm-svn: 122172
* fix PR8602, a bug in an assertion: a volatile store *of* a pointerChris Lattner2010-12-191-1/+1
| | | | | | | does not make the alias set for that pointer volatile, just stores *to* the pointer. llvm-svn: 122171
* Reference ScalarEvolution by name rather than directly in LICM,Dan Gohman2010-11-171-2/+1
| | | | | | to avoid an unneeded dependence. llvm-svn: 119557
* Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.Dan Gohman2010-11-091-1/+1
| | | | llvm-svn: 118618
* Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman2010-10-191-2/+2
| | | | | | uint64_t, plus fixes for places I missed before. llvm-svn: 116875
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-191-1/+0
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM.Dan Gohman2010-10-181-3/+6
| | | | llvm-svn: 116743
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+7
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* fix PR8102, a case where we'd copyValue from a value that we alreadyChris Lattner2010-09-141-11/+11
| | | | | | | | deleted. Fix this by doing the copyValue's before we delete stuff! The testcase only repros the problem on my system with valgrind. llvm-svn: 113820
* fix PR8067, an over-aggressive assertion in LICM.Chris Lattner2010-09-061-4/+4
| | | | llvm-svn: 113146
* pull a simple method out of LICM into a new Chris Lattner2010-09-061-16/+1
| | | | | | | | | | Loop::hasLoopInvariantOperands method. Remove a useless and confusing Loop::isLoopInvariant(Instruction) method, which didn't do what you thought it did. No functionality change. llvm-svn: 113133
* fix a bug in my licm rewrite when a load from the promoted memoryChris Lattner2010-09-041-3/+29
| | | | | | | | location is being re-stored to the memory location. We would get a dangling pointer from the SSAUpdate data structure and miss a use. This fixes PR8068 llvm-svn: 113042
* fix more AST updating bugs, correcting miscompilation in PR8041Chris Lattner2010-09-021-2/+4
| | | | llvm-svn: 112878
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-021-2/+2
| | | | | | | | | I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112810
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-011-2/+2
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-011-2/+2
| | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112699
* licm is wasting time hoisting constant foldable operations,Chris Lattner2010-08-311-4/+16
| | | | | | | instead of hoisting them, just fold them away. This occurs in the testcase for PR8041, for example. llvm-svn: 112669
* rewrite DwarfEHPrepare to use SSAUpdater to promote its allocasChris Lattner2010-08-291-1/+1
| | | | | | | | instead of PromoteMemToReg. This allows it to stop using DF and DT, eliminating a computation of DT and DF from clang -O3. Clang is now down to 2 runs of DomFrontier. llvm-svn: 112457
* two changes: 1) make AliasSet hold the list of call sites with anChris Lattner2010-08-291-0/+1
| | | | | | | | | | | | | | assertingvh so we get a violent explosion if the pointer dangles. 2) Fix AliasSetTracker::deleteValue to remove call sites with by-pointer comparisons instead of by-alias queries. Using findAliasSetForCallSite can cause alias sets to get merged when they shouldn't, and can also miss alias sets when the call is readonly. #2 fixes PR6889, which only repros with a .c file :( llvm-svn: 112452
* LICM does get dead instructions input to it. Instead of sinking themChris Lattner2010-08-291-1/+12
| | | | | | out of loops, just delete them. llvm-svn: 112451
OpenPOWER on IntegriCloud