summaryrefslogtreecommitdiff
path: root/include/llvm/Instruction.h
Commit message (Collapse)AuthorAge
* Remove trailing whitespaceMichael Ilseman2012-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168103 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary classof()'sSean Silva2012-10-11
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
* Use LLVM_DELETED_FUNCTION for copy constructors and copy assignment ↵Craig Topper2012-09-16
| | | | | | operators that aren't implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164006 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor operation equivalence checking in BBVectorize by extending ↵Hal Finkel2012-06-28
| | | | | | | | | | | Instruction::isSameOperationAs. Maintaining this kind of checking in different places is dangerous, extending Instruction::isSameOperationAs consolidates this logic into one place. Here I've added an optional flags parameter and two flags that are important for vectorization: CompareIgnoringAlignment and CompareUsingScalarTypes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159329 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that Reassociate's LinearizeExprTree can look through arbitrary expressionDuncan Sands2012-06-12
| | | | | | | | | | | | | | | | | | topologies, it is quite possible for a leaf node to have huge multiplicity, for example: x0 = x*x, x1 = x0*x0, x2 = x1*x1, ... rapidly gives a value which is x raised to a vast power (the multiplicity, or weight, of x). This patch fixes the computation of weights by correctly computing them no matter how big they are, rather than just overflowing and getting a wrong value. It turns out that the weight for a value never needs more bits to represent than the value itself, so it is enough to represent weights as APInts of the same bitwidth and do the right overflow-avoiding dance steps when computing weights. As a side-effect it reduces the number of multiplies needed in some cases of large powers. While there, in view of external uses (eg by the vectorizer) I made LinearizeExprTree static, pushing the rank computation out into users. This is progress towards fixing PR13021. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158358 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Instruction::isSafeToSpeculativelyExecute out of VMCore andDan Gohman2011-12-14
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146610 91177308-0d34-0410-b5e6-96231b3b80d8
* Push StringRefs through the metadata interface.Benjamin Kramer2011-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145934 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix AliasSetTracker so that it doesn't make any assumptions about ↵Eli Friedman2011-07-27
| | | | | | instructions it doesn't know about (like the atomic instructions I'm adding). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136198 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* There is no need for isAssociative to take the type as an argument anymore.Duncan Sands2010-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122242 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename removeAllMetadata to clearMetadataHashEntries and simplifyDan Gohman2010-07-20
| | | | | | | | it to just do the things that need to be done when an instruction is deleted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108948 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove setDbgMetadata and getDbgMetadata; their users have beenDan Gohman2010-07-20
| | | | | | | replaced with setDebugLoc and getDebugLoc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108914 91177308-0d34-0410-b5e6-96231b3b80d8
* rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.Chris Lattner2010-04-02
| | | | | | | | | This keeps around temporary typedef for clang/llvm-gcc so the build won't break when I commit this :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100218 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the representation of the location in instruction fromChris Lattner2010-04-01
| | | | | | | | | | | | | | | being a TrackingVH<MDNode> to a NewDebugLoc, shrinking sizeof(Instruction) a lot, and providing clients the ability to deal with locations in terms of NewDebugLoc instead of having to deal with Metadata. This is still fully compatible with all clients that *do* use MDNodes for everything of course. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100088 91177308-0d34-0410-b5e6-96231b3b80d8
* add new apis for getting/setting !dbg metadata on Chris Lattner2010-03-31
| | | | | | | | | | instructions. In addition to being a convenience, they are faster than the old apis, particularly when not going from an MDKindID like people should be doing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a major source of compile-time slowness at -O0 -g by optimizingChris Lattner2010-03-30
| | | | | | | | | | | | | | | the storage of !dbg metadata kinds in the instruction themselves. The on-the-side hash table works great for metadata that not-all instructions get, or for metadata that only exists when optimizing. But when compile-time is everything, it isn't great. I'm not super thrilled with the fact that this plops a TrackingVH in Instruction, because it grows it by 3 words. I'm investigating alternatives, but this should be a step in the right direction in any case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99957 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "the the" and similar typos.Dan Gohman2010-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-29
| | | | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded Metadata interfaces.Chris Lattner2009-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92252 91177308-0d34-0410-b5e6-96231b3b80d8
* sink the Instruction::HasMetadata bit into SubclassData.Chris Lattner2009-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a major cleanup of the instruction metadata interfaces thatChris Lattner2009-12-28
| | | | | | | | | | | | | | | | | | | | | | | I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
* rearrange some code.Chris Lattner2009-12-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92234 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out redundancy from clone() implementations.Devang Patel2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85327 91177308-0d34-0410-b5e6-96231b3b80d8
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-27
| | | | | | | update all the callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some of the constants+context related code out into a separate ↵Owen Anderson2009-08-04
| | | | | | | | | header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
* Documentation clarifications for isSafeToSpeculativelyExecute.Eli Friedman2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76168 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace isTrapping with a new, similar method called Eli Friedman2009-07-17
| | | | | | | | | | | | isSafeToSpeculativelyExecute. The new method is a bit closer to what the callers actually care about in that it rejects more things callers don't want. It also adds more precise handling for integer division, and unifies code for analyzing the legality of a speculative load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76150 91177308-0d34-0410-b5e6-96231b3b80d8
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-09
| | | | | | the [I|F]CmpInst constructors. Who knew!? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-06
| | | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated the comment for isArithmeticShift() to match reality.Misha Brukman2009-03-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68016 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the PointerLikeTypeTraits::getNumLowBitsAvailableChris Lattner2009-03-29
| | | | | | | | | | | | | | | | | function with a new NumLowBitsAvailable enum, which makes the value available as an integer constant expression. Add PointerLikeTypeTraits specializations for Instruction* and Use** since they are only guaranteed 4-byte aligned. Enhance PointerIntPair to know about (and enforce) the alignment specified by PointerLikeTypeTraits. This should allow things like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> because the inner one knows that 2 low bits are free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67979 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new insertAfter method, patch by Tom Jablin!Chris Lattner2009-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62158 91177308-0d34-0410-b5e6-96231b3b80d8
* improve const correctness.Chris Lattner2008-11-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60168 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the name of isTrapping in comments.Dan Gohman2008-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57606 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold the useful features of alist and alist_node into ilist, andDan Gohman2008-07-28
| | | | | | | | | | | | | | | | | a new ilist_node class, and remove them. Unlike alist_node, ilist_node doesn't attempt to manage storage itself, so it avoids the associated problems, including being opaque in gdb. Adjust the Recycler class so that it doesn't depend on alist_node. Also, change it to use explicit Size and Align parameters, allowing it to work when the largest-sized node doesn't have the greatest alignment requirement. Change MachineInstr's MachineMemOperand list from a pool-backed alist to a std::list for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an insertBefore method for attaching previously unattached instructions,Owen Anderson2008-06-17
| | | | | | | such as those created by clone(), to a basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52424 91177308-0d34-0410-b5e6-96231b3b80d8
* merge of use-diet branch to trunkGabor Greif2008-05-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new Instruction::mayReadFromMemory predicate, makeChris Lattner2008-05-08
| | | | | | | Instruction::mayWriteToMemory stronger for invokes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50858 91177308-0d34-0410-b5e6-96231b3b80d8
* add a handy helper method to instruction, useful for determiningChris Lattner2008-04-20
| | | | | | | | whether it is used outside of some block. This can be used to see if there are any non-local references, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50004 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers.Dan Gohman2008-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49443 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-29
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* split isBinaryOp into a static and member version.Chris Lattner2007-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44814 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-10
| | | | | | | _sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
* Instruction:: Next/Prev accessors are now privateChris Lattner2007-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36204 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor SymbolTableListTraits to only have a single pointer in it, insteadChris Lattner2007-04-17
| | | | | | | | | of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8 bytes (68->60). On a testcase of mine, this reduces the memory used to read a module header from 565680b to 561024, a little over 4K. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36188 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Value::getValueType to getValueID, to avoid confusion withDan Gohman2007-04-13
| | | | | | | other things named getValueType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35964 91177308-0d34-0410-b5e6-96231b3b80d8