Home | History | Annotate | Download | only in Utils

Lines Matching full:instruction

150                                           Instruction *Cond,
199 /// given instruction, which is assumed to be safe to speculate. 1 means
203 "Instruction is not safe to speculatively execute!");
208 case Instruction::GetElementPtr:
213 case Instruction::Load:
214 case Instruction::Add:
215 case Instruction::Sub:
216 case Instruction::And:
217 case Instruction::Or:
218 case Instruction::Xor:
219 case Instruction::Shl:
220 case Instruction::LShr:
221 case Instruction::AShr:
222 case Instruction::ICmp:
223 case Instruction::Trunc:
224 case Instruction::ZExt:
225 case Instruction::SExt:
228 case Instruction::Call:
229 case Instruction::Select:
240 /// see if V (which must be an instruction) and its recursive operands
242 /// are non-trapping. If both are true, the instruction is inserted into the
252 SmallPtrSet<Instruction*, 4> *AggressiveInsts,
254 Instruction *I = dyn_cast<Instruction>(V);
269 // If this instruction is defined in a block that contains an unconditional
280 // If we have seen this instruction before, don't count it again.
283 // Okay, it looks like the instruction IS in the "condition". Check to
284 // see if it's a cheap instruction to unconditionally compute, and if it
301 // Okay, it's safe to do this! Remember this instruction.
324 if (CE->getOpcode() == Instruction::IntToPtr)
343 Instruction *I = dyn_cast<Instruction>(V);
402 if (I->getOpcode() != (isEQ ? Instruction::Or : Instruction::And))
447 Instruction *Cond = 0;
449 Cond = dyn_cast<Instruction>(SI->getCondition());
452 Cond = dyn_cast<Instruction>(BI->getCondition());
454 Cond = dyn_cast<Instruction>(IBI->getAddress());
484 /// GetValueEqualityComparisonCases - Given a value comparison instruction,
551 /// terminator instruction and its block is known to only have a single
595 Instruction *NI = Builder.CreateBr(ThisDef);
681 Instruction *NI = Builder.CreateBr(TheRealDest);
712 static inline bool HasBranchWeights(const Instruction* I) {
763 /// equality comparison instruction (either a switch or a branch on "X == c").
931 // Now that the successors are updated, create the new Switch instruction.
978 Instruction *I1, Instruction *I2) {
1008 Instruction *I1 = BB1_Itr++, *I2 = BB2_Itr++;
1026 // If we are hoisting the terminator instruction, don't move one (making a
1031 // For a normal instruction, we just move one to right before the branch,
1033 // the now redundant second instruction.
1078 Instruction *NT = I1->clone();
1090 // nodes, so we insert select instruction to compute the final result.
1100 // These values do not agree. Insert a select instruction before NT
1148 Instruction *FirstNonPhiInBBEnd = 0;
1191 Instruction *I1 = &*RI1, *I2 = &*RI2;
1268 // instruction in the basic block down.
1270 // Sink the instruction.
1292 /// \brief Determine if we can hoist sink a sole store instruction out of a
1318 static Value *isSafeToSpeculateStore(Instruction *I, BasicBlock *BrBB,
1334 Instruction *CurI = &*RI;
1336 // Could be calling an instruction that effects memory like free().
1358 /// this is speculating a single, reasonably cheap instruction.
1390 // Be conservative for now. FP select instruction can often be expensive.
1412 SmallDenseMap<Instruction *, unsigned, 4> SinkCandidateUseCounts;
1420 Instruction *I = BBI;
1425 // Only speculatively execution a single instruction (not counting the
1431 // Don't hoist the instruction if it's unsafe or expensive.
1445 // Do not hoist the instruction if any of its operands are defined but not
1450 Instruction *OpI = dyn_cast<Instruction>(*i);
1462 for (SmallDenseMap<Instruction *, unsigned, 4>::iterator I =
1511 // If we get here, we can hoist the instruction and if-convert.
1575 Instruction *U = cast<Instruction>(*UI);
1643 // Clone the instruction.
1644 Instruction *N = BBI->clone();
1658 delete N; // Instruction folded away, don't need actual inst
1660 // Insert the new instruction into its new home.
1713 SmallPtrSet<Instruction*, 4> AggressiveInsts;
1758 // This is not an aggressive instruction that we can promote.
1771 // This is not an aggressive instruction that we can promote.
1783 Instruction *InsertPt = DomBlock->getTerminator();
1798 // Change the PHI node into a select instruction.
1851 // so we can insert a new select instruction.
1925 /// checkCSEInPredecessor - Return true if the given instruction is available
1926 /// in its predecessor block. If yes, the instruction will be removed.
1928 static bool checkCSEInPredecessor(Instruction *Inst, BasicBlock *PB) {
1932 Instruction *PBI = &*I;
1949 Instruction *Cond = 0;
1951 Cond = dyn_cast<Instruction>(BI->getCondition());
1964 Instruction *Curr = I++;
1969 // Quit if we can't remove this instruction.
1983 // Only allow this if the condition is a simple instruction that can be
1991 // Allow a single instruction to be hoisted in addition to the compare
1995 Instruction *BonusInst = 0;
2010 // Make sure the instruction after the condition is the cond branch.
2050 Instruction::BinaryOps Opc = Instruction::BinaryOpsEnd;
2055 Opc = Instruction::Or;
2057 Opc = Instruction::And;
2059 Opc = Instruction::And, InvertPredCond = true;
2061 Opc = Instruction::Or, InvertPredCond = true;
2069 // Ensure that any values used in the bonus instruction are also used
2076 for (Instruction::op_iterator OI = BonusInst->op_begin(),
2097 if (Instruction *I = dyn_cast<Instruction>(Pair.first)) {
2098 for (Instruction::op_iterator OI = I->op_begin(), OE = I->op_end();
2127 Instruction *NewBonus = 0;
2137 Instruction *New = Cond->clone();
2144 Instruction *NewCond =
2145 cast<Instruction>(Builder.CreateBinOp(Opc, PBI->getCondition(),
2202 Instruction *MergedCond = 0;
2207 Instruction *NotCond =
2208 cast<Instruction>(Builder.CreateNot(PBI->getCondition(),
2211 cast<Instruction>(Builder.CreateBinOp(Instruction::And,
2216 cast<Instruction>(Builder.CreateBinOp(Instruction::Or,
2224 cast<Instruction>(Builder.CreateBinOp(Instruction::And,
2228 Instruction *NotCond =
2229 cast<Instruction>(Builder.CreateNot(PBI->getCondition(),
2232 cast<Instruction>(Builder.CreateBinOp(Instruction::Or,
2268 // If this block ends with a branch instruction, and if there is a
2584 /// instruction (a seteq/setne with a constant) as the only instruction in a
2623 // V in this block. Substitute it and constant fold the icmp instruction
2706 /// fold it into a switch instruction if so.
2709 Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
2713 // Change br (X == 0 | X == 1), T, F into a switch instruction.
2722 if (Cond->getOpcode() == Instruction::Or) {
2725 } else if (Cond->getOpcode() == Instruction::And) {
2739 // instruction can't handle, remove them now.
2794 // Create the new switch instruction now.
2797 // Add all of the 'cases' to the switch instruction.
2812 // Erase the old branch instruction.
2842 // Don't remove an `invoke' instruction if the ABI requires an entry into
2850 // Insert a call instruction before the invoke.
2857 // Anything that used the value produced by the invoke instruction now uses
2858 // the value produced by the call instruction. Note that we do this even
2867 // Finally, delete the invoke instruction!
2915 // instruction. If any of them just select between returns, change the
2967 // Delete this instruction (any uses are guaranteed to be dead)
2974 // If the unreachable instruction is the first in the block, take a gander
2975 // at all of the predecessors of this instruction, and simplify them.
3059 // Convert the invoke to a call instruction. This would be a good
3244 /// instruction to a phi node dominated by the switch, if that would mean that
3302 /// ConstantFold - Try to fold instruction I into a constant. This works for
3306 static Constant *ConstantFold(Instruction *I,
3352 /// case), of a switch instruction SI.
3378 // Instruction is side-effect free and constant.
3869 // If the Terminator is the only non-phi instruction, simplify the block.
3875 // If the only instruction in the block is a seteq/setne comparison
3917 } else if (&*I == cast<Instruction>(BI->getCondition())){
3927 // Try to turn "br (X == 0 | X == 1), T, F" into a switch instruction.
3981 /// Check if passing a value to an instruction will cause undefined behavior.
3982 static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I) {
4065 // Check to see if we can constant propagate this terminator instruction