summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-21/+28
| | | | | | | | | | - 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-11/+12
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-10/+12
| | | | llvm-svn: 76702
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-12/+12
| | | | llvm-svn: 76598
* Move a bit more state over to the LLVMContext.Owen Anderson2009-07-211-14/+17
| | | | llvm-svn: 76533
* Replace intersectWith with maximalIntersectWith. The latter guarantees thatNick Lewycky2009-07-181-10/+10
| | | | | | | | all values belonging to the intersection will belong to the resulting range. The former was inconsistent about that point (either way is fine, just pick one.) This is part of PR4545. llvm-svn: 76289
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-161-10/+18
| | | | | | | | number of issues in our current context-passing stuff, which is also fixed here llvm-svn: 76089
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-1/+1
| | | | llvm-svn: 75703
* Move more functionality over to LLVMContext.Owen Anderson2009-07-131-2/+2
| | | | llvm-svn: 75497
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-131-14/+19
| | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. llvm-svn: 75445
* Move a method that creates constant ranges relative to another constant rangeNick Lewycky2009-07-111-54/+5
| | | | | | | | | | per icmp predicate out of predsimplify and into ConstantRange. Add another utility method that determines whether one range is a subset of another. Combine with the former to determine whether icmp pred range, range is known to be true or not. llvm-svn: 75357
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-2/+2
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Constify this value.Owen Anderson2009-06-261-3/+2
| | | | llvm-svn: 74330
* Use cast<> instead of dyn_cast<> for things that are known to beJay Foad2009-06-061-15/+12
| | | | | | Instructions. llvm-svn: 73002
* Silence unused variable warnings.Devang Patel2008-11-211-0/+2
| | | | llvm-svn: 59841
* fix leakage of ValueNumberingNuno Lopes2008-11-091-0/+1
| | | | llvm-svn: 58933
* Add value range analyzing of Add and Sub.Nick Lewycky2008-10-241-9/+73
| | | | | | Understand that mul %x, 1 = %x. llvm-svn: 58069
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. llvm-svn: 55263
* InequalityGraph::node() can create new nodes, invalidating iterators acrossNick Lewycky2008-05-271-0/+1
| | | | | | | the set of nodes. Fix makeEqual to handle this by creating the new node first then iterating across them second. llvm-svn: 51573
* Grammaro.Nick Lewycky2008-05-261-1/+1
| | | | llvm-svn: 51572
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-4/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Remove unnecessary <sstream> includes.Dan Gohman2008-04-141-1/+0
| | | | llvm-svn: 49681
* Fix "Control reaches the end of non-void function" warnings, Chris Lattner2008-03-301-0/+2
| | | | | | patch by David Chisnall. llvm-svn: 48963
* De-tabify.Bill Wendling2008-02-261-2/+2
| | | | llvm-svn: 47599
* Add explicit keywords.Dan Gohman2008-02-201-1/+1
| | | | llvm-svn: 47382
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 optimization. %x = sub %x, %y does not imply that %y is zero.Nick Lewycky2007-09-201-1/+1
| | | | llvm-svn: 42157
* Oops, remove assert that wasn't meant to be committed.Nick Lewycky2007-08-181-2/+0
| | | | llvm-svn: 41170
* Never insert duplicate edges.Nick Lewycky2007-08-181-13/+17
| | | | llvm-svn: 41169
* Clean up comments, fix up some confusing code logic.Nick Lewycky2007-08-041-30/+47
| | | | | | Predsimplify fails llvm-gcc bootstrap. llvm-svn: 40815
* Start adding and cleaning up comments.Nick Lewycky2007-07-161-4/+12
| | | | llvm-svn: 39894
* Use maximal intersection algorithm exclusively. Fixes miscompile bug.Nick Lewycky2007-07-141-11/+11
| | | | llvm-svn: 39852
* Update the ValueRanges interface to use value numbers instead of Value*s.Nick Lewycky2007-07-101-255/+297
| | | | llvm-svn: 38483
* Break "variable canonicalization" out of InequalityGraph and into its own classNick Lewycky2007-07-051-269/+287
| | | | | | "ValueNumbering". llvm-svn: 37881
* Fix value ranges.Nick Lewycky2007-06-241-1/+1
| | | | llvm-svn: 37713
* Remove tabs.Nick Lewycky2007-06-241-2/+2
| | | | llvm-svn: 37710
* Remove use of ETForest. Also cleaned up issues around unreachable basicNick Lewycky2007-06-241-156/+326
| | | | | | blocks, and optimizing within one basic block. llvm-svn: 37709
* Patches by Chuck Rose to unbreak V Studio builds.Bill Wendling2007-06-041-0/+15
| | | | | | Thanks Chuck! llvm-svn: 37428
* s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/gDevang Patel2007-06-041-11/+11
| | | | llvm-svn: 37407
* s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/gDevang Patel2007-06-031-11/+11
| | | | llvm-svn: 37403
* 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
* Using APInt more efficiently.Zhou Sheng2007-04-261-5/+4
| | | | llvm-svn: 36475
* Undo my previous changes. Since my approach to this problem is being revised,Owen Anderson2007-04-251-32/+31
| | | | | | this approach is no longer appropriate. llvm-svn: 36421
* Make PredicateSimplifier not use DominatorTree.Owen Anderson2007-04-211-31/+32
| | | | llvm-svn: 36300
* Make the operations of APInt variables more efficient.Zhou Sheng2007-04-191-27/+21
| | | | llvm-svn: 36260
OpenPOWER on IntegriCloud