[llvm-commits] [llvm-gcc-4.2] r53940 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-convert.cpp
Dan Gohman
gohman at apple.com
Tue Jul 22 17:27:22 PDT 2008
Author: djg
Date: Tue Jul 22 19:27:22 2008
New Revision: 53940
URL: http://llvm.org/viewvc/llvm-project?rev=53940&view=rev
Log:
Switch llvm-gcc from GetResultInst to ExtractValueInst.
Modified:
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/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=53940&r1=53939&r2=53940&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 Tue Jul 22 19:27:22 2008
@@ -1233,7 +1233,7 @@
unsigned DestElemNo,
IRBuilder &Builder,
bool isVolatile) {
- GetResultInst *GR = Builder.CreateGetResult(Src, SrcFieldNo, "mrv_gr");
+ Value *EVI = Builder.CreateExtractValue(Src, SrcFieldNo, "mrv_gr");
const StructType *STy = cast<StructType>(Src->getType());
llvm::Value *Idxs[3];
Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
@@ -1242,10 +1242,10 @@
Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
if (isa<VectorType>(STy->getElementType(SrcFieldNo))) {
Value *ElemIndex = ConstantInt::get(Type::Int32Ty, SrcElemNo);
- Value *GRElem = Builder.CreateExtractElement(GR, ElemIndex, "mrv");
- Builder.CreateStore(GRElem, GEP, isVolatile);
+ Value *EVIElem = Builder.CreateExtractElement(EVI, ElemIndex, "mrv");
+ Builder.CreateStore(EVIElem, GEP, isVolatile);
} else {
- Builder.CreateStore(GR, GEP, isVolatile);
+ Builder.CreateStore(EVI, GEP, isVolatile);
}
}
@@ -1272,21 +1272,21 @@
// DestTy is { float, float, float }
// STy is { <4 x float>, float > }
- GetResultInst *GR = Builder.CreateGetResult(Src, 0, "mrv_gr");
+ Value *EVI = Builder.CreateExtractValue(Src, 0, "mrv_gr");
Value *E0Index = ConstantInt::get(Type::Int32Ty, 0);
- Value *GR0 = Builder.CreateExtractElement(GR, E0Index, "mrv.v");
+ Value *EVI0 = Builder.CreateExtractElement(EVI, E0Index, "mrv.v");
Value *GEP0 = Builder.CreateStructGEP(Dest, 0, "mrv_gep");
- Builder.CreateStore(GR0, GEP0, isVolatile);
+ Builder.CreateStore(EVI0, GEP0, isVolatile);
Value *E1Index = ConstantInt::get(Type::Int32Ty, 1);
- Value *GR1 = Builder.CreateExtractElement(GR, E1Index, "mrv.v");
+ Value *EVI1 = Builder.CreateExtractElement(EVI, E1Index, "mrv.v");
Value *GEP1 = Builder.CreateStructGEP(Dest, 1, "mrv_gep");
- Builder.CreateStore(GR1, GEP1, isVolatile);
+ Builder.CreateStore(EVI1, GEP1, isVolatile);
Value *GEP2 = Builder.CreateStructGEP(Dest, 2, "mrv_gep");
- GetResultInst *GR2 = Builder.CreateGetResult(Src, 1, "mrv_gr");
- Builder.CreateStore(GR2, GEP2, isVolatile);
+ Value *EVI2 = Builder.CreateExtractValue(Src, 1, "mrv_gr");
+ Builder.CreateStore(EVI2, GEP2, isVolatile);
return;
}
@@ -1297,8 +1297,8 @@
// Directly access first class values using getresult.
if (DestElemType->isSingleValueType()) {
Value *GEP = Builder.CreateStructGEP(Dest, DNO, "mrv_gep");
- GetResultInst *GR = Builder.CreateGetResult(Src, SNO, "mrv_gr");
- Builder.CreateStore(GR, GEP, isVolatile);
+ Value *EVI = Builder.CreateExtractValue(Src, SNO, "mrv_gr");
+ Builder.CreateStore(EVI, GEP, isVolatile);
++DNO; ++SNO;
continue;
}
@@ -1311,14 +1311,14 @@
Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, 0);
Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
- GetResultInst *GR = Builder.CreateGetResult(Src, 0, "mrv_gr");
- Builder.CreateStore(GR, GEP, isVolatile);
+ Value *EVI = Builder.CreateExtractValue(Src, 0, "mrv_gr");
+ Builder.CreateStore(EVI, GEP, isVolatile);
++SNO;
Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, 1);
GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep");
- GR = Builder.CreateGetResult(Src, 1, "mrv_gr");
- Builder.CreateStore(GR, GEP, isVolatile);
+ EVI = Builder.CreateExtractValue(Src, 1, "mrv_gr");
+ Builder.CreateStore(EVI, GEP, isVolatile);
++DNO; ++SNO;
continue;
}
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=53940&r1=53939&r2=53940&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jul 22 19:27:22 2008
@@ -4124,7 +4124,7 @@
Builder.CreateStore(CV, StoreCallResultAddrs[0]);
else if (unsigned NumResults = StoreCallResultAddrs.size()) {
for (unsigned i = 0; i != NumResults; ++i) {
- Value *ValI = Builder.CreateGetResult(CV, i, "asmresult");
+ Value *ValI = Builder.CreateExtractValue(CV, i, "asmresult");
Builder.CreateStore(ValI, StoreCallResultAddrs[i]);
}
}
More information about the llvm-commits
mailing list