Lines Matching defs:Repl

476   void makeGepsAvailable(Instruction *Repl, BasicBlock *HoistPt,
480 void updateAlignment(Instruction *I, Instruction *Repl);
483 // Repl. Returns the number of instructions removed.
484 unsigned rauw(const SmallVecInsn &Candidates, Instruction *Repl,
490 // Remove all other instructions and replace them with Repl.
491 unsigned removeAndReplace(const SmallVecInsn &Candidates, Instruction *Repl,
494 // In the case Repl is a load or a store, we make all their GEPs
497 bool makeGepOperandsAvailable(Instruction *Repl, BasicBlock *HoistPt,
907 void GVNHoist::makeGepsAvailable(Instruction *Repl, BasicBlock *HoistPt,
925 // Copy Gep and replace its uses in Repl with ClonedGep.
952 // Replace uses of Gep with ClonedGep in Repl.
953 Repl->replaceUsesOfWith(Gep, ClonedGep);
956 void GVNHoist::updateAlignment(Instruction *I, Instruction *Repl) {
957 if (auto *ReplacementLoad = dyn_cast<LoadInst>(Repl)) {
961 } else if (auto *ReplacementStore = dyn_cast<StoreInst>(Repl)) {
965 } else if (auto *ReplacementAlloca = dyn_cast<AllocaInst>(Repl)) {
968 } else if (isa<CallInst>(Repl)) {
973 unsigned GVNHoist::rauw(const SmallVecInsn &Candidates, Instruction *Repl,
977 if (I != Repl) {
979 updateAlignment(I, Repl);
987 combineMetadataForCSE(Repl, I, true);
988 Repl->andIRFlags(I);
989 I->replaceAllUsesWith(Repl);
1014 Instruction *Repl, BasicBlock *DestBB,
1016 MemoryUseOrDef *NewMemAcc = MSSA->getMemoryAccess(Repl);
1023 // Replace all other instructions with Repl with memory access NewMemAcc.
1024 unsigned NR = rauw(Candidates, Repl, NewMemAcc);
1033 Instruction *Repl, BasicBlock *HoistPt,
1038 if (auto *Ld = dyn_cast<LoadInst>(Repl)) {
1040 } else if (auto *St = dyn_cast<StoreInst>(Repl)) {
1058 makeGepsAvailable(Repl, HoistPt, InstructionsToHoist, Gep);
1061 makeGepsAvailable(Repl, HoistPt, InstructionsToHoist, Val);
1073 Instruction *Repl = nullptr;
1077 // update Repl to be the first one, such that we can rename the uses
1079 if (!Repl || firstInBB(I, Repl))
1080 Repl = I;
1085 if (Repl) {
1086 // Repl is already in HoistPt: it remains in place.
1087 assert(allOperandsAvailable(Repl, DestBB) &&
1091 // When we do not find Repl in HoistPt, select the first in the list
1093 Repl = InstructionsToHoist.front();
1095 // We can move Repl in HoistPt only when all operands are available.
1098 if (!allOperandsAvailable(Repl, DestBB)) {
1105 if (!makeGepOperandsAvailable(Repl, DestBB, InstructionsToHoist))
1111 MD->removeInstruction(Repl);
1112 Repl->moveBefore(Last);
1114 DFSNumber[Repl] = DFSNumber[Last]++;
1118 Repl->dropLocation();
1119 NR += removeAndReplace(InstructionsToHoist, Repl, DestBB, MoveAccess);
1121 if (isa<LoadInst>(Repl))
1123 else if (isa<StoreInst>(Repl))
1125 else if (isa<CallInst>(Repl))