Lines Matching defs:IntToPtr
58 // replace PN and the IntToPtr operation with it. Otherwise, synthesize a new
68 // ptr_val2 = IntToPtr(int_val)
90 // ptr_val2 = IntToPtr(int_val)
112 auto *IntToPtr = dyn_cast<IntToPtrInst>(PN.user_back());
113 if (!IntToPtr)
134 if (!HasPointerUse(IntToPtr))
137 if (DL.getPointerSizeInBits(IntToPtr->getAddressSpace()) !=
138 DL.getTypeSizeInBits(IntToPtr->getOperand(0)->getType()))
155 if (isa<IntToPtrInst>(U) && U->getType() == IntToPtr->getType() &&
199 if (&PtrPHI == &PN || PtrPHI.getType() != IntToPtr->getType())
213 assert(MatchingPtrPHI->getType() == IntToPtr->getType() &&
214 "Phi's Type does not match with IntToPtr");
217 replaceInstUsesWith(*IntToPtr, MatchingPtrPHI);
218 eraseInstFromFunction(*IntToPtr);
225 return (V->getType() != IntToPtr->getType()) || isa<IntToPtrInst>(V);
234 if (V->getType() == IntToPtr->getType())
249 IntToPtr->getType(), PN.getNumIncomingValues(), PN.getName() + ".ptr");
257 if (IncomingVal->getType() == IntToPtr->getType()) {
270 // For an integer Load instruction with a single use, the load + IntToPtr
279 CI = CastInst::CreateBitOrPointerCast(IncomingVal, IntToPtr->getType(),
299 replaceInstUsesWith(*IntToPtr, NewPtrPHI);
300 eraseInstFromFunction(*IntToPtr);
305 // Remove RoundTrip IntToPtr/PtrToInt Cast on PHI-Operand and