Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Variadic

51 // It works by splitting each GEP into a variadic base and a constant offset.
52 // The variadic base can be computed once and reused by multiple GEPs, and the
314 /// \brief A pass that tries to split every GEP in the function into a variadic
342 /// Tries to split the given GEP into a variadic base and a constant offset,
346 /// Function splitGEP already split the original GEP into a variadic part and
348 /// variadic part into a set of GEPs with a single index and applies
350 /// \p Variadic The variadic part of the original GEP.
352 void lowerToSingleIndexGEPs(GetElementPtrInst *Variadic,
355 /// Function splitGEP already split the original GEP into a variadic part and
357 /// variadic part into a set of arithmetic operations and applies
359 Variadic The variadic part of the original GEP.
361 void lowerToArithmetics(GetElementPtrInst *Variadic,
427 "Split GEPs to a variadic base and a constant offset for better CSE", false,
436 "Split GEPs to a variadic base and a constant offset for better CSE", false,
769 GetElementPtrInst *Variadic, int64_t AccumulativeByteOffset) {
770 IRBuilder<> Builder(Variadic);
771 Type *IntPtrTy = DL->getIntPtrType(Variadic->getType());
774 Builder.getInt8PtrTy(Variadic->getType()->getPointerAddressSpace());
775 Value *ResultPtr = Variadic->getOperand(0);
776 Loop *L = LI->getLoopFor(Variadic->getParent());
786 gep_type_iterator GTI = gep_type_begin(*Variadic);
789 for (unsigned I = 1, E = Variadic->getNumOperands(); I != E; ++I, ++GTI) {
791 Value *Idx = Variadic->getOperand(I);
832 if (ResultPtr->getType() != Variadic->getType())
833 ResultPtr = Builder.CreateBitCast(ResultPtr, Variadic->getType());
835 Variadic->replaceAllUsesWith(ResultPtr);
836 Variadic->eraseFromParent();
840 SeparateConstOffsetFromGEP::lowerToArithmetics(GetElementPtrInst *Variadic,
842 IRBuilder<> Builder(Variadic);
843 Type *IntPtrTy = DL->getIntPtrType(Variadic->getType());
845 Value *ResultPtr = Builder.CreatePtrToInt(Variadic->getOperand(0), IntPtrTy);
846 gep_type_iterator GTI = gep_type_begin(*Variadic);
850 for (unsigned I = 1, E = Variadic->getNumOperands(); I != E; ++I, ++GTI) {
852 Value *Idx = Variadic->getOperand(I);
880 ResultPtr = Builder.CreateIntToPtr(ResultPtr, Variadic->getType());
881 Variadic->replaceAllUsesWith(ResultPtr);
882 Variadic->eraseFromParent();
923 // computes the variadic base.
932 // Splits this GEP index into a variadic part and a constant offset, and
933 // uses the variadic part as the new index.