Home | History | Annotate | Download | only in VMCore

Lines Matching refs:Instruction

1 //===-- Instruction.cpp - Implement the Instruction class -----------------===//
10 // This file implements the Instruction class for the VMCore library.
14 #include "llvm/Instruction.h"
23 Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
24 Instruction *InsertBefore)
29 // If requested, insert this instruction into a basic block...
32 "Instruction to insert before is not in a basic block!");
37 Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
43 // append this instruction into the basic block
50 Instruction::~Instruction() {
51 assert(Parent == 0 && "Instruction still linked in the program!");
57 void Instruction::setParent(BasicBlock *P) {
67 void Instruction::removeFromParent() {
71 void Instruction::eraseFromParent() {
76 /// immediately before the specified instruction.
77 void Instruction::insertBefore(Instruction *InsertPos) {
82 /// immediately after the specified instruction.
83 void Instruction::insertAfter(Instruction *InsertPos) {
87 /// moveBefore - Unlink this instruction from its current basic block and
90 void Instruction::moveBefore(Instruction *MovePos) {
96 const char *Instruction::getOpcodeName(unsigned OpCode) {
173 /// isIdenticalTo - Return true if the specified instruction is exactly
176 bool Instruction::isIdenticalTo(const Instruction *I) const {
183 /// under which the instruction's result is undefined.
184 bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const {
239 bool Instruction::isSameOperationAs(const Instruction *I) const {
295 bool Instruction::isUsedOutsideOfBlock(const BasicBlock *BB) const {
302 if (cast<Instruction>(U)->getParent() != BB)
313 /// mayReadFromMemory - Return true if this instruction may read memory.
315 bool Instruction::mayReadFromMemory() const {
318 case Instruction::VAArg:
319 case Instruction::Load:
320 case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
321 case Instruction::AtomicCmpXchg:
322 case Instruction::AtomicRMW:
324 case Instruction::Call:
326 case Instruction::Invoke:
328 case Instruction::Store:
333 /// mayWriteToMemory - Return true if this instruction may modify memory.
335 bool Instruction::mayWriteToMemory() const {
338 case Instruction::Fence: // FIXME: refine definition of mayWriteToMemory
339 case Instruction::Store:
340 case Instruction::VAArg:
341 case Instruction::AtomicCmpXchg:
342 case Instruction::AtomicRMW:
344 case Instruction::Call:
346 case Instruction::Invoke:
348 case Instruction::Load:
353 /// mayThrow - Return true if this instruction may throw an exception.
355 bool Instruction::mayThrow() const {
361 /// isAssociative - Return true if the instruction is associative:
367 bool Instruction::isAssociative(unsigned Opcode) {
372 /// isCommutative - Return true if the instruction is commutative:
379 bool Instruction::isCommutative(unsigned op) {
394 bool Instruction::isSafeToSpeculativelyExecute() const {
447 Instruction *Instruction::clone() const {
448 Instruction *New = clone_impl();
453 // Otherwise, enumerate and copy over metadata from the old instruction to the