Lines Matching refs:DeadI
239 const Instruction *DeadI, in isMaskedStoreOverwrite() argument
242 const auto *DeadII = dyn_cast<IntrinsicInst>(DeadI); in isMaskedStoreOverwrite()
273 Instruction *DeadI, in isPartialOverwrite() argument
287 auto &IM = IOL[DeadI]; in isPartialOverwrite()
475 static bool tryToShorten(Instruction *DeadI, int64_t &DeadStart, in tryToShorten() argument
478 auto *DeadIntrinsic = cast<AnyMemIntrinsic>(DeadI); in tryToShorten()
529 if (auto *AMI = dyn_cast<AtomicMemIntrinsic>(DeadI)) { in tryToShorten()
538 << (IsOverwriteEnd ? "END" : "BEGIN") << ": " << *DeadI in tryToShorten()
554 Dest = CastInst::CreatePointerCast(OrigDest, Int8PtrTy, "", DeadI); in tryToShorten()
558 Type::getInt8Ty(DeadIntrinsic->getContext()), Dest, Indices, "", DeadI); in tryToShorten()
562 "", DeadI); in tryToShorten()
574 static bool tryToShortenEnd(Instruction *DeadI, OverlapIntervalsTy &IntervalMap, in tryToShortenEnd() argument
576 if (IntervalMap.empty() || !isShortenableAtTheEnd(DeadI)) in tryToShortenEnd()
592 if (tryToShorten(DeadI, DeadStart, DeadSize, KillingStart, KillingSize, in tryToShortenEnd()
601 static bool tryToShortenBegin(Instruction *DeadI, in tryToShortenBegin() argument
604 if (IntervalMap.empty() || !isShortenableAtTheBeginning(DeadI)) in tryToShortenBegin()
621 if (tryToShorten(DeadI, DeadStart, DeadSize, KillingStart, KillingSize, in tryToShortenBegin()
631 tryToMergePartialOverlappingStores(StoreInst *KillingI, StoreInst *DeadI, in tryToMergePartialOverlappingStores() argument
636 if (DeadI && isa<ConstantInt>(DeadI->getValueOperand()) && in tryToMergePartialOverlappingStores()
637 DL.typeSizeEqualsStoreSize(DeadI->getValueOperand()->getType()) && in tryToMergePartialOverlappingStores()
640 memoryIsNotModifiedBetween(DeadI, KillingI, AA, DL, DT)) { in tryToMergePartialOverlappingStores()
651 APInt DeadValue = cast<ConstantInt>(DeadI->getValueOperand())->getValue(); in tryToMergePartialOverlappingStores()
668 LLVM_DEBUG(dbgs() << "DSE: Merge Stores:\n Dead: " << *DeadI in tryToMergePartialOverlappingStores()
671 return ConstantInt::get(DeadI->getValueOperand()->getType(), Merged); in tryToMergePartialOverlappingStores()
835 const Instruction *DeadI, in isOverwrite()
842 if (!isGuaranteedLoopIndependent(DeadI, KillingI, DeadLoc)) in isOverwrite()
865 const auto *DeadMemI = dyn_cast<MemIntrinsic>(DeadI); in isOverwrite()
875 return isMaskedStoreOverwrite(KillingI, DeadI, BatchAA); in isOverwrite()
1638 bool mayThrowBetween(Instruction *KillingI, Instruction *DeadI, in mayThrowBetween()
1646 if (KillingI->getParent() == DeadI->getParent()) in mayThrowBetween()
1656 bool isDSEBarrier(const Value *KillingUndObj, Instruction *DeadI) { in isDSEBarrier()
1659 if (DeadI->mayThrow() && !isInvisibleToCallerOnUnwind(KillingUndObj)) in isDSEBarrier()
1664 if (DeadI->isAtomic()) { in isDSEBarrier()
1665 if (auto *LI = dyn_cast<LoadInst>(DeadI)) in isDSEBarrier()
1667 if (auto *SI = dyn_cast<StoreInst>(DeadI)) in isDSEBarrier()
1669 if (auto *ARMW = dyn_cast<AtomicRMWInst>(DeadI)) in isDSEBarrier()
1671 if (auto *CmpXchg = dyn_cast<AtomicCmpXchgInst>(DeadI)) in isDSEBarrier()
1877 Instruction *DeadI = OI.first; in removePartiallyOverlappedStores() local
1878 MemoryLocation Loc = *getLocForWrite(DeadI); in removePartiallyOverlappedStores()
1879 assert(isRemovable(DeadI) && "Expect only removable instruction"); in removePartiallyOverlappedStores()
1886 Changed |= tryToShortenEnd(DeadI, IntervalMap, DeadStart, DeadSize); in removePartiallyOverlappedStores()
1889 Changed |= tryToShortenBegin(DeadI, IntervalMap, DeadStart, DeadSize); in removePartiallyOverlappedStores()
2029 Instruction *DeadI = DeadDefAccess->getMemoryInst(); in eliminateDeadStores() local
2030 LLVM_DEBUG(dbgs() << " (" << *DeadI << ")\n"); in eliminateDeadStores()
2037 MemoryLocation DeadLoc = *State.getLocForWrite(DeadI); in eliminateDeadStores()
2043 LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI in eliminateDeadStores()
2045 State.deleteDeadInstruction(DeadI); in eliminateDeadStores()
2053 KillingI, DeadI, KillingLoc, DeadLoc, KillingOffset, DeadOffset); in eliminateDeadStores()
2057 DeadI->getParent(), InstOverlapIntervalsTy())); in eliminateDeadStores()
2060 DeadOffset, DeadI, IOL); in eliminateDeadStores()
2064 auto *DeadSI = dyn_cast<StoreInst>(DeadI); in eliminateDeadStores()
2092 LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI in eliminateDeadStores()
2094 State.deleteDeadInstruction(DeadI); in eliminateDeadStores()