| /src/external/apache2/llvm/dist/llvm/lib/Transforms/IPO/ |
| GlobalSplit.cpp | 9 // This pass uses inrange annotations on GEP indices to split globals where 60 auto *GEP = dyn_cast<GEPOperator>(U); 61 if (!GEP || !GEP->getInRangeIndex() || *GEP->getInRangeIndex() != 1 || 62 !isa<ConstantInt>(GEP->getOperand(1)) || 63 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || 64 !isa<ConstantInt>(GEP->getOperand(2))) 120 auto *GEP = cast<GEPOperator>(U); 121 unsigned I = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue() [all...] |
| ArgumentPromotion.cpp | 98 /// A vector used to hold the indices of a single GEP instruction 121 // handle cases where there are both a direct load and GEP accesses. 126 // what the new GEP/Load instructions we are inserting look like. 180 // and gep+loads with the GEP indices. 253 // Loop over the operands, inserting GEP and loads in the caller as 263 // Emit a GEP and load for each element of the struct. 296 // This satisfies GEP constraints. 307 // And create a GEP to extract those indices. 439 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back()) [all...] |
| GlobalOpt.cpp | 178 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 179 if (!GEP->hasAllConstantIndices()) 328 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { 329 // Do not transform "gepinst (gep constexpr (GV))" here, because forming 330 // "gepconstexpr (gep constexpr (GV))" will cause the two gep's to fold 333 if (!isa<ConstantExpr>(GEP->getOperand(0))) { 335 ConstantFoldInstruction(GEP, DL, &GetTLI(*GEP->getFunction()))); 340 // If the initializer is an all-null value and we have an inbounds GEP, [all...] |
| /src/external/apache2/llvm/dist/llvm/include/llvm/Analysis/Utils/ |
| Local.h | 29 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, 31 GEPOperator *GEPOp = cast<GEPOperator>(GEP); 32 Type *IntIdxTy = DL.getIndexType(GEP->getType()); 35 // If the GEP is inbounds, we know that none of the addressing operations will 44 gep_type_iterator GTI = gep_type_begin(GEP); 45 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; 86 GEP->getName().str() + ".idx", false /*NUW*/, 93 Result = Builder->CreateAdd(Result, Offset, GEP->getName().str()+".offs",
|
| /src/external/apache2/llvm/dist/llvm/include/llvm/IR/ |
| GetElementPtrTypeIterator.h | 106 // the first element this is an unbounded array of the GEP's source element 139 inline gep_type_iterator gep_type_begin(const User *GEP) { 140 auto *GEPOp = cast<GEPOperator>(GEP); 143 GEP->op_begin() + 1); 146 inline gep_type_iterator gep_type_end(const User *GEP) { 147 return gep_type_iterator::end(GEP->op_end()); 150 inline gep_type_iterator gep_type_begin(const User &GEP) { 151 auto &GEPOp = cast<GEPOperator>(GEP); 154 GEP.op_begin() + 1); 157 inline gep_type_iterator gep_type_end(const User &GEP) { [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Transforms/Scalar/ |
| SeparateConstOffsetFromGEP.cpp | 24 // gep %a, 0, %x, %y; load 25 // gep %a, 0, %x, %y + 1; load 26 // gep %a, 0, %x + 1, %y; load 27 // gep %a, 0, %x + 1, %y + 1; load 30 // unable to reuse (gep %a, 0, %x, %y). As a result, this misoptimization incurs 34 // each GEP, wasting tons of registers. It emits the following PTX for the 50 // It works by splitting each GEP into a variadic base and a constant offset. 58 // base = gep a, 0, x, y 81 // Another improvement enabled by the LowerGEP flag is to lower a GEP with 102 // lower a GEP with multiple indices into arithmetic operations [all...] |
| NaryReassociate.cpp | 258 // nary-gep.ll. 324 static bool isGEPFoldable(GetElementPtrInst *GEP, 326 SmallVector<const Value *, 4> Indices(GEP->indices()); 327 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), 331 Instruction *NaryReassociatePass::tryReassociateGEP(GetElementPtrInst *GEP) { 332 // Not worth reassociating GEP if it is foldable. 333 if (isGEPFoldable(GEP, TTI)) 336 gep_type_iterator GTI = gep_type_begin(*GEP); 337 for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I, ++GTI) [all...] |
| ConstraintElimination.cpp | 55 auto *GEP = dyn_cast<GetElementPtrInst>(V); 56 if (GEP && GEP->getNumOperands() == 2 && GEP->isInBounds()) { 61 if (match(GEP->getOperand(GEP->getNumOperands() - 1), 65 {1, GEP->getPointerOperand()}, 69 {1, GEP->getPointerOperand()}, 71 return {{0, nullptr}, {1, GEP->getPointerOperand()}, {1, Op0}}; 74 if (match(GEP->getOperand(GEP->getNumOperands() - 1), m_ConstantInt(CI)) & [all...] |
| StraightLineStrengthReduce.cpp | 139 GEP, // &B[..][i * S][..] 151 // Note that Index and Stride of a GEP candidate do not necessarily have the 214 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP); 235 GetElementPtrInst *GEP); 238 // GEP and the bump is not divisible by the element size of the GEP, this 240 // basis using an ugly GEP. 286 static bool isGEPFoldable(GetElementPtrInst *GEP, 288 SmallVector<const Value *, 4> Indices(GEP->indices()); 289 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand() [all...] |
| MergeICmps.cpp | 83 BCEAtom(GetElementPtrInst *GEP, LoadInst *LoadI, int BaseId, APInt Offset) 84 : GEP(GEP), LoadI(LoadI), BaseId(BaseId), Offset(Offset) {} 93 GEP = that.GEP; 114 GetElementPtrInst *GEP = nullptr; 157 auto *const GEP = dyn_cast<GetElementPtrInst>(Addr); 158 if (!GEP) 160 LLVM_DEBUG(dbgs() << "GEP\n"); 161 if (GEP->isUsedOutsideOfBlock(LoadI->getParent())) [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Transforms/Utils/ |
| RelLookupTableConverter.cpp | 39 GetElementPtrInst *GEP = 41 if (!GEP || !GEP->hasOneUse()) 44 LoadInst *Load = dyn_cast<LoadInst>(GEP->use_begin()->getUser()); 128 GetElementPtrInst *GEP = 130 LoadInst *Load = cast<LoadInst>(GEP->use_begin()->getUser()); 133 BasicBlock *BB = GEP->getParent(); 140 // Place new instruction sequence before GEP. 141 Builder.SetInsertPoint(GEP); 142 Value *Index = GEP->getOperand(2) [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Analysis/ |
| TypeMetadataUtils.cpp | 62 } else if (auto GEP = dyn_cast<GetElementPtrInst>(User)) { 63 // Take into account the GEP offset. 64 if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) { 65 SmallVector<Value *, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); 67 GEP->getSourceElementType(), Indices);
|
| PHITransAddr.cpp | 214 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 217 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { 218 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); 221 AnyChanged |= GEPOp != GEP->getOperand(i); 226 return GEP; 228 // Simplify the GEP to handle 'gep x, 0' -> x etc. 229 if (Value *V = SimplifyGEPInst(GEP->getSourceElementType(), 237 // Scan to see if we have this GEP available. 241 if (GEPI->getType() == GEP->getType() & [all...] |
| /src/external/apache2/llvm/dist/llvm/include/llvm/Transforms/Scalar/ |
| NaryReassociate.h | 119 // Reassociate GEP for better CSE. 120 Instruction *tryReassociateGEP(GetElementPtrInst *GEP); 122 // Try splitting GEP at the I-th index and see whether either part can be 125 // \p IndexedType The element type indexed by GEP's I-th index. This is 127 // GEP->getIndexedType(GEP->getPointerOperand(), 0-th index, 129 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, 132 // Given GEP's I-th index = LHS + RHS, see whether &Base[..][LHS][..] or 133 // &Base[..][RHS][..] can be CSE'ed and rewrite GEP accordingly. 134 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Target/ARM/ |
| MVEGatherScatterLowering.cpp | 87 Value *checkGEP(Value *&Offsets, FixedVectorType *Ty, GetElementPtrInst *GEP, 127 Value *Ptr, GetElementPtrInst *GEP, 139 Value *foldGEP(GetElementPtrInst *GEP, Value *&Offsets, IRBuilder<> &Builder); 218 GetElementPtrInst *GEP, 220 if (!GEP) { 227 Value *GEPPtr = GEP->getPointerOperand(); 228 Offsets = GEP->getOperand(1); 233 if (GEP->getNumOperands() != 2) { 238 Offsets = GEP->getOperand(1); 267 // If none of the checks failed, return the gep's base pointe [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Transforms/Vectorize/ |
| VPlanTransforms.cpp | 71 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 73 GEP, Plan->mapToVPValues(GEP->operands()), OrigLoop);
|
| /src/external/apache2/llvm/dist/llvm/lib/Transforms/InstCombine/ |
| InstructionCombining.cpp | 201 Value *InstCombinerImpl::EmitGEPOffset(User *GEP) { 202 return llvm::EmitGEPOffset(&Builder, DL, GEP); 1226 /// is a sequence of GEP indices into the pointed type that will land us at the 1288 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { 1289 // If this GEP has only 0 indices, it is the same pointer as 1290 // Src. If Src is not a trivial GEP too, don't combine 1292 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && 1817 // At least one GEP must be inbounds. 1825 /// Thread a GEP operation with constant indices through the constant true/false 1827 static Instruction *foldSelectGEP(GetElementPtrInst &GEP, [all...] |
| InstCombinePHI.cpp | 479 // This is true if all GEP bases are allocas and if all indices into them are 492 GetElementPtrInst *GEP = 494 if (!GEP || !GEP->hasOneUser() || GEP->getType() != FirstInst->getType() || 495 GEP->getNumOperands() != FirstInst->getNumOperands()) 498 AllInBounds &= GEP->isInBounds(); 502 (!isa<AllocaInst>(GEP->getOperand(0)) || 503 !GEP->hasAllConstantIndices())) 508 if (FirstInst->getOperand(op) == GEP->getOperand(op) [all...] |
| /src/external/apache2/llvm/dist/llvm/lib/Target/NVPTX/ |
| NVPTXLowerArgs.cpp | 162 // Only Load and GEP are supported. 178 if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) { 179 SmallVector<Value *, 4> Indices(GEP->indices()); 181 GEP->getName(), GEP); 182 NewGEP->setIsInBounds(GEP->isInBounds()); 221 // E.g if we have Value = Load(BitCast(GEP(arg))), InstructionsToDelete will 222 // have {GEP,BitCast}. GEP can't be deleted first, because it's still used by
|
| NVVMReflect.cpp | 138 const ConstantExpr *GEP = cast<ConstantExpr>(Str); 140 const Value *Sym = GEP->getOperand(0);
|
| /src/external/apache2/llvm/dist/llvm/lib/FuzzMutate/ |
| IRMutator.cpp | 205 GetElementPtrInst *GEP = nullptr; 233 GEP = cast<GetElementPtrInst>(&Inst); 234 Modifications.push_back([GEP]() { GEP->setIsInBounds(true); }); 235 Modifications.push_back([GEP]() { GEP->setIsInBounds(false); });
|
| /src/external/apache2/llvm/dist/llvm/lib/Target/AMDGPU/ |
| AMDGPUPerfHintAnalysis.cpp | 166 if (auto GEP = dyn_cast<GetElementPtrInst>(V)) { 167 auto P = GEP->getPointerOperand(); 169 for (unsigned I = 1, E = GEP->getNumIndices() + 1; I != E; ++I) 170 WorkSet.insert(GEP->getOperand(I)); 237 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) { 239 auto *Ptr = GetPointerBaseWithConstantOffset(GEP, AM.BaseOffs, *DL); 242 if (TLI->isLegalAddressingMode(*DL, AM, GEP->getResultElementType(), 243 GEP->getPointerAddressSpace()))
|
| AMDGPUPromoteAlloca.cpp | 337 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(stripBitcasts(Ptr)); 338 if (!GEP) 341 auto I = GEPIdx.find(GEP); 345 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { 347 if (GEP->getNumOperands() != 3) 350 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); 354 return GEP->getOperand(2); 365 // Currently only handle the case where the Pointer Operand is a GEP. 385 // since it should be canonical form, the User should be a GEP. 455 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(AllocaUser) [all...] |
| AMDGPUInstructionSelector.h | 71 const MachineInstr &GEP; 75 GEPInfo(const MachineInstr &GEP) : GEP(GEP), Imm(0) { }
|
| /src/external/apache2/llvm/dist/llvm/lib/CodeGen/ |
| InterleavedLoadCombinePass.cpp | 149 // Pa_3 = %IDX/2 + 1 #1 | GEP, step signext to i64 150 // Pa_4 = (%IDX/2)*16 + 16 #0 | GEP, multiply index by sizeof(4) for floats 151 // Pa_5 = (%IDX/2)*16 + 16 #0 | GEP, add offset of leading components 156 // Pb_3 = %IDX/2 + 2 #1 | GEP, step signext to i64 157 // Pb_4 = (%IDX/2)*16 + 32 #0 | GEP, multiply index by sizeof(4) for floats 158 // Pb_5 = (%IDX/2)*16 + 16 #0 | GEP, add offset of leading components 984 GetElementPtrInst &GEP = *cast<GetElementPtrInst>(&Ptr); 989 if (GEP.accumulateConstantOffset(DL, BaseOffset)) { 991 BasePtr = GEP.getPointerOperand(); 994 // Otherwise we allow that the last index operand of the GEP i [all...] |