Lines Matching full:instruction
20 // we can hoist it or sink it like any other instruction.
21 // 2. Scalar Promotion of Memory - If there is a store instruction inside of
114 bool MayThrow; // The current loop contains an instruction which
150 /// sink - When an instruction is found to only be used outside of the loop,
154 void sink(Instruction &I);
156 /// hoist - When an instruction is found to only use loop invariant operands
157 /// that is safe to hoist, this instruction is called to do the dirty work.
159 void hoist(Instruction &I);
161 /// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it
162 /// is not a trapping instruction or if it is a trapping instruction and is
165 bool isSafeToExecuteUnconditionally(Instruction &I);
167 /// isGuaranteedToExecute - Check that the instruction is guaranteed to
170 bool isGuaranteedToExecute(Instruction &I);
181 bool canSinkOrHoistInst(Instruction &I);
182 bool isNotUsedInLoop(Instruction &I);
186 SmallVectorImpl<Instruction*> &InsertPts);
277 SmallVector<Instruction *, 8> InsertPts;
321 Instruction &I = *--II;
323 // If the instruction is dead, we would try to sink it because it isn't used
334 // Check to see if we can sink this instruction to the exit blocks
335 // of the loop. We can do this if the all users of the instruction are
337 // operands of the instruction are loop invariant.
362 Instruction &I = *II++;
364 // Try constant folding this instruction. If all the operands are
376 // Try hoisting the instruction out to the preheader. We can only do this
377 // if all of the operands of the instruction are loop invariant and if it
378 // is safe to hoist the instruction.
391 /// instruction.
393 bool LICM::canSinkOrHoistInst(Instruction &I) {
453 /// isNotUsedInLoop - Return true if the only users of this instruction are
454 /// outside of the loop. If this is true, we can sink the instruction to the
457 bool LICM::isNotUsedInLoop(Instruction &I) {
459 Instruction *User = cast<Instruction>(*UI);
474 /// sink - When an instruction is found to only be used outside of the loop,
476 /// This method is guaranteed to remove the original instruction from its
479 void LICM::sink(Instruction &I) {
480 DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n");
495 // Instruction is not used, just delete it.
504 // Move the instruction to the start of the exit block, after any PHI
508 // This instruction is no longer in the AST for the current loop, because
517 // The instruction is actually dead if there ARE NO exit blocks.
536 // Insert a copy of the instruction in each exit block of the loop that is
537 // dominated by the instruction. Each exit block is known to only be in the
552 // instruction, otherwise clone the original instruction and insert
554 Instruction *New;
565 // Now that we have inserted the instruction, inform SSAUpdater.
570 // If the instruction doesn't dominate any exit blocks, it must be dead.
579 // Next, rewrite uses of the instruction, inserting PHI nodes as needed.
593 // Finally, remove the instruction from CurAST. It is no longer in the loop.
597 /// hoist - When an instruction is found to only use loop invariant operands
598 /// that is safe to hoist, this instruction is called to do the dirty work.
600 void LICM::hoist(Instruction &I) {
613 /// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it is
614 /// not a trapping instruction or if it is a trapping instruction and is
617 bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
618 // If it is not a trapping instruction, it is always safe to hoist.
625 bool LICM::isGuaranteedToExecute(Instruction &Inst) {
627 // Somewhere in this loop there is an instruction which may throw and make us
632 // Otherwise we have to check to make sure that the instruction dominates all
634 // which does not execute this instruction, so we can't hoist it.
636 // If the instruction is in the header block for the loop (which is very
664 SmallVectorImpl<Instruction*> &LoopInsertPts;
671 const SmallVectorImpl<Instruction*> &Insts, SSAUpdater &S,
674 SmallVectorImpl<Instruction*> &LIP,
681 virtual bool isInstInList(Instruction *I,
682 const SmallVectorImpl<Instruction*> &) const {
699 Instruction *InsertPos = LoopInsertPts[i];
711 virtual void instructionDeleted(Instruction *I) const {
724 SmallVectorImpl<Instruction*> &InsertPts) {
751 SmallVector<Instruction*, 64> LoopUses;
775 Instruction *Use = dyn_cast<Instruction>(*UI);
779 // If there is an non-load/store instruction in the loop, we can't promote
798 // If the alignment of this instruction allows us to specify a more
800 // instruction will be executed, update the alignment.
828 // If there isn't a guaranteed-to-execute instruction, we can't promote.