summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LICM.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Second batch of passes using LLVMContext.Owen Anderson2009-07-031-2/+3
| | | | llvm-svn: 74753
* Revert r67798: it breaks llvm-gcc bootstrap on x86-64-linux, presumably due toDuncan Sands2009-03-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | a miscompilation. make[4]: Entering directory `gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include' if [ ! -d "./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch" ]; then \ mkdir -p ./x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch; \ fi; \ gcc-4.2.llvm-objects/./gcc/xgcc -shared-libgcc -Bgcc-4.2.llvm-objects/./gcc -nostdinc++ -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src -Lgcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/include -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g -O2 -D_GNU_SOURCE -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -Igcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include -Igcc-4.2.llvm/libstdc++-v3/libsupc++ -O2 -g gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h -o x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch In file included from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/repeat.h:247, from gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional:1098, from gcc-4.2.llvm/libstdc++-v3/include/precompiled/stdtr1c++.h:53: gcc-4.2.llvm-objects/x86_64-unknown-linux-gnu/libstdc++-v3/include/tr1/functional_iterate.h:417: internal compiler error: in ggc_recalculate_in_use_p, at ggc-page.c:1602 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.org/bugs/> for instructions. make[4]: *** [x86_64-unknown-linux-gnu/bits/stdtr1c++.h.gch/O2g.gch] Error 1 llvm-svn: 67839
* While hoisting an instruction, update alias info set tracker.Devang Patel2009-03-261-0/+1
| | | | llvm-svn: 67798
* reimplement AliasSetTracker in terms of DenseMap instead of hash_map,Chris Lattner2009-03-091-7/+7
| | | | | | hopefully no functionality change. llvm-svn: 66398
* This code doesn't actually use the ExitingBlocks list.Dan Gohman2009-02-121-3/+0
| | | | llvm-svn: 64376
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-221-1/+1
| | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. llvm-svn: 58010
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Put the LICM of constant GlobalVariables, introduced in r53945, under aDan Gohman2008-07-241-1/+11
| | | | | | | command-line option, and disable it by default. It introduced performance regressions because CodeGen is currently not able to remat such loads. llvm-svn: 53997
* "Allow LICM to sink or lift loads from constant memory. Also add a testChris Lattner2008-07-231-0/+5
| | | | | | | | | | | case for this. This allows instructions like loads from global variables declared to be constant to be moved out of loops." Patch by Stefanus Du Toit! llvm-svn: 53945
* Use Loop::block_iterator.Dan Gohman2008-06-221-9/+10
| | | | llvm-svn: 52616
* Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places toDan Gohman2008-05-231-7/+3
| | | | | | use it instead of duplicating its functionality. llvm-svn: 51499
* rewrite the validity checking for memory promotion to be simpler,Chris Lattner2008-05-221-49/+52
| | | | | | | more aggressive, and more correct. Verify that we only attempt to promote loads and stores. llvm-svn: 51406
* Use 'continue' to reduce nesting in this loop. No functionality change.Chris Lattner2008-05-221-54/+51
| | | | llvm-svn: 51399
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-7/+7
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Make several variable declarations static.Dan Gohman2008-05-061-1/+1
| | | | llvm-svn: 50696
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Integrate the readonly/readnone logic more deeplyDuncan Sands2007-12-011-16/+14
| | | | | | | | | | | | | | | into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. llvm-svn: 44487
* Remove another leak. Due to some reason AliasSetTracker didn't had any dtor...Anton Korobeynikov2007-11-251-0/+5
| | | | llvm-svn: 44320
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* Fix a typo in a comment.Dan Gohman2007-10-311-1/+1
| | | | llvm-svn: 43553
* Use empty() member functions when that's what's being tested for insteadDan Gohman2007-10-031-1/+1
| | | | | | of comparing begin() and end(). llvm-svn: 42585
* Relax unsafe use check. If there is one unconditional use inside the loop ↵Devang Patel2007-10-011-22/+22
| | | | | | then it is safe to promote value even if there is another conditional use inside the loop. llvm-svn: 42493
* Do not reserve DOM check for GetElementPtrInst.Devang Patel2007-09-251-21/+22
| | | | llvm-svn: 42306
* Do not promote null values because it may be unsafe to do so.Devang Patel2007-09-241-0/+4
| | | | llvm-svn: 42270
* Avoid unsafe promotion.Devang Patel2007-09-191-9/+41
| | | | llvm-svn: 42149
* Fix PR1657Devang Patel2007-09-181-0/+8
| | | | llvm-svn: 42075
* Use SmallVector instead of std::vector.Devang Patel2007-08-211-3/+3
| | | | llvm-svn: 41207
* Typo.Nick Lewycky2007-08-181-1/+1
| | | | llvm-svn: 41168
* Add note.Devang Patel2007-07-311-1/+3
| | | | llvm-svn: 40638
* Implement Simple Analysis interfaces - cloneBasicBlockAnalysis and ↵Devang Patel2007-07-311-0/+26
| | | | | | deleteAnalysisValue. llvm-svn: 40626
* LICM preserves scalar evolution and dom frontier.Devang Patel2007-07-301-0/+3
| | | | llvm-svn: 40602
* Do not require ETForest. Now it is unused by LICM.Devang Patel2007-06-071-3/+0
| | | | llvm-svn: 37502
* Use DominatorTree instead of ETForest.Devang Patel2007-06-071-2/+2
| | | | | | This allows faster immediate domiantor walk. llvm-svn: 37500
* Allow insertelement, extractelement, and shufflevector to be hoisted/sunkDan Gohman2007-06-051-1/+3
| | | | | | by LICM. llvm-svn: 37435
* s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/gDevang Patel2007-06-041-8/+8
| | | | llvm-svn: 37407
* s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/gDevang Patel2007-06-031-8/+8
| | | | llvm-svn: 37403
* Insert new instructions in AliasSet.Devang Patel2007-06-011-1/+5
| | | | llvm-svn: 37390
* Fix typo.Devang Patel2007-05-301-1/+1
| | | | llvm-svn: 37360
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | llvm-svn: 36632
* Mem2Reg does not need TargetData.Devang Patel2007-04-251-2/+2
| | | | llvm-svn: 36444
* Rollback some changes that adversely affected performance. I'm currently ↵Owen Anderson2007-04-241-22/+26
| | | | | | | | rethinking my approach to this, so hopefully I'll find a way to do this without making this slower. llvm-svn: 36392
* Fix a comment.Owen Anderson2007-04-211-1/+1
| | | | llvm-svn: 36299
* Move more passes to using ETForest instead of DominatorTree.Owen Anderson2007-04-201-5/+2
| | | | llvm-svn: 36271
* Switch more uses of DominatorTree over to ETForest.Owen Anderson2007-04-181-22/+24
| | | | llvm-svn: 36254
* Spell doFinalization right, so that it is a proper virtual override andDan Gohman2007-04-171-1/+1
| | | | | | gets called. llvm-svn: 36208
* fix long linesChris Lattner2007-04-141-1/+1
| | | | llvm-svn: 36031
OpenPOWER on IntegriCloud