Home | History | Annotate | Download | only in Utils

Lines Matching refs:Instruction

17 #include "llvm/Instruction.h"
101 if (isa<Instruction>(ScaleReg) && // not a constant expr.
107 // this instruction.
109 AddrModeInsts.push_back(cast<Instruction>(ScaleReg));
123 static bool MightBeFoldableInst(Instruction *I) {
125 case Instruction::BitCast:
130 case Instruction::PtrToInt:
133 case Instruction::IntToPtr:
136 case Instruction::Add:
138 case Instruction::Mul:
139 case Instruction::Shl:
142 case Instruction::GetElementPtr:
150 /// MatchOperationAddr - Given an instruction or constant expr, see if we can
159 case Instruction::PtrToInt:
162 case Instruction::IntToPtr:
168 case Instruction::BitCast:
179 case Instruction::Add: {
201 //case Instruction::Or:
204 case Instruction::Mul:
205 case Instruction::Shl: {
210 if (Opcode == Instruction::Shl)
215 case Instruction::GetElementPtr: {
325 } else if (Instruction *I = dyn_cast<Instruction>(Addr)) {
403 /// memory use. If we find an obviously non-foldable instruction, return true.
405 static bool FindAllMemoryUses(Instruction *I,
406 SmallVectorImpl<std::pair<Instruction*,unsigned> > &MemoryUses,
407 SmallPtrSet<Instruction*, 16> &ConsideredInsts,
409 // If we already considered this instruction, we're done.
413 // If this is an obviously unfoldable instruction, bail out.
444 if (FindAllMemoryUses(cast<Instruction>(U), MemoryUses, ConsideredInsts,
456 /// that we know are live at the instruction already.
464 if (!isa<Instruction>(Val) && !isa<Argument>(Val)) return true;
473 // Check to see if this value is already used in the memory instruction's
480 if (cast<Instruction>(*UI)->getParent() == MemBB)
489 /// mode of the machine to fold the specified instruction into a load or store
490 /// that ultimately uses it. However, the specified instruction has multiple
510 IsProfitableToFoldIntoAddressingMode(Instruction *I, ExtAddrMode &AMBefore,
514 // AMBefore is the addressing mode before this instruction was folded into it,
515 // and AMAfter is the addressing mode after the instruction was folded. Get
526 // lifetime wasn't extended by adding this instruction.
532 // If folding this instruction (and it's subexprs) didn't extend any live
537 // If all uses of this instruction are ultimately load/store/inlineasm's,
538 // check to see if their addressing modes will include this instruction. If
541 SmallVector<std::pair<Instruction*,unsigned>, 16> MemoryUses;
542 SmallPtrSet<Instruction*, 16> ConsideredInsts;
546 // Now that we know that all uses of this instruction are part of a chain of
549 // *actually* fold the instruction.
550 SmallVector<Instruction*, 32> MatchedAddrModeInsts;
552 Instruction *User = MemoryUses[i].first;
565 // *actually* cover the shared instruction.