• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/llvm-project/llvm/lib/Transforms/IPO/

Lines Matching refs:GEP

175     if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) {
176 if (!GEP->hasAllConstantIndices())
320 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
325 if (!isa<ConstantExpr>(GEP->getOperand(0))) {
327 ConstantFoldInstruction(GEP, DL, &GetTLI(*GEP->getFunction())));
331 // If the initializer is an all-null value and we have an inbounds GEP,
332 // we already know what the result of any load from that GEP is.
334 if (Init && isa<ConstantAggregateZero>(Init) && GEP->isInBounds())
335 SubInit = Constant::getNullValue(GEP->getResultElementType());
337 Changed |= CleanupConstantGlobalUsers(GEP, SubInit, DL, GetTLI);
339 if (GEP->use_empty()) {
340 GEP->eraseFromParent();
364 /// Return true if the specified GEP is a safe user of a derived
367 // Check to see if this ConstantExpr GEP is SRA'able. In particular, we
414 // Otherwise, it must be a GEP. Check it and its users are safe to SRA.
422 // The user of the global must be a GEP Inst or a ConstantExpr GEP.
500 for (User *GEP : GV->users()) {
501 assert(((isa<ConstantExpr>(GEP) && cast<ConstantExpr>(GEP)->getOpcode() ==
503 isa<GetElementPtrInst>(GEP)) &&
509 unsigned ElementIdx = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue();
578 User *GEP = GV->user_back();
579 assert(((isa<ConstantExpr>(GEP) &&
580 cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)||
581 isa<GetElementPtrInst>(GEP)) && "NonGEP CE's are not SRAable!");
586 unsigned ElementIdx = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue();
592 // Form a shorter GEP if needed.
593 if (GEP->getNumOperands() > 3) {
594 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) {
602 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP);
612 GEP->replaceAllUsesWith(NewPtr);
614 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(GEP))
617 cast<ConstantExpr>(GEP)->destroyConstant();
740 // Should handle GEP here.
970 // constant prop them. This will promote GEP instructions with constant
971 // indices into GEP constant-exprs, which will allow global-opt to hack on it.
1050 // If this is a "GEP bitcast" and the user is a store to the global, then
1055 // Must be bitcast GEP between the malloc and store to initialize
1071 /// perform heap SRA on. This permits GEP's that index through the array and
1094 // Otherwise the GEP is ok.
1243 // Create the new GEP idx vector.
1507 // GEP'd. These are all things we could transform to using the global
1883 // to care about is a constant GEP or constant bitcast - so just looking
2408 /// GEP operands of Addr [0, OpNo) have been stepped into.
2465 /// of either a global or a constant GEP, set the initializer for the address to
2515 ConstantExpr *GEP = cast<ConstantExpr>(I.first);
2517 if (GEP->getNumOperands() > 3)
2518 ComplexCEs.push_back(std::make_pair(GEP, I.second));
2520 SimpleCEs.push_back(std::make_pair(GEP, I.second));
2576 ConstantExpr *GEP = CEPair.first;
2579 GlobalVariable *GV = cast<GlobalVariable>(GEP->getOperand(0));
2581 ConstantInt *CI = cast<ConstantInt>(GEP->getOperand(2));