summaryrefslogtreecommitdiff
path: root/test/Transforms/DeadStoreElimination
Commit message (Collapse)AuthorAge
* Fix PR8728, a miscompilation I recently introduced. When optimizingChris Lattner2010-12-06
| | | | | | | | | | | | | | | | | | | | | | | memcpy's like: memcpy(A, B) memcpy(A, C) we cannot delete the first memcpy as dead if A and C might be aliases. If so, we actually get: memcpy(A, B) memcpy(A, A) which is not correct to transform into: memcpy(A, A) This patch was heavily influenced by Jakub Staszak's patch in PR8728, thanks Jakub! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120974 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance DSE to handle the variable index case in PR8657.Chris Lattner2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120498 91177308-0d34-0410-b5e6-96231b3b80d8
* teach DSE to use GetPointerBaseWithConstantOffset to analyzeChris Lattner2010-11-30
| | | | | | | | | may-aliasing stores that partially overlap with different base pointers. This implements PR6043 and the non-variable part of PR8657 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120485 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance isRemovable to refuse to delete volatile mem transfersChris Lattner2010-11-30
| | | | | | | | now that DSE hacks on them. This fixes a regression I introduced, by generalizing DSE to hack on transfers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120445 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite the main DSE loop to be written in terms of reasoningChris Lattner2010-11-30
| | | | | | | | | | | | | | | | about pairs of AA::Location's instead of looking for MemDep's "Def" predicate. This is more powerful and general, handling memset/memcpy/store all uniformly, and implementing PR8701 and probably obsoleting parts of memcpyoptimizer. This also fixes an obscure bug with init.trampoline and i8 stores, but I'm not surprised it hasn't been hit yet. Enhancing init.trampoline to carry the size that it stores would allow DSE to be much more aggressive about optimizing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120406 91177308-0d34-0410-b5e6-96231b3b80d8
* merge one more awayChris Lattner2010-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120375 91177308-0d34-0410-b5e6-96231b3b80d8
* I already merged partial-overwrite.ll -> PartialStore.llChris Lattner2010-11-30
| | | | | | | Merge context-sensitive.ll -> simple.ll and upgrade it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120374 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up DSE tests, removing some poorly reduced and useless old test,Chris Lattner2010-11-30
| | | | | | | merging more into other larger .ll files, filecheckizing along the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120373 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance basicaa to return "Mod" for a memcpy call when theChris Lattner2010-11-30
| | | | | | | queried location doesn't overlap the source, and add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120370 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach basicaa that memset's modref set is at worst "mod" and neverChris Lattner2010-11-30
| | | | | | | | | | | contains "ref". Enhance DSE to use a modref query instead of a store-specific hack to generalize the "ignore may-alias stores" optimization to handle memset and memcpy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120368 91177308-0d34-0410-b5e6-96231b3b80d8
* my previous patch would cause us to start deleting some volatileChris Lattner2010-11-30
| | | | | | | stores, fix and add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120363 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some broken CHECK lines.Benjamin Kramer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120332 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8677, patch by Jakub Staszak!Chris Lattner2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120325 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR8576, deleting dead stores with intervening may-alias stores.Chris Lattner2010-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119927 91177308-0d34-0410-b5e6-96231b3b80d8
* file checkizeChris Lattner2010-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119926 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance DSE to handle the case where a free call makes more thanDan Gohman2010-11-12
| | | | | | | | one store dead. This is especially noticeable in SingleSource/Benchmarks/Shootout/objinst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118875 91177308-0d34-0410-b5e6-96231b3b80d8
* Filecheckize.Dan Gohman2010-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118874 91177308-0d34-0410-b5e6-96231b3b80d8
* Make BasicAliasAnalysis a normal AliasAnalysis implementation whichDan Gohman2010-10-18
| | | | | | | | | | | | | does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116720 91177308-0d34-0410-b5e6-96231b3b80d8
* add newlines at the end of files.Chris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100705 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DSE only scan blocks that are reachable from the entryChris Lattner2010-02-11
| | | | | | | | | | block. Other blocks may have pointer cycles that will crash basicaa and other alias analyses. In any case, there is no point wasting cycles optimizing dead blocks. This fixes rdar://7635088 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95852 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete useless trailing semicolons.Dan Gohman2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92740 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some CHECK lines which were ignored by accident.Benjamin Kramer2009-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91214 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup/remove some parts of the lifetime region handling code in memdep and ↵Owen Anderson2009-12-02
| | | | | | | | | GVN, per Chris' comments. Adjust testcases to match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90304 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach memdep to look for memory use intrinsics during dependency queries. FixesNick Lewycky2009-11-28
| | | | | | | PR5574. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90045 91177308-0d34-0410-b5e6-96231b3b80d8
* implement a FIXME: limit the depth that DecomposeGEPExpression goes the sameChris Lattner2009-11-28
| | | | | | | | | | | way that getUnderlyingObject does it. This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!' assertion on sqlite3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90038 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach BasicAA that a constant expression can't alias memory provably notNick Lewycky2009-11-14
| | | | | | | allocated until runtime (such as an alloca). Patch by Hans Wennborg! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88760 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach DSE to eliminate useless trampolines.Duncan Sands2009-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86683 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r86359, "Teach dead store elimination that certain intrinsics write toNick Lewycky2009-11-10
| | | | | | | | memory just like a store" with bug fixed (partial-overwrite.ll is the regression test). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86667 91177308-0d34-0410-b5e6-96231b3b80d8
* remove empty files.Chris Lattner2009-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86392 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r86359, it is breaking the self host on theChris Lattner2009-11-07
| | | | | | | llvm-gcc-i386-darwin9 build bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86391 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach dead store elimination that certain intrinsics write to memory just likeNick Lewycky2009-11-07
| | | | | | | a store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86359 91177308-0d34-0410-b5e6-96231b3b80d8
* improve DSE when TargetData is not around, based on work byChris Lattner2009-11-04
| | | | | | | Hans Wennborg! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86067 91177308-0d34-0410-b5e6-96231b3b80d8
* Make opt default to not adding a target data string and update tests that ↵Kenneth Uildriks2009-11-03
| | | | | | depend on target data to supply it within the test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat lifetime begin/end markers as allocations/frees respectively for theOwen Anderson2009-10-28
| | | | | | | purposes for GVN/DSE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85383 91177308-0d34-0410-b5e6-96231b3b80d8
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-11
| | | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-08
| | | | | | | of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR4815: some cases where DeleteDeadInstruction can deleteChris Lattner2009-09-02
| | | | | | | the instruction BBI points to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80768 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-04
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement the inner loop of DSE. It now uniformly uses getDependence(),Chris Lattner2008-12-06
| | | | | | | | | doesn't do its own local caching, and is slightly more aggressive about free/store dse (see testcase). This eliminates the last external client of MemDep::getDependenceFrom(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60619 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a thinko that manifested as a crash on clamav last night.Chris Lattner2008-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60251 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3141 by ensuring that MemoryDependenceAnalysis::removeInstructionChris Lattner2008-11-28
| | | | | | | | | properly updates the reverse dependency map when it installs updated dependencies for instructions that depend on the removed instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60222 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for eliminating stores that store the same value that was just ↵Owen Anderson2008-07-28
| | | | | | | | | loaded. This fixes PR2599. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54133 91177308-0d34-0410-b5e6-96231b3b80d8
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-20
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8
* Update old-style syntax in some "not grep" tests.Dan Gohman2008-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50560 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix DSE to not eliminate volatile loads with no uses.Dan Gohman2008-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50370 91177308-0d34-0410-b5e6-96231b3b80d8
* rename *.llx -> *.ll, last batch.Chris Lattner2008-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49971 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DSE much more aggressive by performing DCE earlier. Update a testcase ↵Owen Anderson2008-01-30
| | | | | | to reflect this increased aggressiveness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46542 91177308-0d34-0410-b5e6-96231b3b80d8