[llvm-commits] [llvm-gcc-4.2] r50215 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h
Devang Patel
dpatel at apple.com
Thu Apr 24 10:48:02 PDT 2008
Author: dpatel
Date: Thu Apr 24 12:48:02 2008
New Revision: 50215
URL: http://llvm.org/viewvc/llvm-project?rev=50215&view=rev
Log:
Remove dead code.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=50215&r1=50214&r2=50215&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Thu Apr 24 12:48:02 2008
@@ -114,15 +114,6 @@
extern const Type *llvm_x86_aggr_type_for_struct_return(tree type);
-/* LLVM_BUILD_MULTIPLE_RETURN_VALUE - Build multiple return values
- for the function FN and add them in RETVALS. */
-#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,RetVals,B) \
- llvm_x86_build_multiple_return_value((Fn),(R),(RetVals),(B))
-
-extern void llvm_x86_build_multiple_return_value(Function *, Value *,
- SmallVectorImpl <Value *> &,
- IRBuilder &);
-
/* LLVM_EXTRACT_MULTIPLE_RETURN_VALUE - Extract multiple return value from
SRC and assign it to DEST. */
#define LLVM_EXTRACT_MULTIPLE_RETURN_VALUE(Src,Dest,V,B) \
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=50215&r1=50214&r2=50215&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 Thu Apr 24 12:48:02 2008
@@ -1121,131 +1121,6 @@
}
-// llvm_x86_build_multiple_return_value - Function FN returns multiple value
-// where RETVAL points to the aggregate being returned. Build a RETVALS vector
-// of individual values from RETVAL aggregate. RETVALS will be used by
-// the client to build multiple value return instruction.
-void llvm_x86_build_multiple_return_value(Function *Fn, Value *RetVal,
- SmallVectorImpl <Value *> &RetVals,
- IRBuilder &Builder) {
- const StructType *STy = cast<StructType>(Fn->getReturnType());
- const PointerType *PTy = cast<PointerType>(RetVal->getType());
- const StructType *RetSTy = cast<StructType>(PTy->getElementType());
-
- llvm::Value *Idxs[3];
- Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep");
- Value *E = Builder.CreateLoad(GEP, "mrv");
- Value *R = Builder.CreateBitCast(E, STy->getElementType(0), "tmp");
-
-
-
-
- // Walk RetSTy elements and populate RetVals vector. Note, STy and RetSTy
- // may not match. For example, when STy is { <2 x float> } the RetSTy is
- // { float[2]; }
- unsigned NumElements = RetSTy->getNumElements();
- unsigned RNO = 0;
- unsigned SNO = 0;
-
- if (NumElements == 3
- && RetSTy->getElementType(0)->getTypeID() == Type::FloatTyID
- && RetSTy->getElementType(1)->getTypeID() == Type::FloatTyID
- && RetSTy->getElementType(2)->getTypeID() == Type::FloatTyID) {
- Value *GEP0 = Builder.CreateStructGEP(RetVal, 0, "mrv_idx");
- Value *ElemVal0 = Builder.CreateLoad(GEP0, "mrv");
- Value *GEP1 = Builder.CreateStructGEP(RetVal, 1, "mrv_idx");
- Value *ElemVal1 = Builder.CreateLoad(GEP1, "mrv");
- Value *GEP2 = Builder.CreateStructGEP(RetVal, 2, "mrv_idx");
- Value *ElemVal2 = Builder.CreateLoad(GEP2, "mrv");
-
- Value *R = Constant::getNullValue(STy->getElementType(0));
- R = Builder.CreateInsertElement(R, ElemVal0,
- ConstantInt::get(llvm::Type::Int32Ty, 0),
- "mrv.f.");
- R = Builder.CreateInsertElement(R, ElemVal1,
- ConstantInt::get(llvm::Type::Int32Ty, 1),
- "mrv.f.");
- RetVals.push_back(R);
- RetVals.push_back(ElemVal2);
- return;
- }
-
- while (RNO < NumElements) {
- const Type *ElemType = RetSTy->getElementType(RNO);
- if (ElemType->isFirstClassType()) {
- Value *GEP = Builder.CreateStructGEP(RetVal, RNO, "mrv_idx");
- Value *ElemVal = Builder.CreateLoad(GEP, "mrv");
- RetVals.push_back(ElemVal);
- ++RNO;
- ++SNO;
- continue;
- }
-
- // Special treatement for _Complex.
- if (const StructType *ComplexType = dyn_cast<StructType>(ElemType)) {
- llvm::Value *Idxs[3];
- Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, RNO);
- Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep");
- RetVals.push_back(Builder.CreateLoad(GEP, "mrv"));
- Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, 1);
- GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep");
- RetVals.push_back(Builder.CreateLoad(GEP, "mrv"));
- ++RNO;
- ++SNO;
- continue;
- }
- const ArrayType *ATy = cast<ArrayType>(ElemType);
- unsigned ArraySize = ATy->getNumElements();
- // AElemNo keeps track of array elements. This may not match index (VElemNo)
- // that tracks vector elements when Src field type is VectorType..
- unsigned AElemNo = 0;
- while (AElemNo < ArraySize) {
- const Type *SElemTy = STy->getElementType(SNO);
- if (const VectorType *SVElemTy = dyn_cast<VectorType>(SElemTy)) {
- llvm::Value *Idxs[3];
- Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, RNO);
- Value *R = Constant::getNullValue(SElemTy);
- unsigned VElemNo = 0;
- unsigned Size = AElemNo + SVElemTy->getNumElements();
-
- // Only first two elements from <4 x float> are used, for example float[4] is
- // transformed into two <4 x float> vectors.
- if (SVElemTy->getElementType()->getTypeID() == Type::FloatTyID
- && Size == 4)
- Size = AElemNo + 2;
- while (AElemNo < Size) {
- Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, AElemNo);
- Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv.av.gep");
- Value *ElemVal = Builder.CreateLoad(GEP, "mrv");
- R = Builder.CreateInsertElement(R, ElemVal,
- ConstantInt::get(llvm::Type::Int32Ty, VElemNo++),
- "mrv.av.");
- AElemNo++;
- }
- RetVals.push_back(R);
- } else {
- llvm::Value *Idxs[3];
- Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0);
- Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, RNO);
- Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, AElemNo++);
- Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv.a.gep");
- Value *R = Builder.CreateLoad(GEP, "mrv.a");
- RetVals.push_back(R);
- }
- // Next Src field.
- ++SNO;
- }
- // Finished building this array field.
- RNO++;
- }
-}
-
// llvm_x86_extract_mrv_array_element - Helper function that help extract
// an array element from multiple return value.
//
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=50215&r1=50214&r2=50215&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Thu Apr 24 12:48:02 2008
@@ -307,20 +307,6 @@
getLLVMAggregateTypeForStructReturn(X)
#endif
-// LLVM_BUILD_MULTIPLE_RETURN_VALUE - Build multiple return values
-// for the function FN and add them in RETVALS. Each target that
-// supports multiple return value must implement this hook.
-#ifndef LLVM_BUILD_MULTIPLE_RETURN_VALUE
-#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,RetVals,B) \
- llvm_default_build_multiple_return_value((Fn),(R),(RetVals),(B))
-#endif
-
-static void llvm_default_build_multiple_return_value(Function *F, Value *RetVal,
- SmallVectorImpl<Value *> &RetVals,
- IRBuilder &Builder) {
- assert (0 && "LLVM_BUILD_MULTIPLE_RETURN_VALUE is not implemented!");
-}
-
// LLVM_EXTRACT_MULTIPLE_RETURN_VALUE - Extract multiple return value from
// SRC and assign it to DEST. Each target that supports multiple return
// value must implement this hook.
More information about the llvm-commits
mailing list