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
137 /// sink - When an instruction is found to only be used outside of the loop,
141 void sink(Instruction &I);
143 /// hoist - When an instruction is found to only use loop invariant operands
144 /// that is safe to hoist, this instruction is called to do the dirty work.
146 void hoist(Instruction &I);
148 /// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it
149 /// is not a trapping instruction or if it is a trapping instruction and is
152 bool isSafeToExecuteUnconditionally(Instruction &I);
163 bool canSinkOrHoistInst(Instruction &I);
164 bool isNotUsedInLoop(Instruction &I);
285 Instruction &I = *--II;
287 // If the instruction is dead, we would try to sink it because it isn't used
298 // Check to see if we can sink this instruction to the exit blocks
299 // of the loop. We can do this if the all users of the instruction are
301 // operands of the instruction are loop invariant.
326 Instruction &I = *II++;
328 // Try constant folding this instruction. If all the operands are
340 // Try hoisting the instruction out to the preheader. We can only do this
341 // if all of the operands of the instruction are loop invariant and if it
342 // is safe to hoist the instruction.
355 /// instruction.
357 bool LICM::canSinkOrHoistInst(Instruction &I) {
411 /// isNotUsedInLoop - Return true if the only users of this instruction are
412 instruction to the
415 bool LICM::isNotUsedInLoop(Instruction &I) {
417 Instruction *User = cast<Instruction>(*UI);
432 /// sink - When an instruction is found to only be used outside of the loop,
434 /// This method is guaranteed to remove the original instruction from its
437 void LICM::sink(Instruction &I) {
438 DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n");
453 // Instruction is not used, just delete it.
462 // Move the instruction to the start of the exit block, after any PHI
466 // This instruction is no longer in the AST for the current loop, because
475 // The instruction is actually dead if there ARE NO exit blocks.
494 // Insert a copy of the instruction in each exit block of the loop that is
495 // dominated by the instruction. Each exit block is known to only be in the
510 // instruction, otherwise clone the original instruction and insert
512 Instruction *New;
523 // Now that we have inserted the instruction, inform SSAUpdater.
528 // If the instruction doesn't dominate any exit blocks, it must be dead.
537 // Next, rewrite uses of the instruction, inserting PHI nodes as needed.
551 // Finally, remove the instruction from CurAST. It is no longer in the loop.
555 /// hoist - When an instruction is found to only use loop invariant operands
556 /// that is safe to hoist, this instruction is called to do the dirty work.
558 void LICM::hoist(Instruction &I) {
571 /// isSafeToExecuteUnconditionally - Only sink or hoist an instruction if it is
572 /// not a trapping instruction or if it is a trapping instruction and is
575 bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
576 // If it is not a trapping instruction, it is always safe to hoist.
580 // Otherwise we have to check to make sure that the instruction dominates all
582 // which does not execute this instruction, so we can't hoist it.
584 // If the instruction is in the header block for the loop (which is very
612 const SmallVectorImpl<Instruction*> &Insts, SSAUpdater &S,
620 virtual bool isInstInList(Instruction *I,
621 const SmallVectorImpl<Instruction*> &) const {
638 Instruction *InsertPos = ExitBlock->getFirstNonPHI();
649 virtual void instructionDeleted(Instruction *I) const {
687 SmallVector<Instruction*, 64> LoopUses;
710 Instruction *Use = dyn_cast<Instruction>(*UI);
714 // If there is an non-load/store instruction in the loop, we can't promote
730 // If the alignment of this instruction allows us to specify a more
732 // instruction will be executed, update the alignment.
748 // If there isn't a guaranteed-to-execute instruction, we can't promote.