/external/llvm/lib/Target/NVPTX/ |
NVPTXFavorNonGenericAddrSpaces.cpp | 14 // the base pointer of a GEP. 20 // %1 = gep [10 x float]* %0, i64 0, i64 %i 24 // and the GEP to expose more optimization opportunities to function 27 // %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i 35 // %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i 71 /// Transforms "gep (addrspacecast X), indices" into "addrspacecast (gep X, 75 bool hoistAddrSpaceCastFromGEP(GEPOperator *GEP); 112 GEPOperator *GEP) { 113 Operator *Cast = dyn_cast<Operator>(GEP->getPointerOperand()) [all...] |
NVVMReflect.cpp | 177 const ConstantExpr *GEP = cast<ConstantExpr>(Str); 179 const Value *Sym = GEP->getOperand(0);
|
/external/llvm/include/llvm/IR/ |
GetElementPtrTypeIterator.h | 85 inline gep_type_iterator gep_type_begin(const User *GEP) { 87 (GEP->getOperand(0)->getType()->getScalarType(), GEP->op_begin()+1); 89 inline gep_type_iterator gep_type_end(const User *GEP) { 90 return gep_type_iterator::end(GEP->op_end()); 92 inline gep_type_iterator gep_type_begin(const User &GEP) { 94 (GEP.getOperand(0)->getType()->getScalarType(), GEP.op_begin()+1); 96 inline gep_type_iterator gep_type_end(const User &GEP) { 97 return gep_type_iterator::end(GEP.op_end()) [all...] |
/external/llvm/lib/Target/R600/ |
AMDGPUTargetTransformInfo.cpp | 42 const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I); 43 if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS) 46 const Value *Ptr = GEP->getPointerOperand();
|
AMDGPUPromoteAlloca.cpp | 115 GetElementPtrInst *GEP = cast<GetElementPtrInst>(Ptr); 117 auto I = GEPIdx.find(GEP); 121 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { 123 if (GEP->getNumOperands() != 3) 126 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); 130 return GEP->getOperand(2); 167 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(AllocaUser); 168 if (!GEP) { 176 Value *Index = GEPToVectorIndex(GEP); 178 // If we can't compute a vector index from this GEP, then we can' [all...] |
/external/llvm/lib/Transforms/Scalar/ |
SeparateConstOffsetFromGEP.cpp | 25 // gep %a, 0, %x, %y; load 26 // gep %a, 0, %x, %y + 1; load 27 // gep %a, 0, %x + 1, %y; load 28 // gep %a, 0, %x + 1, %y + 1; load 31 // unable to reuse (gep %a, 0, %x, %y). As a result, this misoptimization incurs 35 // each GEP, wasting tons of registers. It emits the following PTX for the 51 // It works by splitting each GEP into a variadic base and a constant offset. 59 // base = gep a, 0, x, y 82 // Another improvement enabled by the LowerGEP flag is to lower a GEP with 103 // lower a GEP with multiple indices into arithmetic operations [all...] |
StraightLineStrengthReduce.cpp | 86 GEP, // &B[..][i * S][..] 98 // Note that Index and Stride of a GEP candidate do not necessarily have the 171 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP); 188 GetElementPtrInst *GEP); 190 // GEP and the bump is not divisible by the element size of the GEP, this 192 // basis using an ugly GEP. 233 static bool isGEPFoldable(GetElementPtrInst *GEP, 241 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getPointerOperand())) 246 gep_type_iterator GTI = gep_type_begin(GEP); [all...] |
LoadCombine.cpp | 93 if (auto *GEP = dyn_cast<GetElementPtrInst>(POP.Pointer)) { 95 unsigned BitWidth = DL.getPointerTypeSizeInBits(GEP->getType()); 97 if (GEP->accumulateConstantOffset(DL, Offset)) 102 POP.Pointer = GEP->getPointerOperand();
|
/external/llvm/include/llvm/Transforms/Utils/ |
Local.h | 192 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, 194 GEPOperator *GEPOp = cast<GEPOperator>(GEP); 195 Type *IntPtrTy = DL.getIntPtrType(GEP->getType()); 198 // If the GEP is inbounds, we know that none of the addressing operations will 206 gep_type_iterator GTI = gep_type_begin(GEP); 207 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; 225 GEP->getName()+".offs"); 233 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs"); 242 GEP->getName()+".idx", isInBounds /*NUW*/) [all...] |
/external/llvm/lib/Analysis/ |
PHITransAddr.cpp | 216 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 219 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { 220 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); 223 AnyChanged |= GEPOp != GEP->getOperand(i); 228 return GEP; 230 // Simplify the GEP to handle 'gep x, 0' -> x etc. 238 // Scan to see if we have this GEP available. 242 if (GEPI->getType() == GEP->getType() && 397 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) [all...] |
MemoryBuiltins.cpp | 402 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) 403 return visitGEPOperator(*GEP); 521 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { 522 SizeOffsetType PtrData = compute(GEP.getPointerOperand()); 524 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(DL, Offset)) 636 } else if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 637 Result = visitGEPOperator(*GEP); 716 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) { 717 SizeOffsetEvalType PtrData = compute_(GEP.getPointerOperand()); 721 Value *Offset = EmitGEPOffset(&Builder, DL, &GEP, /*NoAssumptions=*/true) [all...] |
/external/mesa3d/src/gallium/drivers/radeon/ |
R600KernelParameters.cpp | 159 getElementPtrInst* GEP = dyn_cast<getElementPtrInst>(Val); 160 getElementPtrInst::op_iterator I = GEP->op_begin(); 162 for (++I; I != GEP->op_end(); ++I) { 247 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V); 257 if (GEP && GEP->getType()->getAddressSpace() != Addrspace) { 258 Value *Op = GEP->getPointerOperand(); 266 std::vector<Value*> Params(GEP->idx_begin(), GEP->idx_end()); 270 GEP2->setIsInBounds(GEP->isInBounds()) [all...] |
/external/llvm/lib/Transforms/InstCombine/ |
InstructionCombining.cpp | 78 Value *InstCombiner::EmitGEPOffset(User *GEP) { 79 return llvm::EmitGEPOffset(Builder, DL, GEP); [all...] |
InstCombinePHI.cpp | 136 // This is true if all GEP bases are allocas and if all indices into them are 149 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); 150 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || 151 GEP->getNumOperands() != FirstInst->getNumOperands()) 154 AllInBounds &= GEP->isInBounds(); 158 (!isa<AllocaInst>(GEP->getOperand(0)) || 159 !GEP->hasAllConstantIndices())) 164 if (FirstInst->getOperand(op) == GEP->getOperand(op) [all...] |
InstCombineLoadStoreAlloca.cpp | 79 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 80 // If the GEP has all zero indices, it doesn't offset the pointer. If it 83 std::make_pair(I, IsOffset || !GEP->hasAllZeroIndices())); 199 Instruction *GEP = 201 IC.InsertNewInstBefore(GEP, *It); 205 return IC.ReplaceInstUsesWith(AI, GEP); 578 // Then we know that we can replace %x in the GEP with i64 0. 580 // FIXME: We could fold any GEP index to zero that would cause UB if it were 589 // Find the first non-zero index of a GEP. If all indices are zero, return 640 // FIXME: If the GEP is not inbounds, and there are extra indices after th [all...] |
/external/llvm/lib/IR/ |
Value.cpp | 393 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 397 if (!GEP->hasAllZeroIndices()) 401 if (!GEP->hasAllConstantIndices()) 405 if (!GEP->isInBounds()) 409 V = GEP->getPointerOperand(); 454 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 455 if (!GEP->isInBounds()) 458 if (!GEP->accumulateConstantOffset(DL, GEPOffset)) 461 V = GEP->getPointerOperand(); 537 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) [all...] |
/external/llvm/lib/Transforms/IPO/ |
ArgumentPromotion.cpp | 76 /// A vector used to hold the indices of a single GEP instruction 407 // We can only promote this argument if all of the uses are loads, or are GEP 444 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { 445 V = GEP->getPointerOperand(); 448 Indices.reserve(GEP->getNumIndices()); 449 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); 454 // We found a non-constant GEP index for this argument? Bail out 463 // Direct loads are equivalent to a GEP with a single 0 index. 469 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote [all...] |
/external/llvm/unittests/IR/ |
ConstantsTest.cpp | 270 Constant *GEP = ConstantExpr::getGetElementPtr( 272 EXPECT_DEATH(Global->replaceAllUsesWith(GEP), 338 auto *GEP = ConstantExpr::getGetElementPtr(IntTy, Placeholder, C1); 339 ASSERT_EQ(GEP->getOperand(0), Placeholder); 342 new GlobalVariable(*M, PtrTy, false, GlobalValue::ExternalLinkage, GEP); 343 ASSERT_EQ(GEP, Ref->getInitializer()); 350 ASSERT_EQ(GEP, Ref->getInitializer()); 351 ASSERT_EQ(GEP->getOperand(0), Alias);
|
/external/llvm/lib/CodeGen/ |
GlobalMerge.cpp | 226 Constant *GEP = 228 Globals[k]->replaceAllUsesWith(GEP); 233 auto *PTy = cast<PointerType>(GEP->getType()); 235 Linkage, Name, GEP, &M);
|
/external/llvm/lib/Transforms/Utils/ |
CodeExtractor.cpp | 367 GetElementPtrInst *GEP = GetElementPtrInst::Create( 369 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI); 469 GetElementPtrInst *GEP = GetElementPtrInst::Create( 471 codeReplacer->getInstList().push_back(GEP); 472 StoreInst *SI = new StoreInst(StructValues[i], GEP); 494 GetElementPtrInst *GEP = GetElementPtrInst::Create( 496 codeReplacer->getInstList().push_back(GEP); 497 Output = GEP; 608 GetElementPtrInst *GEP = GetElementPtrInst::Create( 611 new StoreInst(outputs[out], GEP, NTRet) [all...] |
/external/llvm/lib/Analysis/IPA/ |
InlineCost.cpp | 104 bool isGEPOffsetConstant(GetElementPtrInst &GEP); 105 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset); 229 /// \brief Check whether a GEP's indices are all constant. 232 bool CallAnalyzer::isGEPOffsetConstant(GetElementPtrInst &GEP) { 233 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) 240 /// \brief Accumulate a constant GEP offset into an APInt if possible. 244 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { 249 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP); [all...] |
/external/llvm/include/llvm/Analysis/ |
TargetTransformInfoImpl.h | 61 llvm_unreachable("Use getGEPCost for GEP operations!"); 407 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U)) { 408 SmallVector<const Value *, 4> Indices(GEP->idx_begin(), GEP->idx_end()); 410 ->getGEPCost(GEP->getPointerOperand(), Indices);
|
MemoryBuiltins.h | 192 SizeOffsetType visitGEPOperator(GEPOperator &GEP); 257 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
|
/external/llvm/unittests/Transforms/Utils/ |
Cloning.cpp | 137 GetElementPtrInst *GEP = 139 EXPECT_FALSE(this->clone(GEP)->isInBounds()); 141 GEP->setIsInBounds(); 142 EXPECT_TRUE(this->clone(GEP)->isInBounds());
|
/external/llvm/unittests/Linker/ |
LinkModulesTest.cpp | 79 Value *GEP = Builder.CreateGEP(AT, GV, GEPIndices, "switch.gep"); 80 Value *Load = Builder.CreateLoad(GEP, "switch.load");
|