Lines Matching refs:Constant

155     if (isa<Constant>(V))  in IsSafeComputationToRemove()
206 if (isa<Constant>(V)) { in CleanupPointerRootUsers()
214 if (isa<Constant>(MSI->getValue())) { in CleanupPointerRootUsers()
235 } else if (Constant *C = dyn_cast<Constant>(U)) { in CleanupPointerRootUsers()
270 static bool CleanupConstantGlobalUsers(Value *V, Constant *Init, in CleanupConstantGlobalUsers()
299 Constant *SubInit = nullptr; in CleanupConstantGlobalUsers()
318 Constant *SubInit = nullptr; in CleanupConstantGlobalUsers()
329 SubInit = Constant::getNullValue(GEP->getType()->getElementType()); in CleanupConstantGlobalUsers()
343 } else if (Constant *C = dyn_cast<Constant>(U)) { in CleanupConstantGlobalUsers()
360 if (Constant *C = dyn_cast<Constant>(V)) in isSafeSROAElementUse()
377 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) || in isSafeSROAElementUse()
378 !cast<Constant>(GEPI->getOperand(1))->isNullValue()) in isSafeSROAElementUse()
402 if (U->getNumOperands() < 3 || !isa<Constant>(U->getOperand(1)) || in IsUserOfGlobalSafeForSRA()
403 !cast<Constant>(U->getOperand(1))->isNullValue() || in IsUserOfGlobalSafeForSRA()
478 Constant *Init = GV->getInitializer(); in SRAGlobal()
493 Constant *In = Init->getAggregateElement(i); in SRAGlobal()
525 Constant *In = Init->getAggregateElement(i); in SRAGlobal()
550 Constant *NullInt =Constant::getNullValue(Type::getInt32Ty(GV->getContext())); in SRAGlobal()
572 SmallVector<Constant*, 8> Idxs; in SRAGlobal()
577 ConstantExpr::getGetElementPtr(NewTy, cast<Constant>(NewPtr), Idxs); in SRAGlobal()
675 static bool OptimizeAwayTrappingUsesOfValue(Value *V, Constant *NewV) { in OptimizeAwayTrappingUsesOfValue()
716 SmallVector<Constant*, 8> Idxs; in OptimizeAwayTrappingUsesOfValue()
720 if (Constant *C = dyn_cast<Constant>(*i)) in OptimizeAwayTrappingUsesOfValue()
742 static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV, in OptimizeAwayTrappingUsesOfLoads()
810 if (Constant *NewC = ConstantFoldInstruction(I, DL, TLI)) { in ConstantPropUsersOf()
869 Constant *RepValue = NewGV; in OptimizeGlobalAddressOfMalloc()
1203 Constant::getNullValue(NPtr->getType()), in RewriteHeapSROALoadUser()
1297 Constant::getNullValue(PFieldTy), in PerformHeapAllocSRoA()
1327 Constant *ConstantZero = ConstantInt::get(CI->getArgOperand(0)->getType(), 0); in PerformHeapAllocSRoA()
1332 Constant::getNullValue(FieldMallocs[i]->getType()), in PerformHeapAllocSRoA()
1357 Constant::getNullValue(GVVal->getType())); in PerformHeapAllocSRoA()
1367 new StoreInst(Constant::getNullValue(GVVal->getType()), FieldGlobals[i], in PerformHeapAllocSRoA()
1406 Constant *Null = Constant::getNullValue(PT->getElementType()); in PerformHeapAllocSRoA()
1571 if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) { in OptimizeOnceStoredGlobal()
1594 static bool TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) { in TryToShrinkGlobalToBoolean()
1625 Constant *InitVal = GV->getInitializer(); in TryToShrinkGlobalToBoolean()
1812 if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue)) in ProcessInternalGlobal()
1840 if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue)) { in ProcessInternalGlobal()
1951 Constant *New = ConstantFoldConstantExpression(CE, DL, TLI); in OptimizeGlobalVars()
1967 isSimpleEnoughValueToCommit(Constant *C,
1968 SmallPtrSetImpl<Constant *> &SimpleConstants,
1980 isSimpleEnoughValueToCommitHelper(Constant *C, in isSimpleEnoughValueToCommitHelper()
1981 SmallPtrSetImpl<Constant *> &SimpleConstants, in isSimpleEnoughValueToCommitHelper()
1996 if (!isSimpleEnoughValueToCommit(cast<Constant>(Op), SimpleConstants, DL)) in isSimpleEnoughValueToCommitHelper()
2036 isSimpleEnoughValueToCommit(Constant *C, in isSimpleEnoughValueToCommit()
2037 SmallPtrSetImpl<Constant *> &SimpleConstants, in isSimpleEnoughValueToCommit()
2052 static bool isSimpleEnoughPointerToCommit(Constant *C) { in isSimpleEnoughPointerToCommit()
2101 static Constant *EvaluateStoreInto(Constant *Init, Constant *Val, in EvaluateStoreInto()
2109 SmallVector<Constant*, 32> Elts; in EvaluateStoreInto()
2149 static void CommitValueTo(Constant *Val, Constant *Addr) { in CommitValueTo()
2180 Tmp->replaceAllUsesWith(Constant::getNullValue(Tmp->getType())); in ~Evaluator()
2186 bool EvaluateFunction(Function *F, Constant *&RetVal,
2187 const SmallVectorImpl<Constant*> &ActualArgs);
2194 Constant *getVal(Value *V) { in getVal()
2195 if (Constant *CV = dyn_cast<Constant>(V)) return CV; in getVal()
2196 Constant *R = ValueStack.back().lookup(V); in getVal()
2201 void setVal(Value *V, Constant *C) { in setVal()
2205 const DenseMap<Constant*, Constant*> &getMutatedMemory() const { in getMutatedMemory()
2214 Constant *ComputeLoadResult(Constant *P);
2219 std::deque<DenseMap<Value*, Constant*>> ValueStack;
2229 DenseMap<Constant*, Constant*> MutatedMemory;
2242 SmallPtrSet<Constant*, 8> SimpleConstants;
2253 Constant *Evaluator::ComputeLoadResult(Constant *P) { in ComputeLoadResult()
2256 DenseMap<Constant*, Constant*>::const_iterator I = MutatedMemory.find(P); in ComputeLoadResult()
2285 Constant *InstResult = nullptr; in EvaluateBlock()
2294 Constant *Ptr = getVal(SI->getOperand(1)); in EvaluateBlock()
2306 Constant *Val = getVal(SI->getOperand(0)); in EvaluateBlock()
2337 Constant *IdxZero = ConstantInt::get(IdxTy, 0, false); in EvaluateBlock()
2338 Constant * const IdxList[] = {IdxZero, IdxZero}; in EvaluateBlock()
2398 Constant *P = getVal(GEP->getOperand(0)); in EvaluateBlock()
2399 SmallVector<Constant*, 8> GEPOps; in EvaluateBlock()
2415 Constant *Ptr = getVal(LI->getOperand(0)); in EvaluateBlock()
2463 Constant *Ptr = getVal(MSI->getDest()); in EvaluateBlock()
2464 Constant *Val = getVal(MSI->getValue()); in EvaluateBlock()
2465 Constant *DestVal = ComputeLoadResult(getVal(Ptr)); in EvaluateBlock()
2520 SmallVector<Constant*, 8> Formals; in EvaluateBlock()
2526 if (Constant *C = ConstantFoldCall(Callee, Formals, TLI)) { in EvaluateBlock()
2540 Constant *RetVal = nullptr; in EvaluateBlock()
2621 bool Evaluator::EvaluateFunction(Function *F, Constant *&RetVal, in EvaluateFunction()
2622 const SmallVectorImpl<Constant*> &ActualArgs) { in EvaluateFunction()
2688 Constant *RetValDummy; in EvaluateStaticConstructor()
2690 SmallVector<Constant*, 0>()); in EvaluateStaticConstructor()
2699 for (DenseMap<Constant*, Constant*>::const_iterator I = in EvaluateStaticConstructor()
2710 static int compareNames(Constant *const *A, Constant *const *B) { in compareNames()
2724 SmallVector<llvm::Constant *, 8> UsedArray; in setUsedInitializer()
2726 Constant *Cast in setUsedInitializer()
2840 Constant *Aliasee = GA.getAliasee(); in hasUsesToReplace()
2872 Constant *Aliasee = J->getAliasee(); in OptimizeGlobalAliases()
3021 CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); in OptimizeEmptyGlobalCXXDtors()