Lines Matching refs:V

272 static bool getSymTab(Value *V, ValueSymbolTable *&ST) {  in getSymTab()  argument
274 if (Instruction *I = dyn_cast<Instruction>(V)) { in getSymTab()
278 } else if (BasicBlock *BB = dyn_cast<BasicBlock>(V)) { in getSymTab()
281 } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) { in getSymTab()
284 } else if (Argument *A = dyn_cast<Argument>(V)) { in getSymTab()
288 assert(isa<Constant>(V) && "Unknown value type!"); in getSymTab()
396 void Value::takeName(Value *V) { in takeName() argument
397 assert(V != this && "Illegal call to this->takeName(this)!"); in takeName()
405 if (V->hasName()) V->setName(""); in takeName()
418 if (!V->hasName()) return; in takeName()
424 V->setName(""); in takeName()
431 bool Failure = getSymTab(V, VST); in takeName()
438 setValueName(V->getValueName()); in takeName()
439 V->setValueName(nullptr); in takeName()
448 VST->removeValueName(V->getValueName()); in takeName()
449 setValueName(V->getValueName()); in takeName()
450 V->setValueName(nullptr); in takeName()
497 static bool contains(Value *Expr, Value *V) { in contains() argument
498 if (Expr == V) in contains()
501 auto *C = dyn_cast<Constant>(V); in contains()
587 static void replaceDbgUsesOutsideBlock(Value *V, Value *New, BasicBlock *BB) { in replaceDbgUsesOutsideBlock() argument
590 findDbgUsers(DbgUsers, V, &DPUsers); in replaceDbgUsesOutsideBlock()
593 DVI->replaceVariableLocationOp(V, New); in replaceDbgUsesOutsideBlock()
598 DVR->replaceVariableLocationOp(V, New); in replaceDbgUsesOutsideBlock()
635 const Value *V, in stripPointerCastsAndOffsets() argument
637 if (!V->getType()->isPointerTy()) in stripPointerCastsAndOffsets()
638 return V; in stripPointerCastsAndOffsets()
644 Visited.insert(V); in stripPointerCastsAndOffsets()
646 Func(V); in stripPointerCastsAndOffsets()
647 if (auto *GEP = dyn_cast<GEPOperator>(V)) { in stripPointerCastsAndOffsets()
654 return V; in stripPointerCastsAndOffsets()
658 return V; in stripPointerCastsAndOffsets()
662 return V; in stripPointerCastsAndOffsets()
665 V = GEP->getPointerOperand(); in stripPointerCastsAndOffsets()
666 } else if (Operator::getOpcode(V) == Instruction::BitCast) { in stripPointerCastsAndOffsets()
667 Value *NewV = cast<Operator>(V)->getOperand(0); in stripPointerCastsAndOffsets()
669 return V; in stripPointerCastsAndOffsets()
670 V = NewV; in stripPointerCastsAndOffsets()
672 Operator::getOpcode(V) == Instruction::AddrSpaceCast) { in stripPointerCastsAndOffsets()
675 V = cast<Operator>(V)->getOperand(0); in stripPointerCastsAndOffsets()
676 } else if (StripKind == PSK_ZeroIndicesAndAliases && isa<GlobalAlias>(V)) { in stripPointerCastsAndOffsets()
677 V = cast<GlobalAlias>(V)->getAliasee(); in stripPointerCastsAndOffsets()
678 } else if (StripKind == PSK_ForAliasAnalysis && isa<PHINode>(V) && in stripPointerCastsAndOffsets()
679 cast<PHINode>(V)->getNumIncomingValues() == 1) { in stripPointerCastsAndOffsets()
680 V = cast<PHINode>(V)->getIncomingValue(0); in stripPointerCastsAndOffsets()
682 if (const auto *Call = dyn_cast<CallBase>(V)) { in stripPointerCastsAndOffsets()
684 V = RV; in stripPointerCastsAndOffsets()
693 V = Call->getArgOperand(0); in stripPointerCastsAndOffsets()
697 return V; in stripPointerCastsAndOffsets()
699 assert(V->getType()->isPointerTy() && "Unexpected operand type!"); in stripPointerCastsAndOffsets()
700 } while (Visited.insert(V).second); in stripPointerCastsAndOffsets()
702 return V; in stripPointerCastsAndOffsets()
742 const Value *V = this; in stripAndAccumulateConstantOffsets() local
744 if (auto *GEP = dyn_cast<GEPOperator>(V)) { in stripAndAccumulateConstantOffsets()
747 return V; in stripAndAccumulateConstantOffsets()
755 APInt GEPOffset(DL.getIndexTypeSizeInBits(V->getType()), 0); in stripAndAccumulateConstantOffsets()
757 return V; in stripAndAccumulateConstantOffsets()
763 return V; in stripAndAccumulateConstantOffsets()
776 return V; in stripAndAccumulateConstantOffsets()
779 V = GEP->getPointerOperand(); in stripAndAccumulateConstantOffsets()
780 } else if (Operator::getOpcode(V) == Instruction::BitCast || in stripAndAccumulateConstantOffsets()
781 Operator::getOpcode(V) == Instruction::AddrSpaceCast) { in stripAndAccumulateConstantOffsets()
782 V = cast<Operator>(V)->getOperand(0); in stripAndAccumulateConstantOffsets()
783 } else if (auto *GA = dyn_cast<GlobalAlias>(V)) { in stripAndAccumulateConstantOffsets()
785 V = GA->getAliasee(); in stripAndAccumulateConstantOffsets()
786 } else if (const auto *Call = dyn_cast<CallBase>(V)) { in stripAndAccumulateConstantOffsets()
788 V = RV; in stripAndAccumulateConstantOffsets()
790 V = Call->getArgOperand(0); in stripAndAccumulateConstantOffsets()
791 } else if (auto *Int2Ptr = dyn_cast<Operator>(V)) { in stripAndAccumulateConstantOffsets()
796 return V; in stripAndAccumulateConstantOffsets()
800 return V; in stripAndAccumulateConstantOffsets()
805 return V; in stripAndAccumulateConstantOffsets()
808 V = Ptr2Int->getOperand(0); in stripAndAccumulateConstantOffsets()
810 assert(V->getType()->isPtrOrPtrVectorTy() && "Unexpected operand type!"); in stripAndAccumulateConstantOffsets()
811 } while (Visited.insert(V).second); in stripAndAccumulateConstantOffsets()
813 return V; in stripAndAccumulateConstantOffsets()
1230 void ValueHandleBase::ValueIsDeleted(Value *V) { in ValueIsDeleted() argument
1231 assert(V->HasValueHandle && "Should only be called if ValueHandles present"); in ValueIsDeleted()
1235 LLVMContextImpl *pImpl = V->getContext().pImpl; in ValueIsDeleted()
1236 ValueHandleBase *Entry = pImpl->ValueHandles[V]; in ValueIsDeleted()
1270 if (V->HasValueHandle) { in ValueIsDeleted()
1272 dbgs() << "While deleting: " << *V->getType() << " %" << V->getName() in ValueIsDeleted()
1274 if (pImpl->ValueHandles[V]->getKind() == Assert) in ValueIsDeleted()