Home | History | Annotate | Download | only in NVPTX

Lines Matching refs:GEP

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());
120 SmallVector<Value *, 8> Indices(GEP->idx_begin(), GEP->idx_end());
121 if (Instruction *GEPI = dyn_cast<Instruction>(GEP)) {
122 // %1 = gep (addrspacecast X), indices
124 // %0 = gep X, indices
128 GEP->getName(),
130 NewGEPI->setIsInBounds(GEP->isInBounds());
131 GEP->replaceAllUsesWith(
132 new AddrSpaceCastInst(NewGEPI, GEP->getType(), "", GEPI));
134 // GEP is a constant expression.
138 GEP->isInBounds());
139 GEP->replaceAllUsesWith(
140 ConstantExpr::getAddrSpaceCast(NewGEPCE, GEP->getType()));
148 // If the pointer operand is a GEP, hoist the addrspacecast if any from the
149 // GEP to expose more optimization opportunites.
150 if (GEPOperator *GEP = dyn_cast<GEPOperator>(MI->getOperand(Idx))) {
151 hoistAddrSpaceCastFromGEP(GEP);