[llvm-commits] [llvm-gcc-4.2] r135761 - in /llvm-gcc-4.2/trunk/gcc: config/arm/llvm-arm.cpp config/i386/llvm-i386.cpp llvm-convert.cpp

Jay Foad jay.foad at gmail.com
Fri Jul 22 01:16:57 PDT 2011


Author: foad
Date: Fri Jul 22 03:16:57 2011
New Revision: 135761

URL: http://llvm.org/viewvc/llvm-project?rev=135761&view=rev
Log:
Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

Modified:
    llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
    llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=135761&r1=135760&r2=135761&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Fri Jul 22 03:16:57 2011
@@ -2790,7 +2790,7 @@
   Idxs[0] = ConstantInt::get(llvm::Type::getInt32Ty(Context), 0);
   Idxs[1] = ConstantInt::get(llvm::Type::getInt32Ty(Context), DestFieldNo);
   Idxs[2] = ConstantInt::get(llvm::Type::getInt32Ty(Context), DestElemNo);
-  Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
+  Value *GEP = Builder.CreateGEP(Dest, Idxs, "mrv_gep");
   if (STy->getElementType(SrcFieldNo)->isVectorTy()) {
     Value *ElemIndex = ConstantInt::get(Type::getInt32Ty(Context), SrcElemNo);
     Value *EVIElem = Builder.CreateExtractElement(EVI, ElemIndex, "mrv");

Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=135761&r1=135760&r2=135761&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Fri Jul 22 03:16:57 2011
@@ -1809,7 +1809,7 @@
   Idxs[0] = ConstantInt::get(Type::getInt32Ty(Context), 0);
   Idxs[1] = ConstantInt::get(Type::getInt32Ty(Context), DestFieldNo);
   Idxs[2] = ConstantInt::get(Type::getInt32Ty(Context), DestElemNo);
-  Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
+  Value *GEP = Builder.CreateGEP(Dest, Idxs, "mrv_gep");
   if (STy->getElementType(SrcFieldNo)->isVectorTy()) {
     Value *ElemIndex = ConstantInt::get(Type::getInt32Ty(Context), SrcElemNo);
     Value *EVIElem = Builder.CreateExtractElement(EVI, ElemIndex, "mrv");
@@ -1879,13 +1879,13 @@
       Idxs[1] = ConstantInt::get(Type::getInt32Ty(Context), DNO);
 
       Idxs[2] = ConstantInt::get(Type::getInt32Ty(Context), 0);
-      Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
+      Value *GEP = Builder.CreateGEP(Dest, Idxs, "mrv_gep");
       Value *EVI = Builder.CreateExtractValue(Src, 0, "mrv_gr");
       Builder.CreateStore(EVI, GEP, isVolatile);
       ++SNO;
 
       Idxs[2] = ConstantInt::get(llvm::Type::getInt32Ty(Context), 1);
-      GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
+      GEP = Builder.CreateGEP(Dest, Idxs, "mrv_gep");
       EVI = Builder.CreateExtractValue(Src, 1, "mrv_gr");
       Builder.CreateStore(EVI, GEP, isVolatile);
       ++DNO; ++SNO;

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=135761&r1=135760&r2=135761&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Jul 22 03:16:57 2011
@@ -803,7 +803,7 @@
         Idxs[0] = ConstantInt::get(Type::getInt32Ty(Context), 0);
         for (unsigned ri = 0; ri < STy->getNumElements(); ++ri) {
           Idxs[1] = ConstantInt::get(Type::getInt32Ty(Context), ri);
-          Value *GEP = Builder.CreateGEP(R1, Idxs, Idxs+2, "mrv_gep");
+          Value *GEP = Builder.CreateGEP(R1, Idxs, "mrv_gep");
           Value *E = Builder.CreateLoad(GEP, "mrv");
           RetVals.push_back(E);
         }
@@ -7183,8 +7183,8 @@
       Idx.push_back(ConstantInt::get(IntPtrTy, 0));
     Idx.push_back(IndexVal);
     Value *Ptr = flag_wrapv ?
-      Builder.CreateGEP(ArrayAddr, Idx.begin(), Idx.end()) :
-      Builder.CreateInBoundsGEP(ArrayAddr, Idx.begin(), Idx.end());
+      Builder.CreateGEP(ArrayAddr, Idx) :
+      Builder.CreateInBoundsGEP(ArrayAddr, Idx);
 
     Type *ElementTy = ConvertType(ElementType);
     unsigned Alignment = MinAlign(ArrayAlign, TD.getABITypeAlignment(ElementTy));





More information about the llvm-commits mailing list