Lines Matching defs:IntToPtr
86 // replace PN and the IntToPtr operation with it. Otherwise, synthesize a new
96 // ptr_val2 = IntToPtr(int_val)
118 // ptr_val2 = IntToPtr(int_val)
140 auto *IntToPtr = dyn_cast<IntToPtrInst>(PN.user_back());
141 if (!IntToPtr)
162 if (!HasPointerUse(IntToPtr))
165 if (DL.getPointerSizeInBits(IntToPtr->getAddressSpace()) !=
166 DL.getTypeSizeInBits(IntToPtr->getOperand(0)->getType()))
187 if (isa<IntToPtrInst>(U) && U->getType() == IntToPtr->getType() &&
231 if (&PtrPHI == &PN || PtrPHI.getType() != IntToPtr->getType())
245 assert(MatchingPtrPHI->getType() == IntToPtr->getType() &&
246 "Phi's Type does not match with IntToPtr");
249 replaceInstUsesWith(*IntToPtr, MatchingPtrPHI);
250 eraseInstFromFunction(*IntToPtr);
257 return (V->getType() != IntToPtr->getType()) || isa<IntToPtrInst>(V);
266 if (V->getType() == IntToPtr->getType())
281 IntToPtr->getType(), PN.getNumIncomingValues(), PN.getName() + ".ptr");
289 if (IncomingVal->getType() == IntToPtr->getType()) {
302 // For an integer Load instruction with a single use, the load + IntToPtr
311 CI = CastInst::CreateBitOrPointerCast(IncomingVal, IntToPtr->getType(),
331 replaceInstUsesWith(*IntToPtr, NewPtrPHI);
332 eraseInstFromFunction(*IntToPtr);
337 // Remove RoundTrip IntToPtr/PtrToInt Cast on PHI-Operand and