From baldrick at free.fr Mon Apr 14 01:48:48 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Apr 2008 06:48:48 -0000 Subject: [llvm-commits] [llvm] r49634 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.cpp LegalizeTypes.h LegalizeTypesExpand.cpp Message-ID: <200804140648.m3E6mnBX020080@zion.cs.uiuc.edu> Author: baldrick Date: Mon Apr 14 01:48:48 2008 New Revision: 49634 URL: http://llvm.org/viewvc/llvm-project?rev=49634&view=rev Log: Initial libcall support for LegalizeTypes. This is much simpler than in LegalizeDAG because calls are not yet expanded into call sequences: that happens after type legalization has finished. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=49634&r1=49633&r2=49634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Apr 14 01:48:48 2008 @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "LegalizeTypes.h" +#include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/CommandLine.h" @@ -524,6 +525,29 @@ SplitInteger(Op, HalfVT, HalfVT, Lo, Hi); } +/// MakeLibCall - Expand a node into a libcall and return the result. +SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, SDNode *N, + bool isSigned) { + TargetLowering::ArgListTy Args; + TargetLowering::ArgListEntry Entry; + for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { + MVT::ValueType ArgVT = N->getOperand(i).getValueType(); + Entry.Node = N->getOperand(i); + Entry.Ty = MVT::getTypeForValueType(ArgVT); + Entry.isSExt = isSigned; + Entry.isZExt = !isSigned; + Args.push_back(Entry); + } + SDOperand Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC), + TLI.getPointerTy()); + + const Type *RetTy = MVT::getTypeForValueType(N->getValueType(0)); + std::pair CallInfo = + TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false, + CallingConv::C, false, Callee, Args, DAG); + return CallInfo.first; +} + //===----------------------------------------------------------------------===// // Entry Point //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49634&r1=49633&r2=49634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Mon Apr 14 01:48:48 2008 @@ -169,6 +169,7 @@ void SplitInteger(SDOperand Op, SDOperand &Lo, SDOperand &Hi); void SplitInteger(SDOperand Op, MVT::ValueType LoVT, MVT::ValueType HiVT, SDOperand &Lo, SDOperand &Hi); + SDOperand MakeLibCall(RTLIB::Libcall LC, SDNode *N, bool isSigned); //===--------------------------------------------------------------------===// // Promotion Support: LegalizeTypesPromote.cpp @@ -262,6 +263,8 @@ void ExpandResult_TRUNCATE (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_UNDEF (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_ZERO_EXTEND(SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_FP_TO_SINT (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_FP_TO_UINT (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_Logical (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_BSWAP (SDNode *N, SDOperand &Lo, SDOperand &Hi); @@ -271,6 +274,10 @@ void ExpandResult_SELECT (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_SELECT_CC (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_MUL (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_SDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_SREM (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_UDIV (SDNode *N, SDOperand &Lo, SDOperand &Hi); + void ExpandResult_UREM (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandResult_Shift (SDNode *N, SDOperand &Lo, SDOperand &Hi); void ExpandShiftByConstant(SDNode *N, unsigned Amt, Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=49634&r1=49633&r2=49634&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Mon Apr 14 01:48:48 2008 @@ -64,6 +64,8 @@ case ISD::TRUNCATE: ExpandResult_TRUNCATE(N, Lo, Hi); break; case ISD::BIT_CONVERT: ExpandResult_BIT_CONVERT(N, Lo, Hi); break; case ISD::SIGN_EXTEND_INREG: ExpandResult_SIGN_EXTEND_INREG(N, Lo, Hi); break; + case ISD::FP_TO_SINT: ExpandResult_FP_TO_SINT(N, Lo, Hi); break; + case ISD::FP_TO_UINT: ExpandResult_FP_TO_UINT(N, Lo, Hi); break; case ISD::LOAD: ExpandResult_LOAD(cast(N), Lo, Hi); break; case ISD::AND: @@ -79,6 +81,10 @@ case ISD::SELECT: ExpandResult_SELECT(N, Lo, Hi); break; case ISD::SELECT_CC: ExpandResult_SELECT_CC(N, Lo, Hi); break; case ISD::MUL: ExpandResult_MUL(N, Lo, Hi); break; + case ISD::SDIV: ExpandResult_SDIV(N, Lo, Hi); break; + case ISD::SREM: ExpandResult_SREM(N, Lo, Hi); break; + case ISD::UDIV: ExpandResult_UDIV(N, Lo, Hi); break; + case ISD::UREM: ExpandResult_UREM(N, Lo, Hi); break; case ISD::SHL: case ISD::SRA: case ISD::SRL: ExpandResult_Shift(N, Lo, Hi); break; @@ -315,6 +321,62 @@ } } +void DAGTypeLegalizer::ExpandResult_FP_TO_SINT(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + MVT::ValueType VT = N->getValueType(0); + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i64) { + if (N->getOperand(0).getValueType() == MVT::f32) + LC = RTLIB::FPTOSINT_F32_I64; + else if (N->getOperand(0).getValueType() == MVT::f64) + LC = RTLIB::FPTOSINT_F64_I64; + else if (N->getOperand(0).getValueType() == MVT::f80) + LC = RTLIB::FPTOSINT_F80_I64; + else if (N->getOperand(0).getValueType() == MVT::ppcf128) + LC = RTLIB::FPTOSINT_PPCF128_I64; + } else if (VT == MVT::i128) { + if (N->getOperand(0).getValueType() == MVT::f32) + LC = RTLIB::FPTOSINT_F32_I128; + else if (N->getOperand(0).getValueType() == MVT::f64) + LC = RTLIB::FPTOSINT_F64_I128; + else if (N->getOperand(0).getValueType() == MVT::f80) + LC = RTLIB::FPTOSINT_F80_I128; + else if (N->getOperand(0).getValueType() == MVT::ppcf128) + LC = RTLIB::FPTOSINT_PPCF128_I128; + } else { + assert(0 && "Unexpected fp-to-sint conversion!"); + } + SplitInteger(MakeLibCall(LC, N, true/*sign irrelevant*/), Lo, Hi); +} + +void DAGTypeLegalizer::ExpandResult_FP_TO_UINT(SDNode *N, SDOperand &Lo, + SDOperand &Hi) { + MVT::ValueType VT = N->getValueType(0); + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; + if (VT == MVT::i64) { + if (N->getOperand(0).getValueType() == MVT::f32) + LC = RTLIB::FPTOUINT_F32_I64; + else if (N->getOperand(0).getValueType() == MVT::f64) + LC = RTLIB::FPTOUINT_F64_I64; + else if (N->getOperand(0).getValueType() == MVT::f80) + LC = RTLIB::FPTOUINT_F80_I64; + else if (N->getOperand(0).getValueType() == MVT::ppcf128) + LC = RTLIB::FPTOUINT_PPCF128_I64; + } else if (VT == MVT::i128) { + if (N->getOperand(0).getValueType() == MVT::f32) + LC = RTLIB::FPTOUINT_F32_I128; + else if (N->getOperand(0).getValueType() == MVT::f64) + LC = RTLIB::FPTOUINT_F64_I128; + else if (N->getOperand(0).getValueType() == MVT::f80) + LC = RTLIB::FPTOUINT_F80_I128; + else if (N->getOperand(0).getValueType() == MVT::ppcf128) + LC = RTLIB::FPTOUINT_PPCF128_I128; + } else { + assert(0 && "Unexpected fp-to-uint conversion!"); + } + SplitInteger(MakeLibCall(LC, N, false/*sign irrelevant*/), Lo, Hi); +} + void DAGTypeLegalizer::ExpandResult_LOAD(LoadSDNode *N, SDOperand &Lo, SDOperand &Hi) { MVT::ValueType VT = N->getValueType(0); @@ -614,6 +676,29 @@ #endif } +void DAGTypeLegalizer::ExpandResult_SDIV(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + assert(N->getValueType(0) == MVT::i64 && "Unsupported sdiv!"); + SplitInteger(MakeLibCall(RTLIB::SDIV_I64, N, true), Lo, Hi); +} + +void DAGTypeLegalizer::ExpandResult_SREM(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + assert(N->getValueType(0) == MVT::i64 && "Unsupported srem!"); + SplitInteger(MakeLibCall(RTLIB::SREM_I64, N, true), Lo, Hi); +} + +void DAGTypeLegalizer::ExpandResult_UDIV(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + assert(N->getValueType(0) == MVT::i64 && "Unsupported udiv!"); + SplitInteger(MakeLibCall(RTLIB::UDIV_I64, N, false), Lo, Hi); +} + +void DAGTypeLegalizer::ExpandResult_UREM(SDNode *N, + SDOperand &Lo, SDOperand &Hi) { + assert(N->getValueType(0) == MVT::i64 && "Unsupported urem!"); + SplitInteger(MakeLibCall(RTLIB::UREM_I64, N, false), Lo, Hi); +} void DAGTypeLegalizer::ExpandResult_Shift(SDNode *N, SDOperand &Lo, SDOperand &Hi) { From evan.cheng at apple.com Mon Apr 14 02:11:10 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Apr 2008 00:11:10 -0700 Subject: [llvm-commits] [llvm] r49593 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp In-Reply-To: References: <200804122212.m3CMCM2V031114@zion.cs.uiuc.edu> Message-ID: Seems like this could be a target independent option? Evan On Apr 12, 2008, at 4:49 PM, Chris Lattner wrote: > > On Apr 12, 2008, at 3:12 PM, Anton Korobeynikov wrote: > >> Author: asl >> Date: Sat Apr 12 17:12:22 2008 >> New Revision: 49593 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=49593&view=rev >> Log: >> Provide option for stack alignment override > > Is this temporary or permanent? Should it be cl::Hidden? > > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From asl at math.spbu.ru Mon Apr 14 03:12:55 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 14 Apr 2008 12:12:55 +0400 Subject: [llvm-commits] [llvm] r49593 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp In-Reply-To: References: <200804122212.m3CMCM2V031114@zion.cs.uiuc.edu> Message-ID: <1208160775.5348.29.camel@asl.dorms.spbu.ru> Hello, Evan > Seems like this could be a target independent option? Yes, we already discussed with Chris this. I'll fix soon. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From ggreif at gmail.com Mon Apr 14 04:12:15 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 09:12:15 -0000 Subject: [llvm-commits] [llvm] r49636 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804140912.m3E9CFJS032523@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 04:12:15 2008 New Revision: 49636 URL: http://llvm.org/viewvc/llvm-project?rev=49636&view=rev Log: ooops, gcc4.0.1 did not catch this, gcc3.4.6 did! Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49636&r1=49635&r2=49636&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Mon Apr 14 04:12:15 2008 @@ -936,7 +936,7 @@ /// @brief Construct a CallInst from a range of arguments template CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, - const std::string &Name = "", Instruction *InsertBefore); + const std::string &Name, Instruction *InsertBefore); /// Construct a CallInst given a range of arguments. InputIterator /// must be a random-access iterator pointing to contiguous storage From ggreif at gmail.com Mon Apr 14 05:12:54 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 10:12:54 -0000 Subject: [llvm-commits] [llvm] r49637 - /llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp Message-ID: <200804141012.m3EACsfa001967@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 05:12:53 2008 New Revision: 49637 URL: http://llvm.org/viewvc/llvm-project?rev=49637&view=rev Log: remove a bunch of unneeded const_casts. Modified: llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp Modified: llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp?rev=49637&r1=49636&r2=49637&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/ConstantFold.cpp Mon Apr 14 05:12:53 2008 @@ -332,10 +332,10 @@ if (const ConstantVector *CVal = dyn_cast(Val)) { if (const ConstantInt *CIdx = dyn_cast(Idx)) { - return const_cast(CVal->getOperand(CIdx->getZExtValue())); + return CVal->getOperand(CIdx->getZExtValue()); } else if (isa(Idx)) { // ee({w,x,y,z}, undef) -> w (an arbitrary value). - return const_cast(CVal->getOperand(0)); + return CVal->getOperand(0); } } return 0; @@ -401,7 +401,7 @@ /// return the specified element value. Otherwise return null. static Constant *GetVectorElement(const Constant *C, unsigned EltNo) { if (const ConstantVector *CV = dyn_cast(C)) - return const_cast(CV->getOperand(EltNo)); + return CV->getOperand(EltNo); const Type *EltTy = cast(C->getType())->getElementType(); if (isa(C)) @@ -1213,9 +1213,9 @@ if (const ConstantVector *CP2 = dyn_cast(C2)) { if (pred == FCmpInst::FCMP_OEQ || pred == FCmpInst::FCMP_UEQ) { for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) { - Constant *C= ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, - const_cast(CP1->getOperand(i)), - const_cast(CP2->getOperand(i))); + Constant *C = ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, + CP1->getOperand(i), + CP2->getOperand(i)); if (ConstantInt *CB = dyn_cast(C)) return CB; } @@ -1224,8 +1224,8 @@ } else if (pred == ICmpInst::ICMP_EQ) { for (unsigned i = 0, e = CP1->getNumOperands(); i != e; ++i) { Constant *C = ConstantExpr::getICmp(ICmpInst::ICMP_EQ, - const_cast(CP1->getOperand(i)), - const_cast(CP2->getOperand(i))); + CP1->getOperand(i), + CP2->getOperand(i)); if (ConstantInt *CB = dyn_cast(C)) return CB; } From ggreif at gmail.com Mon Apr 14 05:16:54 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 10:16:54 -0000 Subject: [llvm-commits] [llvm] r49638 - in /llvm/branches/ggreif/use-diet/include/llvm: Constants.h OperandTraits.h Message-ID: <200804141016.m3EAGsfj002105@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 05:16:54 2008 New Revision: 49638 URL: http://llvm.org/viewvc/llvm-project?rev=49638&view=rev Log: introduce (and use) DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS for safe, covariant getOperand() Modified: llvm/branches/ggreif/use-diet/include/llvm/Constants.h llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Constants.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Constants.h?rev=49638&r1=49637&r2=49638&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Constants.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Constants.h Mon Apr 14 05:16:54 2008 @@ -22,6 +22,7 @@ #include "llvm/Constant.h" #include "llvm/Type.h" +#include "llvm/OperandTraits.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APFloat.h" @@ -332,7 +333,7 @@ static Constant *get(const std::string &Initializer, bool AddNull = true); /// Transparently provide more efficient getOperand methods. - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); /// getType - Specialize the getType() method to always return an ArrayType, /// which reduces the amount of casting needed in parts of the compiler. @@ -376,7 +377,7 @@ struct OperandTraits : VariadicOperandTraits<> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantArray, Value) +DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantArray, Constant) //===----------------------------------------------------------------------===// // ConstantStruct - Constant Struct Declarations @@ -400,7 +401,7 @@ } /// Transparently provide more efficient getOperand methods. - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); /// getType() specialization - Reduce amount of casting... /// @@ -429,7 +430,7 @@ struct OperandTraits : VariadicOperandTraits<> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantStruct, Value) +DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantStruct, Constant) //===----------------------------------------------------------------------===// /// ConstantVector - Constant Vector Declarations @@ -451,7 +452,7 @@ } /// Transparently provide more efficient getOperand methods. - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); /// getType - Specialize the getType() method to always return a VectorType, /// which reduces the amount of casting needed in parts of the compiler. @@ -494,7 +495,7 @@ struct OperandTraits : VariadicOperandTraits<> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantVector, Value) +DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantVector, Constant) //===----------------------------------------------------------------------===// /// ConstantPointerNull - a constant pointer value that points to null @@ -733,13 +734,13 @@ virtual void destroyConstant(); virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U); - /// Override methods to provide more type information... +/* /// Override methods to provide more type information... inline Constant *getOperand(unsigned i) { return cast(User::getOperand(i)); } inline Constant *getOperand(unsigned i) const { return const_cast(cast(User::getOperand(i))); - } + }*/ /// Methods for support type inquiry through isa, cast, and dyn_cast: @@ -753,7 +754,7 @@ struct OperandTraits : VariadicOperandTraits<1> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantExpr, Constant) +DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantExpr, Constant) //===----------------------------------------------------------------------===// /// UndefValue - 'undef' values are things that do not have specified contents. Modified: llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h?rev=49638&r1=49637&r2=49638&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Mon Apr 14 05:16:54 2008 @@ -106,7 +106,27 @@ #define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ VALUECLASS *CLASS::getOperand(unsigned i) const { \ assert(i < OperandTraits::operands(this) && "getOperand() out of range!"); \ - return OperandTraits::op_begin(const_cast(this))[i]; \ + return static_cast(OperandTraits::op_begin(const_cast(this))[i]); \ +} \ +void CLASS::setOperand(unsigned i, VALUECLASS *Val) { \ + assert(i < OperandTraits::operands(this) && "setOperand() out of range!"); \ + OperandTraits::op_begin(this)[i] = Val; \ +} \ +unsigned CLASS::getNumOperands() const { return OperandTraits::operands(this); } \ +template Use &CLASS::Op() { \ + return OperandTraits::op_begin(this)[Idx]; \ +} \ +template const Use &CLASS::Op() const { \ + return OperandTraits::op_begin(const_cast(this))[Idx]; \ +} + + +/// Macro for generating out-of-class operand accessor +/// definitions with casted result +#define DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ +VALUECLASS *CLASS::getOperand(unsigned i) const { \ + assert(i < OperandTraits::operands(this) && "getOperand() out of range!"); \ + return cast(OperandTraits::op_begin(const_cast(this))[i]); \ } \ void CLASS::setOperand(unsigned i, VALUECLASS *Val) { \ assert(i < OperandTraits::operands(this) && "setOperand() out of range!"); \ From ggreif at gmail.com Mon Apr 14 05:25:47 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 10:25:47 -0000 Subject: [llvm-commits] [llvm] r49639 - /llvm/branches/ggreif/use-diet/include/llvm/Constants.h Message-ID: <200804141025.m3EAPllq002487@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 05:25:47 2008 New Revision: 49639 URL: http://llvm.org/viewvc/llvm-project?rev=49639&view=rev Log: custom dtors no more needed Modified: llvm/branches/ggreif/use-diet/include/llvm/Constants.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Constants.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Constants.h?rev=49639&r1=49638&r2=49639&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Constants.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Constants.h Mon Apr 14 05:25:47 2008 @@ -314,7 +314,6 @@ ConstantArray(const ConstantArray &); // DO NOT IMPLEMENT protected: ConstantArray(const ArrayType *T, const std::vector &Val); - ~ConstantArray(); public: /// get() - Static factory methods - Return objects of the specified value static Constant *get(const ArrayType *T, const std::vector &); @@ -388,7 +387,6 @@ ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT protected: ConstantStruct(const StructType *T, const std::vector &Val); - ~ConstantStruct(); public: /// get() - Static factory methods - Return objects of the specified value /// @@ -441,7 +439,6 @@ ConstantVector(const ConstantVector &); // DO NOT IMPLEMENT protected: ConstantVector(const VectorType *T, const std::vector &Val); - ~ConstantVector(); public: /// get() - Static factory methods - Return objects of the specified value static Constant *get(const VectorType *T, const std::vector &); From ggreif at gmail.com Mon Apr 14 06:49:50 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 11:49:50 -0000 Subject: [llvm-commits] [llvm] r49640 - /llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp Message-ID: <200804141149.m3EBnpTE004946@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 06:49:42 2008 New Revision: 49640 URL: http://llvm.org/viewvc/llvm-project?rev=49640&view=rev Log: cosmetics Modified: llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp Modified: llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp?rev=49640&r1=49639&r2=49640&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp (original) +++ llvm/branches/ggreif/use-diet/tools/llvm2cpp/CppWriter.cpp Mon Apr 14 06:49:42 2008 @@ -1082,9 +1082,12 @@ switch (I->getOpcode()) { case Instruction::Ret: { - const ReturnInst* ret = cast(I); + const ReturnInst* ret = cast(I); Out << "new ReturnInst(" - << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");"; + << (ret->getReturnValue() + ? opNames[0] + ", " + : "") + << bbname << ");"; break; } case Instruction::Br: { From ggreif at gmail.com Mon Apr 14 06:51:54 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 11:51:54 -0000 Subject: [llvm-commits] [llvm] r49641 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804141151.m3EBpsEE005018@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 06:51:53 2008 New Revision: 49641 URL: http://llvm.org/viewvc/llvm-project?rev=49641&view=rev Log: do not assert when a nonexisting return value is asked for, just return NULL Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49641&r1=49640&r2=49641&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Mon Apr 14 06:51:53 2008 @@ -1598,7 +1598,9 @@ /// Convenience accessor Value *getReturnValue(unsigned n = 0) const { - return getOperand(n); + return n < getNumOperands() + ? getOperand(n) + : 0; } unsigned getNumSuccessors() const { return 0; } From ggreif at gmail.com Mon Apr 14 08:10:23 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 13:10:23 -0000 Subject: [llvm-commits] [llvm] r49642 - /llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Message-ID: <200804141310.m3EDANj0007122@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 08:10:21 2008 New Revision: 49642 URL: http://llvm.org/viewvc/llvm-project?rev=49642&view=rev Log: when expanding Op<> member template, make it less probable that name capture occurs. C++ compilers should warn on this! Modified: llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Modified: llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h?rev=49642&r1=49641&r2=49642&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Mon Apr 14 08:10:21 2008 @@ -99,8 +99,8 @@ inline VALUECLASS *getOperand(unsigned) const; \ inline void setOperand(unsigned, VALUECLASS*); \ inline unsigned getNumOperands() const; \ - template inline Use &Op(); \ - template inline const Use &Op() const + template inline Use &Op(); \ + template inline const Use &Op() const /// Macro for generating out-of-class operand accessor definitions #define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ @@ -113,11 +113,11 @@ OperandTraits::op_begin(this)[i] = Val; \ } \ unsigned CLASS::getNumOperands() const { return OperandTraits::operands(this); } \ -template Use &CLASS::Op() { \ - return OperandTraits::op_begin(this)[Idx]; \ +template Use &CLASS::Op() { \ + return OperandTraits::op_begin(this)[Idx_nocapture]; \ } \ -template const Use &CLASS::Op() const { \ - return OperandTraits::op_begin(const_cast(this))[Idx]; \ +template const Use &CLASS::Op() const { \ + return OperandTraits::op_begin(const_cast(this))[Idx_nocapture]; \ } @@ -133,11 +133,11 @@ OperandTraits::op_begin(this)[i] = Val; \ } \ unsigned CLASS::getNumOperands() const { return OperandTraits::operands(this); } \ -template Use &CLASS::Op() { \ - return OperandTraits::op_begin(this)[Idx]; \ +template Use &CLASS::Op() { \ + return OperandTraits::op_begin(this)[Idx_nocapture]; \ } \ -template const Use &CLASS::Op() const { \ - return OperandTraits::op_begin(const_cast(this))[Idx]; \ +template const Use &CLASS::Op() const { \ + return OperandTraits::op_begin(const_cast(this))[Idx_nocapture]; \ } From ggreif at gmail.com Mon Apr 14 08:18:10 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 13:18:10 -0000 Subject: [llvm-commits] [llvm] r49643 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804141318.m3EDIAFa007311@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 08:18:10 2008 New Revision: 49643 URL: http://llvm.org/viewvc/llvm-project?rev=49643&view=rev Log: explicit is of little use here Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49643&r1=49642&r2=49643&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Mon Apr 14 08:18:10 2008 @@ -2671,9 +2671,9 @@ void *operator new(size_t s) { return User::operator new(s, 1); } - explicit GetResultInst(Value *Aggr, unsigned index, - const std::string &Name = "", - Instruction *InsertBefore = 0); + GetResultInst(Value *Aggr, unsigned index, + const std::string &Name = "", + Instruction *InsertBefore = 0); /// isValidOperands - Return true if an getresult instruction can be /// formed with the specified operands. From ggreif at gmail.com Mon Apr 14 08:54:08 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 13:54:08 -0000 Subject: [llvm-commits] [llvm] r49644 - /llvm/branches/ggreif/use-diet/include/llvm/Instruction.h Message-ID: <200804141354.m3EDs8Ie008266@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 08:54:08 2008 New Revision: 49644 URL: http://llvm.org/viewvc/llvm-project?rev=49644&view=rev Log: remove unneeded forward decl Modified: llvm/branches/ggreif/use-diet/include/llvm/Instruction.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instruction.h?rev=49644&r1=49643&r2=49644&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instruction.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instruction.h Mon Apr 14 08:54:08 2008 @@ -20,7 +20,6 @@ namespace llvm { struct AssemblyAnnotationWriter; -class BinaryOperator; template class SymbolTableListTraits; From gohman at apple.com Mon Apr 14 10:07:08 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 15:07:08 -0000 Subject: [llvm-commits] [llvm] r49646 - /llvm/trunk/lib/VMCore/Instruction.cpp Message-ID: <200804141507.m3EF78lu010307@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 10:07:08 2008 New Revision: 49646 URL: http://llvm.org/viewvc/llvm-project?rev=49646&view=rev Log: VAArg may trap. Modified: llvm/trunk/lib/VMCore/Instruction.cpp Modified: llvm/trunk/lib/VMCore/Instruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=49646&r1=49645&r2=49646&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instruction.cpp (original) +++ llvm/trunk/lib/VMCore/Instruction.cpp Mon Apr 14 10:07:08 2008 @@ -266,6 +266,7 @@ case Store: case Call: case Invoke: + case VAArg: return true; default: return false; From sabre at nondot.org Mon Apr 14 11:44:43 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Apr 2008 16:44:43 -0000 Subject: [llvm-commits] [llvm] r49648 - in /llvm/trunk/docs/tutorial: LangImpl2.html LangImpl3.html LangImpl4.html LangImpl5.html LangImpl6.html LangImpl7.html Message-ID: <200804141644.m3EGiixi013033@zion.cs.uiuc.edu> Author: lattner Date: Mon Apr 14 11:44:41 2008 New Revision: 49648 URL: http://llvm.org/viewvc/llvm-project?rev=49648&view=rev Log: improve diagnostics in call parsing, patch suggested by Matthijs Kooijman Modified: llvm/trunk/docs/tutorial/LangImpl2.html llvm/trunk/docs/tutorial/LangImpl3.html llvm/trunk/docs/tutorial/LangImpl4.html llvm/trunk/docs/tutorial/LangImpl5.html llvm/trunk/docs/tutorial/LangImpl6.html llvm/trunk/docs/tutorial/LangImpl7.html Modified: llvm/trunk/docs/tutorial/LangImpl2.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl2.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl2.html (original) +++ llvm/trunk/docs/tutorial/LangImpl2.html Mon Apr 14 11:44:41 2008 @@ -337,7 +337,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } @@ -1007,7 +1007,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } Modified: llvm/trunk/docs/tutorial/LangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl3.html (original) +++ llvm/trunk/docs/tutorial/LangImpl3.html Mon Apr 14 11:44:41 2008 @@ -881,7 +881,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } Modified: llvm/trunk/docs/tutorial/LangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl4.html (original) +++ llvm/trunk/docs/tutorial/LangImpl4.html Mon Apr 14 11:44:41 2008 @@ -714,7 +714,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } Modified: llvm/trunk/docs/tutorial/LangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl5.html (original) +++ llvm/trunk/docs/tutorial/LangImpl5.html Mon Apr 14 11:44:41 2008 @@ -1137,7 +1137,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } Modified: llvm/trunk/docs/tutorial/LangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl6.html (original) +++ llvm/trunk/docs/tutorial/LangImpl6.html Mon Apr 14 11:44:41 2008 @@ -1085,7 +1085,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } Modified: llvm/trunk/docs/tutorial/LangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=49648&r1=49647&r2=49648&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl7.html (original) +++ llvm/trunk/docs/tutorial/LangImpl7.html Mon Apr 14 11:44:41 2008 @@ -1286,7 +1286,7 @@ if (CurTok == ')') break; if (CurTok != ',') - return Error("Expected ')'"); + return Error("Expected ')' or ',' in argument list"); getNextToken(); } } From nicolas.geoffray at lip6.fr Mon Apr 14 11:46:23 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 14 Apr 2008 16:46:23 -0000 Subject: [llvm-commits] [vmkit] r49649 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathConstructor.cpp Classpath/ClasspathMethod.cpp Classpath/ClasspathVMClass.cpp Classpath/ClasspathVMSystemProperties.cpp Classpath/ClasspathVMThread.cpp Classpath/ClasspathVMThrowable.cpp VMCore/JavaClass.h VMCore/JavaIsolate.cpp VMCore/JavaMetaJIT.cpp VMCore/JavaTypes.cpp VMCore/JavaUpcalls.cpp VMCore/Jni.cpp VMCore/Jnjvm.cpp Message-ID: <200804141646.m3EGkOIo013119@zion.cs.uiuc.edu> Author: geoffray Date: Mon Apr 14 11:46:23 2008 New Revision: 49649 URL: http://llvm.org/viewvc/llvm-project?rev=49649&view=rev Log: Calling a Java function from the vm requires an extra argument: the vm Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathConstructor.cpp Mon Apr 14 11:46:23 2008 @@ -79,7 +79,7 @@ JavaObject* excp = 0; try { - meth->invokeIntSpecialBuf(res, _buf); + meth->invokeIntSpecialBuf(vm, res, _buf); }catch(...) { excp = JavaThread::getJavaException(); JavaThread::clearException(); Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathMethod.cpp Mon Apr 14 11:46:23 2008 @@ -100,12 +100,12 @@ try{ \ if (isVirtual(meth->access)) { \ if (isPublic(meth->access)) { \ - val = meth->invoke##TYPE##VirtualBuf(obj, _buf); \ + val = meth->invoke##TYPE##VirtualBuf(vm, obj, _buf); \ } else { \ - val = meth->invoke##TYPE##SpecialBuf(obj, _buf); \ + val = meth->invoke##TYPE##SpecialBuf(vm, obj, _buf); \ } \ } else { \ - val = meth->invoke##TYPE##StaticBuf(_buf); \ + val = meth->invoke##TYPE##StaticBuf(vm, _buf); \ } \ }catch(...) { \ exc = JavaThread::getJavaException(); \ Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp Mon Apr 14 11:46:23 2008 @@ -101,7 +101,7 @@ JavaMethod* meth = *i; // TODO: check parameter types JavaObject* tmp = (*Classpath::newConstructor)(vm); - Classpath::initConstructor->invokeIntSpecial(tmp, Cl, meth); + Classpath::initConstructor->invokeIntSpecial(vm, tmp, Cl, meth); ret->setAt(index, tmp); } return (jobject)ret; @@ -146,7 +146,8 @@ JavaMethod* meth = *i; // TODO: check parameter types JavaObject* tmp = (*Classpath::newMethod)(vm); - Classpath::initMethod->invokeIntSpecial(tmp, Cl, vm->UTF8ToStr(meth->name), meth); + Classpath::initMethod->invokeIntSpecial(vm, tmp, Cl, + vm->UTF8ToStr(meth->name), meth); ret->setAt(index, tmp); } return (jobject)ret; @@ -316,14 +317,16 @@ } } - ArrayObject* ret = ArrayObject::acons(res.size(), Classpath::fieldArrayClass, vm); + ArrayObject* ret = ArrayObject::acons(res.size(), + Classpath::fieldArrayClass, vm); sint32 index = 0; for (std::vector::iterator i = res.begin(), e = res.end(); i != e; ++i, ++index) { JavaField* field = *i; // TODO: check parameter types JavaObject* tmp = (*Classpath::newField)(vm); - Classpath::initField->invokeIntSpecial(tmp, Cl, vm->UTF8ToStr(field->name), field); + Classpath::initField->invokeIntSpecial(vm, tmp, Cl, + vm->UTF8ToStr(field->name), field); ret->setAt(index, tmp); } return (jobject)ret; Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMSystemProperties.cpp Mon Apr 14 11:46:23 2008 @@ -30,7 +30,8 @@ static void setProperty(Jnjvm* vm, JavaObject* prop, const char* key, const char* val) { - Classpath::setProperty->invokeIntSpecial(prop, vm->asciizToStr(key), vm->asciizToStr(val)); + Classpath::setProperty->invokeIntSpecial(vm, prop, vm->asciizToStr(key), + vm->asciizToStr(val)); } static void setUnameProp(Jnjvm* vm, JavaObject* prop) { Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp Mon Apr 14 11:46:23 2008 @@ -64,7 +64,7 @@ } JavaMethod* method = vmthClass->lookupMethod(Jnjvm::runName, Jnjvm::clinitType, ACC_VIRTUAL, true); - method->invokeIntSpecial(vmThread); + method->invokeIntSpecial(isolate, vmThread); if (!isDaemon) { Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp Mon Apr 14 11:46:23 2008 @@ -49,7 +49,7 @@ ArrayUInt32* obj = ArrayUInt32::acons(real_size, JavaArray::ofInt, vm); memcpy(obj->elements, stack, real_size * sizeof(int)); JavaObject* vmThrowable = (*Classpath::newVMThrowable)(vm); - Classpath::initVMThrowable->invokeIntSpecial(vmThrowable); + Classpath::initVMThrowable->invokeIntSpecial(vm, vmThrowable); (*Classpath::vmDataVMThrowable)(vmThrowable, obj); return (jobject)vmThrowable; } @@ -74,7 +74,9 @@ bool native = isNative(meth->access); JavaObject* res = (*Classpath::newStackTraceElement)(vm); - Classpath::initStackTraceElement->invokeIntSpecial(res, sourceName, (uint32)ip, className, methodName, native); + Classpath::initStackTraceElement->invokeIntSpecial(vm, res, sourceName, + (uint32)ip, className, + methodName, native); return res; } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Mon Apr 14 11:46:23 2008 @@ -255,59 +255,59 @@ void* compiledPtr(); const llvm::FunctionType* llvmType; - uint32 invokeIntSpecialAP(JavaObject* obj, va_list ap); - float invokeFloatSpecialAP(JavaObject* obj, va_list ap); - double invokeDoubleSpecialAP(JavaObject* obj, va_list ap); - sint64 invokeLongSpecialAP(JavaObject* obj, va_list ap); - JavaObject* invokeJavaObjectSpecialAP(JavaObject* obj, va_list ap); - - uint32 invokeIntVirtualAP(JavaObject* obj, va_list ap); - float invokeFloatVirtualAP(JavaObject* obj, va_list ap); - double invokeDoubleVirtualAP(JavaObject* obj, va_list ap); - sint64 invokeLongVirtualAP(JavaObject* obj, va_list ap); - JavaObject* invokeJavaObjectVirtualAP(JavaObject* obj, va_list ap); - - uint32 invokeIntStaticAP(va_list ap); - float invokeFloatStaticAP(va_list ap); - double invokeDoubleStaticAP(va_list ap); - sint64 invokeLongStaticAP(va_list ap); - JavaObject* invokeJavaObjectStaticAP(va_list ap); - - uint32 invokeIntSpecialBuf(JavaObject* obj, void* buf); - float invokeFloatSpecialBuf(JavaObject* obj, void* buf); - double invokeDoubleSpecialBuf(JavaObject* obj, void* buf); - sint64 invokeLongSpecialBuf(JavaObject* obj, void* buf); - JavaObject* invokeJavaObjectSpecialBuf(JavaObject* obj, void* buf); - - uint32 invokeIntVirtualBuf(JavaObject* obj, void* buf); - float invokeFloatVirtualBuf(JavaObject* obj, void* buf); - double invokeDoubleVirtualBuf(JavaObject* obj, void* buf); - sint64 invokeLongVirtualBuf(JavaObject* obj, void* buf); - JavaObject* invokeJavaObjectVirtualBuf(JavaObject* obj, void* buf); - - uint32 invokeIntStaticBuf(void* buf); - float invokeFloatStaticBuf(void* buf); - double invokeDoubleStaticBuf(void* buf); - sint64 invokeLongStaticBuf(void* buf); - JavaObject* invokeJavaObjectStaticBuf(void* buf); - - uint32 invokeIntSpecial(JavaObject* obj, ...); - float invokeFloatSpecial(JavaObject* obj, ...); - double invokeDoubleSpecial(JavaObject* obj, ...); - sint64 invokeLongSpecial(JavaObject* obj, ...); - JavaObject* invokeJavaObjectSpecial(JavaObject* obj, ...); - - uint32 invokeIntVirtual(JavaObject* obj, ...); - float invokeFloatVirtual(JavaObject* obj, ...); - double invokeDoubleVirtual(JavaObject* obj, ...); - sint64 invokeLongVirtual(JavaObject* obj, ...); - JavaObject* invokeJavaObjectVirtual(JavaObject* obj, ...); - - uint32 invokeIntStatic(...); - float invokeFloatStatic(...); - double invokeDoubleStatic(...); - sint64 invokeLongStatic(...); - JavaObject* invokeJavaObjectStatic(...); + uint32 invokeIntSpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap); + float invokeFloatSpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap); + double invokeDoubleSpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap); + sint64 invokeLongSpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap); + JavaObject* invokeJavaObjectSpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap); + + uint32 invokeIntVirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap); + float invokeFloatVirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap); + double invokeDoubleVirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap); + sint64 invokeLongVirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap); + JavaObject* invokeJavaObjectVirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap); + + uint32 invokeIntStaticAP(Jnjvm* vm, va_list ap); + float invokeFloatStaticAP(Jnjvm* vm, va_list ap); + double invokeDoubleStaticAP(Jnjvm* vm, va_list ap); + sint64 invokeLongStaticAP(Jnjvm* vm, va_list ap); + JavaObject* invokeJavaObjectStaticAP(Jnjvm* vm, va_list ap); + + uint32 invokeIntSpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf); + float invokeFloatSpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf); + double invokeDoubleSpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf); + sint64 invokeLongSpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf); + JavaObject* invokeJavaObjectSpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf); + + uint32 invokeIntVirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf); + float invokeFloatVirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf); + double invokeDoubleVirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf); + sint64 invokeLongVirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf); + JavaObject* invokeJavaObjectVirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf); + + uint32 invokeIntStaticBuf(Jnjvm* vm, void* buf); + float invokeFloatStaticBuf(Jnjvm* vm, void* buf); + double invokeDoubleStaticBuf(Jnjvm* vm, void* buf); + sint64 invokeLongStaticBuf(Jnjvm* vm, void* buf); + JavaObject* invokeJavaObjectStaticBuf(Jnjvm* vm, void* buf); + + uint32 invokeIntSpecial(Jnjvm* vm, JavaObject* obj, ...); + float invokeFloatSpecial(Jnjvm* vm, JavaObject* obj, ...); + double invokeDoubleSpecial(Jnjvm* vm, JavaObject* obj, ...); + sint64 invokeLongSpecial(Jnjvm* vm, JavaObject* obj, ...); + JavaObject* invokeJavaObjectSpecial(Jnjvm* vm, JavaObject* obj, ...); + + uint32 invokeIntVirtual(Jnjvm* vm, JavaObject* obj, ...); + float invokeFloatVirtual(Jnjvm* vm, JavaObject* obj, ...); + double invokeDoubleVirtual(Jnjvm* vm, JavaObject* obj, ...); + sint64 invokeLongVirtual(Jnjvm* vm, JavaObject* obj, ...); + JavaObject* invokeJavaObjectVirtual(Jnjvm* vm, JavaObject* obj, ...); + + uint32 invokeIntStatic(Jnjvm* vm, ...); + float invokeFloatStatic(Jnjvm* vm, ...); + double invokeDoubleStatic(Jnjvm* vm, ...); + sint64 invokeLongStatic(Jnjvm* vm, ...); + JavaObject* invokeJavaObjectStatic(Jnjvm* vm, ...); }; class JavaField : public mvm::Object { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Mon Apr 14 11:46:23 2008 @@ -304,7 +304,7 @@ JavaObject* JavaIsolate::loadAppClassLoader() { if (appClassLoader == 0) { - appClassLoader = Classpath::getSystemClassLoader->invokeJavaObjectStatic(); + appClassLoader = Classpath::getSystemClassLoader->invokeJavaObjectStatic(this); } return appClassLoader; } @@ -316,7 +316,8 @@ void JavaIsolate::loadBootstrap() { mapInitialThread(); loadAppClassLoader(); - Classpath::setContextClassLoader->invokeIntSpecial(JavaThread::currentThread(), appClassLoader); + JavaObject* obj = JavaThread::currentThread(); + Classpath::setContextClassLoader->invokeIntSpecial(this, obj, appClassLoader); // load and initialise math since it is responsible for dlopen'ing // libjavalang.so and we are optimizing some math operations loadName(asciizConstructUTF8("java/lang/Math"), @@ -334,9 +335,11 @@ if (exc) { JavaThread::clearException(); JavaObject* obj = JavaThread::currentThread(); - JavaObject* group = (JavaObject*)((*obj)(ClasspathThread::group)).PointerVal; + JavaObject* group = + (JavaObject*)((*obj)(ClasspathThread::group)).PointerVal; try{ - ClasspathThread::uncaughtException->invokeIntSpecial(group, obj, exc); + ClasspathThread::uncaughtException->invokeIntSpecial(this, group, obj, + exc); }catch(...) { printf("Even uncaught exception throwed an exception!\n"); assert(0); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp Mon Apr 14 11:46:23 2008 @@ -163,10 +163,10 @@ va_list ap; va_start(ap, access); if (stat) { - method->invokeIntStaticAP(ap); + method->invokeIntStaticAP(vm, ap); } else { JavaObject* obj = va_arg(ap, JavaObject*); - method->invokeIntSpecialAP(obj, ap); + method->invokeIntSpecialAP(vm, obj, ap); } va_end(ap); } @@ -463,7 +463,7 @@ #if 1//defined(__PPC__) && !defined(__MACH__) #define INVOKE(TYPE, TYPE_NAME, FUNC_TYPE_VIRTUAL_AP, FUNC_TYPE_STATIC_AP, FUNC_TYPE_VIRTUAL_BUF, FUNC_TYPE_STATIC_BUF) \ \ -TYPE JavaMethod::invoke##TYPE_NAME##VirtualAP(JavaObject* obj, va_list ap) { \ +TYPE JavaMethod::invoke##TYPE_NAME##VirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap) { \ if (!classDef->isReady()) \ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true); \ \ @@ -474,10 +474,10 @@ void* _buf = (void*)buf; \ readArgs(buf, signature, ap); \ void* func = meth->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, _buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, _buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##SpecialAP(JavaObject* obj, va_list ap) {\ +TYPE JavaMethod::invoke##TYPE_NAME##SpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ @@ -486,10 +486,10 @@ void* _buf = (void*)buf; \ readArgs(buf, signature, ap); \ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, _buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, _buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##StaticAP(va_list ap) {\ +TYPE JavaMethod::invoke##TYPE_NAME##StaticAP(Jnjvm* vm, va_list ap) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ @@ -497,10 +497,10 @@ void* _buf = (void*)buf; \ readArgs(buf, signature, ap); \ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(func, _buf);\ + return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(vm, func, _buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##VirtualBuf(JavaObject* obj, void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##VirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ @@ -508,46 +508,46 @@ JavaMethod* meth = obj->classOf->lookupMethod(name, type, false, true);\ \ void* func = meth->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##SpecialBuf(JavaObject* obj, void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##SpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ verifyNull(obj);\ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##StaticBuf(void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##StaticBuf(Jnjvm* vm, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(func, buf);\ + return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(vm, func, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Virtual(JavaObject* obj, ...) { \ +TYPE JavaMethod::invoke##TYPE_NAME##Virtual(Jnjvm* vm, JavaObject* obj, ...) { \ va_list ap;\ va_start(ap, obj);\ - TYPE res = invoke##TYPE_NAME##VirtualAP(obj, ap);\ + TYPE res = invoke##TYPE_NAME##VirtualAP(vm, obj, ap);\ va_end(ap); \ return res; \ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Special(JavaObject* obj, ...) {\ +TYPE JavaMethod::invoke##TYPE_NAME##Special(Jnjvm* vm, JavaObject* obj, ...) {\ va_list ap;\ va_start(ap, obj);\ - TYPE res = invoke##TYPE_NAME##SpecialAP(obj, ap);\ + TYPE res = invoke##TYPE_NAME##SpecialAP(vm, obj, ap);\ va_end(ap); \ return res; \ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Static(...) {\ +TYPE JavaMethod::invoke##TYPE_NAME##Static(Jnjvm* vm, ...) {\ va_list ap;\ - va_start(ap, this);\ - TYPE res = invoke##TYPE_NAME##StaticAP(ap);\ + va_start(ap, vm);\ + TYPE res = invoke##TYPE_NAME##StaticAP(vm, ap);\ va_end(ap); \ return res; \ }\ @@ -556,7 +556,7 @@ #define INVOKE(TYPE, TYPE_NAME, FUNC_TYPE_VIRTUAL_AP, FUNC_TYPE_STATIC_AP, FUNC_TYPE_VIRTUAL_BUF, FUNC_TYPE_STATIC_BUF) \ \ -TYPE JavaMethod::invoke##TYPE_NAME##VirtualAP(JavaObject* obj, va_list ap) { \ +TYPE JavaMethod::invoke##TYPE_NAME##VirtualAP(Jnjvm* vm, JavaObject* obj, va_list ap) { \ if (!classDef->isReady()) \ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true); \ \ @@ -564,27 +564,27 @@ JavaMethod* meth = obj->classOf->lookupMethod(name, type, false, true); \ \ void* func = meth->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_AP)signature->virtualCallAP())(func, obj, ap);\ + return ((FUNC_TYPE_VIRTUAL_AP)signature->virtualCallAP())(vm, func, obj, ap);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##SpecialAP(JavaObject* obj, va_list ap) {\ +TYPE JavaMethod::invoke##TYPE_NAME##SpecialAP(Jnjvm* vm, JavaObject* obj, va_list ap) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ verifyNull(obj);\ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_AP)signature->virtualCallAP())(func, obj, ap);\ + return ((FUNC_TYPE_VIRTUAL_AP)signature->virtualCallAP())(vm, func, obj, ap);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##StaticAP(va_list ap) {\ +TYPE JavaMethod::invoke##TYPE_NAME##StaticAP(Jnjvm* vm, va_list ap) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_STATIC_AP)signature->staticCallAP())(func, ap);\ + return ((FUNC_TYPE_STATIC_AP)signature->staticCallAP())(vm, func, ap);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##VirtualBuf(JavaObject* obj, void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##VirtualBuf(Jnjvm* vm, JavaObject* obj, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ @@ -592,75 +592,75 @@ JavaMethod* meth = obj->classOf->lookupMethod(name, type, false, true);\ \ void* func = meth->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##SpecialBuf(JavaObject* obj, void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##SpecialBuf(Jnjvm* vm, JavaObject* obj, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ verifyNull(obj);\ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(func, obj, buf);\ + return ((FUNC_TYPE_VIRTUAL_BUF)signature->virtualCallBuf())(vm, func, obj, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##StaticBuf(void* buf) {\ +TYPE JavaMethod::invoke##TYPE_NAME##StaticBuf(Jnjvm* vm, void* buf) {\ if (!classDef->isReady())\ classDef->isolate->loadName(classDef->name, classDef->classLoader, true, true, true);\ \ void* func = this->compiledPtr();\ - return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(func, buf);\ + return ((FUNC_TYPE_STATIC_BUF)signature->staticCallBuf())(vm, func, buf);\ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Virtual(JavaObject* obj, ...) { \ +TYPE JavaMethod::invoke##TYPE_NAME##Virtual(Jnjvm* vm,JavaObject* obj, ...) { \ va_list ap;\ va_start(ap, obj);\ - TYPE res = invoke##TYPE_NAME##VirtualAP(obj, ap);\ + TYPE res = invoke##TYPE_NAME##VirtualAP(vm, obj, ap);\ va_end(ap); \ return res; \ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Special(JavaObject* obj, ...) {\ +TYPE JavaMethod::invoke##TYPE_NAME##Special(Jnjvm* vm, JavaObject* obj, ...) {\ va_list ap;\ va_start(ap, obj);\ - TYPE res = invoke##TYPE_NAME##SpecialAP(obj, ap);\ + TYPE res = invoke##TYPE_NAME##SpecialAP(vm, obj, ap);\ va_end(ap); \ return res; \ }\ \ -TYPE JavaMethod::invoke##TYPE_NAME##Static(...) {\ +TYPE JavaMethod::invoke##TYPE_NAME##Static(Jnjvm* vm, ...) {\ va_list ap;\ va_start(ap, this);\ - TYPE res = invoke##TYPE_NAME##StaticAP(ap);\ + TYPE res = invoke##TYPE_NAME##StaticAP(vm, ap);\ va_end(ap); \ return res; \ }\ #endif -typedef uint32 (*uint32_virtual_ap)(void*, JavaObject*, va_list); -typedef sint64 (*sint64_virtual_ap)(void*, JavaObject*, va_list); -typedef float (*float_virtual_ap)(void*, JavaObject*, va_list); -typedef double (*double_virtual_ap)(void*, JavaObject*, va_list); -typedef JavaObject* (*object_virtual_ap)(void*, JavaObject*, va_list); - -typedef uint32 (*uint32_static_ap)(void*, va_list); -typedef sint64 (*sint64_static_ap)(void*, va_list); -typedef float (*float_static_ap)(void*, va_list); -typedef double (*double_static_ap)(void*, va_list); -typedef JavaObject* (*object_static_ap)(void*, va_list); - -typedef uint32 (*uint32_virtual_buf)(void*, JavaObject*, void*); -typedef sint64 (*sint64_virtual_buf)(void*, JavaObject*, void*); -typedef float (*float_virtual_buf)(void*, JavaObject*, void*); -typedef double (*double_virtual_buf)(void*, JavaObject*, void*); -typedef JavaObject* (*object_virtual_buf)(void*, JavaObject*, void*); - -typedef uint32 (*uint32_static_buf)(void*, void*); -typedef sint64 (*sint64_static_buf)(void*, void*); -typedef float (*float_static_buf)(void*, void*); -typedef double (*double_static_buf)(void*, void*); -typedef JavaObject* (*object_static_buf)(void*, void*); +typedef uint32 (*uint32_virtual_ap)(Jnjvm*, void*, JavaObject*, va_list); +typedef sint64 (*sint64_virtual_ap)(Jnjvm*, void*, JavaObject*, va_list); +typedef float (*float_virtual_ap)(Jnjvm*, void*, JavaObject*, va_list); +typedef double (*double_virtual_ap)(Jnjvm*, void*, JavaObject*, va_list); +typedef JavaObject* (*object_virtual_ap)(Jnjvm*, void*, JavaObject*, va_list); + +typedef uint32 (*uint32_static_ap)(Jnjvm*, void*, va_list); +typedef sint64 (*sint64_static_ap)(Jnjvm*, void*, va_list); +typedef float (*float_static_ap)(Jnjvm*, void*, va_list); +typedef double (*double_static_ap)(Jnjvm*, void*, va_list); +typedef JavaObject* (*object_static_ap)(Jnjvm*, void*, va_list); + +typedef uint32 (*uint32_virtual_buf)(Jnjvm*, void*, JavaObject*, void*); +typedef sint64 (*sint64_virtual_buf)(Jnjvm*, void*, JavaObject*, void*); +typedef float (*float_virtual_buf)(Jnjvm*, void*, JavaObject*, void*); +typedef double (*double_virtual_buf)(Jnjvm*, void*, JavaObject*, void*); +typedef JavaObject* (*object_virtual_buf)(Jnjvm*, void*, JavaObject*, void*); + +typedef uint32 (*uint32_static_buf)(Jnjvm*, void*, void*); +typedef sint64 (*sint64_static_buf)(Jnjvm*, void*, void*); +typedef float (*float_static_buf)(Jnjvm*, void*, void*); +typedef double (*double_static_buf)(Jnjvm*, void*, void*); +typedef JavaObject* (*object_static_buf)(Jnjvm*, void*, void*); INVOKE(uint32, Int, uint32_virtual_ap, uint32_static_ap, uint32_virtual_buf, uint32_static_buf) INVOKE(sint64, Long, sint64_virtual_ap, sint64_static_ap, sint64_virtual_buf, sint64_static_buf) @@ -729,6 +729,10 @@ BasicBlock* currentBlock = BasicBlock::Create("enter", res); Function::arg_iterator i = res->arg_begin(); Value *obj, *ptr, *func; +#ifdef MULTIPLE_VM + Value* vm = i; +#endif + ++i; func = i; ++i; if (virt) { @@ -754,7 +758,7 @@ } #ifdef MULTIPLE_VM - Args.push_back(mvm::jit::constantPtrNull); + Args.push_back(vm); #endif Value* val = CallInst::Create(func, Args.begin(), Args.end(), "", currentBlock); @@ -780,6 +784,10 @@ BasicBlock* currentBlock = BasicBlock::Create("enter", res); Function::arg_iterator i = res->arg_begin(); Value *obj, *ap, *func; +#ifdef MULTIPLE_VM + Value* vm = i; +#endif + ++i; func = i; ++i; if (virt) { @@ -796,7 +804,7 @@ } #ifdef MULTIPLE_VM - Args.push_back(mvm::jit::constantPtrNull); + Args.push_back(vm); #endif Value* val = CallInst::Create(func, Args.begin(), Args.end(), "", currentBlock); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp Mon Apr 14 11:46:23 2008 @@ -595,11 +595,13 @@ res->nativeTypePtr = llvm::PointerType::getUnqual(res->nativeType); std::vector Args; + Args.push_back(mvm::jit::ptrType); // vm Args.push_back(res->staticTypePtr); Args.push_back(llvm::PointerType::getUnqual(llvm::Type::Int32Ty)); res->staticBufType = llvm::FunctionType::get(res->ret->funcs->llvmType, Args, false); std::vector Args2; + Args2.push_back(mvm::jit::ptrType); // vm Args2.push_back(res->virtualTypePtr); Args2.push_back(JavaObject::llvmType); Args2.push_back(llvm::PointerType::getUnqual(llvm::Type::Int32Ty)); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp Mon Apr 14 11:46:23 2008 @@ -139,7 +139,7 @@ (*vmth)(running, (uint32)1); (*rootGroup)(); (*th)(group, (JavaObject*)((*rootGroup)().PointerVal)); - groupAddThread->invokeIntSpecial((JavaObject*)((*rootGroup)().PointerVal), th); + groupAddThread->invokeIntSpecial(vm, (JavaObject*)((*rootGroup)().PointerVal), th); } void ClasspathThread::mapInitialThread(Jnjvm* vm) { @@ -149,7 +149,7 @@ myth->javaThread = th; JavaObject* vmth = (JavaObject*)((*th)(vmThread).PointerVal); (*vmth)(vmdata, (JavaObject*)myth); - finaliseCreateInitialThread->invokeIntStatic(th); + finaliseCreateInitialThread->invokeIntStatic(vm, th); } void Classpath::initialiseClasspath(Jnjvm* vm) { Modified: vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jni.cpp Mon Apr 14 11:46:23 2008 @@ -146,7 +146,7 @@ JavaMethod* init = cl->lookupMethod(Jnjvm::initName, vm->asciizConstructUTF8("(Ljava/lang/String;)V"), 0, 1); - init->invokeIntSpecial(res, vm->asciizToStr(msg)); + init->invokeIntSpecial(vm, res, vm->asciizToStr(msg)); th->pendingException = res; th->returnFromNative(); return 1; @@ -230,8 +230,9 @@ va_start(ap, methodID); JavaMethod* meth = (JavaMethod*)methodID; Class* cl = (Class*)NativeUtil::resolvedImplClass(clazz, true); - JavaObject* res = cl->doNew(JavaThread::get()->isolate); - meth->invokeIntSpecialAP(res, ap); + Jnjvm* vm = JavaThread::get()->isolate; + JavaObject* res = cl->doNew(vm); + meth->invokeIntSpecialAP(vm, res, ap); va_end(ap); return (jobject)res; @@ -320,7 +321,8 @@ va_start(ap, methodID); JavaObject* self = (JavaObject*)obj; JavaMethod* meth = (JavaMethod*)methodID; - JavaObject* res = meth->invokeJavaObjectVirtualAP(self, ap); + Jnjvm* vm = JavaThread::get()->isolate; + JavaObject* res = meth->invokeJavaObjectVirtualAP(vm, self, ap); va_end(ap); return (jobject)res; @@ -351,7 +353,8 @@ va_start(ap, methodID); JavaObject* self = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - uint32 res = meth->invokeIntVirtualAP(self, ap); + Jnjvm* vm = JavaThread::get()->isolate; + uint32 res = meth->invokeIntVirtualAP(vm, self, ap); va_end(ap); return res; @@ -442,7 +445,8 @@ va_start(ap, methodID); JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - uint32 res = meth->invokeIntVirtualAP(obj, ap); + Jnjvm* vm = JavaThread::get()->isolate; + uint32 res = meth->invokeIntVirtualAP(vm, obj, ap); va_end(ap); return res; @@ -495,7 +499,8 @@ va_start(ap, methodID); JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - jfloat res = meth->invokeFloatVirtualAP(obj, ap); + Jnjvm* vm = JavaThread::get()->isolate; + jfloat res = meth->invokeFloatVirtualAP(vm, obj, ap); va_end(ap); return res; @@ -527,7 +532,8 @@ va_start(ap, methodID); JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - jdouble res = meth->invokeDoubleVirtualAP(obj, ap); + Jnjvm* vm = JavaThread::get()->isolate; + jdouble res = meth->invokeDoubleVirtualAP(vm, obj, ap); va_end(ap); return res; @@ -543,7 +549,8 @@ JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - return meth->invokeDoubleVirtualAP(obj, args); + Jnjvm* vm = JavaThread::get()->isolate; + return meth->invokeDoubleVirtualAP(vm, obj, args); END_EXCEPTION return 0.0; @@ -567,7 +574,8 @@ va_start(ap, methodID); JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - meth->invokeIntVirtualAP(obj, ap); + Jnjvm* vm = JavaThread::get()->isolate; + meth->invokeIntVirtualAP(vm, obj, ap); va_end(ap); END_EXCEPTION @@ -581,7 +589,8 @@ JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - meth->invokeIntVirtualAP(obj, args); + Jnjvm* vm = JavaThread::get()->isolate; + meth->invokeIntVirtualAP(vm, obj, args); END_EXCEPTION } @@ -800,7 +809,8 @@ va_start(ap, methodID); JavaObject* obj = (JavaObject*)_obj; JavaMethod* meth = (JavaMethod*)methodID; - meth->invokeIntSpecialAP(obj, ap); + Jnjvm* vm = JavaThread::get()->isolate; + meth->invokeIntSpecialAP(vm, obj, ap); va_end(ap); END_EXCEPTION @@ -1110,7 +1120,8 @@ va_list ap; va_start(ap, methodID); JavaMethod* meth = (JavaMethod*)methodID; - uint32 res = meth->invokeIntStaticAP(ap); + Jnjvm* vm = JavaThread::get()->isolate; + uint32 res = meth->invokeIntStaticAP(vm, ap); va_end(ap); return res; @@ -1284,7 +1295,8 @@ va_list ap; va_start(ap, methodID); JavaMethod* meth = (JavaMethod*)methodID; - meth->invokeIntStaticAP(ap); + Jnjvm* vm = JavaThread::get()->isolate; + meth->invokeIntStaticAP(vm, ap); va_end(ap); END_EXCEPTION @@ -1297,7 +1309,8 @@ BEGIN_EXCEPTION JavaMethod* meth = (JavaMethod*)methodID; - meth->invokeIntStaticAP(args); + Jnjvm* vm = JavaThread::get()->isolate; + meth->invokeIntStaticAP(vm, args); END_EXCEPTION } Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=49649&r1=49648&r2=49649&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon Apr 14 11:46:23 2008 @@ -298,7 +298,7 @@ } -typedef void (*clinit_t)(void); +typedef void (*clinit_t)(Jnjvm* vm); void Jnjvm::initialiseClass(CommonClass* cl) { if (cl->isArray || AssessorDesc::bogusClassToPrimitive(cl)) { @@ -333,7 +333,7 @@ JavaObject* exc = 0; try{ clinit_t pred = (clinit_t)meth->compiledPtr(); - pred(); + pred(this); } catch(...) { exc = JavaThread::getJavaException(); assert(exc && "no exception?"); @@ -816,7 +816,7 @@ CommonClass* Jnjvm::loadInClassLoader(const UTF8* name, JavaObject* loader) { JavaString* str = this->UTF8ToStr(name); JavaObject* obj = (JavaObject*) - Classpath::loadInClassLoader->invokeJavaObjectVirtual(loader, str); + Classpath::loadInClassLoader->invokeJavaObjectVirtual(this, loader, str); return (CommonClass*)((*Classpath::vmdataClass)(obj).PointerVal); } @@ -839,13 +839,13 @@ if (!(cl->delegatee)) { JavaObject* delegatee = (*Classpath::newClass)(this); cl->delegatee = delegatee; - Classpath::initClass->invokeIntSpecial(delegatee, cl); + Classpath::initClass->invokeIntSpecial(this, delegatee, cl); } else if (cl->delegatee->classOf != Classpath::newClass) { JavaObject* pd = cl->delegatee; JavaObject* delegatee = (*Classpath::newClass)(this); cl->delegatee = delegatee;; - Classpath::initClassWithProtectionDomain->invokeIntSpecial(delegatee, cl, - pd); + Classpath::initClassWithProtectionDomain->invokeIntSpecial(this, delegatee, + cl, pd); } return cl->delegatee; } @@ -855,12 +855,13 @@ if (!val) { val = (*Classpath::newClass)(this); delegatees->hash(cl, val); - Classpath::initClass->invokeIntSpecial(val, cl); + Classpath::initClass->invokeIntSpecial(this, val, cl); } else if (val->classOf != Classpath::newClass) { JavaObject* pd = val; val = (*Classpath::newClass)(this); delegatees->hash(cl, val); - Classpath::initClassWithProtectionDomain->invokeIntSpecial(val, cl, pd); + Classpath::initClassWithProtectionDomain->invokeIntSpecial(this, val, cl, + pd); } return val; } From sabre at nondot.org Mon Apr 14 11:48:53 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 14 Apr 2008 16:48:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49650 - /llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Message-ID: <200804141648.m3EGmrjx013193@zion.cs.uiuc.edu> Author: lattner Date: Mon Apr 14 11:48:52 2008 New Revision: 49650 URL: http://llvm.org/viewvc/llvm-project?rev=49650&view=rev Log: Fix LLVMBuilder -> IRBuilder fallout. Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp?rev=49650&r1=49649&r2=49650&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Mon Apr 14 11:48:52 2008 @@ -44,7 +44,7 @@ unsigned OpNum, Intrinsic::ID IID, const Type *ResultType, std::vector &Ops, - LLVMBuilder &Builder, Value *&Result) { + IRBuilder &Builder, Value *&Result) { const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); Function *IntFn = Intrinsic::getDeclaration(TheModule, IID); From nicolas.geoffray at lip6.fr Mon Apr 14 12:17:14 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 14 Apr 2008 17:17:14 -0000 Subject: [llvm-commits] [llvm] r49652 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200804141717.m3EHHE0w014002@zion.cs.uiuc.edu> Author: geoffray Date: Mon Apr 14 12:17:14 2008 New Revision: 49652 URL: http://llvm.org/viewvc/llvm-project?rev=49652&view=rev Log: Fix /test/CodeGen/PowerPC/big-endian-actual-args.ll for linux/ppc32 Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=49652&r1=49651&r2=49652&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 14 12:17:14 2008 @@ -4162,13 +4162,13 @@ unsigned NumRegs = getNumRegisters(VT); for (unsigned i = 0; i != NumRegs; ++i) { RetVals.push_back(RegisterVT); - + ISD::ArgFlagsTy MyFlags = Flags; if (NumRegs > 1 && i == 0) - Flags.setDivided(); + MyFlags.setDivided(); // if it isn't first piece, alignment must be 1 else if (i > 0) - Flags.setOrigAlign(1); - Ops.push_back(DAG.getArgFlags(Flags)); + MyFlags.setOrigAlign(1); + Ops.push_back(DAG.getArgFlags(MyFlags)); } } From dpatel at apple.com Mon Apr 14 12:20:11 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 17:20:11 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49653 - /llvm-gcc-4.2/trunk/GNUmakefile Message-ID: <200804141720.m3EHKBPX014102@zion.cs.uiuc.edu> Author: dpatel Date: Mon Apr 14 12:20:11 2008 New Revision: 49653 URL: http://llvm.org/viewvc/llvm-project?rev=49653&view=rev Log: Update llvmCore install location info. Modified: llvm-gcc-4.2/trunk/GNUmakefile Modified: llvm-gcc-4.2/trunk/GNUmakefile URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/GNUmakefile?rev=49653&r1=49652&r2=49653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/GNUmakefile (original) +++ llvm-gcc-4.2/trunk/GNUmakefile Mon Apr 14 12:20:11 2008 @@ -38,7 +38,7 @@ # LLVM defaults to enabled. ifndef DISABLE_LLVM ENABLE_LLVM = true -# LLVM gets installed into /usr/local, not /usr. +# LLVM gets installed into /Developer/usr/local, not /usr. ifndef DEVELOPER_DIR PREFIX = /Developer/usr/llvm-gcc-4.2 else @@ -56,7 +56,11 @@ endif ifndef LLVMCORE_PATH -LLVMCORE_PATH = /usr/local +ifndef DEVELOPER_DIR +LLVMCORE_PATH = /Developer/usr/local +else +LLVMCORE_PATH = ${DEVELOPER_DIR}/usr/local +endif endif ifndef RC_ProjectSourceVersion From gohman at apple.com Mon Apr 14 12:21:51 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 10:21:51 -0700 Subject: [llvm-commits] [llvm] r49614 - in /llvm/trunk: lib/Linker/LinkModules.cpp lib/Transforms/Scalar/LoopRotation.cpp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Scalar/TailDuplication.cpp lib/Transforms/Utils/CodeExtractor.cpp tools/bugpoint/Miscompilation.cpp In-Reply-To: <200804131915.m3DJFIC8032349@zion.cs.uiuc.edu> References: <200804131915.m3DJFIC8032349@zion.cs.uiuc.edu> Message-ID: On Apr 13, 2008, at 12:15 PM, Owen Anderson wrote: > Author: resistor > Date: Sun Apr 13 14:15:17 2008 > New Revision: 49614 > > URL: http://llvm.org/viewvc/llvm-project?rev=49614&view=rev > Log: > Replace calls of the form V1->setName(V2->getName()) with V1- > >takeName(V2), > which is significantly more efficient. In at least some of those cases the original instruction isn't deleted, so this change causes those instructions to be left without names. Dan From ggreif at gmail.com Mon Apr 14 12:22:34 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 17:22:34 -0000 Subject: [llvm-commits] [llvm] r49654 - /llvm/branches/ggreif/use-diet/include/llvm/User.h Message-ID: <200804141722.m3EHMYMx014178@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 12:22:34 2008 New Revision: 49654 URL: http://llvm.org/viewvc/llvm-project?rev=49654&view=rev Log: actually delete memory Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49654&r1=49653&r2=49654&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Mon Apr 14 12:22:34 2008 @@ -258,7 +258,7 @@ } inline Use *allocHangoffUses(unsigned) const; void dropHungoffUses(Use *U) { - Use::zap(U, U->getImpliedUser()); + Use::zap(U, U->getImpliedUser(), true); } Value *getOperand(unsigned i) const { From dpatel at apple.com Mon Apr 14 12:36:40 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 17:36:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49655 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-convert.cpp Message-ID: <200804141736.m3EHaeLt014599@zion.cs.uiuc.edu> Author: dpatel Date: Mon Apr 14 12:36:40 2008 New Revision: 49655 URL: http://llvm.org/viewvc/llvm-project?rev=49655&view=rev Log: Building and extracting multiple values from a return instruciton is target specific. Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp 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=49655&r1=49654&r2=49655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Apr 14 12:36:40 2008 @@ -296,6 +296,33 @@ 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(Fn,R,RetVals,B) +#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,Rs,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 &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. +#ifndef LLVM_EXTRACT_MULTIPLE_RETURN_VALUE(Src,Dest,B) +#define LLVM_EXTRACT_MULTIPLE_RETURN_VALUE(Src,Dest,V,B) \ + llvm_default_extract_multiple_return_value((Src),(Dest),(V),(B)) +#endif +static void llvm_default_extract_multiple_return_value(Value *Src, Value *Dest, + bool isVolatile, + IRBuilder &Builder) { + assert (0 && "LLVM_EXTRACT_MULTIPLE_RETURN_VALUE is not implemented!"); +} + /// DefaultABI - This class implements the default LLVM ABI where structures are /// passed by decimating them into individual components and unions are passed /// by passing the largest member of the union. 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=49655&r1=49654&r2=49655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Apr 14 12:36:40 2008 @@ -761,12 +761,7 @@ Value *RetVal = DECL_LLVM(DECL_RESULT(FnDecl)); if (const StructType *STy = dyn_cast(Fn->getReturnType())) { // Handle multiple return values - unsigned NumElements = STy->getNumElements(); - for (unsigned i = 0; i < NumElements; i++) { - Value *GEP = Builder.CreateStructGEP(RetVal, i, "mrv_idx"); - Value *RetVal = Builder.CreateLoad(GEP, "mrv"); - RetVals.push_back(RetVal); - } + LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,RetVal,RetVals,Builder); } else { // Otherwise, this aggregate result must be something that is returned in // a scalar register for this target. We must bit convert the aggregate @@ -2646,13 +2641,7 @@ Call->setName("tmp"); if (Client.isAggrReturn()) { - const StructType *STy = cast(Call->getType()); - unsigned NumElements = STy->getNumElements(); - for (unsigned i = 0; i < NumElements; i++) { - Value *GEP = Builder.CreateStructGEP(DestLoc->Ptr, i, "mrv_gep"); - GetResultInst *GR = Builder.CreateGetResult(Call, i, "mrv_gr"); - Builder.CreateStore(GR, GEP, DestLoc->Volatile); - } + LLVM_EXTRACT_MULTIPLE_RETURN_VALUE(Call,DestLoc->Ptr,DestLoc->Volatile,Builder); return 0; } From resistor at mac.com Mon Apr 14 12:38:21 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 14 Apr 2008 17:38:21 -0000 Subject: [llvm-commits] [llvm] r49657 - in /llvm/trunk: lib/Linker/LinkModules.cpp lib/Transforms/Scalar/LoopRotation.cpp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Scalar/TailDuplication.cpp lib/Transforms/Utils/CodeExtractor.cpp tools/bugpoint/Miscompilation.cpp Message-ID: <200804141738.m3EHcLgC014666@zion.cs.uiuc.edu> Author: resistor Date: Mon Apr 14 12:38:21 2008 New Revision: 49657 URL: http://llvm.org/viewvc/llvm-project?rev=49657&view=rev Log: Revert r49614. As Dan pointed out, some of these aren't correct. Modified: llvm/trunk/lib/Linker/LinkModules.cpp llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp llvm/trunk/tools/bugpoint/Miscompilation.cpp Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Apr 14 12:38:21 2008 @@ -930,7 +930,7 @@ Function::arg_iterator DI = Dest->arg_begin(); for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end(); I != E; ++I, ++DI) { - DI->takeName(I); // Copy the name information over... + DI->setName(I->getName()); // Copy the name information over... // Add a mapping to our local map ValueMap[I] = DI; Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 14 12:38:21 2008 @@ -226,7 +226,7 @@ // If this instruction is using a value from same basic block then // update it to use value from cloned instruction. Instruction *C = In->clone(); - C->takeName(In); + C->setName(In->getName()); OrigPreHeader->getInstList().push_back(C); for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) { Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Mon Apr 14 12:38:21 2008 @@ -179,8 +179,8 @@ BB->eraseFromParent(); // Inherit predecessor's name if it exists... - if (BB->hasName() && !OnlyPred->hasName()) - OnlyPred->takeName(BB); + if (!OldName.empty() && !OnlyPred->hasName()) + OnlyPred->setName(OldName); return OnlyPred; } Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Mon Apr 14 12:38:21 2008 @@ -317,7 +317,7 @@ // for (; BI != DestBlock->end(); ++BI) { Instruction *New = BI->clone(); - New->takeName(BI); + New->setName(BI->getName()); SourceBlock->getInstList().push_back(New); ValueMapping[BI] = New; } Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Mon Apr 14 12:38:21 2008 @@ -317,7 +317,7 @@ if (!AggregateArgs) { AI = newFunction->arg_begin(); for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI) - AI->takeName(inputs[i]); + AI->setName(inputs[i]->getName()); for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI) AI->setName(outputs[i]->getName()+".out"); } Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=49657&r1=49656&r2=49657&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original) +++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Mon Apr 14 12:38:21 2008 @@ -657,7 +657,7 @@ for (Function::arg_iterator I = newMain->arg_begin(), E = newMain->arg_end(), OI = oldMain->arg_begin(); I != E; ++I, ++OI) { - I->takeName(OI); // Copy argument names from oldMain + I->setName(OI->getName()); // Copy argument names from oldMain args.push_back(I); } From gohman at apple.com Mon Apr 14 12:45:20 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 17:45:20 -0000 Subject: [llvm-commits] [llvm] r49661 - /llvm/trunk/include/llvm/Target/TargetLowering.h Message-ID: <200804141745.m3EHjK2q014886@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 12:45:20 2008 New Revision: 49661 URL: http://llvm.org/viewvc/llvm-project?rev=49661&view=rev Log: Clean up some comments. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=49661&r1=49660&r2=49661&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Apr 14 12:45:20 2008 @@ -952,7 +952,7 @@ /// memcpy. This can be used by targets to provide code sequences for cases /// that don't fit the target's parameters for simple loads/stores and can be /// more efficient than using a library call. This function can return a null - /// SDOperand if the target declines to use inline code and a different + /// SDOperand if the target declines to use custom code and a different /// lowering strategy should be used. /// /// If AlwaysInline is true, the size is constant and the target should not @@ -976,8 +976,8 @@ /// memmove. This can be used by targets to provide code sequences for cases /// that don't fit the target's parameters for simple loads/stores and can be /// more efficient than using a library call. This function can return a null - /// SDOperand if the target declines to use code and a different lowering - /// strategy should be used. + /// SDOperand if the target declines to use custom code and a different + /// lowering strategy should be used. virtual SDOperand EmitTargetCodeForMemmove(SelectionDAG &DAG, SDOperand Chain, @@ -992,8 +992,8 @@ /// memset. This can be used by targets to provide code sequences for cases /// that don't fit the target's parameters for simple stores and can be more /// efficient than using a library call. This function can return a null - /// SDOperand if the target declines to use code and a different lowering - /// strategy should be used. + /// SDOperand if the target declines to use custom code and a different + /// lowering strategy should be used. virtual SDOperand EmitTargetCodeForMemset(SelectionDAG &DAG, SDOperand Chain, From dalej at apple.com Mon Apr 14 12:54:17 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 14 Apr 2008 17:54:17 -0000 Subject: [llvm-commits] [llvm] r49663 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/DwarfWriter.cpp lib/Target/PowerPC/PPCRegisterInfo.cpp lib/Target/TargetMachine.cpp lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200804141754.m3EHsHhA015140@zion.cs.uiuc.edu> Author: johannes Date: Mon Apr 14 12:54:17 2008 New Revision: 49663 URL: http://llvm.org/viewvc/llvm-project?rev=49663&view=rev Log: Reverse sense of unwind-tables option. This means stack tracebacks on Darwin x86-64 won't work by default; nevertheless, everybody but me thinks this is a good idea. Modified: llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/DwarfWriter.cpp llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp llvm/trunk/lib/Target/TargetMachine.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=49663&r1=49662&r2=49663&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Mon Apr 14 12:54:17 2008 @@ -74,10 +74,9 @@ /// be emitted. extern bool ExceptionHandling; - /// UnwindTablesOptional - This flag indicates that unwind tables need not - /// be emitted for all functions. Exception handling may still require them - /// for some functions. - extern bool UnwindTablesOptional; + /// UnwindTablesMandatory - This flag indicates that unwind tables should + /// be emitted for all functions. + extern bool UnwindTablesMandatory; /// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified /// on the commandline. When the flag is on, the target will perform tail call Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=49663&r1=49662&r2=49663&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Apr 14 12:54:17 2008 @@ -2906,10 +2906,10 @@ // If there are no calls then you can't unwind. This may mean we can // omit the EH Frame, but some environments do not handle weak absolute // symbols. - // If UnwindTablesOptional is not set we cannot do this optimization; the + // If UnwindTablesMandatory is set we cannot do this optimization; the // unwind info is to be available for non-EH uses. if (!EHFrameInfo.hasCalls && - UnwindTablesOptional && + !UnwindTablesMandatory && ((linkage != Function::WeakLinkage && linkage != Function::LinkOnceLinkage) || !TAI->getWeakDefDirective() || @@ -3432,7 +3432,7 @@ // See if we need frame move info. if (MMI->hasDebugInfo() || !MF->getFunction()->doesNotThrow() || - !UnwindTablesOptional) + UnwindTablesMandatory) shouldEmitMoves = true; if (shouldEmitMoves || shouldEmitTable) Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=49663&r1=49662&r2=49663&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Apr 14 12:54:17 2008 @@ -949,7 +949,7 @@ MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || !MF.getFunction()->doesNotThrow() || - !UnwindTablesOptional; + UnwindTablesMandatory; // Prepare for frame info. unsigned FrameLabelId = 0; Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=49663&r1=49662&r2=49663&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Apr 14 12:54:17 2008 @@ -31,7 +31,7 @@ bool UseSoftFloat; bool NoZerosInBSS; bool ExceptionHandling; - bool UnwindTablesOptional; + bool UnwindTablesMandatory; Reloc::Model RelocationModel; CodeModel::Model CMModel; bool PerformTailCallOpt; @@ -85,9 +85,9 @@ cl::location(ExceptionHandling), cl::init(false)); cl::opt - DisableUnwindTables("unwind-tables-optional", - cl::desc("Generate unwinding tables only for functions that require them"), - cl::location(UnwindTablesOptional), + EnableUnwindTables("unwind-tables", + cl::desc("Generate unwinding tables for all functions"), + cl::location(UnwindTablesMandatory), cl::init(false)); cl::opt Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=49663&r1=49662&r2=49663&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Apr 14 12:54:17 2008 @@ -506,7 +506,7 @@ MachineBasicBlock::iterator MBBI = MBB.begin(); bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || !Fn->doesNotThrow() || - !UnwindTablesOptional; + UnwindTablesMandatory; // Prepare for frame info. unsigned FrameLabelId = 0; From dalej at apple.com Mon Apr 14 12:55:01 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 14 Apr 2008 17:55:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49665 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200804141755.m3EHt1Ce015183@zion.cs.uiuc.edu> Author: johannes Date: Mon Apr 14 12:55:00 2008 New Revision: 49665 URL: http://llvm.org/viewvc/llvm-project?rev=49665&view=rev Log: Reverse sense of unwind-tables option. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=49665&r1=49664&r2=49665&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Apr 14 12:55:00 2008 @@ -131,8 +131,8 @@ if (optimize_size) // Reduce inline limit. Default limit is 200. Args.push_back("--inline-threshold=100"); - if (!flag_unwind_tables) - Args.push_back("--unwind-tables-optional"); + if (flag_unwind_tables) + Args.push_back("--unwind-tables"); // If there are options that should be passed through to the LLVM backend // directly from the command line, do so now. This is mainly for debugging From gohman at apple.com Mon Apr 14 12:55:49 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 17:55:49 -0000 Subject: [llvm-commits] [llvm] r49666 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAG.h include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h Message-ID: <200804141755.m3EHtn4m015223@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 12:55:48 2008 New Revision: 49666 URL: http://llvm.org/viewvc/llvm-project?rev=49666&view=rev Log: Fix const-correctness issues with the SrcValue handling in the memory intrinsic expansion code. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Apr 14 12:55:48 2008 @@ -326,17 +326,17 @@ SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff); + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff); SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff); + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff); SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff); + const Value *DstSV, uint64_t DstOff); /// getSetCC - Helper function to make it easier to build SetCC's if you just /// have an ISD::CondCode instead of an SDOperand. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Apr 14 12:55:48 2008 @@ -967,8 +967,8 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff) { + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff) { return SDOperand(); } @@ -983,8 +983,8 @@ SDOperand Chain, SDOperand Op1, SDOperand Op2, SDOperand Op3, unsigned Align, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff) { + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff) { return SDOperand(); } @@ -999,7 +999,7 @@ SDOperand Chain, SDOperand Op1, SDOperand Op2, SDOperand Op3, unsigned Align, - Value *DstSV, uint64_t DstOff) { + const Value *DstSV, uint64_t DstOff) { return SDOperand(); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Apr 14 12:55:48 2008 @@ -2500,8 +2500,8 @@ SDOperand Src, uint64_t Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff) { + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff) { const TargetLowering &TLI = DAG.getTargetLoweringInfo(); // Expand memcpy to a series of store ops if the size operand falls below @@ -2573,7 +2573,7 @@ SDOperand Chain, SDOperand Dst, SDOperand Src, uint64_t Size, unsigned Align, - Value *DstSV, uint64_t DstOff) { + const Value *DstSV, uint64_t DstOff) { const TargetLowering &TLI = DAG.getTargetLoweringInfo(); // Expand memset to a series of load/store ops if the size operand @@ -2604,8 +2604,8 @@ SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff) { + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff) { // Check to see if we should lower the memcpy to loads and stores first. // For cases within the target-specified limits, this is the best choice. @@ -2658,8 +2658,8 @@ SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff) { + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff) { // TODO: Optimize small memmove cases with simple loads and stores, // ensuring that all loads precede all stores. This can cause severe @@ -2691,7 +2691,7 @@ SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff) { + const Value *DstSV, uint64_t DstOff) { // Check to see if we should lower the memset to stores first. // For cases within the target-specified limits, this is the best choice. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Apr 14 12:55:48 2008 @@ -1247,8 +1247,8 @@ SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff){ + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff){ // Do repeated 4-byte loads and stores. To be improved. // This requires 4-byte alignment. if ((Align & 3) != 0) Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Mon Apr 14 12:55:48 2008 @@ -149,8 +149,8 @@ SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff); + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff); }; } Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Apr 14 12:55:48 2008 @@ -4664,7 +4664,7 @@ SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff) { + const Value *DstSV, uint64_t DstOff) { ConstantSDNode *ConstantSize = dyn_cast(Size); /// If not DWORD aligned or size is more than the threshold, call the library. @@ -4804,8 +4804,8 @@ SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff){ + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff){ // This requires the copy size to be a constant, preferrably // within a subtarget-specific limit. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=49666&r1=49665&r2=49666&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Apr 14 12:55:48 2008 @@ -550,14 +550,14 @@ SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, - Value *DstSV, uint64_t DstOff); + const Value *DstSV, uint64_t DstOff); SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, bool AlwaysInline, - Value *DstSV, uint64_t DstOff, - Value *SrcSV, uint64_t SrcOff); + const Value *DstSV, uint64_t DstOff, + const Value *SrcSV, uint64_t SrcOff); }; } From dalej at apple.com Mon Apr 14 12:56:55 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 14 Apr 2008 17:56:55 -0000 Subject: [llvm-commits] [llvm] r49667 - in /llvm/trunk/test/CodeGen: PowerPC/compare-fcmp-ord.ll PowerPC/fold-li.ll PowerPC/reg-coalesce-simple.ll PowerPC/rotl-2.ll X86/2006-03-02-InstrSchedBug.ll X86/2006-05-02-InstrSched1.ll X86/2006-05-02-InstrSched2.ll X86/2006-05-11-InstrSched.ll X86/2007-09-17-ObjcFrameEH.ll X86/constant-pool-remat-0.ll X86/dagcombine-cse.ll X86/iabs.ll X86/or-branch.ll X86/select.ll X86/setuge.ll X86/zero-remat.ll Message-ID: <200804141756.m3EHutsR015284@zion.cs.uiuc.edu> Author: johannes Date: Mon Apr 14 12:56:54 2008 New Revision: 49667 URL: http://llvm.org/viewvc/llvm-project?rev=49667&view=rev Log: Remove -unwind-tables-optional everywhere, since this is now the default. Modified: llvm/trunk/test/CodeGen/PowerPC/compare-fcmp-ord.ll llvm/trunk/test/CodeGen/PowerPC/fold-li.ll llvm/trunk/test/CodeGen/PowerPC/reg-coalesce-simple.ll llvm/trunk/test/CodeGen/PowerPC/rotl-2.ll llvm/trunk/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched1.ll llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched2.ll llvm/trunk/test/CodeGen/X86/2006-05-11-InstrSched.ll llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll llvm/trunk/test/CodeGen/X86/dagcombine-cse.ll llvm/trunk/test/CodeGen/X86/iabs.ll llvm/trunk/test/CodeGen/X86/or-branch.ll llvm/trunk/test/CodeGen/X86/select.ll llvm/trunk/test/CodeGen/X86/setuge.ll llvm/trunk/test/CodeGen/X86/zero-remat.ll Modified: llvm/trunk/test/CodeGen/PowerPC/compare-fcmp-ord.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/compare-fcmp-ord.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/compare-fcmp-ord.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/compare-fcmp-ord.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | grep or | count 3 +; RUN: llvm-as < %s | llc -march=ppc32 | grep or | count 3 ; This should produce one 'or' or 'cror' instruction per function. define i32 @test(double %x, double %y) nounwind { Modified: llvm/trunk/test/CodeGen/PowerPC/fold-li.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/fold-li.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/fold-li.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/fold-li.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | \ +; RUN: llvm-as < %s | llc -march=ppc32 | \ ; RUN: grep -v align | not grep li ;; Test that immediates are folded into these instructions correctly. Modified: llvm/trunk/test/CodeGen/PowerPC/reg-coalesce-simple.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/reg-coalesce-simple.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/reg-coalesce-simple.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/reg-coalesce-simple.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | not grep or +; RUN: llvm-as < %s | llc -march=ppc32 | not grep or %struct.foo = type { i32, i32, [0 x i8] } Modified: llvm/trunk/test/CodeGen/PowerPC/rotl-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/rotl-2.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/rotl-2.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/rotl-2.ll Mon Apr 14 12:56:54 2008 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | grep rlwinm | count 4 -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | grep rlwnm | count 2 -; RUN: llvm-as < %s | llc -march=ppc32 -unwind-tables-optional | not grep or +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwinm | count 4 +; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwnm | count 2 +; RUN: llvm-as < %s | llc -march=ppc32 | not grep or define i32 @rotl32(i32 %A, i8 %Amt) nounwind { %shift.upgrd.1 = zext i8 %Amt to i32 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-03-02-InstrSchedBug.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -unwind-tables-optional -stats |& \ +; RUN: llvm-as < %s | llc -march=x86 -stats |& \ ; RUN: grep asm-printer | grep 7 define i32 @g(i32 %a, i32 %b) nounwind { Modified: llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched1.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched1.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched1.ll Mon Apr 14 12:56:54 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | \ -; RUN: llc -march=x86 -relocation-model=static -unwind-tables-optional -stats |& \ +; RUN: llc -march=x86 -relocation-model=static -stats |& \ ; RUN: grep asm-printer | grep 14 ; @size20 = external global i32 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched2.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched2.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-05-02-InstrSched2.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -stats -unwind-tables-optional |& \ +; RUN: llvm-as < %s | llc -march=x86 -stats |& \ ; RUN: grep asm-printer | grep 13 define void @_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(i8* %tmp435.i, i32* %tmp449.i.out) nounwind { Modified: llvm/trunk/test/CodeGen/X86/2006-05-11-InstrSched.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-05-11-InstrSched.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-05-11-InstrSched.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-05-11-InstrSched.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -unwind-tables-optional |&\ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |&\ ; RUN: grep {asm-printer} | grep 32 target datalayout = "e-p:32:32" Modified: llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll (original) +++ llvm/trunk/test/CodeGen/X86/2007-09-17-ObjcFrameEH.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin -enable-eh -unwind-tables-optional | grep {isNullOrNil].eh"} | count 2 +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin -enable-eh | grep {isNullOrNil].eh"} | count 2 %struct.NSString = type { } %struct._objc__method_prototype_list = type opaque Modified: llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll (original) +++ llvm/trunk/test/CodeGen/X86/constant-pool-remat-0.ll Mon Apr 14 12:56:54 2008 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -march=x86-64 | grep LCPI | count 3 -; RUN: llvm-as < %s | llc -march=x86-64 -stats -unwind-tables-optional -info-output-file - | grep asm-printer | grep 6 +; RUN: llvm-as < %s | llc -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 6 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep LCPI | count 3 -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -unwind-tables-optional -info-output-file - | grep asm-printer | grep 8 +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats -info-output-file - | grep asm-printer | grep 8 declare fastcc float @qux(float %y) Modified: llvm/trunk/test/CodeGen/X86/dagcombine-cse.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dagcombine-cse.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/dagcombine-cse.ll (original) +++ llvm/trunk/test/CodeGen/X86/dagcombine-cse.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -unwind-tables-optional -stats |& grep asm-printer | grep 14 +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -stats |& grep asm-printer | grep 14 define i32 @t(i8* %ref_frame_ptr, i32 %ref_frame_stride, i32 %idxX, i32 %idxY) nounwind { entry: Modified: llvm/trunk/test/CodeGen/X86/iabs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/iabs.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/iabs.ll (original) +++ llvm/trunk/test/CodeGen/X86/iabs.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86-64 -stats -unwind-tables-optional |& \ +; RUN: llvm-as < %s | llc -march=x86-64 -stats |& \ ; RUN: grep {6 .*Number of machine instrs printed} ;; Integer absolute value, should produce something at least as good as: Modified: llvm/trunk/test/CodeGen/X86/or-branch.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/or-branch.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/or-branch.ll (original) +++ llvm/trunk/test/CodeGen/X86/or-branch.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -unwind-tables-optional | not grep set +; RUN: llvm-as < %s | llc -march=x86 | not grep set define void @foo(i32 %X, i32 %Y, i32 %Z) nounwind { entry: Modified: llvm/trunk/test/CodeGen/X86/select.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/select.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/select.ll (original) +++ llvm/trunk/test/CodeGen/X86/select.ll Mon Apr 14 12:56:54 2008 @@ -1,6 +1,6 @@ -; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium -unwind-tables-optional -; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -unwind-tables-optional -; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -unwind-tables-optional | not grep set +; RUN: llvm-as < %s | llc -march=x86 -mcpu=pentium +; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah +; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep set define i1 @boolSel(i1 %A, i1 %B, i1 %C) nounwind { %X = select i1 %A, i1 %B, i1 %C ; [#uses=1] Modified: llvm/trunk/test/CodeGen/X86/setuge.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/setuge.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/setuge.ll (original) +++ llvm/trunk/test/CodeGen/X86/setuge.ll Mon Apr 14 12:56:54 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -unwind-tables-optional | not grep set +; RUN: llvm-as < %s | llc -march=x86 | not grep set declare i1 @llvm.isunordered.f32(float, float) Modified: llvm/trunk/test/CodeGen/X86/zero-remat.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/zero-remat.ll?rev=49667&r1=49666&r2=49667&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/zero-remat.ll (original) +++ llvm/trunk/test/CodeGen/X86/zero-remat.ll Mon Apr 14 12:56:54 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86-64 | grep xor | count 4 -; RUN: llvm-as < %s | llc -march=x86-64 -stats -unwind-tables-optional -info-output-file - | grep asm-printer | grep 12 +; RUN: llvm-as < %s | llc -march=x86-64 -stats -info-output-file - | grep asm-printer | grep 12 ; RUN: llvm-as < %s | llc -march=x86 | grep fldz ; RUN: llvm-as < %s | llc -march=x86 | not grep fldl From echristo at apple.com Mon Apr 14 12:58:16 2008 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Apr 2008 10:58:16 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49653 - /llvm-gcc-4.2/trunk/GNUmakefile In-Reply-To: <200804141720.m3EHKBPX014102@zion.cs.uiuc.edu> References: <200804141720.m3EHKBPX014102@zion.cs.uiuc.edu> Message-ID: > > ifndef DISABLE_LLVM > ENABLE_LLVM = true > -# LLVM gets installed into /usr/local, not /usr. > +# LLVM gets installed into /Developer/usr/local, not /usr. Shouldn't it be installed into both if /Developer exists? -eric From baldrick at free.fr Mon Apr 14 13:03:54 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 14 Apr 2008 20:03:54 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r49655 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-convert.cpp In-Reply-To: <200804141736.m3EHaeLt014599@zion.cs.uiuc.edu> References: <200804141736.m3EHaeLt014599@zion.cs.uiuc.edu> Message-ID: <200804142003.55491.baldrick@free.fr> Hi Devang, > +#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,Rs,B) \ > + llvm_default_build_multiple_return_value((Fn),(R),(RetVals),(B)) Rs in the first line became RetVals in the second line. Ciao, Duncan. From dpatel at apple.com Mon Apr 14 13:16:19 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 11:16:19 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49653 - /llvm-gcc-4.2/trunk/GNUmakefile In-Reply-To: References: <200804141720.m3EHKBPX014102@zion.cs.uiuc.edu> Message-ID: <6EEF511A-005E-4277-91CA-11A543338729@apple.com> On Apr 14, 2008, at 10:58 AM, Eric Christopher wrote: >> >> ifndef DISABLE_LLVM >> ENABLE_LLVM = true >> -# LLVM gets installed into /usr/local, not /usr. >> +# LLVM gets installed into /Developer/usr/local, not /usr. > > Shouldn't it be installed into both if /Developer exists? Nope :) - Devang From gohman at apple.com Mon Apr 14 13:19:37 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 18:19:37 -0000 Subject: [llvm-commits] [llvm] r49669 - in /llvm/trunk/test: CodeGen/CellSPU/ctpop.ll Feature/intrinsics.ll Message-ID: <200804141819.m3EIJcn3016134@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 13:19:18 2008 New Revision: 49669 URL: http://llvm.org/viewvc/llvm-project?rev=49669&view=rev Log: Upgrade these tests for the current intrinsic prototypes. Modified: llvm/trunk/test/CodeGen/CellSPU/ctpop.ll llvm/trunk/test/Feature/intrinsics.ll Modified: llvm/trunk/test/CodeGen/CellSPU/ctpop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/ctpop.ll?rev=49669&r1=49668&r2=49669&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/ctpop.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/ctpop.ll Mon Apr 14 13:19:18 2008 @@ -6,19 +6,19 @@ target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" target triple = "spu" -declare i32 @llvm.ctpop.i8(i8) -declare i32 @llvm.ctpop.i16(i16) +declare i8 @llvm.ctpop.i8(i8) +declare i16 @llvm.ctpop.i16(i16) declare i32 @llvm.ctpop.i32(i32) define i32 @test_i8(i8 %X) { - call i32 @llvm.ctpop.i8(i8 %X) - %Y = bitcast i32 %1 to i32 + call i8 @llvm.ctpop.i8(i8 %X) + %Y = zext i8 %1 to i32 ret i32 %Y } define i32 @test_i16(i16 %X) { - call i32 @llvm.ctpop.i16(i16 %X) - %Y = bitcast i32 %1 to i32 + call i16 @llvm.ctpop.i16(i16 %X) + %Y = zext i16 %1 to i32 ret i32 %Y } Modified: llvm/trunk/test/Feature/intrinsics.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/intrinsics.ll?rev=49669&r1=49668&r2=49669&view=diff ============================================================================== --- llvm/trunk/test/Feature/intrinsics.ll (original) +++ llvm/trunk/test/Feature/intrinsics.ll Mon Apr 14 13:19:18 2008 @@ -8,29 +8,29 @@ declare void @llvm.prefetch(i8*, i32, i32) -declare i32 @llvm.ctpop.i8(i8) +declare i8 @llvm.ctpop.i8(i8) -declare i32 @llvm.ctpop.i16(i16) +declare i16 @llvm.ctpop.i16(i16) declare i32 @llvm.ctpop.i32(i32) -declare i32 @llvm.ctpop.i64(i64) +declare i64 @llvm.ctpop.i64(i64) -declare i32 @llvm.cttz.i8(i8) +declare i8 @llvm.cttz.i8(i8) -declare i32 @llvm.cttz.i16(i16) +declare i16 @llvm.cttz.i16(i16) declare i32 @llvm.cttz.i32(i32) -declare i32 @llvm.cttz.i64(i64) +declare i64 @llvm.cttz.i64(i64) -declare i32 @llvm.ctlz.i8(i8) +declare i8 @llvm.ctlz.i8(i8) -declare i32 @llvm.ctlz.i16(i16) +declare i16 @llvm.ctlz.i16(i16) declare i32 @llvm.ctlz.i32(i32) -declare i32 @llvm.ctlz.i64(i64) +declare i64 @llvm.ctlz.i64(i64) declare float @llvm.sqrt.f32(float) @@ -44,18 +44,18 @@ call void @llvm.prefetch( i8* null, i32 1, i32 3 ) call float @llvm.sqrt.f32( float 5.000000e+00 ) ; :3 [#uses=0] call double @llvm.sqrt.f64( double 6.000000e+00 ) ; :4 [#uses=0] - call i32 @llvm.ctpop.i8( i8 10 ) ; :5 [#uses=0] - call i32 @llvm.ctpop.i16( i16 11 ) ; :6 [#uses=0] + call i8 @llvm.ctpop.i8( i8 10 ) ; :5 [#uses=0] + call i16 @llvm.ctpop.i16( i16 11 ) ; :6 [#uses=0] call i32 @llvm.ctpop.i32( i32 12 ) ; :7 [#uses=0] - call i32 @llvm.ctpop.i64( i64 13 ) ; :8 [#uses=0] - call i32 @llvm.ctlz.i8( i8 14 ) ; :9 [#uses=0] - call i32 @llvm.ctlz.i16( i16 15 ) ; :10 [#uses=0] + call i64 @llvm.ctpop.i64( i64 13 ) ; :8 [#uses=0] + call i8 @llvm.ctlz.i8( i8 14 ) ; :9 [#uses=0] + call i16 @llvm.ctlz.i16( i16 15 ) ; :10 [#uses=0] call i32 @llvm.ctlz.i32( i32 16 ) ; :11 [#uses=0] - call i32 @llvm.ctlz.i64( i64 17 ) ; :12 [#uses=0] - call i32 @llvm.cttz.i8( i8 18 ) ; :13 [#uses=0] - call i32 @llvm.cttz.i16( i16 19 ) ; :14 [#uses=0] + call i64 @llvm.ctlz.i64( i64 17 ) ; :12 [#uses=0] + call i8 @llvm.cttz.i8( i8 18 ) ; :13 [#uses=0] + call i16 @llvm.cttz.i16( i16 19 ) ; :14 [#uses=0] call i32 @llvm.cttz.i32( i32 20 ) ; :15 [#uses=0] - call i32 @llvm.cttz.i64( i64 21 ) ; :16 [#uses=0] + call i64 @llvm.cttz.i64( i64 21 ) ; :16 [#uses=0] ret void } From gohman at apple.com Mon Apr 14 13:24:08 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 18:24:08 -0000 Subject: [llvm-commits] [llvm] r49670 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200804141824.m3EIOA6v016312@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 13:23:56 2008 New Revision: 49670 URL: http://llvm.org/viewvc/llvm-project?rev=49670&view=rev Log: In the special case, call the comparison function instead of manually performing the comparison. This allows the special case to work correctly even in the case where someone is experimenting with a different comparison function :-). Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49670&r1=49669&r2=49670&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Apr 14 13:23:56 2008 @@ -431,7 +431,7 @@ /// than the complexity of the RHS. This comparator is used to canonicalize /// expressions. struct VISIBILITY_HIDDEN SCEVComplexityCompare { - bool operator()(SCEV *LHS, SCEV *RHS) { + bool operator()(const SCEV *LHS, const SCEV *RHS) const { return LHS->getSCEVType() < RHS->getSCEVType(); } }; @@ -452,7 +452,7 @@ if (Ops.size() == 2) { // This is the common case, which also happens to be trivially simple. // Special case it. - if (Ops[0]->getSCEVType() > Ops[1]->getSCEVType()) + if (SCEVComplexityCompare()(Ops[1], Ops[0])) std::swap(Ops[0], Ops[1]); return; } From gohman at apple.com Mon Apr 14 13:26:20 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 18:26:20 -0000 Subject: [llvm-commits] [llvm] r49671 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200804141826.m3EIQKXr016390@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 13:26:16 2008 New Revision: 49671 URL: http://llvm.org/viewvc/llvm-project?rev=49671&view=rev Log: Minor whitespace and comment cleanups. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=49671&r1=49670&r2=49671&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Apr 14 13:26:16 2008 @@ -430,7 +430,7 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L, SmallPtrSet &Processed) { if (!I->getType()->isInteger() && !isa(I->getType())) - return false; // Void and FP expressions cannot be reduced. + return false; // Void and FP expressions cannot be reduced. if (!Processed.insert(I)) return true; // Instruction already handled. @@ -1072,7 +1072,7 @@ return Val.isUseOfPostIncrementedValue; } -/// isNonConstantNegative - REturn true if the specified scev is negated, but +/// isNonConstantNegative - Return true if the specified scev is negated, but /// not a constant. static bool isNonConstantNegative(const SCEVHandle &Expr) { SCEVMulExpr *Mul = dyn_cast(Expr); @@ -1367,7 +1367,7 @@ // We want this constant emitted into the preheader! This is just // using cast as a copy so BitCast (no-op cast) is appropriate BaseV = new BitCastInst(BaseV, BaseV->getType(), "preheaderinsert", - PreInsertPt); + PreInsertPt); } } From dpatel at apple.com Mon Apr 14 13:32:51 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 18:32:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49673 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h Message-ID: <200804141832.m3EIWrLg016607@zion.cs.uiuc.edu> Author: dpatel Date: Mon Apr 14 13:32:41 2008 New Revision: 49673 URL: http://llvm.org/viewvc/llvm-project?rev=49673&view=rev Log: Fix typo. Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h 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=49673&r1=49672&r2=49673&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Apr 14 13:32:41 2008 @@ -300,7 +300,7 @@ // 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(Fn,R,RetVals,B) -#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,Rs,B) \ +#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,RetVals,B) \ llvm_default_build_multiple_return_value((Fn),(R),(RetVals),(B)) #endif From dpatel at apple.com Mon Apr 14 13:33:00 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 11:33:00 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49655 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-convert.cpp In-Reply-To: <200804142003.55491.baldrick@free.fr> References: <200804141736.m3EHaeLt014599@zion.cs.uiuc.edu> <200804142003.55491.baldrick@free.fr> Message-ID: On Apr 14, 2008, at 11:03 AM, Duncan Sands wrote: > Hi Devang, > >> +#define LLVM_BUILD_MULTIPLE_RETURN_VALUE(Fn,R,Rs,B) \ >> + llvm_default_build_multiple_return_value((Fn),(R),(RetVals),(B)) > > Rs in the first line became RetVals in the second line. Yup. Fixed. Thanks! - Devang From gohman at apple.com Mon Apr 14 13:34:51 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 18:34:51 -0000 Subject: [llvm-commits] [llvm] r49674 - in /llvm/trunk: include/llvm/Analysis/AliasSetTracker.h lib/Analysis/AliasSetTracker.cpp Message-ID: <200804141834.m3EIYp1E016680@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 13:34:50 2008 New Revision: 49674 URL: http://llvm.org/viewvc/llvm-project?rev=49674&view=rev Log: Teach AliasSetTracker about VAArgInst. Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h llvm/trunk/lib/Analysis/AliasSetTracker.cpp Modified: llvm/trunk/include/llvm/Analysis/AliasSetTracker.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AliasSetTracker.h?rev=49674&r1=49673&r2=49674&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/AliasSetTracker.h (original) +++ llvm/trunk/include/llvm/Analysis/AliasSetTracker.h Mon Apr 14 13:34:50 2008 @@ -29,6 +29,7 @@ class LoadInst; class StoreInst; class FreeInst; +class VAArgInst; class AliasSetTracker; class AliasSet; @@ -281,6 +282,7 @@ bool add(LoadInst *LI); bool add(StoreInst *SI); bool add(FreeInst *FI); + bool add(VAArgInst *VAAI); bool add(CallSite CS); // Call/Invoke instructions bool add(CallInst *CI) { return add(CallSite(CI)); } bool add(InvokeInst *II) { return add(CallSite(II)); } @@ -295,6 +297,7 @@ bool remove(LoadInst *LI); bool remove(StoreInst *SI); bool remove(FreeInst *FI); + bool remove(VAArgInst *VAAI); bool remove(CallSite CS); bool remove(CallInst *CI) { return remove(CallSite(CI)); } bool remove(InvokeInst *II) { return remove(CallSite(II)); } Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=49674&r1=49673&r2=49674&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original) +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Mon Apr 14 13:34:50 2008 @@ -292,6 +292,12 @@ return NewPtr; } +bool AliasSetTracker::add(VAArgInst *VAAI) { + bool NewPtr; + addPointer(VAAI->getOperand(0), ~0, AliasSet::ModRef, NewPtr); + return NewPtr; +} + bool AliasSetTracker::add(CallSite CS) { if (AA.doesNotAccessMemory(CS)) @@ -321,6 +327,8 @@ return add(II); else if (FreeInst *FI = dyn_cast(I)) return add(FI); + else if (VAArgInst *VAAI = dyn_cast(I)) + return add(VAAI); return true; } @@ -414,6 +422,13 @@ return true; } +bool AliasSetTracker::remove(VAArgInst *VAAI) { + AliasSet *AS = findAliasSetForPointer(VAAI->getOperand(0), ~0); + if (!AS) return false; + remove(*AS); + return true; +} + bool AliasSetTracker::remove(CallSite CS) { if (AA.doesNotAccessMemory(CS)) return false; // doesn't alias anything @@ -434,6 +449,8 @@ return remove(CI); else if (FreeInst *FI = dyn_cast(I)) return remove(FI); + else if (VAArgInst *VAAI = dyn_cast(I)) + return remove(VAAI); return true; } From evan.cheng at apple.com Mon Apr 14 13:37:56 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 14 Apr 2008 11:37:56 -0700 Subject: [llvm-commits] [llvm] r49572 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ test/CodeGen/X86/ In-Reply-To: <200804120436.m3C4aAR9024610@zion.cs.uiuc.edu> References: <200804120436.m3C4aAR9024610@zion.cs.uiuc.edu> Message-ID: Thanks. My only concern is lowering these into target specific code early might potentially inhibit some optimization. Do you see that happening at all? Evan On Apr 11, 2008, at 9:36 PM, Dan Gohman wrote: > Author: djg > Date: Fri Apr 11 23:36:06 2008 > New Revision: 49572 > > URL: http://llvm.org/viewvc/llvm-project?rev=49572&view=rev > Log: > Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal > on any current target and aren't optimized in DAGCombiner. Instead > of using intermediate nodes, expand the operations, choosing between > simple loads/stores, target-specific code, and library calls, > immediately. > > Previously, the code to emit optimized code for these operations > was only used at initial SelectionDAG construction time; now it is > used at all times. This fixes some cases where rep;movs was being > used for small copies where simple loads/stores would be better. > > This also cleans up code that checks for alignments less than 4; > let the targets make that decision instead of doing it in > target-independent code. This allows x86 to use rep;movs in > low-alignment cases. > > Also, this fixes a bug that resulted in the use of rep;stos for > memsets of 0 with non-constant memory size when the alignment was > at least 4. It's better to use the library in this case, which > can be significantly faster when the size is large. > > This also preserves more SourceValue information when memory > intrinsics are lowered into simple loads/stores. > > Added: > llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll > llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll > Modified: > llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > llvm/trunk/include/llvm/Target/TargetLowering.h > llvm/trunk/include/llvm/Target/TargetSubtarget.h > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp > llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > llvm/trunk/lib/Target/ARM/ARMISelLowering.h > llvm/trunk/lib/Target/ARM/ARMSubtarget.h > llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp > llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp > llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp > llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp > llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > llvm/trunk/lib/Target/X86/X86ISelLowering.h > llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx > llvm/trunk/test/CodeGen/X86/byval2.ll > llvm/trunk/test/CodeGen/X86/byval3.ll > llvm/trunk/test/CodeGen/X86/byval4.ll > llvm/trunk/test/CodeGen/X86/byval5.ll > llvm/trunk/test/CodeGen/X86/byval7.ll > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Apr 11 > 23:36:06 2008 > @@ -323,17 +323,20 @@ > SDOperand getNode(unsigned Opcode, SDVTList VTs, > const SDOperand *Ops, unsigned NumOps); > > - SDOperand getMemcpy(SDOperand Chain, SDOperand Dest, SDOperand Src, > - SDOperand Size, SDOperand Align, > - SDOperand AlwaysInline); > - > - SDOperand getMemmove(SDOperand Chain, SDOperand Dest, SDOperand > Src, > - SDOperand Size, SDOperand Align, > - SDOperand AlwaysInline); > - > - SDOperand getMemset(SDOperand Chain, SDOperand Dest, SDOperand Src, > - SDOperand Size, SDOperand Align, > - SDOperand AlwaysInline); > + SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff); > + > + SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff); > + > + SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + Value *DstSV, uint64_t DstOff); > > /// getSetCC - Helper function to make it easier to build SetCC's > if you just > /// have an ISD::CondCode instead of an SDOperand. > > Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) > +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 11 > 23:36:06 2008 > @@ -497,14 +497,6 @@ > // it returns an output chain. > STACKRESTORE, > > - // MEMSET/MEMCPY/MEMMOVE - The first operand is the chain. The > following > - // correspond to the operands of the LLVM intrinsic functions > and the last > - // one is AlwaysInline. The only result is a token chain. The > alignment > - // argument is guaranteed to be a Constant node. > - MEMSET, > - MEMMOVE, > - MEMCPY, > - > // CALLSEQ_START/CALLSEQ_END - These operators mark the > beginning and end of > // a call sequence, and carry arbitrary information that target > might want > // to know. The first operand is a chain, the rest are > specified by the > > Modified: llvm/trunk/include/llvm/Target/TargetLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) > +++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Apr 11 > 23:36:06 2008 > @@ -948,17 +948,60 @@ > SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); > > > - virtual SDOperand LowerMEMCPY(SDOperand Op, SelectionDAG &DAG); > - virtual SDOperand LowerMEMCPYCall(SDOperand Chain, SDOperand Dest, > - SDOperand Source, SDOperand > Count, > - SelectionDAG &DAG); > - virtual SDOperand LowerMEMCPYInline(SDOperand Chain, SDOperand > Dest, > - SDOperand Source, unsigned > Size, > - unsigned Align, SelectionDAG > &DAG) { > - assert(0 && "Not Implemented"); > - return SDOperand(); // this is here to silence compiler errors > + /// EmitTargetCodeForMemcpy - Emit target-specific code that > performs a > + /// memcpy. This can be used by targets to provide code sequences > for cases > + /// that don't fit the target's parameters for simple loads/ > stores and can be > + /// more efficient than using a library call. This function can > return a null > + /// SDOperand if the target declines to use inline code and a > different > + /// lowering strategy should be used. > + /// > + /// If AlwaysInline is true, the size is constant and the target > should not > + /// emit any calls and is strongly encouraged to attempt to emit > inline code > + /// even if it is beyond the usual threshold because this > intrinsic is being > + /// expanded in a place where calls are not feasible (e.g. within > the prologue > + /// for another call). If the target chooses to decline an > AlwaysInline > + /// request here, legalize will resort to using simple loads and > stores. > + virtual SDOperand > + EmitTargetCodeForMemcpy(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Op1, SDOperand Op2, > + SDOperand Op3, unsigned Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff) { > + return SDOperand(); > } > > + /// EmitTargetCodeForMemmove - Emit target-specific code that > performs a > + /// memmove. This can be used by targets to provide code > sequences for cases > + /// that don't fit the target's parameters for simple loads/ > stores and can be > + /// more efficient than using a library call. This function can > return a null > + /// SDOperand if the target declines to use code and a different > lowering > + /// strategy should be used. > + virtual SDOperand > + EmitTargetCodeForMemmove(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Op1, SDOperand Op2, > + SDOperand Op3, unsigned Align, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff) { > + return SDOperand(); > + } > + > + /// EmitTargetCodeForMemset - Emit target-specific code that > performs a > + /// memset. This can be used by targets to provide code sequences > for cases > + /// that don't fit the target's parameters for simple stores and > can be more > + /// efficient than using a library call. This function can return > a null > + /// SDOperand if the target declines to use code and a different > lowering > + /// strategy should be used. > + virtual SDOperand > + EmitTargetCodeForMemset(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Op1, SDOperand Op2, > + SDOperand Op3, unsigned Align, > + Value *DstSV, uint64_t DstOff) { > + return SDOperand(); > + } > > /// LowerOperation - This callback is invoked for operations that > are > /// unsupported by the target, which are registered to use > 'custom' lowering, > > Modified: llvm/trunk/include/llvm/Target/TargetSubtarget.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSubtarget.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Target/TargetSubtarget.h (original) > +++ llvm/trunk/include/llvm/Target/TargetSubtarget.h Fri Apr 11 > 23:36:06 2008 > @@ -28,9 +28,6 @@ > protected: // Can only create subclasses... > TargetSubtarget(); > public: > - /// getMaxInlineSizeThreshold - Returns the maximum memset / > memcpy size > - /// that still makes it profitable to inline the call. > - virtual unsigned getMaxInlineSizeThreshold() const {return 0; } > virtual ~TargetSubtarget(); > }; > > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Apr 11 > 23:36:06 2008 > @@ -22,6 +22,7 @@ > #include "llvm/Target/TargetData.h" > #include "llvm/Target/TargetMachine.h" > #include "llvm/Target/TargetOptions.h" > +#include "llvm/Target/TargetSubtarget.h" > #include "llvm/CallingConv.h" > #include "llvm/Constants.h" > #include "llvm/DerivedTypes.h" > @@ -2842,123 +2843,6 @@ > break; > } > break; > - case ISD::MEMSET: > - case ISD::MEMCPY: > - case ISD::MEMMOVE: { > - Tmp1 = LegalizeOp(Node->getOperand(0)); // Chain > - Tmp2 = LegalizeOp(Node->getOperand(1)); // Pointer > - > - if (Node->getOpcode() == ISD::MEMSET) { // memset = ubyte > - switch (getTypeAction(Node->getOperand(2).getValueType())) { > - case Expand: assert(0 && "Cannot expand a byte!"); > - case Legal: > - Tmp3 = LegalizeOp(Node->getOperand(2)); > - break; > - case Promote: > - Tmp3 = PromoteOp(Node->getOperand(2)); > - break; > - } > - } else { > - Tmp3 = LegalizeOp(Node->getOperand(2)); // memcpy/move = > pointer, > - } > - > - SDOperand Tmp4; > - switch (getTypeAction(Node->getOperand(3).getValueType())) { > - case Expand: { > - // Length is too big, just take the lo-part of the length. > - SDOperand HiPart; > - ExpandOp(Node->getOperand(3), Tmp4, HiPart); > - break; > - } > - case Legal: > - Tmp4 = LegalizeOp(Node->getOperand(3)); > - break; > - case Promote: > - Tmp4 = PromoteOp(Node->getOperand(3)); > - break; > - } > - > - SDOperand Tmp5; > - switch (getTypeAction(Node->getOperand(4).getValueType())) > { // uint > - case Expand: assert(0 && "Cannot expand this yet!"); > - case Legal: > - Tmp5 = LegalizeOp(Node->getOperand(4)); > - break; > - case Promote: > - Tmp5 = PromoteOp(Node->getOperand(4)); > - break; > - } > - > - SDOperand Tmp6; > - switch (getTypeAction(Node->getOperand(5).getValueType())) > { // bool > - case Expand: assert(0 && "Cannot expand this yet!"); > - case Legal: > - Tmp6 = LegalizeOp(Node->getOperand(5)); > - break; > - case Promote: > - Tmp6 = PromoteOp(Node->getOperand(5)); > - break; > - } > - > - switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) { > - default: assert(0 && "This action not implemented for this > operation!"); > - case TargetLowering::Custom: > - isCustom = true; > - // FALLTHROUGH > - case TargetLowering::Legal: { > - SDOperand Ops[] = { Tmp1, Tmp2, Tmp3, Tmp4, Tmp5, Tmp6 }; > - Result = DAG.UpdateNodeOperands(Result, Ops, 6); > - if (isCustom) { > - Tmp1 = TLI.LowerOperation(Result, DAG); > - if (Tmp1.Val) Result = Tmp1; > - } > - break; > - } > - case TargetLowering::Expand: { > - // Otherwise, the target does not support this operation. > Lower the > - // operation to an explicit libcall as appropriate. > - MVT::ValueType IntPtr = TLI.getPointerTy(); > - const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType(); > - TargetLowering::ArgListTy Args; > - TargetLowering::ArgListEntry Entry; > - > - const char *FnName = 0; > - if (Node->getOpcode() == ISD::MEMSET) { > - Entry.Node = Tmp2; Entry.Ty = IntPtrTy; > - Args.push_back(Entry); > - // Extend the (previously legalized) ubyte argument to be > an int value > - // for the call. > - if (Tmp3.getValueType() > MVT::i32) > - Tmp3 = DAG.getNode(ISD::TRUNCATE, MVT::i32, Tmp3); > - else > - Tmp3 = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Tmp3); > - Entry.Node = Tmp3; Entry.Ty = Type::Int32Ty; Entry.isSExt = > true; > - Args.push_back(Entry); > - Entry.Node = Tmp4; Entry.Ty = IntPtrTy; Entry.isSExt = false; > - Args.push_back(Entry); > - > - FnName = "memset"; > - } else if (Node->getOpcode() == ISD::MEMCPY || > - Node->getOpcode() == ISD::MEMMOVE) { > - Entry.Ty = IntPtrTy; > - Entry.Node = Tmp2; Args.push_back(Entry); > - Entry.Node = Tmp3; Args.push_back(Entry); > - Entry.Node = Tmp4; Args.push_back(Entry); > - FnName = Node->getOpcode() == ISD::MEMMOVE ? "memmove" : > "memcpy"; > - } else { > - assert(0 && "Unknown op!"); > - } > - > - std::pair CallResult = > - TLI.LowerCallTo(Tmp1, Type::VoidTy, > - false, false, false, CallingConv::C, false, > - DAG.getExternalSymbol(FnName, IntPtr), > Args, DAG); > - Result = CallResult.second; > - break; > - } > - } > - break; > - } > > case ISD::SHL_PARTS: > case ISD::SRA_PARTS: > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Apr 11 > 23:36:06 2008 > @@ -439,51 +439,6 @@ > return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0); > } > > -/// HandleMemIntrinsic - This handles memcpy/memset/memmove with > invalid > -/// operands. This promotes or expands the operands as required. > -SDOperand DAGTypeLegalizer::HandleMemIntrinsic(SDNode *N) { > - // The chain and pointer [operands #0 and #1] are always valid > types. > - SDOperand Chain = N->getOperand(0); > - SDOperand Ptr = N->getOperand(1); > - SDOperand Op2 = N->getOperand(2); > - > - // Op #2 is either a value (memset) or a pointer. Promote it if > required. > - switch (getTypeAction(Op2.getValueType())) { > - default: assert(0 && "Unknown action for pointer/value operand"); > - case Legal: break; > - case Promote: Op2 = GetPromotedOp(Op2); break; > - } > - > - // The length could have any action required. > - SDOperand Length = N->getOperand(3); > - switch (getTypeAction(Length.getValueType())) { > - default: assert(0 && "Unknown action for memop operand"); > - case Legal: break; > - case Promote: Length = GetPromotedZExtOp(Length); break; > - case Expand: > - SDOperand Dummy; // discard the high part. > - GetExpandedOp(Length, Length, Dummy); > - break; > - } > - > - SDOperand Align = N->getOperand(4); > - switch (getTypeAction(Align.getValueType())) { > - default: assert(0 && "Unknown action for memop operand"); > - case Legal: break; > - case Promote: Align = GetPromotedZExtOp(Align); break; > - } > - > - SDOperand AlwaysInline = N->getOperand(5); > - switch (getTypeAction(AlwaysInline.getValueType())) { > - default: assert(0 && "Unknown action for memop operand"); > - case Legal: break; > - case Promote: AlwaysInline = GetPromotedZExtOp(AlwaysInline); > break; > - } > - > - SDOperand Ops[] = { Chain, Ptr, Op2, Length, Align, AlwaysInline }; > - return DAG.UpdateNodeOperands(SDOperand(N, 0), Ops, 6); > -} > - > /// JoinIntegers - Build an integer with low bits Lo and high bits Hi. > SDOperand DAGTypeLegalizer::JoinIntegers(SDOperand Lo, SDOperand Hi) { > MVT::ValueType LVT = Lo.getValueType(); > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Fri Apr 11 > 23:36:06 2008 > @@ -165,7 +165,6 @@ > // Common routines. > SDOperand BitConvertToInteger(SDOperand Op); > SDOperand CreateStackStoreLoad(SDOperand Op, MVT::ValueType DestVT); > - SDOperand HandleMemIntrinsic(SDNode *N); > SDOperand JoinIntegers(SDOperand Lo, SDOperand Hi); > void SplitInteger(SDOperand Op, SDOperand &Lo, SDOperand &Hi); > void SplitInteger(SDOperand Op, MVT::ValueType LoVT, > MVT::ValueType HiVT, > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp > (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Fri > Apr 11 23:36:06 2008 > @@ -946,9 +946,6 @@ > case ISD::STORE: > Res = ExpandOperand_STORE(cast(N), OpNo); > break; > - case ISD::MEMSET: > - case ISD::MEMCPY: > - case ISD::MEMMOVE: Res = HandleMemIntrinsic(N); break; > > case ISD::BUILD_VECTOR: Res = ExpandOperand_BUILD_VECTOR(N); > break; > } > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp > (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp Fri > Apr 11 23:36:06 2008 > @@ -447,9 +447,6 @@ > > case ISD::STORE: Res = > PromoteOperand_STORE(cast(N), > OpNo); break; > - case ISD::MEMSET: > - case ISD::MEMCPY: > - case ISD::MEMMOVE: Res = HandleMemIntrinsic(N); break; > > case ISD::BUILD_VECTOR: Res = PromoteOperand_BUILD_VECTOR(N); break; > case ISD::INSERT_VECTOR_ELT: > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Apr 11 > 23:36:06 2008 > @@ -17,6 +17,7 @@ > #include "llvm/Intrinsics.h" > #include "llvm/DerivedTypes.h" > #include "llvm/Assembly/Writer.h" > +#include "llvm/CallingConv.h" > #include "llvm/CodeGen/MachineBasicBlock.h" > #include "llvm/CodeGen/MachineConstantPool.h" > #include "llvm/CodeGen/MachineFrameInfo.h" > @@ -2385,28 +2386,357 @@ > return getNode(Opcode, VT, Ops, 5); > } > > -SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dest, > - SDOperand Src, SDOperand Size, > - SDOperand Align, > - SDOperand AlwaysInline) { > - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; > - return getNode(ISD::MEMCPY, MVT::Other, Ops, 6); > +/// getMemsetValue - Vectorized representation of the memset value > +/// operand. > +static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT, > + SelectionDAG &DAG) { > + MVT::ValueType CurVT = VT; > + if (ConstantSDNode *C = dyn_cast(Value)) { > + uint64_t Val = C->getValue() & 255; > + unsigned Shift = 8; > + while (CurVT != MVT::i8) { > + Val = (Val << Shift) | Val; > + Shift <<= 1; > + CurVT = (MVT::ValueType)((unsigned)CurVT - 1); > + } > + return DAG.getConstant(Val, VT); > + } else { > + Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value); > + unsigned Shift = 8; > + while (CurVT != MVT::i8) { > + Value = > + DAG.getNode(ISD::OR, VT, > + DAG.getNode(ISD::SHL, VT, Value, > + DAG.getConstant(Shift, MVT::i8)), > Value); > + Shift <<= 1; > + CurVT = (MVT::ValueType)((unsigned)CurVT - 1); > + } > + > + return Value; > + } > } > > -SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dest, > +/// getMemsetStringVal - Similar to getMemsetValue. Except this is > only > +/// used when a memcpy is turned into a memset when the source is a > constant > +/// string ptr. > +static SDOperand getMemsetStringVal(MVT::ValueType VT, > + SelectionDAG &DAG, > + const TargetLowering &TLI, > + std::string &Str, unsigned > Offset) { > + uint64_t Val = 0; > + unsigned MSB = MVT::getSizeInBits(VT) / 8; > + if (TLI.isLittleEndian()) > + Offset = Offset + MSB - 1; > + for (unsigned i = 0; i != MSB; ++i) { > + Val = (Val << 8) | (unsigned char)Str[Offset]; > + Offset += TLI.isLittleEndian() ? -1 : 1; > + } > + return DAG.getConstant(Val, VT); > +} > + > +/// getMemBasePlusOffset - Returns base and offset node for the > +static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned > Offset, > + SelectionDAG &DAG) { > + MVT::ValueType VT = Base.getValueType(); > + return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, > VT)); > +} > + > +/// MeetsMaxMemopRequirement - Determines if the number of memory > ops required > +/// to replace the memset / memcpy is below the threshold. It also > returns the > +/// types of the sequence of memory ops to perform memset / memcpy. > +static bool MeetsMaxMemopRequirement(std::vector > &MemOps, > + unsigned Limit, uint64_t Size, > + unsigned Align, > + const TargetLowering &TLI) { > + MVT::ValueType VT; > + > + if (TLI.allowsUnalignedMemoryAccesses()) { > + VT = MVT::i64; > + } else { > + switch (Align & 7) { > + case 0: > + VT = MVT::i64; > + break; > + case 4: > + VT = MVT::i32; > + break; > + case 2: > + VT = MVT::i16; > + break; > + default: > + VT = MVT::i8; > + break; > + } > + } > + > + MVT::ValueType LVT = MVT::i64; > + while (!TLI.isTypeLegal(LVT)) > + LVT = (MVT::ValueType)((unsigned)LVT - 1); > + assert(MVT::isInteger(LVT)); > + > + if (VT > LVT) > + VT = LVT; > + > + unsigned NumMemOps = 0; > + while (Size != 0) { > + unsigned VTSize = MVT::getSizeInBits(VT) / 8; > + while (VTSize > Size) { > + VT = (MVT::ValueType)((unsigned)VT - 1); > + VTSize >>= 1; > + } > + assert(MVT::isInteger(VT)); > + > + if (++NumMemOps > Limit) > + return false; > + MemOps.push_back(VT); > + Size -= VTSize; > + } > + > + return true; > +} > + > +static SDOperand getMemcpyLoadsAndStores(SelectionDAG &DAG, > + SDOperand Chain, SDOperand > Dst, > + SDOperand Src, uint64_t > Size, > + unsigned Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t > DstOff, > + Value *SrcSV, uint64_t > SrcOff) { > + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); > + > + // Expand memcpy to a series of store ops if the size operand > falls below > + // a certain threshold. > + std::vector MemOps; > + uint64_t Limit = -1; > + if (!AlwaysInline) > + Limit = TLI.getMaxStoresPerMemcpy(); > + if (!MeetsMaxMemopRequirement(MemOps, Limit, Size, Align, TLI)) > + return SDOperand(); > + > + SmallVector OutChains; > + > + unsigned NumMemOps = MemOps.size(); > + unsigned SrcDelta = 0; > + GlobalAddressSDNode *G = NULL; > + std::string Str; > + bool CopyFromStr = false; > + > + if (Src.getOpcode() == ISD::GlobalAddress) > + G = cast(Src); > + else if (Src.getOpcode() == ISD::ADD && > + Src.getOperand(0).getOpcode() == ISD::GlobalAddress && > + Src.getOperand(1).getOpcode() == ISD::Constant) { > + G = cast(Src.getOperand(0)); > + SrcDelta = cast(Src.getOperand(1))->getValue(); > + } > + if (G) { > + GlobalVariable *GV = dyn_cast(G->getGlobal()); > + if (GV && GV->isConstant()) { > + Str = GV->getStringValue(false); > + if (!Str.empty()) { > + CopyFromStr = true; > + SrcOff += SrcDelta; > + } > + } > + } > + > + for (unsigned i = 0; i < NumMemOps; i++) { > + MVT::ValueType VT = MemOps[i]; > + unsigned VTSize = MVT::getSizeInBits(VT) / 8; > + SDOperand Value, Store; > + > + if (CopyFromStr) { > + Value = getMemsetStringVal(VT, DAG, TLI, Str, SrcOff); > + Store = > + DAG.getStore(Chain, Value, > + getMemBasePlusOffset(Dst, DstOff, DAG), > + DstSV, DstOff); > + } else { > + Value = DAG.getLoad(VT, Chain, > + getMemBasePlusOffset(Src, SrcOff, DAG), > + SrcSV, SrcOff, false, Align); > + Store = > + DAG.getStore(Chain, Value, > + getMemBasePlusOffset(Dst, DstOff, DAG), > + DstSV, DstOff, false, Align); > + } > + OutChains.push_back(Store); > + SrcOff += VTSize; > + DstOff += VTSize; > + } > + > + return DAG.getNode(ISD::TokenFactor, MVT::Other, > + &OutChains[0], OutChains.size()); > +} > + > +static SDOperand getMemsetStores(SelectionDAG &DAG, > + SDOperand Chain, SDOperand Dst, > + SDOperand Src, uint64_t Size, > + unsigned Align, > + Value *DstSV, uint64_t DstOff) { > + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); > + > + // Expand memset to a series of load/store ops if the size operand > + // falls below a certain threshold. > + std::vector MemOps; > + if (!MeetsMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(), > + Size, Align, TLI)) > + return SDOperand(); > + > + SmallVector OutChains; > + > + unsigned NumMemOps = MemOps.size(); > + for (unsigned i = 0; i < NumMemOps; i++) { > + MVT::ValueType VT = MemOps[i]; > + unsigned VTSize = MVT::getSizeInBits(VT) / 8; > + SDOperand Value = getMemsetValue(Src, VT, DAG); > + SDOperand Store = DAG.getStore(Chain, Value, > + getMemBasePlusOffset(Dst, > DstOff, DAG), > + DstSV, DstOff); > + OutChains.push_back(Store); > + DstOff += VTSize; > + } > + > + return DAG.getNode(ISD::TokenFactor, MVT::Other, > + &OutChains[0], OutChains.size()); > +} > + > +SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dst, > SDOperand Src, SDOperand Size, > - SDOperand Align, > - SDOperand AlwaysInline) { > - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; > - return getNode(ISD::MEMMOVE, MVT::Other, Ops, 6); > + unsigned Align, bool AlwaysInline, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff) { > + > + // Check to see if we should lower the memcpy to loads and stores > first. > + // For cases within the target-specified limits, this is the best > choice. > + ConstantSDNode *ConstantSize = dyn_cast(Size); > + if (ConstantSize) { > + // Memcpy with size zero? Just return the original chain. > + if (ConstantSize->isNullValue()) > + return Chain; > + > + SDOperand Result = > + getMemcpyLoadsAndStores(*this, Chain, Dst, Src, ConstantSize- > >getValue(), > + Align, false, DstSV, DstOff, SrcSV, > SrcOff); > + if (Result.Val) > + return Result; > + } > + > + // Then check to see if we should lower the memcpy with target- > specific > + // code. If the target chooses to do this, this is the next best. > + SDOperand Result = > + TLI.EmitTargetCodeForMemcpy(*this, Chain, Dst, Src, Size, Align, > + AlwaysInline, > + DstSV, DstOff, SrcSV, SrcOff); > + if (Result.Val) > + return Result; > + > + // If we really need inline code and the target declined to > provide it, > + // use a (potentially long) sequence of loads and stores. > + if (AlwaysInline) { > + assert(ConstantSize && "AlwaysInline requires a constant size!"); > + return getMemcpyLoadsAndStores(*this, Chain, Dst, Src, > + ConstantSize->getValue(), Align, > true, > + DstSV, DstOff, SrcSV, SrcOff); > + } > + > + // Emit a library call. > + TargetLowering::ArgListTy Args; > + TargetLowering::ArgListEntry Entry; > + Entry.Ty = TLI.getTargetData()->getIntPtrType(); > + Entry.Node = Dst; Args.push_back(Entry); > + Entry.Node = Src; Args.push_back(Entry); > + Entry.Node = Size; Args.push_back(Entry); > + std::pair CallResult = > + TLI.LowerCallTo(Chain, Type::VoidTy, > + false, false, false, CallingConv::C, false, > + getExternalSymbol("memcpy", TLI.getPointerTy()), > + Args, *this); > + return CallResult.second; > +} > + > +SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dst, > + SDOperand Src, SDOperand Size, > + unsigned Align, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff) { > + > + // TODO: Optimize small memmove cases with simple loads and stores, > + // ensuring that all loads precede all stores. This can cause > severe > + // register pressure, so targets should be careful with the size > limit. > + > + // Then check to see if we should lower the memmove with target- > specific > + // code. If the target chooses to do this, this is the next best. > + SDOperand Result = > + TLI.EmitTargetCodeForMemmove(*this, Chain, Dst, Src, Size, Align, > + DstSV, DstOff, SrcSV, SrcOff); > + if (Result.Val) > + return Result; > + > + // Emit a library call. > + TargetLowering::ArgListTy Args; > + TargetLowering::ArgListEntry Entry; > + Entry.Ty = TLI.getTargetData()->getIntPtrType(); > + Entry.Node = Dst; Args.push_back(Entry); > + Entry.Node = Src; Args.push_back(Entry); > + Entry.Node = Size; Args.push_back(Entry); > + std::pair CallResult = > + TLI.LowerCallTo(Chain, Type::VoidTy, > + false, false, false, CallingConv::C, false, > + getExternalSymbol("memmove", TLI.getPointerTy()), > + Args, *this); > + return CallResult.second; > } > > -SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dest, > +SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dst, > SDOperand Src, SDOperand Size, > - SDOperand Align, > - SDOperand AlwaysInline) { > - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; > - return getNode(ISD::MEMSET, MVT::Other, Ops, 6); > + unsigned Align, > + Value *DstSV, uint64_t DstOff) { > + > + // Check to see if we should lower the memset to stores first. > + // For cases within the target-specified limits, this is the best > choice. > + ConstantSDNode *ConstantSize = dyn_cast(Size); > + if (ConstantSize) { > + // Memset with size zero? Just return the original chain. > + if (ConstantSize->isNullValue()) > + return Chain; > + > + SDOperand Result = > + getMemsetStores(*this, Chain, Dst, Src, ConstantSize- > >getValue(), Align, > + DstSV, DstOff); > + if (Result.Val) > + return Result; > + } > + > + // Then check to see if we should lower the memset with target- > specific > + // code. If the target chooses to do this, this is the next best. > + SDOperand Result = > + TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align, > + DstSV, DstOff); > + if (Result.Val) > + return Result; > + > + // Emit a library call. > + const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType(); > + TargetLowering::ArgListTy Args; > + TargetLowering::ArgListEntry Entry; > + Entry.Node = Dst; Entry.Ty = IntPtrTy; > + Args.push_back(Entry); > + // Extend or truncate the argument to be an i32 value for the call. > + if (Src.getValueType() > MVT::i32) > + Src = getNode(ISD::TRUNCATE, MVT::i32, Src); > + else > + Src = getNode(ISD::ZERO_EXTEND, MVT::i32, Src); > + Entry.Node = Src; Entry.Ty = Type::Int32Ty; Entry.isSExt = true; > + Args.push_back(Entry); > + Entry.Node = Size; Entry.Ty = IntPtrTy; Entry.isSExt = false; > + Args.push_back(Entry); > + std::pair CallResult = > + TLI.LowerCallTo(Chain, Type::VoidTy, > + false, false, false, CallingConv::C, false, > + getExternalSymbol("memset", TLI.getPointerTy()), > + Args, *this); > + return CallResult.second; > } > > SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain, > @@ -4009,11 +4339,6 @@ > case ISD::STACKRESTORE: return "stackrestore"; > case ISD::TRAP: return "trap"; > > - // Block memory operations. > - case ISD::MEMSET: return "memset"; > - case ISD::MEMCPY: return "memcpy"; > - case ISD::MEMMOVE: return "memmove"; > - > // Bit manipulation > case ISD::BSWAP: return "bswap"; > case ISD::CTPOP: return "ctpop"; > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr > 11 23:36:06 2008 > @@ -647,8 +647,6 @@ > void visitVAEnd(CallInst &I); > void visitVACopy(CallInst &I); > > - void visitMemIntrinsic(CallInst &I, unsigned Op); > - > void visitGetResult(GetResultInst &I); > > void visitUserOp1(Instruction &I) { > @@ -2737,18 +2735,48 @@ > return "_longjmp"+!TLI.usesUnderscoreLongJmp(); > break; > case Intrinsic::memcpy_i32: > - case Intrinsic::memcpy_i64: > - visitMemIntrinsic(I, ISD::MEMCPY); > + case Intrinsic::memcpy_i64: { > + SDOperand Op1 = getValue(I.getOperand(1)); > + SDOperand Op2 = getValue(I.getOperand(2)); > + SDOperand Op3 = getValue(I.getOperand(3)); > + unsigned Align = cast(I.getOperand(4))- > >getZExtValue(); > + DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, false, > + I.getOperand(1), 0, I.getOperand(2), > 0)); > return 0; > + } > case Intrinsic::memset_i32: > - case Intrinsic::memset_i64: > - visitMemIntrinsic(I, ISD::MEMSET); > + case Intrinsic::memset_i64: { > + SDOperand Op1 = getValue(I.getOperand(1)); > + SDOperand Op2 = getValue(I.getOperand(2)); > + SDOperand Op3 = getValue(I.getOperand(3)); > + unsigned Align = cast(I.getOperand(4))- > >getZExtValue(); > + DAG.setRoot(DAG.getMemset(getRoot(), Op1, Op2, Op3, Align, > + I.getOperand(1), 0)); > return 0; > + } > case Intrinsic::memmove_i32: > - case Intrinsic::memmove_i64: > - visitMemIntrinsic(I, ISD::MEMMOVE); > + case Intrinsic::memmove_i64: { > + SDOperand Op1 = getValue(I.getOperand(1)); > + SDOperand Op2 = getValue(I.getOperand(2)); > + SDOperand Op3 = getValue(I.getOperand(3)); > + unsigned Align = cast(I.getOperand(4))- > >getZExtValue(); > + > + // If the source and destination are known to not be aliases, > we can > + // lower memmove as memcpy. > + uint64_t Size = -1ULL; > + if (ConstantSDNode *C = dyn_cast(Op3)) > + Size = C->getValue(); > + if (AA.alias(I.getOperand(1), Size, I.getOperand(2), Size) == > + AliasAnalysis::NoAlias) { > + DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, > false, > + I.getOperand(1), 0, > I.getOperand(2), 0)); > + return 0; > + } > + > + DAG.setRoot(DAG.getMemmove(getRoot(), Op1, Op2, Op3, Align, > + I.getOperand(1), 0, I.getOperand(2), > 0)); > return 0; > - > + } > case Intrinsic::dbg_stoppoint: { > MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); > DbgStopPointInst &SPI = cast(I); > @@ -4342,242 +4370,6 @@ > return SDOperand(); > } > > -/// getMemsetValue - Vectorized representation of the memset value > -/// operand. > -static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT, > - SelectionDAG &DAG) { > - MVT::ValueType CurVT = VT; > - if (ConstantSDNode *C = dyn_cast(Value)) { > - uint64_t Val = C->getValue() & 255; > - unsigned Shift = 8; > - while (CurVT != MVT::i8) { > - Val = (Val << Shift) | Val; > - Shift <<= 1; > - CurVT = (MVT::ValueType)((unsigned)CurVT - 1); > - } > - return DAG.getConstant(Val, VT); > - } else { > - Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value); > - unsigned Shift = 8; > - while (CurVT != MVT::i8) { > - Value = > - DAG.getNode(ISD::OR, VT, > - DAG.getNode(ISD::SHL, VT, Value, > - DAG.getConstant(Shift, MVT::i8)), > Value); > - Shift <<= 1; > - CurVT = (MVT::ValueType)((unsigned)CurVT - 1); > - } > - > - return Value; > - } > -} > - > -/// getMemsetStringVal - Similar to getMemsetValue. Except this is > only > -/// used when a memcpy is turned into a memset when the source is a > constant > -/// string ptr. > -static SDOperand getMemsetStringVal(MVT::ValueType VT, > - SelectionDAG &DAG, > TargetLowering &TLI, > - std::string &Str, unsigned > Offset) { > - uint64_t Val = 0; > - unsigned MSB = MVT::getSizeInBits(VT) / 8; > - if (TLI.isLittleEndian()) > - Offset = Offset + MSB - 1; > - for (unsigned i = 0; i != MSB; ++i) { > - Val = (Val << 8) | (unsigned char)Str[Offset]; > - Offset += TLI.isLittleEndian() ? -1 : 1; > - } > - return DAG.getConstant(Val, VT); > -} > - > -/// getMemBasePlusOffset - Returns base and offset node for the > -static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned > Offset, > - SelectionDAG &DAG, > TargetLowering &TLI) { > - MVT::ValueType VT = Base.getValueType(); > - return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, > VT)); > -} > - > -/// MeetsMaxMemopRequirement - Determines if the number of memory > ops required > -/// to replace the memset / memcpy is below the threshold. It also > returns the > -/// types of the sequence of memory ops to perform memset / memcpy. > -static bool MeetsMaxMemopRequirement(std::vector > &MemOps, > - unsigned Limit, uint64_t Size, > - unsigned Align, TargetLowering > &TLI) { > - MVT::ValueType VT; > - > - if (TLI.allowsUnalignedMemoryAccesses()) { > - VT = MVT::i64; > - } else { > - switch (Align & 7) { > - case 0: > - VT = MVT::i64; > - break; > - case 4: > - VT = MVT::i32; > - break; > - case 2: > - VT = MVT::i16; > - break; > - default: > - VT = MVT::i8; > - break; > - } > - } > - > - MVT::ValueType LVT = MVT::i64; > - while (!TLI.isTypeLegal(LVT)) > - LVT = (MVT::ValueType)((unsigned)LVT - 1); > - assert(MVT::isInteger(LVT)); > - > - if (VT > LVT) > - VT = LVT; > - > - unsigned NumMemOps = 0; > - while (Size != 0) { > - unsigned VTSize = MVT::getSizeInBits(VT) / 8; > - while (VTSize > Size) { > - VT = (MVT::ValueType)((unsigned)VT - 1); > - VTSize >>= 1; > - } > - assert(MVT::isInteger(VT)); > - > - if (++NumMemOps > Limit) > - return false; > - MemOps.push_back(VT); > - Size -= VTSize; > - } > - > - return true; > -} > - > -void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned > Op) { > - SDOperand Op1 = getValue(I.getOperand(1)); > - SDOperand Op2 = getValue(I.getOperand(2)); > - SDOperand Op3 = getValue(I.getOperand(3)); > - SDOperand Op4 = getValue(I.getOperand(4)); > - unsigned Align = (unsigned)cast(Op4)->getValue(); > - if (Align == 0) Align = 1; > - > - // If the source and destination are known to not be aliases, we > can > - // lower memmove as memcpy. > - if (Op == ISD::MEMMOVE) { > - uint64_t Size = -1ULL; > - if (ConstantSDNode *C = dyn_cast(Op3)) > - Size = C->getValue(); > - if (AA.alias(I.getOperand(1), Size, I.getOperand(2), Size) == > - AliasAnalysis::NoAlias) > - Op = ISD::MEMCPY; > - } > - > - if (ConstantSDNode *Size = dyn_cast(Op3)) { > - std::vector MemOps; > - > - // Expand memset / memcpy to a series of load / store ops > - // if the size operand falls below a certain threshold. > - SmallVector OutChains; > - switch (Op) { > - default: break; // Do nothing for now. > - case ISD::MEMSET: { > - if (MeetsMaxMemopRequirement(MemOps, > TLI.getMaxStoresPerMemset(), > - Size->getValue(), Align, TLI)) { > - unsigned NumMemOps = MemOps.size(); > - unsigned Offset = 0; > - for (unsigned i = 0; i < NumMemOps; i++) { > - MVT::ValueType VT = MemOps[i]; > - unsigned VTSize = MVT::getSizeInBits(VT) / 8; > - SDOperand Value = getMemsetValue(Op2, VT, DAG); > - SDOperand Store = DAG.getStore(getRoot(), Value, > - getMemBasePlusOffset(Op1, > Offset, DAG, TLI), > - I.getOperand(1), Offset); > - OutChains.push_back(Store); > - Offset += VTSize; > - } > - } > - break; > - } > - case ISD::MEMCPY: { > - if (MeetsMaxMemopRequirement(MemOps, > TLI.getMaxStoresPerMemcpy(), > - Size->getValue(), Align, TLI)) { > - unsigned NumMemOps = MemOps.size(); > - unsigned SrcOff = 0, DstOff = 0, SrcDelta = 0; > - GlobalAddressSDNode *G = NULL; > - std::string Str; > - bool CopyFromStr = false; > - > - if (Op2.getOpcode() == ISD::GlobalAddress) > - G = cast(Op2); > - else if (Op2.getOpcode() == ISD::ADD && > - Op2.getOperand(0).getOpcode() == > ISD::GlobalAddress && > - Op2.getOperand(1).getOpcode() == ISD::Constant) { > - G = cast(Op2.getOperand(0)); > - SrcDelta = cast(Op2.getOperand(1))- > >getValue(); > - } > - if (G) { > - GlobalVariable *GV = dyn_cast(G- > >getGlobal()); > - if (GV && GV->isConstant()) { > - Str = GV->getStringValue(false); > - if (!Str.empty()) { > - CopyFromStr = true; > - SrcOff += SrcDelta; > - } > - } > - } > - > - for (unsigned i = 0; i < NumMemOps; i++) { > - MVT::ValueType VT = MemOps[i]; > - unsigned VTSize = MVT::getSizeInBits(VT) / 8; > - SDOperand Value, Chain, Store; > - > - if (CopyFromStr) { > - Value = getMemsetStringVal(VT, DAG, TLI, Str, SrcOff); > - Chain = getRoot(); > - Store = > - DAG.getStore(Chain, Value, > - getMemBasePlusOffset(Op1, DstOff, DAG, > TLI), > - I.getOperand(1), DstOff); > - } else { > - Value = DAG.getLoad(VT, getRoot(), > - getMemBasePlusOffset(Op2, SrcOff, > DAG, TLI), > - I.getOperand(2), SrcOff, false, > Align); > - Chain = Value.getValue(1); > - Store = > - DAG.getStore(Chain, Value, > - getMemBasePlusOffset(Op1, DstOff, DAG, > TLI), > - I.getOperand(1), DstOff, false, Align); > - } > - OutChains.push_back(Store); > - SrcOff += VTSize; > - DstOff += VTSize; > - } > - } > - break; > - } > - } > - > - if (!OutChains.empty()) { > - DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, > - &OutChains[0], OutChains.size())); > - return; > - } > - } > - > - SDOperand AlwaysInline = DAG.getConstant(0, MVT::i1); > - SDOperand Node; > - switch(Op) { > - default: > - assert(0 && "Unknown Op"); > - case ISD::MEMCPY: > - Node = DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Op4, > AlwaysInline); > - break; > - case ISD::MEMMOVE: > - Node = DAG.getMemmove(getRoot(), Op1, Op2, Op3, Op4, > AlwaysInline); > - break; > - case ISD::MEMSET: > - Node = DAG.getMemset(getRoot(), Op1, Op2, Op3, Op4, > AlwaysInline); > - break; > - } > - DAG.setRoot(Node); > -} > - > // > = > = > = > ----------------------------------------------------------------------= > ==// > // SelectionDAGISel code > // > = > = > = > ----------------------------------------------------------------------= > ==// > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Fri Apr > 11 23:36:06 2008 > @@ -17,7 +17,7 @@ > #include "llvm/Target/TargetData.h" > #include "llvm/Target/TargetMachine.h" > #include "llvm/Target/TargetRegisterInfo.h" > -#include "llvm/CallingConv.h" > +#include "llvm/GlobalVariable.h" > #include "llvm/DerivedTypes.h" > #include "llvm/CodeGen/SelectionDAG.h" > #include "llvm/ADT/StringExtras.h" > @@ -234,59 +234,6 @@ > > TargetLowering::~TargetLowering() {} > > - > -SDOperand TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG > &DAG) { > - assert(getSubtarget() && "Subtarget not defined"); > - SDOperand ChainOp = Op.getOperand(0); > - SDOperand DestOp = Op.getOperand(1); > - SDOperand SourceOp = Op.getOperand(2); > - SDOperand CountOp = Op.getOperand(3); > - SDOperand AlignOp = Op.getOperand(4); > - SDOperand AlwaysInlineOp = Op.getOperand(5); > - > - bool AlwaysInline = (bool)cast(AlwaysInlineOp)- > >getValue(); > - unsigned Align = (unsigned)cast(AlignOp)- > >getValue(); > - if (Align == 0) Align = 1; > - > - // If size is unknown, call memcpy. > - ConstantSDNode *I = dyn_cast(CountOp); > - if (!I) { > - assert(!AlwaysInline && "Cannot inline copy of unknown size"); > - return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG); > - } > - > - // If not DWORD aligned or if size is more than threshold, then > call memcpy. > - // The libc version is likely to be faster for the following > cases. It can > - // use the address value and run time information about the CPU. > - // With glibc 2.6.1 on a core 2, coping an array of 100M longs > was 30% faster > - unsigned Size = I->getValue(); > - if (AlwaysInline || > - (Size <= getSubtarget()->getMaxInlineSizeThreshold() && > - (Align & 3) == 0)) > - return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, > Align, DAG); > - return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG); > -} > - > - > -SDOperand TargetLowering::LowerMEMCPYCall(SDOperand Chain, > - SDOperand Dest, > - SDOperand Source, > - SDOperand Count, > - SelectionDAG &DAG) { > - MVT::ValueType IntPtr = getPointerTy(); > - TargetLowering::ArgListTy Args; > - TargetLowering::ArgListEntry Entry; > - Entry.Ty = getTargetData()->getIntPtrType(); > - Entry.Node = Dest; Args.push_back(Entry); > - Entry.Node = Source; Args.push_back(Entry); > - Entry.Node = Count; Args.push_back(Entry); > - std::pair CallResult = > - LowerCallTo(Chain, Type::VoidTy, false, false, false, > CallingConv::C, > - false, DAG.getExternalSymbol("memcpy", IntPtr), > Args, DAG); > - return CallResult.second; > -} > - > - > /// computeRegisterProperties - Once all of the register classes are > added, > /// this allows us to compute derived properties we expose. > void TargetLowering::computeRegisterProperties() { > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -197,11 +197,6 @@ > setOperationAction(ISD::GLOBAL_OFFSET_TABLE, MVT::i32, Custom); > setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); > > - // Expand mem operations genericly. > - setOperationAction(ISD::MEMSET , MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY , MVT::Other, Custom); > - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); > - > // Use the default implementation. > setOperationAction(ISD::VASTART , MVT::Other, Custom); > setOperationAction(ISD::VAARG , MVT::Other, Expand); > @@ -1246,18 +1241,30 @@ > return DAG.getNode(ARMISD::CNEG, VT, AbsVal, AbsVal, ARMCC, CCR, > Cmp); > } > > -SDOperand ARMTargetLowering::LowerMEMCPYInline(SDOperand Chain, > - SDOperand Dest, > - SDOperand Source, > - unsigned Size, > - unsigned Align, > - SelectionDAG &DAG) { > +SDOperand > +ARMTargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand > Src, > + SDOperand Size, unsigned > Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t > DstOff, > + Value *SrcSV, uint64_t > SrcOff){ > // Do repeated 4-byte loads and stores. To be improved. > - assert((Align & 3) == 0 && "Expected 4-byte aligned addresses!"); > - unsigned BytesLeft = Size & 3; > - unsigned NumMemOps = Size >> 2; > + // This requires 4-byte alignment. > + if ((Align & 3) != 0) > + return SDOperand(); > + // This requires the copy size to be a constant, preferrably > + // within a subtarget-specific limit. > + ConstantSDNode *ConstantSize = dyn_cast(Size); > + if (!ConstantSize) > + return SDOperand(); > + uint64_t SizeVal = ConstantSize->getValue(); > + if (!AlwaysInline && SizeVal > getSubtarget()- > >getMaxInlineSizeThreshold()) > + return SDOperand(); > + > + unsigned BytesLeft = SizeVal & 3; > + unsigned NumMemOps = SizeVal >> 2; > unsigned EmittedNumMemOps = 0; > - unsigned SrcOff = 0, DstOff = 0; > MVT::ValueType VT = MVT::i32; > unsigned VTSize = 4; > unsigned i = 0; > @@ -1272,9 +1279,9 @@ > for (i = 0; > i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; + > +i) { > Loads[i] = DAG.getLoad(VT, Chain, > - DAG.getNode(ISD::ADD, MVT::i32, Source, > + DAG.getNode(ISD::ADD, MVT::i32, Src, > DAG.getConstant(SrcOff, > MVT::i32)), > - NULL, 0); > + SrcSV, SrcOff); > TFOps[i] = Loads[i].getValue(1); > SrcOff += VTSize; > } > @@ -1283,9 +1290,9 @@ > for (i = 0; > i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; + > +i) { > TFOps[i] = DAG.getStore(Chain, Loads[i], > - DAG.getNode(ISD::ADD, MVT::i32, Dest, > + DAG.getNode(ISD::ADD, MVT::i32, Dst, > DAG.getConstant(DstOff, > MVT::i32)), > - NULL, 0); > + DstSV, DstOff); > DstOff += VTSize; > } > Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i); > @@ -1309,9 +1316,9 @@ > } > > Loads[i] = DAG.getLoad(VT, Chain, > - DAG.getNode(ISD::ADD, MVT::i32, Source, > + DAG.getNode(ISD::ADD, MVT::i32, Src, > DAG.getConstant(SrcOff, > MVT::i32)), > - NULL, 0); > + SrcSV, SrcOff); > TFOps[i] = Loads[i].getValue(1); > ++i; > SrcOff += VTSize; > @@ -1331,9 +1338,9 @@ > } > > TFOps[i] = DAG.getStore(Chain, Loads[i], > - DAG.getNode(ISD::ADD, MVT::i32, Dest, > + DAG.getNode(ISD::ADD, MVT::i32, Dst, > DAG.getConstant(DstOff, > MVT::i32)), > - NULL, 0); > + DstSV, DstOff); > ++i; > DstOff += VTSize; > BytesLeft -= VTSize; > @@ -1409,7 +1416,6 @@ > case ISD::RETURNADDR: break; > case ISD::FRAMEADDR: break; > case ISD::GLOBAL_OFFSET_TABLE: return LowerGLOBAL_OFFSET_TABLE(Op, > DAG); > - case ISD::MEMCPY: return LowerMEMCPY(Op, DAG); > case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, > DAG); > > > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Fri Apr 11 23:36:06 > 2008 > @@ -119,8 +119,8 @@ > getRegClassForInlineAsmConstraint(const std::string &Constraint, > MVT::ValueType VT) const; > > - virtual const TargetSubtarget* getSubtarget() { > - return static_cast(Subtarget); > + virtual const ARMSubtarget* getSubtarget() { > + return Subtarget; > } > > private: > @@ -143,11 +143,14 @@ > SDOperand LowerGLOBAL_OFFSET_TABLE(SDOperand Op, SelectionDAG > &DAG); > SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG); > SDOperand LowerBR_JT(SDOperand Op, SelectionDAG &DAG); > - SDOperand LowerMEMCPYInline(SDOperand Chain, SDOperand Dest, > - SDOperand Source, unsigned Size, > - unsigned Align, SelectionDAG &DAG); > - > > + SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff); > }; > } > > > Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Fri Apr 11 23:36:06 2008 > @@ -62,6 +62,8 @@ > /// > ARMSubtarget(const Module &M, const std::string &FS, bool thumb); > > + /// getMaxInlineSizeThreshold - Returns the maximum memset / > memcpy size > + /// that still makes it profitable to inline the call. > unsigned getMaxInlineSizeThreshold() const { > // FIXME: For now, we don't lower memcpy's to loads / stores for > Thumb. > // Change this once Thumb ldmia / stmia support is added. > > Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -87,10 +87,6 @@ > setOperationAction(ISD::SDIV , MVT::i64, Custom); > setOperationAction(ISD::UDIV , MVT::i64, Custom); > > - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); > - setOperationAction(ISD::MEMSET , MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY , MVT::Other, Expand); > - > // We don't support sin/cos/sqrt/pow > setOperationAction(ISD::FSIN , MVT::f64, Expand); > setOperationAction(ISD::FCOS , MVT::f64, Expand); > > Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -175,9 +175,6 @@ > setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); > > // SPU has no intrinsics for these particular operations: > - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); > - setOperationAction(ISD::MEMSET, MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); > > // PowerPC has no SREM/UREM instructions > > Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -65,9 +65,6 @@ > setOperationAction(ISD::UREM , MVT::f32 , Expand); > setOperationAction(ISD::UREM , MVT::f64 , Expand); > > - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); > - setOperationAction(ISD::MEMSET , MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY , MVT::Other, Expand); > setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand); > > setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote); > > Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -80,9 +80,6 @@ > setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); > > // Mips not supported intrinsics. > - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); > - setOperationAction(ISD::MEMSET, MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); > > setOperationAction(ISD::CTPOP, MVT::i32, Expand); > > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -78,9 +78,6 @@ > setOperationAction(ISD::FP_ROUND_INREG, MVT::ppcf128, Custom); > > // PowerPC has no intrinsics for these particular operations > - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); > - setOperationAction(ISD::MEMSET, MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); > > // PowerPC has no SREM/UREM instructions > @@ -1735,10 +1732,9 @@ > CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand > Chain, > ISD::ArgFlagsTy Flags, SelectionDAG &DAG, > unsigned Size) { > - SDOperand AlignNode = DAG.getConstant(Flags.getByValAlign(), > MVT::i32); > - SDOperand SizeNode = DAG.getConstant(Size, MVT::i32); > - SDOperand AlwaysInline = DAG.getConstant(0, MVT::i32); > - return DAG.getMemcpy(Chain, Dst, Src, SizeNode, AlignNode, > AlwaysInline); > + SDOperand SizeNode = DAG.getConstant(Size, MVT::i32); > + return DAG.getMemcpy(Chain, Dst, Src, SizeNode, > Flags.getByValAlign(), false, > + NULL, 0, NULL, 0); > } > > SDOperand PPCTargetLowering::LowerCALL(SDOperand Op, SelectionDAG > &DAG, > > Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -570,9 +570,6 @@ > setOperationAction(ISD::SELECT_CC, MVT::f64, Custom); > > // SPARC has no intrinsics for these particular operations. > - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); > - setOperationAction(ISD::MEMSET, MVT::Other, Expand); > - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); > setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); > > setOperationAction(ISD::FSIN , MVT::f64, Expand); > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Apr 11 > 23:36:06 2008 > @@ -206,7 +206,6 @@ > setOperationAction(ISD::BRCOND , MVT::Other, Custom); > setOperationAction(ISD::BR_CC , MVT::Other, Expand); > setOperationAction(ISD::SELECT_CC , MVT::Other, Expand); > - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); > if (Subtarget->is64Bit()) > setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i32, Legal); > setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16 , Legal); > @@ -281,9 +280,6 @@ > setOperationAction(ISD::SRA_PARTS , MVT::i64 , Custom); > setOperationAction(ISD::SRL_PARTS , MVT::i64 , Custom); > } > - // X86 wants to expand memset / memcpy itself. > - setOperationAction(ISD::MEMSET , MVT::Other, Custom); > - setOperationAction(ISD::MEMCPY , MVT::Other, Custom); > > if (Subtarget->hasSSE1()) > setOperationAction(ISD::PREFETCH , MVT::Other, Legal); > @@ -1113,10 +1109,10 @@ > static SDOperand > CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand > Chain, > ISD::ArgFlagsTy Flags, SelectionDAG &DAG) { > - SDOperand AlignNode = DAG.getConstant(Flags.getByValAlign(), > MVT::i32); > SDOperand SizeNode = DAG.getConstant(Flags.getByValSize(), > MVT::i32); > - SDOperand AlwaysInline = DAG.getConstant(1, MVT::i32); > - return DAG.getMemcpy(Chain, Dst, Src, SizeNode, AlignNode, > AlwaysInline); > + return DAG.getMemcpy(Chain, Dst, Src, SizeNode, > Flags.getByValAlign(), > + /*AlwaysInline=*/true, > + NULL, 0, NULL, 0); > } > > SDOperand X86TargetLowering::LowerMemArgument(SDOperand Op, > SelectionDAG &DAG, > @@ -4557,52 +4553,51 @@ > return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops1, 2); > } > > -SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG > &DAG) { > - SDOperand InFlag(0, 0); > - SDOperand Chain = Op.getOperand(0); > - unsigned Align = > - (unsigned)cast(Op.getOperand(4))->getValue(); > - if (Align == 0) Align = 1; > - > - ConstantSDNode *I = dyn_cast(Op.getOperand(3)); > - // If not DWORD aligned or size is more than the threshold, call > memset. > - // The libc version is likely to be faster for these cases. It > can use the > - // address value and run time information about the CPU. > - if ((Align & 3) != 0 || > - (I && I->getValue() > Subtarget- > >getMaxInlineSizeThreshold())) { > +SDOperand > +X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand > Src, > + SDOperand Size, unsigned > Align, > + Value *DstSV, uint64_t > DstOff) { > + ConstantSDNode *ConstantSize = dyn_cast(Size); > + > + /// If not DWORD aligned or size is more than the threshold, call > the library. > + /// The libc version is likely to be faster for these cases. It > can use the > + /// address value and run time information about the CPU. > + if ((Align & 3) == 0 || > + !ConstantSize || > + ConstantSize->getValue() > getSubtarget()- > >getMaxInlineSizeThreshold()) { > + SDOperand InFlag(0, 0); > > // Check to see if there is a specialized entry-point for memory > zeroing. > - ConstantSDNode *V = dyn_cast(Op.getOperand(2)); > - const char *bzeroEntry = > - V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0; > - > - MVT::ValueType IntPtr = getPointerTy(); > - const Type *IntPtrTy = getTargetData()->getIntPtrType(); > - TargetLowering::ArgListTy Args; > - TargetLowering::ArgListEntry Entry; > - Entry.Node = Op.getOperand(1); > - Entry.Ty = IntPtrTy; > - Args.push_back(Entry); > - > - if (!bzeroEntry) { > - // Extend the unsigned i8 argument to be an int value for the > call. > - Entry.Node = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, > Op.getOperand(2)); > + ConstantSDNode *V = dyn_cast(Src); > + if (const char *bzeroEntry = > + V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0) { > + MVT::ValueType IntPtr = getPointerTy(); > + const Type *IntPtrTy = getTargetData()->getIntPtrType(); > + TargetLowering::ArgListTy Args; > + TargetLowering::ArgListEntry Entry; > + Entry.Node = Dst; > Entry.Ty = IntPtrTy; > Args.push_back(Entry); > + Entry.Node = Size; > + Args.push_back(Entry); > + std::pair CallResult = > + LowerCallTo(Chain, Type::VoidTy, false, false, false, > CallingConv::C, > + false, DAG.getExternalSymbol(bzeroEntry, IntPtr), > + Args, DAG); > + return CallResult.second; > } > > - Entry.Node = Op.getOperand(3); > - Args.push_back(Entry); > - const char *Name = bzeroEntry ? bzeroEntry : "memset"; > - std::pair CallResult = > - LowerCallTo(Chain, Type::VoidTy, false, false, false, > CallingConv::C, > - false, DAG.getExternalSymbol(Name, IntPtr), Args, > DAG); > - return CallResult.second; > + // Otherwise have the target-independent code call memset. > + return SDOperand(); > } > > + uint64_t SizeVal = ConstantSize->getValue(); > + SDOperand InFlag(0, 0); > MVT::ValueType AVT; > SDOperand Count; > - ConstantSDNode *ValC = dyn_cast(Op.getOperand(2)); > + ConstantSDNode *ValC = dyn_cast(Src); > unsigned BytesLeft = 0; > bool TwoRepStos = false; > if (ValC) { > @@ -4630,22 +4625,14 @@ > default: // Byte aligned > AVT = MVT::i8; > ValReg = X86::AL; > - Count = Op.getOperand(3); > + Count = Size; > break; > } > > if (AVT > MVT::i8) { > - if (I) { > - unsigned UBytes = MVT::getSizeInBits(AVT) / 8; > - Count = DAG.getIntPtrConstant(I->getValue() / UBytes); > - BytesLeft = I->getValue() % UBytes; > - } else { > - assert(AVT >= MVT::i32 && > - "Do not use rep;stos if not at least DWORD aligned"); > - Count = DAG.getNode(ISD::SRL, > Op.getOperand(3).getValueType(), > - Op.getOperand(3), DAG.getConstant(2, > MVT::i8)); > - TwoRepStos = true; > - } > + unsigned UBytes = MVT::getSizeInBits(AVT) / 8; > + Count = DAG.getIntPtrConstant(SizeVal / UBytes); > + BytesLeft = SizeVal % UBytes; > } > > Chain = DAG.getCopyToReg(Chain, ValReg, DAG.getConstant(Val, > AVT), > @@ -4653,8 +4640,8 @@ > InFlag = Chain.getValue(1); > } else { > AVT = MVT::i8; > - Count = Op.getOperand(3); > - Chain = DAG.getCopyToReg(Chain, X86::AL, Op.getOperand(2), > InFlag); > + Count = Size; > + Chain = DAG.getCopyToReg(Chain, X86::AL, Src, InFlag); > InFlag = Chain.getValue(1); > } > > @@ -4662,7 +4649,7 @@ > Count, InFlag); > InFlag = Chain.getValue(1); > Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : > X86::EDI, > - Op.getOperand(1), InFlag); > + Dst, InFlag); > InFlag = Chain.getValue(1); > > SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); > @@ -4674,7 +4661,7 @@ > > if (TwoRepStos) { > InFlag = Chain.getValue(1); > - Count = Op.getOperand(3); > + Count = Size; > MVT::ValueType CVT = Count.getValueType(); > SDOperand Left = DAG.getNode(ISD::AND, CVT, Count, > DAG.getConstant((AVT == MVT::i64) ? > 7 : 3, CVT)); > @@ -4688,79 +4675,68 @@ > Ops.push_back(InFlag); > Chain = DAG.getNode(X86ISD::REP_STOS, Tys, &Ops[0], Ops.size()); > } else if (BytesLeft) { > - // Issue stores for the last 1 - 7 bytes. > - SDOperand Value; > - unsigned Val = ValC->getValue() & 255; > - unsigned Offset = I->getValue() - BytesLeft; > - SDOperand DstAddr = Op.getOperand(1); > - MVT::ValueType AddrVT = DstAddr.getValueType(); > - if (BytesLeft >= 4) { > - Val = (Val << 8) | Val; > - Val = (Val << 16) | Val; > - Value = DAG.getConstant(Val, MVT::i32); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, AddrVT, DstAddr, > - DAG.getConstant(Offset, > AddrVT)), > - NULL, 0); > - BytesLeft -= 4; > - Offset += 4; > - } > - if (BytesLeft >= 2) { > - Value = DAG.getConstant((Val << 8) | Val, MVT::i16); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, AddrVT, DstAddr, > - DAG.getConstant(Offset, > AddrVT)), > - NULL, 0); > - BytesLeft -= 2; > - Offset += 2; > - } > - if (BytesLeft == 1) { > - Value = DAG.getConstant(Val, MVT::i8); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, AddrVT, DstAddr, > - DAG.getConstant(Offset, > AddrVT)), > - NULL, 0); > - } > + // Handle the last 1 - 7 bytes. > + unsigned Offset = SizeVal - BytesLeft; > + MVT::ValueType AddrVT = Dst.getValueType(); > + MVT::ValueType SizeVT = Size.getValueType(); > + > + Chain = DAG.getMemset(Chain, > + DAG.getNode(ISD::ADD, AddrVT, Dst, > + DAG.getConstant(Offset, > AddrVT)), > + Src, > + DAG.getConstant(BytesLeft, SizeVT), > + Align, DstSV, Offset); > } > > + // TODO: Use a Tokenfactor, as in memcpy, instead of a single > chain. > return Chain; > } > > -SDOperand X86TargetLowering::LowerMEMCPYInline(SDOperand Chain, > - SDOperand Dest, > - SDOperand Source, > - unsigned Size, > - unsigned Align, > - SelectionDAG &DAG) { > +SDOperand > +X86TargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand > Src, > + SDOperand Size, unsigned > Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t > DstOff, > + Value *SrcSV, uint64_t > SrcOff){ > + > + // This requires the copy size to be a constant, preferrably > + // within a subtarget-specific limit. > + ConstantSDNode *ConstantSize = dyn_cast(Size); > + if (!ConstantSize) > + return SDOperand(); > + uint64_t SizeVal = ConstantSize->getValue(); > + if (!AlwaysInline && SizeVal > getSubtarget()- > >getMaxInlineSizeThreshold()) > + return SDOperand(); > + > + SmallVector Results; > + > MVT::ValueType AVT; > unsigned BytesLeft = 0; > - switch (Align & 3) { > - case 2: // WORD aligned > - AVT = MVT::i16; > - break; > - case 0: // DWORD aligned > - AVT = MVT::i32; > - if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) // QWORD > aligned > - AVT = MVT::i64; > - break; > - default: // Byte aligned > - AVT = MVT::i8; > - break; > - } > + if (Align >= 8 && Subtarget->is64Bit()) > + AVT = MVT::i64; > + else if (Align >= 4) > + AVT = MVT::i32; > + else if (Align >= 2) > + AVT = MVT::i16; > + else > + AVT = MVT::i8; > > unsigned UBytes = MVT::getSizeInBits(AVT) / 8; > - SDOperand Count = DAG.getIntPtrConstant(Size / UBytes); > - BytesLeft = Size % UBytes; > + unsigned CountVal = SizeVal / UBytes; > + SDOperand Count = DAG.getIntPtrConstant(CountVal); > + BytesLeft = SizeVal % UBytes; > > SDOperand InFlag(0, 0); > Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RCX : > X86::ECX, > Count, InFlag); > InFlag = Chain.getValue(1); > Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : > X86::EDI, > - Dest, InFlag); > + Dst, InFlag); > InFlag = Chain.getValue(1); > Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RSI : > X86::ESI, > - Source, InFlag); > + Src, InFlag); > InFlag = Chain.getValue(1); > > SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); > @@ -4768,57 +4744,28 @@ > Ops.push_back(Chain); > Ops.push_back(DAG.getValueType(AVT)); > Ops.push_back(InFlag); > - Chain = DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], Ops.size()); > + Results.push_back(DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], > Ops.size())); > > if (BytesLeft) { > - // Issue loads and stores for the last 1 - 7 bytes. > - unsigned Offset = Size - BytesLeft; > - SDOperand DstAddr = Dest; > - MVT::ValueType DstVT = DstAddr.getValueType(); > - SDOperand SrcAddr = Source; > - MVT::ValueType SrcVT = SrcAddr.getValueType(); > - SDOperand Value; > - if (BytesLeft >= 4) { > - Value = DAG.getLoad(MVT::i32, Chain, > - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, > - DAG.getConstant(Offset, > SrcVT)), > - NULL, 0); > - Chain = Value.getValue(1); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, DstVT, DstAddr, > - DAG.getConstant(Offset, > DstVT)), > - NULL, 0); > - BytesLeft -= 4; > - Offset += 4; > - } > - if (BytesLeft >= 2) { > - Value = DAG.getLoad(MVT::i16, Chain, > - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, > - DAG.getConstant(Offset, > SrcVT)), > - NULL, 0); > - Chain = Value.getValue(1); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, DstVT, DstAddr, > - DAG.getConstant(Offset, > DstVT)), > - NULL, 0); > - BytesLeft -= 2; > - Offset += 2; > - } > - > - if (BytesLeft == 1) { > - Value = DAG.getLoad(MVT::i8, Chain, > - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, > - DAG.getConstant(Offset, > SrcVT)), > - NULL, 0); > - Chain = Value.getValue(1); > - Chain = DAG.getStore(Chain, Value, > - DAG.getNode(ISD::ADD, DstVT, DstAddr, > - DAG.getConstant(Offset, > DstVT)), > - NULL, 0); > - } > + // Handle the last 1 - 7 bytes. > + unsigned Offset = SizeVal - BytesLeft; > + MVT::ValueType DstVT = Dst.getValueType(); > + MVT::ValueType SrcVT = Src.getValueType(); > + MVT::ValueType SizeVT = Size.getValueType(); > + > + Results.push_back(DAG.getMemcpy(Chain, > + DAG.getNode(ISD::ADD, DstVT, Dst, > + > DAG.getConstant(Offset, > + > DstVT)), > + DAG.getNode(ISD::ADD, SrcVT, Src, > + > DAG.getConstant(Offset, > + > SrcVT)), > + DAG.getConstant(BytesLeft, > SizeVT), > + Align, AlwaysInline, > + DstSV, Offset, SrcSV, Offset)); > } > > - return Chain; > + return DAG.getNode(ISD::TokenFactor, MVT::Other, &Results[0], > Results.size()); > } > > /// Expand the result of: i64,outchain = READCYCLECOUNTER inchain > @@ -5430,8 +5377,6 @@ > case ISD::CALL: return LowerCALL(Op, DAG); > case ISD::RET: return LowerRET(Op, DAG); > case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG); > - case ISD::MEMSET: return LowerMEMSET(Op, DAG); > - case ISD::MEMCPY: return LowerMEMCPY(Op, DAG); > case ISD::VASTART: return LowerVASTART(Op, DAG); > case ISD::VACOPY: return LowerVACOPY(Op, DAG); > case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, > DAG); > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Fri Apr 11 23:36:06 > 2008 > @@ -441,8 +441,8 @@ > SDOperand Ret, > SelectionDAG > &DAG) const; > > - virtual const TargetSubtarget* getSubtarget() { > - return static_cast(Subtarget); > + virtual const X86Subtarget* getSubtarget() { > + return Subtarget; > } > > /// isScalarFPTypeInSSEReg - Return true if the specified scalar > FP type is > @@ -512,9 +512,6 @@ > SDOperand LowerSELECT(SDOperand Op, SelectionDAG &DAG); > SDOperand LowerBRCOND(SDOperand Op, SelectionDAG &DAG); > SDOperand LowerMEMSET(SDOperand Op, SelectionDAG &DAG); > - SDOperand LowerMEMCPYInline(SDOperand Dest, SDOperand Source, > - SDOperand Chain, unsigned Size, > unsigned Align, > - SelectionDAG &DAG); > SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG); > SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG); > SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG); > @@ -535,6 +532,19 @@ > SDNode *ExpandFP_TO_SINT(SDNode *N, SelectionDAG &DAG); > SDNode *ExpandREADCYCLECOUNTER(SDNode *N, SelectionDAG &DAG); > SDNode *ExpandATOMIC_LCS(SDNode *N, SelectionDAG &DAG); > + > + SDOperand EmitTargetCodeForMemset(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + Value *DstSV, uint64_t DstOff); > + SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG, > + SDOperand Chain, > + SDOperand Dst, SDOperand Src, > + SDOperand Size, unsigned Align, > + bool AlwaysInline, > + Value *DstSV, uint64_t DstOff, > + Value *SrcSV, uint64_t SrcOff); > }; > } > > > Modified: llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx (original) > +++ llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx Fri Apr 11 > 23:36:06 2008 > @@ -1,5 +1,4 @@ > -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | > grep movs | count 1 > -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | > grep memcpy | count 2 > +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | > grep movs | count 3 > > @A = global [32 x i32] zeroinitializer > @B = global [32 x i32] zeroinitializer > > Modified: llvm/trunk/test/CodeGen/X86/byval2.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval2.ll?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/byval2.ll (original) > +++ llvm/trunk/test/CodeGen/X86/byval2.ll Fri Apr 11 23:36:06 2008 > @@ -1,7 +1,9 @@ > ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsq | count 2 > ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 > > -%struct.s = type { i64, i64, i64 } > +%struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64, > + i64, i64, i64, i64, i64, i64, i64, i64, > + i64 } > > define void @g(i64 %a, i64 %b, i64 %c) { > entry: > > Modified: llvm/trunk/test/CodeGen/X86/byval3.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval3.ll?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/byval3.ll (original) > +++ llvm/trunk/test/CodeGen/X86/byval3.ll Fri Apr 11 23:36:06 2008 > @@ -1,7 +1,11 @@ > ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsl | count 2 > ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 > > -%struct.s = type { i32, i32, i32, i32, i32, i32 } > +%struct.s = type { i32, i32, i32, i32, i32, i32, i32, i32, > + i32, i32, i32, i32, i32, i32, i32, i32, > + i32, i32, i32, i32, i32, i32, i32, i32, > + i32, i32, i32, i32, i32, i32, i32, i32, > + i32 } > > define void @g(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6) { > entry: > > Modified: llvm/trunk/test/CodeGen/X86/byval4.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval4.ll?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/byval4.ll (original) > +++ llvm/trunk/test/CodeGen/X86/byval4.ll Fri Apr 11 23:36:06 2008 > @@ -1,7 +1,15 @@ > ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsw | count 2 > ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 > > -%struct.s = type { i16, i16, i16, i16, i16, i16 } > +%struct.s = type { i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16, i16, i16, i16, i16, i16, i16, i16, > + i16 } > > > define void @g(i16 signext %a1, i16 signext %a2, i16 signext %a3, > > Modified: llvm/trunk/test/CodeGen/X86/byval5.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval5.ll?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/byval5.ll (original) > +++ llvm/trunk/test/CodeGen/X86/byval5.ll Fri Apr 11 23:36:06 2008 > @@ -1,7 +1,23 @@ > ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsb | count 2 > ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 > > -%struct.s = type { i8, i8, i8, i8, i8, i8 } > +%struct.s = type { i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8, i8, i8, i8, i8, i8, i8, i8, > + i8 } > > > define void @g(i8 signext %a1, i8 signext %a2, i8 signext %a3, > > Modified: llvm/trunk/test/CodeGen/X86/byval7.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval7.ll?rev=49572&r1=49571&r2=49572&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/byval7.ll (original) > +++ llvm/trunk/test/CodeGen/X86/byval7.ll Fri Apr 11 23:36:06 2008 > @@ -1,6 +1,7 @@ > ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep add | grep 16 > > - %struct.S = type { <2 x i64> } > + %struct.S = type { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, > + <2 x i64> } > > define i32 @main() nounwind { > entry: > > Added: llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll?rev=49572&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll (added) > +++ llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll Fri Apr 11 > 23:36:06 2008 > @@ -0,0 +1,22 @@ > +; RUN: llvm-as < %s | llc | not grep movs > + > +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- > i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- > f80:128:128" > +target triple = "i386-apple-darwin8" > + > +define void @ccosl({ x86_fp80, x86_fp80 }* noalias sret > %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %z) nounwind { > +entry: > + %iz = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> > [#uses=3] > + %tmp1 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 1 ; > [#uses=1] > + %tmp2 = load x86_fp80* %tmp1, align 16 ; [#uses=1] > + %tmp3 = sub x86_fp80 0xK80000000000000000000, %tmp2 ; > [#uses=1] > + %tmp4 = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 1 ; > [#uses=1] > + %real = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 0 ; > [#uses=1] > + %tmp6 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 0 ; > [#uses=1] > + %tmp7 = load x86_fp80* %tmp6, align 16 ; [#uses=1] > + store x86_fp80 %tmp3, x86_fp80* %real, align 16 > + store x86_fp80 %tmp7, x86_fp80* %tmp4, align 16 > + call void @ccoshl( { x86_fp80, x86_fp80 }* noalias sret > %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %iz ) nounwind > + ret void > +} > + > +declare void @ccoshl({ x86_fp80, x86_fp80 }* noalias sret , > { x86_fp80, x86_fp80 }* byval align 4 ) nounwind > > Added: llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll?rev=49572&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll (added) > +++ llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll Fri > Apr 11 23:36:06 2008 > @@ -0,0 +1,8 @@ > +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin10 | > grep __bzero > + > +declare void @llvm.memset.i64(i8*, i8, i64, i32) > + > +define void @foo(i8* %p, i64 %n) { > + call void @llvm.memset.i64(i8* %p, i8 0, i64 %n, i32 4) > + ret void > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Mon Apr 14 13:40:45 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Apr 2008 11:40:45 -0700 Subject: [llvm-commits] [llvm] r49667 - in /llvm/trunk/test/CodeGen: PowerPC/compare-fcmp-ord.ll PowerPC/fold-li.ll PowerPC/reg-coalesce-simple.ll PowerPC/rotl-2.ll X86/2006-03-02-InstrSchedBug.ll X86/2006-05-02-InstrSched1.ll X86/2006-05-02-InstrSched2.ll X86/2006-05-11-InstrSched.ll X86/2007-09-17-ObjcFrameEH.ll X86/constant-pool-remat-0.ll X86/dagcombine-cse.ll X86/iabs.ll X86/or-branch.ll X86/select.ll X86/setuge.ll X86/zero-remat.ll In-Reply-To: <200804141756.m3EHutsR015284@zion.cs.uiuc.edu> References: <200804141756.m3EHutsR015284@zion.cs.uiuc.edu> Message-ID: <3E0CF8FB-EAEF-4027-98CC-1102473FDE45@apple.com> On Apr 14, 2008, at 10:56 AM, Dale Johannesen wrote: > Author: johannes > Date: Mon Apr 14 12:56:54 2008 > New Revision: 49667 > > URL: http://llvm.org/viewvc/llvm-project?rev=49667&view=rev > Log: > Remove -unwind-tables-optional everywhere, since > this is now the default. Yay, thanks Dale! -Chris From gohman at apple.com Mon Apr 14 13:43:25 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 18:43:25 -0000 Subject: [llvm-commits] [llvm] r49676 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200804141843.m3EIhQwm016972@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 13:43:25 2008 New Revision: 49676 URL: http://llvm.org/viewvc/llvm-project?rev=49676&view=rev Log: Avoid creating MERGE_VALUES nodes for single values. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49676&r1=49675&r2=49676&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Apr 14 13:43:25 2008 @@ -1848,7 +1848,8 @@ unsigned OpOpcode = Operand.Val->getOpcode(); switch (Opcode) { case ISD::TokenFactor: - return Operand; // Factor of one node? No factor. + case ISD::MERGE_VALUES: + return Operand; // Factor or merge of one node? No need. case ISD::FP_ROUND: assert(0 && "Invalid method to make FP_ROUND node"); case ISD::FP_EXTEND: assert(MVT::isFloatingPoint(VT) && From echristo at apple.com Mon Apr 14 13:45:40 2008 From: echristo at apple.com (Eric Christopher) Date: Mon, 14 Apr 2008 11:45:40 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49653 - /llvm-gcc-4.2/trunk/GNUmakefile In-Reply-To: <6EEF511A-005E-4277-91CA-11A543338729@apple.com> References: <200804141720.m3EHKBPX014102@zion.cs.uiuc.edu> <6EEF511A-005E-4277-91CA-11A543338729@apple.com> Message-ID: <4B68A7E3-2661-4EF9-B17F-602137B4996F@apple.com> On Apr 14, 2008, at 11:16 AM, Devang Patel wrote: > > On Apr 14, 2008, at 10:58 AM, Eric Christopher wrote: > >>> >>> ifndef DISABLE_LLVM >>> ENABLE_LLVM = true >>> -# LLVM gets installed into /usr/local, not /usr. >>> +# LLVM gets installed into /Developer/usr/local, not /usr. >> >> Shouldn't it be installed into both if /Developer exists? > > > Nope :) Mmm... OK. Links or something? -eric From gohman at apple.com Mon Apr 14 14:57:50 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 12:57:50 -0700 Subject: [llvm-commits] [llvm] r49572 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ test/CodeGen/X86/ In-Reply-To: References: <200804120436.m3C4aAR9024610@zion.cs.uiuc.edu> Message-ID: <7B70F70C-93E0-4BB3-ADD5-AE408F0C4DC5@apple.com> I haven't seen any. ISD::MEMCPY wasn't ever being dagcombined, and it was pretty conservative with its chain edges, so target-specific nodes aren't very different. Dan On Apr 14, 2008, at 11:37 AM, Evan Cheng wrote: > Thanks. My only concern is lowering these into target specific code > early might potentially inhibit some optimization. Do you see that > happening at all? > > Evan > > On Apr 11, 2008, at 9:36 PM, Dan Gohman wrote: > >> Author: djg >> Date: Fri Apr 11 23:36:06 2008 >> New Revision: 49572 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=49572&view=rev >> Log: >> Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal >> on any current target and aren't optimized in DAGCombiner. Instead >> of using intermediate nodes, expand the operations, choosing between >> simple loads/stores, target-specific code, and library calls, >> immediately. >> >> Previously, the code to emit optimized code for these operations >> was only used at initial SelectionDAG construction time; now it is >> used at all times. This fixes some cases where rep;movs was being >> used for small copies where simple loads/stores would be better. >> >> This also cleans up code that checks for alignments less than 4; >> let the targets make that decision instead of doing it in >> target-independent code. This allows x86 to use rep;movs in >> low-alignment cases. >> >> Also, this fixes a bug that resulted in the use of rep;stos for >> memsets of 0 with non-constant memory size when the alignment was >> at least 4. It's better to use the library in this case, which >> can be significantly faster when the size is large. >> >> This also preserves more SourceValue information when memory >> intrinsics are lowered into simple loads/stores. >> >> Added: >> llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll >> llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll >> Modified: >> llvm/trunk/include/llvm/CodeGen/SelectionDAG.h >> llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h >> llvm/trunk/include/llvm/Target/TargetLowering.h >> llvm/trunk/include/llvm/Target/TargetSubtarget.h >> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h >> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp >> llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp >> llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> llvm/trunk/lib/Target/ARM/ARMSubtarget.h >> llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp >> llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp >> llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp >> llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp >> llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp >> llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp >> llvm/trunk/lib/Target/X86/X86ISelLowering.cpp >> llvm/trunk/lib/Target/X86/X86ISelLowering.h >> llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx >> llvm/trunk/test/CodeGen/X86/byval2.ll >> llvm/trunk/test/CodeGen/X86/byval3.ll >> llvm/trunk/test/CodeGen/X86/byval4.ll >> llvm/trunk/test/CodeGen/X86/byval5.ll >> llvm/trunk/test/CodeGen/X86/byval7.ll >> >> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) >> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Fri Apr 11 >> 23:36:06 2008 >> @@ -323,17 +323,20 @@ >> SDOperand getNode(unsigned Opcode, SDVTList VTs, >> const SDOperand *Ops, unsigned NumOps); >> >> - SDOperand getMemcpy(SDOperand Chain, SDOperand Dest, SDOperand >> Src, >> - SDOperand Size, SDOperand Align, >> - SDOperand AlwaysInline); >> - >> - SDOperand getMemmove(SDOperand Chain, SDOperand Dest, SDOperand >> Src, >> - SDOperand Size, SDOperand Align, >> - SDOperand AlwaysInline); >> - >> - SDOperand getMemset(SDOperand Chain, SDOperand Dest, SDOperand >> Src, >> - SDOperand Size, SDOperand Align, >> - SDOperand AlwaysInline); >> + SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src, >> + SDOperand Size, unsigned Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff); >> + >> + SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand >> Src, >> + SDOperand Size, unsigned Align, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff); >> + >> + SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src, >> + SDOperand Size, unsigned Align, >> + Value *DstSV, uint64_t DstOff); >> >> /// getSetCC - Helper function to make it easier to build SetCC's >> if you just >> /// have an ISD::CondCode instead of an SDOperand. >> >> Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) >> +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Fri Apr 11 >> 23:36:06 2008 >> @@ -497,14 +497,6 @@ >> // it returns an output chain. >> STACKRESTORE, >> >> - // MEMSET/MEMCPY/MEMMOVE - The first operand is the chain. The >> following >> - // correspond to the operands of the LLVM intrinsic functions >> and the last >> - // one is AlwaysInline. The only result is a token chain. The >> alignment >> - // argument is guaranteed to be a Constant node. >> - MEMSET, >> - MEMMOVE, >> - MEMCPY, >> - >> // CALLSEQ_START/CALLSEQ_END - These operators mark the >> beginning and end of >> // a call sequence, and carry arbitrary information that target >> might want >> // to know. The first operand is a chain, the rest are >> specified by the >> >> Modified: llvm/trunk/include/llvm/Target/TargetLowering.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) >> +++ llvm/trunk/include/llvm/Target/TargetLowering.h Fri Apr 11 >> 23:36:06 2008 >> @@ -948,17 +948,60 @@ >> SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); >> >> >> - virtual SDOperand LowerMEMCPY(SDOperand Op, SelectionDAG &DAG); >> - virtual SDOperand LowerMEMCPYCall(SDOperand Chain, SDOperand Dest, >> - SDOperand Source, SDOperand >> Count, >> - SelectionDAG &DAG); >> - virtual SDOperand LowerMEMCPYInline(SDOperand Chain, SDOperand >> Dest, >> - SDOperand Source, unsigned >> Size, >> - unsigned Align, SelectionDAG >> &DAG) { >> - assert(0 && "Not Implemented"); >> - return SDOperand(); // this is here to silence compiler errors >> + /// EmitTargetCodeForMemcpy - Emit target-specific code that >> performs a >> + /// memcpy. This can be used by targets to provide code sequences >> for cases >> + /// that don't fit the target's parameters for simple loads/ >> stores and can be >> + /// more efficient than using a library call. This function can >> return a null >> + /// SDOperand if the target declines to use inline code and a >> different >> + /// lowering strategy should be used. >> + /// >> + /// If AlwaysInline is true, the size is constant and the target >> should not >> + /// emit any calls and is strongly encouraged to attempt to emit >> inline code >> + /// even if it is beyond the usual threshold because this >> intrinsic is being >> + /// expanded in a place where calls are not feasible (e.g. within >> the prologue >> + /// for another call). If the target chooses to decline an >> AlwaysInline >> + /// request here, legalize will resort to using simple loads and >> stores. >> + virtual SDOperand >> + EmitTargetCodeForMemcpy(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Op1, SDOperand Op2, >> + SDOperand Op3, unsigned Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff) { >> + return SDOperand(); >> } >> >> + /// EmitTargetCodeForMemmove - Emit target-specific code that >> performs a >> + /// memmove. This can be used by targets to provide code >> sequences for cases >> + /// that don't fit the target's parameters for simple loads/ >> stores and can be >> + /// more efficient than using a library call. This function can >> return a null >> + /// SDOperand if the target declines to use code and a different >> lowering >> + /// strategy should be used. >> + virtual SDOperand >> + EmitTargetCodeForMemmove(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Op1, SDOperand Op2, >> + SDOperand Op3, unsigned Align, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff) { >> + return SDOperand(); >> + } >> + >> + /// EmitTargetCodeForMemset - Emit target-specific code that >> performs a >> + /// memset. This can be used by targets to provide code sequences >> for cases >> + /// that don't fit the target's parameters for simple stores and >> can be more >> + /// efficient than using a library call. This function can return >> a null >> + /// SDOperand if the target declines to use code and a different >> lowering >> + /// strategy should be used. >> + virtual SDOperand >> + EmitTargetCodeForMemset(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Op1, SDOperand Op2, >> + SDOperand Op3, unsigned Align, >> + Value *DstSV, uint64_t DstOff) { >> + return SDOperand(); >> + } >> >> /// LowerOperation - This callback is invoked for operations that >> are >> /// unsupported by the target, which are registered to use >> 'custom' lowering, >> >> Modified: llvm/trunk/include/llvm/Target/TargetSubtarget.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSubtarget.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/include/llvm/Target/TargetSubtarget.h (original) >> +++ llvm/trunk/include/llvm/Target/TargetSubtarget.h Fri Apr 11 >> 23:36:06 2008 >> @@ -28,9 +28,6 @@ >> protected: // Can only create subclasses... >> TargetSubtarget(); >> public: >> - /// getMaxInlineSizeThreshold - Returns the maximum memset / >> memcpy size >> - /// that still makes it profitable to inline the call. >> - virtual unsigned getMaxInlineSizeThreshold() const {return 0; } >> virtual ~TargetSubtarget(); >> }; >> >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -22,6 +22,7 @@ >> #include "llvm/Target/TargetData.h" >> #include "llvm/Target/TargetMachine.h" >> #include "llvm/Target/TargetOptions.h" >> +#include "llvm/Target/TargetSubtarget.h" >> #include "llvm/CallingConv.h" >> #include "llvm/Constants.h" >> #include "llvm/DerivedTypes.h" >> @@ -2842,123 +2843,6 @@ >> break; >> } >> break; >> - case ISD::MEMSET: >> - case ISD::MEMCPY: >> - case ISD::MEMMOVE: { >> - Tmp1 = LegalizeOp(Node->getOperand(0)); // Chain >> - Tmp2 = LegalizeOp(Node->getOperand(1)); // Pointer >> - >> - if (Node->getOpcode() == ISD::MEMSET) { // memset = ubyte >> - switch (getTypeAction(Node->getOperand(2).getValueType())) { >> - case Expand: assert(0 && "Cannot expand a byte!"); >> - case Legal: >> - Tmp3 = LegalizeOp(Node->getOperand(2)); >> - break; >> - case Promote: >> - Tmp3 = PromoteOp(Node->getOperand(2)); >> - break; >> - } >> - } else { >> - Tmp3 = LegalizeOp(Node->getOperand(2)); // memcpy/move = >> pointer, >> - } >> - >> - SDOperand Tmp4; >> - switch (getTypeAction(Node->getOperand(3).getValueType())) { >> - case Expand: { >> - // Length is too big, just take the lo-part of the length. >> - SDOperand HiPart; >> - ExpandOp(Node->getOperand(3), Tmp4, HiPart); >> - break; >> - } >> - case Legal: >> - Tmp4 = LegalizeOp(Node->getOperand(3)); >> - break; >> - case Promote: >> - Tmp4 = PromoteOp(Node->getOperand(3)); >> - break; >> - } >> - >> - SDOperand Tmp5; >> - switch (getTypeAction(Node->getOperand(4).getValueType())) >> { // uint >> - case Expand: assert(0 && "Cannot expand this yet!"); >> - case Legal: >> - Tmp5 = LegalizeOp(Node->getOperand(4)); >> - break; >> - case Promote: >> - Tmp5 = PromoteOp(Node->getOperand(4)); >> - break; >> - } >> - >> - SDOperand Tmp6; >> - switch (getTypeAction(Node->getOperand(5).getValueType())) >> { // bool >> - case Expand: assert(0 && "Cannot expand this yet!"); >> - case Legal: >> - Tmp6 = LegalizeOp(Node->getOperand(5)); >> - break; >> - case Promote: >> - Tmp6 = PromoteOp(Node->getOperand(5)); >> - break; >> - } >> - >> - switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) { >> - default: assert(0 && "This action not implemented for this >> operation!"); >> - case TargetLowering::Custom: >> - isCustom = true; >> - // FALLTHROUGH >> - case TargetLowering::Legal: { >> - SDOperand Ops[] = { Tmp1, Tmp2, Tmp3, Tmp4, Tmp5, Tmp6 }; >> - Result = DAG.UpdateNodeOperands(Result, Ops, 6); >> - if (isCustom) { >> - Tmp1 = TLI.LowerOperation(Result, DAG); >> - if (Tmp1.Val) Result = Tmp1; >> - } >> - break; >> - } >> - case TargetLowering::Expand: { >> - // Otherwise, the target does not support this operation. >> Lower the >> - // operation to an explicit libcall as appropriate. >> - MVT::ValueType IntPtr = TLI.getPointerTy(); >> - const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType(); >> - TargetLowering::ArgListTy Args; >> - TargetLowering::ArgListEntry Entry; >> - >> - const char *FnName = 0; >> - if (Node->getOpcode() == ISD::MEMSET) { >> - Entry.Node = Tmp2; Entry.Ty = IntPtrTy; >> - Args.push_back(Entry); >> - // Extend the (previously legalized) ubyte argument to be >> an int value >> - // for the call. >> - if (Tmp3.getValueType() > MVT::i32) >> - Tmp3 = DAG.getNode(ISD::TRUNCATE, MVT::i32, Tmp3); >> - else >> - Tmp3 = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Tmp3); >> - Entry.Node = Tmp3; Entry.Ty = Type::Int32Ty; Entry.isSExt = >> true; >> - Args.push_back(Entry); >> - Entry.Node = Tmp4; Entry.Ty = IntPtrTy; Entry.isSExt = >> false; >> - Args.push_back(Entry); >> - >> - FnName = "memset"; >> - } else if (Node->getOpcode() == ISD::MEMCPY || >> - Node->getOpcode() == ISD::MEMMOVE) { >> - Entry.Ty = IntPtrTy; >> - Entry.Node = Tmp2; Args.push_back(Entry); >> - Entry.Node = Tmp3; Args.push_back(Entry); >> - Entry.Node = Tmp4; Args.push_back(Entry); >> - FnName = Node->getOpcode() == ISD::MEMMOVE ? "memmove" : >> "memcpy"; >> - } else { >> - assert(0 && "Unknown op!"); >> - } >> - >> - std::pair CallResult = >> - TLI.LowerCallTo(Tmp1, Type::VoidTy, >> - false, false, false, CallingConv::C, false, >> - DAG.getExternalSymbol(FnName, IntPtr), >> Args, DAG); >> - Result = CallResult.second; >> - break; >> - } >> - } >> - break; >> - } >> >> case ISD::SHL_PARTS: >> case ISD::SRA_PARTS: >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -439,51 +439,6 @@ >> return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0); >> } >> >> -/// HandleMemIntrinsic - This handles memcpy/memset/memmove with >> invalid >> -/// operands. This promotes or expands the operands as required. >> -SDOperand DAGTypeLegalizer::HandleMemIntrinsic(SDNode *N) { >> - // The chain and pointer [operands #0 and #1] are always valid >> types. >> - SDOperand Chain = N->getOperand(0); >> - SDOperand Ptr = N->getOperand(1); >> - SDOperand Op2 = N->getOperand(2); >> - >> - // Op #2 is either a value (memset) or a pointer. Promote it if >> required. >> - switch (getTypeAction(Op2.getValueType())) { >> - default: assert(0 && "Unknown action for pointer/value operand"); >> - case Legal: break; >> - case Promote: Op2 = GetPromotedOp(Op2); break; >> - } >> - >> - // The length could have any action required. >> - SDOperand Length = N->getOperand(3); >> - switch (getTypeAction(Length.getValueType())) { >> - default: assert(0 && "Unknown action for memop operand"); >> - case Legal: break; >> - case Promote: Length = GetPromotedZExtOp(Length); break; >> - case Expand: >> - SDOperand Dummy; // discard the high part. >> - GetExpandedOp(Length, Length, Dummy); >> - break; >> - } >> - >> - SDOperand Align = N->getOperand(4); >> - switch (getTypeAction(Align.getValueType())) { >> - default: assert(0 && "Unknown action for memop operand"); >> - case Legal: break; >> - case Promote: Align = GetPromotedZExtOp(Align); break; >> - } >> - >> - SDOperand AlwaysInline = N->getOperand(5); >> - switch (getTypeAction(AlwaysInline.getValueType())) { >> - default: assert(0 && "Unknown action for memop operand"); >> - case Legal: break; >> - case Promote: AlwaysInline = GetPromotedZExtOp(AlwaysInline); >> break; >> - } >> - >> - SDOperand Ops[] = { Chain, Ptr, Op2, Length, Align, >> AlwaysInline }; >> - return DAG.UpdateNodeOperands(SDOperand(N, 0), Ops, 6); >> -} >> - >> /// JoinIntegers - Build an integer with low bits Lo and high bits >> Hi. >> SDOperand DAGTypeLegalizer::JoinIntegers(SDOperand Lo, SDOperand >> Hi) { >> MVT::ValueType LVT = Lo.getValueType(); >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Fri Apr 11 >> 23:36:06 2008 >> @@ -165,7 +165,6 @@ >> // Common routines. >> SDOperand BitConvertToInteger(SDOperand Op); >> SDOperand CreateStackStoreLoad(SDOperand Op, MVT::ValueType DestVT); >> - SDOperand HandleMemIntrinsic(SDNode *N); >> SDOperand JoinIntegers(SDOperand Lo, SDOperand Hi); >> void SplitInteger(SDOperand Op, SDOperand &Lo, SDOperand &Hi); >> void SplitInteger(SDOperand Op, MVT::ValueType LoVT, >> MVT::ValueType HiVT, >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp >> (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Fri >> Apr 11 23:36:06 2008 >> @@ -946,9 +946,6 @@ >> case ISD::STORE: >> Res = ExpandOperand_STORE(cast(N), OpNo); >> break; >> - case ISD::MEMSET: >> - case ISD::MEMCPY: >> - case ISD::MEMMOVE: Res = HandleMemIntrinsic(N); break; >> >> case ISD::BUILD_VECTOR: Res = ExpandOperand_BUILD_VECTOR(N); >> break; >> } >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ >> LegalizeTypesPromote.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp >> (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp Fri >> Apr 11 23:36:06 2008 >> @@ -447,9 +447,6 @@ >> >> case ISD::STORE: Res = >> PromoteOperand_STORE(cast(N), >> OpNo); break; >> - case ISD::MEMSET: >> - case ISD::MEMCPY: >> - case ISD::MEMMOVE: Res = HandleMemIntrinsic(N); break; >> >> case ISD::BUILD_VECTOR: Res = PromoteOperand_BUILD_VECTOR(N); break; >> case ISD::INSERT_VECTOR_ELT: >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -17,6 +17,7 @@ >> #include "llvm/Intrinsics.h" >> #include "llvm/DerivedTypes.h" >> #include "llvm/Assembly/Writer.h" >> +#include "llvm/CallingConv.h" >> #include "llvm/CodeGen/MachineBasicBlock.h" >> #include "llvm/CodeGen/MachineConstantPool.h" >> #include "llvm/CodeGen/MachineFrameInfo.h" >> @@ -2385,28 +2386,357 @@ >> return getNode(Opcode, VT, Ops, 5); >> } >> >> -SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dest, >> - SDOperand Src, SDOperand Size, >> - SDOperand Align, >> - SDOperand AlwaysInline) { >> - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; >> - return getNode(ISD::MEMCPY, MVT::Other, Ops, 6); >> +/// getMemsetValue - Vectorized representation of the memset value >> +/// operand. >> +static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT, >> + SelectionDAG &DAG) { >> + MVT::ValueType CurVT = VT; >> + if (ConstantSDNode *C = dyn_cast(Value)) { >> + uint64_t Val = C->getValue() & 255; >> + unsigned Shift = 8; >> + while (CurVT != MVT::i8) { >> + Val = (Val << Shift) | Val; >> + Shift <<= 1; >> + CurVT = (MVT::ValueType)((unsigned)CurVT - 1); >> + } >> + return DAG.getConstant(Val, VT); >> + } else { >> + Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value); >> + unsigned Shift = 8; >> + while (CurVT != MVT::i8) { >> + Value = >> + DAG.getNode(ISD::OR, VT, >> + DAG.getNode(ISD::SHL, VT, Value, >> + DAG.getConstant(Shift, MVT::i8)), >> Value); >> + Shift <<= 1; >> + CurVT = (MVT::ValueType)((unsigned)CurVT - 1); >> + } >> + >> + return Value; >> + } >> } >> >> -SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dest, >> +/// getMemsetStringVal - Similar to getMemsetValue. Except this is >> only >> +/// used when a memcpy is turned into a memset when the source is a >> constant >> +/// string ptr. >> +static SDOperand getMemsetStringVal(MVT::ValueType VT, >> + SelectionDAG &DAG, >> + const TargetLowering &TLI, >> + std::string &Str, unsigned >> Offset) { >> + uint64_t Val = 0; >> + unsigned MSB = MVT::getSizeInBits(VT) / 8; >> + if (TLI.isLittleEndian()) >> + Offset = Offset + MSB - 1; >> + for (unsigned i = 0; i != MSB; ++i) { >> + Val = (Val << 8) | (unsigned char)Str[Offset]; >> + Offset += TLI.isLittleEndian() ? -1 : 1; >> + } >> + return DAG.getConstant(Val, VT); >> +} >> + >> +/// getMemBasePlusOffset - Returns base and offset node for the >> +static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned >> Offset, >> + SelectionDAG &DAG) { >> + MVT::ValueType VT = Base.getValueType(); >> + return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, >> VT)); >> +} >> + >> +/// MeetsMaxMemopRequirement - Determines if the number of memory >> ops required >> +/// to replace the memset / memcpy is below the threshold. It also >> returns the >> +/// types of the sequence of memory ops to perform memset / memcpy. >> +static bool MeetsMaxMemopRequirement(std::vector >> &MemOps, >> + unsigned Limit, uint64_t Size, >> + unsigned Align, >> + const TargetLowering &TLI) { >> + MVT::ValueType VT; >> + >> + if (TLI.allowsUnalignedMemoryAccesses()) { >> + VT = MVT::i64; >> + } else { >> + switch (Align & 7) { >> + case 0: >> + VT = MVT::i64; >> + break; >> + case 4: >> + VT = MVT::i32; >> + break; >> + case 2: >> + VT = MVT::i16; >> + break; >> + default: >> + VT = MVT::i8; >> + break; >> + } >> + } >> + >> + MVT::ValueType LVT = MVT::i64; >> + while (!TLI.isTypeLegal(LVT)) >> + LVT = (MVT::ValueType)((unsigned)LVT - 1); >> + assert(MVT::isInteger(LVT)); >> + >> + if (VT > LVT) >> + VT = LVT; >> + >> + unsigned NumMemOps = 0; >> + while (Size != 0) { >> + unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> + while (VTSize > Size) { >> + VT = (MVT::ValueType)((unsigned)VT - 1); >> + VTSize >>= 1; >> + } >> + assert(MVT::isInteger(VT)); >> + >> + if (++NumMemOps > Limit) >> + return false; >> + MemOps.push_back(VT); >> + Size -= VTSize; >> + } >> + >> + return true; >> +} >> + >> +static SDOperand getMemcpyLoadsAndStores(SelectionDAG &DAG, >> + SDOperand Chain, SDOperand >> Dst, >> + SDOperand Src, uint64_t >> Size, >> + unsigned Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t >> DstOff, >> + Value *SrcSV, uint64_t >> SrcOff) { >> + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); >> + >> + // Expand memcpy to a series of store ops if the size operand >> falls below >> + // a certain threshold. >> + std::vector MemOps; >> + uint64_t Limit = -1; >> + if (!AlwaysInline) >> + Limit = TLI.getMaxStoresPerMemcpy(); >> + if (!MeetsMaxMemopRequirement(MemOps, Limit, Size, Align, TLI)) >> + return SDOperand(); >> + >> + SmallVector OutChains; >> + >> + unsigned NumMemOps = MemOps.size(); >> + unsigned SrcDelta = 0; >> + GlobalAddressSDNode *G = NULL; >> + std::string Str; >> + bool CopyFromStr = false; >> + >> + if (Src.getOpcode() == ISD::GlobalAddress) >> + G = cast(Src); >> + else if (Src.getOpcode() == ISD::ADD && >> + Src.getOperand(0).getOpcode() == ISD::GlobalAddress && >> + Src.getOperand(1).getOpcode() == ISD::Constant) { >> + G = cast(Src.getOperand(0)); >> + SrcDelta = cast(Src.getOperand(1))->getValue(); >> + } >> + if (G) { >> + GlobalVariable *GV = dyn_cast(G->getGlobal()); >> + if (GV && GV->isConstant()) { >> + Str = GV->getStringValue(false); >> + if (!Str.empty()) { >> + CopyFromStr = true; >> + SrcOff += SrcDelta; >> + } >> + } >> + } >> + >> + for (unsigned i = 0; i < NumMemOps; i++) { >> + MVT::ValueType VT = MemOps[i]; >> + unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> + SDOperand Value, Store; >> + >> + if (CopyFromStr) { >> + Value = getMemsetStringVal(VT, DAG, TLI, Str, SrcOff); >> + Store = >> + DAG.getStore(Chain, Value, >> + getMemBasePlusOffset(Dst, DstOff, DAG), >> + DstSV, DstOff); >> + } else { >> + Value = DAG.getLoad(VT, Chain, >> + getMemBasePlusOffset(Src, SrcOff, DAG), >> + SrcSV, SrcOff, false, Align); >> + Store = >> + DAG.getStore(Chain, Value, >> + getMemBasePlusOffset(Dst, DstOff, DAG), >> + DstSV, DstOff, false, Align); >> + } >> + OutChains.push_back(Store); >> + SrcOff += VTSize; >> + DstOff += VTSize; >> + } >> + >> + return DAG.getNode(ISD::TokenFactor, MVT::Other, >> + &OutChains[0], OutChains.size()); >> +} >> + >> +static SDOperand getMemsetStores(SelectionDAG &DAG, >> + SDOperand Chain, SDOperand Dst, >> + SDOperand Src, uint64_t Size, >> + unsigned Align, >> + Value *DstSV, uint64_t DstOff) { >> + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); >> + >> + // Expand memset to a series of load/store ops if the size operand >> + // falls below a certain threshold. >> + std::vector MemOps; >> + if (!MeetsMaxMemopRequirement(MemOps, TLI.getMaxStoresPerMemset(), >> + Size, Align, TLI)) >> + return SDOperand(); >> + >> + SmallVector OutChains; >> + >> + unsigned NumMemOps = MemOps.size(); >> + for (unsigned i = 0; i < NumMemOps; i++) { >> + MVT::ValueType VT = MemOps[i]; >> + unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> + SDOperand Value = getMemsetValue(Src, VT, DAG); >> + SDOperand Store = DAG.getStore(Chain, Value, >> + getMemBasePlusOffset(Dst, >> DstOff, DAG), >> + DstSV, DstOff); >> + OutChains.push_back(Store); >> + DstOff += VTSize; >> + } >> + >> + return DAG.getNode(ISD::TokenFactor, MVT::Other, >> + &OutChains[0], OutChains.size()); >> +} >> + >> +SDOperand SelectionDAG::getMemcpy(SDOperand Chain, SDOperand Dst, >> SDOperand Src, SDOperand Size, >> - SDOperand Align, >> - SDOperand AlwaysInline) { >> - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; >> - return getNode(ISD::MEMMOVE, MVT::Other, Ops, 6); >> + unsigned Align, bool AlwaysInline, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff) { >> + >> + // Check to see if we should lower the memcpy to loads and stores >> first. >> + // For cases within the target-specified limits, this is the best >> choice. >> + ConstantSDNode *ConstantSize = dyn_cast(Size); >> + if (ConstantSize) { >> + // Memcpy with size zero? Just return the original chain. >> + if (ConstantSize->isNullValue()) >> + return Chain; >> + >> + SDOperand Result = >> + getMemcpyLoadsAndStores(*this, Chain, Dst, Src, ConstantSize- >>> getValue(), >> + Align, false, DstSV, DstOff, SrcSV, >> SrcOff); >> + if (Result.Val) >> + return Result; >> + } >> + >> + // Then check to see if we should lower the memcpy with target- >> specific >> + // code. If the target chooses to do this, this is the next best. >> + SDOperand Result = >> + TLI.EmitTargetCodeForMemcpy(*this, Chain, Dst, Src, Size, Align, >> + AlwaysInline, >> + DstSV, DstOff, SrcSV, SrcOff); >> + if (Result.Val) >> + return Result; >> + >> + // If we really need inline code and the target declined to >> provide it, >> + // use a (potentially long) sequence of loads and stores. >> + if (AlwaysInline) { >> + assert(ConstantSize && "AlwaysInline requires a constant >> size!"); >> + return getMemcpyLoadsAndStores(*this, Chain, Dst, Src, >> + ConstantSize->getValue(), Align, >> true, >> + DstSV, DstOff, SrcSV, SrcOff); >> + } >> + >> + // Emit a library call. >> + TargetLowering::ArgListTy Args; >> + TargetLowering::ArgListEntry Entry; >> + Entry.Ty = TLI.getTargetData()->getIntPtrType(); >> + Entry.Node = Dst; Args.push_back(Entry); >> + Entry.Node = Src; Args.push_back(Entry); >> + Entry.Node = Size; Args.push_back(Entry); >> + std::pair CallResult = >> + TLI.LowerCallTo(Chain, Type::VoidTy, >> + false, false, false, CallingConv::C, false, >> + getExternalSymbol("memcpy", TLI.getPointerTy()), >> + Args, *this); >> + return CallResult.second; >> +} >> + >> +SDOperand SelectionDAG::getMemmove(SDOperand Chain, SDOperand Dst, >> + SDOperand Src, SDOperand Size, >> + unsigned Align, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t SrcOff) { >> + >> + // TODO: Optimize small memmove cases with simple loads and >> stores, >> + // ensuring that all loads precede all stores. This can cause >> severe >> + // register pressure, so targets should be careful with the size >> limit. >> + >> + // Then check to see if we should lower the memmove with target- >> specific >> + // code. If the target chooses to do this, this is the next best. >> + SDOperand Result = >> + TLI.EmitTargetCodeForMemmove(*this, Chain, Dst, Src, Size, >> Align, >> + DstSV, DstOff, SrcSV, SrcOff); >> + if (Result.Val) >> + return Result; >> + >> + // Emit a library call. >> + TargetLowering::ArgListTy Args; >> + TargetLowering::ArgListEntry Entry; >> + Entry.Ty = TLI.getTargetData()->getIntPtrType(); >> + Entry.Node = Dst; Args.push_back(Entry); >> + Entry.Node = Src; Args.push_back(Entry); >> + Entry.Node = Size; Args.push_back(Entry); >> + std::pair CallResult = >> + TLI.LowerCallTo(Chain, Type::VoidTy, >> + false, false, false, CallingConv::C, false, >> + getExternalSymbol("memmove", >> TLI.getPointerTy()), >> + Args, *this); >> + return CallResult.second; >> } >> >> -SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dest, >> +SDOperand SelectionDAG::getMemset(SDOperand Chain, SDOperand Dst, >> SDOperand Src, SDOperand Size, >> - SDOperand Align, >> - SDOperand AlwaysInline) { >> - SDOperand Ops[] = { Chain, Dest, Src, Size, Align, AlwaysInline }; >> - return getNode(ISD::MEMSET, MVT::Other, Ops, 6); >> + unsigned Align, >> + Value *DstSV, uint64_t DstOff) { >> + >> + // Check to see if we should lower the memset to stores first. >> + // For cases within the target-specified limits, this is the best >> choice. >> + ConstantSDNode *ConstantSize = dyn_cast(Size); >> + if (ConstantSize) { >> + // Memset with size zero? Just return the original chain. >> + if (ConstantSize->isNullValue()) >> + return Chain; >> + >> + SDOperand Result = >> + getMemsetStores(*this, Chain, Dst, Src, ConstantSize- >>> getValue(), Align, >> + DstSV, DstOff); >> + if (Result.Val) >> + return Result; >> + } >> + >> + // Then check to see if we should lower the memset with target- >> specific >> + // code. If the target chooses to do this, this is the next best. >> + SDOperand Result = >> + TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align, >> + DstSV, DstOff); >> + if (Result.Val) >> + return Result; >> + >> + // Emit a library call. >> + const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType(); >> + TargetLowering::ArgListTy Args; >> + TargetLowering::ArgListEntry Entry; >> + Entry.Node = Dst; Entry.Ty = IntPtrTy; >> + Args.push_back(Entry); >> + // Extend or truncate the argument to be an i32 value for the >> call. >> + if (Src.getValueType() > MVT::i32) >> + Src = getNode(ISD::TRUNCATE, MVT::i32, Src); >> + else >> + Src = getNode(ISD::ZERO_EXTEND, MVT::i32, Src); >> + Entry.Node = Src; Entry.Ty = Type::Int32Ty; Entry.isSExt = true; >> + Args.push_back(Entry); >> + Entry.Node = Size; Entry.Ty = IntPtrTy; Entry.isSExt = false; >> + Args.push_back(Entry); >> + std::pair CallResult = >> + TLI.LowerCallTo(Chain, Type::VoidTy, >> + false, false, false, CallingConv::C, false, >> + getExternalSymbol("memset", TLI.getPointerTy()), >> + Args, *this); >> + return CallResult.second; >> } >> >> SDOperand SelectionDAG::getAtomic(unsigned Opcode, SDOperand Chain, >> @@ -4009,11 +4339,6 @@ >> case ISD::STACKRESTORE: return "stackrestore"; >> case ISD::TRAP: return "trap"; >> >> - // Block memory operations. >> - case ISD::MEMSET: return "memset"; >> - case ISD::MEMCPY: return "memcpy"; >> - case ISD::MEMMOVE: return "memmove"; >> - >> // Bit manipulation >> case ISD::BSWAP: return "bswap"; >> case ISD::CTPOP: return "ctpop"; >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp >> (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr >> 11 23:36:06 2008 >> @@ -647,8 +647,6 @@ >> void visitVAEnd(CallInst &I); >> void visitVACopy(CallInst &I); >> >> - void visitMemIntrinsic(CallInst &I, unsigned Op); >> - >> void visitGetResult(GetResultInst &I); >> >> void visitUserOp1(Instruction &I) { >> @@ -2737,18 +2735,48 @@ >> return "_longjmp"+!TLI.usesUnderscoreLongJmp(); >> break; >> case Intrinsic::memcpy_i32: >> - case Intrinsic::memcpy_i64: >> - visitMemIntrinsic(I, ISD::MEMCPY); >> + case Intrinsic::memcpy_i64: { >> + SDOperand Op1 = getValue(I.getOperand(1)); >> + SDOperand Op2 = getValue(I.getOperand(2)); >> + SDOperand Op3 = getValue(I.getOperand(3)); >> + unsigned Align = cast(I.getOperand(4))- >>> getZExtValue(); >> + DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, >> false, >> + I.getOperand(1), 0, I.getOperand(2), >> 0)); >> return 0; >> + } >> case Intrinsic::memset_i32: >> - case Intrinsic::memset_i64: >> - visitMemIntrinsic(I, ISD::MEMSET); >> + case Intrinsic::memset_i64: { >> + SDOperand Op1 = getValue(I.getOperand(1)); >> + SDOperand Op2 = getValue(I.getOperand(2)); >> + SDOperand Op3 = getValue(I.getOperand(3)); >> + unsigned Align = cast(I.getOperand(4))- >>> getZExtValue(); >> + DAG.setRoot(DAG.getMemset(getRoot(), Op1, Op2, Op3, Align, >> + I.getOperand(1), 0)); >> return 0; >> + } >> case Intrinsic::memmove_i32: >> - case Intrinsic::memmove_i64: >> - visitMemIntrinsic(I, ISD::MEMMOVE); >> + case Intrinsic::memmove_i64: { >> + SDOperand Op1 = getValue(I.getOperand(1)); >> + SDOperand Op2 = getValue(I.getOperand(2)); >> + SDOperand Op3 = getValue(I.getOperand(3)); >> + unsigned Align = cast(I.getOperand(4))- >>> getZExtValue(); >> + >> + // If the source and destination are known to not be aliases, >> we can >> + // lower memmove as memcpy. >> + uint64_t Size = -1ULL; >> + if (ConstantSDNode *C = dyn_cast(Op3)) >> + Size = C->getValue(); >> + if (AA.alias(I.getOperand(1), Size, I.getOperand(2), Size) == >> + AliasAnalysis::NoAlias) { >> + DAG.setRoot(DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Align, >> false, >> + I.getOperand(1), 0, >> I.getOperand(2), 0)); >> + return 0; >> + } >> + >> + DAG.setRoot(DAG.getMemmove(getRoot(), Op1, Op2, Op3, Align, >> + I.getOperand(1), 0, I.getOperand(2), >> 0)); >> return 0; >> - >> + } >> case Intrinsic::dbg_stoppoint: { >> MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); >> DbgStopPointInst &SPI = cast(I); >> @@ -4342,242 +4370,6 @@ >> return SDOperand(); >> } >> >> -/// getMemsetValue - Vectorized representation of the memset value >> -/// operand. >> -static SDOperand getMemsetValue(SDOperand Value, MVT::ValueType VT, >> - SelectionDAG &DAG) { >> - MVT::ValueType CurVT = VT; >> - if (ConstantSDNode *C = dyn_cast(Value)) { >> - uint64_t Val = C->getValue() & 255; >> - unsigned Shift = 8; >> - while (CurVT != MVT::i8) { >> - Val = (Val << Shift) | Val; >> - Shift <<= 1; >> - CurVT = (MVT::ValueType)((unsigned)CurVT - 1); >> - } >> - return DAG.getConstant(Val, VT); >> - } else { >> - Value = DAG.getNode(ISD::ZERO_EXTEND, VT, Value); >> - unsigned Shift = 8; >> - while (CurVT != MVT::i8) { >> - Value = >> - DAG.getNode(ISD::OR, VT, >> - DAG.getNode(ISD::SHL, VT, Value, >> - DAG.getConstant(Shift, MVT::i8)), >> Value); >> - Shift <<= 1; >> - CurVT = (MVT::ValueType)((unsigned)CurVT - 1); >> - } >> - >> - return Value; >> - } >> -} >> - >> -/// getMemsetStringVal - Similar to getMemsetValue. Except this is >> only >> -/// used when a memcpy is turned into a memset when the source is a >> constant >> -/// string ptr. >> -static SDOperand getMemsetStringVal(MVT::ValueType VT, >> - SelectionDAG &DAG, >> TargetLowering &TLI, >> - std::string &Str, unsigned >> Offset) { >> - uint64_t Val = 0; >> - unsigned MSB = MVT::getSizeInBits(VT) / 8; >> - if (TLI.isLittleEndian()) >> - Offset = Offset + MSB - 1; >> - for (unsigned i = 0; i != MSB; ++i) { >> - Val = (Val << 8) | (unsigned char)Str[Offset]; >> - Offset += TLI.isLittleEndian() ? -1 : 1; >> - } >> - return DAG.getConstant(Val, VT); >> -} >> - >> -/// getMemBasePlusOffset - Returns base and offset node for the >> -static SDOperand getMemBasePlusOffset(SDOperand Base, unsigned >> Offset, >> - SelectionDAG &DAG, >> TargetLowering &TLI) { >> - MVT::ValueType VT = Base.getValueType(); >> - return DAG.getNode(ISD::ADD, VT, Base, DAG.getConstant(Offset, >> VT)); >> -} >> - >> -/// MeetsMaxMemopRequirement - Determines if the number of memory >> ops required >> -/// to replace the memset / memcpy is below the threshold. It also >> returns the >> -/// types of the sequence of memory ops to perform memset / memcpy. >> -static bool MeetsMaxMemopRequirement(std::vector >> &MemOps, >> - unsigned Limit, uint64_t Size, >> - unsigned Align, TargetLowering >> &TLI) { >> - MVT::ValueType VT; >> - >> - if (TLI.allowsUnalignedMemoryAccesses()) { >> - VT = MVT::i64; >> - } else { >> - switch (Align & 7) { >> - case 0: >> - VT = MVT::i64; >> - break; >> - case 4: >> - VT = MVT::i32; >> - break; >> - case 2: >> - VT = MVT::i16; >> - break; >> - default: >> - VT = MVT::i8; >> - break; >> - } >> - } >> - >> - MVT::ValueType LVT = MVT::i64; >> - while (!TLI.isTypeLegal(LVT)) >> - LVT = (MVT::ValueType)((unsigned)LVT - 1); >> - assert(MVT::isInteger(LVT)); >> - >> - if (VT > LVT) >> - VT = LVT; >> - >> - unsigned NumMemOps = 0; >> - while (Size != 0) { >> - unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> - while (VTSize > Size) { >> - VT = (MVT::ValueType)((unsigned)VT - 1); >> - VTSize >>= 1; >> - } >> - assert(MVT::isInteger(VT)); >> - >> - if (++NumMemOps > Limit) >> - return false; >> - MemOps.push_back(VT); >> - Size -= VTSize; >> - } >> - >> - return true; >> -} >> - >> -void SelectionDAGLowering::visitMemIntrinsic(CallInst &I, unsigned >> Op) { >> - SDOperand Op1 = getValue(I.getOperand(1)); >> - SDOperand Op2 = getValue(I.getOperand(2)); >> - SDOperand Op3 = getValue(I.getOperand(3)); >> - SDOperand Op4 = getValue(I.getOperand(4)); >> - unsigned Align = (unsigned)cast(Op4)->getValue(); >> - if (Align == 0) Align = 1; >> - >> - // If the source and destination are known to not be aliases, we >> can >> - // lower memmove as memcpy. >> - if (Op == ISD::MEMMOVE) { >> - uint64_t Size = -1ULL; >> - if (ConstantSDNode *C = dyn_cast(Op3)) >> - Size = C->getValue(); >> - if (AA.alias(I.getOperand(1), Size, I.getOperand(2), Size) == >> - AliasAnalysis::NoAlias) >> - Op = ISD::MEMCPY; >> - } >> - >> - if (ConstantSDNode *Size = dyn_cast(Op3)) { >> - std::vector MemOps; >> - >> - // Expand memset / memcpy to a series of load / store ops >> - // if the size operand falls below a certain threshold. >> - SmallVector OutChains; >> - switch (Op) { >> - default: break; // Do nothing for now. >> - case ISD::MEMSET: { >> - if (MeetsMaxMemopRequirement(MemOps, >> TLI.getMaxStoresPerMemset(), >> - Size->getValue(), Align, TLI)) { >> - unsigned NumMemOps = MemOps.size(); >> - unsigned Offset = 0; >> - for (unsigned i = 0; i < NumMemOps; i++) { >> - MVT::ValueType VT = MemOps[i]; >> - unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> - SDOperand Value = getMemsetValue(Op2, VT, DAG); >> - SDOperand Store = DAG.getStore(getRoot(), Value, >> - getMemBasePlusOffset(Op1, >> Offset, DAG, TLI), >> - I.getOperand(1), Offset); >> - OutChains.push_back(Store); >> - Offset += VTSize; >> - } >> - } >> - break; >> - } >> - case ISD::MEMCPY: { >> - if (MeetsMaxMemopRequirement(MemOps, >> TLI.getMaxStoresPerMemcpy(), >> - Size->getValue(), Align, TLI)) { >> - unsigned NumMemOps = MemOps.size(); >> - unsigned SrcOff = 0, DstOff = 0, SrcDelta = 0; >> - GlobalAddressSDNode *G = NULL; >> - std::string Str; >> - bool CopyFromStr = false; >> - >> - if (Op2.getOpcode() == ISD::GlobalAddress) >> - G = cast(Op2); >> - else if (Op2.getOpcode() == ISD::ADD && >> - Op2.getOperand(0).getOpcode() == >> ISD::GlobalAddress && >> - Op2.getOperand(1).getOpcode() == ISD::Constant) { >> - G = cast(Op2.getOperand(0)); >> - SrcDelta = cast(Op2.getOperand(1))- >>> getValue(); >> - } >> - if (G) { >> - GlobalVariable *GV = dyn_cast(G- >>> getGlobal()); >> - if (GV && GV->isConstant()) { >> - Str = GV->getStringValue(false); >> - if (!Str.empty()) { >> - CopyFromStr = true; >> - SrcOff += SrcDelta; >> - } >> - } >> - } >> - >> - for (unsigned i = 0; i < NumMemOps; i++) { >> - MVT::ValueType VT = MemOps[i]; >> - unsigned VTSize = MVT::getSizeInBits(VT) / 8; >> - SDOperand Value, Chain, Store; >> - >> - if (CopyFromStr) { >> - Value = getMemsetStringVal(VT, DAG, TLI, Str, SrcOff); >> - Chain = getRoot(); >> - Store = >> - DAG.getStore(Chain, Value, >> - getMemBasePlusOffset(Op1, DstOff, DAG, >> TLI), >> - I.getOperand(1), DstOff); >> - } else { >> - Value = DAG.getLoad(VT, getRoot(), >> - getMemBasePlusOffset(Op2, SrcOff, >> DAG, TLI), >> - I.getOperand(2), SrcOff, false, >> Align); >> - Chain = Value.getValue(1); >> - Store = >> - DAG.getStore(Chain, Value, >> - getMemBasePlusOffset(Op1, DstOff, DAG, >> TLI), >> - I.getOperand(1), DstOff, false, Align); >> - } >> - OutChains.push_back(Store); >> - SrcOff += VTSize; >> - DstOff += VTSize; >> - } >> - } >> - break; >> - } >> - } >> - >> - if (!OutChains.empty()) { >> - DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, >> - &OutChains[0], OutChains.size())); >> - return; >> - } >> - } >> - >> - SDOperand AlwaysInline = DAG.getConstant(0, MVT::i1); >> - SDOperand Node; >> - switch(Op) { >> - default: >> - assert(0 && "Unknown Op"); >> - case ISD::MEMCPY: >> - Node = DAG.getMemcpy(getRoot(), Op1, Op2, Op3, Op4, >> AlwaysInline); >> - break; >> - case ISD::MEMMOVE: >> - Node = DAG.getMemmove(getRoot(), Op1, Op2, Op3, Op4, >> AlwaysInline); >> - break; >> - case ISD::MEMSET: >> - Node = DAG.getMemset(getRoot(), Op1, Op2, Op3, Op4, >> AlwaysInline); >> - break; >> - } >> - DAG.setRoot(Node); >> -} >> - >> // >> = >> = >> = >> ----------------------------------------------------------------------= >> ==// >> // SelectionDAGISel code >> // >> = >> = >> = >> ----------------------------------------------------------------------= >> ==// >> >> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Fri Apr >> 11 23:36:06 2008 >> @@ -17,7 +17,7 @@ >> #include "llvm/Target/TargetData.h" >> #include "llvm/Target/TargetMachine.h" >> #include "llvm/Target/TargetRegisterInfo.h" >> -#include "llvm/CallingConv.h" >> +#include "llvm/GlobalVariable.h" >> #include "llvm/DerivedTypes.h" >> #include "llvm/CodeGen/SelectionDAG.h" >> #include "llvm/ADT/StringExtras.h" >> @@ -234,59 +234,6 @@ >> >> TargetLowering::~TargetLowering() {} >> >> - >> -SDOperand TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG >> &DAG) { >> - assert(getSubtarget() && "Subtarget not defined"); >> - SDOperand ChainOp = Op.getOperand(0); >> - SDOperand DestOp = Op.getOperand(1); >> - SDOperand SourceOp = Op.getOperand(2); >> - SDOperand CountOp = Op.getOperand(3); >> - SDOperand AlignOp = Op.getOperand(4); >> - SDOperand AlwaysInlineOp = Op.getOperand(5); >> - >> - bool AlwaysInline = (bool)cast(AlwaysInlineOp)- >>> getValue(); >> - unsigned Align = (unsigned)cast(AlignOp)- >>> getValue(); >> - if (Align == 0) Align = 1; >> - >> - // If size is unknown, call memcpy. >> - ConstantSDNode *I = dyn_cast(CountOp); >> - if (!I) { >> - assert(!AlwaysInline && "Cannot inline copy of unknown size"); >> - return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG); >> - } >> - >> - // If not DWORD aligned or if size is more than threshold, then >> call memcpy. >> - // The libc version is likely to be faster for the following >> cases. It can >> - // use the address value and run time information about the CPU. >> - // With glibc 2.6.1 on a core 2, coping an array of 100M longs >> was 30% faster >> - unsigned Size = I->getValue(); >> - if (AlwaysInline || >> - (Size <= getSubtarget()->getMaxInlineSizeThreshold() && >> - (Align & 3) == 0)) >> - return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, >> Align, DAG); >> - return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG); >> -} >> - >> - >> -SDOperand TargetLowering::LowerMEMCPYCall(SDOperand Chain, >> - SDOperand Dest, >> - SDOperand Source, >> - SDOperand Count, >> - SelectionDAG &DAG) { >> - MVT::ValueType IntPtr = getPointerTy(); >> - TargetLowering::ArgListTy Args; >> - TargetLowering::ArgListEntry Entry; >> - Entry.Ty = getTargetData()->getIntPtrType(); >> - Entry.Node = Dest; Args.push_back(Entry); >> - Entry.Node = Source; Args.push_back(Entry); >> - Entry.Node = Count; Args.push_back(Entry); >> - std::pair CallResult = >> - LowerCallTo(Chain, Type::VoidTy, false, false, false, >> CallingConv::C, >> - false, DAG.getExternalSymbol("memcpy", IntPtr), >> Args, DAG); >> - return CallResult.second; >> -} >> - >> - >> /// computeRegisterProperties - Once all of the register classes are >> added, >> /// this allows us to compute derived properties we expose. >> void TargetLowering::computeRegisterProperties() { >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -197,11 +197,6 @@ >> setOperationAction(ISD::GLOBAL_OFFSET_TABLE, MVT::i32, Custom); >> setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); >> >> - // Expand mem operations genericly. >> - setOperationAction(ISD::MEMSET , MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY , MVT::Other, Custom); >> - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); >> - >> // Use the default implementation. >> setOperationAction(ISD::VASTART , MVT::Other, Custom); >> setOperationAction(ISD::VAARG , MVT::Other, Expand); >> @@ -1246,18 +1241,30 @@ >> return DAG.getNode(ARMISD::CNEG, VT, AbsVal, AbsVal, ARMCC, CCR, >> Cmp); >> } >> >> -SDOperand ARMTargetLowering::LowerMEMCPYInline(SDOperand Chain, >> - SDOperand Dest, >> - SDOperand Source, >> - unsigned Size, >> - unsigned Align, >> - SelectionDAG &DAG) { >> +SDOperand >> +ARMTargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand >> Src, >> + SDOperand Size, unsigned >> Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t >> DstOff, >> + Value *SrcSV, uint64_t >> SrcOff){ >> // Do repeated 4-byte loads and stores. To be improved. >> - assert((Align & 3) == 0 && "Expected 4-byte aligned addresses!"); >> - unsigned BytesLeft = Size & 3; >> - unsigned NumMemOps = Size >> 2; >> + // This requires 4-byte alignment. >> + if ((Align & 3) != 0) >> + return SDOperand(); >> + // This requires the copy size to be a constant, preferrably >> + // within a subtarget-specific limit. >> + ConstantSDNode *ConstantSize = dyn_cast(Size); >> + if (!ConstantSize) >> + return SDOperand(); >> + uint64_t SizeVal = ConstantSize->getValue(); >> + if (!AlwaysInline && SizeVal > getSubtarget()- >>> getMaxInlineSizeThreshold()) >> + return SDOperand(); >> + >> + unsigned BytesLeft = SizeVal & 3; >> + unsigned NumMemOps = SizeVal >> 2; >> unsigned EmittedNumMemOps = 0; >> - unsigned SrcOff = 0, DstOff = 0; >> MVT::ValueType VT = MVT::i32; >> unsigned VTSize = 4; >> unsigned i = 0; >> @@ -1272,9 +1279,9 @@ >> for (i = 0; >> i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; + >> +i) { >> Loads[i] = DAG.getLoad(VT, Chain, >> - DAG.getNode(ISD::ADD, MVT::i32, Source, >> + DAG.getNode(ISD::ADD, MVT::i32, Src, >> DAG.getConstant(SrcOff, >> MVT::i32)), >> - NULL, 0); >> + SrcSV, SrcOff); >> TFOps[i] = Loads[i].getValue(1); >> SrcOff += VTSize; >> } >> @@ -1283,9 +1290,9 @@ >> for (i = 0; >> i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; + >> +i) { >> TFOps[i] = DAG.getStore(Chain, Loads[i], >> - DAG.getNode(ISD::ADD, MVT::i32, Dest, >> + DAG.getNode(ISD::ADD, MVT::i32, Dst, >> DAG.getConstant(DstOff, >> MVT::i32)), >> - NULL, 0); >> + DstSV, DstOff); >> DstOff += VTSize; >> } >> Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &TFOps[0], i); >> @@ -1309,9 +1316,9 @@ >> } >> >> Loads[i] = DAG.getLoad(VT, Chain, >> - DAG.getNode(ISD::ADD, MVT::i32, Source, >> + DAG.getNode(ISD::ADD, MVT::i32, Src, >> DAG.getConstant(SrcOff, >> MVT::i32)), >> - NULL, 0); >> + SrcSV, SrcOff); >> TFOps[i] = Loads[i].getValue(1); >> ++i; >> SrcOff += VTSize; >> @@ -1331,9 +1338,9 @@ >> } >> >> TFOps[i] = DAG.getStore(Chain, Loads[i], >> - DAG.getNode(ISD::ADD, MVT::i32, Dest, >> + DAG.getNode(ISD::ADD, MVT::i32, Dst, >> DAG.getConstant(DstOff, >> MVT::i32)), >> - NULL, 0); >> + DstSV, DstOff); >> ++i; >> DstOff += VTSize; >> BytesLeft -= VTSize; >> @@ -1409,7 +1416,6 @@ >> case ISD::RETURNADDR: break; >> case ISD::FRAMEADDR: break; >> case ISD::GLOBAL_OFFSET_TABLE: return LowerGLOBAL_OFFSET_TABLE(Op, >> DAG); >> - case ISD::MEMCPY: return LowerMEMCPY(Op, DAG); >> case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, >> DAG); >> >> >> >> Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Fri Apr 11 23:36:06 >> 2008 >> @@ -119,8 +119,8 @@ >> getRegClassForInlineAsmConstraint(const std::string &Constraint, >> MVT::ValueType VT) const; >> >> - virtual const TargetSubtarget* getSubtarget() { >> - return static_cast(Subtarget); >> + virtual const ARMSubtarget* getSubtarget() { >> + return Subtarget; >> } >> >> private: >> @@ -143,11 +143,14 @@ >> SDOperand LowerGLOBAL_OFFSET_TABLE(SDOperand Op, SelectionDAG >> &DAG); >> SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG); >> SDOperand LowerBR_JT(SDOperand Op, SelectionDAG &DAG); >> - SDOperand LowerMEMCPYInline(SDOperand Chain, SDOperand Dest, >> - SDOperand Source, unsigned Size, >> - unsigned Align, SelectionDAG &DAG); >> - >> >> + SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand Src, >> + SDOperand Size, unsigned >> Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t >> SrcOff); >> }; >> } >> >> >> Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original) >> +++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Fri Apr 11 23:36:06 2008 >> @@ -62,6 +62,8 @@ >> /// >> ARMSubtarget(const Module &M, const std::string &FS, bool thumb); >> >> + /// getMaxInlineSizeThreshold - Returns the maximum memset / >> memcpy size >> + /// that still makes it profitable to inline the call. >> unsigned getMaxInlineSizeThreshold() const { >> // FIXME: For now, we don't lower memcpy's to loads / stores for >> Thumb. >> // Change this once Thumb ldmia / stmia support is added. >> >> Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -87,10 +87,6 @@ >> setOperationAction(ISD::SDIV , MVT::i64, Custom); >> setOperationAction(ISD::UDIV , MVT::i64, Custom); >> >> - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); >> - setOperationAction(ISD::MEMSET , MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY , MVT::Other, Expand); >> - >> // We don't support sin/cos/sqrt/pow >> setOperationAction(ISD::FSIN , MVT::f64, Expand); >> setOperationAction(ISD::FCOS , MVT::f64, Expand); >> >> Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -175,9 +175,6 @@ >> setOperationAction(ISD::SELECT_CC, MVT::Other, Expand); >> >> // SPU has no intrinsics for these particular operations: >> - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); >> - setOperationAction(ISD::MEMSET, MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); >> setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); >> >> // PowerPC has no SREM/UREM instructions >> >> Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -65,9 +65,6 @@ >> setOperationAction(ISD::UREM , MVT::f32 , Expand); >> setOperationAction(ISD::UREM , MVT::f64 , Expand); >> >> - setOperationAction(ISD::MEMMOVE , MVT::Other, >> Expand); >> - setOperationAction(ISD::MEMSET , MVT::Other, >> Expand); >> - setOperationAction(ISD::MEMCPY , MVT::Other, >> Expand); >> setOperationAction(ISD::MEMBARRIER , MVT::Other, Expand); >> >> setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote); >> >> Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -80,9 +80,6 @@ >> setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand); >> >> // Mips not supported intrinsics. >> - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); >> - setOperationAction(ISD::MEMSET, MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); >> setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); >> >> setOperationAction(ISD::CTPOP, MVT::i32, Expand); >> >> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -78,9 +78,6 @@ >> setOperationAction(ISD::FP_ROUND_INREG, MVT::ppcf128, Custom); >> >> // PowerPC has no intrinsics for these particular operations >> - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); >> - setOperationAction(ISD::MEMSET, MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); >> setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); >> >> // PowerPC has no SREM/UREM instructions >> @@ -1735,10 +1732,9 @@ >> CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand >> Chain, >> ISD::ArgFlagsTy Flags, SelectionDAG &DAG, >> unsigned Size) { >> - SDOperand AlignNode = DAG.getConstant(Flags.getByValAlign(), >> MVT::i32); >> - SDOperand SizeNode = DAG.getConstant(Size, MVT::i32); >> - SDOperand AlwaysInline = DAG.getConstant(0, MVT::i32); >> - return DAG.getMemcpy(Chain, Dst, Src, SizeNode, AlignNode, >> AlwaysInline); >> + SDOperand SizeNode = DAG.getConstant(Size, MVT::i32); >> + return DAG.getMemcpy(Chain, Dst, Src, SizeNode, >> Flags.getByValAlign(), false, >> + NULL, 0, NULL, 0); >> } >> >> SDOperand PPCTargetLowering::LowerCALL(SDOperand Op, SelectionDAG >> &DAG, >> >> Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -570,9 +570,6 @@ >> setOperationAction(ISD::SELECT_CC, MVT::f64, Custom); >> >> // SPARC has no intrinsics for these particular operations. >> - setOperationAction(ISD::MEMMOVE, MVT::Other, Expand); >> - setOperationAction(ISD::MEMSET, MVT::Other, Expand); >> - setOperationAction(ISD::MEMCPY, MVT::Other, Expand); >> setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); >> >> setOperationAction(ISD::FSIN , MVT::f64, Expand); >> >> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) >> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Apr 11 >> 23:36:06 2008 >> @@ -206,7 +206,6 @@ >> setOperationAction(ISD::BRCOND , MVT::Other, Custom); >> setOperationAction(ISD::BR_CC , MVT::Other, Expand); >> setOperationAction(ISD::SELECT_CC , MVT::Other, Expand); >> - setOperationAction(ISD::MEMMOVE , MVT::Other, Expand); >> if (Subtarget->is64Bit()) >> setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i32, Legal); >> setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16 , Legal); >> @@ -281,9 +280,6 @@ >> setOperationAction(ISD::SRA_PARTS , MVT::i64 , Custom); >> setOperationAction(ISD::SRL_PARTS , MVT::i64 , Custom); >> } >> - // X86 wants to expand memset / memcpy itself. >> - setOperationAction(ISD::MEMSET , MVT::Other, Custom); >> - setOperationAction(ISD::MEMCPY , MVT::Other, Custom); >> >> if (Subtarget->hasSSE1()) >> setOperationAction(ISD::PREFETCH , MVT::Other, Legal); >> @@ -1113,10 +1109,10 @@ >> static SDOperand >> CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand >> Chain, >> ISD::ArgFlagsTy Flags, SelectionDAG &DAG) { >> - SDOperand AlignNode = DAG.getConstant(Flags.getByValAlign(), >> MVT::i32); >> SDOperand SizeNode = DAG.getConstant(Flags.getByValSize(), >> MVT::i32); >> - SDOperand AlwaysInline = DAG.getConstant(1, MVT::i32); >> - return DAG.getMemcpy(Chain, Dst, Src, SizeNode, AlignNode, >> AlwaysInline); >> + return DAG.getMemcpy(Chain, Dst, Src, SizeNode, >> Flags.getByValAlign(), >> + /*AlwaysInline=*/true, >> + NULL, 0, NULL, 0); >> } >> >> SDOperand X86TargetLowering::LowerMemArgument(SDOperand Op, >> SelectionDAG &DAG, >> @@ -4557,52 +4553,51 @@ >> return DAG.getNode(ISD::MERGE_VALUES, Tys, Ops1, 2); >> } >> >> -SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG >> &DAG) { >> - SDOperand InFlag(0, 0); >> - SDOperand Chain = Op.getOperand(0); >> - unsigned Align = >> - (unsigned)cast(Op.getOperand(4))->getValue(); >> - if (Align == 0) Align = 1; >> - >> - ConstantSDNode *I = dyn_cast(Op.getOperand(3)); >> - // If not DWORD aligned or size is more than the threshold, call >> memset. >> - // The libc version is likely to be faster for these cases. It >> can use the >> - // address value and run time information about the CPU. >> - if ((Align & 3) != 0 || >> - (I && I->getValue() > Subtarget- >>> getMaxInlineSizeThreshold())) { >> +SDOperand >> +X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand >> Src, >> + SDOperand Size, unsigned >> Align, >> + Value *DstSV, uint64_t >> DstOff) { >> + ConstantSDNode *ConstantSize = dyn_cast(Size); >> + >> + /// If not DWORD aligned or size is more than the threshold, call >> the library. >> + /// The libc version is likely to be faster for these cases. It >> can use the >> + /// address value and run time information about the CPU. >> + if ((Align & 3) == 0 || >> + !ConstantSize || >> + ConstantSize->getValue() > getSubtarget()- >>> getMaxInlineSizeThreshold()) { >> + SDOperand InFlag(0, 0); >> >> // Check to see if there is a specialized entry-point for memory >> zeroing. >> - ConstantSDNode *V = dyn_cast(Op.getOperand(2)); >> - const char *bzeroEntry = >> - V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0; >> - >> - MVT::ValueType IntPtr = getPointerTy(); >> - const Type *IntPtrTy = getTargetData()->getIntPtrType(); >> - TargetLowering::ArgListTy Args; >> - TargetLowering::ArgListEntry Entry; >> - Entry.Node = Op.getOperand(1); >> - Entry.Ty = IntPtrTy; >> - Args.push_back(Entry); >> - >> - if (!bzeroEntry) { >> - // Extend the unsigned i8 argument to be an int value for the >> call. >> - Entry.Node = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, >> Op.getOperand(2)); >> + ConstantSDNode *V = dyn_cast(Src); >> + if (const char *bzeroEntry = >> + V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0) { >> + MVT::ValueType IntPtr = getPointerTy(); >> + const Type *IntPtrTy = getTargetData()->getIntPtrType(); >> + TargetLowering::ArgListTy Args; >> + TargetLowering::ArgListEntry Entry; >> + Entry.Node = Dst; >> Entry.Ty = IntPtrTy; >> Args.push_back(Entry); >> + Entry.Node = Size; >> + Args.push_back(Entry); >> + std::pair CallResult = >> + LowerCallTo(Chain, Type::VoidTy, false, false, false, >> CallingConv::C, >> + false, DAG.getExternalSymbol(bzeroEntry, >> IntPtr), >> + Args, DAG); >> + return CallResult.second; >> } >> >> - Entry.Node = Op.getOperand(3); >> - Args.push_back(Entry); >> - const char *Name = bzeroEntry ? bzeroEntry : "memset"; >> - std::pair CallResult = >> - LowerCallTo(Chain, Type::VoidTy, false, false, false, >> CallingConv::C, >> - false, DAG.getExternalSymbol(Name, IntPtr), Args, >> DAG); >> - return CallResult.second; >> + // Otherwise have the target-independent code call memset. >> + return SDOperand(); >> } >> >> + uint64_t SizeVal = ConstantSize->getValue(); >> + SDOperand InFlag(0, 0); >> MVT::ValueType AVT; >> SDOperand Count; >> - ConstantSDNode *ValC = dyn_cast(Op.getOperand(2)); >> + ConstantSDNode *ValC = dyn_cast(Src); >> unsigned BytesLeft = 0; >> bool TwoRepStos = false; >> if (ValC) { >> @@ -4630,22 +4625,14 @@ >> default: // Byte aligned >> AVT = MVT::i8; >> ValReg = X86::AL; >> - Count = Op.getOperand(3); >> + Count = Size; >> break; >> } >> >> if (AVT > MVT::i8) { >> - if (I) { >> - unsigned UBytes = MVT::getSizeInBits(AVT) / 8; >> - Count = DAG.getIntPtrConstant(I->getValue() / UBytes); >> - BytesLeft = I->getValue() % UBytes; >> - } else { >> - assert(AVT >= MVT::i32 && >> - "Do not use rep;stos if not at least DWORD aligned"); >> - Count = DAG.getNode(ISD::SRL, >> Op.getOperand(3).getValueType(), >> - Op.getOperand(3), DAG.getConstant(2, >> MVT::i8)); >> - TwoRepStos = true; >> - } >> + unsigned UBytes = MVT::getSizeInBits(AVT) / 8; >> + Count = DAG.getIntPtrConstant(SizeVal / UBytes); >> + BytesLeft = SizeVal % UBytes; >> } >> >> Chain = DAG.getCopyToReg(Chain, ValReg, DAG.getConstant(Val, >> AVT), >> @@ -4653,8 +4640,8 @@ >> InFlag = Chain.getValue(1); >> } else { >> AVT = MVT::i8; >> - Count = Op.getOperand(3); >> - Chain = DAG.getCopyToReg(Chain, X86::AL, Op.getOperand(2), >> InFlag); >> + Count = Size; >> + Chain = DAG.getCopyToReg(Chain, X86::AL, Src, InFlag); >> InFlag = Chain.getValue(1); >> } >> >> @@ -4662,7 +4649,7 @@ >> Count, InFlag); >> InFlag = Chain.getValue(1); >> Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : >> X86::EDI, >> - Op.getOperand(1), InFlag); >> + Dst, InFlag); >> InFlag = Chain.getValue(1); >> >> SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); >> @@ -4674,7 +4661,7 @@ >> >> if (TwoRepStos) { >> InFlag = Chain.getValue(1); >> - Count = Op.getOperand(3); >> + Count = Size; >> MVT::ValueType CVT = Count.getValueType(); >> SDOperand Left = DAG.getNode(ISD::AND, CVT, Count, >> DAG.getConstant((AVT == MVT::i64) ? >> 7 : 3, CVT)); >> @@ -4688,79 +4675,68 @@ >> Ops.push_back(InFlag); >> Chain = DAG.getNode(X86ISD::REP_STOS, Tys, &Ops[0], Ops.size()); >> } else if (BytesLeft) { >> - // Issue stores for the last 1 - 7 bytes. >> - SDOperand Value; >> - unsigned Val = ValC->getValue() & 255; >> - unsigned Offset = I->getValue() - BytesLeft; >> - SDOperand DstAddr = Op.getOperand(1); >> - MVT::ValueType AddrVT = DstAddr.getValueType(); >> - if (BytesLeft >= 4) { >> - Val = (Val << 8) | Val; >> - Val = (Val << 16) | Val; >> - Value = DAG.getConstant(Val, MVT::i32); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, AddrVT, DstAddr, >> - DAG.getConstant(Offset, >> AddrVT)), >> - NULL, 0); >> - BytesLeft -= 4; >> - Offset += 4; >> - } >> - if (BytesLeft >= 2) { >> - Value = DAG.getConstant((Val << 8) | Val, MVT::i16); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, AddrVT, DstAddr, >> - DAG.getConstant(Offset, >> AddrVT)), >> - NULL, 0); >> - BytesLeft -= 2; >> - Offset += 2; >> - } >> - if (BytesLeft == 1) { >> - Value = DAG.getConstant(Val, MVT::i8); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, AddrVT, DstAddr, >> - DAG.getConstant(Offset, >> AddrVT)), >> - NULL, 0); >> - } >> + // Handle the last 1 - 7 bytes. >> + unsigned Offset = SizeVal - BytesLeft; >> + MVT::ValueType AddrVT = Dst.getValueType(); >> + MVT::ValueType SizeVT = Size.getValueType(); >> + >> + Chain = DAG.getMemset(Chain, >> + DAG.getNode(ISD::ADD, AddrVT, Dst, >> + DAG.getConstant(Offset, >> AddrVT)), >> + Src, >> + DAG.getConstant(BytesLeft, SizeVT), >> + Align, DstSV, Offset); >> } >> >> + // TODO: Use a Tokenfactor, as in memcpy, instead of a single >> chain. >> return Chain; >> } >> >> -SDOperand X86TargetLowering::LowerMEMCPYInline(SDOperand Chain, >> - SDOperand Dest, >> - SDOperand Source, >> - unsigned Size, >> - unsigned Align, >> - SelectionDAG &DAG) { >> +SDOperand >> +X86TargetLowering::EmitTargetCodeForMemcpy(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand >> Src, >> + SDOperand Size, unsigned >> Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t >> DstOff, >> + Value *SrcSV, uint64_t >> SrcOff){ >> + >> + // This requires the copy size to be a constant, preferrably >> + // within a subtarget-specific limit. >> + ConstantSDNode *ConstantSize = dyn_cast(Size); >> + if (!ConstantSize) >> + return SDOperand(); >> + uint64_t SizeVal = ConstantSize->getValue(); >> + if (!AlwaysInline && SizeVal > getSubtarget()- >>> getMaxInlineSizeThreshold()) >> + return SDOperand(); >> + >> + SmallVector Results; >> + >> MVT::ValueType AVT; >> unsigned BytesLeft = 0; >> - switch (Align & 3) { >> - case 2: // WORD aligned >> - AVT = MVT::i16; >> - break; >> - case 0: // DWORD aligned >> - AVT = MVT::i32; >> - if (Subtarget->is64Bit() && ((Align & 0x7) == 0)) // QWORD >> aligned >> - AVT = MVT::i64; >> - break; >> - default: // Byte aligned >> - AVT = MVT::i8; >> - break; >> - } >> + if (Align >= 8 && Subtarget->is64Bit()) >> + AVT = MVT::i64; >> + else if (Align >= 4) >> + AVT = MVT::i32; >> + else if (Align >= 2) >> + AVT = MVT::i16; >> + else >> + AVT = MVT::i8; >> >> unsigned UBytes = MVT::getSizeInBits(AVT) / 8; >> - SDOperand Count = DAG.getIntPtrConstant(Size / UBytes); >> - BytesLeft = Size % UBytes; >> + unsigned CountVal = SizeVal / UBytes; >> + SDOperand Count = DAG.getIntPtrConstant(CountVal); >> + BytesLeft = SizeVal % UBytes; >> >> SDOperand InFlag(0, 0); >> Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RCX : >> X86::ECX, >> Count, InFlag); >> InFlag = Chain.getValue(1); >> Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RDI : >> X86::EDI, >> - Dest, InFlag); >> + Dst, InFlag); >> InFlag = Chain.getValue(1); >> Chain = DAG.getCopyToReg(Chain, Subtarget->is64Bit() ? X86::RSI : >> X86::ESI, >> - Source, InFlag); >> + Src, InFlag); >> InFlag = Chain.getValue(1); >> >> SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); >> @@ -4768,57 +4744,28 @@ >> Ops.push_back(Chain); >> Ops.push_back(DAG.getValueType(AVT)); >> Ops.push_back(InFlag); >> - Chain = DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], Ops.size()); >> + Results.push_back(DAG.getNode(X86ISD::REP_MOVS, Tys, &Ops[0], >> Ops.size())); >> >> if (BytesLeft) { >> - // Issue loads and stores for the last 1 - 7 bytes. >> - unsigned Offset = Size - BytesLeft; >> - SDOperand DstAddr = Dest; >> - MVT::ValueType DstVT = DstAddr.getValueType(); >> - SDOperand SrcAddr = Source; >> - MVT::ValueType SrcVT = SrcAddr.getValueType(); >> - SDOperand Value; >> - if (BytesLeft >= 4) { >> - Value = DAG.getLoad(MVT::i32, Chain, >> - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, >> - DAG.getConstant(Offset, >> SrcVT)), >> - NULL, 0); >> - Chain = Value.getValue(1); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, DstVT, DstAddr, >> - DAG.getConstant(Offset, >> DstVT)), >> - NULL, 0); >> - BytesLeft -= 4; >> - Offset += 4; >> - } >> - if (BytesLeft >= 2) { >> - Value = DAG.getLoad(MVT::i16, Chain, >> - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, >> - DAG.getConstant(Offset, >> SrcVT)), >> - NULL, 0); >> - Chain = Value.getValue(1); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, DstVT, DstAddr, >> - DAG.getConstant(Offset, >> DstVT)), >> - NULL, 0); >> - BytesLeft -= 2; >> - Offset += 2; >> - } >> - >> - if (BytesLeft == 1) { >> - Value = DAG.getLoad(MVT::i8, Chain, >> - DAG.getNode(ISD::ADD, SrcVT, SrcAddr, >> - DAG.getConstant(Offset, >> SrcVT)), >> - NULL, 0); >> - Chain = Value.getValue(1); >> - Chain = DAG.getStore(Chain, Value, >> - DAG.getNode(ISD::ADD, DstVT, DstAddr, >> - DAG.getConstant(Offset, >> DstVT)), >> - NULL, 0); >> - } >> + // Handle the last 1 - 7 bytes. >> + unsigned Offset = SizeVal - BytesLeft; >> + MVT::ValueType DstVT = Dst.getValueType(); >> + MVT::ValueType SrcVT = Src.getValueType(); >> + MVT::ValueType SizeVT = Size.getValueType(); >> + >> + Results.push_back(DAG.getMemcpy(Chain, >> + DAG.getNode(ISD::ADD, DstVT, >> Dst, >> + >> DAG.getConstant(Offset, >> + >> DstVT)), >> + DAG.getNode(ISD::ADD, SrcVT, >> Src, >> + >> DAG.getConstant(Offset, >> + >> SrcVT)), >> + DAG.getConstant(BytesLeft, >> SizeVT), >> + Align, AlwaysInline, >> + DstSV, Offset, SrcSV, Offset)); >> } >> >> - return Chain; >> + return DAG.getNode(ISD::TokenFactor, MVT::Other, &Results[0], >> Results.size()); >> } >> >> /// Expand the result of: i64,outchain = READCYCLECOUNTER inchain >> @@ -5430,8 +5377,6 @@ >> case ISD::CALL: return LowerCALL(Op, DAG); >> case ISD::RET: return LowerRET(Op, DAG); >> case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG); >> - case ISD::MEMSET: return LowerMEMSET(Op, DAG); >> - case ISD::MEMCPY: return LowerMEMCPY(Op, DAG); >> case ISD::VASTART: return LowerVASTART(Op, DAG); >> case ISD::VACOPY: return LowerVACOPY(Op, DAG); >> case ISD::INTRINSIC_WO_CHAIN: return LowerINTRINSIC_WO_CHAIN(Op, >> DAG); >> >> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) >> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Fri Apr 11 23:36:06 >> 2008 >> @@ -441,8 +441,8 @@ >> SDOperand Ret, >> SelectionDAG >> &DAG) const; >> >> - virtual const TargetSubtarget* getSubtarget() { >> - return static_cast(Subtarget); >> + virtual const X86Subtarget* getSubtarget() { >> + return Subtarget; >> } >> >> /// isScalarFPTypeInSSEReg - Return true if the specified scalar >> FP type is >> @@ -512,9 +512,6 @@ >> SDOperand LowerSELECT(SDOperand Op, SelectionDAG &DAG); >> SDOperand LowerBRCOND(SDOperand Op, SelectionDAG &DAG); >> SDOperand LowerMEMSET(SDOperand Op, SelectionDAG &DAG); >> - SDOperand LowerMEMCPYInline(SDOperand Dest, SDOperand Source, >> - SDOperand Chain, unsigned Size, >> unsigned Align, >> - SelectionDAG &DAG); >> SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG); >> SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG); >> SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG); >> @@ -535,6 +532,19 @@ >> SDNode *ExpandFP_TO_SINT(SDNode *N, SelectionDAG &DAG); >> SDNode *ExpandREADCYCLECOUNTER(SDNode *N, SelectionDAG &DAG); >> SDNode *ExpandATOMIC_LCS(SDNode *N, SelectionDAG &DAG); >> + >> + SDOperand EmitTargetCodeForMemset(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand Src, >> + SDOperand Size, unsigned >> Align, >> + Value *DstSV, uint64_t >> DstOff); >> + SDOperand EmitTargetCodeForMemcpy(SelectionDAG &DAG, >> + SDOperand Chain, >> + SDOperand Dst, SDOperand Src, >> + SDOperand Size, unsigned >> Align, >> + bool AlwaysInline, >> + Value *DstSV, uint64_t DstOff, >> + Value *SrcSV, uint64_t >> SrcOff); >> }; >> } >> >> >> Modified: llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx (original) >> +++ llvm/trunk/test/CodeGen/X86/2004-02-12-Memcpy.llx Fri Apr 11 >> 23:36:06 2008 >> @@ -1,5 +1,4 @@ >> -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | >> grep movs | count 1 >> -; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | >> grep memcpy | count 2 >> +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | >> grep movs | count 3 >> >> @A = global [32 x i32] zeroinitializer >> @B = global [32 x i32] zeroinitializer >> >> Modified: llvm/trunk/test/CodeGen/X86/byval2.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval2.ll?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/byval2.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/byval2.ll Fri Apr 11 23:36:06 2008 >> @@ -1,7 +1,9 @@ >> ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsq | count 2 >> ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 >> >> -%struct.s = type { i64, i64, i64 } >> +%struct.s = type { i64, i64, i64, i64, i64, i64, i64, i64, >> + i64, i64, i64, i64, i64, i64, i64, i64, >> + i64 } >> >> define void @g(i64 %a, i64 %b, i64 %c) { >> entry: >> >> Modified: llvm/trunk/test/CodeGen/X86/byval3.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval3.ll?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/byval3.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/byval3.ll Fri Apr 11 23:36:06 2008 >> @@ -1,7 +1,11 @@ >> ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsl | count 2 >> ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 >> >> -%struct.s = type { i32, i32, i32, i32, i32, i32 } >> +%struct.s = type { i32, i32, i32, i32, i32, i32, i32, i32, >> + i32, i32, i32, i32, i32, i32, i32, i32, >> + i32, i32, i32, i32, i32, i32, i32, i32, >> + i32, i32, i32, i32, i32, i32, i32, i32, >> + i32 } >> >> define void @g(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 >> %a6) { >> entry: >> >> Modified: llvm/trunk/test/CodeGen/X86/byval4.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval4.ll?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/byval4.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/byval4.ll Fri Apr 11 23:36:06 2008 >> @@ -1,7 +1,15 @@ >> ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsw | count 2 >> ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 >> >> -%struct.s = type { i16, i16, i16, i16, i16, i16 } >> +%struct.s = type { i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16, i16, i16, i16, i16, i16, i16, i16, >> + i16 } >> >> >> define void @g(i16 signext %a1, i16 signext %a2, i16 signext %a3, >> >> Modified: llvm/trunk/test/CodeGen/X86/byval5.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval5.ll?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/byval5.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/byval5.ll Fri Apr 11 23:36:06 2008 >> @@ -1,7 +1,23 @@ >> ; RUN: llvm-as < %s | llc -march=x86-64 | grep rep.movsb | count 2 >> ; RUN: llvm-as < %s | llc -march=x86 | grep rep.movsl | count 2 >> >> -%struct.s = type { i8, i8, i8, i8, i8, i8 } >> +%struct.s = type { i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8, i8, i8, i8, i8, i8, i8, i8, >> + i8 } >> >> >> define void @g(i8 signext %a1, i8 signext %a2, i8 signext %a3, >> >> Modified: llvm/trunk/test/CodeGen/X86/byval7.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/byval7.ll?rev=49572&r1=49571&r2=49572&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/byval7.ll (original) >> +++ llvm/trunk/test/CodeGen/X86/byval7.ll Fri Apr 11 23:36:06 2008 >> @@ -1,6 +1,7 @@ >> ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | grep add | grep 16 >> >> - %struct.S = type { <2 x i64> } >> + %struct.S = type { <2 x i64>, <2 x i64>, <2 x i64>, <2 x i64>, >> + <2 x i64> } >> >> define i32 @main() nounwind { >> entry: >> >> Added: llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll?rev=49572&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll (added) >> +++ llvm/trunk/test/CodeGen/X86/small-byval-memcpy.ll Fri Apr 11 >> 23:36:06 2008 >> @@ -0,0 +1,22 @@ >> +; RUN: llvm-as < %s | llc | not grep movs >> + >> +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- >> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- >> f80:128:128" >> +target triple = "i386-apple-darwin8" >> + >> +define void @ccosl({ x86_fp80, x86_fp80 }* noalias sret >> %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %z) nounwind { >> +entry: >> + %iz = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> >> [#uses=3] >> + %tmp1 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 1 ; >> [#uses=1] >> + %tmp2 = load x86_fp80* %tmp1, align 16 ; [#uses=1] >> + %tmp3 = sub x86_fp80 0xK80000000000000000000, %tmp2 ; >> [#uses=1] >> + %tmp4 = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 1 ; >> [#uses=1] >> + %real = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 0 ; >> [#uses=1] >> + %tmp6 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 0 ; >> [#uses=1] >> + %tmp7 = load x86_fp80* %tmp6, align 16 ; [#uses=1] >> + store x86_fp80 %tmp3, x86_fp80* %real, align 16 >> + store x86_fp80 %tmp7, x86_fp80* %tmp4, align 16 >> + call void @ccoshl( { x86_fp80, x86_fp80 }* noalias sret >> %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %iz ) nounwind >> + ret void >> +} >> + >> +declare void @ccoshl({ x86_fp80, x86_fp80 }* noalias sret , >> { x86_fp80, x86_fp80 }* byval align 4 ) nounwind >> >> Added: llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll?rev=49572&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll >> (added) >> +++ llvm/trunk/test/CodeGen/X86/variable-sized-darwin-bzero.ll Fri >> Apr 11 23:36:06 2008 >> @@ -0,0 +1,8 @@ >> +; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin10 | >> grep __bzero >> + >> +declare void @llvm.memset.i64(i8*, i8, i64, i32) >> + >> +define void @foo(i8* %p, i64 %n) { >> + call void @llvm.memset.i64(i8* %p, i8 0, i64 %n, i32 4) >> + ret void >> +} >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Apr 14 15:16:36 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Apr 2008 20:16:36 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49680 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp Message-ID: <200804142016.m3EKGeLi019796@zion.cs.uiuc.edu> Author: dpatel Date: Mon Apr 14 15:16:21 2008 New Revision: 49680 URL: http://llvm.org/viewvc/llvm-project?rev=49680&view=rev Log: Begin adding support for multiple value returns. This work is not yet complete and it is disabled right now. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp 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=49680&r1=49679&r2=49680&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 Mon Apr 14 15:16:21 2008 @@ -114,6 +114,24 @@ extern const Type *llvm_x86_aggr_type_for_struct_return(const Type *Ty); +/* 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 &, + 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) \ + llvm_x86_extract_multiple_return_value((Src),(Dest),(V),(B)) + +extern void llvm_x86_extract_multiple_return_value(Value *Src, Value *Dest, + bool isVolatile, + IRBuilder &B); + /* Vectors which are not MMX nor SSE should be passed as integers. */ #define LLVM_SHOULD_PASS_VECTOR_IN_INTEGER_REGS(X) \ llvm_x86_should_pass_vector_in_integer_regs((X)) 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=49680&r1=49679&r2=49680&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 Mon Apr 14 15:16:21 2008 @@ -895,8 +895,46 @@ return false; } -// Return LLVM Type if TY can be returned as a scalar, otherwise return NULL. +// llvm_suitable_multiple_ret_value_type - Return TRUE if return value +// of type TY should be returned using multiple value return instruction. +static bool llvm_suitable_multiple_ret_value_type(const Type *Ty) { + + //NOTE: Work in progress. Do not open the flood gate yet. + return false; + + if (!TARGET_64BIT) + return false; + + const StructType *STy = dyn_cast(Ty); + if (!STy) + return false; + + unsigned NumElements = STy->getNumElements(); + + bool useMultipleReturnVals = true; + for (unsigned i = 0; i < NumElements; ++i) { + const Type *T = STy->getElementType(i); + + if (T->isFirstClassType()) + continue; + + if (const ArrayType *ATy = dyn_cast(T)) { + // Allow { float f[4]; } but block { float f[10]; } or { char c[4]; } + // FIXME :Double check '5'. + if (ATy->getElementType()->isFloatingPoint() + && ATy->getNumElements() < 5) + continue; + } + return false; + } + + return true; +} + +// llvm_x86_scalar_type_for_struct_return - Return LLVM type if TY +// can be returned as a scalar, otherwise return NULL. const Type *llvm_x86_scalar_type_for_struct_return(const Type *Ty) { + unsigned Size = getTargetData().getABITypeSize(Ty); if (Size == 0) return Type::VoidTy; @@ -906,7 +944,12 @@ return Type::Int16Ty; else if (Size <= 4) return Type::Int32Ty; - else if (Size <= 8) + + // Check if Ty should be returned using multiple value return instruction. + if (llvm_suitable_multiple_ret_value_type(Ty)) + return NULL; + + if (Size <= 8) return Type::Int64Ty; else if (Size <= 16) return IntegerType::get(128); @@ -918,8 +961,211 @@ // Return LLVM Type if TY can be returned as an aggregate, otherwise return NULL. const Type *llvm_x86_aggr_type_for_struct_return(const Type *Ty) { - return NULL; + + if (!llvm_suitable_multiple_ret_value_type(Ty)) + return NULL; + + const StructType *STy = cast(Ty); + unsigned NumElements = STy->getNumElements(); + + std::vector ElementTypes; + for (unsigned i = 0; i < NumElements; ++i) { + const Type *T = STy->getElementType(i); + + if (T->isFirstClassType()) { + ElementTypes.push_back(T); + continue; + } + + const ArrayType *ATy = dyn_cast(T); + assert (ATy && "Unexpected struct element type!"); + assert (ATy->getElementType()->isFirstClassType() + && "Unexpected ArrayType element type!"); + + unsigned size = ATy->getNumElements(); + if (ATy->getElementType()->isFloatingPoint()) { + switch (size) { + case 2: + // use { <2 x float> } for struct { float[2]; } + ElementTypes.push_back(VectorType::get(ATy->getElementType(), 2)); + break; + case 3: + // use { <2 x float>, float } for struct { float[3]; } + ElementTypes.push_back(VectorType::get(ATy->getElementType(), 2)); + ElementTypes.push_back(ATy->getElementType()); + break; + case 4: + // use { <4 x float> } for struct { float[4]; } + ElementTypes.push_back(VectorType::get(ATy->getElementType(), 4)); + break; + default: + assert (0 && "Unexpected floating point array size!"); + } + } else { + for (unsigned j = 0; j < size; ++j) + ElementTypes.push_back(ATy->getElementType()); + } + } + + return StructType::get(ElementTypes, STy->isPacked()); } +// llvm_x86_build_mrv_array_element - This is a helper function used by +// llvm_x6_build_multiple_return_value. This function builds a vector +// from the array fields of RetVal. +static Value *llvm_x86_build_mrv_array_element(const Type *STyFieldTy, + Value *RetVal, + unsigned FieldNo, + unsigned ArraySize, + IRBuilder &Builder) { + llvm::Value *Idxs[3]; + Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0); + Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, FieldNo); + + Value *R1 = UndefValue::get(STyFieldTy); + + for (unsigned i = 0; i < ArraySize; ++i) { + Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, i); + Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep"); + Value *ElemVal = Builder.CreateLoad(GEP, "mrv"); + R1 = Builder.CreateInsertElement(R1, ElemVal, + ConstantInt::get(llvm::Type::Int32Ty, i), + "mrv"); + } + return R1; +} + +// 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 &RetVals, + IRBuilder &Builder) { + const StructType *STy = cast(Fn->getReturnType()); + const PointerType *PTy = cast(RetVal->getType()); + const StructType *RetSTy = cast(PTy->getElementType()); + + // 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(); + for (unsigned RNO = 0, SNO = 0; RNO < NumElements; ++RNO, ++SNO) { + 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); + } else { + const ArrayType *ATy = cast(ElemType); + unsigned ArraySize = ATy->getNumElements(); + const VectorType *SElemTy = cast(STy->getElementType(SNO)); + unsigned Size = SElemTy->getNumElements(); + assert (ArraySize >= Size && "Invalid multiple return value type!"); + Value *R = llvm_x86_build_mrv_array_element(SElemTy, RetVal, RNO, + Size, Builder); + RetVals.push_back(R); + if (ArraySize > Size) { + assert (ArraySize == Size + 1 && "Unable to build multiple return value!"); + // Build remaining values. + const Type *NextTy = STy->getElementType(SNO + 1); + if (NextTy->getTypeID() == Type::FloatTyID) { + 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, Size + 1); + Value *GEP3 = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep"); + Value *ElemVal3 = Builder.CreateLoad(GEP3, "mrv"); + RetVals.push_back(ElemVal3); + SNO++; + } else + assert ( 0 && "Unable to build multiple return value!"); + } + } + } +} + +// llvm_x86_extract_mrv_array_element - Helper function that help extract +// an array element from multiple return value. +// +// Here, SRC is returning multiple values. DEST's DESTFIELNO field is an array. +// Extract SRCFIELDNO's ELEMENO value and store it in DEST's FIELDNO field's +// ELEMENTNO. +// +static void llvm_x86_extract_mrv_array_element(Value *Src, Value *Dest, + unsigned SrcFieldNo, + unsigned SrcElemNo, + unsigned DestFieldNo, + unsigned DestElemNo, + IRBuilder &Builder, + bool isVolatile) { + GetResultInst *GR = Builder.CreateGetResult(Src, SrcFieldNo, "mrv_gr"); + const StructType *STy = cast(Src->getType()); + llvm::Value *Idxs[3]; + Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0); + Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, DestFieldNo); + Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, DestElemNo); + Value *GEP = Builder.CreateGEP(Dest, Idxs, Idxs+3, "mrv_gep"); + if (isa(STy->getElementType(SrcFieldNo))) { + Value *ElemIndex = ConstantInt::get(Type::Int32Ty, SrcElemNo); + Value *GRElem = Builder.CreateExtractElement(GR, ElemIndex, "mrv"); + Builder.CreateStore(GRElem, GEP, isVolatile); + } else { + Builder.CreateStore(GR, GEP, isVolatile); + } +} + +// llvm_x86_extract_multiple_return_value - Extract multiple values returned +// by SRC and store them in DEST. It is expected thaty SRC and +// DEST types are StructType, but they may not match. +void llvm_x86_extract_multiple_return_value(Value *Src, Value *Dest, + bool isVolatile, + IRBuilder &Builder) { + + const StructType *STy = cast(Src->getType()); + unsigned NumElements = STy->getNumElements(); + + const PointerType *PTy = cast(Dest->getType()); + const StructType *DestTy = cast(PTy->getElementType()); + unsigned SNO = 0; + unsigned DNO = 0; + while (SNO < NumElements) { + + const Type *DestElemType = DestTy->getElementType(DNO); + + // Directly access first class values using getresult. + if (DestElemType->isFirstClassType()) { + Value *GEP = Builder.CreateStructGEP(Dest, DNO, "mrv_gep"); + GetResultInst *GR = Builder.CreateGetResult(Src, SNO, "mrv_gr"); + Builder.CreateStore(GR, GEP, isVolatile); + ++DNO; ++SNO; + continue; + } + + // Access array elements individually. Note, Src and Dest type may + // not match. For example { <2 x float>, float } and { float[3]; } + const ArrayType *ATy = cast(DestElemType); + unsigned ArraySize = ATy->getNumElements(); + for (unsigned di = 0, si = 0; di < ArraySize; ++di, ++si) { + llvm_x86_extract_mrv_array_element(Src, Dest, SNO, si, DNO, di, + Builder, isVolatile); + if (const VectorType *SElemTy = + dyn_cast(STy->getElementType(SNO))) { + unsigned NumVElem = SElemTy->getNumElements(); + if (NumVElem == si + 1) { + // If extracted all elments from current Src field then + // move to next field. + si = 0; + ++SNO; + } + } else { + // Copied content from current source field, so move to next field. + ++SNO; + } + } + // Process next DNO element. + ++DNO; + } +} /* LLVM LOCAL end (ENTIRE FILE!) */ From gohman at apple.com Mon Apr 14 15:24:30 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 13:24:30 -0700 Subject: [llvm-commits] [llvm] r49610 - in /llvm/trunk/test/Analysis/BasicAA: const-dce.ll pure-const-dce.ll In-Reply-To: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> References: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> Message-ID: <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> On Apr 13, 2008, at 2:51 AM, Owen Anderson wrote: > Author: resistor > Date: Sun Apr 13 04:51:06 2008 > New Revision: 49610 > > URL: http://llvm.org/viewvc/llvm-project?rev=49610&view=rev > Log: > The functionality being tested was removed because it was horribly > unsafe. It looks like the test was testing that two calls with identical arguments to a readonly function with no intervening stores can be changed to one call. What's horribly unsafe about that? Dan > > Added: > llvm/trunk/test/Analysis/BasicAA/const-dce.ll > - copied, changed from r49609, llvm/trunk/test/Analysis/BasicAA/ > pure-const-dce.ll > Removed: > llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll > > Copied: llvm/trunk/test/Analysis/BasicAA/const-dce.ll (from r49609, > llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll) > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/const-dce.ll?p2=llvm/trunk/test/Analysis/BasicAA/const-dce.ll&p1=llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll&r1=49609&r2=49610&rev=49610&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (original) > +++ llvm/trunk/test/Analysis/BasicAA/const-dce.ll Sun Apr 13 > 04:51:06 2008 > @@ -1,5 +1,5 @@ > ; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst > | count 2 > -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure > | count 3 > +; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure > | count 4 > ; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone > | count 4 > @g = global i32 0 ; [#uses=1] > > > Removed: llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll?rev=49609&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (original) > +++ llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (removed) > @@ -1,33 +0,0 @@ > -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst > | count 2 > -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure > | count 3 > -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone > | count 4 > - at g = global i32 0 ; [#uses=1] > - > -define i32 @test() { > -entry: > - %tmp0 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] > - %tmp1 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] > - %tmp2 = call i32 @TestNone( i32 7 ) ; [#uses=1] > - store i32 1, i32* @g > - %tmp3 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] > - %tmp4 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] > - %tmp5 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] > - %tmp6 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] > - %tmp7 = call i32 @TestNone( i32 7 ) ; [#uses=1] > - %tmp8 = call i32 @TestNone( i32 7 ) ; [#uses=1] > - %sum0 = add i32 %tmp0, %tmp1 ; [#uses=1] > - %sum1 = add i32 %sum0, %tmp2 ; [#uses=1] > - %sum2 = add i32 %sum1, %tmp3 ; [#uses=1] > - %sum3 = add i32 %sum2, %tmp4 ; [#uses=1] > - %sum4 = add i32 %sum3, %tmp5 ; [#uses=1] > - %sum5 = add i32 %sum4, %tmp6 ; [#uses=1] > - %sum6 = add i32 %sum5, %tmp7 ; [#uses=1] > - %sum7 = add i32 %sum6, %tmp8 ; [#uses=1] > - ret i32 %sum7 > -} > - > -declare i32 @TestConst(i32) readnone > - > -declare i32 @TestPure(i32) readonly > - > -declare i32 @TestNone(i32) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Apr 14 15:40:50 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 20:40:50 -0000 Subject: [llvm-commits] [llvm] r49681 - in /llvm/trunk/lib: Target/TargetData.cpp Transforms/Scalar/PredicateSimplifier.cpp Message-ID: <200804142040.m3EKeo2Y020627@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 15:40:47 2008 New Revision: 49681 URL: http://llvm.org/viewvc/llvm-project?rev=49681&view=rev Log: Remove unnecessary includes. Modified: llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=49681&r1=49680&r2=49681&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Mon Apr 14 15:40:47 2008 @@ -27,7 +27,6 @@ #include "llvm/ADT/StringExtras.h" #include #include -#include using namespace llvm; // Handle the Pass registration stuff necessary to use TargetData's. Modified: llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp?rev=49681&r1=49680&r2=49681&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon Apr 14 15:40:47 2008 @@ -101,7 +101,6 @@ #include "llvm/Transforms/Utils/Local.h" #include #include -#include #include using namespace llvm; From isanbard at gmail.com Mon Apr 14 16:59:25 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Apr 2008 21:59:25 -0000 Subject: [llvm-commits] [llvm] r49690 - /llvm/tags/Apple/llvmCore-2035/ Message-ID: <200804142159.m3ELxP4Q022994@zion.cs.uiuc.edu> Author: void Date: Mon Apr 14 16:59:24 2008 New Revision: 49690 URL: http://llvm.org/viewvc/llvm-project?rev=49690&view=rev Log: Creating llvmCore-2035 branch Added: llvm/tags/Apple/llvmCore-2035/ - copied from r49689, llvm/trunk/ From isanbard at gmail.com Mon Apr 14 16:59:31 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 14 Apr 2008 21:59:31 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49691 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2035/ Message-ID: <200804142159.m3ELxWaA023007@zion.cs.uiuc.edu> Author: void Date: Mon Apr 14 16:59:31 2008 New Revision: 49691 URL: http://llvm.org/viewvc/llvm-project?rev=49691&view=rev Log: Creating llvmgcc42-2035 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2035/ - copied from r49690, llvm-gcc-4.2/trunk/ From gohman at apple.com Mon Apr 14 18:15:11 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 14 Apr 2008 23:15:11 -0000 Subject: [llvm-commits] [llvm] r49696 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Message-ID: <200804142315.m3ENFBke025618@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 18:15:07 2008 New Revision: 49696 URL: http://llvm.org/viewvc/llvm-project?rev=49696&view=rev Log: In -view-sunit-dags, display "special" chain dependencies as cyan instead of blue to distinguish them from regular dependencies. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=49696&r1=49695&r2=49696&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Apr 14 18:15:07 2008 @@ -456,6 +456,7 @@ unsigned getOperand() const { return Operand; } const SUnit *getNode() const { return Node; } bool isCtrlDep() const { return Node->Preds[Operand].isCtrl; } + bool isSpecialDep() const { return Node->Preds[Operand].isSpecial; } }; template <> struct GraphTraits { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=49696&r1=49695&r2=49696&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Apr 14 18:15:07 2008 @@ -283,6 +283,8 @@ /// edge, override this method. template static std::string getEdgeAttributes(const void *Node, EdgeIter EI) { + if (EI.isSpecialDep()) + return "color=cyan,style=dashed"; if (EI.isCtrlDep()) return "color=blue,style=dashed"; return ""; From ggreif at gmail.com Mon Apr 14 18:20:19 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 23:20:19 -0000 Subject: [llvm-commits] [llvm] r49697 - in /llvm/branches/ggreif/use-diet/lib/Transforms: IPO/GlobalDCE.cpp IPO/IPConstantPropagation.cpp Scalar/DCE.cpp Scalar/InstructionCombining.cpp Message-ID: <200804142320.m3ENKJ57025789@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 18:20:15 2008 New Revision: 49697 URL: http://llvm.org/viewvc/llvm-project?rev=49697&view=rev Log: fix performance bug by not passing Use by value to dyn_cast Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp?rev=49697&r1=49696&r2=49697&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp Mon Apr 14 18:20:15 2008 @@ -158,9 +158,9 @@ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) // For all operands... for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U) - if (GlobalValue *GV = dyn_cast(*U)) + if (GlobalValue *GV = dyn_cast(U->get())) GlobalIsNeeded(GV); - else if (Constant *C = dyn_cast(*U)) + else if (Constant *C = dyn_cast(U->get())) MarkUsedGlobalsAsNeeded(C); } } Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=49697&r1=49696&r2=49697&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp Mon Apr 14 18:20:15 2008 @@ -98,7 +98,7 @@ if (*AI == &F) return false; // Passes the function into itself if (!ArgumentConstants[i].second) { - if (Constant *C = dyn_cast(*AI)) { + if (Constant *C = dyn_cast(AI->get())) { if (!ArgumentConstants[i].first) ArgumentConstants[i].first = C; else if (ArgumentConstants[i].first != C) { Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp?rev=49697&r1=49696&r2=49697&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp Mon Apr 14 18:20:15 2008 @@ -102,7 +102,7 @@ // go dead after this one is removed. // for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) - if (Instruction *Used = dyn_cast(*OI)) + if (Instruction *Used = dyn_cast(OI->get())) WorkList.push_back(Used); // Remove the instruction. Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp?rev=49697&r1=49696&r2=49697&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Mon Apr 14 18:20:15 2008 @@ -8484,7 +8484,7 @@ // the call. for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(), E = CS.arg_end(); I != E; ++I) - if (CastInst *CI = dyn_cast(*I)) { + if (CastInst *CI = dyn_cast(I->get())) { // If this cast does not effect the value passed through the varargs // area, we can eliminate the use of the cast. Value *Op = CI->getOperand(0); @@ -8575,7 +8575,7 @@ if (CallerPAL.getParamAttrs(i + 1) & ParamAttr::typeIncompatible(ParamTy)) return false; // Attribute not compatible with transformed value. - ConstantInt *c = dyn_cast(*AI); + ConstantInt *c = dyn_cast(AI->get()); // Some conversions are safe even if we do not have a body. // Either we can cast directly, or we can upconvert the argument bool isConvertible = ActTy == ParamTy || From ggreif at gmail.com Mon Apr 14 18:24:36 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 14 Apr 2008 23:24:36 -0000 Subject: [llvm-commits] [llvm] r49698 - in /llvm/branches/ggreif/use-diet/include/llvm: Use.h Value.h Message-ID: <200804142324.m3ENOaG0025914@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 18:24:36 2008 New Revision: 49698 URL: http://llvm.org/viewvc/llvm-project?rev=49698&view=rev Log: fix bookkeeping bug when swapping Uses. thanks for the pills, sabre ;-) Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/include/llvm/Value.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49698&r1=49697&r2=49698&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Mon Apr 14 18:24:36 2008 @@ -18,6 +18,7 @@ #include "llvm/Support/Casting.h" #include "llvm/ADT/iterator" +#include namespace llvm { @@ -35,9 +36,11 @@ public: inline void init(Value *V, User *U); +private: + template friend void std::swap(U&, U&); /* Use(Value *V, User *U) { init(V, U); } - Use(const Use &U) { init(U.get(), U.U); } -*/ + */ Use(const Use &U) { init(U.get(), 0); } + inline ~Use() { if (get()) removeFromList(); } Modified: llvm/branches/ggreif/use-diet/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Value.h?rev=49698&r1=49697&r2=49698&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Value.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Value.h Mon Apr 14 18:24:36 2008 @@ -226,7 +226,7 @@ void Use::init(Value *V, User *user) { Val = transferTag(V); U = user; - assert(U == getUser() && "Use::init discrepancy?"); + assert((!U || U == getUser()) && "Use::init discrepancy?"); if (V) V->addUse(*this); } From dberlin at dberlin.org Mon Apr 14 19:37:35 2008 From: dberlin at dberlin.org (Daniel Berlin) Date: Mon, 14 Apr 2008 20:37:35 -0400 Subject: [llvm-commits] [llvm] r49610 - in /llvm/trunk/test/Analysis/BasicAA: const-dce.ll pure-const-dce.ll In-Reply-To: <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> References: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> Message-ID: <4aca3dc20804141737w7f7b019s9317bf42f1adb949@mail.gmail.com> On Mon, Apr 14, 2008 at 4:24 PM, Dan Gohman wrote: > > On Apr 13, 2008, at 2:51 AM, Owen Anderson wrote: > > > Author: resistor > > Date: Sun Apr 13 04:51:06 2008 > > New Revision: 49610 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=49610&view=rev > > Log: > > The functionality being tested was removed because it was horribly > > unsafe. > > It looks like the test was testing that two calls with identical > arguments to a readonly function with no intervening stores can > be changed to one call. What's horribly unsafe about that? I don't see anything unsafe about that either, even though readonly calls can throw exceptions (since they can only depend on arguments and global variables, if the first doesn't throw an exception, and there are no stores/etc, the second can't) From ggreif at gmail.com Mon Apr 14 20:11:52 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 01:11:52 -0000 Subject: [llvm-commits] [llvm] r49700 - /llvm/branches/ggreif/use-diet/include/llvm/Use.h Message-ID: <200804150111.m3F1Bt2s028647@zion.cs.uiuc.edu> Author: ggreif Date: Mon Apr 14 20:11:39 2008 New Revision: 49700 URL: http://llvm.org/viewvc/llvm-project?rev=49700&view=rev Log: polish Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49700&r1=49699&r2=49700&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Mon Apr 14 20:11:39 2008 @@ -18,7 +18,6 @@ #include "llvm/Support/Casting.h" #include "llvm/ADT/iterator" -#include namespace llvm { @@ -37,10 +36,13 @@ inline void init(Value *V, User *U); private: + /// Allow std::swap some intimacy template friend void std::swap(U&, U&); -/* Use(Value *V, User *U) { init(V, U); } - */ Use(const Use &U) { init(U.get(), 0); } + /// Copy ctor - Only for std::swap + Use(const Use &U) { init(U.get(), 0); } + + /// Destructor - Only for zap() and std::swap inline ~Use() { if (get()) removeFromList(); } From gohman at apple.com Mon Apr 14 20:22:24 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 01:22:24 -0000 Subject: [llvm-commits] [llvm] r49701 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp test/CodeGen/X86/loop-hoist.ll Message-ID: <200804150122.m3F1MPWO029029@zion.cs.uiuc.edu> Author: djg Date: Mon Apr 14 20:22:18 2008 New Revision: 49701 URL: http://llvm.org/viewvc/llvm-project?rev=49701&view=rev Log: Treat EntryToken nodes as "passive" so that they aren't added to the ScheduleDAG; they don't correspond to any actual instructions so they don't need to be scheduled. This fixes a bug where the EntryToken was being scheduled multiple times in some cases, though it ended up not causing any trouble because EntryToken doesn't expand into anything. With this fixed the schedulers reliably schedule the expected number of units, so we can check this with an assertion. This requires a tweak to test/CodeGen/X86/loop-hoist.ll because it ends up getting scheduled differently in a trivial way, though it was enough to fool the prcontext+grep that the test does. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/test/CodeGen/X86/loop-hoist.ll Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=49701&r1=49700&r2=49701&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Mon Apr 14 20:22:18 2008 @@ -285,6 +285,7 @@ if (isa(Node)) return true; if (isa(Node)) return true; if (isa(Node)) return true; + if (Node->getOpcode() == ISD::EntryToken) return true; return false; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=49701&r1=49700&r2=49701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Mon Apr 14 20:22:18 2008 @@ -863,8 +863,11 @@ Node->dump(&DAG); #endif assert(0 && "This target-independent node should have been selected!"); - case ISD::EntryToken: // fall thru - case ISD::TokenFactor: + break; + case ISD::EntryToken: + assert(0 && "EntryToken should have been excluded from the schedule!"); + break; + case ISD::TokenFactor: // fall thru case ISD::LABEL: case ISD::DECLARE: case ISD::SRCVALUE: Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=49701&r1=49700&r2=49701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Mon Apr 14 20:22:18 2008 @@ -164,21 +164,16 @@ /// schedulers. void ScheduleDAGList::ListScheduleTopDown() { unsigned CurCycle = 0; - SUnit *Entry = SUnitMap[DAG.getEntryNode().Val].front(); // All leaves to Available queue. for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { // It is available if it has no predecessors. - if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) { + if (SUnits[i].Preds.empty()) { AvailableQueue->push(&SUnits[i]); SUnits[i].isAvailable = SUnits[i].isPending = true; } } - // Emit the entry node first. - ScheduleNodeTopDown(Entry, CurCycle); - HazardRec->EmitInstruction(Entry->Node); - // While Available queue is not empty, grab the node with the highest // priority. If it is not ready put it back. Schedule the node. std::vector NotReady; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=49701&r1=49700&r2=49701&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Apr 14 20:22:18 2008 @@ -239,7 +239,8 @@ /// possible. It will be commuted when it is translated to a MI. void ScheduleDAGRRList::CommuteNodesToReducePressure() { SmallPtrSet OperandSeen; - for (unsigned i = Sequence.size()-1; i != 0; --i) { // Ignore first node. + for (unsigned i = Sequence.size(); i != 0; ) { + --i; SUnit *SU = Sequence[i]; if (!SU || !SU->Node) continue; if (SU->isCommutable) { @@ -311,11 +312,8 @@ #endif if (PredSU->NumSuccsLeft == 0) { - // EntryToken has to go last! Special case it here. - if (!PredSU->Node || PredSU->Node->getOpcode() != ISD::EntryToken) { - PredSU->isAvailable = true; - AvailableQueue->push(PredSU); - } + PredSU->isAvailable = true; + AvailableQueue->push(PredSU); } } @@ -735,9 +733,10 @@ I->isCtrl, I->isSpecial)); } - RemovePred(SU, ChainPred, true, false); - if (isNewLoad) { - AddPred(LoadSU,ChainPred, true, false); + if (ChainPred) { + RemovePred(SU, ChainPred, true, false); + if (isNewLoad) + AddPred(LoadSU, ChainPred, true, false); } for (unsigned i = 0, e = LoadPreds.size(); i != e; ++i) { SDep *Pred = &LoadPreds[i]; @@ -941,9 +940,12 @@ void ScheduleDAGRRList::ListScheduleBottomUp() { unsigned CurCycle = 0; // Add root to Available queue. - SUnit *RootSU = SUnitMap[DAG.getRoot().Val].front(); - RootSU->isAvailable = true; - AvailableQueue->push(RootSU); + if (!SUnits.empty()) { + SUnit *RootSU = SUnitMap[DAG.getRoot().Val].front(); + assert(RootSU->Succs.empty() && "Graph root shouldn't have successors!"); + RootSU->isAvailable = true; + AvailableQueue->push(RootSU); + } // While Available queue is not empty, grab the node with the highest // priority. If it is not ready put it back. Schedule the node. @@ -1066,12 +1068,6 @@ ++CurCycle; } - // Add entry node last - if (DAG.getEntryNode().Val != DAG.getRoot().Val) { - SUnit *Entry = SUnitMap[DAG.getEntryNode().Val].front(); - Sequence.push_back(Entry); - } - // Reverse the order if it is bottom up. std::reverse(Sequence.begin(), Sequence.end()); @@ -1079,16 +1075,30 @@ #ifndef NDEBUG // Verify that all SUnits were scheduled. bool AnyNotSched = false; + unsigned DeadNodes = 0; for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { - if (SUnits[i].NumSuccsLeft != 0) { + if (!SUnits[i].isScheduled) { + if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) { + ++DeadNodes; + continue; + } if (!AnyNotSched) cerr << "*** List scheduling failed! ***\n"; SUnits[i].dump(&DAG); cerr << "has not been scheduled!\n"; AnyNotSched = true; } + if (SUnits[i].NumSuccsLeft != 0) { + if (!AnyNotSched) + cerr << "*** List scheduling failed! ***\n"; + SUnits[i].dump(&DAG); + cerr << "has successors left!\n"; + AnyNotSched = true; + } } assert(!AnyNotSched); + assert(Sequence.size() + DeadNodes == SUnits.size() && + "The number of nodes scheduled doesn't match the expected number!"); #endif } @@ -1145,22 +1155,16 @@ /// schedulers. void ScheduleDAGRRList::ListScheduleTopDown() { unsigned CurCycle = 0; - SUnit *Entry = SUnitMap[DAG.getEntryNode().Val].front(); // All leaves to Available queue. for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { // It is available if it has no predecessors. - if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) { + if (SUnits[i].Preds.empty()) { AvailableQueue->push(&SUnits[i]); SUnits[i].isAvailable = true; } } - // Emit the entry node first. - ScheduleNodeTopDown(Entry, CurCycle); - Sequence.push_back(Entry); - ++CurCycle; - // While Available queue is not empty, grab the node with the highest // priority. If it is not ready put it back. Schedule the node. std::vector NotReady; @@ -1181,23 +1185,37 @@ ScheduleNodeTopDown(CurSU, CurCycle); Sequence.push_back(CurSU); } - CurCycle++; + ++CurCycle; } #ifndef NDEBUG // Verify that all SUnits were scheduled. bool AnyNotSched = false; + unsigned DeadNodes = 0; for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { if (!SUnits[i].isScheduled) { + if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) { + ++DeadNodes; + continue; + } if (!AnyNotSched) cerr << "*** List scheduling failed! ***\n"; SUnits[i].dump(&DAG); cerr << "has not been scheduled!\n"; AnyNotSched = true; } + if (SUnits[i].NumPredsLeft != 0) { + if (!AnyNotSched) + cerr << "*** List scheduling failed! ***\n"; + SUnits[i].dump(&DAG); + cerr << "has predecessors left!\n"; + AnyNotSched = true; + } } assert(!AnyNotSched); + assert(Sequence.size() + DeadNodes == SUnits.size() && + "The number of nodes scheduled doesn't match the expected number!"); #endif } Modified: llvm/trunk/test/CodeGen/X86/loop-hoist.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/loop-hoist.ll?rev=49701&r1=49700&r2=49701&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/loop-hoist.ll (original) +++ llvm/trunk/test/CodeGen/X86/loop-hoist.ll Mon Apr 14 20:22:18 2008 @@ -7,13 +7,13 @@ @Arr = external global [0 x i32] ; <[0 x i32]*> [#uses=1] -define void @foo(i32 %N.in) { +define void @foo(i32 %N.in, i32 %x) { entry: %N = bitcast i32 %N.in to i32 ; [#uses=1] br label %cond_true cond_true: ; preds = %cond_true, %entry - %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %cond_true ] ; [#uses=2] + %indvar = phi i32 [ %x, %entry ], [ %indvar.next, %cond_true ] ; [#uses=2] %i.0.0 = bitcast i32 %indvar to i32 ; [#uses=2] %tmp = getelementptr [0 x i32]* @Arr, i32 0, i32 %i.0.0 ; [#uses=1] store i32 %i.0.0, i32* %tmp From resistor at mac.com Mon Apr 14 20:39:49 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 14 Apr 2008 20:39:49 -0500 Subject: [llvm-commits] [llvm] r49610 - in /llvm/trunk/test/Analysis/BasicAA: const-dce.ll pure-const-dce.ll In-Reply-To: <4aca3dc20804141737w7f7b019s9317bf42f1adb949@mail.gmail.com> References: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> <4aca3dc20804141737w7f7b019s9317bf42f1adb949@mail.gmail.com> Message-ID: On Apr 14, 2008, at 7:37 PM, Daniel Berlin wrote: > On Mon, Apr 14, 2008 at 4:24 PM, Dan Gohman wrote: >> >> >> It looks like the test was testing that two calls with identical >> arguments to a readonly function with no intervening stores can >> be changed to one call. What's horribly unsafe about that? > > I don't see anything unsafe about that either, even though readonly > calls can throw exceptions (since they can only depend on arguments > and global variables, if the first doesn't throw an exception, and > there are no stores/etc, the second can't) The particular testcase wasn't broken, rather GVN's general functionality for removing read-only calls. It wasn't doing the appropriate checking for intervening stores to globals. --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4264 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080414/04ba49c5/attachment.bin From isanbard at gmail.com Mon Apr 14 20:44:03 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Apr 2008 01:44:03 -0000 Subject: [llvm-commits] [llvm] r49702 - in /llvm/tags/Apple/llvmCore-2030-04: ./ lib/ExecutionEngine/JIT/JITEmitter.cpp lib/Target/X86/X86Subtarget.h Message-ID: <200804150144.m3F1i4JB029654@zion.cs.uiuc.edu> Author: void Date: Mon Apr 14 20:44:02 2008 New Revision: 49702 URL: http://llvm.org/viewvc/llvm-project?rev=49702&view=rev Log: llvmCore-2030-02 + r49566 Added: llvm/tags/Apple/llvmCore-2030-04/ - copied from r49668, llvm/tags/Apple/llvmCore-2030-03/ Modified: llvm/tags/Apple/llvmCore-2030-04/lib/ExecutionEngine/JIT/JITEmitter.cpp llvm/tags/Apple/llvmCore-2030-04/lib/Target/X86/X86Subtarget.h Modified: llvm/tags/Apple/llvmCore-2030-04/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2030-04/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=49702&r1=49668&r2=49702&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2030-04/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/tags/Apple/llvmCore-2030-04/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Apr 14 20:44:02 2008 @@ -233,8 +233,7 @@ if (!idx) { idx = ++nextGOTIndex; revGOTMap[addr] = idx; - DOUT << "Adding GOT entry " << idx - << " for addr " << addr << "\n"; + DOUT << "Adding GOT entry " << idx << " for addr " << addr << "\n"; } return idx; } @@ -612,11 +611,15 @@ ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); Size += TheJIT->getTargetData()->getABITypeSize(Ty); - ConstantPoolBase = allocateSpace(Size, 1 << MCP->getConstantPoolAlignment()); + unsigned Align = 1 << MCP->getConstantPoolAlignment(); + ConstantPoolBase = allocateSpace(Size, Align); ConstantPool = MCP; if (ConstantPoolBase == 0) return; // Buffer overflow. + DOUT << "JIT: Emitted constant pool at [" << ConstantPoolBase + << "] (size: " << Size << ", alignment: " << Align << ")\n"; + // Initialize the memory for all of the constant pool entries. for (unsigned i = 0, e = Constants.size(); i != e; ++i) { void *CAddr = (char*)ConstantPoolBase+Constants[i].Offset; @@ -627,6 +630,7 @@ abort(); } TheJIT->InitializeMemory(Constants[i].Val.ConstVal, CAddr); + DOUT << "JIT: CP" << i << " at [" << CAddr << "]\n"; } } Modified: llvm/tags/Apple/llvmCore-2030-04/lib/Target/X86/X86Subtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2030-04/lib/Target/X86/X86Subtarget.h?rev=49702&r1=49668&r2=49702&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2030-04/lib/Target/X86/X86Subtarget.h (original) +++ llvm/tags/Apple/llvmCore-2030-04/lib/Target/X86/X86Subtarget.h Mon Apr 14 20:44:02 2008 @@ -119,8 +119,9 @@ bool hasSSE2() const { return X86SSELevel >= SSE2; } bool hasSSE3() const { return X86SSELevel >= SSE3; } bool hasSSSE3() const { return X86SSELevel >= SSSE3; } - bool hasSSE41() const { return X86SSELevel >= SSE41; } - bool hasSSE42() const { return X86SSELevel >= SSE42; } + // Temporarily disabling SSE4. + bool hasSSE41() const { return false && X86SSELevel >= SSE41; } + bool hasSSE42() const { return false && X86SSELevel >= SSE42; } bool has3DNow() const { return X863DNowLevel >= ThreeDNow; } bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; } From isanbard at gmail.com Mon Apr 14 22:11:32 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Apr 2008 03:11:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49704 - /llvm-gcc-4.2/trunk/build_gcc Message-ID: <200804150311.m3F3BXjr032043@zion.cs.uiuc.edu> Author: void Date: Mon Apr 14 22:11:24 2008 New Revision: 49704 URL: http://llvm.org/viewvc/llvm-project?rev=49704&view=rev Log: Don't copy over libstdc++.dylib Modified: llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=49704&r1=49703&r2=49704&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Mon Apr 14 22:11:24 2008 @@ -416,13 +416,14 @@ done done -for t in $TARGETS ; do - cp -p /usr/lib/libstdc++.6.dylib \ - .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \ - || exit 1 -# LLVM LOCAL -# strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 -done +# LLVM LOCAL begin - Don't copy over libstdc++.dylib +# for t in $TARGETS ; do +# cp -p /usr/lib/libstdc++.6.dylib \ +# .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib \ +# || exit 1 +# strip -x -c .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/libstdc++.dylib || exit 1 +# done +# LLVM LOCAL end - Don't copy over libstdc++.dylib # include HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS From clattner at apple.com Tue Apr 15 00:23:36 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 14 Apr 2008 22:23:36 -0700 Subject: [llvm-commits] [llvm] r49610 - in /llvm/trunk/test/Analysis/BasicAA: const-dce.ll pure-const-dce.ll In-Reply-To: References: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> <4aca3dc20804141737w7f7b019s9317bf42f1adb949@mail.gmail.com> Message-ID: <1901EB83-25FC-4379-A2C9-DF789F0BBC3F@apple.com> On Apr 14, 2008, at 6:39 PM, Owen Anderson wrote: > > On Apr 14, 2008, at 7:37 PM, Daniel Berlin wrote: > >> On Mon, Apr 14, 2008 at 4:24 PM, Dan Gohman wrote: >>> >>> >>> It looks like the test was testing that two calls with identical >>> arguments to a readonly function with no intervening stores can >>> be changed to one call. What's horribly unsafe about that? >> >> I don't see anything unsafe about that either, even though readonly >> calls can throw exceptions (since they can only depend on arguments >> and global variables, if the first doesn't throw an exception, and >> there are no stores/etc, the second can't) > > The particular testcase wasn't broken, rather GVN's general > functionality for removing read-only calls. It wasn't doing the > appropriate checking for intervening stores to globals. gcse/loadvn used to do this, is it hard to add back? -Chris From isanbard at gmail.com Tue Apr 15 02:02:59 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Apr 2008 07:02:59 -0000 Subject: [llvm-commits] [llvm] r49713 - /llvm/trunk/utils/buildit/build_llvm Message-ID: <200804150702.m3F72xv6006608@zion.cs.uiuc.edu> Author: void Date: Tue Apr 15 02:02:59 2008 New Revision: 49713 URL: http://llvm.org/viewvc/llvm-project?rev=49713&view=rev Log: Install into the directory Modified: llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=49713&r1=49712&r2=49713&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Tue Apr 15 02:02:59 2008 @@ -59,9 +59,11 @@ # If the user has CC set in their environment unset it now unset CC -DT_HOME=$DEST_DIR//Developer/usr +DT_HOME=$DEST_DIR/Developer/usr +DEST_ROOT="/Developer$DEST_ROOT" if [ "x$DEVELOPER_BIN" != "x" ]; then -DT_HOME=$DEST_DIR/$DEVELOPER_DIR/usr + DT_HOME=$DEST_DIR/$DEVELOPER_DIR/usr + DEST_ROOT="/$DEVELOPER_DIR$DEST_ROOT" fi ################################################################################ From evan.cheng at apple.com Tue Apr 15 02:56:04 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Apr 2008 07:56:04 -0000 Subject: [llvm-commits] [llvm] r49714 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <200804150756.m3F7u4L9015868@zion.cs.uiuc.edu> Author: evancheng Date: Tue Apr 15 02:56:03 2008 New Revision: 49714 URL: http://llvm.org/viewvc/llvm-project?rev=49714&view=rev Log: Sort sub-registers and super-registers lists according to super-sub register relations. e.g. X86::RAX sub-register list is EAX, AX, AL, AH (order of last two are not guaranteed). Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=49714&r1=49713&r2=49714&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Tue Apr 15 02:56:03 2008 @@ -353,9 +353,10 @@ return get(RegNo).AliasSet; } - /// getSubRegisters - Return the set of registers that are sub-registers of + /// getSubRegisters - Return the list of registers that are sub-registers of /// the specified register, or a null list of there are none. The list - /// returned is zero terminated. + /// returned is zero terminated and sorted according to super-sub register + /// relations. e.g. X86::RAX's sub-register list is EAX, AX, AL, AH. /// const unsigned *getSubRegisters(unsigned RegNo) const { return get(RegNo).SubRegs; @@ -369,9 +370,10 @@ return get(RegNo).ImmSubRegs; } - /// getSuperRegisters - Return the set of registers that are super-registers + /// getSuperRegisters - Return the list of registers that are super-registers /// of the specified register, or a null list of there are none. The list - /// returned is zero terminated. + /// returned is zero terminated and sorted according to super-sub register + /// relations. e.g. X86::AL's super-register list is RAX, EAX, AX. /// const unsigned *getSuperRegisters(unsigned RegNo) const { return get(RegNo).SuperRegs; Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=49714&r1=49713&r2=49714&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Tue Apr 15 02:56:03 2008 @@ -153,6 +153,20 @@ addSubSuperReg(R, *I, SubRegs, SuperRegs, Aliases); } +class RegisterSorter { +private: + std::map > &RegisterSubRegs; + +public: + RegisterSorter(std::map > &RS) + : RegisterSubRegs(RS) {}; + + bool operator()(Record *RegA, Record *RegB) { + // B is sub-register of A. + return RegisterSubRegs.count(RegA) && RegisterSubRegs[RegA].count(RegB); + } +}; + // RegisterInfoEmitter::run - Main register file description emitter. // void RegisterInfoEmitter::run(std::ostream &OS) { @@ -474,9 +488,14 @@ for (std::map >::iterator I = RegisterSubRegs.begin(), E = RegisterSubRegs.end(); I != E; ++I) { OS << " const unsigned " << I->first->getName() << "_SubRegsSet[] = { "; + std::vector SubRegsVector; for (std::set::iterator ASI = I->second.begin(), E = I->second.end(); ASI != E; ++ASI) - OS << getQualifiedName(*ASI) << ", "; + SubRegsVector.push_back(*ASI); + RegisterSorter RS(RegisterSubRegs); + std::stable_sort(SubRegsVector.begin(), SubRegsVector.end(), RS); + for (unsigned i = 0, e = SubRegsVector.size(); i != e; ++i) + OS << getQualifiedName(SubRegsVector[i]) << ", "; OS << "0 };\n"; } @@ -505,9 +524,15 @@ for (std::map >::iterator I = RegisterSuperRegs.begin(), E = RegisterSuperRegs.end(); I != E; ++I) { OS << " const unsigned " << I->first->getName() << "_SuperRegsSet[] = { "; + + std::vector SuperRegsVector; for (std::set::iterator ASI = I->second.begin(), E = I->second.end(); ASI != E; ++ASI) - OS << getQualifiedName(*ASI) << ", "; + SuperRegsVector.push_back(*ASI); + RegisterSorter RS(RegisterSubRegs); + std::stable_sort(SuperRegsVector.begin(), SuperRegsVector.end(), RS); + for (unsigned i = 0, e = SuperRegsVector.size(); i != e; ++i) + OS << getQualifiedName(SuperRegsVector[i]) << ", "; OS << "0 };\n"; } From nicolas.geoffray at lip6.fr Tue Apr 15 03:08:50 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 15 Apr 2008 08:08:50 -0000 Subject: [llvm-commits] [llvm] r49715 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200804150808.m3F88pAe016262@zion.cs.uiuc.edu> Author: geoffray Date: Tue Apr 15 03:08:50 2008 New Revision: 49715 URL: http://llvm.org/viewvc/llvm-project?rev=49715&view=rev Log: Change Divided flag to Split, as suggested by Evan Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49715&r1=49714&r2=49715&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Apr 15 03:08:50 2008 @@ -1734,8 +1734,8 @@ static const uint64_t NestOffs = 5; static const uint64_t ByValAlign = 0xFULL << 6; //< Struct alignment static const uint64_t ByValAlignOffs = 6; - static const uint64_t Divided = 1ULL << 10; - static const uint64_t DividedOffs = 10; + static const uint64_t Split = 1ULL << 10; + static const uint64_t SplitOffs = 10; static const uint64_t OrigAlign = 0x1FULL<<27; static const uint64_t OrigAlignOffs = 27; static const uint64_t ByValSize = 0xffffffffULL << 32; //< Struct size @@ -1773,8 +1773,8 @@ (uint64_t(Log2_32(A) + 1) << ByValAlignOffs); } - bool isDivided() const { return Flags & Divided; } - void setDivided() { Flags |= One << DividedOffs; } + bool isSplit() const { return Flags & Split; } + void setSplit() { Flags |= One << SplitOffs; } unsigned getOrigAlign() const { return (One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=49715&r1=49714&r2=49715&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Apr 15 03:08:50 2008 @@ -4164,7 +4164,7 @@ RetVals.push_back(RegisterVT); ISD::ArgFlagsTy MyFlags = Flags; if (NumRegs > 1 && i == 0) - MyFlags.setDivided(); + MyFlags.setSplit(); // if it isn't first piece, alignment must be 1 else if (i > 0) MyFlags.setOrigAlign(1); @@ -4289,7 +4289,7 @@ // if it isn't first piece, alignment must be 1 ISD::ArgFlagsTy MyFlags = Flags; if (NumParts > 1 && i == 0) - MyFlags.setDivided(); + MyFlags.setSplit(); else if (i != 0) MyFlags.setOrigAlign(1); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49715&r1=49714&r2=49715&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Apr 15 03:08:50 2008 @@ -1423,7 +1423,7 @@ ISD::ArgFlagsTy Flags = cast(Op.getOperand(ArgNo+3))->getArgFlags(); // See if next argument requires stack alignment in ELF - bool Align = Flags.isDivided(); + bool Align = Flags.isSplit(); unsigned CurArgOffset = ArgOffset; @@ -1855,7 +1855,7 @@ ISD::ArgFlagsTy Flags = cast(Op.getOperand(5+2*i+1))->getArgFlags(); // See if next argument requires stack alignment in ELF - bool Align = Flags.isDivided(); + bool Align = Flags.isSplit(); // PtrOff will be used to store the current argument to the stack if a // register cannot be found for it. From ggreif at gmail.com Tue Apr 15 03:37:20 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 08:37:20 -0000 Subject: [llvm-commits] [llvm] r49716 - in /llvm/branches/ggreif/use-diet: include/llvm/User.h lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Instructions.cpp Message-ID: <200804150837.m3F8bKYn017055@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 03:37:20 2008 New Revision: 49716 URL: http://llvm.org/viewvc/llvm-project?rev=49716&view=rev Log: rename allocHangoffUses -> allocHungoffUses Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49716&r1=49715&r2=49716&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 03:37:20 2008 @@ -256,7 +256,7 @@ template const Use &Op() const { return OperandTraits::op_begin(const_cast(this))[Idx]; } - inline Use *allocHangoffUses(unsigned) const; + inline Use *allocHungoffUses(unsigned) const; void dropHungoffUses(Use *U) { Use::zap(U, U->getImpliedUser(), true); } @@ -319,12 +319,8 @@ inline unsigned OperandTraits::operands(const User *U) { return U->getNumOperands(); } - /* - static inline void *allocate(unsigned); -}; - */ -Use *User::allocHangoffUses(unsigned N) const { +Use *User::allocHungoffUses(unsigned N) const { Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof this)); Use *End = Begin + N; (*(User**)End) = (User*)(ptrdiff_t(this) | 1); Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp?rev=49716&r1=49715&r2=49716&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp Tue Apr 15 03:37:20 2008 @@ -154,7 +154,7 @@ if (Desired > Capacity) { - Use *New = allocHangoffUses(Desired); + Use *New = allocHungoffUses(Desired); for (int i(getNumOperands() - 1); i >= 0; --i) New[i] = getOperand(i); Use *Old = OperandList; Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=49716&r1=49715&r2=49716&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Tue Apr 15 03:37:20 2008 @@ -114,7 +114,7 @@ PHINode::PHINode(const PHINode &PN) : Instruction(PN.getType(), Instruction::PHI, - allocHangoffUses(PN.getNumOperands()), PN.getNumOperands()), + allocHungoffUses(PN.getNumOperands()), PN.getNumOperands()), ReservedSpace(PN.getNumOperands()) { Use *OL = OperandList; for (unsigned i = 0, e = PN.getNumOperands(); i != e; i+=2) { @@ -181,7 +181,7 @@ ReservedSpace = NumOps; Use *OldOps = OperandList; - Use *NewOps = allocHangoffUses(NumOps); + Use *NewOps = allocHungoffUses(NumOps); for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { NewOps[i].init(OldOps[i], this); } @@ -2632,7 +2632,7 @@ assert(Value && Default); ReservedSpace = 2+NumCases*2; NumOperands = 2; - OperandList = allocHangoffUses(ReservedSpace); + OperandList = allocHungoffUses(ReservedSpace); OperandList[0].init(Value, this); OperandList[1].init(Default, this); @@ -2660,7 +2660,7 @@ SwitchInst::SwitchInst(const SwitchInst &SI) : TerminatorInst(Type::VoidTy, Instruction::Switch, - allocHangoffUses(SI.getNumOperands()), SI.getNumOperands()) { + allocHungoffUses(SI.getNumOperands()), SI.getNumOperands()) { Use *OL = OperandList, *InOL = SI.OperandList; for (unsigned i = 0, E = SI.getNumOperands(); i != E; i+=2) { OL[i].init(InOL[i], this); @@ -2733,7 +2733,7 @@ } ReservedSpace = NumOps; - Use *NewOps = allocHangoffUses(NumOps); + Use *NewOps = allocHungoffUses(NumOps); Use *OldOps = OperandList; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { NewOps[i].init(OldOps[i], this); From resistor at mac.com Tue Apr 15 04:04:10 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 15 Apr 2008 04:04:10 -0500 Subject: [llvm-commits] [llvm] r49610 - in /llvm/trunk/test/Analysis/BasicAA: const-dce.ll pure-const-dce.ll In-Reply-To: <1901EB83-25FC-4379-A2C9-DF789F0BBC3F@apple.com> References: <200804130951.m3D9p7u0016877@zion.cs.uiuc.edu> <5ADE47FA-14BE-49D8-8E2D-6D32D5E5FA12@apple.com> <4aca3dc20804141737w7f7b019s9317bf42f1adb949@mail.gmail.com> <1901EB83-25FC-4379-A2C9-DF789F0BBC3F@apple.com> Message-ID: <6E006BED-F8ED-4A5F-9CFA-B38B7A9E5C5C@mac.com> On Apr 15, 2008, at 12:23 AM, Chris Lattner wrote: > gcse/loadvn used to do this, is it hard to add back? > > -Chris Probably not. It's just not at the top of my list of priorities. If you have a testcase where it matters, make a PR for it. :-) --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4264 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080415/3428a921/attachment.bin From ggreif at gmail.com Tue Apr 15 04:17:50 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 09:17:50 -0000 Subject: [llvm-commits] [llvm] r49717 - /llvm/branches/ggreif/use-diet/include/llvm/User.h Message-ID: <200804150917.m3F9HoRs018840@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 04:17:49 2008 New Revision: 49717 URL: http://llvm.org/viewvc/llvm-project?rev=49717&view=rev Log: prettify allocHungoffUses Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49717&r1=49716&r2=49717&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 04:17:49 2008 @@ -245,9 +245,9 @@ void operator delete(void *Usr) { User *Start = static_cast(Usr); Use *Storage = static_cast(Usr) - Start->NumOperands; - if (Storage == Start->OperandList) - ::operator delete(Storage); - else ::operator delete(Usr); + ::operator delete(Storage == Start->OperandList + ? Storage + : Usr); } public: template Use &Op() { @@ -320,10 +320,21 @@ return U->getNumOperands(); } +enum Tag { noTag, tagOne, tagTwo, tagThree }; + +template +inline T *addTag(T *P, TAG Tag) { + return reinterpret_cast(ptrdiff_t(P) | Tag); +} + Use *User::allocHungoffUses(unsigned N) const { - Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof this)); - Use *End = Begin + N; - (*(User**)End) = (User*)(ptrdiff_t(this) | 1); + struct AugmentedUse : Use { + User *ref; + AugmentedUse(); // not implemented + }; + Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); + AugmentedUse *End = static_cast(Begin + N); + End->ref = (User*)(ptrdiff_t(this) | tagOne); Use::initTags(Begin, End); return Begin; } From ggreif at gmail.com Tue Apr 15 04:55:28 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 09:55:28 -0000 Subject: [llvm-commits] [llvm] r49718 - /llvm/branches/ggreif/use-diet/include/llvm/User.h Message-ID: <200804150955.m3F9tWIj019786@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 04:55:11 2008 New Revision: 49718 URL: http://llvm.org/viewvc/llvm-project?rev=49718&view=rev Log: actually use addTag and define stripTag Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49718&r1=49717&r2=49718&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 04:55:11 2008 @@ -323,10 +323,15 @@ enum Tag { noTag, tagOne, tagTwo, tagThree }; template -inline T *addTag(T *P, TAG Tag) { +inline T *addTag(const T *P, TAG Tag) { return reinterpret_cast(ptrdiff_t(P) | Tag); } +template +inline T *stripTag(const T *P) { + return reinterpret_cast(ptrdiff_t(P) & ~MASK); +} + Use *User::allocHungoffUses(unsigned N) const { struct AugmentedUse : Use { User *ref; @@ -334,7 +339,7 @@ }; Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); AugmentedUse *End = static_cast(Begin + N); - End->ref = (User*)(ptrdiff_t(this) | tagOne); + End->ref = addTag(this, tagOne); Use::initTags(Begin, End); return Begin; } From nicolas.geoffray at lip6.fr Tue Apr 15 05:00:55 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 15 Apr 2008 10:00:55 -0000 Subject: [llvm-commits] [vmkit] r49719 - in /vmkit/trunk: include/mvm/JIT.h include/mvm/MvmMemoryManager.h lib/Mvm/CommandLine.cpp lib/Mvm/GCMmap2/MvmGC.h lib/Mvm/GCMmap2/gc.cpp lib/Mvm/GCMmap2/gccollector.cpp lib/Mvm/GCMmap2/gccollector.h lib/Mvm/GCMmap2/gcthread.h lib/Mvm/GCMmap2/main.cpp lib/Mvm/JIT.cpp lib/Mvm/MvmMemoryManager.cpp lib/Mvm/MvmMemoryManager.h lib/Mvm/Object.cpp lib/Mvm/Sigsegv.cpp Message-ID: <200804151000.m3FA0x6V019947@zion.cs.uiuc.edu> Author: geoffray Date: Tue Apr 15 05:00:41 2008 New Revision: 49719 URL: http://llvm.org/viewvc/llvm-project?rev=49719&view=rev Log: Allow multiple GC to execute. MvmMemoryManager has a map of llvm::Module->GC to allocate functions. Make MvmMemoryManager.h accessible to virtual machines. Added: vmkit/trunk/include/mvm/MvmMemoryManager.h Removed: vmkit/trunk/lib/Mvm/MvmMemoryManager.h Modified: vmkit/trunk/include/mvm/JIT.h vmkit/trunk/lib/Mvm/CommandLine.cpp vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h vmkit/trunk/lib/Mvm/GCMmap2/main.cpp vmkit/trunk/lib/Mvm/JIT.cpp vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp vmkit/trunk/lib/Mvm/Object.cpp vmkit/trunk/lib/Mvm/Sigsegv.cpp Modified: vmkit/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Tue Apr 15 05:00:41 2008 @@ -26,6 +26,7 @@ #include "types.h" #include "mvm/Threads/Locks.h" +#include "mvm/MvmMemoryManager.h" namespace mvm { @@ -148,7 +149,7 @@ extern llvm::Module *globalModule; extern llvm::ExistingModuleProvider *globalModuleProvider; -extern llvm::JITMemoryManager *memoryManager; +extern mvm::MvmMemoryManager *memoryManager; extern void protectTypes(); extern void unprotectTypes(); Added: vmkit/trunk/include/mvm/MvmMemoryManager.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/MvmMemoryManager.h?rev=49719&view=auto ============================================================================== --- vmkit/trunk/include/mvm/MvmMemoryManager.h (added) +++ vmkit/trunk/include/mvm/MvmMemoryManager.h Tue Apr 15 05:00:41 2008 @@ -0,0 +1,114 @@ +//===------- MvmMemoryManager.h - LLVM Memory manager for Mvm -------------===// +// +// Mvm +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#ifndef MVM_MEMORY_MANAGER_H +#define MVM_MEMORY_MANAGER_H + +#include + +#include "MvmGC.h" +#include "mvm/Threads/Locks.h" +#include "llvm/Module.h" +#include + +using namespace llvm; + +namespace mvm { + +class Method; +class Object; + +class MvmMemoryManager : public JITMemoryManager { + Method* currentMethod; // Current method being compiled + unsigned char *GOTBase; // Target Specific reserved memory +#ifdef MULTIPLE_GC + std::map GCMap; + mvm::Lock* lock; +#endif +public: + + MvmMemoryManager() : JITMemoryManager() { + GOTBase = 0; +#ifdef MULTIPLE_GC + lock = mvm::Lock::allocNormal(); +#endif + } + ~MvmMemoryManager() { + delete[] GOTBase; +#ifdef MULTIPLE_GC + delete lock; +#endif + } + +#ifdef MULTIPLE_GC + void addGCForModule(Module* M, Collector* GC){ + lock->lock(); + GCMap[M] = GC; + lock->unlock(); + } +#endif + + /// startFunctionBody - When we start JITing a function, the JIT calls this + /// method to allocate a block of free RWX memory, which returns a pointer to + /// it. The JIT doesn't know ahead of time how much space it will need to + /// emit the function, so it doesn't pass in the size. Instead, this method + /// is required to pass back a "valid size". The JIT will be careful to not + /// write more than the returned ActualSize bytes of memory. + virtual unsigned char *startFunctionBody(const Function *F, + uintptr_t &ActualSize); + + /// allocateStub - This method is called by the JIT to allocate space for a + /// function stub (used to handle limited branch displacements) while it is + /// JIT compiling a function. For example, if foo calls bar, and if bar + /// either needs to be lazily compiled or is a native function that exists too + /// far away from the call site to work, this method will be used to make a + /// thunk for it. The stub should be "close" to the current function body, + /// but should not be included in the 'actualsize' returned by + /// startFunctionBody. + virtual unsigned char *allocateStub(unsigned StubSize, unsigned Alignment); + + /// endFunctionBody - This method is called when the JIT is done codegen'ing + /// the specified function. At this point we know the size of the JIT + /// compiled function. This passes in FunctionStart (which was returned by + /// the startFunctionBody method) and FunctionEnd which is a pointer to the + /// actual end of the function. This method should mark the space allocated + /// and remember where it is in case the client wants to deallocate it. + virtual void endFunctionBody(const Function *F, unsigned char *FunctionStart, + unsigned char *FunctionEnd); + + /// deallocateMemForFunction - Free JIT memory for the specified function. + /// This is never called when the JIT is currently emitting a function. + virtual void deallocateMemForFunction(const Function *F); + + /// AllocateGOT - If the current table requires a Global Offset Table, this + /// method is invoked to allocate it. This method is required to set HasGOT + /// to true. + virtual void AllocateGOT(); + + /// getGOTBase - If this is managing a Global Offset Table, this method should + /// return a pointer to its base. + virtual unsigned char *getGOTBase() const; + + + /// startExceptionTable - When we finished JITing the function, if exception + /// handling is set, we emit the exception table. + virtual unsigned char* startExceptionTable(const Function* F, + uintptr_t &ActualSize); + + /// endExceptionTable - This method is called when the JIT is done emitting + /// the exception table. + virtual void endExceptionTable(const Function *F, unsigned char *TableStart, + unsigned char *TableEnd, + unsigned char* FrameRegister); +}; + +} // End mvm namespace + +#endif Modified: vmkit/trunk/lib/Mvm/CommandLine.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommandLine.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommandLine.cpp (original) +++ vmkit/trunk/lib/Mvm/CommandLine.cpp Tue Apr 15 05:00:41 2008 @@ -105,10 +105,18 @@ char** argv = arg->argv; vmlet_main_t func = arg->func; free(arg); +#ifndef MULTIPLE_GC Collector::inject_my_thread(&argc); func(argc, argv); Collector::remove_my_thread(); Collector::collect(); +#else + Collector* GC = Collector::allocate(); + GC->inject_my_thread(&argc); + func(argc, argv); + GC->remove_my_thread(); + GC->collect(); +#endif return 0; } @@ -150,7 +158,6 @@ Thread::start(&tid, (int (*)(void *))startApp, thread_arg); #else func(argc, argv); - Collector::collect(); #endif } } Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Tue Apr 15 05:00:41 2008 @@ -18,6 +18,8 @@ #define gc_new(Class) __gc_new(Class::VT) Class #define __gc_new new +class Collector; + class gc : public gcRoot { public: @@ -28,37 +30,53 @@ void operator delete(void *); void * realloc(size_t n); +#ifdef MULTIPLE_GC +#define collector_new(Class, Collector) __gc_new(Class::VT, Collector) Class + void markAndTrace(Collector* GC) const; + size_t objectSize(Collector* GC) const; + void * operator new(size_t sz, VirtualTable *VT, Collector* GC); + void * operator new(size_t sz, Collector* GC); + void operator delete(void *, Collector* GC); + void * realloc(size_t n, Collector* GC); +#endif + }; +#ifdef MULTIPLE_GC +#define STATIC +#else +#define STATIC static +#endif + class Collector { public: typedef void (*markerFn)(void); static void initialise(markerFn mark, void *base_sp); - static void destroy(); + STATIC void destroy(); - static void die_if_sigsegv_occured_during_collection(void *addr); - static int isStable(gc_lock_recovery_fct_t, int, int, int, int, + STATIC void die_if_sigsegv_occured_during_collection(void *addr); + STATIC int isStable(gc_lock_recovery_fct_t, int, int, int, int, int, int, int, int); - static unsigned int enable(unsigned int n); - static void gcStats(size_t &no, size_t &nbb); - static void maybeCollect(); - static void collect(void); - static void inject_my_thread(void *sp); - static void remove_my_thread(); + STATIC unsigned int enable(unsigned int n); + STATIC void gcStats(size_t &no, size_t &nbb); + STATIC void maybeCollect(); + STATIC void collect(void); + STATIC void inject_my_thread(void *sp); + STATIC void remove_my_thread(); static Collector* allocate(); - static gc *begOf(const void *o); - static int byteOffset(void *o); - inline static bool isObject(const void *o) { return begOf((void*)o); } - static void applyFunc(void (*func)(gcRoot *o, void *data), void *data); - static void registerMemoryError(void (*func)(unsigned int)); - static int getMaxMemory(void); - static int getFreeMemory(void); - static int getTotalMemory(void); - static void setMaxMemory(size_t); - static void setMinMemory(size_t); + STATIC gc *begOf(const void *o); + STATIC int byteOffset(void *o); + inline STATIC bool isObject(const void *o) { return begOf((void*)o); } + STATIC void applyFunc(void (*func)(gcRoot *o, void *data), void *data); + STATIC void registerMemoryError(void (*func)(unsigned int)); + STATIC int getMaxMemory(void); + STATIC int getFreeMemory(void); + STATIC int getTotalMemory(void); + STATIC void setMaxMemory(size_t); + STATIC void setMinMemory(size_t); }; Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Tue Apr 15 05:00:41 2008 @@ -15,24 +15,31 @@ using namespace mvm; +#ifdef MULTIPLE_GC +#define COLLECTOR ((GCCollector*)(mvm::Thread::get()->GC))-> +#else +#define COLLECTOR GCCollector:: +#endif + + typedef void (*memoryError_t)(unsigned int); memoryError_t GCCollector::internMemoryError; void gc::markAndTrace() const { - GCCollector::markAndTrace((void*)this); + COLLECTOR markAndTrace((void*)this); } size_t gc::objectSize() const { - return GCCollector::objectSize((gc*)this); + return COLLECTOR objectSize((gc*)this); } void *gc::operator new(size_t sz, VirtualTable *vt) { - return GCCollector::gcmalloc(vt, sz); + return COLLECTOR gcmalloc(vt, sz); } void *gc::operator new(size_t sz) { - return malloc(sz); + return malloc(sz); } void gc::operator delete(void *) { @@ -40,62 +47,103 @@ } void *gc::realloc(size_t n) { - return GCCollector::gcrealloc(this, n); + return COLLECTOR gcrealloc(this, n); +} + + +#ifdef MULTIPLE_GC +void gc::markAndTrace(Collector* GC) const { + ((GCCollector*)GC)->markAndTrace((void*)this); } +size_t gc::objectSize(Collector* GC) const { + return ((GCCollector*)GC)->objectSize((gc*)this); +} + +void *gc::operator new(size_t sz, VirtualTable *VT, Collector* GC) { + return ((GCCollector*)GC)->gcmalloc(VT, sz); +} + +void *gc::operator new(size_t sz, Collector* GC) { + return malloc(sz); +} + +void gc::operator delete(void *, Collector* GC) { + gcfatal(0, "never call directly a destructor....."); +} + +void *gc::realloc(size_t n, Collector* GC) { + return ((GCCollector*)GC)->gcrealloc(this, n); +} +#endif + +#undef COLLECTOR +#ifdef MULTIPLE_GC +#define COLLECTOR ((GCCollector*)this)-> +#else +#define COLLECTOR GCCollector:: +#endif + unsigned int Collector::enable(unsigned int n) { - return GCCollector::enable(n); + return COLLECTOR enable(n); } int Collector::isStable(gc_lock_recovery_fct_t fct, int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7) { - return GCCollector::isStable(fct, a0, a1, a2, a3, a4, a5, a6, a7); + return COLLECTOR isStable(fct, a0, a1, a2, a3, a4, a5, a6, a7); } void Collector::die_if_sigsegv_occured_during_collection(void *addr) { - GCCollector::die_if_sigsegv_occured_during_collection(addr); + COLLECTOR die_if_sigsegv_occured_during_collection(addr); } void Collector::gcStats(size_t &no, size_t &nbb) { - GCCollector::gcStats(&no, &nbb); + COLLECTOR gcStats(&no, &nbb); } void Collector::initialise(markerFn marker, void *base_sp) { +#ifdef MULTIPLE_GC + GCCollector* GC = new GCCollector(); + mvm::Thread::get()->GC = GC; + GC->initialise(marker); + GC->inject_my_thread(base_sp); +#else GCCollector::initialise(marker); GCCollector::inject_my_thread(base_sp); +#endif } void Collector::destroy() { - GCCollector::destroy(); + COLLECTOR destroy(); } void Collector::inject_my_thread(void *base_sp) { #ifdef HAVE_PTHREAD - GCCollector::inject_my_thread(base_sp); + COLLECTOR inject_my_thread(base_sp); #endif } void Collector::maybeCollect() { - GCCollector::maybeCollect(); + COLLECTOR maybeCollect(); } void Collector::collect(void) { - GCCollector::collect(); + COLLECTOR collect(); } gc *Collector::begOf(const void *obj) { - return (gc*)GCCollector::begOf((void*)obj); + return (gc*)COLLECTOR begOf((void*)obj); } int Collector::byteOffset(void *obj) { - int beg = (intptr_t)GCCollector::begOf(obj); + int beg = (intptr_t)COLLECTOR begOf(obj); intptr_t off = (intptr_t)obj; return (off-beg); } void Collector::applyFunc(void (*func)(gcRoot *o, void *data), void *data) { - return GCCollector::applyFunc(func, data); + return COLLECTOR applyFunc(func, data); } int Collector::getMaxMemory(void){ @@ -117,63 +165,74 @@ } void Collector::registerMemoryError(void (*func)(unsigned int)){ - GCCollector::internMemoryError = func; - //onMemoryError = &GCCollector::defaultMemoryError; + COLLECTOR internMemoryError = func; + //onMemoryError = &COLLECTOR defaultMemoryError; } void Collector::remove_my_thread() { #ifdef HAVE_PTHREAD - GCCollector::remove_thread(GCCollector::threads->myloc()); + COLLECTOR remove_thread(COLLECTOR threads->myloc()); #endif } +void GCThread::waitCollection() { + unsigned int cm = COLLECTOR current_mark; + + if(Thread::self() != collector_tid) { + collectorGo(); + while((COLLECTOR current_mark == cm) && + (COLLECTOR status == COLLECTOR stat_collect)) + _collectionCond.wait(&_stackLock); + } +} + #ifdef HAVE_PTHREAD + +#undef COLLECTOR void GCCollector::siggc_handler(int) { - GCThreadCollector *loc = GCCollector::threads->myloc(); - register unsigned int cm = GCCollector::current_mark; +#ifdef MULTIPLE_GC + GCCollector* GC = ((GCCollector*)mvm::Thread::get()->GC); +#define COLLECTOR GC-> +#else +#define COLLECTOR GCCollector:: +#endif + GCThreadCollector *loc = COLLECTOR threads->myloc(); + register unsigned int cm = COLLECTOR current_mark; // jmp_buf buf; // setjmp(buf); - - GCCollector::threads->stackLock(); - if(!loc) /* a key is being destroyed */ - GCCollector::threads->another_mark(); - else if(loc->current_mark() != cm) { + COLLECTOR threads->stackLock(); + + if(!loc) /* a key is being destroyed */ + COLLECTOR threads->another_mark(); + else if(loc->current_mark() != cm) { register unsigned int **cur = (unsigned int **)&cur; register unsigned int **max = loc->base_sp(); GCChunkNode *node; for(; curremove(); - node->append(GCCollector::used_nodes); - GCCollector::mark(node); + node->append(COLLECTOR used_nodes); + COLLECTOR mark(node); } } loc->current_mark(cm); - GCCollector::threads->another_mark(); - - GCCollector::threads->waitCollection(); + COLLECTOR threads->another_mark(); + COLLECTOR threads->waitCollection(); } - GCCollector::threads->stackUnlock(); + COLLECTOR threads->stackUnlock(); +#undef COLLECTOR } #endif -void GCThread::waitCollection() { - unsigned int cm = GCCollector::current_mark; - - if(Thread::self() != collector_tid) { - collectorGo(); - while((GCCollector::current_mark == cm) && - (GCCollector::status == GCCollector::stat_collect)) - _collectionCond.wait(&_stackLock); - } -} Collector* Collector::allocate() { - return new GCCollector(); + GCCollector* GC = new GCCollector(); + GC->initialise(0); + return GC; } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp Tue Apr 15 05:00:41 2008 @@ -12,7 +12,7 @@ using namespace mvm; -#ifndef MULTIPLE_VM +#ifndef MULTIPLE_GC GCAllocator *GCCollector::allocator = 0; #ifdef HAVE_PTHREAD GCThread *GCCollector::threads; Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h Tue Apr 15 05:00:41 2008 @@ -17,7 +17,7 @@ #endif #include "mvm/GC/GC.h" -#ifdef MULTIPLE_VM +#ifdef MULTIPLE_GC #define STATIC #else #define STATIC static Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h Tue Apr 15 05:00:41 2008 @@ -75,17 +75,23 @@ }; class GCThread { - Key _loc; - GCThreadCollector base; + GCThreadCollector base; GCLockRecovery _globalLock; /* global lock for gcmalloc */ LockNormal _stackLock; /* stack lock for synchronization */ Cond _stackCond; /* condition for unlocking other tasks (write protect) */ Cond _collectionCond;/* condition for unblocking the collecter */ - unsigned int _nb_threads; /* number of active threads */ - unsigned int _nb_collected; /* number of threads collected */ + unsigned int _nb_threads; /* number of active threads */ + unsigned int _nb_collected; /* number of threads collected */ int collector_tid; /* don't synchonize this one */ + public: + Key _loc; + GCThread() { + _nb_threads = 0; + _nb_collected = 0; + collector_tid = 0; + } inline void lock() { _globalLock.lock(); } inline void unlock() { _globalLock.unlock(); } @@ -108,9 +114,9 @@ collectionFinished(); /* unblock mutators */ } - inline GCThreadCollector *myloc() { return _loc.get(); } + inline GCThreadCollector *myloc() { return _loc.get(); } - inline void another_mark() { _nb_collected++; } + inline void another_mark() { _nb_collected++; } void synchronize(); Modified: vmkit/trunk/lib/Mvm/GCMmap2/main.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/main.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/main.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/main.cpp Tue Apr 15 05:00:41 2008 @@ -26,8 +26,13 @@ } int main(int argc, char **argv) { + mvm::Thread::initialise(); Collector::initialise(marker, 0); +#ifdef MULTIPLE_GC + mvm::Thread::get()->GC->destroy(); +#else Collector::destroy(); +#endif return 0; } Modified: vmkit/trunk/lib/Mvm/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/JIT.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/JIT.cpp Tue Apr 15 05:00:41 2008 @@ -17,8 +17,7 @@ #include "mvm/JIT.h" #include "mvm/Method.h" - -#include "MvmMemoryManager.h" +#include "mvm/MvmMemoryManager.h" using namespace mvm; using namespace mvm::jit; @@ -658,7 +657,7 @@ llvm::Module *mvm::jit::globalModule; llvm::ExistingModuleProvider *mvm::jit::globalModuleProvider; -llvm::JITMemoryManager *mvm::jit::memoryManager; +mvm::MvmMemoryManager *mvm::jit::memoryManager; uint64 mvm::jit::getTypeSize(const llvm::Type* type) { Modified: vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp (original) +++ vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp Tue Apr 15 05:00:41 2008 @@ -12,7 +12,7 @@ #include "mvm/Method.h" #include "mvm/Object.h" -#include "MvmMemoryManager.h" +#include "mvm/MvmMemoryManager.h" using namespace mvm; using namespace llvm; @@ -20,9 +20,15 @@ unsigned char* MvmMemoryManager::startFunctionBody(const Function* F, uintptr_t &ActualSize) { size_t nbb = ((ActualSize - 1) & -4) + 4 + sizeof(Method *); +#ifdef MUTLIPLE_GC + Collector* GC = GCMap[F->getModule()]; + assert(GC && "GC not available in a multi-GC environment"); + Code *res = (Code *)gc::operator new(nbb, Code::VT, GC); + Method* meth = collector_new(Method, GC)(res, ActualSize); +#else Code *res = (Code *)gc::operator new(nbb, Code::VT); - Method* meth = gc_new(Method)(res, ActualSize); +#endif res->method(meth); currentMethod = meth; return (unsigned char*)((unsigned int*)res + 2); @@ -59,8 +65,16 @@ unsigned char *MvmMemoryManager::startExceptionTable(const Function* F, uintptr_t &ActualSize) { +#ifdef MUTLIPLE_GC + Collector* GC = GCMap[F->getModule()]; + assert(GC && "GC not available in a multi-GC environment"); + ExceptionTable *res = (ExceptionTable*)gc::operator new(ActualSize + 4, + ExceptionTable::VT, + GC); +#else ExceptionTable *res = (ExceptionTable*)gc::operator new(ActualSize + 4, ExceptionTable::VT); +#endif currentMethod->exceptionTable(res); return (unsigned char*)((unsigned int*)res + 2); } Removed: vmkit/trunk/lib/Mvm/MvmMemoryManager.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MvmMemoryManager.h?rev=49718&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/MvmMemoryManager.h (original) +++ vmkit/trunk/lib/Mvm/MvmMemoryManager.h (removed) @@ -1,86 +0,0 @@ -//===------- MvmMemoryManager.h - LLVM Memory manager for Mvm -------------===// -// -// Mvm -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -#ifndef MVM_MEMORY_MANAGER_H -#define MVM_MEMORY_MANAGER_H - -#include - -using namespace llvm; - -namespace mvm { - -class Method; -class Object; - -class MvmMemoryManager : public JITMemoryManager { - Method* currentMethod; // Current method being compiled - unsigned char *GOTBase; // Target Specific reserved memory -public: - - MvmMemoryManager() : JITMemoryManager() { GOTBase = 0; } - ~MvmMemoryManager() { delete[] GOTBase; } - /// startFunctionBody - When we start JITing a function, the JIT calls this - /// method to allocate a block of free RWX memory, which returns a pointer to - /// it. The JIT doesn't know ahead of time how much space it will need to - /// emit the function, so it doesn't pass in the size. Instead, this method - /// is required to pass back a "valid size". The JIT will be careful to not - /// write more than the returned ActualSize bytes of memory. - virtual unsigned char *startFunctionBody(const Function *F, - uintptr_t &ActualSize); - - /// allocateStub - This method is called by the JIT to allocate space for a - /// function stub (used to handle limited branch displacements) while it is - /// JIT compiling a function. For example, if foo calls bar, and if bar - /// either needs to be lazily compiled or is a native function that exists too - /// far away from the call site to work, this method will be used to make a - /// thunk for it. The stub should be "close" to the current function body, - /// but should not be included in the 'actualsize' returned by - /// startFunctionBody. - virtual unsigned char *allocateStub(unsigned StubSize, unsigned Alignment); - - /// endFunctionBody - This method is called when the JIT is done codegen'ing - /// the specified function. At this point we know the size of the JIT - /// compiled function. This passes in FunctionStart (which was returned by - /// the startFunctionBody method) and FunctionEnd which is a pointer to the - /// actual end of the function. This method should mark the space allocated - /// and remember where it is in case the client wants to deallocate it. - virtual void endFunctionBody(const Function *F, unsigned char *FunctionStart, - unsigned char *FunctionEnd); - - /// deallocateMemForFunction - Free JIT memory for the specified function. - /// This is never called when the JIT is currently emitting a function. - virtual void deallocateMemForFunction(const Function *F); - - /// AllocateGOT - If the current table requires a Global Offset Table, this - /// method is invoked to allocate it. This method is required to set HasGOT - /// to true. - virtual void AllocateGOT(); - - /// getGOTBase - If this is managing a Global Offset Table, this method should - /// return a pointer to its base. - virtual unsigned char *getGOTBase() const; - - - /// startExceptionTable - When we finished JITing the function, if exception - /// handling is set, we emit the exception table. - virtual unsigned char* startExceptionTable(const Function* F, - uintptr_t &ActualSize); - - /// endExceptionTable - This method is called when the JIT is done emitting - /// the exception table. - virtual void endExceptionTable(const Function *F, unsigned char *TableStart, - unsigned char *TableEnd, - unsigned char* FrameRegister); -}; - -} // End mvm namespace - -#endif Modified: vmkit/trunk/lib/Mvm/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Object.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Object.cpp Tue Apr 15 05:00:41 2008 @@ -88,7 +88,7 @@ PrintBuffer *PrintBuffer::writeObj(const Object *obj) { - Object *beg = (Object*)Collector::begOf(obj); + Object *beg = (Object*)mvm::Thread::get()->GC->begOf(obj); if(beg) { if(beg == obj) { Modified: vmkit/trunk/lib/Mvm/Sigsegv.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Sigsegv.cpp?rev=49719&r1=49718&r2=49719&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Sigsegv.cpp (original) +++ vmkit/trunk/lib/Mvm/Sigsegv.cpp Tue Apr 15 05:00:41 2008 @@ -10,6 +10,7 @@ #include "MvmGC.h" #include "mvm/Sigsegv.h" +#include "mvm/Threads/Thread.h" #include #include @@ -49,7 +50,11 @@ #endif /* Free the GC if it sisgegv'd. No other collection is possible */ +#ifndef MULTIPLE_GC Collector::die_if_sigsegv_occured_during_collection(addr); +#else + mvm::Thread::get()->GC->die_if_sigsegv_occured_during_collection(addr); +#endif // sys_exit(0); if(client_sigsegv_handler) From nicolas.geoffray at lip6.fr Tue Apr 15 05:22:23 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 15 Apr 2008 10:22:23 -0000 Subject: [llvm-commits] [vmkit] r49720 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathVMRuntime.cpp Classpath/ClasspathVMStackWalker.cpp Classpath/ClasspathVMThread.cpp Classpath/ClasspathVMThrowable.cpp VMCore/JavaBacktrace.cpp VMCore/JavaClass.cpp VMCore/JavaIsolate.cpp VMCore/Jnjvm.cpp VMCore/Jnjvm.h Message-ID: <200804151022.m3FAMPPC020524@zion.cs.uiuc.edu> Author: geoffray Date: Tue Apr 15 05:22:21 2008 New Revision: 49720 URL: http://llvm.org/viewvc/llvm-project?rev=49720&view=rev Log: Cooperate with multiple GCs. Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp Tue Apr 15 05:22:21 2008 @@ -88,7 +88,11 @@ jclass clazz, #endif ) { +#ifdef MULTIPLE_GC + mvm::Thread::get()->GC->collect(); +#else Collector::collect(); +#endif } JNIEXPORT void JNICALL Java_java_lang_VMRuntime_runFinalization( @@ -129,7 +133,11 @@ jclass clazz, #endif ) { +#ifdef MULTIPLE_GC + return (jlong)mvm::Thread::get()->GC->getFreeMemory(); +#else return (jlong)Collector::getFreeMemory(); +#endif } JNIEXPORT jlong Java_java_lang_VMRuntime_totalMemory( @@ -138,7 +146,11 @@ jclass clazz, #endif ) { +#ifdef MULTIPLE_GC + return (jlong)mvm::Thread::get()->GC->getTotalMemory(); +#else return (jlong)Collector::getTotalMemory(); +#endif } JNIEXPORT jlong Java_java_lang_VMRuntime_maxMemory( @@ -147,7 +159,11 @@ jclass clazz, #endif ) { +#ifdef MULTIPLE_GC + return (jlong)mvm::Thread::get()->GC->getMaxMemory(); +#else return (jlong)Collector::getMaxMemory(); +#endif } } Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp Tue Apr 15 05:22:21 2008 @@ -31,7 +31,11 @@ ArrayObject* recGetClassContext(int** stack, uint32 size, uint32 first, uint32 rec) { if (size != first) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(stack[first]); +#else int *begIp = (int*)Collector::begOf(stack[first]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth) { ArrayObject* res = recGetClassContext(stack, size, first + 1, rec + 1); @@ -59,7 +63,11 @@ CommonClass* cl = Classpath::vmStackWalker; while (i < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); +#else int *begIp = (int*)Collector::begOf(ips[i++]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth && meth->classDef == cl) { first = i; @@ -88,7 +96,11 @@ int i = 0; while (i < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); +#else int *begIp = (int*)Collector::begOf(ips[i++]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth) { ++n; @@ -106,7 +118,11 @@ int i = 0; while (i < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); +#else int *begIp = (int*)Collector::begOf(ips[i++]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth) { ++n; Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp Tue Apr 15 05:22:21 2008 @@ -46,11 +46,15 @@ static void start(arg_thread_t* arg) { int argc; - Collector::inject_my_thread(&argc); JavaObject* vmThread = arg->vmThread; JavaThread* intern = arg->intern; free(arg); mvm::Thread::threadKey->set(intern); +#ifdef MULTIPLE_GC + intern->GC->inject_my_thread(&argc); +#else + Collector::inject_my_thread(&argc); +#endif CommonClass* vmthClass = vmThread->classOf; JavaObject* thread = (JavaObject*)((*ClasspathThread::assocThread)(vmThread).PointerVal); JavaIsolate* isolate = (JavaIsolate*)(intern->isolate); @@ -74,7 +78,12 @@ ts->nonDaemonVar->signal(); ts->nonDaemonLock->unlock(); } + +#ifdef MULTIPLE_GC + intern->GC->remove_my_thread(); +#else Collector::remove_my_thread(); +#endif } JNIEXPORT void JNICALL Java_java_lang_VMThread_start( @@ -93,6 +102,9 @@ arg_thread_t* arg = (arg_thread_t*)malloc(sizeof(arg_thread_t)); arg->intern = th; arg->vmThread = vmThread; +#ifdef MULTIPLE_GC + th->GC = mvm::Thread::get()->GC; +#endif mvm::Thread::start(&tid, (int (*)(void *))start, (void*)arg); } Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThrowable.cpp Tue Apr 15 05:22:21 2008 @@ -83,7 +83,11 @@ ArrayObject* recGetStackTrace(int** stack, uint32 size, uint32 first, uint32 rec) { Jnjvm* vm = JavaThread::get()->isolate; if (size != first) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(stack[first]); +#else int *begIp = (int*)Collector::begOf(stack[first]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth) { ArrayObject* res = recGetStackTrace(stack, size, first + 1, rec + 1); @@ -109,7 +113,11 @@ sint32 i = 0; while (i < array->size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf((void*)stack[i++]); +#else int *begIp = (int*)Collector::begOf((void*)stack[i++]); +#endif JavaMethod* meth = ip_to_meth(begIp); if (meth && meth->classDef == cl) { first = i; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp Tue Apr 15 05:22:21 2008 @@ -120,7 +120,11 @@ fp = debug_frame_caller_from_first_fp(fp); while ((!frame_end(fp)) && (debug_frame_ip(fp) != 0)) { int * ip = debug_frame_ip(fp); +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ip); +#else int *begIp = (int*)Collector::begOf(ip); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = @@ -148,7 +152,11 @@ int real_size = backtrace((void**)(void*)ips, 100); int n = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = @@ -186,7 +194,11 @@ int n = 0; int i = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = @@ -213,7 +225,11 @@ int n = 0; int i = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Tue Apr 15 05:22:21 2008 @@ -225,7 +225,11 @@ } // We can compile it, since if we're here, it's for a good reason void* val = mvm::jit::executionEngine->getPointerToGlobal(methPtr); +#ifndef MULTIPLE_GC if (Collector::isObject(val)) { +#else + if (classDef->isolate->GC->isObject(val)) { +#endif mvm::Code* temp = (mvm::Code*)((unsigned*)val - 2); temp->method()->definition(this); } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Tue Apr 15 05:22:21 2008 @@ -15,6 +15,7 @@ #include "llvm/Target/TargetData.h" #include "mvm/JIT.h" +#include "mvm/MvmMemoryManager.h" #include "mvm/Threads/Locks.h" #include "mvm/Threads/Cond.h" @@ -411,7 +412,10 @@ JavaIsolate* JavaIsolate::allocateIsolate(Jnjvm* callingVM) { JavaIsolate *isolate= vm_new(callingVM, JavaIsolate)(); - + +#ifdef MULTIPLE_GC + isolate->GC = Collector::allocate(); +#endif isolate->classpath = getenv("CLASSPATH"); if (!(isolate->classpath)) { isolate->classpath = "."; @@ -437,10 +441,14 @@ isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); +#ifndef MULTIPLE_GC mvm::Thread* th = mvm::Thread::get(); isolate->bootstrapThread->GC = th->GC; +#else + isolate->bootstrapThread->GC = isolate->GC; + mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); +#endif JavaThread::threadKey->set(isolate->bootstrapThread); - isolate->threadSystem = vm_new(isolate, ThreadSystem)(); isolate->threadSystem->initialise(); @@ -469,6 +477,10 @@ JavaIsolate* JavaIsolate::allocateBootstrap() { JavaIsolate *isolate= gc_new(JavaIsolate)(); +#ifdef MULTIPLE_GC + isolate->GC = Collector::allocate(); +#endif + isolate->classpath = getenv("CLASSPATH"); if (!(isolate->classpath)) { isolate->classpath = "."; @@ -493,8 +505,13 @@ isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); +#ifndef MULTIPLE_GC mvm::Thread* th = mvm::Thread::get(); isolate->bootstrapThread->GC = th->GC; +#else + isolate->bootstrapThread->GC = isolate->GC; + mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); +#endif JavaThread::threadKey->set(isolate->bootstrapThread); isolate->name = "bootstrapVM"; @@ -515,7 +532,7 @@ #endif #if defined(SERVICE_VM) || !defined(MULTIPLE_VM) - isolate->threadSystem = vm_new(this, ThreadSystem)(); + isolate->threadSystem = vm_new(isolate, ThreadSystem)(); isolate->threadSystem->initialise(); #endif @@ -523,9 +540,5 @@ } void JavaIsolate::destroyer(size_t sz) { - mvm::jit::protectEngine->lock(); - mvm::jit::executionEngine->removeModuleProvider(TheModuleProvider); - mvm::jit::protectEngine->unlock(); - delete TheModuleProvider; - delete module; + Jnjvm::destroyer(); } Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue Apr 15 05:22:21 2008 @@ -28,6 +28,7 @@ #include "JavaTypes.h" #include "JavaUpcalls.h" #include "Jnjvm.h" +#include "JnjvmModuleProvider.h" #include "LockedMap.h" #include "Reader.h" #ifdef SERVICE_VM @@ -866,3 +867,17 @@ return val; } #endif + +void Jnjvm::destroyer() { +#ifdef MULTIPLE_GC + GC->destroy(); + delete GC; +#endif + mvm::jit::protectEngine->lock(); + mvm::jit::executionEngine->removeModuleProvider(TheModuleProvider); + mvm::jit::protectEngine->unlock(); + delete globalRefsLock; + delete protectModule; + delete TheModuleProvider; + delete module; +} Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=49720&r1=49719&r2=49720&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Tue Apr 15 05:22:21 2008 @@ -22,7 +22,11 @@ #include "types.h" +#ifdef MULTIPLE_GC +#define vm_new(vm, cl) collector_new(cl, vm->GC) +#else #define vm_new(vm, cl) gc_new(cl) +#endif namespace jnjvm { @@ -218,6 +222,8 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("Jnjvm<>"); } + + virtual void destroyer(); void addProperty(char* key, char* value); @@ -249,6 +255,9 @@ DelegateeMap* delegatees; #endif +#ifdef MULTIPLE_GC + Collector* GC; +#endif mvm::Lock* protectModule; llvm::Module* module; From ggreif at gmail.com Tue Apr 15 05:40:30 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 10:40:30 -0000 Subject: [llvm-commits] [llvm] r49721 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804151040.m3FAeWKS021169@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 05:40:18 2008 New Revision: 49721 URL: http://llvm.org/viewvc/llvm-project?rev=49721&view=rev Log: send verbose output to stderr Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49721&r1=49720&r2=49721&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Tue Apr 15 05:40:18 2008 @@ -133,7 +133,7 @@ puts $makeFileId "\t echo proc xfail { msg } { puts '\"XFAIL: \$\$msg\"' }; \\" puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\" puts $makeFileId "\t echo proc xpass { msg } { puts '\"XPASS: \$\$msg\"' '; exit 1' }; \\" - puts $makeFileId "\t echo proc verbose { msg level } { puts '\"\$\$msg\"' }; \\" + puts $makeFileId "\t echo proc verbose { msg level } { puts stderr '\"\$\$msg\"' }; \\" puts $makeFileId "\t echo set subdir \$(SUBDIR); \\" puts $makeFileId "\t echo run_one_test \$<) | \\" puts $makeFileId "\t (ulimit -t 600; \\" From nicolas.geoffray at lip6.fr Tue Apr 15 05:53:36 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 15 Apr 2008 10:53:36 -0000 Subject: [llvm-commits] [vmkit] r49722 - in /vmkit/trunk/lib/N3/VMCore: BackTrace.cpp CLIJit.cpp N3.cpp PNetLib.cpp Message-ID: <200804151053.m3FArbCE021543@zion.cs.uiuc.edu> Author: geoffray Date: Tue Apr 15 05:53:25 2008 New Revision: 49722 URL: http://llvm.org/viewvc/llvm-project?rev=49722&view=rev Log: Cooperate with multiple GCs. Modified: vmkit/trunk/lib/N3/VMCore/BackTrace.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/PNetLib.cpp Modified: vmkit/trunk/lib/N3/VMCore/BackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/BackTrace.cpp?rev=49722&r1=49721&r2=49722&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/BackTrace.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/BackTrace.cpp Tue Apr 15 05:53:25 2008 @@ -35,7 +35,11 @@ int real_size = backtrace((void**)(void*)ips, 100); int n = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = @@ -72,7 +76,11 @@ int n = 0; int i = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = @@ -102,7 +110,11 @@ int n = 0; int i = 0; while (n < real_size) { +#ifdef MULTIPLE_GC + int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); +#else int *begIp = (int*)Collector::begOf(ips[n++]); +#endif if (begIp) { unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); const llvm::GlobalValue * glob = Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=49722&r1=49721&r2=49722&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Apr 15 05:53:25 2008 @@ -1443,7 +1443,11 @@ extern "C" bool isInCode(void* value) { +#ifdef MULTIPLE_GC + mvm::Object* obj = (mvm::Object*)mvm::Thread::get()->GC->begOf(value); +#else mvm::Object* obj = (mvm::Object*)Collector::begOf(value); +#endif if (obj && obj->getVirtualTable() == mvm::Code::VT) { return true; } else { Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=49722&r1=49721&r2=49722&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Tue Apr 15 05:53:25 2008 @@ -11,6 +11,8 @@ #include "llvm/Module.h" #include "llvm/Support/CommandLine.h" +#include "mvm/JIT.h" + #include "types.h" #include "Assembly.h" #include "CLIJit.h" @@ -56,6 +58,10 @@ N3* N3::allocateBootstrap() { N3 *vm= gc_new(N3)(); + +#ifdef MULTIPLE_GC + Collector* GC = Collector::allocate(); +#endif vm->module = new llvm::Module("Bootstrap N3"); vm->protectModule = mvm::Lock::allocNormal(); @@ -63,9 +69,13 @@ vm->TheModuleProvider = new N3ModuleProvider(vm->module, vm->functions); CLIJit::initialiseBootstrapVM(vm); - vm->bootstrapThread = VMThread::allocate(0, vm); +#ifdef MULTIPLE_GC + vm->bootstrapThread->GC = GC; + mvm::jit::memoryManager->addGCForModule(vm->module, GC); +#endif VMThread::threadKey->set(vm->bootstrapThread); + vm->name = "bootstrapN3"; vm->hashUTF8 = UTF8Map::allocate(); vm->hashStr = StringMap::allocate(); @@ -79,6 +89,10 @@ N3* N3::allocate(char* name, N3* parent) { N3 *vm= gc_new(N3)(); +#ifdef MULTIPLE_GC + Collector* GC = Collector::allocate(); +#endif + vm->module = new llvm::Module("App Domain"); vm->protectModule = mvm::Lock::allocNormal(); vm->functions = FunctionMap::allocate(); @@ -86,7 +100,12 @@ CLIJit::initialiseAppDomain(vm); vm->bootstrapThread = VMThread::allocate(0, vm); +#ifdef MULTIPLE_GC + vm->bootstrapThread->GC = GC; + mvm::jit::memoryManager->addGCForModule(vm->module, GC); +#endif VMThread::threadKey->set(vm->bootstrapThread); + vm->threadSystem = ThreadSystem::allocateThreadSystem(); vm->name = name; vm->hashUTF8 = parent->hashUTF8; @@ -96,7 +115,6 @@ vm->coreAssembly = parent->coreAssembly; vm->loadedAssemblies->hash(parent->coreAssembly->name, parent->coreAssembly); - return vm; } Modified: vmkit/trunk/lib/N3/VMCore/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/PNetLib.cpp?rev=49722&r1=49721&r2=49722&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/PNetLib.cpp Tue Apr 15 05:53:25 2008 @@ -1021,13 +1021,7 @@ return vm->UTF8ToStr(res); } -// LLVM Bug -#if defined (__PPC__) && !defined (__MACH__) -extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint32 position1, uint32 position2, ArrayUInt8* buffer, uint32 offset, uint32 count) { - uint64 position = position1 << 32 + position2; -#else extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint64 position, ArrayUInt8* buffer, uint32 offset, uint32 count) { -#endif uint32 resRva = assembly->resRva; ArrayUInt8* bytes = assembly->bytes; Section* textSection = assembly->textSection; @@ -1146,7 +1140,11 @@ } extern "C" void System_GC_Collect() { +#ifdef MULTIPLE_GC + mvm::Thread::get()->GC->collect(); +#else Collector::collect(); +#endif } From ggreif at gmail.com Tue Apr 15 06:47:32 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 11:47:32 -0000 Subject: [llvm-commits] [llvm] r49723 - /llvm/branches/ggreif/use-diet/include/llvm/User.h Message-ID: <200804151147.m3FBlWP3023193@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 06:47:32 2008 New Revision: 49723 URL: http://llvm.org/viewvc/llvm-project?rev=49723&view=rev Log: do not manipulate the End iterator, but the one in front of it Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49723&r1=49722&r2=49723&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 06:47:32 2008 @@ -338,8 +338,8 @@ AugmentedUse(); // not implemented }; Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); - AugmentedUse *End = static_cast(Begin + N); - End->ref = addTag(this, tagOne); + Use *End = Begin + N; + static_cast(End[-1]).ref = addTag(this, tagOne); Use::initTags(Begin, End); return Begin; } From ggreif at gmail.com Tue Apr 15 06:48:30 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 11:48:30 -0000 Subject: [llvm-commits] [llvm] r49724 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804151148.m3FBmVxN023224@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 06:48:30 2008 New Revision: 49724 URL: http://llvm.org/viewvc/llvm-project?rev=49724&view=rev Log: cleanups and prettier ABOUT TO RUN messages Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49724&r1=49723&r2=49724&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Tue Apr 15 06:48:30 2008 @@ -139,7 +139,6 @@ puts $makeFileId "\t (ulimit -t 600; \\" puts $makeFileId "\t ulimit -d 512000; \\" puts $makeFileId "\t PATH=\"\$(LLVMToolDir):\$(LLVM_SRC_ROOT)/test/Scripts:\$(PATH)\" \$(TCLSH)) > \$@ || \$(REPORTFAIL)" -# puts $makeFileId "\t@ \$(DONE)" puts $makeFileId "" puts $makeFileId "" puts $makeFileId "TESTS = \\" @@ -150,9 +149,7 @@ puts $makeFileId "" puts $makeFileId "Test.makefile.out: \$(TESTS)" -# puts $makeFileId "\t@ printf '\\n---- testing $subdir ---\\n'" puts $makeFileId "\t@ cat \$(TESTS) > \$@" -# puts $makeFileId "\t@ touch \$@" puts $makeFileId "" close $makeFileId @@ -166,12 +163,12 @@ # This procedure runs just one test from the test_source_files array. proc run_one_test { test } { - global target_triplet llvmgcc_version + global target_triplet llvmgcc_version subdir #Should figure out best way to set the timeout #set timeout 40 set filename [file tail $test] - verbose "ABOUT TO RUN: $filename" 2 + verbose "ABOUT TO RUN: [file join $subdir $filename]" 2 set outcome PASS set tmpFile "$filename.tmp" From ggreif at gmail.com Tue Apr 15 07:03:38 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 12:03:38 -0000 Subject: [llvm-commits] [llvm] r49725 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804151203.m3FC3ccu023630@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 07:03:38 2008 New Revision: 49725 URL: http://llvm.org/viewvc/llvm-project?rev=49725&view=rev Log: make verbosity controllable Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49725&r1=49724&r2=49725&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Tue Apr 15 07:03:38 2008 @@ -81,7 +81,7 @@ # This procedure runs the set of tests for the test_source_files array. proc RunLLVMTests { test_source_files } { - global srcroot objroot srcdir objdir subdir + global srcroot objroot srcdir objdir subdir verbose if 0==[llength $test_source_files] { verbose "NOTE: test suite without tests: $subdir" 1 @@ -133,7 +133,11 @@ puts $makeFileId "\t echo proc xfail { msg } { puts '\"XFAIL: \$\$msg\"' }; \\" puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\" puts $makeFileId "\t echo proc xpass { msg } { puts '\"XPASS: \$\$msg\"' '; exit 1' }; \\" - puts $makeFileId "\t echo proc verbose { msg level } { puts stderr '\"\$\$msg\"' }; \\" + if $verbose>=2 { + puts $makeFileId "\t echo proc verbose { msg level } { puts stderr '\"\$\$msg\"' }; \\" + } else { + puts $makeFileId "\t echo proc verbose { msg level } { }; \\" + } puts $makeFileId "\t echo set subdir \$(SUBDIR); \\" puts $makeFileId "\t echo run_one_test \$<) | \\" puts $makeFileId "\t (ulimit -t 600; \\" From nicolas.geoffray at lip6.fr Tue Apr 15 08:01:06 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 15 Apr 2008 15:01:06 +0200 Subject: [llvm-commits] JIT memory manager: Correlate stubs with functions Message-ID: <4804A712.4070308@lip6.fr> Hi everyone, The attached patch adds a new Function parameter to startFunctionStub, which is the function that the generated stub will call. The motivation behind is that a custom JITMemoryManager may want to allocate stubs and functions on a per-module basis. For example Module A is given a 20MB, Module B is given 10MB, etc. And if a function from A calls a function from B, and a stub is generated, it should be allocated on behalf of B. OK to commit? Thx, Nicolas -------------- next part -------------- A non-text attachment was scrubbed... Name: function-stub.patch Type: text/x-patch Size: 20170 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080415/85014ac2/attachment.bin From ggreif at gmail.com Tue Apr 15 08:14:38 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 13:14:38 -0000 Subject: [llvm-commits] [llvm] r49726 - in /llvm/branches/ggreif/use-diet: include/llvm/Use.h include/llvm/User.h lib/VMCore/Use.cpp Message-ID: <200804151314.m3FDEcFR026303@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 08:14:38 2008 New Revision: 49726 URL: http://llvm.org/viewvc/llvm-project?rev=49726&view=rev Log: * move tagging functions to Use.h * add extractTag and transferTag * un-inline User::allocHungoffUses * prettify overall Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/include/llvm/User.h llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49726&r1=49725&r2=49726&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Tue Apr 15 08:14:38 2008 @@ -26,6 +26,40 @@ //===----------------------------------------------------------------------===// +// Generic Tagging Functions +//===----------------------------------------------------------------------===// + +/// Tag - generic tag type for (at least 32 bit) pointers +enum Tag { noTag, tagOne, tagTwo, tagThree }; + +/// addTag - insert tag bits into an (untagged) pointer +template +inline T *addTag(const T *P, TAG Tag) { + return reinterpret_cast(ptrdiff_t(P) | Tag); +} + +/// stripTag - remove tag bits from a pointer, +/// making it dereferencable +template +inline T *stripTag(const T *P) { + return reinterpret_cast(ptrdiff_t(P) & ~MASK); +} + +/// extractTag - extract tag bits from a pointer +template +inline TAG extractTag(const T *P) { + return TAG(ptrdiff_t(P) & MASK); +} + +/// transferTag - transfer tag bits from a pointer, +/// to an untagged pointer +template +inline T *transferTag(const T *From, const T *To) { + return reinterpret_cast((ptrdiff_t(From) & MASK) | ptrdiff_t(To)); +} + + +//===----------------------------------------------------------------------===// // Use Class //===----------------------------------------------------------------------===// @@ -50,8 +84,12 @@ /// Default ctor - This leaves the Use completely uninitialized. The only thing /// that is valid to do with this use is to call the "init" method. -private: inline Use() {} + enum ValuePtrTag { zeroDigitTag = noTag + , oneDigitTag = tagOne + , stopTag = tagTwo + , fullStopTag = tagThree }; + public: @@ -59,7 +97,7 @@ Value *get() const { return stripTag(Val); } User *getUser() const; const Use* getImpliedUser() const; - static void initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0); + static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0); static void zap(Use *Start, const Use *Stop, bool del = false); inline void set(Value *Val); @@ -83,10 +121,10 @@ Value *Val; static Value *stripTag(Value *V) { - return reinterpret_cast(reinterpret_cast(V) & ~3UL); + return llvm::stripTag(V); } Value *transferTag(Value *V) { - return reinterpret_cast(reinterpret_cast(V) | (reinterpret_cast(Val) & 3UL)); + return llvm::transferTag(Val, V); } void addToList(Use **List) { Next = *List; Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49726&r1=49725&r2=49726&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 08:14:38 2008 @@ -196,6 +196,7 @@ class User; +/// OperandTraits - specialization to User template <> struct OperandTraits { static inline Use *op_begin(User*); @@ -216,9 +217,9 @@ protected: /// OperandList - This is a pointer to the array of Users for this operand. /// For nodes of fixed arity (e.g. a binary operator) this array will live - /// embedded into the derived class. For nodes of variable arity - /// (e.g. ConstantArrays, CallInst, PHINodes, ReturnInst etc.), this memory - /// will be dynamically allocated and should be destroyed by the classes' + /// prefixed to the derived class. For nodes of resizable variable arity + /// (e.g. PHINodes, SwitchInst etc.), this memory will be dynamically + /// allocated and should be destroyed by the classes' /// virtual dtor. Use *OperandList; @@ -256,7 +257,7 @@ template const Use &Op() const { return OperandTraits::op_begin(const_cast(this))[Idx]; } - inline Use *allocHungoffUses(unsigned) const; + Use *allocHungoffUses(unsigned) const; void dropHungoffUses(Use *U) { Use::zap(U, U->getImpliedUser(), true); } @@ -320,30 +321,6 @@ return U->getNumOperands(); } -enum Tag { noTag, tagOne, tagTwo, tagThree }; - -template -inline T *addTag(const T *P, TAG Tag) { - return reinterpret_cast(ptrdiff_t(P) | Tag); -} - -template -inline T *stripTag(const T *P) { - return reinterpret_cast(ptrdiff_t(P) & ~MASK); -} - -Use *User::allocHungoffUses(unsigned N) const { - struct AugmentedUse : Use { - User *ref; - AugmentedUse(); // not implemented - }; - Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); - Use *End = Begin + N; - static_cast(End[-1]).ref = addTag(this, tagOne); - Use::initTags(Begin, End); - return Begin; -} - template<> struct simplify_type { typedef Value* SimpleType; Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49726&r1=49725&r2=49726&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Tue Apr 15 08:14:38 2008 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Value.h" +#include "llvm/User.h" namespace llvm { @@ -19,15 +20,13 @@ // Use getImpliedUser Implementation //===----------------------------------------------------------------------===// -enum ValuePtrTag { zeroDigitTag = 0, oneDigitTag = 1, stopTag = 0x2, fullStopTag = 0x3 }; - const Use *Use::getImpliedUser() const { bool StopEncountered = false; ptrdiff_t Offset = 1; const Use *Current = this; while (true) { - unsigned Tag = unsigned(Current->Val) & 0x3; + unsigned Tag = extractTag(Current->Val); switch (Tag) { case zeroDigitTag: @@ -53,7 +52,7 @@ // Use initTags Implementation //===----------------------------------------------------------------------===// -void Use::initTags(Use *Start, Use *Stop, ptrdiff_t Done) { +Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) { ptrdiff_t Count = 0; while (Start != Stop) { @@ -69,6 +68,8 @@ ++Done; } } + + return Start; } //===----------------------------------------------------------------------===// @@ -85,19 +86,39 @@ } //===----------------------------------------------------------------------===// +// AugmentedUse layout struct +//===----------------------------------------------------------------------===// + +struct AugmentedUse : Use { + User *ref; + AugmentedUse(); // not implemented +}; + + +//===----------------------------------------------------------------------===// // Use getUser Implementation //===----------------------------------------------------------------------===// User *Use::getUser() const { const Use* End = getImpliedUser(); - User *She = End->U; - if (ptrdiff_t(She) & 1UL) - She = (User*)(ptrdiff_t(She) & ~1UL); - else - She = (User*)End; + User *She = static_cast(End - 1)->ref; + She = extractTag(She) + ? llvm::stripTag(She) + : reinterpret_cast(const_cast(End)); assert((!U || U == She) && "Implicit User differs?"); return She; } +//===----------------------------------------------------------------------===// +// User allocHungoffUses Implementation +//===----------------------------------------------------------------------===// + +Use *User::allocHungoffUses(unsigned N) const { + Use *Begin = static_cast(::operator new(sizeof(Use) * N + sizeof(AugmentedUse) - sizeof(Use))); + Use *End = Begin + N; + static_cast(End[-1]).ref = addTag(this, tagOne); + return Use::initTags(Begin, End); +} + } // End llvm namespace From ggreif at gmail.com Tue Apr 15 11:58:42 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 16:58:42 -0000 Subject: [llvm-commits] [llvm] r49728 - /llvm/branches/ggreif/use-diet/include/llvm/User.h Message-ID: <200804151658.m3FGwg0K000833@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 11:58:41 2008 New Revision: 49728 URL: http://llvm.org/viewvc/llvm-project?rev=49728&view=rev Log: when dropping hung-off Uses, be careful really dropping the last reference to the block Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49728&r1=49727&r2=49728&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 15 11:58:41 2008 @@ -259,6 +259,10 @@ } Use *allocHungoffUses(unsigned) const; void dropHungoffUses(Use *U) { + if (OperandList == U) { + OperandList = 0; + NumOperands = 0; + } Use::zap(U, U->getImpliedUser(), true); } From sabre at nondot.org Tue Apr 15 11:59:22 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 15 Apr 2008 16:59:22 -0000 Subject: [llvm-commits] [llvm] r49729 - in /llvm/trunk/docs/tutorial: LangImpl3.html LangImpl4.html Message-ID: <200804151659.m3FGxMAd000862@zion.cs.uiuc.edu> Author: lattner Date: Tue Apr 15 11:59:22 2008 New Revision: 49729 URL: http://llvm.org/viewvc/llvm-project?rev=49729&view=rev Log: A couple minor fixes suggested by Matthijs Kooijman Modified: llvm/trunk/docs/tutorial/LangImpl3.html llvm/trunk/docs/tutorial/LangImpl4.html Modified: llvm/trunk/docs/tutorial/LangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=49729&r1=49728&r2=49729&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl3.html (original) +++ llvm/trunk/docs/tutorial/LangImpl3.html Tue Apr 15 11:59:22 2008 @@ -327,7 +327,7 @@

The final line above actually creates the function that the prototype will correspond to. This indicates the type, linkage and name to use, as well as which -module to insert into. "external linkage" +module to insert into. "external linkage" means that the function may be defined outside the current module and/or that it is callable by functions outside the module. The Name passed in is the name the user specified: since "TheModule" is specified, this name is registered Modified: llvm/trunk/docs/tutorial/LangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=49729&r1=49728&r2=49729&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl4.html (original) +++ llvm/trunk/docs/tutorial/LangImpl4.html Tue Apr 15 11:59:22 2008 @@ -123,7 +123,7 @@

In this case, the LHS and RHS of the multiplication are the same value. We'd really like to see this generate "tmp = x+3; result = tmp*tmp;" instead -of computing "x*3" twice.

+of computing "x+3" twice.

Unfortunately, no amount of local analysis will be able to detect and correct this. This requires two transformations: reassociation of expressions (to From gohman at apple.com Tue Apr 15 12:27:05 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 17:27:05 -0000 Subject: [llvm-commits] [llvm] r49730 - /llvm/trunk/lib/Support/GraphWriter.cpp Message-ID: <200804151727.m3FHR5O1001734@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 12:27:05 2008 New Revision: 49730 URL: http://llvm.org/viewvc/llvm-project?rev=49730&view=rev Log: Use gv's --spartan option, which trades away an extra row of UI buttons for more space for displaying the graph. Modified: llvm/trunk/lib/Support/GraphWriter.cpp Modified: llvm/trunk/lib/Support/GraphWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/GraphWriter.cpp?rev=49730&r1=49729&r2=49730&view=diff ============================================================================== --- llvm/trunk/lib/Support/GraphWriter.cpp (original) +++ llvm/trunk/lib/Support/GraphWriter.cpp Tue Apr 15 12:27:05 2008 @@ -57,6 +57,7 @@ sys::Path gv(LLVM_PATH_GV); args.clear(); args.push_back(gv.c_str()); + args.push_back("--spartan"); args.push_back(PSFilename.c_str()); args.push_back(0); From dalej at apple.com Tue Apr 15 12:41:34 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Apr 2008 17:41:34 -0000 Subject: [llvm-commits] [llvm] r49731 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2008-04-15-Byval.ll Message-ID: <200804151741.m3FHfY3m002240@zion.cs.uiuc.edu> Author: johannes Date: Tue Apr 15 12:41:34 2008 New Revision: 49731 URL: http://llvm.org/viewvc/llvm-project?rev=49731&view=rev Log: Don't assume a tail call can't reference a byval argument to the outer function, this isn't correct. Added: llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=49731&r1=49730&r2=49731&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Apr 15 12:41:34 2008 @@ -273,8 +273,10 @@ // If this is a tail call and P points to a stack location, we know that // the tail call cannot access or modify the local stack. - if (isa(Object) || - (isa(Object) && cast(Object)->hasByValAttr())) + // We cannot exclude byval arguments here; these belong to the caller of + // the current function not to the current function, and a tail callee + // may reference them. + if (isa(Object)) if (CallInst *CI = dyn_cast(CS.getInstruction())) if (CI->isTailCall()) return NoModRef; Added: llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll?rev=49731&view=auto ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll (added) +++ llvm/trunk/test/Analysis/BasicAA/2008-04-15-Byval.ll Tue Apr 15 12:41:34 2008 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep store +; ModuleID = 'small2.c' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin8" + %struct.x = type { [4 x i32] } + +define void @foo(%struct.x* byval align 4 %X) nounwind { +entry: + %tmp = getelementptr %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1] + %tmp1 = getelementptr [4 x i32]* %tmp, i32 0, i32 3 ; [#uses=1] + store i32 2, i32* %tmp1, align 4 + %tmp2 = call i32 (...)* @bar( %struct.x* byval align 4 %X ) nounwind ; [#uses=0] + br label %return +return: ; preds = %entry + ret void +} + +declare i32 @bar(...) From dpatel at apple.com Tue Apr 15 13:11:08 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 18:11:08 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49732 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804151811.m3FIB8BF003051@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 13:11:07 2008 New Revision: 49732 URL: http://llvm.org/viewvc/llvm-project?rev=49732&view=rev Log: Refactor code. No expected change in behavior. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49732&r1=49731&r2=49732&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 Apr 15 13:11:07 2008 @@ -744,6 +744,32 @@ return llvm_x86_64_should_pass_aggregate_in_memory(TreeType, Mode); } +/* llvm_x86_64_type_needs_multiple_regs - Return number of register classes + need by TREETYPE. Return 0 if TREETYPE does not need multiple registers. + This helper routine is used to determine LLVM type of the function + arguments as well as return values. */ +static int +llvm_x86_64_type_needs_multiple_regs(enum machine_mode Mode, tree TreeType, + enum x86_64_reg_class Class[MAX_CLASSES]) { + int NumClasses = ix86_ClassifyArgument(Mode, TreeType, Class, 0); + if (!NumClasses) + return 0; + + for (int i = 0; i < NumClasses; ++i) { + switch (Class[i]) { + case X86_64_X87_CLASS: + case X86_64_X87UP_CLASS: + case X86_64_COMPLEX_X87_CLASS: + return 0; + case X86_64_NO_CLASS: + return 0; + default: + break; + } + } + return NumClasses; +} + /* Target hook for llvm-abi.h. It returns true if an aggregate of the specified type should be passed in a number of registers of mixed types. It also returns a vector of types that correspond to the registers used @@ -755,7 +781,7 @@ enum machine_mode Mode = ix86_getNaturalModeForType(TreeType); HOST_WIDE_INT Bytes = (Mode == BLKmode) ? int_size_in_bytes(TreeType) : (int) GET_MODE_SIZE(Mode); - int NumClasses = ix86_ClassifyArgument(Mode, TreeType, Class, 0); + int NumClasses = llvm_x86_64_type_needs_multiple_regs(Mode, TreeType, Class); if (!NumClasses) return false; From dpatel at apple.com Tue Apr 15 13:29:46 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 18:29:46 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49733 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h Message-ID: <200804151829.m3FITknQ003652@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 13:29:45 2008 New Revision: 49733 URL: http://llvm.org/viewvc/llvm-project?rev=49733&view=rev Log: Using gcc's tree type node is handy. It allows target specific code to take advantage of existing gcc helper functions. 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=49733&r1=49732&r2=49733&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 Tue Apr 15 13:29:45 2008 @@ -105,14 +105,14 @@ #define LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(X) \ llvm_x86_scalar_type_for_struct_return(X) -extern const Type *llvm_x86_scalar_type_for_struct_return(const Type *Ty); +extern const Type *llvm_x86_scalar_type_for_struct_return(tree type); /* LLVM_AGGR_TYPE_FOR_STRUCT_RETURN - Return LLVM Type if X can be returned as an aggregate, otherwise return NULL. */ #define LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(X) \ llvm_x86_aggr_type_for_struct_return(X) -extern const Type *llvm_x86_aggr_type_for_struct_return(const Type *Ty); +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. */ 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=49733&r1=49732&r2=49733&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 Apr 15 13:29:45 2008 @@ -957,10 +957,10 @@ return true; } -// llvm_x86_scalar_type_for_struct_return - Return LLVM type if TY +// llvm_x86_scalar_type_for_struct_return - Return LLVM type if TYPE // can be returned as a scalar, otherwise return NULL. -const Type *llvm_x86_scalar_type_for_struct_return(const Type *Ty) { - +const Type *llvm_x86_scalar_type_for_struct_return(tree type) { + const Type *Ty = ConvertType(type); unsigned Size = getTargetData().getABITypeSize(Ty); if (Size == 0) return Type::VoidTy; @@ -985,9 +985,9 @@ return NULL; } -// Return LLVM Type if TY can be returned as an aggregate, otherwise return NULL. -const Type *llvm_x86_aggr_type_for_struct_return(const Type *Ty) { - +// Return LLVM Type if TYPE can be returned as an aggregate, otherwise return NULL. +const Type *llvm_x86_aggr_type_for_struct_return(tree type) { + const Type *Ty = ConvertType(type); if (!llvm_suitable_multiple_ret_value_type(Ty)) return NULL; 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=49733&r1=49732&r2=49733&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Tue Apr 15 13:29:45 2008 @@ -183,8 +183,8 @@ // getLLVMScalarTypeForStructReturn - Return LLVM Type if TY can be // returned as a scalar, otherwise return NULL. This is the default // target independent implementation. -static const Type* getLLVMScalarTypeForStructReturn(const Type *Ty) { - +static const Type* getLLVMScalarTypeForStructReturn(tree type) { + const Type *Ty = ConvertType(type); unsigned Size = getTargetData().getABITypeSize(Ty); if (Size == 0) return Type::VoidTy; @@ -207,7 +207,7 @@ // getLLVMAggregateTypeForStructReturn - Return LLVM type if TY can be // returns as multiple values, otherwise return NULL. This is the default // target indepdendent implementation. -static const Type* getLLVMAggregateTypeForStructReturn(const Type *Ty) { +static const Type* getLLVMAggregateTypeForStructReturn(tree type) { return NULL; } @@ -366,9 +366,9 @@ } else { // Otherwise return as an integer value large enough to hold the entire // aggregate. - if (const Type* ScalarTy = LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(Ty)) + if (const Type* ScalarTy = LLVM_SCALAR_TYPE_FOR_STRUCT_RETURN(type)) C.HandleAggregateResultAsScalar(ScalarTy); - else if (const Type *AggrTy = LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(Ty)) + else if (const Type *AggrTy = LLVM_AGGR_TYPE_FOR_STRUCT_RETURN(type)) C.HandleAggregateResultAsAggregate(AggrTy); else { assert(0 && "Unable to determine how to return this aggregate!"); From dalej at apple.com Tue Apr 15 13:44:59 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Apr 2008 18:44:59 -0000 Subject: [llvm-commits] [llvm] r49736 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200804151844.m3FIixks004092@zion.cs.uiuc.edu> Author: johannes Date: Tue Apr 15 13:44:59 2008 New Revision: 49736 URL: http://llvm.org/viewvc/llvm-project?rev=49736&view=rev Log: Make 64-to-32 bit truncations explicit (prevent warnings). All values here fit in 32 bits. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49736&r1=49735&r2=49736&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Apr 15 13:44:59 2008 @@ -1766,7 +1766,8 @@ void setNest() { Flags |= One << NestOffs; } unsigned getByValAlign() const { - return (One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2; + return (unsigned) + ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2); } void setByValAlign(unsigned A) { Flags = (Flags & ~ByValAlign) | @@ -1777,7 +1778,8 @@ void setSplit() { Flags |= One << SplitOffs; } unsigned getOrigAlign() const { - return (One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2; + return (unsigned) + ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2); } void setOrigAlign(unsigned A) { Flags = (Flags & ~OrigAlign) | @@ -1785,7 +1787,7 @@ } unsigned getByValSize() const { - return (Flags & ByValSize) >> ByValSizeOffs; + return (unsigned)((Flags & ByValSize) >> ByValSizeOffs); } void setByValSize(unsigned S) { Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs); From isanbard at gmail.com Tue Apr 15 14:59:41 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Apr 2008 19:59:41 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49737 - /llvm-gcc-4.2/trunk/build_gcc Message-ID: <200804151959.m3FJxfsT006235@zion.cs.uiuc.edu> Author: void Date: Tue Apr 15 14:59:41 2008 New Revision: 49737 URL: http://llvm.org/viewvc/llvm-project?rev=49737&view=rev Log: Remove dead variable. Modified: llvm-gcc-4.2/trunk/build_gcc Modified: llvm-gcc-4.2/trunk/build_gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build_gcc?rev=49737&r1=49736&r2=49737&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build_gcc (original) +++ llvm-gcc-4.2/trunk/build_gcc Tue Apr 15 14:59:41 2008 @@ -84,12 +84,6 @@ # LLVM_BIN_DIR - This is the place where llvm-gcc/llvm-g++ symlinks get installed. LLVM_BIN_DIR=$DEST_ROOT/../bin -# LLVM_ARCHS - This tells us which architectures we'd like the libraries to be -# build for. The default is 4-way. -if [ "x$LLVM_ARCHS" == "x" ]; then - LLVM_ARCHS="ppc i386 ppc64 x86_64" -fi - # LLVM LOCAL end # The current working directory is where the build will happen. From ggreif at gmail.com Tue Apr 15 15:58:01 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 20:58:01 -0000 Subject: [llvm-commits] [llvm] r49739 - in /llvm/branches/ggreif/use-diet: include/llvm/Instructions.h lib/VMCore/Instructions.cpp Message-ID: <200804152058.m3FKw183007985@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 15:58:01 2008 New Revision: 49739 URL: http://llvm.org/viewvc/llvm-project?rev=49739&view=rev Log: make sure that SwitchInst's operands are always hung off Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49739&r1=49738&r2=49739&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Tue Apr 15 15:58:01 2008 @@ -1754,6 +1754,7 @@ /// SwitchInst - Multiway switch /// class SwitchInst : public TerminatorInst { + void *operator new(size_t, unsigned); // DO NOT IMPLEMENT unsigned ReservedSpace; // Operand[0] = Value to switch on // Operand[1] = Default basic block destination @@ -1762,6 +1763,10 @@ SwitchInst(const SwitchInst &RI); void init(Value *Value, BasicBlock *Default, unsigned NumCases); void resizeOperands(unsigned No); + // allocate space for exactly zero operands + void *operator new(size_t s) { + return User::operator new(s, 0); + } /// SwitchInst ctor - Create a new switch instruction, specifying a value to /// switch on and a default destination. The number of additional cases can /// be specified here to make memory allocation more efficient. This Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=49739&r1=49738&r2=49739&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Tue Apr 15 15:58:01 2008 @@ -2843,7 +2843,7 @@ PHINode *PHINode::clone() const { return new PHINode(*this); } ReturnInst *ReturnInst::clone() const { return new(getNumOperands()) ReturnInst(*this); } BranchInst *BranchInst::clone() const { return new(getNumOperands()) BranchInst(*this); } -SwitchInst *SwitchInst::clone() const { return new(getNumOperands()) SwitchInst(*this); } +SwitchInst *SwitchInst::clone() const { return new SwitchInst(*this); } InvokeInst *InvokeInst::clone() const { return new(getNumOperands()) InvokeInst(*this); } UnwindInst *UnwindInst::clone() const { return new UnwindInst(); } UnreachableInst *UnreachableInst::clone() const { return new UnreachableInst();} From ggreif at gmail.com Tue Apr 15 16:08:42 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 21:08:42 -0000 Subject: [llvm-commits] [llvm] r49740 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804152108.m3FL8g4b008282@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 16:08:42 2008 New Revision: 49740 URL: http://llvm.org/viewvc/llvm-project?rev=49740&view=rev Log: ooops, fix linker error Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49740&r1=49739&r2=49740&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Tue Apr 15 16:08:42 2008 @@ -1783,11 +1783,11 @@ public: static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases, Instruction *InsertBefore = 0) { - return new(0) SwitchInst(Value, Default, NumCases, InsertBefore); + return new SwitchInst(Value, Default, NumCases, InsertBefore); } static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases, BasicBlock *InsertAtEnd) { - return new(0) SwitchInst(Value, Default, NumCases, InsertAtEnd); + return new SwitchInst(Value, Default, NumCases, InsertAtEnd); } ~SwitchInst(); From dpatel at apple.com Tue Apr 15 16:19:38 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 21:19:38 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49741 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804152119.m3FLJco6008622@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 16:19:37 2008 New Revision: 49741 URL: http://llvm.org/viewvc/llvm-project?rev=49741&view=rev Log: Piggyback gcc's ix86_ClassifyArgument() Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49741&r1=49740&r2=49741&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 Apr 15 16:19:37 2008 @@ -923,8 +923,9 @@ // llvm_suitable_multiple_ret_value_type - Return TRUE if return value // of type TY should be returned using multiple value return instruction. -static bool llvm_suitable_multiple_ret_value_type(const Type *Ty) { - +static bool llvm_suitable_multiple_ret_value_type(const Type *Ty, + tree TreeType, + std::vector&Elts) { //NOTE: Work in progress. Do not open the flood gate yet. return false; @@ -934,27 +935,28 @@ const StructType *STy = dyn_cast(Ty); if (!STy) return false; - - unsigned NumElements = STy->getNumElements(); - bool useMultipleReturnVals = true; - for (unsigned i = 0; i < NumElements; ++i) { - const Type *T = STy->getElementType(i); - - if (T->isFirstClassType()) - continue; + //Let gcc specific routine answer the question. + enum x86_64_reg_class Class[MAX_CLASSES]; + enum machine_mode Mode = ix86_getNaturalModeForType(TreeType); + if (llvm_x86_64_type_needs_multiple_regs(Mode, TreeType, Class)) { + + llvm_x86_64_should_pass_aggregate_in_mixed_regs(TreeType, Ty, Elts); + assert (!Elts.empty() && "Unable to handle aggregate return type!"); + // If it is a singleton structure, e.g. { long double ld;} then use the type + // directly. + if (Elts.size() == 1) + return true; - if (const ArrayType *ATy = dyn_cast(T)) { - // Allow { float f[4]; } but block { float f[10]; } or { char c[4]; } - // FIXME :Double check '5'. - if (ATy->getElementType()->isFloatingPoint() - && ATy->getNumElements() < 5) - continue; - } - return false; + bool foundFloat = false; + for (unsigned i = 0; i < Elts.size(); ++i) + if (Elts[i]->isFloatingPoint()) + foundFloat = true; + + return foundFloat; } - - return true; + + return false; } // llvm_x86_scalar_type_for_struct_return - Return LLVM type if TYPE @@ -972,8 +974,12 @@ return Type::Int32Ty; // Check if Ty should be returned using multiple value return instruction. - if (llvm_suitable_multiple_ret_value_type(Ty)) + std::vectorElts; + if (llvm_suitable_multiple_ret_value_type(Ty, type, Elts)) { + if (Elts.size() == 1) + return Elts[0]; return NULL; + } if (Size <= 8) return Type::Int64Ty; @@ -988,7 +994,8 @@ // Return LLVM Type if TYPE can be returned as an aggregate, otherwise return NULL. const Type *llvm_x86_aggr_type_for_struct_return(tree type) { const Type *Ty = ConvertType(type); - if (!llvm_suitable_multiple_ret_value_type(Ty)) + std::vectorElts; + if (!llvm_suitable_multiple_ret_value_type(Ty, type, Elts)) return NULL; const StructType *STy = cast(Ty); From cfr at adobe.com Tue Apr 15 16:27:11 2008 From: cfr at adobe.com (Chuck Rose III) Date: Tue, 15 Apr 2008 21:27:11 -0000 Subject: [llvm-commits] [llvm] r49743 - in /llvm/trunk: lib/Transforms/Utils/LowerInvoke.cpp utils/TableGen/RegisterInfoEmitter.cpp win32/Transforms/Transforms.vcproj Message-ID: <200804152127.m3FLRBGV008875@zion.cs.uiuc.edu> Author: cfr Date: Tue Apr 15 16:27:11 2008 New Revision: 49743 URL: http://llvm.org/viewvc/llvm-project?rev=49743&view=rev Log: VisualStudio project files updated. #include added to make VisualStudio happy. Also had to undefine setjmp because of #include turning setjmp into _setjmp in VisualStudio. Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp llvm/trunk/win32/Transforms/Transforms.vcproj Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=49743&r1=49742&r2=49743&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Tue Apr 15 16:27:11 2008 @@ -143,7 +143,22 @@ Constant::getNullValue(PtrJBList), "llvm.sjljeh.jblist", &M); } + +// VisualStudio defines setjmp as _setjmp via #include / , +// so it looks like Intrinsic::_setjmp +#if defined(_MSC_VER) && defined(setjmp) +#define setjmp_undefined_for_visual_studio +#undef setjmp +#endif + SetJmpFn = Intrinsic::getDeclaration(&M, Intrinsic::setjmp); + +#if defined(_MSC_VER) && defined(setjmp_undefined_for_visual_studio) +// let's return it to _setjmp state in case anyone ever needs it after this +// point under VisualStudio +#define setjmp _setjmp +#endif + LongJmpFn = Intrinsic::getDeclaration(&M, Intrinsic::longjmp); } Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=49743&r1=49742&r2=49743&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Tue Apr 15 16:27:11 2008 @@ -21,6 +21,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Streams.h" #include +#include using namespace llvm; // runEnums - Print out enum values for all of the registers. Modified: llvm/trunk/win32/Transforms/Transforms.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/Transforms/Transforms.vcproj?rev=49743&r1=49742&r2=49743&view=diff ============================================================================== --- llvm/trunk/win32/Transforms/Transforms.vcproj (original) +++ llvm/trunk/win32/Transforms/Transforms.vcproj Tue Apr 15 16:27:11 2008 @@ -488,6 +488,10 @@ > + + From isanbard at gmail.com Tue Apr 15 16:33:52 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 15 Apr 2008 21:33:52 -0000 Subject: [llvm-commits] [llvm] r49744 - /llvm/trunk/utils/buildit/build_llvm Message-ID: <200804152133.m3FLXqIp009090@zion.cs.uiuc.edu> Author: void Date: Tue Apr 15 16:33:52 2008 New Revision: 49744 URL: http://llvm.org/viewvc/llvm-project?rev=49744&view=rev Log: Apple GCC 4.2 builds things differently. It no longer spawns a bunch of processes, but requires the project to use -j. Modified: llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=49744&r1=49743&r2=49744&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Tue Apr 15 16:33:52 2008 @@ -95,10 +95,39 @@ LLVM_VERSION="$LLVM_SUBMIT_VERSION-$LLVM_SUBMIT_SUBVERSION" fi -# Note: Don't pass -jN here. Building universal already has parallelism and we -# don't want to make the builders hit swap by firing off too many gcc's at the -# same time. -make $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \ +GCC_VER=`cc --version 2>/dev/null | sed 1q` + +if echo "$GCC_VER" | grep GCC > /dev/null; then + GCC_VER=`echo $GCC_VER | sed -e 's/.*(GCC) \([0-9.][0-9.]*\).*/\1/'` + MAJ_VER=`echo $GCC_VER | sed 's/\..*//'` + MIN_VER=`echo $GCC_VER | sed 's/[^.]*\.\([0-9]*\).*/\1/'` +fi + +JOBS_FLAG="" + +# Note: If compiling with GCC 4.0, don't pass the -jN flag. Building universal +# already has parallelism and we don't want to make the builders hit swap by +# firing off too many gccs at the same time. +if [ "x$MAJ_VER" != "x4" -o "x$MIN_VER" != "x0" ]; then + # Figure out how many make processes to run. + SYSCTL=`sysctl -n hw.activecpu` + + # hw.activecpu only available in 10.2.6 and later + if [ -z "$SYSCTL" ]; then + SYSCTL=`sysctl -n hw.ncpu` + fi + + # sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot. + # Builders can default to 2, since even if they are single processor, + # nothing else is running on the machine. + if [ -z "$SYSCTL" ]; then + SYSCTL=2 + fi + + JOBS_FLAG="-j $SYSCTL" +fi + +make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \ LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \ LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \ CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" From gohman at apple.com Tue Apr 15 17:15:20 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 22:15:20 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49745 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804152215.m3FMFKsE010455@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 17:15:19 2008 New Revision: 49745 URL: http://llvm.org/viewvc/llvm-project?rev=49745&view=rev Log: Lower v1i64 return value to use %rax on x86-64 to match the ABI. Patch by Devang! Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49745&r1=49744&r2=49745&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 Apr 15 17:15:19 2008 @@ -890,7 +890,6 @@ tree llvm_x86_should_return_vector_as_scalar(tree type, bool isBuiltin) { if (TARGET_MACHO && !isBuiltin && - !TARGET_64BIT && TREE_CODE(type) == VECTOR_TYPE && TYPE_SIZE(type) && TREE_CODE(TYPE_SIZE(type))==INTEGER_CST) { From dpatel at apple.com Tue Apr 15 17:18:41 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 22:18:41 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 17:18:40 2008 New Revision: 49746 URL: http://llvm.org/viewvc/llvm-project?rev=49746&view=rev Log: Handle test cases from gcc.target/x86-64/abi/test_struct_return.c Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49746&r1=49745&r2=49746&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 Apr 15 17:18:40 2008 @@ -843,6 +843,15 @@ Elts.push_back(Type::DoubleTy); Elts.push_back(Type::DoubleTy); Bytes -= 16; + } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) { + // struct {float f[2]; double d; } should be returned in SSE registers. + Elts.push_back(Type::DoubleTy); + Elts.push_back(Type::DoubleTy); + } else if (Class[i+1] == X86_64_INTEGER_CLASS) { + // struct { float f[2]; char c; } should be returned in SSE(low) + // and INT (high). + Elts.push_back(VectorType::get(Type::FloatTy, 2)); + Elts.push_back(Type::DoubleTy); } else assert(0 && "Not yet handled!"); ++i; // Already handled the next one. From clattner at apple.com Tue Apr 15 17:37:00 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Apr 2008 15:37:00 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> Message-ID: On Apr 15, 2008, at 3:18 PM, Devang Patel wrote: > Author: dpatel > Date: Tue Apr 15 17:18:40 2008 > New Revision: 49746 > > URL: http://llvm.org/viewvc/llvm-project?rev=49746&view=rev > Log: > Handle test cases from gcc.target/x86-64/abi/test_struct_return.c This looks wrong: > Elts.push_back(Type::DoubleTy); > Bytes -= 16; > + } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) { > + // struct {float f[2]; double d; } should be returned in > SSE registers. > + Elts.push_back(Type::DoubleTy); > + Elts.push_back(Type::DoubleTy); Shouldn't this be <4 x float> [or <2 x float> if that works], double for performance? > + } else if (Class[i+1] == X86_64_INTEGER_CLASS) { > + // struct { float f[2]; char c; } should be returned in > SSE(low) > + // and INT (high). > + Elts.push_back(VectorType::get(Type::FloatTy, 2)); > + Elts.push_back(Type::DoubleTy); The second half should be i64 for correctness, no? -Chris From gohman at apple.com Tue Apr 15 17:40:14 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 22:40:14 -0000 Subject: [llvm-commits] [llvm] r49747 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200804152240.m3FMeEOb011232@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 17:40:14 2008 New Revision: 49747 URL: http://llvm.org/viewvc/llvm-project?rev=49747&view=rev Log: Fix the new scheduler assertion checks to work when the scheduler has inserted no-ops. This fixes the 2006-07-03-schedulers.ll regression on ppc32. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=49747&r1=49746&r2=49747&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Apr 15 17:40:14 2008 @@ -1076,6 +1076,7 @@ // Verify that all SUnits were scheduled. bool AnyNotSched = false; unsigned DeadNodes = 0; + unsigned Noops = 0; for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { if (!SUnits[i].isScheduled) { if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) { @@ -1096,8 +1097,11 @@ AnyNotSched = true; } } + for (unsigned i = 0, e = Sequence.size(); i != e; ++i) + if (!Sequence[i]) + ++Noops; assert(!AnyNotSched); - assert(Sequence.size() + DeadNodes == SUnits.size() && + assert(Sequence.size() + DeadNodes - Noops == SUnits.size() && "The number of nodes scheduled doesn't match the expected number!"); #endif } @@ -1193,6 +1197,7 @@ // Verify that all SUnits were scheduled. bool AnyNotSched = false; unsigned DeadNodes = 0; + unsigned Noops = 0; for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { if (!SUnits[i].isScheduled) { if (SUnits[i].NumPreds == 0 && SUnits[i].NumSuccs == 0) { @@ -1213,8 +1218,11 @@ AnyNotSched = true; } } + for (unsigned i = 0, e = Sequence.size(); i != e; ++i) + if (!Sequence[i]) + ++Noops; assert(!AnyNotSched); - assert(Sequence.size() + DeadNodes == SUnits.size() && + assert(Sequence.size() + DeadNodes - Noops == SUnits.size() && "The number of nodes scheduled doesn't match the expected number!"); #endif } From gohman at apple.com Tue Apr 15 18:19:28 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 23:19:28 -0000 Subject: [llvm-commits] [llvm] r49753 - /llvm/trunk/test/Transforms/MemCpyOpt/ Message-ID: <200804152319.m3FNJUac012572@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 18:19:16 2008 New Revision: 49753 URL: http://llvm.org/viewvc/llvm-project?rev=49753&view=rev Log: Add an svn:ignore for the test Output directory. Modified: llvm/trunk/test/Transforms/MemCpyOpt/ (props changed) Propchange: llvm/trunk/test/Transforms/MemCpyOpt/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Apr 15 18:19:16 2008 @@ -0,0 +1 @@ +Output From dpatel at apple.com Tue Apr 15 18:23:49 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 23:23:49 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49754 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804152323.m3FNNolQ012707@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 18:23:37 2008 New Revision: 49754 URL: http://llvm.org/viewvc/llvm-project?rev=49754&view=rev Log: Use appropriate type for the second element while handling struct { float f[2]; char c; }; Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49754&r1=49753&r2=49754&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 Apr 15 18:23:37 2008 @@ -850,8 +850,12 @@ } else if (Class[i+1] == X86_64_INTEGER_CLASS) { // struct { float f[2]; char c; } should be returned in SSE(low) // and INT (high). - Elts.push_back(VectorType::get(Type::FloatTy, 2)); - Elts.push_back(Type::DoubleTy); + const Type *Ty = ConvertType(TreeType); + if (const StructType *STy = dyn_cast(Ty)) { + Elts.push_back(VectorType::get(Type::FloatTy, 2)); + Elts.push_back(STy->getElementType(1)); + } else + assert(0 && "Not yet handled!"); } else assert(0 && "Not yet handled!"); ++i; // Already handled the next one. @@ -958,7 +962,8 @@ bool foundFloat = false; for (unsigned i = 0; i < Elts.size(); ++i) - if (Elts[i]->isFloatingPoint()) + if (Elts[i]->isFloatingPoint() + || Elts[i]->getTypeID() == Type::VectorTyID) foundFloat = true; return foundFloat; From evan.cheng at apple.com Tue Apr 15 18:24:51 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Apr 2008 16:24:51 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> Message-ID: <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> On Apr 15, 2008, at 3:37 PM, Chris Lattner wrote: > > On Apr 15, 2008, at 3:18 PM, Devang Patel wrote: > >> Author: dpatel >> Date: Tue Apr 15 17:18:40 2008 >> New Revision: 49746 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=49746&view=rev >> Log: >> Handle test cases from gcc.target/x86-64/abi/test_struct_return.c > > This looks wrong: > >> Elts.push_back(Type::DoubleTy); >> Bytes -= 16; >> + } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == >> 16) { >> + // struct {float f[2]; double d; } should be returned in >> SSE registers. >> + Elts.push_back(Type::DoubleTy); >> + Elts.push_back(Type::DoubleTy); > > Shouldn't this be <4 x float> [or <2 x float> if that works], double > for performance? I think X86_64_SSE_CLASS + X86_64_SSEDF_CLASS does mean passing two doubles. But I am confused. This is llvm_x86_64_should_pass_aggregate_in_mixed_regs? It's used to determine argument passing, not return values. Are you fixing function return or argument passing? Evan > > > >> + } else if (Class[i+1] == X86_64_INTEGER_CLASS) { >> + // struct { float f[2]; char c; } should be returned in >> SSE(low) >> + // and INT (high). >> + Elts.push_back(VectorType::get(Type::FloatTy, 2)); >> + Elts.push_back(Type::DoubleTy); > > The second half should be i64 for correctness, no? > > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Tue Apr 15 18:24:54 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 16:24:54 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> Message-ID: <4E7591DB-ADCE-4925-BA87-0BF8F48F83D9@apple.com> On Apr 15, 2008, at 3:37 PM, Chris Lattner wrote: > > > >> + } else if (Class[i+1] == X86_64_INTEGER_CLASS) { >> + // struct { float f[2]; char c; } should be returned in >> SSE(low) >> + // and INT (high). >> + Elts.push_back(VectorType::get(Type::FloatTy, 2)); >> + Elts.push_back(Type::DoubleTy); > > The second half should be i64 for correctness, no? Yes. Fixed. Thanks! - Devang From dpatel at apple.com Tue Apr 15 18:41:01 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 16:41:01 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> Message-ID: <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> On Apr 15, 2008, at 4:24 PM, Evan Cheng wrote: > But I am confused. This is > llvm_x86_64_should_pass_aggregate_in_mixed_regs? It's used to > determine argument passing, not return values. Are you fixing function > return or argument passing? I'm trying to reuse it to determine return value registers. - Devang From ggreif at gmail.com Tue Apr 15 18:44:12 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 15 Apr 2008 23:44:12 -0000 Subject: [llvm-commits] [llvm] r49755 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804152344.m3FNiDQK013264@zion.cs.uiuc.edu> Author: ggreif Date: Tue Apr 15 18:44:10 2008 New Revision: 49755 URL: http://llvm.org/viewvc/llvm-project?rev=49755&view=rev Log: poor SelectInst has been forgotten Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49755&r1=49754&r2=49755&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Tue Apr 15 18:44:10 2008 @@ -1121,8 +1121,8 @@ : Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) { init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>()); } - SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name = "", - Instruction *InsertBefore = 0) + SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name, + Instruction *InsertBefore) : Instruction(S1->getType(), Instruction::Select, &Op<0>(), 3, InsertBefore) { init(C, S1, S2); setName(Name); @@ -1135,11 +1135,11 @@ } public: static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "", - Instruction *InsertBefore = 0) { + Instruction *InsertBefore = 0) { return new(3) SelectInst(C, S1, S2, Name, InsertBefore); } - static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name, - BasicBlock *InsertAtEnd) { + static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "", + BasicBlock *InsertAtEnd) { return new(3) SelectInst(C, S1, S2, Name, InsertAtEnd); } @@ -1148,15 +1148,7 @@ Value *getFalseValue() const { return Op<2>(); } /// Transparently provide more efficient getOperand methods. - Value *getOperand(unsigned i) const { - assert(i < 3 && "getOperand() out of range!"); - return OperandList[i]; - } - void setOperand(unsigned i, Value *Val) { - assert(i < 3 && "setOperand() out of range!"); - OperandList[i] = Val; - } - unsigned getNumOperands() const { return 3; } + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); OtherOps getOpcode() const { return static_cast(Instruction::getOpcode()); @@ -1174,6 +1166,12 @@ } }; +template <> +struct OperandTraits : FixedNumOperandTraits<3> { +}; + +DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value) + //===----------------------------------------------------------------------===// // VAArgInst Class //===----------------------------------------------------------------------===// From gohman at apple.com Tue Apr 15 18:55:07 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 15 Apr 2008 23:55:07 -0000 Subject: [llvm-commits] [llvm] r49757 - in /llvm/trunk: lib/Target/X86/X86InstrMMX.td test/CodeGen/X86/mmx-bitcast-to-i64.ll Message-ID: <200804152355.m3FNt7WY013646@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 18:55:07 2008 New Revision: 49757 URL: http://llvm.org/viewvc/llvm-project?rev=49757&view=rev Log: Add movd instructions to move from MMX registers to 64-bit GPR registers on x86-64. Added: llvm/trunk/test/CodeGen/X86/mmx-bitcast-to-i64.ll Modified: llvm/trunk/lib/Target/X86/X86InstrMMX.td Modified: llvm/trunk/lib/Target/X86/X86InstrMMX.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrMMX.td?rev=49757&r1=49756&r2=49757&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrMMX.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrMMX.td Tue Apr 15 18:55:07 2008 @@ -167,6 +167,10 @@ "movd\t{$src, $dst|$dst, $src}", []>; let neverHasSideEffects = 1 in +def MMX_MOVD64from64rr : MMXRI<0x6E, MRMSrcReg, (outs GR64:$dst), (ins VR64:$src), + "movd\t{$src, $dst|$dst, $src}", []>; + +let neverHasSideEffects = 1 in def MMX_MOVQ64rr : MMXI<0x6F, MRMSrcReg, (outs VR64:$dst), (ins VR64:$src), "movq\t{$src, $dst|$dst, $src}", []>; let isSimpleLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in @@ -548,6 +552,14 @@ (MMX_MOVD64to64rr GR64:$src)>; def : Pat<(v8i8 (bitconvert (i64 GR64:$src))), (MMX_MOVD64to64rr GR64:$src)>; +def : Pat<(i64 (bitconvert (v1i64 VR64:$src))), + (MMX_MOVD64from64rr VR64:$src)>; +def : Pat<(i64 (bitconvert (v2i32 VR64:$src))), + (MMX_MOVD64from64rr VR64:$src)>; +def : Pat<(i64 (bitconvert (v4i16 VR64:$src))), + (MMX_MOVD64from64rr VR64:$src)>; +def : Pat<(i64 (bitconvert (v8i8 VR64:$src))), + (MMX_MOVD64from64rr VR64:$src)>; // Move scalar to XMM zero-extended // movd to XMM register zero-extends Added: llvm/trunk/test/CodeGen/X86/mmx-bitcast-to-i64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mmx-bitcast-to-i64.ll?rev=49757&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/mmx-bitcast-to-i64.ll (added) +++ llvm/trunk/test/CodeGen/X86/mmx-bitcast-to-i64.ll Tue Apr 15 18:55:07 2008 @@ -0,0 +1,26 @@ +; RUN: llvm-as < %s | llc -march=x86-64 | grep movd | count 4 + +define i64 @foo(<1 x i64>* %p) { + %t = load <1 x i64>* %p + %u = add <1 x i64> %t, %t + %s = bitcast <1 x i64> %u to i64 + ret i64 %s +} +define i64 @goo(<2 x i32>* %p) { + %t = load <2 x i32>* %p + %u = add <2 x i32> %t, %t + %s = bitcast <2 x i32> %u to i64 + ret i64 %s +} +define i64 @hoo(<4 x i16>* %p) { + %t = load <4 x i16>* %p + %u = add <4 x i16> %t, %t + %s = bitcast <4 x i16> %u to i64 + ret i64 %s +} +define i64 @ioo(<8 x i8>* %p) { + %t = load <8 x i8>* %p + %u = add <8 x i8> %t, %t + %s = bitcast <8 x i8> %u to i64 + ret i64 %s +} From dpatel at apple.com Tue Apr 15 19:22:05 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 16 Apr 2008 00:22:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49758 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804160022.m3G0M5XJ014619@zion.cs.uiuc.edu> Author: dpatel Date: Tue Apr 15 19:22:05 2008 New Revision: 49758 URL: http://llvm.org/viewvc/llvm-project?rev=49758&view=rev Log: Use <2 x float> for float[2] field. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49758&r1=49757&r2=49758&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 Apr 15 19:22:05 2008 @@ -845,7 +845,7 @@ Bytes -= 16; } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) { // struct {float f[2]; double d; } should be returned in SSE registers. - Elts.push_back(Type::DoubleTy); + Elts.push_back(VectorType::get(Type::FloatTy, 2)); Elts.push_back(Type::DoubleTy); } else if (Class[i+1] == X86_64_INTEGER_CLASS) { // struct { float f[2]; char c; } should be returned in SSE(low) From gohman at apple.com Tue Apr 15 19:24:30 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 00:24:30 -0000 Subject: [llvm-commits] [llvm] r49759 - /llvm/trunk/lib/Target/X86/X86ISelLowering.h Message-ID: <200804160024.m3G0OUfN014691@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 19:24:30 2008 New Revision: 49759 URL: http://llvm.org/viewvc/llvm-project?rev=49759&view=rev Log: Remove X86_64SRet; it isn't used anymore. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=49759&r1=49758&r2=49759&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Apr 15 19:24:30 2008 @@ -294,17 +294,6 @@ unsigned getShufflePSHUFLWImmediate(SDNode *N); } - namespace X86 { - /// X86_64SRet - These represent different ways to implement x86_64 struct - /// returns call results. - enum X86_64SRet { - InMemory, // Really is sret, returns in memory. - InGPR64, // Returns in a pair of 64-bit integer registers. - InSSE, // Returns in a pair of SSE registers. - InX87 // Returns in a pair of f80 X87 registers. - }; - } - //===--------------------------------------------------------------------===// // X86TargetLowering - X86 Implementation of the TargetLowering interface class X86TargetLowering : public TargetLowering { From evan.cheng at apple.com Tue Apr 15 20:11:27 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Apr 2008 18:11:27 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> Message-ID: <7B88C249-C314-46CA-B747-D812971A835D@apple.com> I am not sure that's the right approach. I think they are similar but not 100% the same and there is always the risk of fixing one and breaking the other. Please check if it's gcc uses the same code path to determine return types. If so, please rename the function to something more appropriate. Thanks, Evan On Apr 15, 2008, at 4:41 PM, Devang Patel wrote: > > On Apr 15, 2008, at 4:24 PM, Evan Cheng wrote: > >> But I am confused. This is >> llvm_x86_64_should_pass_aggregate_in_mixed_regs? It's used to >> determine argument passing, not return values. Are you fixing >> function >> return or argument passing? > > I'm trying to reuse it to determine return value registers. > > - > Devang > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Tue Apr 15 20:17:51 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 15 Apr 2008 18:17:51 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <7B88C249-C314-46CA-B747-D812971A835D@apple.com> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> <7B88C249-C314-46CA-B747-D812971A835D@apple.com> Message-ID: <360E17A8-3554-48DB-8452-E4A17414DE1E@apple.com> On Apr 15, 2008, at 6:11 PM, Evan Cheng wrote: > I am not sure that's the right approach. I think they are similar but > not 100% the same and there is always the risk of fixing one and > breaking the other. There are definitely cases where they're not the same on x86-32. I agree it's better to separate the functionality. > Please check if it's gcc uses the same code path to determine return > types. If so, please rename the function to something more > appropriate. > > Thanks, > > Evan > > On Apr 15, 2008, at 4:41 PM, Devang Patel wrote: > >> >> On Apr 15, 2008, at 4:24 PM, Evan Cheng wrote: >> >>> But I am confused. This is >>> llvm_x86_64_should_pass_aggregate_in_mixed_regs? It's used to >>> determine argument passing, not return values. Are you fixing >>> function >>> return or argument passing? >> >> I'm trying to reuse it to determine return value registers. >> >> - >> Devang >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Tue Apr 15 20:22:28 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 01:22:28 -0000 Subject: [llvm-commits] [llvm] r49760 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200804160122.m3G1MS87016591@zion.cs.uiuc.edu> Author: evancheng Date: Tue Apr 15 20:22:28 2008 New Revision: 49760 URL: http://llvm.org/viewvc/llvm-project?rev=49760&view=rev Log: Avoid read after free. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49760&r1=49759&r2=49760&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Apr 15 20:22:28 2008 @@ -553,7 +553,6 @@ static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_, const TargetRegisterInfo *tri_) { if (li.empty()) { - li_->removeInterval(li.reg); if (TargetRegisterInfo::isPhysicalRegister(li.reg)) for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) { if (!li_->hasInterval(*SR)) @@ -562,6 +561,7 @@ if (sli.empty()) li_->removeInterval(*SR); } + li_->removeInterval(li.reg); } } From gohman at apple.com Tue Apr 15 20:32:32 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 01:32:32 -0000 Subject: [llvm-commits] [llvm] r49761 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/memset64-on-x86-32.ll Message-ID: <200804160132.m3G1WWex017111@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 20:32:32 2008 New Revision: 49761 URL: http://llvm.org/viewvc/llvm-project?rev=49761&view=rev Log: Recreate the size SDNode instead of reusing the old one in the x86 memcpy lowering code; this ensures that the size node has the desired result type. This fixes a regression from r49572 with @llvm.memcpy.i64 on x86-32. Added: llvm/trunk/test/CodeGen/X86/memset64-on-x86-32.ll Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49761&r1=49760&r2=49761&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Apr 15 20:32:32 2008 @@ -4731,7 +4731,7 @@ default: // Byte aligned AVT = MVT::i8; ValReg = X86::AL; - Count = Size; + Count = DAG.getIntPtrConstant(SizeVal); break; } @@ -4746,7 +4746,7 @@ InFlag = Chain.getValue(1); } else { AVT = MVT::i8; - Count = Size; + Count = DAG.getIntPtrConstant(SizeVal); Chain = DAG.getCopyToReg(Chain, X86::AL, Src, InFlag); InFlag = Chain.getValue(1); } Added: llvm/trunk/test/CodeGen/X86/memset64-on-x86-32.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/memset64-on-x86-32.ll?rev=49761&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/memset64-on-x86-32.ll (added) +++ llvm/trunk/test/CodeGen/X86/memset64-on-x86-32.ll Tue Apr 15 20:32:32 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep stosb + +target triple = "i386-apple-darwin9" + %struct.S = type { [80 x i8] } + +define %struct.S* @bork() { +entry: + call void @llvm.memset.i64( i8* null, i8 0, i64 80, i32 1 ) + ret %struct.S* null +} + +declare void @llvm.memset.i64(i8*, i8, i64, i32) nounwind + From dpatel at apple.com Tue Apr 15 20:41:58 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 15 Apr 2008 18:41:58 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <7B88C249-C314-46CA-B747-D812971A835D@apple.com> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> <7B88C249-C314-46CA-B747-D812971A835D@apple.com> Message-ID: <93CAE913-9DB5-4214-9257-EE461B24A8CF@apple.com> On Apr 15, 2008, at 6:11 PM, Evan Cheng wrote: > I am not sure that's the right approach. I think they are similar but > not 100% the same and there is always the risk of fixing one and > breaking the other. > > Please check if it's gcc uses the same code path to determine return > types. If so, please rename the function to something more > appropriate. Yup, I intend to refactor the code appropriately before I enable multiple value returns for x86-64. - Devang From gohman at apple.com Tue Apr 15 21:32:24 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 02:32:24 -0000 Subject: [llvm-commits] [llvm] r49762 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/sse41-extractps-bitcast-0.ll test/CodeGen/X86/sse41-extractps-bitcast-1.ll Message-ID: <200804160232.m3G2WOjO018983@zion.cs.uiuc.edu> Author: djg Date: Tue Apr 15 21:32:24 2008 New Revision: 49762 URL: http://llvm.org/viewvc/llvm-project?rev=49762&view=rev Log: Add support for the form of the SSE41 extractps instruction that puts its result in a 32-bit GPR. Added: llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-0.ll llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-1.ll Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49762&r1=49761&r2=49762&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Apr 15 21:32:24 2008 @@ -3833,11 +3833,13 @@ } else if (VT == MVT::f32) { // EXTRACTPS outputs to a GPR32 register which will require a movd to copy // the result back to FR32 register. It's only worth matching if the - // result has a single use which is a store. + // result has a single use which is a store or a bitcast to i32. if (!Op.hasOneUse()) return SDOperand(); SDNode *User = Op.Val->use_begin()->getUser(); - if (User->getOpcode() != ISD::STORE) + if (User->getOpcode() != ISD::STORE && + (User->getOpcode() != ISD::BIT_CONVERT || + User->getValueType(0) != MVT::i32)) return SDOperand(); SDOperand Extract = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32, DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, Op.getOperand(0)), Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=49762&r1=49761&r2=49762&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Apr 15 21:32:24 2008 @@ -3387,13 +3387,12 @@ /// SS41I_extractf32 - SSE 4.1 extract 32 bits fp value to int reg or memory /// destination multiclass SS41I_extractf32 opc, string OpcodeStr> { - // Not worth matching to rr form of extractps since the result is in GPR32. def rr : SS4AIi8, + [(set GR32:$dst, + (extractelt (bc_v4i32 (v4f32 VR128:$src1)), imm:$src2))]>, OpSize; def mr : SS4AIi8 %v) { + %s = extractelement <4 x float> %v, i32 3 + %i = bitcast float %s to i32 + ret i32 %i +} +define i32 @boo(<4 x float> %v) { + %t = bitcast <4 x float> %v to <4 x i32> + %s = extractelement <4 x i32> %t, i32 3 + ret i32 %s +} Added: llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-1.ll?rev=49762&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/sse41-extractps-bitcast-1.ll Tue Apr 15 21:32:24 2008 @@ -0,0 +1,19 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=sse41 | not grep extractps + +; The non-store form of extractps puts its result into a GPR. +; This makes it suitable for an extract from a <4 x float> that +; is bitcasted to i32, but unsuitable for much of anything else. + +define float @bar(<4 x float> %v) { + %s = extractelement <4 x float> %v, i32 3 + %t = add float %s, 1.0 + ret float %t +} +define float @baz(<4 x float> %v) { + %s = extractelement <4 x float> %v, i32 3 + ret float %s +} +define i32 @qux(<4 x i32> %v) { + %i = extractelement <4 x i32> %v, i32 3 + ret i32 %i +} From clattner at apple.com Tue Apr 15 22:22:09 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 15 Apr 2008 20:22:09 -0700 Subject: [llvm-commits] [llvm] r49762 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/sse41-extractps-bitcast-0.ll test/CodeGen/X86/sse41-extractps-bitcast-1.ll In-Reply-To: <200804160232.m3G2WOjO018983@zion.cs.uiuc.edu> References: <200804160232.m3G2WOjO018983@zion.cs.uiuc.edu> Message-ID: <8C361EDD-B7AC-4EEE-BCE2-CF6DB0C2F573@apple.com> On Apr 15, 2008, at 7:32 PM, Dan Gohman wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=49762&view=rev > Log: > Add support for the form of the SSE41 extractps instruction that > puts its result in a 32-bit GPR. Ooh, nice. Can you run an example that uses this through the JIT to ensure the encoding is correct? If you need an acct on an sse4 machine, let me know, -Chris From sabre at nondot.org Tue Apr 15 23:05:02 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Apr 2008 04:05:02 -0000 Subject: [llvm-commits] [llvm] r49765 - /llvm/trunk/include/llvm/ADT/SmallString.h Message-ID: <200804160405.m3G452jq021749@zion.cs.uiuc.edu> Author: lattner Date: Tue Apr 15 23:05:02 2008 New Revision: 49765 URL: http://llvm.org/viewvc/llvm-project?rev=49765&view=rev Log: give smallstring some methods to do 'itoa'. Modified: llvm/trunk/include/llvm/ADT/SmallString.h Modified: llvm/trunk/include/llvm/ADT/SmallString.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallString.h?rev=49765&r1=49764&r2=49765&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallString.h (original) +++ llvm/trunk/include/llvm/ADT/SmallString.h Tue Apr 15 23:05:02 2008 @@ -53,6 +53,47 @@ this->push_back(C); return *this; } + + SmallString &append_uint_32(uint32_t N) { + char Buffer[20]; + char *BufPtr = Buffer+19; + + if (N == 0) *--BufPtr = '0'; // Handle special case. + + while (N) { + *--BufPtr = '0' + char(N % 10); + N /= 10; + } + this->append(BufPtr, Buffer+20); + return *this; + } + + SmallString &append_uint(uint64_t N) { + if (N == uint32_t(N)) + return append_uint_32(uint32_t(N)); + + char Buffer[40]; + char *BufPtr = Buffer+39; + + if (N == 0) *--BufPtr = '0'; // Handle special case... + + while (N) { + *--BufPtr = '0' + char(N % 10); + N /= 10; + } + + this->append(BufPtr, Buffer+40); + return *this; + } + + SmallString &append_sint(int64_t N) { + // TODO, wrong for minint64. + if (N < 0) { + this->push_back('-'); + N = -N; + } + return append_uint(N); + } }; From sabre at nondot.org Tue Apr 15 23:10:37 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 16 Apr 2008 04:10:37 -0000 Subject: [llvm-commits] [llvm] r49766 - /llvm/trunk/include/llvm/ADT/SmallString.h Message-ID: <200804160410.m3G4AbR1021926@zion.cs.uiuc.edu> Author: lattner Date: Tue Apr 15 23:10:37 2008 New Revision: 49766 URL: http://llvm.org/viewvc/llvm-project?rev=49766&view=rev Log: fix off by one error. Modified: llvm/trunk/include/llvm/ADT/SmallString.h Modified: llvm/trunk/include/llvm/ADT/SmallString.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallString.h?rev=49766&r1=49765&r2=49766&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallString.h (original) +++ llvm/trunk/include/llvm/ADT/SmallString.h Tue Apr 15 23:10:37 2008 @@ -56,7 +56,7 @@ SmallString &append_uint_32(uint32_t N) { char Buffer[20]; - char *BufPtr = Buffer+19; + char *BufPtr = Buffer+20; if (N == 0) *--BufPtr = '0'; // Handle special case. @@ -73,7 +73,7 @@ return append_uint_32(uint32_t(N)); char Buffer[40]; - char *BufPtr = Buffer+39; + char *BufPtr = Buffer+40; if (N == 0) *--BufPtr = '0'; // Handle special case... From resistor at mac.com Tue Apr 15 23:21:16 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 16 Apr 2008 04:21:16 -0000 Subject: [llvm-commits] [llvm] r49768 - in /llvm/trunk: include/llvm/Analysis/DominatorInternals.h include/llvm/Analysis/Dominators.h lib/Analysis/PostDominators.cpp lib/VMCore/Dominators.cpp Message-ID: <200804160421.m3G4LG6b022240@zion.cs.uiuc.edu> Author: resistor Date: Tue Apr 15 23:21:16 2008 New Revision: 49768 URL: http://llvm.org/viewvc/llvm-project?rev=49768&view=rev Log: Major repairs to the post-dominators implementation. Patch from Florian Brandner! Modified: llvm/trunk/include/llvm/Analysis/DominatorInternals.h llvm/trunk/include/llvm/Analysis/Dominators.h llvm/trunk/lib/Analysis/PostDominators.cpp llvm/trunk/lib/VMCore/Dominators.cpp Modified: llvm/trunk/include/llvm/Analysis/DominatorInternals.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DominatorInternals.h?rev=49768&r1=49767&r2=49768&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DominatorInternals.h (original) +++ llvm/trunk/include/llvm/Analysis/DominatorInternals.h Tue Apr 15 23:21:16 2008 @@ -42,7 +42,7 @@ // documentation purposes. #if 0 InfoRec &VInfo = DT.Info[DT.Roots[i]]; - VInfo.Semi = ++N; + VInfo.DFSNum = VInfo.Semi = ++N; VInfo.Label = V; Vertex.push_back(V); // Vertex[n] = V; @@ -58,6 +58,8 @@ } } #else + bool IsChilOfArtificialExit = (N != 0); + std::vector > Worklist; Worklist.push_back(std::make_pair(V, GraphT::child_begin(V))); @@ -65,19 +67,29 @@ typename GraphT::NodeType* BB = Worklist.back().first; typename GraphT::ChildIteratorType NextSucc = Worklist.back().second; + typename DominatorTreeBase::InfoRec &BBInfo = + DT.Info[BB]; + // First time we visited this BB? if (NextSucc == GraphT::child_begin(BB)) { - typename DominatorTreeBase::InfoRec &BBInfo = - DT.Info[BB]; - BBInfo.Semi = ++N; + BBInfo.DFSNum = BBInfo.Semi = ++N; BBInfo.Label = BB; DT.Vertex.push_back(BB); // Vertex[n] = V; //BBInfo[V].Ancestor = 0; // Ancestor[n] = 0 //BBInfo[V].Child = 0; // Child[v] = 0 BBInfo.Size = 1; // Size[v] = 1 + + if (IsChilOfArtificialExit) + BBInfo.Parent = 1; + + IsChilOfArtificialExit = false; } - + + // store the DFS number of the current BB - the reference to BBInfo might + // get invalidated when processing the successors. + unsigned BBDFSNum = BBInfo.DFSNum; + // If we are done with this block, remove it from the worklist. if (NextSucc == GraphT::child_end(BB)) { Worklist.pop_back(); @@ -93,7 +105,7 @@ typename DominatorTreeBase::InfoRec &SuccVInfo = DT.Info[Succ]; if (SuccVInfo.Semi == 0) { - SuccVInfo.Parent = BB; + SuccVInfo.Parent = BBDFSNum; Worklist.push_back(std::make_pair(Succ, GraphT::child_begin(Succ))); } } @@ -106,9 +118,8 @@ typename GraphT::NodeType *VIn) { std::vector Work; SmallPtrSet Visited; - typename GraphT::NodeType* VInAncestor = DT.Info[VIn].Ancestor; typename DominatorTreeBase::InfoRec &VInVAInfo = - DT.Info[VInAncestor]; + DT.Info[DT.Vertex[DT.Info[VIn].Ancestor]]; if (VInVAInfo.Ancestor != 0) Work.push_back(VIn); @@ -117,7 +128,7 @@ typename GraphT::NodeType* V = Work.back(); typename DominatorTreeBase::InfoRec &VInfo = DT.Info[V]; - typename GraphT::NodeType* VAncestor = VInfo.Ancestor; + typename GraphT::NodeType* VAncestor = DT.Vertex[VInfo.Ancestor]; typename DominatorTreeBase::InfoRec &VAInfo = DT.Info[VAncestor]; @@ -168,11 +179,11 @@ template void Link(DominatorTreeBase& DT, - typename GraphT::NodeType* V, typename GraphT::NodeType* W, + unsigned DFSNumV, typename GraphT::NodeType* W, typename DominatorTreeBase::InfoRec &WInfo) { #if !BALANCE_IDOM_TREE // Higher-complexity but faster implementation - WInfo.Ancestor = V; + WInfo.Ancestor = DFSNumV; #else // Lower-complexity but slower implementation GraphT::NodeType* WLabel = WInfo.Label; @@ -220,10 +231,30 @@ void Calculate(DominatorTreeBase::NodeType>& DT, FuncT& F) { typedef GraphTraits GraphT; - + + unsigned N = 0; + + // Add a node for the root. This node might be the actual root, if there is + // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0) + // which postdominates all real exits if there are multiple exit blocks. + typename GraphT::NodeType* Root = DT.Roots.size() == 1 ? DT.Roots[0] + : 0; + bool MultipleRoots = (DT.Roots.size() > 1); + + if (MultipleRoots) { + typename DominatorTreeBase::InfoRec &BBInfo = + DT.Info[NULL]; + BBInfo.DFSNum = BBInfo.Semi = ++N; + BBInfo.Label = NULL; + + DT.Vertex.push_back(NULL); // Vertex[n] = V; + //BBInfo[V].Ancestor = 0; // Ancestor[n] = 0 + //BBInfo[V].Child = 0; // Child[v] = 0 + BBInfo.Size = 1; // Size[v] = 1 + } + // Step #1: Number blocks in depth-first order and initialize variables used // in later stages of the algorithm. - unsigned N = 0; for (unsigned i = 0, e = DT.Roots.size(); i != e; ++i) N = DFSPass(DT, DT.Roots[i], N); @@ -233,19 +264,34 @@ DT.Info[W]; // Step #2: Calculate the semidominators of all vertices + bool HasChildOutsideDFS = false; + + // initialize the semi dominator to point to the parent node + WInfo.Semi = WInfo.Parent; for (typename GraphTraits >::ChildIteratorType CI = GraphTraits >::child_begin(W), - E = GraphTraits >::child_end(W); CI != E; ++CI) + E = GraphTraits >::child_end(W); CI != E; ++CI) { if (DT.Info.count(*CI)) { // Only if this predecessor is reachable! unsigned SemiU = DT.Info[Eval(DT, *CI)].Semi; if (SemiU < WInfo.Semi) WInfo.Semi = SemiU; } + else { + // if the child has no DFS number it is not post-dominated by any exit, + // and so is the current block. + HasChildOutsideDFS = true; + } + } + + // if some child has no DFS number it is not post-dominated by any exit, + // and so is the current block. + if (DT.isPostDominator() && HasChildOutsideDFS) + WInfo.Semi = 0; DT.Info[DT.Vertex[WInfo.Semi]].Bucket.push_back(W); - typename GraphT::NodeType* WParent = WInfo.Parent; - Link(DT, WParent, W, WInfo); + typename GraphT::NodeType* WParent = DT.Vertex[WInfo.Parent]; + Link(DT, WInfo.Parent, W, WInfo); // Step #3: Implicitly define the immediate dominator of vertices std::vector &WParentBucket = @@ -271,29 +317,39 @@ // Add a node for the root. This node might be the actual root, if there is // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0) // which postdominates all real exits if there are multiple exit blocks. - typename GraphT::NodeType* Root = DT.Roots.size() == 1 ? DT.Roots[0] - : 0; DT.DomTreeNodes[Root] = DT.RootNode = new DomTreeNodeBase(Root, 0); // Loop over all of the reachable blocks in the function... - for (typename FuncT::iterator I = F.begin(), E = F.end(); I != E; ++I) - if (typename GraphT::NodeType* ImmDom = DT.getIDom(I)) { - // Reachable block. - DomTreeNodeBase *BBNode = DT.DomTreeNodes[I]; - if (BBNode) continue; // Haven't calculated this node yet? + for (unsigned i = 2; i <= N; ++i) { + typename GraphT::NodeType* W = DT.Vertex[i]; - // Get or calculate the node for the immediate dominator - DomTreeNodeBase *IDomNode = + DomTreeNodeBase *BBNode = DT.DomTreeNodes[W]; + if (BBNode) continue; // Haven't calculated this node yet? + + typename GraphT::NodeType* ImmDom = DT.getIDom(W); + + // skip all non root nodes that have no dominator - this occures with + // infinite loops. + if (!ImmDom && std::count(DT.Roots.begin(), DT.Roots.end(), W) == 0) + continue; + + // Get or calculate the node for the immediate dominator + DomTreeNodeBase *IDomNode = DT.getNodeForBlock(ImmDom); - // Add a new tree node for this BasicBlock, and link it as a child of - // IDomNode - DomTreeNodeBase *C = - new DomTreeNodeBase(I, IDomNode); - DT.DomTreeNodes[I] = IDomNode->addChild(C); - } - + // skip all children that are dominated by a non root node that, by itself, + // has no dominator. + if (!IDomNode) + continue; + + // Add a new tree node for this BasicBlock, and link it as a child of + // IDomNode + DomTreeNodeBase *C = + new DomTreeNodeBase(W, IDomNode); + DT.DomTreeNodes[W] = IDomNode->addChild(C); + } + // Free temporary memory used to construct idom's DT.IDoms.clear(); DT.Info.clear(); Modified: llvm/trunk/include/llvm/Analysis/Dominators.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=49768&r1=49767&r2=49768&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/Dominators.h (original) +++ llvm/trunk/include/llvm/Analysis/Dominators.h Tue Apr 15 23:21:16 2008 @@ -182,13 +182,16 @@ unsigned int SlowQueries; // Information record used during immediate dominators computation. struct InfoRec { + unsigned DFSNum; unsigned Semi; unsigned Size; - NodeT *Label, *Parent, *Child, *Ancestor; + NodeT *Label, *Child; + unsigned Parent, Ancestor; std::vector Bucket; - InfoRec() : Semi(0), Size(0), Label(0), Parent(0), Child(0), Ancestor(0) {} + InfoRec() : DFSNum(0), Semi(0), Size(0), Label(0), Child(0), Parent(0), + Ancestor(0) {} }; DenseMap IDoms; @@ -544,8 +547,7 @@ template friend void Link(DominatorTreeBase& DT, - typename GraphT::NodeType* V, - typename GraphT::NodeType* W, + unsigned DFSNumV, typename GraphT::NodeType* W, typename DominatorTreeBase::InfoRec &WInfo); template @@ -602,8 +604,18 @@ // Haven't calculated this node yet? Get or calculate the node for the // immediate dominator. NodeT *IDom = getIDom(BB); + + // skip all non root nodes that have no dominator + if (!IDom && std::count(this->Roots.begin(), this->Roots.end(), BB) == 0) + return NULL; + DomTreeNodeBase *IDomNode = getNodeForBlock(IDom); + // skip all nodes that are dominated by a non root node that, by itself, + // has no dominator. + if (!IDomNode) + return NULL; + // Add a new tree node for this BasicBlock, and link it as a child of // IDomNode DomTreeNodeBase *C = new DomTreeNodeBase(BB, IDomNode); @@ -616,9 +628,7 @@ } inline void addRoot(NodeT* BB) { - // Unreachable block is not a root node. - if (!isa(&BB->back())) - this->Roots.push_back(BB); + this->Roots.push_back(BB); } public: Modified: llvm/trunk/lib/Analysis/PostDominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PostDominators.cpp?rev=49768&r1=49767&r2=49768&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/PostDominators.cpp (original) +++ llvm/trunk/lib/Analysis/PostDominators.cpp Tue Apr 15 23:21:16 2008 @@ -11,9 +11,12 @@ // //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "postdomtree" + #include "llvm/Analysis/PostDominators.h" #include "llvm/Instructions.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/Debug.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SetOperations.h" #include "llvm/Analysis/DominatorInternals.h" @@ -30,6 +33,7 @@ bool PostDominatorTree::runOnFunction(Function &F) { DT->recalculate(F); + DEBUG(DT->dump()); return false; } Modified: llvm/trunk/lib/VMCore/Dominators.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Dominators.cpp?rev=49768&r1=49767&r2=49768&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Dominators.cpp (original) +++ llvm/trunk/lib/VMCore/Dominators.cpp Tue Apr 15 23:21:16 2008 @@ -14,9 +14,12 @@ // //===----------------------------------------------------------------------===// +#define DEBUG_TYPE "domtree" + #include "llvm/Analysis/Dominators.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/SmallPtrSet.h" @@ -58,7 +61,7 @@ bool DominatorTree::runOnFunction(Function &F) { DT->recalculate(F); - + DEBUG(DT->dump()); return false; } From resistor at mac.com Tue Apr 15 23:25:42 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 16 Apr 2008 04:25:42 -0000 Subject: [llvm-commits] [llvm] r49769 - /llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll Message-ID: <200804160425.m3G4PgEx022399@zion.cs.uiuc.edu> Author: resistor Date: Tue Apr 15 23:25:42 2008 New Revision: 49769 URL: http://llvm.org/viewvc/llvm-project?rev=49769&view=rev Log: XFAIL this test for the moment. The real solution is to prevent ADCE from transforming loops and adding a separate loop pass for removing loops with know trip counts. Until that happens, ADCE is miscompiling this code. Modified: llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll Modified: llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll?rev=49769&r1=49768&r2=49769&view=diff ============================================================================== --- llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll (original) +++ llvm/trunk/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll Tue Apr 15 23:25:42 2008 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | opt -adce | llvm-dis | grep switch ; PR 1564 +; XFAIL: * define fastcc void @out() { start: From evan.cheng at apple.com Wed Apr 16 01:15:21 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 15 Apr 2008 23:15:21 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49746 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <93CAE913-9DB5-4214-9257-EE461B24A8CF@apple.com> References: <200804152218.m3FMIfMx010575@zion.cs.uiuc.edu> <0F0E3BC1-465D-4974-A3EF-6B8B9960574D@apple.com> <2AFE4622-4447-4ABD-87CF-6D4FC2C73B67@apple.com> <7B88C249-C314-46CA-B747-D812971A835D@apple.com> <93CAE913-9DB5-4214-9257-EE461B24A8CF@apple.com> Message-ID: <215CCAB0-A715-4A75-8991-EE38FCE69D94@apple.com> Sounds good. Thanks! Evan On Apr 15, 2008, at 6:41 PM, Devang Patel wrote: > > On Apr 15, 2008, at 6:11 PM, Evan Cheng wrote: > >> I am not sure that's the right approach. I think they are similar but >> not 100% the same and there is always the risk of fixing one and >> breaking the other. >> >> Please check if it's gcc uses the same code path to determine return >> types. If so, please rename the function to something more >> appropriate. > > Yup, I intend to refactor the code appropriately before I enable > multiple > value returns for x86-64. > > - > Devang > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Wed Apr 16 03:18:50 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 01:18:50 -0700 Subject: [llvm-commits] [llvm] r49663 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/DwarfWriter.cpp lib/Target/PowerPC/PPCRegisterInfo.cpp lib/Target/TargetMachine.cpp lib/Target/X86/X86RegisterInfo.cpp In-Reply-To: <200804141754.m3EHsHhA015140@zion.cs.uiuc.edu> References: <200804141754.m3EHsHhA015140@zion.cs.uiuc.edu> Message-ID: <133E4906-0C76-4D51-BD88-BF4FF1541CA3@apple.com> On Apr 14, 2008, at 10:54 AM, Dale Johannesen wrote: > Author: johannes > Date: Mon Apr 14 12:54:17 2008 > New Revision: 49663 > > URL: http://llvm.org/viewvc/llvm-project?rev=49663&view=rev > Log: > Reverse sense of unwind-tables option. This means > stack tracebacks on Darwin x86-64 won't work by default; > nevertheless, everybody but me thinks this is a good idea. Yay! :-) Thanks Dale. Evan > > > > Modified: > llvm/trunk/include/llvm/Target/TargetOptions.h > llvm/trunk/lib/CodeGen/DwarfWriter.cpp > llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp > llvm/trunk/lib/Target/TargetMachine.cpp > llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp > > Modified: llvm/trunk/include/llvm/Target/TargetOptions.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=49663&r1=49662&r2=49663&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) > +++ llvm/trunk/include/llvm/Target/TargetOptions.h Mon Apr 14 > 12:54:17 2008 > @@ -74,10 +74,9 @@ > /// be emitted. > extern bool ExceptionHandling; > > - /// UnwindTablesOptional - This flag indicates that unwind tables > need not > - /// be emitted for all functions. Exception handling may still > require them > - /// for some functions. > - extern bool UnwindTablesOptional; > + /// UnwindTablesMandatory - This flag indicates that unwind > tables should > + /// be emitted for all functions. > + extern bool UnwindTablesMandatory; > > /// PerformTailCallOpt - This flag is enabled when -tailcallopt is > specified > /// on the commandline. When the flag is on, the target will > perform tail call > > Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=49663&r1=49662&r2=49663&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Apr 14 12:54:17 2008 > @@ -2906,10 +2906,10 @@ > // If there are no calls then you can't unwind. This may mean > we can > // omit the EH Frame, but some environments do not handle weak > absolute > // symbols. > - // If UnwindTablesOptional is not set we cannot do this > optimization; the > + // If UnwindTablesMandatory is set we cannot do this > optimization; the > // unwind info is to be available for non-EH uses. > if (!EHFrameInfo.hasCalls && > - UnwindTablesOptional && > + !UnwindTablesMandatory && > ((linkage != Function::WeakLinkage && > linkage != Function::LinkOnceLinkage) || > !TAI->getWeakDefDirective() || > @@ -3432,7 +3432,7 @@ > // See if we need frame move info. > if (MMI->hasDebugInfo() || > !MF->getFunction()->doesNotThrow() || > - !UnwindTablesOptional) > + UnwindTablesMandatory) > shouldEmitMoves = true; > > if (shouldEmitMoves || shouldEmitTable) > > Modified: llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=49663&r1=49662&r2=49663&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Apr 14 > 12:54:17 2008 > @@ -949,7 +949,7 @@ > MachineModuleInfo *MMI = MFI->getMachineModuleInfo(); > bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || > !MF.getFunction()->doesNotThrow() || > - !UnwindTablesOptional; > + UnwindTablesMandatory; > > // Prepare for frame info. > unsigned FrameLabelId = 0; > > Modified: llvm/trunk/lib/Target/TargetMachine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=49663&r1=49662&r2=49663&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/TargetMachine.cpp (original) > +++ llvm/trunk/lib/Target/TargetMachine.cpp Mon Apr 14 12:54:17 2008 > @@ -31,7 +31,7 @@ > bool UseSoftFloat; > bool NoZerosInBSS; > bool ExceptionHandling; > - bool UnwindTablesOptional; > + bool UnwindTablesMandatory; > Reloc::Model RelocationModel; > CodeModel::Model CMModel; > bool PerformTailCallOpt; > @@ -85,9 +85,9 @@ > cl::location(ExceptionHandling), > cl::init(false)); > cl::opt > - DisableUnwindTables("unwind-tables-optional", > - cl::desc("Generate unwinding tables only for > functions that require them"), > - cl::location(UnwindTablesOptional), > + EnableUnwindTables("unwind-tables", > + cl::desc("Generate unwinding tables for all > functions"), > + cl::location(UnwindTablesMandatory), > cl::init(false)); > > cl::opt > > Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=49663&r1=49662&r2=49663&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Mon Apr 14 > 12:54:17 2008 > @@ -506,7 +506,7 @@ > MachineBasicBlock::iterator MBBI = MBB.begin(); > bool needsFrameMoves = (MMI && MMI->hasDebugInfo()) || > !Fn->doesNotThrow() || > - !UnwindTablesOptional; > + UnwindTablesMandatory; > > // Prepare for frame info. > unsigned FrameLabelId = 0; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Wed Apr 16 03:41:39 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 08:41:39 -0000 Subject: [llvm-commits] [llvm] r49782 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Message-ID: <200804160841.m3G8fduZ005938@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 03:41:36 2008 New Revision: 49782 URL: http://llvm.org/viewvc/llvm-project?rev=49782&view=rev Log: I was a bit overzealous with my last change. gcc4.0.1 did not diagnose this Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49782&r1=49781&r2=49782&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Wed Apr 16 03:41:36 2008 @@ -1138,7 +1138,7 @@ Instruction *InsertBefore = 0) { return new(3) SelectInst(C, S1, S2, Name, InsertBefore); } - static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "", + static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name, BasicBlock *InsertAtEnd) { return new(3) SelectInst(C, S1, S2, Name, InsertAtEnd); } From evan.cheng at apple.com Wed Apr 16 04:41:59 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 09:41:59 -0000 Subject: [llvm-commits] [llvm] r49783 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp Message-ID: <200804160941.m3G9fxKc008379@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 04:41:59 2008 New Revision: 49783 URL: http://llvm.org/viewvc/llvm-project?rev=49783&view=rev Log: Code clean up. Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=49783&r1=49782&r2=49783&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Apr 16 04:41:59 2008 @@ -728,103 +728,87 @@ bool MachineInstr::addRegisterKilled(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound) { - // Go through the machine instruction's operands to eliminate any potentially - // illegal conditions. I.e., a super- and sub-register both marked "kill". - for (unsigned i = 0, e = getNumOperands(); i < e;) { - MachineOperand &MO = getOperand(i); - if (MO.isRegister() && MO.isUse()) { - unsigned Reg = MO.getReg(); - - if (!Reg || IncomingReg == Reg || - !TargetRegisterInfo::isPhysicalRegister(Reg) || - !TargetRegisterInfo::isPhysicalRegister(IncomingReg)) { - ++i; - continue; - } - - if (RegInfo->isSuperRegister(IncomingReg, Reg) && MO.isKill()) - // The kill information is already handled by a super-register. Don't - // add this sub-register as a kill. - return true; - - if (RegInfo->isSubRegister(IncomingReg, Reg) && MO.isKill()) { - if (MO.isImplicit()) { - // Remove this implicit use that marks the sub-register - // "kill". Let the super-register take care of this - // information. - RemoveOperand(i); - --e; - continue; - } else { - // The super-register is going to take care of this kill - // information. - MO.setIsKill(false); - } - } - } - - ++i; - } - - // If the register already exists, then make sure it or its super-register is - // marked "kill". + bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg); + bool Found = false; + SmallVector DeadOps; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { MachineOperand &MO = getOperand(i); + if (!MO.isRegister() || !MO.isUse()) + continue; + unsigned Reg = MO.getReg(); + if (!Reg) + continue; - if (MO.isRegister() && MO.isUse()) { - unsigned Reg = MO.getReg(); - if (!Reg) continue; - - if (Reg == IncomingReg) { + if (Reg == IncomingReg) { + if (!Found) // One kill of reg per instruction. MO.setIsKill(); - return true; - } - - if (TargetRegisterInfo::isPhysicalRegister(Reg) && - TargetRegisterInfo::isPhysicalRegister(IncomingReg) && - RegInfo->isSuperRegister(IncomingReg, Reg) && - MO.isKill()) - // A super-register kill already exists. - return true; + Found = true; + } else if (isPhysReg && MO.isKill() && + TargetRegisterInfo::isPhysicalRegister(Reg)) { + // A super-register kill already exists. + if (RegInfo->isSuperRegister(IncomingReg, Reg)) + Found = true; + else if (RegInfo->isSubRegister(IncomingReg, Reg)) + DeadOps.push_back(i); } } + // Trim unneeded kill operands. + while (!DeadOps.empty()) { + unsigned OpIdx = DeadOps.back(); + if (getOperand(OpIdx).isImplicit()) + RemoveOperand(OpIdx); + else + getOperand(OpIdx).setIsKill(false); + DeadOps.pop_back(); + } + // If not found, this means an alias of one of the operands is killed. Add a // new implicit operand if required. - if (AddIfNotFound) { + if (!Found && AddIfNotFound) { addOperand(MachineOperand::CreateReg(IncomingReg, false /*IsDef*/, true /*IsImp*/, true /*IsKill*/)); return true; } - - return false; + return Found; } bool MachineInstr::addRegisterDead(unsigned IncomingReg, const TargetRegisterInfo *RegInfo, bool AddIfNotFound) { + bool isPhysReg = TargetRegisterInfo::isPhysicalRegister(IncomingReg); bool Found = false; + SmallVector DeadOps; for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { MachineOperand &MO = getOperand(i); - if (MO.isRegister() && MO.isDef()) { - unsigned Reg = MO.getReg(); - if (!Reg) - continue; - if (Reg == IncomingReg) { - MO.setIsDead(); + if (!MO.isRegister() || !MO.isDef()) + continue; + unsigned Reg = MO.getReg(); + if (Reg == IncomingReg) { + MO.setIsDead(); + Found = true; + } else if (isPhysReg && MO.isDead() && + TargetRegisterInfo::isPhysicalRegister(Reg)) { + // There exists a super-register that's marked dead. + if (RegInfo->isSuperRegister(IncomingReg, Reg)) Found = true; - break; - } else if (TargetRegisterInfo::isPhysicalRegister(Reg) && - TargetRegisterInfo::isPhysicalRegister(IncomingReg) && - RegInfo->isSuperRegister(IncomingReg, Reg) && - MO.isDead()) - // There exists a super-register that's marked dead. - return true; + else if (RegInfo->isSubRegister(IncomingReg, Reg)) + DeadOps.push_back(i); } } + // Trim unneeded dead operands. + while (!DeadOps.empty()) { + unsigned OpIdx = DeadOps.back(); + if (getOperand(OpIdx).isImplicit()) + RemoveOperand(OpIdx); + else + getOperand(OpIdx).setIsDead(false); + DeadOps.pop_back(); + } + // If not found, this means an alias of one of the operand is dead. Add a // new implicit operand. if (!Found && AddIfNotFound) { From evan.cheng at apple.com Wed Apr 16 04:46:40 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 09:46:40 -0000 Subject: [llvm-commits] [llvm] r49784 - in /llvm/trunk: include/llvm/CodeGen/LiveVariables.h lib/CodeGen/LiveVariables.cpp test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Message-ID: <200804160946.m3G9keqd008529@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 04:46:40 2008 New Revision: 49784 URL: http://llvm.org/viewvc/llvm-project?rev=49784&view=rev Log: Rewrite LiveVariable liveness computation. The new implementation is much simplified. It eliminated the nasty recursive routines and removed the partial def / use bookkeeping. There is also potential for performance improvement by replacing the conservative handling of partial physical register definitions. The code is currently disabled until live interval analysis is taught of the name scheme. This patch also fixed a couple of nasty corner cases. Added: llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h llvm/trunk/lib/CodeGen/LiveVariables.cpp Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=49784&r1=49783&r2=49784&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Wed Apr 16 04:46:40 2008 @@ -134,25 +134,15 @@ const TargetRegisterInfo *TRI; - // PhysRegInfo - Keep track of which instruction was the last def/use of a + // PhysRegInfo - Keep track of which instruction was the last def of a // physical register. This is a purely local property, because all physical // register references are presumed dead across basic blocks. - MachineInstr **PhysRegInfo; + MachineInstr **PhysRegDef; - // PhysRegUsed - Keep track of whether the physical register has been used - // after its last definition. This is local property. - bool *PhysRegUsed; - - // PhysRegPartUse - Keep track of which instruction was the last partial use - // of a physical register (e.g. on X86 a def of EAX followed by a use of AX). - // This is a purely local property. - MachineInstr **PhysRegPartUse; - - // PhysRegPartDef - Keep track of a list of instructions which "partially" - // defined the physical register (e.g. on X86 AX partially defines EAX). - // These are turned into use/mod/write if there is a use of the register - // later in the same block. This is local property. - SmallVector *PhysRegPartDef; + // PhysRegInfo - Keep track of which instruction was the last use of a + // physical register. This is a purely local property, because all physical + // register references are presumed dead across basic blocks. + MachineInstr **PhysRegUse; SmallVector *PHIVarInfo; @@ -160,22 +150,21 @@ // current basic block. DenseMap DistanceMap; - void addRegisterKills(unsigned Reg, MachineInstr *MI, - SmallSet &SubKills); - /// HandlePhysRegKill - Add kills of Reg and its sub-registers to the /// uses. Pay special attention to the sub-register uses which may come below /// the last use of the whole register. - bool HandlePhysRegKill(unsigned Reg, const MachineInstr *MI, - SmallSet &SubKills); - bool HandlePhysRegKill(unsigned Reg, MachineInstr *MI); + bool HandlePhysRegKill(unsigned Reg); + void HandlePhysRegUse(unsigned Reg, MachineInstr *MI); void HandlePhysRegDef(unsigned Reg, MachineInstr *MI); + /// FindLastPartialDef - Return the last partial def of the specified register. + /// Also returns the sub-register that's defined. + MachineInstr *FindLastPartialDef(unsigned Reg, unsigned &PartDefReg); + /// hasRegisterUseBelow - Return true if the specified register is used after /// the current instruction and before it's next definition. - bool hasRegisterUseBelow(unsigned Reg, - MachineBasicBlock::iterator I, + bool hasRegisterUseBelow(unsigned Reg, MachineBasicBlock::iterator I, MachineBasicBlock *MBB); /// analyzePHINodes - Gather information about the PHI nodes in here. In Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=49784&r1=49783&r2=49784&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Wed Apr 16 04:46:40 2008 @@ -154,147 +154,88 @@ MarkVirtRegAliveInBlock(VRInfo, MRI->getVRegDef(reg)->getParent(), *PI); } +/// FindLastPartialDef - Return the last partial def of the specified register. +/// Also returns the sub-register that's defined. +MachineInstr *LiveVariables::FindLastPartialDef(unsigned Reg, + unsigned &PartDefReg) { + unsigned LastDefReg = 0; + unsigned LastDefDist = 0; + MachineInstr *LastDef = NULL; + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + MachineInstr *Def = PhysRegDef[SubReg]; + if (!Def) + continue; + unsigned Dist = DistanceMap[Def]; + if (Dist > LastDefDist) { + LastDefReg = SubReg; + LastDef = Def; + LastDefDist = Dist; + } + } + PartDefReg = LastDefReg; + return LastDef; +} + /// HandlePhysRegUse - Turn previous partial def's into read/mod/writes. Add /// implicit defs to a machine instruction if there was an earlier def of its /// super-register. void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) { - // Turn previous partial def's into read/mod/write. - for (unsigned i = 0, e = PhysRegPartDef[Reg].size(); i != e; ++i) { - MachineInstr *Def = PhysRegPartDef[Reg][i]; - - // First one is just a def. This means the use is reading some undef bits. - if (i != 0) - Def->addOperand(MachineOperand::CreateReg(Reg, - false /*IsDef*/, - true /*IsImp*/, - true /*IsKill*/)); - - Def->addOperand(MachineOperand::CreateReg(Reg, - true /*IsDef*/, - true /*IsImp*/)); + // If there was a previous use or a "full" def all is well. + if (!PhysRegDef[Reg] && !PhysRegUse[Reg]) { + // Otherwise, the last sub-register def implicitly defines this register. + // e.g. + // AH = + // AL = ... , + // = AH + // ... + // = EAX + // All of the sub-registers must have been defined before the use of Reg! + unsigned PartDefReg = 0; + MachineInstr *LastPartialDef = FindLastPartialDef(Reg, PartDefReg); + // If LastPartialDef is NULL, it must be using a livein register. + if (LastPartialDef) { + LastPartialDef->addOperand(MachineOperand::CreateReg(Reg, true/*IsDef*/, + true/*IsImp*/)); + PhysRegDef[Reg] = LastPartialDef; + std::set Processed; + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + if (Processed.count(SubReg)) + continue; + if (SubReg == PartDefReg || TRI->isSubRegister(PartDefReg, SubReg)) + continue; + // This part of Reg was defined before the last partial def. It's killed + // here. + LastPartialDef->addOperand(MachineOperand::CreateReg(SubReg, + false/*IsDef*/, + true/*IsImp*/)); + PhysRegDef[SubReg] = LastPartialDef; + for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS) + Processed.insert(*SS); + } + } } - PhysRegPartDef[Reg].clear(); - // There was an earlier def of a super-register. Add implicit def to that MI. // // A: EAX = ... // B: ... = AX // - // Add implicit def to A. - if (PhysRegInfo[Reg] && PhysRegInfo[Reg] != PhysRegPartUse[Reg] && - !PhysRegUsed[Reg]) { - MachineInstr *Def = PhysRegInfo[Reg]; - - if (!Def->modifiesRegister(Reg)) + // Add implicit def to A if there isn't a use of AX (or EAX) before B. + if (!PhysRegUse[Reg]) { + MachineInstr *Def = PhysRegDef[Reg]; + if (Def && !Def->modifiesRegister(Reg)) Def->addOperand(MachineOperand::CreateReg(Reg, true /*IsDef*/, true /*IsImp*/)); } - - // There is a now a proper use, forget about the last partial use. - PhysRegPartUse[Reg] = NULL; - PhysRegInfo[Reg] = MI; - PhysRegUsed[Reg] = true; - - // Now reset the use information for the sub-registers. + + // Remember this use. + PhysRegUse[Reg] = MI; for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); - unsigned SubReg = *SubRegs; ++SubRegs) { - PhysRegPartUse[SubReg] = NULL; - PhysRegInfo[SubReg] = MI; - PhysRegUsed[SubReg] = true; - } - - for (const unsigned *SuperRegs = TRI->getSuperRegisters(Reg); - unsigned SuperReg = *SuperRegs; ++SuperRegs) { - // Remember the partial use of this super-register if it was previously - // defined. - bool HasPrevDef = PhysRegInfo[SuperReg] != NULL; - - if (!HasPrevDef) - // No need to go up more levels. A def of a register also sets its sub- - // registers. So if PhysRegInfo[SuperReg] is NULL, it means SuperReg's - // super-registers are not previously defined. - for (const unsigned *SSRegs = TRI->getSuperRegisters(SuperReg); - unsigned SSReg = *SSRegs; ++SSRegs) - if (PhysRegInfo[SSReg] != NULL) { - HasPrevDef = true; - break; - } - - if (HasPrevDef) { - PhysRegInfo[SuperReg] = MI; - PhysRegPartUse[SuperReg] = MI; - } - } -} - -/// addRegisterKills - For all of a register's sub-registers that are killed in -/// at this machine instruction, mark them as "killed". (If the machine operand -/// isn't found, add it first.) -void LiveVariables::addRegisterKills(unsigned Reg, MachineInstr *MI, - SmallSet &SubKills) { - if (SubKills.count(Reg) == 0) { - MI->addRegisterKilled(Reg, TRI, true); - return; - } - - for (const unsigned *SubRegs = TRI->getImmediateSubRegisters(Reg); unsigned SubReg = *SubRegs; ++SubRegs) - addRegisterKills(SubReg, MI, SubKills); -} - -/// HandlePhysRegKill - The recursive version of HandlePhysRegKill. Returns true -/// if: -/// -/// - The register has no sub-registers and the machine instruction is the -/// last def/use of the register, or -/// - The register has sub-registers and none of them are killed elsewhere. -/// -/// SubKills is filled with the set of sub-registers that are killed elsewhere. -bool LiveVariables::HandlePhysRegKill(unsigned Reg, const MachineInstr *RefMI, - SmallSet &SubKills) { - const unsigned *SubRegs = TRI->getImmediateSubRegisters(Reg); - - for (; unsigned SubReg = *SubRegs; ++SubRegs) { - const MachineInstr *LastRef = PhysRegInfo[SubReg]; - - if (LastRef != RefMI || - !HandlePhysRegKill(SubReg, RefMI, SubKills)) - SubKills.insert(SubReg); - } - - if (*SubRegs == 0) { - // No sub-registers, just check if reg is killed by RefMI. - if (PhysRegInfo[Reg] == RefMI && PhysRegInfo[Reg]->readsRegister(Reg)) { - return true; - } - } else if (SubKills.empty()) { - // None of the sub-registers are killed elsewhere. - return true; - } - - return false; -} - -/// HandlePhysRegKill - Returns true if the whole register is killed in the -/// machine instruction. If only some of its sub-registers are killed in this -/// machine instruction, then mark those as killed and return false. -bool LiveVariables::HandlePhysRegKill(unsigned Reg, MachineInstr *RefMI) { - SmallSet SubKills; - - if (HandlePhysRegKill(Reg, RefMI, SubKills)) { - // This machine instruction kills this register. - RefMI->addRegisterKilled(Reg, TRI, true); - return true; - } - - // Some sub-registers are killed by another machine instruction. - for (const unsigned *SubRegs = TRI->getImmediateSubRegisters(Reg); - unsigned SubReg = *SubRegs; ++SubRegs) - addRegisterKills(SubReg, RefMI, SubKills); - - return false; + PhysRegUse[SubReg] = MI; } /// hasRegisterUseBelow - Return true if the specified register is used after @@ -348,8 +289,8 @@ DistanceMap.insert(std::make_pair(I, CurDist)); } - unsigned EarliestUse = CurDist; - for (unsigned i = 0, e = Uses.size(); i != e; ++i) { + unsigned EarliestUse = DistanceMap[Uses[0]]; + for (unsigned i = 1, e = Uses.size(); i != e; ++i) { unsigned Dist = DistanceMap[Uses[i]]; if (Dist < EarliestUse) EarliestUse = Dist; @@ -363,46 +304,124 @@ return true; } +bool LiveVariables::HandlePhysRegKill(unsigned Reg) { + if (!PhysRegUse[Reg] && !PhysRegDef[Reg]) + return false; + + MachineInstr *LastRefOrPartRef = PhysRegUse[Reg] + ? PhysRegUse[Reg] : PhysRegDef[Reg]; + unsigned LastRefOrPartRefDist = DistanceMap[LastRefOrPartRef]; + // The whole register is used. + // AL = + // AH = + // + // = AX + // = AL, AX + // AX = + // + // Or whole register is defined, but not used at all. + // AX = + // ... + // AX = + // + // Or whole register is defined, but only partly used. + // AX = AL + // = AL + // AX = + std::set PartUses; + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + if (MachineInstr *Use = PhysRegUse[SubReg]) { + PartUses.insert(SubReg); + for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS) + PartUses.insert(*SS); + unsigned Dist = DistanceMap[Use]; + if (Dist > LastRefOrPartRefDist) { + LastRefOrPartRefDist = Dist; + LastRefOrPartRef = Use; + } + } + } + if (LastRefOrPartRef == PhysRegDef[Reg]) + // Not used at all. + LastRefOrPartRef->addRegisterDead(Reg, TRI, true); + + /* Partial uses. Mark register def dead and add implicit def of + sub-registers which are used. + FIXME: LiveIntervalAnalysis can't handle this yet! + EAX = op AL + That is, EAX def is dead but AL def extends pass it. + Enable this after live interval analysis is fixed to improve codegen! + else if (!PhysRegUse[Reg]) { + PhysRegDef[Reg]->addRegisterDead(Reg, TRI, true); + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + if (PartUses.count(SubReg)) { + PhysRegDef[Reg]->addOperand(MachineOperand::CreateReg(SubReg, + true, true)); + LastRefOrPartRef->addRegisterKilled(SubReg, TRI, true); + for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS) + PartUses.erase(*SS); + } + } + } */ + else + LastRefOrPartRef->addRegisterKilled(Reg, TRI, true); + return true; +} + void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) { - // Does this kill a previous version of this register? - if (MachineInstr *LastRef = PhysRegInfo[Reg]) { - if (PhysRegUsed[Reg]) { - if (!HandlePhysRegKill(Reg, LastRef)) { - if (PhysRegPartUse[Reg]) - PhysRegPartUse[Reg]->addRegisterKilled(Reg, TRI, true); - } - } else if (PhysRegPartUse[Reg]) { - // Add implicit use / kill to last partial use. - PhysRegPartUse[Reg]->addRegisterKilled(Reg, TRI, true); - } else if (LastRef != MI) { - // Defined, but not used. However, watch out for cases where a super-reg - // is also defined on the same MI. - LastRef->addRegisterDead(Reg, TRI); + // What parts of the register are previously defined? + std::set Live; + if (PhysRegDef[Reg] || PhysRegUse[Reg]) { + Live.insert(Reg); + for (const unsigned *SS = TRI->getSubRegisters(Reg); *SS; ++SS) + Live.insert(*SS); + } else { + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + // If a register isn't itself defined, but all parts that make up of it + // are defined, then consider it also defined. + // e.g. + // AL = + // AH = + // = AX + if (PhysRegDef[SubReg] || PhysRegUse[SubReg]) { + Live.insert(SubReg); + for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS) + Live.insert(*SS); + } } } - for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); - unsigned SubReg = *SubRegs; ++SubRegs) { - if (MachineInstr *LastRef = PhysRegInfo[SubReg]) { - if (PhysRegUsed[SubReg]) { - if (!HandlePhysRegKill(SubReg, LastRef)) { - if (PhysRegPartUse[SubReg]) - PhysRegPartUse[SubReg]->addRegisterKilled(SubReg, TRI, true); - } - } else if (PhysRegPartUse[SubReg]) { - // Add implicit use / kill to last use of a sub-register. - PhysRegPartUse[SubReg]->addRegisterKilled(SubReg, TRI, true); - } else if (LastRef != MI) { - // This must be a def of the subreg on the same MI. - LastRef->addRegisterDead(SubReg, TRI); + // Start from the largest piece, find the last time any part of the register + // is referenced. + if (!HandlePhysRegKill(Reg)) { + // Only some of the sub-registers are used. + for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); + unsigned SubReg = *SubRegs; ++SubRegs) { + if (!Live.count(SubReg)) + // Skip if this sub-register isn't defined. + continue; + if (HandlePhysRegKill(SubReg)) { + Live.erase(SubReg); + for (const unsigned *SS = TRI->getSubRegisters(SubReg); *SS; ++SS) + Live.erase(*SS); } } + assert(Live.empty() && "Not all defined registers are killed / dead?"); } if (MI) { + // Does this extend the live range of a super-register? + std::set Processed; for (const unsigned *SuperRegs = TRI->getSuperRegisters(Reg); unsigned SuperReg = *SuperRegs; ++SuperRegs) { - if (PhysRegInfo[SuperReg] && PhysRegInfo[SuperReg] != MI) { + if (Processed.count(SuperReg)) + continue; + MachineInstr *LastRef = PhysRegUse[SuperReg] + ? PhysRegUse[SuperReg] : PhysRegDef[SuperReg]; + if (LastRef && LastRef != MI) { // The larger register is previously defined. Now a smaller part is // being re-defined. Treat it as read/mod/write if there are uses // below. @@ -410,35 +429,41 @@ // AX = EAX, EAX // ... /// = EAX - if (MI && hasRegisterUseBelow(SuperReg, MI, MI->getParent())) { + if (hasRegisterUseBelow(SuperReg, MI, MI->getParent())) { MI->addOperand(MachineOperand::CreateReg(SuperReg, false/*IsDef*/, - true/*IsImp*/,true/*IsKill*/)); + true/*IsImp*/,true/*IsKill*/)); MI->addOperand(MachineOperand::CreateReg(SuperReg, true/*IsDef*/, true/*IsImp*/)); - PhysRegInfo[SuperReg] = MI; + PhysRegDef[SuperReg] = MI; + PhysRegUse[SuperReg] = NULL; + Processed.insert(SuperReg); + for (const unsigned *SS = TRI->getSubRegisters(SuperReg); *SS; ++SS) { + PhysRegDef[*SS] = MI; + PhysRegUse[*SS] = NULL; + Processed.insert(*SS); + } } else { - PhysRegInfo[SuperReg]->addRegisterKilled(SuperReg, TRI, true); - PhysRegInfo[SuperReg] = NULL; + // Otherwise, the super register is killed. + if (HandlePhysRegKill(SuperReg)) { + PhysRegDef[SuperReg] = NULL; + PhysRegUse[SuperReg] = NULL; + for (const unsigned *SS = TRI->getSubRegisters(SuperReg); *SS; ++SS) { + PhysRegDef[*SS] = NULL; + PhysRegUse[*SS] = NULL; + Processed.insert(*SS); + } + } } - PhysRegUsed[SuperReg] = false; - PhysRegPartUse[SuperReg] = NULL; - } else { - // Remember this partial def. - PhysRegPartDef[SuperReg].push_back(MI); } } - PhysRegInfo[Reg] = MI; - PhysRegUsed[Reg] = false; - PhysRegPartDef[Reg].clear(); - PhysRegPartUse[Reg] = NULL; - + // Remember this def. + PhysRegDef[Reg] = MI; + PhysRegUse[Reg] = NULL; for (const unsigned *SubRegs = TRI->getSubRegisters(Reg); unsigned SubReg = *SubRegs; ++SubRegs) { - PhysRegInfo[SubReg] = MI; - PhysRegUsed[SubReg] = false; - PhysRegPartDef[SubReg].clear(); - PhysRegPartUse[SubReg] = NULL; + PhysRegDef[SubReg] = MI; + PhysRegUse[SubReg] = NULL; } } } @@ -451,14 +476,11 @@ ReservedRegisters = TRI->getReservedRegs(mf); unsigned NumRegs = TRI->getNumRegs(); - PhysRegInfo = new MachineInstr*[NumRegs]; - PhysRegUsed = new bool[NumRegs]; - PhysRegPartUse = new MachineInstr*[NumRegs]; - PhysRegPartDef = new SmallVector[NumRegs]; + PhysRegDef = new MachineInstr*[NumRegs]; + PhysRegUse = new MachineInstr*[NumRegs]; PHIVarInfo = new SmallVector[MF->getNumBlockIDs()]; - std::fill(PhysRegInfo, PhysRegInfo + NumRegs, (MachineInstr*)0); - std::fill(PhysRegUsed, PhysRegUsed + NumRegs, false); - std::fill(PhysRegPartUse, PhysRegPartUse + NumRegs, (MachineInstr*)0); + std::fill(PhysRegDef, PhysRegDef + NumRegs, (MachineInstr*)0); + std::fill(PhysRegUse, PhysRegUse + NumRegs, (MachineInstr*)0); /// Get some space for a respectable number of registers. VirtRegInfo.resize(64); @@ -501,38 +523,43 @@ if (MI->getOpcode() == TargetInstrInfo::PHI) NumOperandsToProcess = 1; - // Process all uses. + SmallVector UseRegs; + SmallVector DefRegs; for (unsigned i = 0; i != NumOperandsToProcess; ++i) { const MachineOperand &MO = MI->getOperand(i); - - if (MO.isRegister() && MO.isUse() && MO.getReg()) { + if (MO.isRegister() && MO.getReg()) { unsigned MOReg = MO.getReg(); - - if (TargetRegisterInfo::isVirtualRegister(MOReg)) - HandleVirtRegUse(MOReg, MBB, MI); - else if (TargetRegisterInfo::isPhysicalRegister(MOReg) && - !ReservedRegisters[MOReg]) - HandlePhysRegUse(MOReg, MI); + if (!MOReg) + continue; + if (MO.isUse()) + UseRegs.push_back(MOReg); + if (MO.isDef()) + DefRegs.push_back(MOReg); } } - // Process all defs. - for (unsigned i = 0; i != NumOperandsToProcess; ++i) { - const MachineOperand &MO = MI->getOperand(i); - - if (MO.isRegister() && MO.isDef() && MO.getReg()) { - unsigned MOReg = MO.getReg(); - - if (TargetRegisterInfo::isVirtualRegister(MOReg)) { - VarInfo &VRInfo = getVarInfo(MOReg); + // Process all uses. + for (unsigned i = 0, e = UseRegs.size(); i != e; ++i) { + unsigned MOReg = UseRegs[i]; + if (TargetRegisterInfo::isVirtualRegister(MOReg)) + HandleVirtRegUse(MOReg, MBB, MI); + else if (TargetRegisterInfo::isPhysicalRegister(MOReg) && + !ReservedRegisters[MOReg]) + HandlePhysRegUse(MOReg, MI); + } - if (VRInfo.AliveBlocks.none()) - // If vr is not alive in any block, then defaults to dead. - VRInfo.Kills.push_back(MI); - } else if (TargetRegisterInfo::isPhysicalRegister(MOReg) && - !ReservedRegisters[MOReg]) { - HandlePhysRegDef(MOReg, MI); - } + // Process all defs. + for (unsigned i = 0, e = DefRegs.size(); i != e; ++i) { + unsigned MOReg = DefRegs[i]; + if (TargetRegisterInfo::isVirtualRegister(MOReg)) { + VarInfo &VRInfo = getVarInfo(MOReg); + + if (VRInfo.AliveBlocks.none()) + // If vr is not alive in any block, then defaults to dead. + VRInfo.Kills.push_back(MI); + } else if (TargetRegisterInfo::isPhysicalRegister(MOReg) && + !ReservedRegisters[MOReg]) { + HandlePhysRegDef(MOReg, MI); } } } @@ -569,19 +596,14 @@ } } - // Loop over PhysRegInfo, killing any registers that are available at the - // end of the basic block. This also resets the PhysRegInfo map. + // Loop over PhysRegDef / PhysRegUse, killing any registers that are + // available at the end of the basic block. for (unsigned i = 0; i != NumRegs; ++i) - if (PhysRegInfo[i]) + if (PhysRegDef[i] || PhysRegUse[i]) HandlePhysRegDef(i, 0); - // Clear some states between BB's. These are purely local information. - for (unsigned i = 0; i != NumRegs; ++i) - PhysRegPartDef[i].clear(); - - std::fill(PhysRegInfo, PhysRegInfo + NumRegs, (MachineInstr*)0); - std::fill(PhysRegUsed, PhysRegUsed + NumRegs, false); - std::fill(PhysRegPartUse, PhysRegPartUse + NumRegs, (MachineInstr*)0); + std::fill(PhysRegDef, PhysRegDef + NumRegs, (MachineInstr*)0); + std::fill(PhysRegUse, PhysRegUse + NumRegs, (MachineInstr*)0); } // Convert and transfer the dead / killed information we have gathered into @@ -608,10 +630,8 @@ assert(Visited.count(&*i) != 0 && "unreachable basic block found"); #endif - delete[] PhysRegInfo; - delete[] PhysRegUsed; - delete[] PhysRegPartUse; - delete[] PhysRegPartDef; + delete[] PhysRegDef; + delete[] PhysRegUse; delete[] PHIVarInfo; return false; Added: llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll?rev=49784&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Wed Apr 16 04:46:40 2008 @@ -0,0 +1,48 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin + + %struct.CGPoint = type { double, double } + %struct.NSArray = type { %struct.NSObject } + %struct.NSAssertionHandler = type { %struct.NSObject, i8* } + %struct.NSDockTile = type { %struct.NSObject, %struct.NSObject*, i8*, %struct.NSView*, %struct.NSView*, %struct.NSView*, %struct.NSArray*, %struct._SPFlags, %struct.CGPoint, [5 x %struct.NSObject*] } + %struct.NSDocument = type { %struct.NSObject, %struct.NSWindow*, %struct.NSObject*, %struct.NSURL*, %struct.NSArray*, %struct.NSPrintInfo*, i64, %struct.NSView*, %struct.NSObject*, %struct.NSObject*, %struct.NSUndoManager*, %struct._BCFlags2, %struct.NSArray* } + %struct.AA = type { %struct.NSObject, %struct.NSDocument*, %struct.NSURL*, %struct.NSArray*, %struct.NSArray* } + %struct.NSError = type { %struct.NSObject, i8*, i64, %struct.NSArray*, %struct.NSArray* } + %struct.NSImage = type { %struct.NSObject, %struct.NSArray*, %struct.CGPoint, %struct._BCFlags2, %struct.NSObject*, %struct._NSImageAuxiliary* } + %struct.NSMutableArray = type { %struct.NSArray } + %struct.NSObject = type { %struct.NSObject* } + %struct.NSPrintInfo = type { %struct.NSObject, %struct.NSMutableArray*, %struct.NSObject* } + %struct.NSRect = type { %struct.CGPoint, %struct.CGPoint } + %struct.NSRegion = type opaque + %struct.NSResponder = type { %struct.NSObject, %struct.NSObject* } + %struct.NSToolbar = type { %struct.NSObject, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSObject*, %struct.NSArray*, i8*, %struct.NSObject*, %struct.NSWindow*, %struct.NSObject*, %struct.NSObject*, i64, %struct._BCFlags2, i64, %struct.NSObject* } + %struct.NSURL = type { %struct.NSObject, %struct.NSArray*, %struct.NSURL*, i8*, i8* } + %struct.NSUndoManager = type { %struct.NSObject, %struct.NSObject*, %struct.NSObject*, %struct.NSArray*, i64, %struct._SPFlags, %struct.NSObject*, i8*, i8*, i8* } + %struct.NSView = type { %struct.NSResponder, %struct.NSRect, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSWindow*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct.NSObject*, %struct._NSViewAuxiliary*, %struct._BCFlags, %struct._SPFlags } + %struct.NSWindow = type { %struct.NSResponder, %struct.NSRect, %struct.NSObject*, %struct.NSObject*, %struct.NSResponder*, %struct.NSView*, %struct.NSView*, %struct.NSObject*, %struct.NSObject*, i32, i64, i32, %struct.NSArray*, %struct.NSObject*, i8, i8, i8, i8, i8*, i8*, %struct.NSImage*, i32, %struct.NSMutableArray*, %struct.NSURL*, %struct.CGPoint*, %struct.NSArray*, %struct.NSArray*, %struct.__wFlags, %struct.NSObject*, %struct.NSView*, %struct.NSWindowAuxiliary* } + %struct.NSWindowAuxiliary = type { %struct.NSObject, %struct.NSArray*, %struct.NSDockTile*, %struct._NSWindowAnimator*, %struct.NSRect, i32, %struct.NSAssertionHandler*, %struct.NSUndoManager*, %struct.NSWindowController*, %struct.NSAssertionHandler*, %struct.NSObject*, i32, %struct.__CFRunLoopObserver*, %struct.__CFRunLoopObserver*, %struct.NSArray*, %struct.NSArray*, %struct.NSView*, %struct.NSRegion*, %struct.NSWindow*, %struct.NSWindow*, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSArray*, %struct.NSWindow*, %struct.CGPoint, %struct.NSObject*, i8*, i8*, i32, %struct.NSObject*, %struct.NSArray*, double, %struct.CGPoint, %struct.NSArray*, %struct.NSMutableArray*, %struct.NSMutableArray*, %struct.NSWindow*, %struct.NSView*, %struct.NSArray*, %struct.__auxWFlags, i32, i8*, double, %struct.NSObject*, %struct.NSObject*, %struct.__CFArray*, %struct.NSRegion*, %struct.NSArray*, %struct.NSRect, %struct.NSToolbar*, %struct.NSRect, %struct.NSMutableArray* } + %struct.NSWindowController = type { %struct.NSResponder, %struct.NSWindow*, %struct.NSArray*, %struct.NSDocument*, %struct.NSArray*, %struct.NSObject*, %struct._SPFlags, %struct.NSArray*, %struct.NSObject* } + %struct._BCFlags = type <{ i8, i8, i8, i8 }> + %struct._BCFlags2 = type <{ i8, [3 x i8] }> + %struct._NSImageAuxiliary = type opaque + %struct._NSViewAuxiliary = type opaque + %struct._NSWindowAnimator = type opaque + %struct._SPFlags = type <{ i32 }> + %struct.__CFArray = type opaque + %struct.__CFRunLoopObserver = type opaque + %struct.__auxWFlags = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i16 } + %struct.__wFlags = type <{ i8, i8, i8, i8, i8, i8, i8, i8 }> + %struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* } + %struct.objc_selector = type opaque +@"\01L_OBJC_MESSAGE_REF_228" = internal global %struct._message_ref_t zeroinitializer ; <%struct._message_ref_t*> [#uses=1] + at llvm.used1 = appending global [1 x i8*] [ i8* bitcast (void (%struct.AA*, %struct._message_ref_t*, %struct.NSError*, i64, %struct.NSObject*, %struct.objc_selector*, i8*)* @"-[AA BB:optionIndex:delegate:CC:contextInfo:]" to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define void @"-[AA BB:optionIndex:delegate:CC:contextInfo:]"(%struct.AA* %self, %struct._message_ref_t* %_cmd, %struct.NSError* %inError, i64 %inOptionIndex, %struct.NSObject* %inDelegate, %struct.objc_selector* %inDidRecoverSelector, i8* %inContextInfo) { +entry: + %tmp105 = load %struct.NSArray** null, align 8 ; <%struct.NSArray*> [#uses=1] + %tmp107 = load %struct.NSObject** null, align 8 ; <%struct.NSObject*> [#uses=1] + call void null( %struct.NSObject* %tmp107, %struct._message_ref_t* @"\01L_OBJC_MESSAGE_REF_228", %struct.NSArray* %tmp105, i8 signext 0 ) + %tmp111 = call %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)* @objc_msgSend( %struct.NSObject* null, %struct.objc_selector* null, i32 0, i8* null ) ; <%struct.NSObject*> [#uses=0] + ret void +} + +declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...) From ggreif at gmail.com Wed Apr 16 05:37:38 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 10:37:38 -0000 Subject: [llvm-commits] [llvm] r49785 - /llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h Message-ID: <200804161037.m3GAbeiB010106@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 05:37:26 2008 New Revision: 49785 URL: http://llvm.org/viewvc/llvm-project?rev=49785&view=rev Log: pass V to dyn_cast by const reference, this avoids copy-constructing and destructing all the time. especially important if these constructors are not accessible Modified: llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h?rev=49785&r1=49784&r2=49785&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Support/Casting.h Wed Apr 16 05:37:26 2008 @@ -221,7 +221,7 @@ // template -inline typename cast_retty::ret_type dyn_cast(Y Val) { +inline typename cast_retty::ret_type dyn_cast(const Y &Val) { return isa(Val) ? cast(Val) : 0; } @@ -229,7 +229,7 @@ // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(Y Val) { +inline typename cast_retty::ret_type dyn_cast_or_null(const Y &Val) { return (Val && isa(Val)) ? cast(Val) : 0; } From ggreif at gmail.com Wed Apr 16 05:46:59 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 10:46:59 -0000 Subject: [llvm-commits] [llvm] r49786 - in /llvm/branches/ggreif/use-diet/lib/Transforms: IPO/GlobalDCE.cpp IPO/IPConstantPropagation.cpp Scalar/DCE.cpp Scalar/InstructionCombining.cpp Message-ID: <200804161047.m3GAl1Sl010402@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 05:46:48 2008 New Revision: 49786 URL: http://llvm.org/viewvc/llvm-project?rev=49786&view=rev Log: back out r49697, it is not needed any more Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp?rev=49786&r1=49785&r2=49786&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalDCE.cpp Wed Apr 16 05:46:48 2008 @@ -158,9 +158,9 @@ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) // For all operands... for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U) - if (GlobalValue *GV = dyn_cast(U->get())) + if (GlobalValue *GV = dyn_cast(*U)) GlobalIsNeeded(GV); - else if (Constant *C = dyn_cast(U->get())) + else if (Constant *C = dyn_cast(*U)) MarkUsedGlobalsAsNeeded(C); } } Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=49786&r1=49785&r2=49786&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IPConstantPropagation.cpp Wed Apr 16 05:46:48 2008 @@ -98,7 +98,7 @@ if (*AI == &F) return false; // Passes the function into itself if (!ArgumentConstants[i].second) { - if (Constant *C = dyn_cast(AI->get())) { + if (Constant *C = dyn_cast(*AI)) { if (!ArgumentConstants[i].first) ArgumentConstants[i].first = C; else if (ArgumentConstants[i].first != C) { Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp?rev=49786&r1=49785&r2=49786&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/DCE.cpp Wed Apr 16 05:46:48 2008 @@ -102,7 +102,7 @@ // go dead after this one is removed. // for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) - if (Instruction *Used = dyn_cast(OI->get())) + if (Instruction *Used = dyn_cast(*OI)) WorkList.push_back(Used); // Remove the instruction. Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp?rev=49786&r1=49785&r2=49786&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Wed Apr 16 05:46:48 2008 @@ -8484,7 +8484,7 @@ // the call. for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(), E = CS.arg_end(); I != E; ++I) - if (CastInst *CI = dyn_cast(I->get())) { + if (CastInst *CI = dyn_cast(*I)) { // If this cast does not effect the value passed through the varargs // area, we can eliminate the use of the cast. Value *Op = CI->getOperand(0); @@ -8575,7 +8575,7 @@ if (CallerPAL.getParamAttrs(i + 1) & ParamAttr::typeIncompatible(ParamTy)) return false; // Attribute not compatible with transformed value. - ConstantInt *c = dyn_cast(AI->get()); + ConstantInt *c = dyn_cast(*AI); // Some conversions are safe even if we do not have a body. // Either we can cast directly, or we can upconvert the argument bool isConvertible = ActTy == ParamTy || From ggreif at gmail.com Wed Apr 16 06:43:47 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 11:43:47 -0000 Subject: [llvm-commits] [llvm] r49787 - /llvm/trunk/include/llvm/Support/Casting.h Message-ID: <200804161143.m3GBhmY8012256@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 06:43:47 2008 New Revision: 49787 URL: http://llvm.org/viewvc/llvm-project?rev=49787&view=rev Log: merge of r49785 (from branches/ggreif/use-diet): pass V to dyn_cast by const reference, this avoids copy-constructing and destructing all the time. especially important if these constructors are not accessible Modified: llvm/trunk/include/llvm/Support/Casting.h Modified: llvm/trunk/include/llvm/Support/Casting.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Casting.h?rev=49787&r1=49786&r2=49787&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Casting.h (original) +++ llvm/trunk/include/llvm/Support/Casting.h Wed Apr 16 06:43:47 2008 @@ -221,7 +221,7 @@ // template -inline typename cast_retty::ret_type dyn_cast(Y Val) { +inline typename cast_retty::ret_type dyn_cast(const Y &Val) { return isa(Val) ? cast(Val) : 0; } @@ -229,7 +229,7 @@ // value is accepted. // template -inline typename cast_retty::ret_type dyn_cast_or_null(Y Val) { +inline typename cast_retty::ret_type dyn_cast_or_null(const Y &Val) { return (Val && isa(Val)) ? cast(Val) : 0; } From foldr at codedgers.com Wed Apr 16 08:45:52 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Wed, 16 Apr 2008 09:45:52 -0400 (EDT) Subject: [llvm-commits] [PATCH] Add method empty() to sys::Path. Message-ID: <44344.81.172.134.32.1208353552.squirrel@webmail.sophsolutions.com> Add method empty() to sys::Path. Also remove some unnecessary trailing whitespace:) -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-method-empty-to-sys-Path.-Also-remove-some-un.patch Type: text/x-patch Size: 11761 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080416/9b1f9958/attachment.bin From ggreif at gmail.com Wed Apr 16 09:25:34 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 14:25:34 -0000 Subject: [llvm-commits] [llvm] r49788 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804161425.m3GEPYuF017832@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 09:25:33 2008 New Revision: 49788 URL: http://llvm.org/viewvc/llvm-project?rev=49788&view=rev Log: speed up running tests by leaving .testresults file empty and using some stupid tricks to recover the "PASS: xxx" line into the summary. this reorders the passed tests to the end, so the VERBOSE option restores the in-order, but slow behaviour. Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49788&r1=49787&r2=49788&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Wed Apr 16 09:25:33 2008 @@ -131,7 +131,11 @@ puts $makeFileId "\t echo source \$(LLVM_SRC_ROOT)/test/lib/llvm.exp; \\" puts $makeFileId "\t echo proc fail { msg } { puts '\"FAIL: \$\$msg\"' '; exit 1' }; \\" puts $makeFileId "\t echo proc xfail { msg } { puts '\"XFAIL: \$\$msg\"' }; \\" - puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\" + if $verbose>0 { + puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\" + } else { + puts $makeFileId "\t echo proc pass { msg } { }; \\" + } puts $makeFileId "\t echo proc xpass { msg } { puts '\"XPASS: \$\$msg\"' '; exit 1' }; \\" if $verbose>=2 { puts $makeFileId "\t echo proc verbose { msg level } { puts stderr '\"\$\$msg\"' }; \\" @@ -153,7 +157,10 @@ puts $makeFileId "" puts $makeFileId "Test.makefile.out: \$(TESTS)" - puts $makeFileId "\t@ cat \$(TESTS) > \$@" + puts $makeFileId "\t@ cat \$(TESTS) /dev/null > \$@" + if $verbose<1 { + puts $makeFileId "\t@ wc \$(TESTS) /dev/null | grep -E ' +0 +0 +0 ' | grep -v ' total\$\$' | grep -v ' /dev/null\$\$' | sed -e 's| *0 *0 *0 |PASS: \$(SUBDIR)\\/|1' -e 's|.testresults\$\$||1' >> \$@" + } puts $makeFileId "" close $makeFileId From ggreif at gmail.com Wed Apr 16 09:57:07 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 14:57:07 -0000 Subject: [llvm-commits] [llvm] r49789 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804161457.m3GEv7Bv018763@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 09:57:07 2008 New Revision: 49789 URL: http://llvm.org/viewvc/llvm-project?rev=49789&view=rev Log: more correct output of filenames Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49789&r1=49788&r2=49789&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Wed Apr 16 09:57:07 2008 @@ -179,7 +179,8 @@ #set timeout 40 set filename [file tail $test] - verbose "ABOUT TO RUN: [file join $subdir $filename]" 2 + set subdir_filename "[file join $subdir $filename]" + verbose "ABOUT TO RUN: $subdir_filename" 2 set outcome PASS set tmpFile "$filename.tmp" @@ -267,7 +268,7 @@ if { $numLines == 0 } { - fail "$test: \nDoes not have a RUN line\n" + fail "$subdir_filename: \nDoes not have a RUN line\n" } else { set failed 0 for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } { @@ -290,9 +291,9 @@ set PRNUMS " for $PRNUMS" } if { $outcome == "XFAIL" } { - xpass "$test$PRNUMS" + xpass "$subdir_filename$PRNUMS" } else { - pass "$test$PRNUMS" + pass "$subdir_filename$PRNUMS" } } } From ggreif at gmail.com Wed Apr 16 10:09:01 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 15:09:01 -0000 Subject: [llvm-commits] [llvm] r49790 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804161509.m3GF91Qn019142@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 10:09:01 2008 New Revision: 49790 URL: http://llvm.org/viewvc/llvm-project?rev=49790&view=rev Log: even nicer filenames (for failed tests now) Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49790&r1=49789&r2=49790&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Wed Apr 16 10:09:01 2008 @@ -1,5 +1,5 @@ # This procedure executes one line of a test case's execution script. -proc execOneLine { test PRS outcome lineno line } { +proc execOneLine { subdir_filename test PRS outcome lineno line } { set status 0 set resultmsg "" set retval [ catch { eval exec -keepnewline -- $line } errmsg ] @@ -14,21 +14,21 @@ CHILDSTATUS { set status [lindex $::errorCode 2] if { $status != 0 } { - set resultmsg "$test$PRS\nFailed with exit($status)$errmsg" + set resultmsg "$subdir_filename$PRS\nFailed with exit($status)$errmsg" } } CHILDKILLED { set signal [lindex $::errorCode 2] - set resultmsg "$test$PRS\nFailed with signal($signal)$errmsg" + set resultmsg "$subdir_filename$PRS\nFailed with signal($signal)$errmsg" } CHILDSUSP { set signal [lindex $::errorCode 2] - set resultmsg "$test$PRS\nFailed with suspend($signal)$errmsg" + set resultmsg "$subdir_filename$PRS\nFailed with suspend($signal)$errmsg" } POSIX { set posixNum [lindex $::errorCode 1] set posixMsg [lindex $::errorCode 2] - set resultmsg "$test$PRS\nFailed with posix($posixNum,$posixMsg)$errmsg" + set resultmsg "$subdir_filename$PRS\nFailed with posix($posixNum,$posixMsg)$errmsg" } NONE { } @@ -273,7 +273,7 @@ set failed 0 for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } { regsub ^.*RUN:(.*) $lines($i) \1 theLine - set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ] + set resultmsg [execOneLine $subdir_filename $test $PRNUMS $outcome $i $theLine ] if { $resultmsg != "" } { if { $outcome == "XFAIL" } { xfail "$resultmsg" From ggreif at gmail.com Wed Apr 16 10:51:30 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 15:51:30 -0000 Subject: [llvm-commits] [llvm] r49792 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804161551.m3GFpUeZ020441@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 10:51:29 2008 New Revision: 49792 URL: http://llvm.org/viewvc/llvm-project?rev=49792&view=rev Log: add summary report calculation and output Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49792&r1=49791&r2=49792&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Wed Apr 16 10:51:29 2008 @@ -62,6 +62,9 @@ report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) @ cat $^ +%.report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) + @ cat $^ | grep "$(basename $@): " | wc -l | xargs echo "$(basename $@):" | (grep -v ': 0' ; true) > $@ + .PHONY: report check-local:: site.exp @@ -72,6 +75,8 @@ @ ( ulimit -t 600 ; ulimit -d 512000 ; \ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile))) @ $(DONE) + @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make PASS.report FAIL.report XPASS.report XFAIL.report + @ cat PASS.report FAIL.report XPASS.report XFAIL.report else check-local:: site.exp @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm." From gohman at apple.com Wed Apr 16 10:56:26 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 15:56:26 -0000 Subject: [llvm-commits] [llvm] r49793 - /llvm/trunk/tools/llc/llc.cpp Message-ID: <200804161556.m3GFuQHM020592@zion.cs.uiuc.edu> Author: djg Date: Wed Apr 16 10:56:26 2008 New Revision: 49793 URL: http://llvm.org/viewvc/llvm-project?rev=49793&view=rev Log: Fix a memory leak in llc. Modified: llvm/trunk/tools/llc/llc.cpp Modified: llvm/trunk/tools/llc/llc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=49793&r1=49792&r2=49793&view=diff ============================================================================== --- llvm/trunk/tools/llc/llc.cpp (original) +++ llvm/trunk/tools/llc/llc.cpp Wed Apr 16 10:56:26 2008 @@ -246,7 +246,8 @@ PM.run(mod); } else { // Build up all of the passes that we want to do to the module. - FunctionPassManager Passes(new ExistingModuleProvider(M.get())); + ExistingModuleProvider Provider(M.release()); + FunctionPassManager Passes(&Provider); Passes.add(new TargetData(*Target.getTargetData())); #ifndef NDEBUG From ggreif at gmail.com Wed Apr 16 11:00:16 2008 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 16 Apr 2008 16:00:16 -0000 Subject: [llvm-commits] [llvm] r49794 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804161600.m3GG0GIO020698@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 11:00:15 2008 New Revision: 49794 URL: http://llvm.org/viewvc/llvm-project?rev=49794&view=rev Log: be careful not to count XFAILS as FAILS :-) Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49794&r1=49793&r2=49794&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Wed Apr 16 11:00:15 2008 @@ -63,7 +63,7 @@ @ cat $^ %.report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) - @ cat $^ | grep "$(basename $@): " | wc -l | xargs echo "$(basename $@):" | (grep -v ': 0' ; true) > $@ + @ cat $^ | grep "^$(basename $@): " | wc -l | xargs echo "$(basename $@):" | (grep -v ': 0' ; true) > $@ .PHONY: report From romix.llvm at googlemail.com Wed Apr 16 11:15:28 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Wed, 16 Apr 2008 16:15:28 -0000 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp Message-ID: <200804161615.m3GGFS0b021120@zion.cs.uiuc.edu> Author: romix Date: Wed Apr 16 11:15:27 2008 New Revision: 49795 URL: http://llvm.org/viewvc/llvm-project?rev=49795&view=rev Log: Ongoing work on improving the instruction selection infrastructure: Rename SDOperandImpl back to SDOperand. Introduce the SDUse class that represents a use of the SDNode referred by an SDOperand. Now it is more similar to Use/Value classes. Patch is approved by Dan Gohman. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed Apr 16 11:15:27 2008 @@ -334,7 +334,7 @@ /// register number for the results of the node. /// void EmitNode(SDNode *Node, unsigned InstNo, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); /// EmitNoop - Emit a noop instruction. /// @@ -352,11 +352,11 @@ /// EmitSubregNode - Generate machine code for subreg nodes. /// void EmitSubregNode(SDNode *Node, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); /// getVR - Return the virtual register corresponding to the specified result /// of the specified node. - unsigned getVR(SDOperand Op, DenseMap &VRBaseMap); + unsigned getVR(SDOperand Op, DenseMap &VRBaseMap); /// getDstOfCopyToRegUse - If the only use of the specified result number of /// node is a CopyToReg, return its destination register. Return 0 otherwise. @@ -364,7 +364,7 @@ void AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum, const TargetInstrDesc *II, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); void AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO); @@ -374,11 +374,11 @@ /// implicit physical register output. void EmitCopyFromReg(SDNode *Node, unsigned ResNo, unsigned InstNo, unsigned SrcReg, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI, const TargetInstrDesc &II, - DenseMap &VRBaseMap); + DenseMap &VRBaseMap); /// EmitLiveInCopy - Emit a copy for a live in physical register. If the /// physical register has only a single copy use, then coalesced the copy Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Apr 16 11:15:27 2008 @@ -304,11 +304,11 @@ SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4, SDOperand N5); SDOperand getNode(unsigned Opcode, MVT::ValueType VT, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, std::vector &ResultTys, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, SDVTList VTs); SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N); SDOperand getNode(unsigned Opcode, SDVTList VTs, @@ -321,7 +321,7 @@ SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4, SDOperand N5); SDOperand getNode(unsigned Opcode, SDVTList VTs, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src, SDOperand Size, unsigned Align, @@ -420,7 +420,7 @@ SDOperand Op3, SDOperand Op4); SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDOperand UpdateNodeOperands(SDOperand N, SDOperand *Ops, unsigned NumOps); + SDOperand UpdateNodeOperands(SDOperand N, SDOperandPtr Ops, unsigned NumOps); /// SelectNodeTo - These are used for target selectors to *mutate* the /// specified node to have the specified return type, Target opcode, and @@ -435,7 +435,7 @@ SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, @@ -457,7 +457,7 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, @@ -469,7 +469,7 @@ SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2); @@ -478,18 +478,18 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, MVT::ValueType VT4, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, std::vector &ResultTys, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); /// getNodeIfExists - Get the specified node if it's already available, or /// else return NULL. SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTs, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); /// DAGUpdateListener - Clients of various APIs that cause global effects on /// the DAG can optionally implement this interface. This allows the clients @@ -519,7 +519,7 @@ DAGUpdateListener *UpdateListener = 0); void ReplaceAllUsesWith(SDNode *From, SDNode *To, DAGUpdateListener *UpdateListener = 0); - void ReplaceAllUsesWith(SDNode *From, const SDOperand *To, + void ReplaceAllUsesWith(SDNode *From, SDOperandPtr To, DAGUpdateListener *UpdateListener = 0); /// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving @@ -606,7 +606,7 @@ SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *&InsertPos); SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2, void *&InsertPos); - SDNode *FindModifiedNodeSlot(SDNode *N, const SDOperand *Ops, unsigned NumOps, + SDNode *FindModifiedNodeSlot(SDNode *N, SDOperandPtr Ops, unsigned NumOps, void *&InsertPos); void DeleteNodeNotInCSEMaps(SDNode *N); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Wed Apr 16 11:15:27 2008 @@ -771,7 +771,7 @@ //===----------------------------------------------------------------------===// -/// SDOperandImpl - Unlike LLVM values, Selection DAG nodes may return multiple +/// SDOperand - Unlike LLVM values, Selection DAG nodes may return multiple /// values as the result of a computation. Many nodes return multiple values, /// from loads (which define a token and a return value) to ADDC (which returns /// a result and a carry value), to calls (which may return an arbitrary number @@ -779,28 +779,28 @@ /// /// As such, each use of a SelectionDAG computation must indicate the node that /// computes it as well as which return value to use from that node. This pair -/// of information is represented with the SDOperandImpl value type. +/// of information is represented with the SDOperand value type. /// -class SDOperandImpl { +class SDOperand { public: SDNode *Val; // The node defining the value we are using. unsigned ResNo; // Which return value of the node we are using. - SDOperandImpl() : Val(0), ResNo(0) {} - SDOperandImpl(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {} + SDOperand() : Val(0), ResNo(0) {} + SDOperand(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {} - bool operator==(const SDOperandImpl &O) const { + bool operator==(const SDOperand &O) const { return Val == O.Val && ResNo == O.ResNo; } - bool operator!=(const SDOperandImpl &O) const { + bool operator!=(const SDOperand &O) const { return !operator==(O); } - bool operator<(const SDOperandImpl &O) const { + bool operator<(const SDOperand &O) const { return Val < O.Val || (Val == O.Val && ResNo < O.ResNo); } - SDOperandImpl getValue(unsigned R) const { - return SDOperandImpl(Val, R); + SDOperand getValue(unsigned R) const { + return SDOperand(Val, R); } // isOperandOf - Return true if this node is an operand of N. @@ -819,7 +819,7 @@ // Forwarding methods - These forward to the corresponding methods in SDNode. inline unsigned getOpcode() const; inline unsigned getNumOperands() const; - inline const SDOperandImpl &getOperand(unsigned i) const; + inline const SDOperand &getOperand(unsigned i) const; inline uint64_t getConstantOperandVal(unsigned i) const; inline bool isTargetOpcode() const; inline unsigned getTargetOpcode() const; @@ -830,7 +830,7 @@ /// side-effecting instructions. In practice, this looks through token /// factors and non-volatile loads. In order to remain efficient, this only /// looks a couple of nodes in, it does not do an exhaustive search. - bool reachesChainWithoutSideEffects(SDOperandImpl Dest, + bool reachesChainWithoutSideEffects(SDOperand Dest, unsigned Depth = 2) const; /// hasOneUse - Return true if there is exactly one operation using this @@ -843,18 +843,18 @@ }; -template<> struct DenseMapInfo { - static inline SDOperandImpl getEmptyKey() { - return SDOperandImpl((SDNode*)-1, -1U); +template<> struct DenseMapInfo { + static inline SDOperand getEmptyKey() { + return SDOperand((SDNode*)-1, -1U); } - static inline SDOperandImpl getTombstoneKey() { - return SDOperandImpl((SDNode*)-1, 0); + static inline SDOperand getTombstoneKey() { + return SDOperand((SDNode*)-1, 0); } - static unsigned getHashValue(const SDOperandImpl &Val) { + static unsigned getHashValue(const SDOperand &Val) { return ((unsigned)((uintptr_t)Val.Val >> 4) ^ (unsigned)((uintptr_t)Val.Val >> 9)) + Val.ResNo; } - static bool isEqual(const SDOperandImpl &LHS, const SDOperandImpl &RHS) { + static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) { return LHS == RHS; } static bool isPod() { return true; } @@ -862,73 +862,90 @@ /// simplify_type specializations - Allow casting operators to work directly on /// SDOperands as if they were SDNode*'s. -template<> struct simplify_type { +template<> struct simplify_type { typedef SDNode* SimpleType; - static SimpleType getSimplifiedValue(const SDOperandImpl &Val) { + static SimpleType getSimplifiedValue(const SDOperand &Val) { return static_cast(Val.Val); } }; -template<> struct simplify_type { +template<> struct simplify_type { typedef SDNode* SimpleType; - static SimpleType getSimplifiedValue(const SDOperandImpl &Val) { + static SimpleType getSimplifiedValue(const SDOperand &Val) { return static_cast(Val.Val); } }; -/// SDOperand - Represents a use of the SDNode referred by -/// the SDOperandImpl. -class SDOperand: public SDOperandImpl { +/// SDUse - Represents a use of the SDNode referred by +/// the SDOperand. +class SDUse { + SDOperand Operand; /// parent - Parent node of this operand. SDNode *parent; /// Prev, next - Pointers to the uses list of the SDNode referred by /// this operand. - SDOperand **Prev, *Next; + SDUse **Prev, *Next; public: friend class SDNode; - SDOperand(): SDOperandImpl(), parent(NULL), Prev(NULL), Next(NULL) {} + SDUse(): Operand(), parent(NULL), Prev(NULL), Next(NULL) {} - SDOperand(SDNode *val, unsigned resno) : - SDOperandImpl(val,resno), parent(NULL), Prev(NULL), Next(NULL) {} + SDUse(SDNode *val, unsigned resno) : + Operand(val,resno), parent(NULL), Prev(NULL), Next(NULL) {} - SDOperand(const SDOperandImpl& Op): SDOperandImpl(Op),parent(NULL), - Prev(NULL), Next(NULL) { - } - SDOperand& operator= (SDOperandImpl& Op) { - *(SDOperandImpl*)this = Op; + SDUse& operator= (SDOperand& Op) { + Operand = Op; Next = NULL; Prev = NULL; return *this; } - SDOperand& operator= (const SDOperandImpl& Op) { - *(SDOperandImpl*)this = Op; + SDUse& operator= (const SDOperand& Op) { + Operand = Op; Next = NULL; Prev = NULL; return *this; } - SDOperand& operator= (SDOperand& Op) { - *(SDOperandImpl*)this = Op; + SDUse& operator= (SDUse& Op) { + Operand = Op; Next = NULL; Prev = NULL; return *this; } - SDOperand& operator= (const SDOperand& Op) { - *(SDOperandImpl*)this = Op; + SDUse& operator= (const SDUse& Op) { + Operand = Op; Next = NULL; Prev = NULL; return *this; } - SDOperand * getNext() { return Next; } + SDUse * getNext() { return Next; } SDNode *getUser() { return parent; } + void setUser(SDNode *p) { parent = p; } + operator SDOperand() const { return Operand; } + + const SDOperand& getSDOperand() const { return Operand; } + + SDNode* &getVal () { return Operand.Val; } + + bool operator==(const SDOperand &O) const { + return Operand == O; + } + + bool operator!=(const SDOperand &O) const { + return !(Operand == O); + } + + bool operator<(const SDOperand &O) const { + return Operand < O; + } + protected: - void addToList(SDOperand **List) { + void addToList(SDUse **List) { Next = *List; if (Next) Next->Prev = &Next; Prev = List; @@ -944,20 +961,62 @@ /// simplify_type specializations - Allow casting operators to work directly on /// SDOperands as if they were SDNode*'s. -template<> struct simplify_type { +template<> struct simplify_type { typedef SDNode* SimpleType; - static SimpleType getSimplifiedValue(const SDOperand &Val) { - return static_cast(Val.Val); + static SimpleType getSimplifiedValue(const SDUse &Val) { + return static_cast(Val.getSDOperand().Val); } }; -template<> struct simplify_type { +template<> struct simplify_type { typedef SDNode* SimpleType; - static SimpleType getSimplifiedValue(const SDOperand &Val) { - return static_cast(Val.Val); + static SimpleType getSimplifiedValue(const SDUse &Val) { + return static_cast(Val.getSDOperand().Val); } }; +/// SDOperandPtr - A helper SDOperand poiner class, that can handle +/// arrays of SDUse and arrays of SDOperand objects. This is required +/// in many places inside the SelectionDAG. +/// +class SDOperandPtr { + const SDOperand *ptr; // The pointer to the SDOperand object + int object_size; // The size of the object containg the SDOperand +public: + SDOperandPtr(SDUse * use_ptr) { + ptr = &use_ptr->getSDOperand(); + object_size = sizeof(SDUse); + } + + SDOperandPtr(const SDOperand * op_ptr) { + ptr = op_ptr; + object_size = sizeof(SDOperand); + } + + operator const SDOperand *() const { + assert(object_size == sizeof(SDOperand) && + "Only SDOperand can be converted"); + return ptr; + } + + const SDOperand operator *() { return *ptr; } + const SDOperand *operator ->() { return ptr; } + SDOperandPtr operator ++ () { + ptr = (SDOperand*)((char *)ptr + object_size); + return *this; + } + + SDOperandPtr operator ++ (int) { + SDOperandPtr tmp = *this; + ptr = (SDOperand*)((char *)ptr + object_size); + return tmp; + } + + SDOperand operator[] (int idx) const { + return *(SDOperand*)((char*) ptr + object_size * idx); + } +}; + /// SDNode - Represents one node in the SelectionDAG. /// class SDNode : public FoldingSetNode { @@ -975,7 +1034,7 @@ /// OperandList - The values that are used by this operation. /// - SDOperand *OperandList; + SDUse *OperandList; /// ValueList - The types of the values this node defines. SDNode's may /// define multiple values simultaneously. @@ -993,10 +1052,10 @@ unsigned UsesSize; /// Uses - List of uses for this SDNode. - SDOperand *Uses; + SDUse *Uses; - /// addUse - add SDOperand to the list of uses. - void addUse(SDOperand &U) { U.addToList(&Uses); } + /// addUse - add SDUse to the list of uses. + void addUse(SDUse &U) { U.addToList(&Uses); } // Out-of-line virtual method to give class a home. virtual void ANCHOR(); @@ -1027,17 +1086,17 @@ /// setNodeId - Set unique node id. void setNodeId(int Id) { NodeId = Id; } - /// use_iterator - This class provides iterator support for SDOperand + /// use_iterator - This class provides iterator support for SDUse /// operands that use a specific SDNode. class use_iterator - : public forward_iterator { - SDOperand *Op; - explicit use_iterator(SDOperand *op) : Op(op) { + : public forward_iterator { + SDUse *Op; + explicit use_iterator(SDUse *op) : Op(op) { } friend class SDNode; public: - typedef forward_iterator::reference reference; - typedef forward_iterator::pointer pointer; + typedef forward_iterator::reference reference; + typedef forward_iterator::pointer pointer; use_iterator(const use_iterator &I) : Op(I.Op) {} use_iterator() : Op(0) {} @@ -1071,13 +1130,13 @@ } /// Retrieve a reference to the current operand. - SDOperand &operator*() const { + SDUse &operator*() const { assert(Op && "Cannot dereference end iterator!"); return *Op; } /// Retrieve a pointer to the current operand. - SDOperand *operator->() const { + SDUse *operator->() const { assert(Op && "Cannot dereference end iterator!"); return Op; } @@ -1130,10 +1189,10 @@ const SDOperand &getOperand(unsigned Num) const { assert(Num < NumOperands && "Invalid child # of SDNode!"); - return OperandList[Num]; + return OperandList[Num].getSDOperand(); } - typedef SDOperand* op_iterator; + typedef SDUse* op_iterator; op_iterator op_begin() const { return OperandList; } op_iterator op_end() const { return OperandList+NumOperands; } @@ -1193,7 +1252,25 @@ : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) { OperandsNeedDelete = true; NumOperands = NumOps; - OperandList = NumOps ? new SDOperand[NumOperands] : 0; + OperandList = NumOps ? new SDUse[NumOperands] : 0; + + for (unsigned i = 0; i != NumOps; ++i) { + OperandList[i] = Ops[i]; + OperandList[i].setUser(this); + Ops[i].Val->addUse(OperandList[i]); + ++Ops[i].Val->UsesSize; + } + + ValueList = VTs.VTs; + NumValues = VTs.NumVTs; + Prev = 0; Next = 0; + } + + SDNode(unsigned Opc, SDVTList VTs, SDOperandPtr Ops, unsigned NumOps) + : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) { + OperandsNeedDelete = true; + NumOperands = NumOps; + OperandList = NumOps ? new SDUse[NumOperands] : 0; for (unsigned i = 0; i != NumOps; ++i) { OperandList[i] = Ops[i]; @@ -1220,7 +1297,7 @@ /// InitOperands - Initialize the operands list of this node with the /// specified values, which are part of the node (thus they don't need to be /// copied in or allocated). - void InitOperands(SDOperand *Ops, unsigned NumOps) { + void InitOperands(SDUse *Ops, unsigned NumOps) { assert(OperandList == 0 && "Operands already set!"); NumOperands = NumOps; OperandList = Ops; @@ -1229,8 +1306,8 @@ for (unsigned i = 0; i != NumOps; ++i) { OperandList[i].setUser(this); - Ops[i].Val->addUse(OperandList[i]); - ++Ops[i].Val->UsesSize; + Ops[i].getVal()->addUse(OperandList[i]); + ++Ops[i].getVal()->UsesSize; } } @@ -1248,40 +1325,40 @@ void removeUser(unsigned i, SDNode *User) { assert(User->OperandList[i].getUser() && "Node without parent"); - SDOperand &Op = User->OperandList[i]; + SDUse &Op = User->OperandList[i]; Op.removeFromList(); --UsesSize; } }; -// Define inline functions from the SDOperandImpl class. +// Define inline functions from the SDOperand class. -inline unsigned SDOperandImpl::getOpcode() const { +inline unsigned SDOperand::getOpcode() const { return Val->getOpcode(); } -inline MVT::ValueType SDOperandImpl::getValueType() const { +inline MVT::ValueType SDOperand::getValueType() const { return Val->getValueType(ResNo); } -inline unsigned SDOperandImpl::getNumOperands() const { +inline unsigned SDOperand::getNumOperands() const { return Val->getNumOperands(); } -inline const SDOperandImpl &SDOperandImpl::getOperand(unsigned i) const { +inline const SDOperand &SDOperand::getOperand(unsigned i) const { return Val->getOperand(i); } -inline uint64_t SDOperandImpl::getConstantOperandVal(unsigned i) const { +inline uint64_t SDOperand::getConstantOperandVal(unsigned i) const { return Val->getConstantOperandVal(i); } -inline bool SDOperandImpl::isTargetOpcode() const { +inline bool SDOperand::isTargetOpcode() const { return Val->isTargetOpcode(); } -inline unsigned SDOperandImpl::getTargetOpcode() const { +inline unsigned SDOperand::getTargetOpcode() const { return Val->getTargetOpcode(); } -inline bool SDOperandImpl::hasOneUse() const { +inline bool SDOperand::hasOneUse() const { return Val->hasNUsesOfValue(1, ResNo); } -inline bool SDOperandImpl::use_empty() const { +inline bool SDOperand::use_empty() const { return !Val->hasAnyUseOfValue(ResNo); } @@ -1289,10 +1366,11 @@ /// to allow co-allocation of node operands with the node itself. class UnarySDNode : public SDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - SDOperand Op; + SDUse Op; public: UnarySDNode(unsigned Opc, SDVTList VTs, SDOperand X) - : SDNode(Opc, VTs), Op(X) { + : SDNode(Opc, VTs) { + Op = X; InitOperands(&Op, 1); } }; @@ -1301,7 +1379,7 @@ /// to allow co-allocation of node operands with the node itself. class BinarySDNode : public SDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - SDOperand Ops[2]; + SDUse Ops[2]; public: BinarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y) : SDNode(Opc, VTs) { @@ -1315,7 +1393,7 @@ /// to allow co-allocation of node operands with the node itself. class TernarySDNode : public SDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - SDOperand Ops[3]; + SDUse Ops[3]; public: TernarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y, SDOperand Z) @@ -1334,19 +1412,20 @@ /// the AllNodes list. class HandleSDNode : public SDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - SDOperand Op; + SDUse Op; public: explicit HandleSDNode(SDOperand X) - : SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)), Op(X) { + : SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)) { + Op = X; InitOperands(&Op, 1); } ~HandleSDNode(); - SDOperand getValue() const { return Op; } + SDUse getValue() const { return Op; } }; class AtomicSDNode : public SDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - SDOperand Ops[4]; + SDUse Ops[4]; MVT::ValueType OrigVT; public: AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr, @@ -1867,7 +1946,7 @@ common functionality shared between LoadSDNode and StoreSDNode */ - SDOperand Ops[4]; + SDUse Ops[4]; public: LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned NumOperands, SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT, Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 16 11:15:27 2008 @@ -3880,7 +3880,8 @@ MVT::ValueType VT = N->getValueType(0); // If this is fp_round(fpextend), don't fold it, allow ourselves to be folded. - if (N->hasOneUse() && (N->use_begin())->getOpcode() == ISD::FP_ROUND) + if (N->hasOneUse() && + N->use_begin()->getSDOperand().getOpcode() == ISD::FP_ROUND) return SDOperand(); // fold (fp_extend c1fp) -> c1fp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Apr 16 11:15:27 2008 @@ -86,17 +86,17 @@ /// LegalizedNodes - For nodes that are of legal width, and that have more /// than one use, this map indicates what regularized operand to use. This /// allows us to avoid legalizing the same thing more than once. - DenseMap LegalizedNodes; + DenseMap LegalizedNodes; /// PromotedNodes - For nodes that are below legal width, and that have more /// than one use, this map indicates what promoted value to use. This allows /// us to avoid promoting the same thing more than once. - DenseMap PromotedNodes; + DenseMap PromotedNodes; /// ExpandedNodes - For nodes that need to be expanded this map indicates /// which which operands are the expanded version of the input. This allows /// us to avoid expanding the same node more than once. - DenseMap > ExpandedNodes; + DenseMap > ExpandedNodes; /// SplitNodes - For vector nodes that need to be split, this map indicates /// which which operands are the split version of the input. This allows us @@ -784,7 +784,7 @@ // Note that LegalizeOp may be reentered even from single-use nodes, which // means that we always must cache transformed nodes. - DenseMap::iterator I = LegalizedNodes.find(Op); + DenseMap::iterator I = LegalizedNodes.find(Op); if (I != LegalizedNodes.end()) return I->second; SDOperand Tmp1, Tmp2, Tmp3, Tmp4; @@ -1600,7 +1600,7 @@ // will cause this node to be legalized as well as handling libcalls right. if (LastCALLSEQ_END.Val != Node) { LegalizeOp(SDOperand(FindCallStartFromCallEnd(Node), 0)); - DenseMap::iterator I = LegalizedNodes.find(Op); + DenseMap::iterator I = LegalizedNodes.find(Op); assert(I != LegalizedNodes.end() && "Legalizing the call start should have legalized this node!"); return I->second; @@ -4016,7 +4016,7 @@ SDOperand Result; SDNode *Node = Op.Val; - DenseMap::iterator I = PromotedNodes.find(Op); + DenseMap::iterator I = PromotedNodes.find(Op); if (I != PromotedNodes.end()) return I->second; switch (Node->getOpcode()) { @@ -5721,7 +5721,7 @@ "Cannot expand to FP value or to larger int value!"); // See if we already expanded it. - DenseMap >::iterator I + DenseMap >::iterator I = ExpandedNodes.find(Op); if (I != ExpandedNodes.end()) { Lo = I->second.first; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Wed Apr 16 11:15:27 2008 @@ -273,39 +273,39 @@ E = Worklist.end(); I != E; ++I) assert(*I != N); - for (DenseMap::iterator I = ReplacedNodes.begin(), + for (DenseMap::iterator I = ReplacedNodes.begin(), E = ReplacedNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.Val != N); } - for (DenseMap::iterator I = PromotedNodes.begin(), + for (DenseMap::iterator I = PromotedNodes.begin(), E = PromotedNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.Val != N); } - for (DenseMap::iterator + for (DenseMap::iterator I = FloatToIntedNodes.begin(), E = FloatToIntedNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.Val != N); } - for (DenseMap::iterator I = ScalarizedNodes.begin(), + for (DenseMap::iterator I = ScalarizedNodes.begin(), E = ScalarizedNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.Val != N); } - for (DenseMap >::iterator + for (DenseMap >::iterator I = ExpandedNodes.begin(), E = ExpandedNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.first.Val != N); assert(I->second.second.Val != N); } - for (DenseMap >::iterator + for (DenseMap >::iterator I = SplitNodes.begin(), E = SplitNodes.end(); I != E; ++I) { assert(I->first.Val != N); assert(I->second.first.Val != N); @@ -393,7 +393,7 @@ /// RemapNode - If the specified value was already legalized to another value, /// replace it by that value. void DAGTypeLegalizer::RemapNode(SDOperand &N) { - DenseMap::iterator I = ReplacedNodes.find(N); + DenseMap::iterator I = ReplacedNodes.find(N); if (I != ReplacedNodes.end()) { // Use path compression to speed up future lookups if values get multiply // replaced with other values. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Wed Apr 16 11:15:27 2008 @@ -110,27 +110,27 @@ /// PromotedNodes - For nodes that are below legal width, this map indicates /// what promoted value to use. - DenseMap PromotedNodes; + DenseMap PromotedNodes; /// ExpandedNodes - For nodes that need to be expanded this map indicates /// which operands are the expanded version of the input. - DenseMap > ExpandedNodes; + DenseMap > ExpandedNodes; /// FloatToIntedNodes - For floating point nodes converted to integers of /// the same size, this map indicates the converted value to use. - DenseMap FloatToIntedNodes; + DenseMap FloatToIntedNodes; /// ScalarizedNodes - For nodes that are <1 x ty>, this map indicates the /// scalar value of type 'ty' to use. - DenseMap ScalarizedNodes; + DenseMap ScalarizedNodes; /// SplitNodes - For nodes that need to be split this map indicates /// which operands are the expanded version of the input. - DenseMap > SplitNodes; + DenseMap > SplitNodes; /// ReplacedNodes - For nodes that have been replaced with another, /// indicates the replacement node to use. - DenseMap ReplacedNodes; + DenseMap ReplacedNodes; /// Worklist - This defines a worklist of nodes to process. In order to be /// pushed onto this worklist, all operands of a node must have already been Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Apr 16 11:15:27 2008 @@ -400,7 +400,7 @@ void ScheduleDAG::EmitCopyFromReg(SDNode *Node, unsigned ResNo, unsigned InstanceNo, unsigned SrcReg, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { unsigned VRBase = 0; if (TargetRegisterInfo::isVirtualRegister(SrcReg)) { // Just use the input register directly! @@ -488,7 +488,7 @@ void ScheduleDAG::CreateVirtualRegisters(SDNode *Node, MachineInstr *MI, const TargetInstrDesc &II, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { assert(Node->getTargetOpcode() != TargetInstrInfo::IMPLICIT_DEF && "IMPLICIT_DEF should have been handled as a special case elsewhere!"); @@ -529,7 +529,7 @@ /// getVR - Return the virtual register corresponding to the specified result /// of the specified node. unsigned ScheduleDAG::getVR(SDOperand Op, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { if (Op.isTargetOpcode() && Op.getTargetOpcode() == TargetInstrInfo::IMPLICIT_DEF) { // Add an IMPLICIT_DEF instruction before every use. @@ -544,7 +544,7 @@ return VReg; } - DenseMap::iterator I = VRBaseMap.find(Op); + DenseMap::iterator I = VRBaseMap.find(Op); assert(I != VRBaseMap.end() && "Node emitted out of order - late"); return I->second; } @@ -557,7 +557,7 @@ void ScheduleDAG::AddOperand(MachineInstr *MI, SDOperand Op, unsigned IIOpNum, const TargetInstrDesc *II, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { if (Op.isTargetOpcode()) { // Note that this case is redundant with the final else block, but we // include it because it is the most common and it makes the logic @@ -688,7 +688,7 @@ /// EmitSubregNode - Generate machine code for subreg nodes. /// void ScheduleDAG::EmitSubregNode(SDNode *Node, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { unsigned VRBase = 0; unsigned Opc = Node->getTargetOpcode(); @@ -779,7 +779,7 @@ /// EmitNode - Generate machine code for an node and needed dependencies. /// void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, - DenseMap &VRBaseMap) { + DenseMap &VRBaseMap) { // If machine instruction if (Node->isTargetOpcode()) { unsigned Opc = Node->getTargetOpcode(); @@ -1102,7 +1102,7 @@ } // Finally, emit the code for all of the scheduled instructions. - DenseMap VRBaseMap; + DenseMap VRBaseMap; DenseMap CopyVRBaseMap; for (unsigned i = 0, e = Sequence.size(); i != e; i++) { SUnit *SU = Sequence[i]; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Apr 16 11:15:27 2008 @@ -328,7 +328,7 @@ /// AddNodeIDOperands - Various routines for adding operands to the NodeID data. /// static void AddNodeIDOperands(FoldingSetNodeID &ID, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { for (; NumOps; --NumOps, ++Ops) { ID.AddPointer(Ops->Val); ID.AddInteger(Ops->ResNo); @@ -343,6 +343,7 @@ AddNodeIDOperands(ID, OpList, N); } + /// AddNodeIDNode - Generic routine for adding a nodes info to the NodeID /// data. static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) { @@ -464,7 +465,7 @@ // Next, brutally remove the operand list. This is safe to do, as there are // no cycles in the graph. for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) { - SDNode *Operand = I->Val; + SDNode *Operand = I->getVal(); Operand->removeUser(std::distance(N->op_begin(), I), N); // Now that we removed this operand, see if there are no uses of it left. @@ -504,7 +505,7 @@ // Next, brutally remove the operand list. This is safe to do, as there are // no cycles in the graph. for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) { - SDNode *Operand = I->Val; + SDNode *Operand = I->getVal(); Operand->removeUser(std::distance(N->op_begin(), I), N); // Now that we removed this operand, see if there are no uses of it left. @@ -540,7 +541,7 @@ // Drop all of the operands and decrement used nodes use counts. for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) - I->Val->removeUser(std::distance(N->op_begin(), I), N); + I->getVal()->removeUser(std::distance(N->op_begin(), I), N); if (N->OperandsNeedDelete) { delete[] N->OperandList; } @@ -669,7 +670,7 @@ /// return null, otherwise return a pointer to the slot it would take. If a /// node already exists with these operands, the slot will be non-null. SDNode *SelectionDAG::FindModifiedNodeSlot(SDNode *N, - const SDOperand *Ops,unsigned NumOps, + SDOperandPtr Ops,unsigned NumOps, void *&InsertPos) { if (N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag) return 0; // Never add these nodes. @@ -748,7 +749,7 @@ unsigned Opc = isT ? ISD::TargetConstant : ISD::Constant; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(EltVT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(EltVT), (SDOperand*)0, 0); ID.Add(Val); void *IP = 0; SDNode *N = NULL; @@ -787,7 +788,7 @@ // we don't have issues with SNANs. unsigned Opc = isTarget ? ISD::TargetConstantFP : ISD::ConstantFP; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(EltVT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(EltVT), (SDOperand*)0, 0); ID.Add(V); void *IP = 0; SDNode *N = NULL; @@ -837,7 +838,7 @@ Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0); ID.AddPointer(GV); ID.AddInteger(Offset); void *IP = 0; @@ -853,7 +854,7 @@ bool isTarget) { unsigned Opc = isTarget ? ISD::TargetFrameIndex : ISD::FrameIndex; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0); ID.AddInteger(FI); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -867,7 +868,7 @@ SDOperand SelectionDAG::getJumpTable(int JTI, MVT::ValueType VT, bool isTarget){ unsigned Opc = isTarget ? ISD::TargetJumpTable : ISD::JumpTable; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0); ID.AddInteger(JTI); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -883,7 +884,7 @@ bool isTarget) { unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0); ID.AddInteger(Alignment); ID.AddInteger(Offset); ID.AddPointer(C); @@ -903,7 +904,7 @@ bool isTarget) { unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool; FoldingSetNodeID ID; - AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opc, getVTList(VT), (SDOperand*)0, 0); ID.AddInteger(Alignment); ID.AddInteger(Offset); C->AddSelectionDAGCSEId(ID); @@ -919,7 +920,7 @@ SDOperand SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) { FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), 0, 0); + AddNodeIDNode(ID, ISD::BasicBlock, getVTList(MVT::Other), (SDOperand*)0, 0); ID.AddPointer(MBB); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -932,7 +933,7 @@ SDOperand SelectionDAG::getArgFlags(ISD::ArgFlagsTy Flags) { FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::ARG_FLAGS, getVTList(MVT::Other), 0, 0); + AddNodeIDNode(ID, ISD::ARG_FLAGS, getVTList(MVT::Other), (SDOperand*)0, 0); ID.AddInteger(Flags.getRawBits()); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -986,7 +987,7 @@ SDOperand SelectionDAG::getRegister(unsigned RegNo, MVT::ValueType VT) { FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::Register, getVTList(VT), 0, 0); + AddNodeIDNode(ID, ISD::Register, getVTList(VT), (SDOperand*)0, 0); ID.AddInteger(RegNo); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1002,7 +1003,7 @@ "SrcValue is not a pointer?"); FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), 0, 0); + AddNodeIDNode(ID, ISD::SRCVALUE, getVTList(MVT::Other), (SDOperand*)0, 0); ID.AddPointer(V); void *IP = 0; @@ -1021,7 +1022,7 @@ "SrcValue is not a pointer?"); FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::MEMOPERAND, getVTList(MVT::Other), 0, 0); + AddNodeIDNode(ID, ISD::MEMOPERAND, getVTList(MVT::Other), (SDOperand*)0, 0); ID.AddPointer(v); ID.AddInteger(MO.getFlags()); ID.AddInteger(MO.getOffset()); @@ -1751,7 +1752,7 @@ /// SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT) { FoldingSetNodeID ID; - AddNodeIDNode(ID, Opcode, getVTList(VT), 0, 0); + AddNodeIDNode(ID, Opcode, getVTList(VT), (SDOperand*)0, 0); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); @@ -2987,7 +2988,7 @@ } SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { switch (NumOps) { case 0: return getNode(Opcode, VT); case 1: return getNode(Opcode, VT, Ops[0]); @@ -3036,21 +3037,21 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, std::vector &ResultTys, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { return getNode(Opcode, getNodeValueTypes(ResultTys), ResultTys.size(), Ops, NumOps); } SDOperand SelectionDAG::getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { if (NumVTs == 1) return getNode(Opcode, VTs[0], Ops, NumOps); return getNode(Opcode, makeVTList(VTs, NumVTs), Ops, NumOps); } SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { if (VTList.NumVTs == 1) return getNode(Opcode, VTList.VTs[0], Ops, NumOps); @@ -3109,7 +3110,7 @@ } SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList) { - return getNode(Opcode, VTList, 0, 0); + return getNode(Opcode, VTList, (SDOperand*)0, 0); } SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList, @@ -3228,7 +3229,7 @@ RemoveNodeFromCSEMaps(N); // Now we update the operands. - N->OperandList[0].Val->removeUser(0, N); + N->OperandList[0].getVal()->removeUser(0, N); N->OperandList[0] = Op; N->OperandList[0].setUser(N); Op.Val->addUser(0, N); @@ -3258,13 +3259,13 @@ // Now we update the operands. if (N->OperandList[0] != Op1) { - N->OperandList[0].Val->removeUser(0, N); + N->OperandList[0].getVal()->removeUser(0, N); N->OperandList[0] = Op1; N->OperandList[0].setUser(N); Op1.Val->addUser(0, N); } if (N->OperandList[1] != Op2) { - N->OperandList[1].Val->removeUser(1, N); + N->OperandList[1].getVal()->removeUser(1, N); N->OperandList[1] = Op2; N->OperandList[1].setUser(N); Op2.Val->addUser(1, N); @@ -3296,7 +3297,7 @@ } SDOperand SelectionDAG:: -UpdateNodeOperands(SDOperand InN, SDOperand *Ops, unsigned NumOps) { +UpdateNodeOperands(SDOperand InN, SDOperandPtr Ops, unsigned NumOps) { SDNode *N = InN.Val; assert(N->getNumOperands() == NumOps && "Update with wrong number of operands"); @@ -3325,7 +3326,7 @@ // Now we update the operands. for (unsigned i = 0; i != NumOps; ++i) { if (N->OperandList[i] != Ops[i]) { - N->OperandList[i].Val->removeUser(i, N); + N->OperandList[i].getVal()->removeUser(i, N); N->OperandList[i] = Ops[i]; N->OperandList[i].setUser(N); Ops[i].Val->addUser(i, N); @@ -3349,7 +3350,7 @@ // Clear the operands list, updating used nodes to remove this from their // use list. for (op_iterator I = op_begin(), E = op_end(); I != E; ++I) - I->Val->removeUser(std::distance(op_begin(), I), this); + I->getVal()->removeUser(std::distance(op_begin(), I), this); // If NumOps is larger than the # of operands we currently have, reallocate // the operand list. @@ -3357,7 +3358,7 @@ if (OperandsNeedDelete) { delete [] OperandList; } - OperandList = new SDOperand[NumOps]; + OperandList = new SDUse[NumOps]; OperandsNeedDelete = true; } @@ -3367,7 +3368,7 @@ for (unsigned i = 0, e = NumOps; i != e; ++i) { OperandList[i] = Ops[i]; OperandList[i].setUser(this); - SDNode *N = OperandList[i].Val; + SDNode *N = OperandList[i].getVal(); N->addUser(i, this); ++N->UsesSize; } @@ -3385,7 +3386,7 @@ MVT::ValueType VT) { SDVTList VTs = getVTList(VT); FoldingSetNodeID ID; - AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, 0, 0); + AddNodeIDNode(ID, ISD::BUILTIN_OP_END+TargetOpc, VTs, (SDOperand*)0, 0); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) return ON; @@ -3458,7 +3459,7 @@ } SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT, const SDOperand *Ops, + MVT::ValueType VT, SDOperandPtr Ops, unsigned NumOps) { // If an identical node already exists, use it. SDVTList VTs = getVTList(VT); @@ -3536,7 +3537,7 @@ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, @@ -3566,7 +3567,7 @@ } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; } @@ -3587,14 +3588,14 @@ } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, NumOps).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, MVT::ValueType VT4, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { std::vector VTList; VTList.push_back(VT1); VTList.push_back(VT2); @@ -3605,7 +3606,7 @@ } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, std::vector &ResultTys, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { const MVT::ValueType *VTs = getNodeValueTypes(ResultTys); return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, ResultTys.size(), Ops, NumOps).Val; @@ -3614,7 +3615,7 @@ /// getNodeIfExists - Get the specified node if it's already available, or /// else return NULL. SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) { FoldingSetNodeID ID; AddNodeIDNode(ID, Opcode, VTList, Ops, NumOps); @@ -3647,7 +3648,7 @@ int operandNum = 0; for (SDNode::op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I, ++operandNum) - if (I->Val == From) { + if (I->getVal() == From) { From->removeUser(operandNum, U); *I = To; I->setUser(U); @@ -3695,9 +3696,9 @@ int operandNum = 0; for (SDNode::op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I, ++operandNum) - if (I->Val == From) { + if (I->getVal() == From) { From->removeUser(operandNum, U); - I->Val = To; + I->getVal() = To; To->addUser(operandNum, U); } @@ -3724,7 +3725,7 @@ /// This version can replace From with any result values. To must match the /// number and types of values returned by From. void SelectionDAG::ReplaceAllUsesWith(SDNode *From, - const SDOperand *To, + SDOperandPtr To, DAGUpdateListener *UpdateListener) { if (From->getNumValues() == 1) // Handle the simple case efficiently. return ReplaceAllUsesWith(SDOperand(From, 0), To[0], UpdateListener); @@ -3738,8 +3739,8 @@ int operandNum = 0; for (SDNode::op_iterator I = U->op_begin(), E = U->op_end(); I != E; ++I, ++operandNum) - if (I->Val == From) { - const SDOperand &ToOp = To[I->ResNo]; + if (I->getVal() == From) { + const SDOperand &ToOp = To[I->getSDOperand().ResNo]; From->removeUser(operandNum, U); *I = ToOp; I->setUser(U); @@ -3865,7 +3866,6 @@ } } - /// AssignNodeIds - Assign a unique node id for each node in the DAG based on /// their allnodes order. It returns the maximum id. unsigned SelectionDAG::AssignNodeIds() { @@ -3902,7 +3902,7 @@ Sources.pop_back(); TopOrder.push_back(N); for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I) { - SDNode *P = I->Val; + SDNode *P = I->getVal(); unsigned Degree = --InDegree[P->getNodeId()]; if (Degree == 0) Sources.push_back(P); @@ -4077,7 +4077,7 @@ /// isOperand - Return true if this node is an operand of N. /// -bool SDOperandImpl::isOperandOf(SDNode *N) const { +bool SDOperand::isOperandOf(SDNode *N) const { for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) if (*this == N->getOperand(i)) return true; @@ -4086,7 +4086,7 @@ bool SDNode::isOperandOf(SDNode *N) const { for (unsigned i = 0, e = N->NumOperands; i != e; ++i) - if (this == N->OperandList[i].Val) + if (this == N->OperandList[i].getVal()) return true; return false; } @@ -4096,7 +4096,7 @@ /// side-effecting instructions. In practice, this looks through token /// factors and non-volatile loads. In order to remain efficient, this only /// looks a couple of nodes in, it does not do an exhaustive search. -bool SDOperandImpl::reachesChainWithoutSideEffects(SDOperandImpl Dest, +bool SDOperand::reachesChainWithoutSideEffects(SDOperand Dest, unsigned Depth) const { if (*this == Dest) return true; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49795&r1=49794&r2=49795&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Apr 16 11:15:27 2008 @@ -2094,7 +2094,7 @@ /// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand /// specifies a shuffle of elements that is suitable for input to SHUFP*. -static bool isSHUFPMask(const SDOperand *Elems, unsigned NumElems) { +static bool isSHUFPMask(SDOperandPtr Elems, unsigned NumElems) { if (NumElems != 2 && NumElems != 4) return false; unsigned Half = NumElems / 2; @@ -2117,7 +2117,7 @@ /// the reverse of what x86 shuffles want. x86 shuffles requires the lower /// half elements to come from vector 1 (which would equal the dest.) and /// the upper half to come from vector 2. -static bool isCommutedSHUFP(const SDOperand *Ops, unsigned NumOps) { +static bool isCommutedSHUFP(SDOperandPtr Ops, unsigned NumOps) { if (NumOps != 2 && NumOps != 4) return false; unsigned Half = NumOps / 2; @@ -2211,7 +2211,7 @@ /// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand /// specifies a shuffle of elements that is suitable for input to UNPCKL. -bool static isUNPCKLMask(const SDOperand *Elts, unsigned NumElts, +bool static isUNPCKLMask(SDOperandPtr Elts, unsigned NumElts, bool V2IsSplat = false) { if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16) return false; @@ -2240,7 +2240,7 @@ /// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand /// specifies a shuffle of elements that is suitable for input to UNPCKH. -bool static isUNPCKHMask(const SDOperand *Elts, unsigned NumElts, +bool static isUNPCKHMask(SDOperandPtr Elts, unsigned NumElts, bool V2IsSplat = false) { if (NumElts != 2 && NumElts != 4 && NumElts != 8 && NumElts != 16) return false; @@ -2316,7 +2316,7 @@ /// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand /// specifies a shuffle of elements that is suitable for input to MOVSS, /// MOVSD, and MOVD, i.e. setting the lowest element. -static bool isMOVLMask(const SDOperand *Elts, unsigned NumElts) { +static bool isMOVLMask(SDOperandPtr Elts, unsigned NumElts) { if (NumElts != 2 && NumElts != 4) return false; @@ -2339,7 +2339,7 @@ /// isCommutedMOVL - Returns true if the shuffle mask is except the reverse /// of what x86 movss want. X86 movs requires the lowest element to be lowest /// element of vector 2 and the other elements to come from vector 1 in order. -static bool isCommutedMOVL(const SDOperand *Ops, unsigned NumOps, +static bool isCommutedMOVL(SDOperandPtr Ops, unsigned NumOps, bool V2IsSplat = false, bool V2IsUndef = false) { if (NumOps != 2 && NumOps != 4 && NumOps != 8 && NumOps != 16) From romix.llvm at googlemail.com Wed Apr 16 11:19:41 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Wed, 16 Apr 2008 17:19:41 +0100 Subject: [llvm-commits] Speeding up instruction selection In-Reply-To: <3F534552-8033-40A3-8E0A-733516299939@apple.com> References: <1C1F9E6C-5B8E-4667-A119-4590F340FDE7@apple.com> <83CD954F-CD49-4D4B-950D-B6CB6CD1B32D@apple.com> <417E9823-6AF6-44B0-83FD-89F0CC079B6A@apple.com> <3F534552-8033-40A3-8E0A-733516299939@apple.com> Message-ID: Hi Dan, 2008/4/8, Dan Gohman : > > On Mar 31, 2008, at 5:09 AM, Roman Levenstein wrote: > > > Hi Dan, Hi Evan, > > > > Here is the updated patch. > > > > 1) I introduced the SDOperandPtr class, as I suggested in my last > > email. This class is a sort of an "intelligent" pointer. With this > > class, there is no need to copy the SDOperand arrays into the > > temporary SmallVectors. Therefore there is no additional overhead. > > > I don't know about *no* additional overhead :-), but I don't > expect it'll be a big deal. I didn't expect the previous copying > solution to be a big deal either, but I think this new approach > is fine. OK. > Please add a doxygen comment for the SDOperandPtr class to > document it. Done. > In changes like this in SelectionDAG.h: > > - const SDOperand *Ops, unsigned NumOps); > + const SDOperandPtr Ops, unsigned NumOps); > > the const is now superfluous. > > In the SDOperandPtr class, > > + SDOperandPtr(SDOperand * op_ptr) { > + ptr = op_ptr; > + object_size = sizeof(SDOperand); > + } > + > + SDOperandPtr(const SDOperand * op_ptr) { > + ptr = op_ptr; > + object_size = sizeof(SDOperand); > + } > > The first of these two constructors is unnecessary because > the second can be used in both cases. Done. > > 3) I also changed the return types of some methods from SDUse to > > SDOperand, as it was suggested during the review. > > > Ok. Remember that Chris also suggested that many of these methods > can be changed to return an SDOperand by value instead of by > reference. If you decide to do that, please do it with a > separate commit. I haven't done it so far. > With the issues mentioned above addressed, this patch looks good > to me. Good. I committed the patch including all improvements suggested by you. BTW, Dan, have you had any time to look at the patch introducing queues instead of heaps in the target specific instruction selectors? -Roman From jon at alacatialabs.com Wed Apr 16 11:25:19 2008 From: jon at alacatialabs.com (Jonathan Johnson) Date: Wed, 16 Apr 2008 11:25:19 -0500 Subject: [llvm-commits] CVS: llvm-www/devmtg/current/index.html Message-ID: <200804161625.m3GGPJoQ021755@zion.cs.uiuc.edu> Changes in directory llvm-www/devmtg/current: index.html updated: 1.9 -> 1.10 --- Log message: Added more attendees --- Diffs of the changes: (+3 -1) index.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/devmtg/current/index.html diff -u llvm-www/devmtg/current/index.html:1.9 llvm-www/devmtg/current/index.html:1.10 --- llvm-www/devmtg/current/index.html:1.9 Fri Apr 11 10:55:44 2008 +++ llvm-www/devmtg/current/index.html Wed Apr 16 11:24:42 2008 @@ -48,6 +48,7 @@ Evan ChengApple, Inc. Eric ChristopherApple, Inc. Samuel Crow + Daniel Dunbar Ryan GovostesAlacatia Labs, Inc. Kurt HarrimanGreenplum Robert HundtGoogle @@ -59,6 +60,7 @@ Bruno Cardoso Lopes Nuno Lopes Harry Metcalfe + Scott Michel Steve NaroffApple, Inc. Ted Neward Devang PatelApple, Inc. @@ -72,7 +74,7 @@ Robert Zeh Chuck (Chengyan) ZhaoUniversity of Toronto -

Total unconfirmed: 29

+

Total unconfirmed: 31

If your name is misspelled, or organization affiliation isn't correct, please email us, and we'll correct it. From dalej at apple.com Wed Apr 16 12:31:41 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Apr 2008 17:31:41 -0000 Subject: [llvm-commits] [llvm] r49799 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <200804161731.m3GHVfIp024855@zion.cs.uiuc.edu> Author: johannes Date: Wed Apr 16 12:31:41 2008 New Revision: 49799 URL: http://llvm.org/viewvc/llvm-project?rev=49799&view=rev Log: Don't read off end of the input array. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=49799&r1=49798&r2=49799&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Apr 16 12:31:41 2008 @@ -527,7 +527,7 @@ Out << (unsigned char)(nibble + '0'); else Out << (unsigned char)(nibble - 10 + 'A'); - if (shiftcount == 0) { + if (shiftcount == 0 && j+4 < width) { word = *(++p); shiftcount = 64; if (width-j-4 < 64) From evan.cheng at apple.com Wed Apr 16 13:01:08 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 18:01:08 -0000 Subject: [llvm-commits] [llvm] r49800 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Message-ID: <200804161801.m3GI180h026916@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 13:01:08 2008 New Revision: 49800 URL: http://llvm.org/viewvc/llvm-project?rev=49800&view=rev Log: Empty basic block should have an empty range. Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=49800&r1=49799&r2=49800&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Apr 16 13:01:08 2008 @@ -108,7 +108,9 @@ } // Set the MBB2IdxMap entry for this MBB. - MBB2IdxMap[MBB->getNumber()] = std::make_pair(StartIdx, MIIndex - 1); + MBB2IdxMap[MBB->getNumber()] = (StartIdx == MIIndex) + ? std::make_pair(StartIdx, StartIdx) // Empty MBB + : std::make_pair(StartIdx, MIIndex - 1); Idx2MBBMap.push_back(std::make_pair(StartIdx, MBB)); } std::sort(Idx2MBBMap.begin(), Idx2MBBMap.end(), Idx2MBBCompare()); From isanbard at gmail.com Wed Apr 16 13:14:07 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Apr 2008 11:14:07 -0700 Subject: [llvm-commits] [llvm] r49783 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp In-Reply-To: <200804160941.m3G9fxKc008379@zion.cs.uiuc.edu> References: <200804160941.m3G9fxKc008379@zion.cs.uiuc.edu> Message-ID: <16e5fdf90804161114p71df03fcva358fef23400ea3d@mail.gmail.com> On Wed, Apr 16, 2008 at 2:41 AM, Evan Cheng wrote: > > + // Trim unneeded kill operands. > + while (!DeadOps.empty()) { > + unsigned OpIdx = DeadOps.back(); > + if (getOperand(OpIdx).isImplicit()) > + RemoveOperand(OpIdx); > + else > + getOperand(OpIdx).setIsKill(false); > + DeadOps.pop_back(); > + } > + ... > > + // Trim unneeded dead operands. > + while (!DeadOps.empty()) { > + unsigned OpIdx = DeadOps.back(); > + if (getOperand(OpIdx).isImplicit()) > + RemoveOperand(OpIdx); > + else > + getOperand(OpIdx).setIsDead(false); > + DeadOps.pop_back(); > + } A small point, but it seems that the idiom people use in the code is while (!Container.empty()) { Object o = Container.back(); Container.pop_back(); // Do stuff to "o" } instead of putting the pop_back() command at the end. -bw From evan.cheng at apple.com Wed Apr 16 13:21:55 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 18:21:55 -0000 Subject: [llvm-commits] [llvm] r49802 - /llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Message-ID: <200804161821.m3GILtwf028274@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 13:21:55 2008 New Revision: 49802 URL: http://llvm.org/viewvc/llvm-project?rev=49802&view=rev Log: Really test what's intended. Modified: llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Modified: llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll?rev=49802&r1=49801&r2=49802&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-04-15-LiveVariableBug.ll Wed Apr 16 13:21:55 2008 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin +; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin -relocation-model=pic -disable-fp-elim -fast -regalloc=local %struct.CGPoint = type { double, double } %struct.NSArray = type { %struct.NSObject } From isanbard at gmail.com Wed Apr 16 13:27:03 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Apr 2008 18:27:03 -0000 Subject: [llvm-commits] [llvm] r49803 - /llvm/trunk/include/llvm/System/Path.h Message-ID: <200804161827.m3GIR3wX028630@zion.cs.uiuc.edu> Author: void Date: Wed Apr 16 13:27:02 2008 New Revision: 49803 URL: http://llvm.org/viewvc/llvm-project?rev=49803&view=rev Log: Add "empty()" method to sys::Path and remove unnecessary whitespace. Patch by Mikhail Glushenkov! Modified: llvm/trunk/include/llvm/System/Path.h Modified: llvm/trunk/include/llvm/System/Path.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Path.h?rev=49803&r1=49802&r2=49803&view=diff ============================================================================== --- llvm/trunk/include/llvm/System/Path.h (original) +++ llvm/trunk/include/llvm/System/Path.h Wed Apr 16 13:27:02 2008 @@ -28,8 +28,8 @@ /// platform independent and eliminates many of the unix-specific fields. /// However, to support llvm-ar, the mode, user, and group fields are /// retained. These pertain to unix security and may not have a meaningful - /// value on non-Unix platforms. However, the other fields fields should - /// always be applicable on all platforms. The structure is filled in by + /// value on non-Unix platforms. However, the other fields fields should + /// always be applicable on all platforms. The structure is filled in by /// the PathWithStatus class. /// @brief File status structure class FileStatus { @@ -45,7 +45,7 @@ FileStatus() : fileSize(0), modTime(0,0), mode(0777), user(999), group(999), uniqueID(0), isDir(false), isFile(false) { } - + TimeValue getTimestamp() const { return modTime; } uint64_t getSize() const { return fileSize; } uint32_t getMode() const { return mode; } @@ -148,7 +148,7 @@ /// constructor must provide the same result as GetRootDirectory. /// @brief Construct a path to the current user's "home" directory static Path GetUserHomeDirectory(); - + /// Construct a path to the current directory for the current process. /// @returns The current working directory. /// @brief Returns the current working directory. @@ -161,7 +161,7 @@ /// @returns The dynamic link library suffix for the current platform. /// @brief Return the dynamic link library suffix. static std::string GetDLLSuffix(); - + /// GetMainExecutable - Return the path to the main executable, given the /// value of argv[0] from program startup and the address of main itself. static Path GetMainExecutable(const char *argv0, void *MainAddr); @@ -177,20 +177,20 @@ /// This constructor will accept a std::string as a path. No checking is /// done on this path to determine if it is valid. To determine validity - /// of the path, use the isValid method. + /// of the path, use the isValid method. /// @param p The path to assign. /// @brief Construct a Path from a string. explicit Path(const std::string& p) : path(p) {} /// This constructor will accept a character range as a path. No checking /// is done on this path to determine if it is valid. To determine - /// validity of the path, use the isValid method. + /// validity of the path, use the isValid method. /// @param StrStart A pointer to the first character of the path name /// @param StrLen The length of the path name at StrStart /// @brief Construct a Path from a string. explicit Path(const char *StrStart, unsigned StrLen) : path(StrStart, StrStart+StrLen) {} - + /// @} /// @name Operators /// @{ @@ -240,10 +240,10 @@ /// @brief Determine if a path is syntactically valid or not. bool isValid() const; - /// This function determines if the contents of the path name are empty. + /// This function determines if the contents of the path name are empty. /// That is, the path name has a zero length. This does NOT determine if - /// if the file is empty. To get the length of the file itself, Use the - /// PathWithStatus::getFileStatus() method and then the getSize() method + /// if the file is empty. To get the length of the file itself, Use the + /// PathWithStatus::getFileStatus() method and then the getSize() method /// on the returned FileStatus object. /// @returns true iff the path is empty. /// @brief Determines if the path name is empty (invalid). @@ -269,7 +269,7 @@ /// @returns std::string containing the basename of the path /// @brief Get the base name of the path std::string getBasename() const; - + /// This function strips off the suffix of the path beginning with the /// path separator ('/' on Unix, '\' on Windows) and returns the result. std::string getDirname() const; @@ -286,10 +286,13 @@ /// @returns a 'C' string containing the path name. /// @brief Returns the path as a C string. const char *c_str() const { return path.c_str(); } - + /// size - Return the length in bytes of this path name. unsigned size() const { return path.size(); } + /// empty - Returns true if the path is empty. + unsigned empty() const { return path.empty(); } + /// @} /// @name Disk Accessors /// @{ @@ -303,7 +306,7 @@ bool isRootDirectory() const; /// This function determines if the path name is absolute, as opposed to - /// relative. + /// relative. /// @brief Determine if the path is absolute. bool isAbsolute() const; @@ -336,7 +339,7 @@ /// bitcode files. /// @brief Determine if the path references a bitcode file. bool isBitcodeFile() const; - + /// This function determines if the path name in the object references a /// native Dynamic Library (shared library, shared object) by looking at /// the file's magic number. The Path object must reference a file, not a @@ -345,7 +348,7 @@ /// shared library. /// @brief Determine if the path reference a dynamic library. bool isDynamicLibrary() const; - + /// This function determines if the path name references an existing file /// or directory in the file system. /// @returns true if the pathname references an existing file or @@ -354,12 +357,12 @@ /// the file system. bool exists() const; - /// This function determines if the path name refences an + /// This function determines if the path name refences an /// existing directory. /// @returns true if the pathname references an existing directory. /// @brief Determins if the path is a directory in the file system. bool isDirectory() const; - + /// This function determines if the path name references a readable file /// or directory in the file system. This function checks for /// the existence and readability (by the current program) of the file @@ -494,9 +497,9 @@ /// created. The created directory will have no entries. /// @returns true if the directory could not be created, false otherwise /// @brief Create the directory this Path refers to. - bool createDirectoryOnDisk( - bool create_parents = false, ///< Determines whether non-existent - ///< directory components other than the last one (the "parents") + bool createDirectoryOnDisk( + bool create_parents = false, ///< Determines whether non-existent + ///< directory components other than the last one (the "parents") ///< are created or not. std::string* ErrMsg = 0 ///< Optional place to put error messages. ); @@ -518,11 +521,11 @@ /// file is created. Note that this will both change the Path object /// *and* create the corresponding file. This function will ensure that /// the newly generated temporary file name is unique in the file system. - /// @returns true if the file couldn't be created, false otherwise. + /// @returns true if the file couldn't be created, false otherwise. /// @brief Create a unique temporary file bool createTemporaryFileOnDisk( - bool reuse_current = false, ///< When set to true, this parameter - ///< indicates that if the current file name does not exist then + bool reuse_current = false, ///< When set to true, this parameter + ///< indicates that if the current file name does not exist then ///< it will be used without modification. std::string* ErrMsg = 0 ///< Optional place to put error messages ); @@ -548,8 +551,8 @@ /// @brief Removes the file or directory from the filesystem. bool eraseFromDisk(bool destroy_contents = false, std::string *Err = 0) const; - - + + /// MapInFilePages - This is a low level system API to map in the file /// that is currently opened as FD into the current processes' address /// space for read only access. This function may return null on failure @@ -560,23 +563,23 @@ /// present. /// 3) The pages must be contiguous. /// - /// This API is not intended for general use, clients should use + /// This API is not intended for general use, clients should use /// MemoryBuffer::getFile instead. static const char *MapInFilePages(int FD, uint64_t FileSize); - + /// UnMapFilePages - Free pages mapped into the current process by /// MapInFilePages. - /// - /// This API is not intended for general use, clients should use + /// + /// This API is not intended for general use, clients should use /// MemoryBuffer::getFile instead. static void UnMapFilePages(const char *Base, uint64_t FileSize); - + /// @} /// @name Data /// @{ protected: mutable std::string path; ///< Storage for the path name. - + /// @} }; @@ -592,23 +595,23 @@ class PathWithStatus : public Path { /// @name Constructors /// @{ - public: + public: /// @brief Default constructor PathWithStatus() : Path(), status(), fsIsValid(false) {} /// @brief Copy constructor - PathWithStatus(const PathWithStatus &that) - : Path(static_cast(that)), status(that.status), + PathWithStatus(const PathWithStatus &that) + : Path(static_cast(that)), status(that.status), fsIsValid(that.fsIsValid) {} /// This constructor allows construction from a Path object /// @brief Path constructor - PathWithStatus(const Path &other) + PathWithStatus(const Path &other) : Path(other), status(), fsIsValid(false) {} /// This constructor will accept a std::string as a path. No checking is /// done on this path to determine if it is valid. To determine validity - /// of the path, use the isValid method. + /// of the path, use the isValid method. /// @brief Construct a Path from a string. explicit PathWithStatus( const std::string& p ///< The path to assign. @@ -616,7 +619,7 @@ /// This constructor will accept a character range as a path. No checking /// is done on this path to determine if it is valid. To determine - /// validity of the path, use the isValid method. + /// validity of the path, use the isValid method. /// @brief Construct a Path from a string. explicit PathWithStatus( const char *StrStart, ///< Pointer to the first character of the path @@ -704,7 +707,7 @@ } std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath); -inline std::ostream& operator<<(std::ostream& strm, +inline std::ostream& operator<<(std::ostream& strm, const sys::PathWithStatus& aPath) { strm << static_cast(aPath); return strm; From isanbard at gmail.com Wed Apr 16 13:27:13 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Apr 2008 11:27:13 -0700 Subject: [llvm-commits] [PATCH] Add method empty() to sys::Path. In-Reply-To: <44344.81.172.134.32.1208353552.squirrel@webmail.sophsolutions.com> References: <44344.81.172.134.32.1208353552.squirrel@webmail.sophsolutions.com> Message-ID: <16e5fdf90804161127n3153c199v283f48779972a0e8@mail.gmail.com> Applied. Thanks! -bw On Wed, Apr 16, 2008 at 6:45 AM, Mikhail Glushenkov wrote: > Add method empty() to sys::Path. Also remove some unnecessary trailing > whitespace:) > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From evan.cheng at apple.com Wed Apr 16 13:48:43 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 18:48:43 -0000 Subject: [llvm-commits] [llvm] r49807 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200804161848.m3GImhG0030319@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 13:48:43 2008 New Revision: 49807 URL: http://llvm.org/viewvc/llvm-project?rev=49807&view=rev Log: Fix PR2226. Avoid using uninitialized variables. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49807&r1=49806&r2=49807&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Apr 16 13:48:43 2008 @@ -97,6 +97,8 @@ // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); + if (BLR == IntB.end()) // Should never happen! + return false; VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -107,6 +109,8 @@ // AValNo is the value number in A that defines the copy, A3 in the example. LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1); + if (ALR == IntA.end()) // Should never happen! + return false; VNInfo *AValNo = ALR->valno; // If AValNo is defined as a copy from IntB, we can potentially process this. @@ -122,6 +126,8 @@ // Get the LiveRange in IntB that this value number starts with. LiveInterval::iterator ValLR = IntB.FindLiveRangeContaining(AValNo->def-1); + if (ValLR == IntB.end()) // Should never happen! + return false; // Make sure that the end of the live range is inside the same block as // CopyMI. @@ -251,6 +257,8 @@ // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); + if (BLR == IntB.end()) // Should never happen! + return false; VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -261,6 +269,8 @@ // AValNo is the value number in A that defines the copy, A3 in the example. LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1); + if (ALR == IntA.end()) // Should never happen! + return false; VNInfo *AValNo = ALR->valno; // If other defs can reach uses of this def, then it's not safe to perform // the optimization. @@ -290,6 +300,8 @@ MachineInstr *UseMI = &*UI; unsigned UseIdx = li_->getInstructionIndex(UseMI); LiveInterval::iterator ULR = IntA.FindLiveRangeContaining(UseIdx); + if (ULR == IntA.end()) + continue; if (ULR->valno == AValNo && JoinedCopies.count(UseMI)) return false; } @@ -337,7 +349,7 @@ continue; unsigned UseIdx = li_->getInstructionIndex(UseMI); LiveInterval::iterator ULR = IntA.FindLiveRangeContaining(UseIdx); - if (ULR->valno != AValNo) + if (ULR == IntA.end() || ULR->valno != AValNo) continue; UseMO.setReg(NewReg); if (UseMI == CopyMI) @@ -356,7 +368,7 @@ // remove that val# as well. However this live range is being // extended to the end of the existing live range defined by the copy. unsigned DefIdx = li_->getDefIndex(UseIdx); - LiveInterval::iterator DLR = IntB.FindLiveRangeContaining(DefIdx); + const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx); BHasPHIKill |= DLR->valno->hasPHIKill; assert(DLR->valno->def == DefIdx); BDeadValNos.push_back(DLR->valno); @@ -515,8 +527,7 @@ unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI)); if (JoinedCopies.count(UseMI)) continue; - LiveInterval::const_iterator UI = LI.FindLiveRangeContaining(UseIdx); - assert(UI != LI.end()); + const LiveRange *UI = LI.getLiveRangeContaining(UseIdx); if (!LI.isKill(UI->valno, UseIdx+1)) UseMO.setIsKill(false); } @@ -614,7 +625,7 @@ assert(TargetRegisterInfo::isPhysicalRegister(li.reg)); // Live-in to the function but dead. Remove it from entry live-in set. mf_->begin()->removeLiveIn(li.reg); - LiveInterval::iterator LR = li.FindLiveRangeContaining(CopyIdx); + const LiveRange *LR = li.getLiveRangeContaining(CopyIdx); removeRange(li, LR->start, LR->end, li_, tri_); removeIntervalIfEmpty(li, li_, tri_); return; @@ -694,7 +705,7 @@ continue; unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI)); LiveInterval::iterator ULR = li.FindLiveRangeContaining(UseIdx); - if (ULR->valno != LR->valno) + if (ULR == li.end() || ULR->valno != LR->valno) continue; // If the use is not a use, then it's not safe to coalesce the move. unsigned SrcReg, DstReg; @@ -733,7 +744,7 @@ continue; unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(MI)); LiveInterval::iterator ULR = li.FindLiveRangeContaining(UseIdx); - if (ULR->valno != VNI) + if (ULR == li.end() || ULR->valno != VNI) continue; // If the use is a copy, turn it into an identity copy. unsigned SrcReg, DstReg; @@ -1013,9 +1024,8 @@ SmallSet CopiedValNos; for (LiveInterval::Ranges::const_iterator I = ResSrcInt->ranges.begin(), E = ResSrcInt->ranges.end(); I != E; ++I) { - LiveInterval::const_iterator DstLR = - ResDstInt->FindLiveRangeContaining(I->start); - assert(DstLR != ResDstInt->end() && "Invalid joined interval!"); + const LiveRange *DstLR = ResDstInt->getLiveRangeContaining(I->start); + assert(DstLR && "Invalid joined interval!"); const VNInfo *DstValNo = DstLR->valno; if (CopiedValNos.insert(DstValNo)) { VNInfo *ValNo = RealInt.getNextValue(DstValNo->def, DstValNo->copy, @@ -1095,7 +1105,7 @@ // by the copy is being defined by an IMPLICIT_DEF which defines a zero // length interval. Remove the val#. unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI)); - LiveInterval::iterator LR = ResDstInt->FindLiveRangeContaining(CopyIdx); + const LiveRange *LR = ResDstInt->getLiveRangeContaining(CopyIdx); VNInfo *ImpVal = LR->valno; assert(ImpVal->def == CopyIdx); unsigned NextDef = LR->end; @@ -1877,7 +1887,7 @@ if (!li_->hasInterval(DstReg)) return false; LiveInterval &DstInt = li_->getInterval(DstReg); - LiveInterval::iterator DstLR = DstInt.FindLiveRangeContaining(CopyIdx); + const LiveRange *DstLR = DstInt.getLiveRangeContaining(CopyIdx); DstInt.removeValNo(DstLR->valno); CopyMI->setDesc(tii_->get(TargetInstrInfo::IMPLICIT_DEF)); for (int i = CopyMI->getNumOperands() - 1, e = 0; i > e; --i) @@ -1934,7 +1944,12 @@ E = JoinedCopies.end(); I != E; ++I) { MachineInstr *CopyMI = *I; unsigned SrcReg, DstReg; - tii_->isMoveInstr(*CopyMI, SrcReg, DstReg); + if (!tii_->isMoveInstr(*CopyMI, SrcReg, DstReg)) { + assert((CopyMI->getOpcode() == TargetInstrInfo::EXTRACT_SUBREG || + CopyMI->getOpcode() == TargetInstrInfo::INSERT_SUBREG) && + "Unrecognized copy instruction"); + DstReg = CopyMI->getOperand(0).getReg(); + } if (CopyMI->registerDefIsDead(DstReg)) { LiveInterval &li = li_->getInterval(DstReg); ShortenDeadCopySrcLiveRange(li, CopyMI); From gohman at apple.com Wed Apr 16 13:52:53 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 11:52:53 -0700 Subject: [llvm-commits] [llvm] r49768 - in /llvm/trunk: include/llvm/Analysis/DominatorInternals.h include/llvm/Analysis/Dominators.h lib/Analysis/PostDominators.cpp lib/VMCore/Dominators.cpp In-Reply-To: <200804160421.m3G4LG6b022240@zion.cs.uiuc.edu> References: <200804160421.m3G4LG6b022240@zion.cs.uiuc.edu> Message-ID: On Apr 15, 2008, at 9:21 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Apr 15 23:21:16 2008 > New Revision: 49768 > > URL: http://llvm.org/viewvc/llvm-project?rev=49768&view=rev > Log: > Major repairs to the post-dominators implementation. Patch from > Florian Brandner! Cool! BTW, does this fix PR1098 by any chance? Dan From gohman at apple.com Wed Apr 16 13:54:08 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 11:54:08 -0700 Subject: [llvm-commits] [llvm] r49762 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/sse41-extractps-bitcast-0.ll test/CodeGen/X86/sse41-extractps-bitcast-1.ll In-Reply-To: <8C361EDD-B7AC-4EEE-BCE2-CF6DB0C2F573@apple.com> References: <200804160232.m3G2WOjO018983@zion.cs.uiuc.edu> <8C361EDD-B7AC-4EEE-BCE2-CF6DB0C2F573@apple.com> Message-ID: On Apr 15, 2008, at 8:22 PM, Chris Lattner wrote: > On Apr 15, 2008, at 7:32 PM, Dan Gohman wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=49762&view=rev >> Log: >> Add support for the form of the SSE41 extractps instruction that >> puts its result in a 32-bit GPR. > > Ooh, nice. Can you run an example that uses this through the JIT to > ensure the encoding is correct? If you need an acct on an sse4 > machine, let me know, I double-checked it with gdb disassembling the jit'd code. Dan From evan.cheng at apple.com Wed Apr 16 14:03:03 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 19:03:03 -0000 Subject: [llvm-commits] [llvm] r49808 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp Message-ID: <200804161903.m3GJ33Ck031434@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 14:03:02 2008 New Revision: 49808 URL: http://llvm.org/viewvc/llvm-project?rev=49808&view=rev Log: Initialize X863DNowLevel. Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=49808&r1=49807&r2=49808&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Wed Apr 16 14:03:02 2008 @@ -241,6 +241,7 @@ : AsmFlavor(AsmWriterFlavor) , PICStyle(PICStyle::None) , X86SSELevel(NoMMXSSE) + , X863DNowLevel(NoThreeDNow) , HasX86_64(false) , DarwinVers(0) , stackAlignment(8) From evan.cheng at apple.com Wed Apr 16 14:50:51 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 12:50:51 -0700 Subject: [llvm-commits] JIT memory manager: Correlate stubs with functions In-Reply-To: <4804A712.4070308@lip6.fr> References: <4804A712.4070308@lip6.fr> Message-ID: <7BB191F8-FCE0-4FC8-AE59-B86F63166E8F@apple.com> On Apr 15, 2008, at 6:01 AM, Nicolas Geoffray wrote: > Hi everyone, > > The attached patch adds a new Function parameter to > startFunctionStub, which is the function that the generated stub > will call. The motivation behind is that a custom JITMemoryManager > may want to allocate stubs and functions on a per-module basis. For > example Module A is given a 20MB, Module B is given 10MB, etc. And > if a function from A calls a function from B, and a stub is > generated, it should be allocated on behalf of B. > > OK to commit? Yep. Evan > > > Thx, > Nicolas > Index: include/llvm/Target/TargetJITInfo.h > =================================================================== > --- include/llvm/Target/TargetJITInfo.h (revision 49722) > +++ include/llvm/Target/TargetJITInfo.h (working copy) > @@ -23,6 +23,7 @@ > > namespace llvm { > class Function; > + class GlobalValue; > class MachineBasicBlock; > class MachineCodeEmitter; > class MachineRelocation; > @@ -41,8 +42,9 @@ > virtual void replaceMachineCodeForFunction(void *Old, void *New) > = 0; > > /// emitGlobalValueLazyPtr - Use the specified > MachineCodeEmitter object to > - /// emit a lazy pointer which contains the address of the > specified GV. > - virtual void *emitGlobalValueLazyPtr(void *GV, > MachineCodeEmitter &MCE) { > + /// emit a lazy pointer which contains the address of the > specified ptr. > + virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, > void *ptr, > + MachineCodeEmitter &MCE) { > assert(0 && "This target doesn't implement > emitGlobalValueLazyPtr!"); > return 0; > } > @@ -50,7 +52,8 @@ > /// emitFunctionStub - Use the specified MachineCodeEmitter > object to emit a > /// small native function that simply calls the function at the > specified > /// address. Return the address of the resultant function. > - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE) { > + virtual void *emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE) { > assert(0 && "This target doesn't implement emitFunctionStub!"); > return 0; > } > Index: include/llvm/ExecutionEngine/JITMemoryManager.h > =================================================================== > --- include/llvm/ExecutionEngine/JITMemoryManager.h (revision 49722) > +++ include/llvm/ExecutionEngine/JITMemoryManager.h (working copy) > @@ -74,7 +74,8 @@ > /// thunk for it. The stub should be "close" to the current > function body, > /// but should not be included in the 'actualsize' returned by > /// startFunctionBody. > - virtual unsigned char *allocateStub(unsigned StubSize, unsigned > Alignment) =0; > + virtual unsigned char *allocateStub(const GlobalValue* F, > unsigned StubSize, > + unsigned Alignment) =0; > > > /// endFunctionBody - This method is called when the JIT is done > codegen'ing > Index: include/llvm/CodeGen/MachineCodeEmitter.h > =================================================================== > --- include/llvm/CodeGen/MachineCodeEmitter.h (revision 49722) > +++ include/llvm/CodeGen/MachineCodeEmitter.h (working copy) > @@ -82,12 +82,13 @@ > /// have constant pools, the can only use the other emitByte*/ > emitWord* > /// methods. > /// > - virtual void startFunctionStub(unsigned StubSize, unsigned > Alignment = 1) = 0; > + virtual void startFunctionStub(const GlobalValue* F, unsigned > StubSize, > + unsigned Alignment = 1) = 0; > > /// finishFunctionStub - This callback is invoked to terminate a > function > /// stub. > /// > - virtual void *finishFunctionStub(const Function *F) = 0; > + virtual void *finishFunctionStub(const GlobalValue* F) = 0; > > /// emitByte - This callback is invoked when a byte needs to be > written to the > /// output stream. > Index: lib/CodeGen/ELFWriter.cpp > =================================================================== > --- lib/CodeGen/ELFWriter.cpp (revision 49722) > +++ lib/CodeGen/ELFWriter.cpp (working copy) > @@ -114,11 +114,12 @@ > > > /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! > - void startFunctionStub(unsigned StubSize, unsigned Alignment = > 1) { > + void startFunctionStub(const GlobalValue* F, unsigned StubSize, > + unsigned Alignment = 1) { > assert(0 && "JIT specific function called!"); > abort(); > } > - void *finishFunctionStub(const Function *F) { > + void *finishFunctionStub(const GlobalValue *F) { > assert(0 && "JIT specific function called!"); > abort(); > return 0; > Index: lib/CodeGen/MachOWriter.cpp > =================================================================== > --- lib/CodeGen/MachOWriter.cpp (revision 49722) > +++ lib/CodeGen/MachOWriter.cpp (working copy) > @@ -141,11 +141,12 @@ > virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { } > > /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! > - virtual void startFunctionStub(unsigned StubSize, unsigned > Alignment = 1) { > + virtual void startFunctionStub(const GlobalValue* F, unsigned > StubSize, > + unsigned Alignment = 1) { > assert(0 && "JIT specific function called!"); > abort(); > } > - virtual void *finishFunctionStub(const Function *F) { > + virtual void *finishFunctionStub(const GlobalValue* F) { > assert(0 && "JIT specific function called!"); > abort(); > return 0; > Index: lib/Target/PowerPC/PPCJITInfo.h > =================================================================== > --- lib/Target/PowerPC/PPCJITInfo.h (revision 49722) > +++ lib/Target/PowerPC/PPCJITInfo.h (working copy) > @@ -29,7 +29,8 @@ > is64Bit = tmIs64Bit; > } > > - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE); > + virtual void *emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE); > virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); > virtual void relocate(void *Function, MachineRelocation *MR, > unsigned NumRelocs, unsigned char* GOTBase); > Index: lib/Target/PowerPC/PPCJITInfo.cpp > =================================================================== > --- lib/Target/PowerPC/PPCJITInfo.cpp (revision 49722) > +++ lib/Target/PowerPC/PPCJITInfo.cpp (working copy) > @@ -15,6 +15,7 @@ > #include "PPCJITInfo.h" > #include "PPCRelocations.h" > #include "PPCTargetMachine.h" > +#include "llvm/Function.h" > #include "llvm/CodeGen/MachineCodeEmitter.h" > #include "llvm/Config/alloca.h" > #include "llvm/Support/Debug.h" > @@ -338,12 +339,13 @@ > #endif > } > > -void *PPCJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE) { > +void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE) { > // If this is just a call to an external function, emit a branch > instead of a > // call. The code is the same except for one bit of the last > instruction. > if (Fn != (void*)(intptr_t)PPC32CompilationCallback && > Fn != (void*)(intptr_t)PPC64CompilationCallback) { > - MCE.startFunctionStub(7*4); > + MCE.startFunctionStub(F, 7*4); > intptr_t Addr = (intptr_t)MCE.getCurrentPCValue(); > MCE.emitWordBE(0); > MCE.emitWordBE(0); > @@ -354,10 +356,10 @@ > MCE.emitWordBE(0); > EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit); > SyncICache((void*)Addr, 7*4); > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > - MCE.startFunctionStub(10*4); > + MCE.startFunctionStub(F, 10*4); > intptr_t Addr = (intptr_t)MCE.getCurrentPCValue(); > if (is64Bit) { > MCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1) > @@ -382,7 +384,7 @@ > MCE.emitWordBE(0); > EmitBranchToAt(BranchAddr, (intptr_t)Fn, true, is64Bit); > SyncICache((void*)Addr, 10*4); > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > > Index: lib/Target/ARM/ARMJITInfo.cpp > =================================================================== > --- lib/Target/ARM/ARMJITInfo.cpp (revision 49722) > +++ lib/Target/ARM/ARMJITInfo.cpp (working copy) > @@ -15,6 +15,7 @@ > #include "ARMJITInfo.h" > #include "ARMRelocations.h" > #include "ARMSubtarget.h" > +#include "llvm/Function.h" > #include "llvm/CodeGen/MachineCodeEmitter.h" > #include "llvm/Config/alloca.h" > #include > @@ -93,20 +94,21 @@ > return ARMCompilationCallback; > } > > -void *ARMJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE) { > +void *ARMJITInfo::emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE) { > unsigned addr = (intptr_t)Fn; > // If this is just a call to an external function, emit a branch > instead of a > // call. The code is the same except for one bit of the last > instruction. > if (Fn != (void*)(intptr_t)ARMCompilationCallback) { > // branch to the corresponding function addr > // the stub is 8-byte size and 4-aligned > - MCE.startFunctionStub(8, 4); > + MCE.startFunctionStub(F, 8, 4); > MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4] > MCE.emitWordLE(addr); // addr of function > } else { > // branch and link to the corresponding function addr > // the stub is 20-byte size and 4-aligned > - MCE.startFunctionStub(20, 4); > + MCE.startFunctionStub(F, 20, 4); > MCE.emitWordLE(0xE92D4800); // STMFD SP!, [R11, LR] > MCE.emitWordLE(0xE28FE004); // ADD LR, PC, #4 > MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4] > @@ -114,7 +116,7 @@ > MCE.emitWordLE(0xE8BD8800); // LDMFD SP!, [R11, PC] > } > > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > /// relocate - Before the JIT can run a block of code that has been > emitted, > Index: lib/Target/ARM/ARMJITInfo.h > =================================================================== > --- lib/Target/ARM/ARMJITInfo.h (revision 49722) > +++ lib/Target/ARM/ARMJITInfo.h (working copy) > @@ -34,7 +34,8 @@ > /// emitFunctionStub - Use the specified MachineCodeEmitter > object to emit a > /// small native function that simply calls the function at the > specified > /// address. > - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE); > + virtual void *emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE); > > /// getLazyResolverFunction - Expose the lazy resolver to the JIT. > virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); > Index: lib/Target/Alpha/AlphaJITInfo.cpp > =================================================================== > --- lib/Target/Alpha/AlphaJITInfo.cpp (revision 49722) > +++ lib/Target/Alpha/AlphaJITInfo.cpp (working copy) > @@ -14,6 +14,7 @@ > #define DEBUG_TYPE "jit" > #include "AlphaJITInfo.h" > #include "AlphaRelocations.h" > +#include "llvm/Function.h" > #include "llvm/CodeGen/MachineCodeEmitter.h" > #include "llvm/Config/alloca.h" > #include "llvm/Support/Debug.h" > @@ -190,16 +191,17 @@ > #endif > } > > -void *AlphaJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE) { > +void *AlphaJITInfo::emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE) { > //assert(Fn == AlphaCompilationCallback && "Where are you going? > \n"); > //Do things in a stupid slow way! > - MCE.startFunctionStub(19*4); > + MCE.startFunctionStub(F, 19*4); > void* Addr = (void*)(intptr_t)MCE.getCurrentPCValue(); > for (int x = 0; x < 19; ++ x) > MCE.emitWordLE(0); > EmitBranchToAt(Addr, Fn); > DOUT << "Emitting Stub to " << Fn << " at [" << Addr << "]\n"; > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > TargetJITInfo::LazyResolverFn > Index: lib/Target/Alpha/AlphaJITInfo.h > =================================================================== > --- lib/Target/Alpha/AlphaJITInfo.h (revision 49722) > +++ lib/Target/Alpha/AlphaJITInfo.h (working copy) > @@ -29,7 +29,8 @@ > explicit AlphaJITInfo(TargetMachine &tm) : TM(tm) > { useGOT = true; } > > - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE); > + virtual void *emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE); > virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); > virtual void relocate(void *Function, MachineRelocation *MR, > unsigned NumRelocs, unsigned char* GOTBase); > Index: lib/Target/X86/X86JITInfo.h > =================================================================== > --- lib/Target/X86/X86JITInfo.h (revision 49722) > +++ lib/Target/X86/X86JITInfo.h (working copy) > @@ -14,6 +14,7 @@ > #ifndef X86JITINFO_H > #define X86JITINFO_H > > +#include "llvm/Function.h" > #include "llvm/Target/TargetJITInfo.h" > > namespace llvm { > @@ -33,13 +34,15 @@ > virtual void replaceMachineCodeForFunction(void *Old, void *New); > > /// emitGlobalValueLazyPtr - Use the specified > MachineCodeEmitter object to > - /// emit a lazy pointer which contains the address of the > specified GV. > - virtual void *emitGlobalValueLazyPtr(void *GV, > MachineCodeEmitter &MCE); > + /// emit a lazy pointer which contains the address of the > specified ptr. > + virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, > void *ptr, > + MachineCodeEmitter &MCE); > > /// emitFunctionStub - Use the specified MachineCodeEmitter > object to emit a > /// small native function that simply calls the function at the > specified > /// address. > - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE); > + virtual void *emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE); > > /// getPICJumpTableEntry - Returns the value of the jumptable > entry for the > /// specific basic block. > Index: lib/Target/X86/X86JITInfo.cpp > =================================================================== > --- lib/Target/X86/X86JITInfo.cpp (revision 49722) > +++ lib/Target/X86/X86JITInfo.cpp (working copy) > @@ -15,6 +15,7 @@ > #include "X86JITInfo.h" > #include "X86Relocations.h" > #include "X86Subtarget.h" > +#include "llvm/Function.h" > #include "llvm/CodeGen/MachineCodeEmitter.h" > #include "llvm/Config/alloca.h" > #include > @@ -391,19 +392,21 @@ > return X86CompilationCallback; > } > > -void *X86JITInfo::emitGlobalValueLazyPtr(void *GV, > MachineCodeEmitter &MCE) { > +void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, > void *ptr, > + MachineCodeEmitter &MCE) { > #if defined (X86_64_JIT) > MCE.startFunctionStub(8, 8); > - MCE.emitWordLE(((unsigned *)&GV)[0]); > - MCE.emitWordLE(((unsigned *)&GV)[1]); > + MCE.emitWordLE(((unsigned *)&ptr)[0]); > + MCE.emitWordLE(((unsigned *)&ptr)[1]); > #else > - MCE.startFunctionStub(4, 4); > - MCE.emitWordLE((intptr_t)GV); > + MCE.startFunctionStub(GV, 4, 4); > + MCE.emitWordLE((intptr_t)ptr); > #endif > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(GV); > } > > -void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter > &MCE) { > +void *X86JITInfo::emitFunctionStub(const Function* F, void *Fn, > + MachineCodeEmitter &MCE) { > // Note, we cast to intptr_t here to silence a -pedantic warning > that > // complains about casting a function pointer to a normal pointer. > #if defined (X86_32_JIT) && !defined (_MSC_VER) > @@ -414,7 +417,7 @@ > #endif > if (NotCC) { > #if defined (X86_64_JIT) > - MCE.startFunctionStub(13, 4); > + MCE.startFunctionStub(F, 13, 4); > MCE.emitByte(0x49); // REX prefix > MCE.emitByte(0xB8+2); // movabsq r10 > MCE.emitWordLE(((unsigned *)&Fn)[0]); > @@ -423,15 +426,15 @@ > MCE.emitByte(0xFF); // jmpq *r10 > MCE.emitByte(2 | (4 << 3) | (3 << 6)); > #else > - MCE.startFunctionStub(5, 4); > + MCE.startFunctionStub(F, 5, 4); > MCE.emitByte(0xE9); > MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); > #endif > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > #if defined (X86_64_JIT) > - MCE.startFunctionStub(14, 4); > + MCE.startFunctionStub(F, 14, 4); > MCE.emitByte(0x49); // REX prefix > MCE.emitByte(0xB8+2); // movabsq r10 > MCE.emitWordLE(((unsigned *)&Fn)[0]); > @@ -440,14 +443,14 @@ > MCE.emitByte(0xFF); // callq *r10 > MCE.emitByte(2 | (2 << 3) | (3 << 6)); > #else > - MCE.startFunctionStub(6, 4); > + MCE.startFunctionStub(F, 6, 4); > MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination... > > MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); > #endif > > MCE.emitByte(0xCD); // Interrupt - Just a marker identifying the > stub! > - return MCE.finishFunctionStub(0); > + return MCE.finishFunctionStub(F); > } > > /// getPICJumpTableEntry - Returns the value of the jumptable entry > for the > Index: lib/ExecutionEngine/JIT/JITEmitter.cpp > =================================================================== > --- lib/ExecutionEngine/JIT/JITEmitter.cpp (revision 49722) > +++ lib/ExecutionEngine/JIT/JITEmitter.cpp (working copy) > @@ -175,7 +175,7 @@ > > // Otherwise, codegen a new stub. For now, the stub will call the > lazy > // resolver function. > - Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, > + Stub = TheJIT->getJITInfo().emitFunctionStub(F, Actual, > *TheJIT- > >getCodeEmitter()); > > if (Actual != (void*)(intptr_t)LazyResolverFn) { > @@ -204,7 +204,7 @@ > if (LazyPtr) return LazyPtr; > > // Otherwise, codegen a new lazy pointer. > - LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GVAddress, > + LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GV, > GVAddress, > *TheJIT- > >getCodeEmitter()); > > DOUT << "JIT: Stub emitted at [" << LazyPtr << "] for GV '" > @@ -220,7 +220,7 @@ > void *&Stub = ExternalFnToStubMap[FnAddr]; > if (Stub) return Stub; > > - Stub = TheJIT->getJITInfo().emitFunctionStub(FnAddr, > + Stub = TheJIT->getJITInfo().emitFunctionStub(0, FnAddr, > *TheJIT- > >getCodeEmitter()); > > DOUT << "JIT: Stub emitted at [" << Stub > @@ -503,8 +503,9 @@ > void initJumpTableInfo(MachineJumpTableInfo *MJTI); > void emitJumpTableInfo(MachineJumpTableInfo *MJTI); > > - virtual void startFunctionStub(unsigned StubSize, unsigned > Alignment = 1); > - virtual void* finishFunctionStub(const Function *F); > + virtual void startFunctionStub(const GlobalValue* F, unsigned > StubSize, > + unsigned Alignment = 1); > + virtual void* finishFunctionStub(const GlobalValue *F); > > virtual void addRelocation(const MachineRelocation &MR) { > Relocations.push_back(MR); > @@ -822,16 +823,17 @@ > } > } > > -void JITEmitter::startFunctionStub(unsigned StubSize, unsigned > Alignment) { > +void JITEmitter::startFunctionStub(const GlobalValue* F, unsigned > StubSize, > + unsigned Alignment) { > SavedBufferBegin = BufferBegin; > SavedBufferEnd = BufferEnd; > SavedCurBufferPtr = CurBufferPtr; > > - BufferBegin = CurBufferPtr = MemMgr->allocateStub(StubSize, > Alignment); > + BufferBegin = CurBufferPtr = MemMgr->allocateStub(F, StubSize, > Alignment); > BufferEnd = BufferBegin+StubSize+1; > } > > -void *JITEmitter::finishFunctionStub(const Function *F) { > +void *JITEmitter::finishFunctionStub(const GlobalValue* F) { > NumBytes += getCurrentPCOffset(); > std::swap(SavedBufferBegin, BufferBegin); > BufferEnd = SavedBufferEnd; > Index: lib/ExecutionEngine/JIT/JITMemoryManager.cpp > =================================================================== > --- lib/ExecutionEngine/JIT/JITMemoryManager.cpp (revision 49722) > +++ lib/ExecutionEngine/JIT/JITMemoryManager.cpp (working copy) > @@ -11,6 +11,7 @@ > // > // > = > = > = > ----------------------------------------------------------------------= > ==// > > +#include "llvm/GlobalValue.h" > #include "llvm/ExecutionEngine/JITMemoryManager.h" > #include "llvm/Support/Compiler.h" > #include "llvm/System/Memory.h" > @@ -265,7 +266,8 @@ > > void AllocateGOT(); > > - unsigned char *allocateStub(unsigned StubSize, unsigned > Alignment); > + unsigned char *allocateStub(const GlobalValue* F, unsigned > StubSize, > + unsigned Alignment); > > /// startFunctionBody - When a function starts, allocate a block > of free > /// executable memory, returning a pointer to it and its actual > size. > @@ -438,7 +440,8 @@ > Blocks.clear(); > } > > -unsigned char *DefaultJITMemoryManager::allocateStub(unsigned > StubSize, > +unsigned char *DefaultJITMemoryManager::allocateStub(const > GlobalValue* F, > + unsigned > StubSize, > unsigned > Alignment) { > CurStubPtr -= StubSize; > CurStubPtr = (unsigned char*)(((intptr_t)CurStubPtr) & > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicolas.geoffray at lip6.fr Wed Apr 16 15:10:14 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 16 Apr 2008 20:10:14 -0000 Subject: [llvm-commits] [llvm] r49809 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/ lib/Target/ARM/ lib/Target/PowerPC/ lib/Target/X86/ Message-ID: <200804162010.m3GKAETc004542@zion.cs.uiuc.edu> Author: geoffray Date: Wed Apr 16 15:10:13 2008 New Revision: 49809 URL: http://llvm.org/viewvc/llvm-project?rev=49809&view=rev Log: Infrastructure for getting the machine code size of a function and an instruction. X86, PowerPC and ARM are implemented Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.h llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.h llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Wed Apr 16 15:10:13 2008 @@ -388,6 +388,18 @@ abort(); return 0; // Must return a value in order to compile with VS 2005 } + + /// GetInstSize - Returns the size of the specified Instruction. + /// + virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const { + assert(0 && "Target didn't implement TargetInstrInfo::GetInstSize!"); + return 0; + } + + /// GetFunctionSizeInBytes - Returns the size of the specified MachineFunction. + /// + virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const = 0; + }; /// TargetInstrInfoImpl - This is the default implementation of @@ -408,6 +420,7 @@ MachineBasicBlock::iterator MI, unsigned DestReg, const MachineInstr *Orig) const; + virtual unsigned GetFunctionSizeInBytes(const MachineFunction &MF) const; }; } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Wed Apr 16 15:10:13 2008 @@ -94,3 +94,14 @@ MBB.insert(I, MI); } +unsigned +TargetInstrInfoImpl::GetFunctionSizeInBytes(const MachineFunction &MF) const { + unsigned FnSize = 0; + for (MachineFunction::const_iterator MBBI = MF.begin(), E = MF.end(); + MBBI != E; ++MBBI) { + const MachineBasicBlock &MBB = *MBBI; + for (MachineBasicBlock::const_iterator I = MBB.begin(),E = MBB.end(); I != E; ++I) + FnSize += GetInstSizeInBytes(I); + } + return FnSize; +} Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Apr 16 15:10:13 2008 @@ -368,7 +368,7 @@ for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { // Add instruction size to MBBSize. - MBBSize += ARM::GetInstSize(I); + MBBSize += TII->GetInstSizeInBytes(I); int Opc = I->getOpcode(); if (I->getDesc().isBranch()) { @@ -519,7 +519,7 @@ for (MachineBasicBlock::iterator I = MBB->begin(); ; ++I) { assert(I != MBB->end() && "Didn't find MI in its own basic block?"); if (&*I == MI) return Offset; - Offset += ARM::GetInstSize(I); + Offset += TII->GetInstSizeInBytes(I); } } @@ -617,7 +617,7 @@ unsigned NewBBSize = 0; for (MachineBasicBlock::iterator I = NewBB->begin(), E = NewBB->end(); I != E; ++I) - NewBBSize += ARM::GetInstSize(I); + NewBBSize += TII->GetInstSizeInBytes(I); unsigned OrigBBI = OrigBB->getNumber(); unsigned NewBBI = NewBB->getNumber(); @@ -968,9 +968,9 @@ MachineBasicBlock::iterator MI = UserMI; ++MI; unsigned CPUIndex = CPUserIndex+1; - for (unsigned Offset = UserOffset+ARM::GetInstSize(UserMI); + for (unsigned Offset = UserOffset+TII->GetInstSizeInBytes(UserMI); Offset < BaseInsertOffset; - Offset += ARM::GetInstSize(MI), + Offset += TII->GetInstSizeInBytes(MI), MI = next(MI)) { if (CPUIndex < CPUsers.size() && CPUsers[CPUIndex].MI == MI) { if (!OffsetIsInRange(Offset, EndInsertOffset, @@ -1225,7 +1225,7 @@ SplitBlockBeforeInstr(MI); // No need for the branch to the next block. We're adding a unconditional // branch to the destination. - int delta = ARM::GetInstSize(&MBB->back()); + int delta = TII->GetInstSizeInBytes(&MBB->back()); BBSizes[MBB->getNumber()] -= delta; MachineBasicBlock* SplitBB = next(MachineFunction::iterator(MBB)); AdjustBBOffsetsAfter(SplitBB, -delta); @@ -1243,18 +1243,18 @@ BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB) .addImm(CC).addReg(CCReg); Br.MI = &MBB->back(); - BBSizes[MBB->getNumber()] += ARM::GetInstSize(&MBB->back()); + BBSizes[MBB->getNumber()] += TII->GetInstSizeInBytes(&MBB->back()); BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB); - BBSizes[MBB->getNumber()] += ARM::GetInstSize(&MBB->back()); + BBSizes[MBB->getNumber()] += TII->GetInstSizeInBytes(&MBB->back()); unsigned MaxDisp = getUnconditionalBrDisp(Br.UncondBr); ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr)); // Remove the old conditional branch. It may or may not still be in MBB. - BBSizes[MI->getParent()->getNumber()] -= ARM::GetInstSize(MI); + BBSizes[MI->getParent()->getNumber()] -= TII->GetInstSizeInBytes(MI); MI->eraseFromParent(); // The net size change is an addition of one unconditional branch. - int delta = ARM::GetInstSize(&MBB->back()); + int delta = TII->GetInstSizeInBytes(&MBB->back()); AdjustBBOffsetsAfter(MBB, delta); return true; } Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.cpp Wed Apr 16 15:10:13 2008 @@ -877,8 +877,8 @@ /// GetInstSize - Return the size of the specified MachineInstr. /// -unsigned ARM::GetInstSize(MachineInstr *MI) { - MachineBasicBlock &MBB = *MI->getParent(); +unsigned ARMInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { + const MachineBasicBlock &MBB = *MI->getParent(); const MachineFunction *MF = MBB.getParent(); const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo(); @@ -937,17 +937,3 @@ } return 0; // Not reached } - -/// GetFunctionSize - Returns the size of the specified MachineFunction. -/// -unsigned ARM::GetFunctionSize(MachineFunction &MF) { - unsigned FnSize = 0; - for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end(); - MBBI != E; ++MBBI) { - MachineBasicBlock &MBB = *MBBI; - for (MachineBasicBlock::iterator I = MBB.begin(),E = MBB.end(); I != E; ++I) - FnSize += ARM::GetInstSize(I); - } - return FnSize; -} - Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Wed Apr 16 15:10:13 2008 @@ -225,18 +225,12 @@ virtual bool DefinesPredicate(MachineInstr *MI, std::vector &Pred) const; + + /// GetInstSize - Returns the size of the specified MachineInstr. + /// + virtual unsigned GetInstSizeInBytes(const MachineInstr* MI) const; }; - // Utility routines - namespace ARM { - /// GetInstSize - Returns the size of the specified MachineInstr. - /// - unsigned GetInstSize(MachineInstr *MI); - - /// GetFunctionSize - Returns the size of the specified MachineFunction. - /// - unsigned GetFunctionSize(MachineFunction &MF); - } } #endif Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Wed Apr 16 15:10:13 2008 @@ -948,7 +948,7 @@ bool ForceLRSpill = false; if (!LRSpilled && AFI->isThumbFunction()) { - unsigned FnSize = ARM::GetFunctionSize(MF); + unsigned FnSize = TII.GetFunctionSizeInBytes(MF); // Force LR to be spilled if the Thumb function size is > 2048. This enables // use of BL to implement far jump. If it turns out that it's not needed // then the branch fix up path will undo it. Modified: llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCBranchSelector.cpp Wed Apr 16 15:10:13 2008 @@ -22,7 +22,6 @@ #include "PPCPredicates.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" @@ -54,25 +53,6 @@ return new PPCBSel(); } -/// getNumBytesForInstruction - Return the number of bytes of code the specified -/// instruction may be. This returns the maximum number of bytes. -/// -static unsigned getNumBytesForInstruction(MachineInstr *MI) { - switch (MI->getOpcode()) { - case PPC::INLINEASM: { // Inline Asm: Variable size. - MachineFunction *MF = MI->getParent()->getParent(); - const char *AsmStr = MI->getOperand(0).getSymbolName(); - return MF->getTarget().getTargetAsmInfo()->getInlineAsmLength(AsmStr); - } - case PPC::LABEL: { - return 0; - } - default: - return 4; // PowerPC instructions are all 4 bytes - } -} - - bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) { const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo(); // Give the blocks of the function a dense, in-order, numbering. @@ -88,7 +68,7 @@ unsigned BlockSize = 0; for (MachineBasicBlock::iterator MBBI = MBB->begin(), EE = MBB->end(); MBBI != EE; ++MBBI) - BlockSize += getNumBytesForInstruction(MBBI); + BlockSize += TII->GetInstSizeInBytes(MBBI); BlockSizes[MBB->getNumber()] = BlockSize; FuncSize += BlockSize; @@ -124,7 +104,7 @@ for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { if (I->getOpcode() != PPC::BCC || I->getOperand(2).isImmediate()) { - MBBStartOffset += getNumBytesForInstruction(I); + MBBStartOffset += TII->GetInstSizeInBytes(I); continue; } Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Wed Apr 16 15:10:13 2008 @@ -20,6 +20,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Target/TargetAsmInfo.h" using namespace llvm; extern cl::opt EnablePPC32RS; // FIXME (64-bit): See PPCRegisterInfo.cpp. @@ -724,3 +725,21 @@ Cond[0].setImm(PPC::InvertPredicate((PPC::Predicate)Cond[0].getImm())); return false; } + +/// GetInstSize - Return the number of bytes of code the specified +/// instruction may be. This returns the maximum number of bytes. +/// +unsigned PPCInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { + switch (MI->getOpcode()) { + case PPC::INLINEASM: { // Inline Asm: Variable size. + const MachineFunction *MF = MI->getParent()->getParent(); + const char *AsmStr = MI->getOperand(0).getSymbolName(); + return MF->getTarget().getTargetAsmInfo()->getInlineAsmLength(AsmStr); + } + case PPC::LABEL: { + return 0; + } + default: + return 4; // PowerPC instructions are all 4 bytes + } +} Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.h Wed Apr 16 15:10:13 2008 @@ -155,6 +155,11 @@ virtual bool BlockHasNoFallThrough(MachineBasicBlock &MBB) const; virtual bool ReverseBranchCondition(std::vector &Cond) const; + + /// GetInstSize - Return the number of bytes of code the specified + /// instruction may be. This returns the maximum number of bytes. + /// + virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const; }; } Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Wed Apr 16 15:10:13 2008 @@ -92,8 +92,6 @@ intptr_t PCAdj = 0); unsigned getX86RegNum(unsigned RegNo) const; - bool isX86_64ExtendedReg(const MachineOperand &MO); - unsigned determineREX(const MachineInstr &MI); bool gvNeedsLazyPtr(const GlobalValue *GV); }; @@ -405,139 +403,6 @@ } } -static unsigned sizeOfImm(const TargetInstrDesc *Desc) { - switch (Desc->TSFlags & X86II::ImmMask) { - case X86II::Imm8: return 1; - case X86II::Imm16: return 2; - case X86II::Imm32: return 4; - case X86II::Imm64: return 8; - default: assert(0 && "Immediate size not set!"); - return 0; - } -} - -/// isX86_64ExtendedReg - Is the MachineOperand a x86-64 extended register? -/// e.g. r8, xmm8, etc. -bool Emitter::isX86_64ExtendedReg(const MachineOperand &MO) { - if (!MO.isRegister()) return false; - switch (MO.getReg()) { - default: break; - case X86::R8: case X86::R9: case X86::R10: case X86::R11: - case X86::R12: case X86::R13: case X86::R14: case X86::R15: - case X86::R8D: case X86::R9D: case X86::R10D: case X86::R11D: - case X86::R12D: case X86::R13D: case X86::R14D: case X86::R15D: - case X86::R8W: case X86::R9W: case X86::R10W: case X86::R11W: - case X86::R12W: case X86::R13W: case X86::R14W: case X86::R15W: - case X86::R8B: case X86::R9B: case X86::R10B: case X86::R11B: - case X86::R12B: case X86::R13B: case X86::R14B: case X86::R15B: - case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11: - case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15: - return true; - } - return false; -} - -inline static bool isX86_64NonExtLowByteReg(unsigned reg) { - return (reg == X86::SPL || reg == X86::BPL || - reg == X86::SIL || reg == X86::DIL); -} - -/// determineREX - Determine if the MachineInstr has to be encoded with a X86-64 -/// REX prefix which specifies 1) 64-bit instructions, 2) non-default operand -/// size, and 3) use of X86-64 extended registers. -unsigned Emitter::determineREX(const MachineInstr &MI) { - unsigned REX = 0; - const TargetInstrDesc &Desc = MI.getDesc(); - - // Pseudo instructions do not need REX prefix byte. - if ((Desc.TSFlags & X86II::FormMask) == X86II::Pseudo) - return 0; - if (Desc.TSFlags & X86II::REX_W) - REX |= 1 << 3; - - unsigned NumOps = Desc.getNumOperands(); - if (NumOps) { - bool isTwoAddr = NumOps > 1 && - Desc.getOperandConstraint(1, TOI::TIED_TO) != -1; - - // If it accesses SPL, BPL, SIL, or DIL, then it requires a 0x40 REX prefix. - unsigned i = isTwoAddr ? 1 : 0; - for (unsigned e = NumOps; i != e; ++i) { - const MachineOperand& MO = MI.getOperand(i); - if (MO.isRegister()) { - unsigned Reg = MO.getReg(); - if (isX86_64NonExtLowByteReg(Reg)) - REX |= 0x40; - } - } - - switch (Desc.TSFlags & X86II::FormMask) { - case X86II::MRMInitReg: - if (isX86_64ExtendedReg(MI.getOperand(0))) - REX |= (1 << 0) | (1 << 2); - break; - case X86II::MRMSrcReg: { - if (isX86_64ExtendedReg(MI.getOperand(0))) - REX |= 1 << 2; - i = isTwoAddr ? 2 : 1; - for (unsigned e = NumOps; i != e; ++i) { - const MachineOperand& MO = MI.getOperand(i); - if (isX86_64ExtendedReg(MO)) - REX |= 1 << 0; - } - break; - } - case X86II::MRMSrcMem: { - if (isX86_64ExtendedReg(MI.getOperand(0))) - REX |= 1 << 2; - unsigned Bit = 0; - i = isTwoAddr ? 2 : 1; - for (; i != NumOps; ++i) { - const MachineOperand& MO = MI.getOperand(i); - if (MO.isRegister()) { - if (isX86_64ExtendedReg(MO)) - REX |= 1 << Bit; - Bit++; - } - } - break; - } - case X86II::MRM0m: case X86II::MRM1m: - case X86II::MRM2m: case X86II::MRM3m: - case X86II::MRM4m: case X86II::MRM5m: - case X86II::MRM6m: case X86II::MRM7m: - case X86II::MRMDestMem: { - unsigned e = isTwoAddr ? 5 : 4; - i = isTwoAddr ? 1 : 0; - if (NumOps > e && isX86_64ExtendedReg(MI.getOperand(e))) - REX |= 1 << 2; - unsigned Bit = 0; - for (; i != e; ++i) { - const MachineOperand& MO = MI.getOperand(i); - if (MO.isRegister()) { - if (isX86_64ExtendedReg(MO)) - REX |= 1 << Bit; - Bit++; - } - } - break; - } - default: { - if (isX86_64ExtendedReg(MI.getOperand(0))) - REX |= 1 << 0; - i = isTwoAddr ? 2 : 1; - for (unsigned e = NumOps; i != e; ++i) { - const MachineOperand& MO = MI.getOperand(i); - if (isX86_64ExtendedReg(MO)) - REX |= 1 << 2; - } - break; - } - } - } - return REX; -} - void Emitter::emitInstruction(const MachineInstr &MI, const TargetInstrDesc *Desc) { DOUT << MI; @@ -584,7 +449,7 @@ if (Is64BitMode) { // REX prefix - unsigned REX = determineREX(MI); + unsigned REX = X86InstrInfo::determineREX(MI); if (REX) MCE.emitByte(0x40 | REX); } @@ -632,7 +497,7 @@ case X86::MOVPC32r: { // This emits the "call" portion of this pseudo instruction. MCE.emitByte(BaseOpcode); - emitConstant(0, sizeOfImm(Desc)); + emitConstant(0, X86InstrInfo::sizeOfImm(Desc)); // Remember PIC base. PICBaseOffset = MCE.getCurrentPCOffset(); X86JITInfo *JTI = dynamic_cast(TM.getJITInfo()); @@ -657,7 +522,7 @@ } else if (MO.isExternalSymbol()) { emitExternalSymbolAddress(MO.getSymbolName(), X86::reloc_pcrel_word); } else if (MO.isImmediate()) { - emitConstant(MO.getImm(), sizeOfImm(Desc)); + emitConstant(MO.getImm(), X86InstrInfo::sizeOfImm(Desc)); } else { assert(0 && "Unknown RawFrm operand!"); } @@ -669,7 +534,7 @@ if (CurOp != NumOps) { const MachineOperand &MO1 = MI.getOperand(CurOp++); - unsigned Size = sizeOfImm(Desc); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); if (MO1.isImmediate()) emitConstant(MO1.getImm(), Size); else { @@ -698,7 +563,7 @@ getX86RegNum(MI.getOperand(CurOp+1).getReg())); CurOp += 2; if (CurOp != NumOps) - emitConstant(MI.getOperand(CurOp++).getImm(), sizeOfImm(Desc)); + emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; } case X86II::MRMDestMem: { @@ -706,7 +571,7 @@ emitMemModRMByte(MI, CurOp, getX86RegNum(MI.getOperand(CurOp+4).getReg())); CurOp += 5; if (CurOp != NumOps) - emitConstant(MI.getOperand(CurOp++).getImm(), sizeOfImm(Desc)); + emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; } @@ -716,18 +581,18 @@ getX86RegNum(MI.getOperand(CurOp).getReg())); CurOp += 2; if (CurOp != NumOps) - emitConstant(MI.getOperand(CurOp++).getImm(), sizeOfImm(Desc)); + emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; case X86II::MRMSrcMem: { - intptr_t PCAdj = (CurOp+5 != NumOps) ? sizeOfImm(Desc) : 0; + intptr_t PCAdj = (CurOp+5 != NumOps) ? X86InstrInfo::sizeOfImm(Desc) : 0; MCE.emitByte(BaseOpcode); emitMemModRMByte(MI, CurOp+1, getX86RegNum(MI.getOperand(CurOp).getReg()), PCAdj); CurOp += 5; if (CurOp != NumOps) - emitConstant(MI.getOperand(CurOp++).getImm(), sizeOfImm(Desc)); + emitConstant(MI.getOperand(CurOp++).getImm(), X86InstrInfo::sizeOfImm(Desc)); break; } @@ -741,7 +606,7 @@ if (CurOp != NumOps) { const MachineOperand &MO1 = MI.getOperand(CurOp++); - unsigned Size = sizeOfImm(Desc); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); if (MO1.isImmediate()) emitConstant(MO1.getImm(), Size); else { @@ -769,7 +634,7 @@ case X86II::MRM4m: case X86II::MRM5m: case X86II::MRM6m: case X86II::MRM7m: { intptr_t PCAdj = (CurOp+4 != NumOps) ? - (MI.getOperand(CurOp+4).isImmediate() ? sizeOfImm(Desc) : 4) : 0; + (MI.getOperand(CurOp+4).isImmediate() ? X86InstrInfo::sizeOfImm(Desc) : 4) : 0; MCE.emitByte(BaseOpcode); emitMemModRMByte(MI, CurOp, (Desc->TSFlags & X86II::FormMask)-X86II::MRM0m, @@ -778,7 +643,7 @@ if (CurOp != NumOps) { const MachineOperand &MO = MI.getOperand(CurOp++); - unsigned Size = sizeOfImm(Desc); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); if (MO.isImmediate()) emitConstant(MO.getImm(), Size); else { Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Apr 16 15:10:13 2008 @@ -25,6 +25,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetOptions.h" +#include "llvm/Target/TargetAsmInfo.h" using namespace llvm; @@ -2263,3 +2264,542 @@ else return &X86::GR32RegClass; } + +unsigned X86InstrInfo::sizeOfImm(const TargetInstrDesc *Desc) { + switch (Desc->TSFlags & X86II::ImmMask) { + case X86II::Imm8: return 1; + case X86II::Imm16: return 2; + case X86II::Imm32: return 4; + case X86II::Imm64: return 8; + default: assert(0 && "Immediate size not set!"); + return 0; + } +} + +/// isX86_64ExtendedReg - Is the MachineOperand a x86-64 extended register? +/// e.g. r8, xmm8, etc. +bool X86InstrInfo::isX86_64ExtendedReg(const MachineOperand &MO) { + if (!MO.isRegister()) return false; + switch (MO.getReg()) { + default: break; + case X86::R8: case X86::R9: case X86::R10: case X86::R11: + case X86::R12: case X86::R13: case X86::R14: case X86::R15: + case X86::R8D: case X86::R9D: case X86::R10D: case X86::R11D: + case X86::R12D: case X86::R13D: case X86::R14D: case X86::R15D: + case X86::R8W: case X86::R9W: case X86::R10W: case X86::R11W: + case X86::R12W: case X86::R13W: case X86::R14W: case X86::R15W: + case X86::R8B: case X86::R9B: case X86::R10B: case X86::R11B: + case X86::R12B: case X86::R13B: case X86::R14B: case X86::R15B: + case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11: + case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15: + return true; + } + return false; +} + + +/// determineREX - Determine if the MachineInstr has to be encoded with a X86-64 +/// REX prefix which specifies 1) 64-bit instructions, 2) non-default operand +/// size, and 3) use of X86-64 extended registers. +unsigned X86InstrInfo::determineREX(const MachineInstr &MI) { + unsigned REX = 0; + const TargetInstrDesc &Desc = MI.getDesc(); + + // Pseudo instructions do not need REX prefix byte. + if ((Desc.TSFlags & X86II::FormMask) == X86II::Pseudo) + return 0; + if (Desc.TSFlags & X86II::REX_W) + REX |= 1 << 3; + + unsigned NumOps = Desc.getNumOperands(); + if (NumOps) { + bool isTwoAddr = NumOps > 1 && + Desc.getOperandConstraint(1, TOI::TIED_TO) != -1; + + // If it accesses SPL, BPL, SIL, or DIL, then it requires a 0x40 REX prefix. + unsigned i = isTwoAddr ? 1 : 0; + for (unsigned e = NumOps; i != e; ++i) { + const MachineOperand& MO = MI.getOperand(i); + if (MO.isRegister()) { + unsigned Reg = MO.getReg(); + if (isX86_64NonExtLowByteReg(Reg)) + REX |= 0x40; + } + } + + switch (Desc.TSFlags & X86II::FormMask) { + case X86II::MRMInitReg: + if (isX86_64ExtendedReg(MI.getOperand(0))) + REX |= (1 << 0) | (1 << 2); + break; + case X86II::MRMSrcReg: { + if (isX86_64ExtendedReg(MI.getOperand(0))) + REX |= 1 << 2; + i = isTwoAddr ? 2 : 1; + for (unsigned e = NumOps; i != e; ++i) { + const MachineOperand& MO = MI.getOperand(i); + if (isX86_64ExtendedReg(MO)) + REX |= 1 << 0; + } + break; + } + case X86II::MRMSrcMem: { + if (isX86_64ExtendedReg(MI.getOperand(0))) + REX |= 1 << 2; + unsigned Bit = 0; + i = isTwoAddr ? 2 : 1; + for (; i != NumOps; ++i) { + const MachineOperand& MO = MI.getOperand(i); + if (MO.isRegister()) { + if (isX86_64ExtendedReg(MO)) + REX |= 1 << Bit; + Bit++; + } + } + break; + } + case X86II::MRM0m: case X86II::MRM1m: + case X86II::MRM2m: case X86II::MRM3m: + case X86II::MRM4m: case X86II::MRM5m: + case X86II::MRM6m: case X86II::MRM7m: + case X86II::MRMDestMem: { + unsigned e = isTwoAddr ? 5 : 4; + i = isTwoAddr ? 1 : 0; + if (NumOps > e && isX86_64ExtendedReg(MI.getOperand(e))) + REX |= 1 << 2; + unsigned Bit = 0; + for (; i != e; ++i) { + const MachineOperand& MO = MI.getOperand(i); + if (MO.isRegister()) { + if (isX86_64ExtendedReg(MO)) + REX |= 1 << Bit; + Bit++; + } + } + break; + } + default: { + if (isX86_64ExtendedReg(MI.getOperand(0))) + REX |= 1 << 0; + i = isTwoAddr ? 2 : 1; + for (unsigned e = NumOps; i != e; ++i) { + const MachineOperand& MO = MI.getOperand(i); + if (isX86_64ExtendedReg(MO)) + REX |= 1 << 2; + } + break; + } + } + } + return REX; +} + +/// sizePCRelativeBlockAddress - This method returns the size of a PC +/// relative block address instruction +/// +static unsigned sizePCRelativeBlockAddress() { + return 4; +} + +/// sizeGlobalAddress - Give the size of the emission of this global address +/// +static unsigned sizeGlobalAddress(bool dword) { + return dword ? 8 : 4; +} + +/// sizeConstPoolAddress - Give the size of the emission of this constant +/// pool address +/// +static unsigned sizeConstPoolAddress(bool dword) { + return dword ? 8 : 4; +} + +/// sizeExternalSymbolAddress - Give the size of the emission of this external +/// symbol +/// +static unsigned sizeExternalSymbolAddress(bool dword) { + return dword ? 8 : 4; +} + +/// sizeJumpTableAddress - Give the size of the emission of this jump +/// table address +/// +static unsigned sizeJumpTableAddress(bool dword) { + return dword ? 8 : 4; +} + +static unsigned sizeConstant(unsigned Size) { + return Size; +} + +static unsigned sizeRegModRMByte(){ + return 1; +} + +static unsigned sizeSIBByte(){ + return 1; +} + +static unsigned getDisplacementFieldSize(const MachineOperand *RelocOp) { + unsigned FinalSize = 0; + // If this is a simple integer displacement that doesn't require a relocation. + if (!RelocOp) { + FinalSize += sizeConstant(4); + return FinalSize; + } + + // Otherwise, this is something that requires a relocation. + if (RelocOp->isGlobalAddress()) { + FinalSize += sizeGlobalAddress(false); + } else if (RelocOp->isConstantPoolIndex()) { + FinalSize += sizeConstPoolAddress(false); + } else if (RelocOp->isJumpTableIndex()) { + FinalSize += sizeJumpTableAddress(false); + } else { + assert(0 && "Unknown value to relocate!"); + } + return FinalSize; +} + +static unsigned getMemModRMByteSize(const MachineInstr &MI, unsigned Op, + bool IsPIC, bool Is64BitMode) { + const MachineOperand &Op3 = MI.getOperand(Op+3); + int DispVal = 0; + const MachineOperand *DispForReloc = 0; + unsigned FinalSize = 0; + + // Figure out what sort of displacement we have to handle here. + if (Op3.isGlobalAddress()) { + DispForReloc = &Op3; + } else if (Op3.isConstantPoolIndex()) { + if (Is64BitMode || IsPIC) { + DispForReloc = &Op3; + } else { + DispVal = 1; + } + } else if (Op3.isJumpTableIndex()) { + if (Is64BitMode || IsPIC) { + DispForReloc = &Op3; + } else { + DispVal = 1; + } + } else { + DispVal = 1; + } + + const MachineOperand &Base = MI.getOperand(Op); + const MachineOperand &IndexReg = MI.getOperand(Op+2); + + unsigned BaseReg = Base.getReg(); + + // Is a SIB byte needed? + if (IndexReg.getReg() == 0 && + (BaseReg == 0 || X86RegisterInfo::getX86RegNum(BaseReg) != N86::ESP)) { + if (BaseReg == 0) { // Just a displacement? + // Emit special case [disp32] encoding + ++FinalSize; + FinalSize += getDisplacementFieldSize(DispForReloc); + } else { + unsigned BaseRegNo = X86RegisterInfo::getX86RegNum(BaseReg); + if (!DispForReloc && DispVal == 0 && BaseRegNo != N86::EBP) { + // Emit simple indirect register encoding... [EAX] f.e. + ++FinalSize; + // Be pessimistic and assume it's a disp32, not a disp8 + } else { + // Emit the most general non-SIB encoding: [REG+disp32] + ++FinalSize; + FinalSize += getDisplacementFieldSize(DispForReloc); + } + } + + } else { // We need a SIB byte, so start by outputting the ModR/M byte first + assert(IndexReg.getReg() != X86::ESP && + IndexReg.getReg() != X86::RSP && "Cannot use ESP as index reg!"); + + bool ForceDisp32 = false; + if (BaseReg == 0 || DispForReloc) { + // Emit the normal disp32 encoding. + ++FinalSize; + ForceDisp32 = true; + } else { + ++FinalSize; + } + + FinalSize += sizeSIBByte(); + + // Do we need to output a displacement? + if (DispVal != 0 || ForceDisp32) { + FinalSize += getDisplacementFieldSize(DispForReloc); + } + } + return FinalSize; +} + + +static unsigned GetInstSizeWithDesc(const MachineInstr &MI, + const TargetInstrDesc *Desc, + bool IsPIC, bool Is64BitMode) { + + unsigned Opcode = Desc->Opcode; + unsigned FinalSize = 0; + + // Emit the lock opcode prefix as needed. + if (Desc->TSFlags & X86II::LOCK) ++FinalSize; + + // Emit the repeat opcode prefix as needed. + if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) ++FinalSize; + + // Emit the operand size opcode prefix as needed. + if (Desc->TSFlags & X86II::OpSize) ++FinalSize; + + // Emit the address size opcode prefix as needed. + if (Desc->TSFlags & X86II::AdSize) ++FinalSize; + + bool Need0FPrefix = false; + switch (Desc->TSFlags & X86II::Op0Mask) { + case X86II::TB: // Two-byte opcode prefix + case X86II::T8: // 0F 38 + case X86II::TA: // 0F 3A + Need0FPrefix = true; + break; + case X86II::REP: break; // already handled. + case X86II::XS: // F3 0F + ++FinalSize; + Need0FPrefix = true; + break; + case X86II::XD: // F2 0F + ++FinalSize; + Need0FPrefix = true; + break; + case X86II::D8: case X86II::D9: case X86II::DA: case X86II::DB: + case X86II::DC: case X86II::DD: case X86II::DE: case X86II::DF: + ++FinalSize; + break; // Two-byte opcode prefix + default: assert(0 && "Invalid prefix!"); + case 0: break; // No prefix! + } + + if (Is64BitMode) { + // REX prefix + unsigned REX = X86InstrInfo::determineREX(MI); + if (REX) + ++FinalSize; + } + + // 0x0F escape code must be emitted just before the opcode. + if (Need0FPrefix) + ++FinalSize; + + switch (Desc->TSFlags & X86II::Op0Mask) { + case X86II::T8: // 0F 38 + ++FinalSize; + break; + case X86II::TA: // 0F 3A + ++FinalSize; + break; + } + + // If this is a two-address instruction, skip one of the register operands. + unsigned NumOps = Desc->getNumOperands(); + unsigned CurOp = 0; + if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1) + CurOp++; + + switch (Desc->TSFlags & X86II::FormMask) { + default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!"); + case X86II::Pseudo: + // Remember the current PC offset, this is the PIC relocation + // base address. + switch (Opcode) { + default: + break; + case TargetInstrInfo::INLINEASM: { + const MachineFunction *MF = MI.getParent()->getParent(); + const char *AsmStr = MI.getOperand(0).getSymbolName(); + const TargetAsmInfo* AI = MF->getTarget().getTargetAsmInfo(); + FinalSize += AI->getInlineAsmLength(AsmStr); + break; + } + case TargetInstrInfo::LABEL: + break; + case TargetInstrInfo::IMPLICIT_DEF: + case TargetInstrInfo::DECLARE: + case X86::DWARF_LOC: + case X86::FP_REG_KILL: + break; + case X86::MOVPC32r: { + // This emits the "call" portion of this pseudo instruction. + ++FinalSize; + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + break; + } + } + CurOp = NumOps; + break; + case X86II::RawFrm: + ++FinalSize; + + if (CurOp != NumOps) { + const MachineOperand &MO = MI.getOperand(CurOp++); + if (MO.isMachineBasicBlock()) { + FinalSize += sizePCRelativeBlockAddress(); + } else if (MO.isGlobalAddress()) { + FinalSize += sizeGlobalAddress(false); + } else if (MO.isExternalSymbol()) { + FinalSize += sizeExternalSymbolAddress(false); + } else if (MO.isImmediate()) { + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + } else { + assert(0 && "Unknown RawFrm operand!"); + } + } + break; + + case X86II::AddRegFrm: + ++FinalSize; + + if (CurOp != NumOps) { + const MachineOperand &MO1 = MI.getOperand(CurOp++); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); + if (MO1.isImmediate()) + FinalSize += sizeConstant(Size); + else { + bool dword = false; + if (Opcode == X86::MOV64ri) + dword = true; + if (MO1.isGlobalAddress()) { + FinalSize += sizeGlobalAddress(dword); + } else if (MO1.isExternalSymbol()) + FinalSize += sizeExternalSymbolAddress(dword); + else if (MO1.isConstantPoolIndex()) + FinalSize += sizeConstPoolAddress(dword); + else if (MO1.isJumpTableIndex()) + FinalSize += sizeJumpTableAddress(dword); + } + } + break; + + case X86II::MRMDestReg: { + ++FinalSize; + FinalSize += sizeRegModRMByte(); + CurOp += 2; + if (CurOp != NumOps) + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + break; + } + case X86II::MRMDestMem: { + ++FinalSize; + FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode); + CurOp += 5; + if (CurOp != NumOps) + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + break; + } + + case X86II::MRMSrcReg: + ++FinalSize; + FinalSize += sizeRegModRMByte(); + CurOp += 2; + if (CurOp != NumOps) + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + break; + + case X86II::MRMSrcMem: { + + ++FinalSize; + FinalSize += getMemModRMByteSize(MI, CurOp+1, IsPIC, Is64BitMode); + CurOp += 5; + if (CurOp != NumOps) + FinalSize += sizeConstant(X86InstrInfo::sizeOfImm(Desc)); + break; + } + + case X86II::MRM0r: case X86II::MRM1r: + case X86II::MRM2r: case X86II::MRM3r: + case X86II::MRM4r: case X86II::MRM5r: + case X86II::MRM6r: case X86II::MRM7r: + ++FinalSize; + FinalSize += sizeRegModRMByte(); + + if (CurOp != NumOps) { + const MachineOperand &MO1 = MI.getOperand(CurOp++); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); + if (MO1.isImmediate()) + FinalSize += sizeConstant(Size); + else { + bool dword = false; + if (Opcode == X86::MOV64ri32) + dword = true; + if (MO1.isGlobalAddress()) { + FinalSize += sizeGlobalAddress(dword); + } else if (MO1.isExternalSymbol()) + FinalSize += sizeExternalSymbolAddress(dword); + else if (MO1.isConstantPoolIndex()) + FinalSize += sizeConstPoolAddress(dword); + else if (MO1.isJumpTableIndex()) + FinalSize += sizeJumpTableAddress(dword); + } + } + break; + + case X86II::MRM0m: case X86II::MRM1m: + case X86II::MRM2m: case X86II::MRM3m: + case X86II::MRM4m: case X86II::MRM5m: + case X86II::MRM6m: case X86II::MRM7m: { + + ++FinalSize; + FinalSize += getMemModRMByteSize(MI, CurOp, IsPIC, Is64BitMode); + CurOp += 4; + + if (CurOp != NumOps) { + const MachineOperand &MO = MI.getOperand(CurOp++); + unsigned Size = X86InstrInfo::sizeOfImm(Desc); + if (MO.isImmediate()) + FinalSize += sizeConstant(Size); + else { + bool dword = false; + if (Opcode == X86::MOV64mi32) + dword = true; + if (MO.isGlobalAddress()) { + FinalSize += sizeGlobalAddress(dword); + } else if (MO.isExternalSymbol()) + FinalSize += sizeExternalSymbolAddress(dword); + else if (MO.isConstantPoolIndex()) + FinalSize += sizeConstPoolAddress(dword); + else if (MO.isJumpTableIndex()) + FinalSize += sizeJumpTableAddress(dword); + } + } + break; + } + + case X86II::MRMInitReg: + ++FinalSize; + // Duplicate register, used by things like MOV8r0 (aka xor reg,reg). + FinalSize += sizeRegModRMByte(); + ++CurOp; + break; + } + + if (!Desc->isVariadic() && CurOp != NumOps) { + cerr << "Cannot determine size: "; + MI.dump(); + cerr << '\n'; + abort(); + } + + + return FinalSize; +} + + +unsigned X86InstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { + const TargetInstrDesc &Desc = MI->getDesc(); + bool IsPIC = (TM.getRelocationModel() == Reloc::PIC_); + bool Is64BitMode = ((X86Subtarget*)TM.getSubtargetImpl())->is64Bit(); + unsigned Size = GetInstSizeWithDesc(*MI, &Desc, IsPIC, Is64BitMode); + if (Desc.getOpcode() == X86::MOVPC32r) { + Size += GetInstSizeWithDesc(*MI, &get(X86::POP32r), IsPIC, Is64BitMode); + } + return Size; +} Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Wed Apr 16 15:10:13 2008 @@ -15,6 +15,7 @@ #define X86INSTRUCTIONINFO_H #include "llvm/Target/TargetInstrInfo.h" +#include "X86.h" #include "X86RegisterInfo.h" #include "llvm/ADT/IndexedMap.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -380,6 +381,20 @@ unsigned char getBaseOpcodeFor(unsigned Opcode) const { return getBaseOpcodeFor(&get(Opcode)); } + + static bool isX86_64NonExtLowByteReg(unsigned reg) { + return (reg == X86::SPL || reg == X86::BPL || + reg == X86::SIL || reg == X86::DIL); + } + + static unsigned sizeOfImm(const TargetInstrDesc *Desc); + static unsigned getX86RegNum(unsigned RegNo); + static bool isX86_64ExtendedReg(const MachineOperand &MO); + static unsigned determineREX(const MachineInstr &MI); + + /// GetInstSize - Returns the size of the specified MachineInstr. + /// + virtual unsigned GetInstSizeInBytes(const MachineInstr *MI) const; private: MachineInstr* foldMemoryOperand(MachineInstr* MI, Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Wed Apr 16 15:10:13 2008 @@ -84,7 +84,7 @@ // getX86RegNum - This function maps LLVM register identifiers to their X86 // specific numbering, which is used in various places encoding instructions. // -unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) const { +unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) { switch(RegNo) { case X86::RAX: case X86::EAX: case X86::AX: case X86::AL: return N86::EAX; case X86::RCX: case X86::ECX: case X86::CX: case X86::CL: return N86::ECX; Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.h?rev=49809&r1=49808&r2=49809&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.h Wed Apr 16 15:10:13 2008 @@ -84,7 +84,7 @@ /// getX86RegNum - Returns the native X86 register number for the given LLVM /// register identifier. - unsigned getX86RegNum(unsigned RegNo) const; + static unsigned getX86RegNum(unsigned RegNo); unsigned getStackAlignment() const { return StackAlign; } From isanbard at gmail.com Wed Apr 16 15:16:36 2008 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Apr 2008 13:16:36 -0700 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/C Message-ID: <16e5fdf90804161316r4342cfe1o6159198fc98860e2@mail.gmail.com> Hi Roman, > +/// SDOperandPtr - A helper SDOperand poiner class, that can handle poiner -> pointer > +/// arrays of SDUse and arrays of SDOperand objects. This is required > +/// in many places inside the SelectionDAG. > +/// > +class SDOperandPtr { > + const SDOperand *ptr; // The pointer to the SDOperand object > + int object_size; // The size of the object containg the SDOperand > +public: > + SDOperandPtr(SDUse * use_ptr) { > + ptr = &use_ptr->getSDOperand(); > + object_size = sizeof(SDUse); > + } > + > + SDOperandPtr(const SDOperand * op_ptr) { > + ptr = op_ptr; > + object_size = sizeof(SDOperand); > + } > + > + operator const SDOperand *() const { > + assert(object_size == sizeof(SDOperand) && > + "Only SDOperand can be converted"); > + return ptr; > + } > + > + const SDOperand operator *() { return *ptr; } > + const SDOperand *operator ->() { return ptr; } > + SDOperandPtr operator ++ () { > + ptr = (SDOperand*)((char *)ptr + object_size); > + return *this; > + } > + > + SDOperandPtr operator ++ (int) { > + SDOperandPtr tmp = *this; > + ptr = (SDOperand*)((char *)ptr + object_size); > + return tmp; > + } > + > + SDOperand operator[] (int idx) const { > + return *(SDOperand*)((char*) ptr + object_size * idx); > + } > +}; > + I must say that I'm not a fan of this class. I don't like the fact that you're doing pointer arithmetic. Is there another way to implement this? Perhaps with some template magic? -bw From evan.cheng at apple.com Wed Apr 16 15:24:26 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 20:24:26 -0000 Subject: [llvm-commits] [llvm] r49810 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/SimpleRegisterCoalescing.h test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll Message-ID: <200804162024.m3GKOQO4005721@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 15:24:25 2008 New Revision: 49810 URL: http://llvm.org/viewvc/llvm-project?rev=49810&view=rev Log: After reading memory that's already freed. Added: llvm/trunk/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49810&r1=49809&r2=49810&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Apr 16 15:24:25 2008 @@ -560,8 +560,8 @@ /// removeIntervalIfEmpty - Check if the live interval of a physical register /// is empty, if so remove it and also remove the empty intervals of its -/// sub-registers. -static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_, +/// sub-registers. Return true if live interval is removed. +static bool removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_, const TargetRegisterInfo *tri_) { if (li.empty()) { if (TargetRegisterInfo::isPhysicalRegister(li.reg)) @@ -573,25 +573,28 @@ li_->removeInterval(*SR); } li_->removeInterval(li.reg); + return true; } + return false; } /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy. -/// -void SimpleRegisterCoalescing::ShortenDeadCopyLiveRange(LiveInterval &li, +/// Return true if live interval is removed. +bool SimpleRegisterCoalescing::ShortenDeadCopyLiveRange(LiveInterval &li, MachineInstr *CopyMI) { unsigned CopyIdx = li_->getInstructionIndex(CopyMI); LiveInterval::iterator MLR = li.FindLiveRangeContaining(li_->getDefIndex(CopyIdx)); if (MLR == li.end()) - return; // Already removed by ShortenDeadCopySrcLiveRange. + return false; // Already removed by ShortenDeadCopySrcLiveRange. unsigned RemoveStart = MLR->start; unsigned RemoveEnd = MLR->end; // Remove the liverange that's defined by this. if (RemoveEnd == li_->getDefIndex(CopyIdx)+1) { removeRange(li, RemoveStart, RemoveEnd, li_, tri_); - removeIntervalIfEmpty(li, li_, tri_); + return removeIntervalIfEmpty(li, li_, tri_); } + return false; } /// PropagateDeadness - Propagate the dead marker to the instruction which @@ -614,8 +617,8 @@ /// ShortenDeadCopyLiveRange - Shorten a live range as it's artificially /// extended by a dead copy. Mark the last use (if any) of the val# as kill /// as ends the live range there. If there isn't another use, then this -/// live range is dead. -void +/// live range is dead. Return true if live interval is removed. +bool SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI) { unsigned CopyIdx = li_->getInstructionIndex(CopyMI); @@ -627,20 +630,19 @@ mf_->begin()->removeLiveIn(li.reg); const LiveRange *LR = li.getLiveRangeContaining(CopyIdx); removeRange(li, LR->start, LR->end, li_, tri_); - removeIntervalIfEmpty(li, li_, tri_); - return; + return removeIntervalIfEmpty(li, li_, tri_); } LiveInterval::iterator LR = li.FindLiveRangeContaining(CopyIdx-1); if (LR == li.end()) // Livein but defined by a phi. - return; + return false; unsigned RemoveStart = LR->start; unsigned RemoveEnd = li_->getDefIndex(CopyIdx)+1; if (LR->end > RemoveEnd) // More uses past this copy? Nothing to do. - return; + return false; unsigned LastUseIdx; MachineOperand *LastUse = lastRegisterUse(LR->start, CopyIdx-1, li.reg, @@ -658,7 +660,7 @@ int DeadIdx = LastUseMI->findRegisterDefOperandIdx(li.reg, false, tri_); LastUseMI->getOperand(DeadIdx).setIsDead(); } - return; + return false; } // Is it livein? @@ -678,7 +680,7 @@ PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_); removeRange(li, RemoveStart, LR->end, li_, tri_); - removeIntervalIfEmpty(li, li_, tri_); + return removeIntervalIfEmpty(li, li_, tri_); } /// CanCoalesceWithImpDef - Returns true if the specified copy instruction @@ -1952,8 +1954,8 @@ } if (CopyMI->registerDefIsDead(DstReg)) { LiveInterval &li = li_->getInterval(DstReg); - ShortenDeadCopySrcLiveRange(li, CopyMI); - ShortenDeadCopyLiveRange(li, CopyMI); + if (!ShortenDeadCopySrcLiveRange(li, CopyMI)) + ShortenDeadCopyLiveRange(li, CopyMI); } li_->RemoveMachineInstrFromMaps(*I); (*I)->eraseFromParent(); @@ -1979,8 +1981,8 @@ // If def of this move instruction is dead, remove its live range // from the dstination register's live interval. if (mii->registerDefIsDead(dstReg)) { - ShortenDeadCopySrcLiveRange(RegInt, mii); - ShortenDeadCopyLiveRange(RegInt, mii); + if (!ShortenDeadCopySrcLiveRange(RegInt, mii)) + ShortenDeadCopyLiveRange(RegInt, mii); } } li_->RemoveMachineInstrFromMaps(mii); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h?rev=49810&r1=49809&r2=49810&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.h Wed Apr 16 15:24:25 2008 @@ -232,14 +232,14 @@ void RemoveUnnecessaryKills(unsigned Reg, LiveInterval &LI); /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy. - /// - void ShortenDeadCopyLiveRange(LiveInterval &li, MachineInstr *CopyMI); + /// Return true if live interval is removed. + bool ShortenDeadCopyLiveRange(LiveInterval &li, MachineInstr *CopyMI); /// ShortenDeadCopyLiveRange - Shorten a live range as it's artificially /// extended by a dead copy. Mark the last use (if any) of the val# as kill /// as ends the live range there. If there isn't another use, then this - /// live range is dead. - void ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI); + /// live range is dead. Return true if live interval is removed. + bool ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI); /// lastRegisterUse - Returns the last use of the specific register between /// cycles Start and End or NULL if there are no uses. Added: llvm/trunk/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll?rev=49810&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/2008-04-16-CoalescerBug.ll Wed Apr 16 15:24:25 2008 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llc -mtriple=powerpc-apple-darwin +; Avoid reading memory that's already freed. + + at llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i64)* @_Z13GetSectorSizey to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define i32 @_Z13GetSectorSizey(i64 %Base) nounwind { +entry: + br i1 false, label %bb, label %UnifiedReturnBlock +bb: ; preds = %entry + %tmp10 = and i64 0, %Base ; [#uses=0] + ret i32 0 +UnifiedReturnBlock: ; preds = %entry + ret i32 131072 +} From clattner at apple.com Wed Apr 16 15:25:47 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 16 Apr 2008 13:25:47 -0700 Subject: [llvm-commits] [llvm] r49762 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/sse41-extractps-bitcast-0.ll test/CodeGen/X86/sse41-extractps-bitcast-1.ll In-Reply-To: References: <200804160232.m3G2WOjO018983@zion.cs.uiuc.edu> <8C361EDD-B7AC-4EEE-BCE2-CF6DB0C2F573@apple.com> Message-ID: On Apr 16, 2008, at 11:54 AM, Dan Gohman wrote: > > On Apr 15, 2008, at 8:22 PM, Chris Lattner wrote: >> On Apr 15, 2008, at 7:32 PM, Dan Gohman wrote: >>> URL: http://llvm.org/viewvc/llvm-project?rev=49762&view=rev >>> Log: >>> Add support for the form of the SSE41 extractps instruction that >>> puts its result in a 32-bit GPR. >> >> Ooh, nice. Can you run an example that uses this through the JIT to >> ensure the encoding is correct? If you need an acct on an sse4 >> machine, let me know, > > I double-checked it with gdb disassembling the jit'd code. Thanks! -Chris From dag at cray.com Wed Apr 16 15:29:42 2008 From: dag at cray.com (David Greene) Date: Wed, 16 Apr 2008 14:29:42 -0600 Subject: [llvm-commits] [llvm] r49807 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp In-Reply-To: <200804161848.m3GImhG0030319@zion.cs.uiuc.edu> References: <200804161848.m3GImhG0030319@zion.cs.uiuc.edu> Message-ID: <200804161529.43306.dag@cray.com> On Wednesday 16 April 2008 13:48, Evan Cheng wrote: > LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); > + if (BLR == IntB.end()) // Should never happen! > + return false; Shouldn't this and similar constructs have asserts? -Dave From echristo at apple.com Wed Apr 16 15:45:36 2008 From: echristo at apple.com (Eric Christopher) Date: Wed, 16 Apr 2008 20:45:36 -0000 Subject: [llvm-commits] [llvm] r49813 - /llvm/trunk/include/llvm/Module.h Message-ID: <200804162045.m3GKjaKT007587@zion.cs.uiuc.edu> Author: echristo Date: Wed Apr 16 15:45:31 2008 New Revision: 49813 URL: http://llvm.org/viewvc/llvm-project?rev=49813&view=rev Log: Fix comment. Modified: llvm/trunk/include/llvm/Module.h Modified: llvm/trunk/include/llvm/Module.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=49813&r1=49812&r2=49813&view=diff ============================================================================== --- llvm/trunk/include/llvm/Module.h (original) +++ llvm/trunk/include/llvm/Module.h Wed Apr 16 15:45:31 2008 @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -/// @file This file contains the declarations for the Module class. +/// @file This file contains the declarations for the Module class. // //===----------------------------------------------------------------------===// @@ -54,9 +54,9 @@ }; /// A Module instance is used to store all the information related to an -/// LLVM module. Modules are the top level container of all other LLVM +/// LLVM module. Modules are the top level container of all other LLVM /// Intermediate Representation (IR) objects. Each module directly contains a -/// list of globals variables, a list of functions, a list of libraries (or +/// list of globals variables, a list of functions, a list of libraries (or /// other modules) this module depends on, a symbol table, and various data /// about the target's characteristics. /// @@ -108,7 +108,7 @@ private: GlobalListType GlobalList; ///< The Global Variables in the module FunctionListType FunctionList; ///< The Functions in the module - AliasListType AliasList; ///< The Aliases in the module + AliasListType AliasList; ///< The Aliases in the module LibraryListType LibraryList; ///< The Libraries needed by the module std::string GlobalScopeAsm; ///< Inline Asm at global scope. ValueSymbolTable *ValSymTab; ///< Symbol table for values @@ -173,14 +173,14 @@ /// Set the module-scope inline assembly blocks. void setModuleInlineAsm(const std::string &Asm) { GlobalScopeAsm = Asm; } - + /// Append to the module-scope inline assembly blocks, automatically /// appending a newline to the end. void appendModuleInlineAsm(const std::string &Asm) { GlobalScopeAsm += Asm; GlobalScopeAsm += '\n'; } - + /// @} /// @name Function Accessors /// @{ @@ -211,14 +211,14 @@ Function *getFunction(const std::string &Name) const; /// @} -/// @name Global Variable Accessors +/// @name Global Variable Accessors /// @{ public: /// getGlobalVariable - Look up the specified global variable in the module /// symbol table. If it does not exist, return null. If AllowInternal is set /// to true, this function will return types that have InternalLinkage. By /// default, these types are not returned. - GlobalVariable *getGlobalVariable(const std::string &Name, + GlobalVariable *getGlobalVariable(const std::string &Name, bool AllowInternal = false) const; /// getNamedGlobal - Return the first global variable in the module with the @@ -229,14 +229,14 @@ } /// @} -/// @name Global Variable Accessors +/// @name Global Alias Accessors /// @{ public: - /// getNamedGlobal - Return the first global alias in the module with the + /// getNamedAlias - Return the first global alias in the module with the /// specified name, of arbitrary type. This method returns null if a global /// with the specified name is not found. GlobalAlias *getNamedAlias(const std::string &Name) const; - + /// @} /// @name Type Accessors /// @{ @@ -312,7 +312,7 @@ bool empty() const { return FunctionList.empty(); } /// @} -/// @name Dependent Library Iteration +/// @name Dependent Library Iteration /// @{ public: /// @brief Get a constant iterator to beginning of dependent library list. @@ -360,10 +360,10 @@ /// Dump the module to std::cerr (for debugging). void dump() const; /// This function causes all the subinstructions to "let go" of all references - /// that they are maintaining. This allows one to 'delete' a whole class at - /// a time, even though there may be circular references... first all - /// references are dropped, and all use counts go to zero. Then everything - /// is delete'd for real. Note that no operations are valid on an object + /// that they are maintaining. This allows one to 'delete' a whole class at + /// a time, even though there may be circular references... first all + /// references are dropped, and all use counts go to zero. Then everything + /// is delete'd for real. Note that no operations are valid on an object /// that has "dropped all references", except operator delete. void dropAllReferences(); /// @} @@ -403,17 +403,17 @@ return M ? &M->getValueSymbolTable() : 0; } -inline int +inline int ilist_traits::getListOffset() { return Module::getFunctionListOffset(); } -inline int +inline int ilist_traits::getListOffset() { return Module::getGlobalVariableListOffset(); } -inline int +inline int ilist_traits::getListOffset() { return Module::getAliasListOffset(); } From nicolas.geoffray at lip6.fr Wed Apr 16 15:46:05 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 16 Apr 2008 20:46:05 -0000 Subject: [llvm-commits] [llvm] r49814 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/ExecutionEngine/ include/llvm/Target/ lib/CodeGen/ lib/ExecutionEngine/JIT/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/PowerPC/ lib/Target/X86/ Message-ID: <200804162046.m3GKk6nV007626@zion.cs.uiuc.edu> Author: geoffray Date: Wed Apr 16 15:46:05 2008 New Revision: 49814 URL: http://llvm.org/viewvc/llvm-project?rev=49814&view=rev Log: Correlate stubs with functions in JIT: when emitting a stub, the JIT tells the memory manager which function the stub will resolve. Modified: llvm/trunk/include/llvm/CodeGen/MachineCodeEmitter.h llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h llvm/trunk/include/llvm/Target/TargetJITInfo.h llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp llvm/trunk/lib/Target/ARM/ARMJITInfo.h llvm/trunk/lib/Target/Alpha/AlphaJITInfo.cpp llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h llvm/trunk/lib/Target/X86/X86JITInfo.cpp llvm/trunk/lib/Target/X86/X86JITInfo.h Modified: llvm/trunk/include/llvm/CodeGen/MachineCodeEmitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineCodeEmitter.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineCodeEmitter.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineCodeEmitter.h Wed Apr 16 15:46:05 2008 @@ -82,12 +82,13 @@ /// have constant pools, the can only use the other emitByte*/emitWord* /// methods. /// - virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) = 0; + virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment = 1) = 0; /// finishFunctionStub - This callback is invoked to terminate a function /// stub. /// - virtual void *finishFunctionStub(const Function *F) = 0; + virtual void *finishFunctionStub(const GlobalValue* F) = 0; /// emitByte - This callback is invoked when a byte needs to be written to the /// output stream. Modified: llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h (original) +++ llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h Wed Apr 16 15:46:05 2008 @@ -74,7 +74,8 @@ /// thunk for it. The stub should be "close" to the current function body, /// but should not be included in the 'actualsize' returned by /// startFunctionBody. - virtual unsigned char *allocateStub(unsigned StubSize, unsigned Alignment) =0; + virtual unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment) =0; /// endFunctionBody - This method is called when the JIT is done codegen'ing Modified: llvm/trunk/include/llvm/Target/TargetJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetJITInfo.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetJITInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetJITInfo.h Wed Apr 16 15:46:05 2008 @@ -23,6 +23,7 @@ namespace llvm { class Function; + class GlobalValue; class MachineBasicBlock; class MachineCodeEmitter; class MachineRelocation; @@ -41,8 +42,9 @@ virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0; /// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to - /// emit a lazy pointer which contains the address of the specified GV. - virtual void *emitGlobalValueLazyPtr(void *GV, MachineCodeEmitter &MCE) { + /// emit a lazy pointer which contains the address of the specified ptr. + virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr, + MachineCodeEmitter &MCE) { assert(0 && "This target doesn't implement emitGlobalValueLazyPtr!"); return 0; } @@ -50,7 +52,8 @@ /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a /// small native function that simply calls the function at the specified /// address. Return the address of the resultant function. - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { + virtual void *emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE) { assert(0 && "This target doesn't implement emitFunctionStub!"); return 0; } Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Wed Apr 16 15:46:05 2008 @@ -114,11 +114,12 @@ /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! - void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) { + void startFunctionStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment = 1) { assert(0 && "JIT specific function called!"); abort(); } - void *finishFunctionStub(const Function *F) { + void *finishFunctionStub(const GlobalValue *F) { assert(0 && "JIT specific function called!"); abort(); return 0; Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Wed Apr 16 15:46:05 2008 @@ -141,11 +141,12 @@ virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { } /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! - virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1) { + virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment = 1) { assert(0 && "JIT specific function called!"); abort(); } - virtual void *finishFunctionStub(const Function *F) { + virtual void *finishFunctionStub(const GlobalValue* F) { assert(0 && "JIT specific function called!"); abort(); return 0; Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Wed Apr 16 15:46:05 2008 @@ -175,7 +175,7 @@ // Otherwise, codegen a new stub. For now, the stub will call the lazy // resolver function. - Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, + Stub = TheJIT->getJITInfo().emitFunctionStub(F, Actual, *TheJIT->getCodeEmitter()); if (Actual != (void*)(intptr_t)LazyResolverFn) { @@ -204,7 +204,7 @@ if (LazyPtr) return LazyPtr; // Otherwise, codegen a new lazy pointer. - LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GVAddress, + LazyPtr = TheJIT->getJITInfo().emitGlobalValueLazyPtr(GV, GVAddress, *TheJIT->getCodeEmitter()); DOUT << "JIT: Stub emitted at [" << LazyPtr << "] for GV '" @@ -220,7 +220,7 @@ void *&Stub = ExternalFnToStubMap[FnAddr]; if (Stub) return Stub; - Stub = TheJIT->getJITInfo().emitFunctionStub(FnAddr, + Stub = TheJIT->getJITInfo().emitFunctionStub(0, FnAddr, *TheJIT->getCodeEmitter()); DOUT << "JIT: Stub emitted at [" << Stub @@ -503,8 +503,9 @@ void initJumpTableInfo(MachineJumpTableInfo *MJTI); void emitJumpTableInfo(MachineJumpTableInfo *MJTI); - virtual void startFunctionStub(unsigned StubSize, unsigned Alignment = 1); - virtual void* finishFunctionStub(const Function *F); + virtual void startFunctionStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment = 1); + virtual void* finishFunctionStub(const GlobalValue *F); virtual void addRelocation(const MachineRelocation &MR) { Relocations.push_back(MR); @@ -822,16 +823,17 @@ } } -void JITEmitter::startFunctionStub(unsigned StubSize, unsigned Alignment) { +void JITEmitter::startFunctionStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment) { SavedBufferBegin = BufferBegin; SavedBufferEnd = BufferEnd; SavedCurBufferPtr = CurBufferPtr; - BufferBegin = CurBufferPtr = MemMgr->allocateStub(StubSize, Alignment); + BufferBegin = CurBufferPtr = MemMgr->allocateStub(F, StubSize, Alignment); BufferEnd = BufferBegin+StubSize+1; } -void *JITEmitter::finishFunctionStub(const Function *F) { +void *JITEmitter::finishFunctionStub(const GlobalValue* F) { NumBytes += getCurrentPCOffset(); std::swap(SavedBufferBegin, BufferBegin); BufferEnd = SavedBufferEnd; Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Wed Apr 16 15:46:05 2008 @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/GlobalValue.h" #include "llvm/ExecutionEngine/JITMemoryManager.h" #include "llvm/Support/Compiler.h" #include "llvm/System/Memory.h" @@ -265,7 +266,8 @@ void AllocateGOT(); - unsigned char *allocateStub(unsigned StubSize, unsigned Alignment); + unsigned char *allocateStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment); /// startFunctionBody - When a function starts, allocate a block of free /// executable memory, returning a pointer to it and its actual size. @@ -438,7 +440,8 @@ Blocks.clear(); } -unsigned char *DefaultJITMemoryManager::allocateStub(unsigned StubSize, +unsigned char *DefaultJITMemoryManager::allocateStub(const GlobalValue* F, + unsigned StubSize, unsigned Alignment) { CurStubPtr -= StubSize; CurStubPtr = (unsigned char*)(((intptr_t)CurStubPtr) & Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Wed Apr 16 15:46:05 2008 @@ -15,6 +15,7 @@ #include "ARMJITInfo.h" #include "ARMRelocations.h" #include "ARMSubtarget.h" +#include "llvm/Function.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" #include @@ -93,20 +94,21 @@ return ARMCompilationCallback; } -void *ARMJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { +void *ARMJITInfo::emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE) { unsigned addr = (intptr_t)Fn; // If this is just a call to an external function, emit a branch instead of a // call. The code is the same except for one bit of the last instruction. if (Fn != (void*)(intptr_t)ARMCompilationCallback) { // branch to the corresponding function addr // the stub is 8-byte size and 4-aligned - MCE.startFunctionStub(8, 4); + MCE.startFunctionStub(F, 8, 4); MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4] MCE.emitWordLE(addr); // addr of function } else { // branch and link to the corresponding function addr // the stub is 20-byte size and 4-aligned - MCE.startFunctionStub(20, 4); + MCE.startFunctionStub(F, 20, 4); MCE.emitWordLE(0xE92D4800); // STMFD SP!, [R11, LR] MCE.emitWordLE(0xE28FE004); // ADD LR, PC, #4 MCE.emitWordLE(0xE51FF004); // LDR PC, [PC,#-4] @@ -114,7 +116,7 @@ MCE.emitWordLE(0xE8BD8800); // LDMFD SP!, [R11, PC] } - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } /// relocate - Before the JIT can run a block of code that has been emitted, Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.h Wed Apr 16 15:46:05 2008 @@ -34,7 +34,8 @@ /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a /// small native function that simply calls the function at the specified /// address. - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + virtual void *emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE); /// getLazyResolverFunction - Expose the lazy resolver to the JIT. virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); Modified: llvm/trunk/lib/Target/Alpha/AlphaJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaJITInfo.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaJITInfo.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaJITInfo.cpp Wed Apr 16 15:46:05 2008 @@ -14,6 +14,7 @@ #define DEBUG_TYPE "jit" #include "AlphaJITInfo.h" #include "AlphaRelocations.h" +#include "llvm/Function.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" #include "llvm/Support/Debug.h" @@ -190,16 +191,17 @@ #endif } -void *AlphaJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { +void *AlphaJITInfo::emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE) { //assert(Fn == AlphaCompilationCallback && "Where are you going?\n"); //Do things in a stupid slow way! - MCE.startFunctionStub(19*4); + MCE.startFunctionStub(F, 19*4); void* Addr = (void*)(intptr_t)MCE.getCurrentPCValue(); for (int x = 0; x < 19; ++ x) MCE.emitWordLE(0); EmitBranchToAt(Addr, Fn); DOUT << "Emitting Stub to " << Fn << " at [" << Addr << "]\n"; - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } TargetJITInfo::LazyResolverFn Modified: llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h (original) +++ llvm/trunk/lib/Target/Alpha/AlphaJITInfo.h Wed Apr 16 15:46:05 2008 @@ -29,7 +29,8 @@ explicit AlphaJITInfo(TargetMachine &tm) : TM(tm) { useGOT = true; } - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + virtual void *emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE); virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char* GOTBase); Modified: llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp Wed Apr 16 15:46:05 2008 @@ -15,6 +15,7 @@ #include "PPCJITInfo.h" #include "PPCRelocations.h" #include "PPCTargetMachine.h" +#include "llvm/Function.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" #include "llvm/Support/Debug.h" @@ -338,12 +339,13 @@ #endif } -void *PPCJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { +void *PPCJITInfo::emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE) { // If this is just a call to an external function, emit a branch instead of a // call. The code is the same except for one bit of the last instruction. if (Fn != (void*)(intptr_t)PPC32CompilationCallback && Fn != (void*)(intptr_t)PPC64CompilationCallback) { - MCE.startFunctionStub(7*4); + MCE.startFunctionStub(F, 7*4); intptr_t Addr = (intptr_t)MCE.getCurrentPCValue(); MCE.emitWordBE(0); MCE.emitWordBE(0); @@ -354,10 +356,10 @@ MCE.emitWordBE(0); EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit); SyncICache((void*)Addr, 7*4); - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } - MCE.startFunctionStub(10*4); + MCE.startFunctionStub(F, 10*4); intptr_t Addr = (intptr_t)MCE.getCurrentPCValue(); if (is64Bit) { MCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1) @@ -382,7 +384,7 @@ MCE.emitWordBE(0); EmitBranchToAt(BranchAddr, (intptr_t)Fn, true, is64Bit); SyncICache((void*)Addr, 10*4); - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } Modified: llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.h Wed Apr 16 15:46:05 2008 @@ -29,7 +29,8 @@ is64Bit = tmIs64Bit; } - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + virtual void *emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE); virtual LazyResolverFn getLazyResolverFunction(JITCompilerFn); virtual void relocate(void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char* GOTBase); Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Wed Apr 16 15:46:05 2008 @@ -15,6 +15,7 @@ #include "X86JITInfo.h" #include "X86Relocations.h" #include "X86Subtarget.h" +#include "llvm/Function.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/Config/alloca.h" #include @@ -391,19 +392,21 @@ return X86CompilationCallback; } -void *X86JITInfo::emitGlobalValueLazyPtr(void *GV, MachineCodeEmitter &MCE) { +void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr, + MachineCodeEmitter &MCE) { #if defined (X86_64_JIT) MCE.startFunctionStub(8, 8); - MCE.emitWordLE(((unsigned *)&GV)[0]); - MCE.emitWordLE(((unsigned *)&GV)[1]); + MCE.emitWordLE(((unsigned *)&ptr)[0]); + MCE.emitWordLE(((unsigned *)&ptr)[1]); #else - MCE.startFunctionStub(4, 4); - MCE.emitWordLE((intptr_t)GV); + MCE.startFunctionStub(GV, 4, 4); + MCE.emitWordLE((intptr_t)ptr); #endif - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(GV); } -void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) { +void *X86JITInfo::emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE) { // Note, we cast to intptr_t here to silence a -pedantic warning that // complains about casting a function pointer to a normal pointer. #if defined (X86_32_JIT) && !defined (_MSC_VER) @@ -414,7 +417,7 @@ #endif if (NotCC) { #if defined (X86_64_JIT) - MCE.startFunctionStub(13, 4); + MCE.startFunctionStub(F, 13, 4); MCE.emitByte(0x49); // REX prefix MCE.emitByte(0xB8+2); // movabsq r10 MCE.emitWordLE(((unsigned *)&Fn)[0]); @@ -423,15 +426,15 @@ MCE.emitByte(0xFF); // jmpq *r10 MCE.emitByte(2 | (4 << 3) | (3 << 6)); #else - MCE.startFunctionStub(5, 4); + MCE.startFunctionStub(F, 5, 4); MCE.emitByte(0xE9); MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); #endif - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } #if defined (X86_64_JIT) - MCE.startFunctionStub(14, 4); + MCE.startFunctionStub(F, 14, 4); MCE.emitByte(0x49); // REX prefix MCE.emitByte(0xB8+2); // movabsq r10 MCE.emitWordLE(((unsigned *)&Fn)[0]); @@ -440,14 +443,14 @@ MCE.emitByte(0xFF); // callq *r10 MCE.emitByte(2 | (2 << 3) | (3 << 6)); #else - MCE.startFunctionStub(6, 4); + MCE.startFunctionStub(F, 6, 4); MCE.emitByte(0xE8); // Call with 32 bit pc-rel destination... MCE.emitWordLE((intptr_t)Fn-MCE.getCurrentPCValue()-4); #endif MCE.emitByte(0xCD); // Interrupt - Just a marker identifying the stub! - return MCE.finishFunctionStub(0); + return MCE.finishFunctionStub(F); } /// getPICJumpTableEntry - Returns the value of the jumptable entry for the Modified: llvm/trunk/lib/Target/X86/X86JITInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.h?rev=49814&r1=49813&r2=49814&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.h Wed Apr 16 15:46:05 2008 @@ -14,6 +14,7 @@ #ifndef X86JITINFO_H #define X86JITINFO_H +#include "llvm/Function.h" #include "llvm/Target/TargetJITInfo.h" namespace llvm { @@ -33,13 +34,15 @@ virtual void replaceMachineCodeForFunction(void *Old, void *New); /// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to - /// emit a lazy pointer which contains the address of the specified GV. - virtual void *emitGlobalValueLazyPtr(void *GV, MachineCodeEmitter &MCE); + /// emit a lazy pointer which contains the address of the specified ptr. + virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr, + MachineCodeEmitter &MCE); /// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a /// small native function that simply calls the function at the specified /// address. - virtual void *emitFunctionStub(void *Fn, MachineCodeEmitter &MCE); + virtual void *emitFunctionStub(const Function* F, void *Fn, + MachineCodeEmitter &MCE); /// getPICJumpTableEntry - Returns the value of the jumptable entry for the /// specific basic block. From gohman at apple.com Wed Apr 16 16:04:02 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 14:04:02 -0700 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200804161615.m3GGFS0b021120@zion.cs.uiuc.edu> References: <200804161615.m3GGFS0b021120@zion.cs.uiuc.edu> Message-ID: On Apr 16, 2008, at 9:15 AM, Roman Levenstein wrote: > > - SDOperand& operator= (SDOperandImpl& Op) { > - *(SDOperandImpl*)this = Op; > + SDUse& operator= (SDOperand& Op) { > + Operand = Op; > Next = NULL; > Prev = NULL; > return *this; > } > > - SDOperand& operator= (const SDOperandImpl& Op) { > - *(SDOperandImpl*)this = Op; > + SDUse& operator= (const SDOperand& Op) { > + Operand = Op; > Next = NULL; > Prev = NULL; > return *this; > } The first of these two assignment operators can be removed now; the one taking a const reference will handle both cases. > > > - SDOperand& operator= (SDOperand& Op) { > - *(SDOperandImpl*)this = Op; > + SDUse& operator= (SDUse& Op) { > + Operand = Op; > Next = NULL; > Prev = NULL; > return *this; > } > > - SDOperand& operator= (const SDOperand& Op) { > - *(SDOperandImpl*)this = Op; > + SDUse& operator= (const SDUse& Op) { > + Operand = Op; > Next = NULL; > Prev = NULL; > return *this; > } Ditto. Dan From gohman at apple.com Wed Apr 16 16:57:30 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 21:57:30 -0000 Subject: [llvm-commits] [llvm] r49820 - /llvm/trunk/include/llvm/Use.h Message-ID: <200804162157.m3GLvUcu013189@zion.cs.uiuc.edu> Author: djg Date: Wed Apr 16 16:57:29 2008 New Revision: 49820 URL: http://llvm.org/viewvc/llvm-project?rev=49820&view=rev Log: Fix a copy+paste error in a comment. Modified: llvm/trunk/include/llvm/Use.h Modified: llvm/trunk/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Use.h?rev=49820&r1=49819&r2=49820&view=diff ============================================================================== --- llvm/trunk/include/llvm/Use.h (original) +++ llvm/trunk/include/llvm/Use.h Wed Apr 16 16:57:29 2008 @@ -136,7 +136,7 @@ _Self tmp = *this; ++*this; return tmp; } - // Retrieve a reference to the current SCC + // Retrieve a reference to the current User UserTy *operator*() const { assert(U && "Cannot increment end iterator!"); return U->getUser(); From gohman at apple.com Wed Apr 16 16:59:47 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 14:59:47 -0700 Subject: [llvm-commits] Speeding up instruction selection In-Reply-To: References: <1C1F9E6C-5B8E-4667-A119-4590F340FDE7@apple.com> <83CD954F-CD49-4D4B-950D-B6CB6CD1B32D@apple.com> <417E9823-6AF6-44B0-83FD-89F0CC079B6A@apple.com> <3F534552-8033-40A3-8E0A-733516299939@apple.com> Message-ID: On Apr 16, 2008, at 9:19 AM, Roman Levenstein wrote: > Good. I committed the patch including all improvements suggested by > you. Thanks! > > > BTW, Dan, have you had any time to look at the patch introducing > queues instead of heaps in the target specific instruction selectors? Not yet, but I'm hoping to soon. I briefly looked at it a while ago and had the same question that I think was one you had asked; is a multiset really necessary? But I haven't dug into it yet. Dan From gohman at apple.com Wed Apr 16 17:21:01 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 16 Apr 2008 15:21:01 -0700 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200804161615.m3GGFS0b021120@zion.cs.uiuc.edu> References: <200804161615.m3GGFS0b021120@zion.cs.uiuc.edu> Message-ID: <9282D88D-0DB0-4463-87FD-3A7C6937E3C5@apple.com> Hi Roman, I have a few more comments, not on this commit specifically, but on this overall series. On Apr 16, 2008, at 9:15 AM, Roman Levenstein wrote: > > -/// SDOperand - Represents a use of the SDNode referred by > -/// the SDOperandImpl. > -class SDOperand: public SDOperandImpl { > +/// SDUse - Represents a use of the SDNode referred by > +/// the SDOperand. > +class SDUse { > + SDOperand Operand; > /// parent - Parent node of this operand. Can you rename parent? I know the public accessor is already renamed, but I'd like the private member's name to match too :-). > > /// Retrieve a reference to the current operand. > - SDOperand &operator*() const { > + SDUse &operator*() const { > assert(Op && "Cannot dereference end iterator!"); > return *Op; > } > > /// Retrieve a pointer to the current operand. > - SDOperand *operator->() const { > + SDUse *operator->() const { > assert(Op && "Cannot dereference end iterator!"); > return Op; (this is in SDNode::use_iterator) Now that the SDUse change is in we can take another look at use_iterator::operator* (and operator->). The parallel to Use::value_use_iterator would be to have it return the user SDNode * (i.e., operator* calls getUser). At first glance, that seems a little questionable because it doesn't convey which value is being used. But I think that's addressed if we persue the idea mentioned earlier about providing a way to iterate through the users of a specific value of a node. What do you think? Dan From dalej at apple.com Wed Apr 16 17:24:34 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 16 Apr 2008 22:24:34 -0000 Subject: [llvm-commits] [llvm] r49822 - /llvm/trunk/lib/Target/X86/X86JITInfo.cpp Message-ID: <200804162224.m3GMOYrt015346@zion.cs.uiuc.edu> Author: johannes Date: Wed Apr 16 17:24:33 2008 New Revision: 49822 URL: http://llvm.org/viewvc/llvm-project?rev=49822&view=rev Log: Unbreak build on x86-64. Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=49822&r1=49821&r2=49822&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Wed Apr 16 17:24:33 2008 @@ -395,7 +395,7 @@ void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr, MachineCodeEmitter &MCE) { #if defined (X86_64_JIT) - MCE.startFunctionStub(8, 8); + MCE.startFunctionStub(GV, 8, 8); MCE.emitWordLE(((unsigned *)&ptr)[0]); MCE.emitWordLE(((unsigned *)&ptr)[1]); #else From tonic at nondot.org Wed Apr 16 17:38:37 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 16 Apr 2008 17:38:37 -0500 Subject: [llvm-commits] CVS: llvm-www/www-index.html Message-ID: <200804162238.m3GMcbur016652@zion.cs.uiuc.edu> Changes in directory llvm-www: www-index.html updated: 1.154 -> 1.155 --- Log message: 2.3 release schedule --- Diffs of the changes: (+7 -1) www-index.html | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.154 llvm-www/www-index.html:1.155 --- llvm-www/www-index.html:1.154 Fri Mar 14 01:21:09 2008 +++ llvm-www/www-index.html Wed Apr 16 17:38:02 2008 @@ -117,8 +117,14 @@

Upcoming Releases
-

LLVM 2.3 release schedule (coming soon)

+

LLVM 2.3 release schedule:

    +
  • May 9, 2008: Branch creation/Code Freeze (9PM PDT).
  • +
  • May 12, 2008: First round of pre-release testing begins.
  • +
  • May 21, 2008: Pre-release testing ends.
  • +
  • May 23, 2008: Second round of pre-release testing begins.
  • +
  • May 30, 2008: Pre-release testing ends.
  • +
  • June 2, 2008: 2.3 Released.
From dpatel at apple.com Wed Apr 16 18:28:44 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 16 Apr 2008 23:28:44 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49829 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804162328.m3GNSine020806@zion.cs.uiuc.edu> Author: dpatel Date: Wed Apr 16 18:28:44 2008 New Revision: 49829 URL: http://llvm.org/viewvc/llvm-project?rev=49829&view=rev Log: Do not use llvm_x86_64_should_pass_aggregate_in_mixed_regs() while handling struct return. And some code cleanup. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49829&r1=49828&r2=49829&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 Wed Apr 16 18:28:44 2008 @@ -744,32 +744,6 @@ return llvm_x86_64_should_pass_aggregate_in_memory(TreeType, Mode); } -/* llvm_x86_64_type_needs_multiple_regs - Return number of register classes - need by TREETYPE. Return 0 if TREETYPE does not need multiple registers. - This helper routine is used to determine LLVM type of the function - arguments as well as return values. */ -static int -llvm_x86_64_type_needs_multiple_regs(enum machine_mode Mode, tree TreeType, - enum x86_64_reg_class Class[MAX_CLASSES]) { - int NumClasses = ix86_ClassifyArgument(Mode, TreeType, Class, 0); - if (!NumClasses) - return 0; - - for (int i = 0; i < NumClasses; ++i) { - switch (Class[i]) { - case X86_64_X87_CLASS: - case X86_64_X87UP_CLASS: - case X86_64_COMPLEX_X87_CLASS: - return 0; - case X86_64_NO_CLASS: - return 0; - default: - break; - } - } - return NumClasses; -} - /* Target hook for llvm-abi.h. It returns true if an aggregate of the specified type should be passed in a number of registers of mixed types. It also returns a vector of types that correspond to the registers used @@ -781,7 +755,7 @@ enum machine_mode Mode = ix86_getNaturalModeForType(TreeType); HOST_WIDE_INT Bytes = (Mode == BLKmode) ? int_size_in_bytes(TreeType) : (int) GET_MODE_SIZE(Mode); - int NumClasses = llvm_x86_64_type_needs_multiple_regs(Mode, TreeType, Class); + int NumClasses = ix86_ClassifyArgument(Mode, TreeType, Class, 0); if (!NumClasses) return false; @@ -844,18 +818,11 @@ Elts.push_back(Type::DoubleTy); Bytes -= 16; } else if (Class[i+1] == X86_64_SSEDF_CLASS && Bytes == 16) { - // struct {float f[2]; double d; } should be returned in SSE registers. Elts.push_back(VectorType::get(Type::FloatTy, 2)); Elts.push_back(Type::DoubleTy); } else if (Class[i+1] == X86_64_INTEGER_CLASS) { - // struct { float f[2]; char c; } should be returned in SSE(low) - // and INT (high). - const Type *Ty = ConvertType(TreeType); - if (const StructType *STy = dyn_cast(Ty)) { - Elts.push_back(VectorType::get(Type::FloatTy, 2)); - Elts.push_back(STy->getElementType(1)); - } else - assert(0 && "Not yet handled!"); + Elts.push_back(VectorType::get(Type::FloatTy, 2)); + Elts.push_back(Type::Int64Ty); } else assert(0 && "Not yet handled!"); ++i; // Already handled the next one. @@ -936,8 +903,7 @@ // llvm_suitable_multiple_ret_value_type - Return TRUE if return value // of type TY should be returned using multiple value return instruction. static bool llvm_suitable_multiple_ret_value_type(const Type *Ty, - tree TreeType, - std::vector&Elts) { + tree TreeType) { //NOTE: Work in progress. Do not open the flood gate yet. return false; @@ -948,28 +914,40 @@ if (!STy) return false; - //Let gcc specific routine answer the question. + // llvm only accepts first class types for multiple values in ret instruction. + bool foundNonInt = false; + bool foundInt = false; + unsigned STyElements = STy->getNumElements(); + for (unsigned i = 0; i < STyElements; ++i) { + const Type *ETy = STy->getElementType(i); + if (const ArrayType *ATy = dyn_cast(ETy)) + ETy = ATy->getElementType(); + if (!ETy->isFirstClassType()) + return false; + if (!ETy->isInteger()) + foundNonInt = true; + else + foundInt = true; + } + // FIXME. llvm x86-64 code generator does not handle all cases of + // multiple value return. Remove this when the code generator restriction + // is removed. + if (!foundNonInt) + return false; + + // Let gcc specific routine answer the question. enum x86_64_reg_class Class[MAX_CLASSES]; enum machine_mode Mode = ix86_getNaturalModeForType(TreeType); - if (llvm_x86_64_type_needs_multiple_regs(Mode, TreeType, Class)) { - - llvm_x86_64_should_pass_aggregate_in_mixed_regs(TreeType, Ty, Elts); - assert (!Elts.empty() && "Unable to handle aggregate return type!"); - // If it is a singleton structure, e.g. { long double ld;} then use the type - // directly. - if (Elts.size() == 1) - return true; - - bool foundFloat = false; - for (unsigned i = 0; i < Elts.size(); ++i) - if (Elts[i]->isFloatingPoint() - || Elts[i]->getTypeID() == Type::VectorTyID) - foundFloat = true; + int NumClasses = ix86_ClassifyArgument(Mode, TreeType, Class, 0); + if (NumClasses == 0) + return false; - return foundFloat; - } + // FIXME: llvm x86-64 code generator is not able to handle return {i8, float} + if (NumClasses == 1 && foundInt) + return false; - return false; + // Otherwise, use of multiple value return is OK. + return true; } // llvm_x86_scalar_type_for_struct_return - Return LLVM type if TYPE @@ -987,12 +965,8 @@ return Type::Int32Ty; // Check if Ty should be returned using multiple value return instruction. - std::vectorElts; - if (llvm_suitable_multiple_ret_value_type(Ty, type, Elts)) { - if (Elts.size() == 1) - return Elts[0]; + if (llvm_suitable_multiple_ret_value_type(Ty, type)) return NULL; - } if (Size <= 8) return Type::Int64Ty; @@ -1004,11 +978,11 @@ return NULL; } -// Return LLVM Type if TYPE can be returned as an aggregate, otherwise return NULL. +// Return LLVM Type if TYPE can be returned as an aggregate, +// otherwise return NULL. const Type *llvm_x86_aggr_type_for_struct_return(tree type) { const Type *Ty = ConvertType(type); - std::vectorElts; - if (!llvm_suitable_multiple_ret_value_type(Ty, type, Elts)) + if (!llvm_suitable_multiple_ret_value_type(Ty, type)) return NULL; const StructType *STy = cast(Ty); @@ -1042,7 +1016,8 @@ break; case 4: // use { <4 x float> } for struct { float[4]; } - ElementTypes.push_back(VectorType::get(ATy->getElementType(), 4)); + ElementTypes.push_back(VectorType::get(ATy->getElementType(), 2)); + ElementTypes.push_back(VectorType::get(ATy->getElementType(), 2)); break; default: assert (0 && "Unexpected floating point array size!"); @@ -1052,34 +1027,37 @@ ElementTypes.push_back(ATy->getElementType()); } } - return StructType::get(ElementTypes, STy->isPacked()); } - // llvm_x86_build_mrv_array_element - This is a helper function used by -// llvm_x6_build_multiple_return_value. This function builds a vector -// from the array fields of RetVal. +// llvm_x6_build_multiple_return_value. static Value *llvm_x86_build_mrv_array_element(const Type *STyFieldTy, Value *RetVal, unsigned FieldNo, - unsigned ArraySize, - IRBuilder &Builder) { + IRBuilder &Builder, + unsigned ArrayElemNo = 0) { llvm::Value *Idxs[3]; Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0); Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, FieldNo); - - Value *R1 = UndefValue::get(STyFieldTy); - - for (unsigned i = 0; i < ArraySize; ++i) { - Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, i); + if (const VectorType *VTy = dyn_cast(STyFieldTy)) { + // Source field is a vector. Use insertelement. + Value *R1 = UndefValue::get(STyFieldTy); + unsigned ArraySize = VTy->getNumElements(); + for (unsigned i = ArrayElemNo; i < ArraySize; ++i) { + Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, i); + Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep"); + Value *ElemVal = Builder.CreateLoad(GEP, "mrv"); + R1 = Builder.CreateInsertElement(R1, ElemVal, + ConstantInt::get(llvm::Type::Int32Ty, i), + "mrv"); + } + return R1; + } else { + Idxs[2] = ConstantInt::get(llvm::Type::Int32Ty, ArrayElemNo); Value *GEP = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep"); - Value *ElemVal = Builder.CreateLoad(GEP, "mrv"); - R1 = Builder.CreateInsertElement(R1, ElemVal, - ConstantInt::get(llvm::Type::Int32Ty, i), - "mrv"); + return Builder.CreateLoad(GEP, "mrv"); } - return R1; } // llvm_x86_build_multiple_return_value - Function FN returns multiple value @@ -1097,38 +1075,44 @@ // may not match. For example, when STy is { <2 x float> } the RetSTy is // { float[2]; } unsigned NumElements = RetSTy->getNumElements(); - for (unsigned RNO = 0, SNO = 0; RNO < NumElements; ++RNO, ++SNO) { - const Type *ElemType = RetSTy->getElementType(RNO); + unsigned RNO = 0; + unsigned SNO = 0; + 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); - } else { - const ArrayType *ATy = cast(ElemType); - unsigned ArraySize = ATy->getNumElements(); - const VectorType *SElemTy = cast(STy->getElementType(SNO)); - unsigned Size = SElemTy->getNumElements(); - assert (ArraySize >= Size && "Invalid multiple return value type!"); - Value *R = llvm_x86_build_mrv_array_element(SElemTy, RetVal, RNO, - Size, Builder); - RetVals.push_back(R); - if (ArraySize > Size) { - assert (ArraySize == Size + 1 && "Unable to build multiple return value!"); - // Build remaining values. - const Type *NextTy = STy->getElementType(SNO + 1); - if (NextTy->getTypeID() == Type::FloatTyID) { - 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, Size + 1); - Value *GEP3 = Builder.CreateGEP(RetVal, Idxs, Idxs+3, "mrv_gep"); - Value *ElemVal3 = Builder.CreateLoad(GEP3, "mrv"); - RetVals.push_back(ElemVal3); - SNO++; - } else - assert ( 0 && "Unable to build multiple return value!"); + ++RNO; + ++SNO; + continue; + } + + const ArrayType *ATy = cast(ElemType); + unsigned ArraySize = ATy->getNumElements(); + unsigned AElemNo = 0; + while (AElemNo < ArraySize) { + const Type *SElemTy = STy->getElementType(SNO); + if (const VectorType *SVElemTy = dyn_cast(SElemTy)) { + // Build array elements from a vector. + unsigned VSize = SVElemTy->getNumElements(); + assert (ArraySize - AElemNo >= VSize + && "Invalid multiple return value type!"); + Value *R = llvm_x86_build_mrv_array_element(SVElemTy, RetVal, RNO, + Builder, AElemNo); + RetVals.push_back(R); + AElemNo += VSize; + } else { + Value *R = llvm_x86_build_mrv_array_element(SElemTy, RetVal, RNO, + Builder, AElemNo); + RetVals.push_back(R); + ++AElemNo; } + // Next Src field. + ++SNO; } + // Finished building this array field. + RNO++; } } @@ -1193,24 +1177,24 @@ // not match. For example { <2 x float>, float } and { float[3]; } const ArrayType *ATy = cast(DestElemType); unsigned ArraySize = ATy->getNumElements(); - for (unsigned di = 0, si = 0; di < ArraySize; ++di, ++si) { - llvm_x86_extract_mrv_array_element(Src, Dest, SNO, si, DNO, di, - Builder, isVolatile); - if (const VectorType *SElemTy = - dyn_cast(STy->getElementType(SNO))) { - unsigned NumVElem = SElemTy->getNumElements(); - if (NumVElem == si + 1) { - // If extracted all elments from current Src field then - // move to next field. - si = 0; - ++SNO; - } + unsigned DElemNo = 0; // DestTy's DNO field's element number + while (DElemNo < ArraySize) { + const VectorType *SElemTy = dyn_cast(STy->getElementType(SNO)); + if (!SElemTy) { + llvm_x86_extract_mrv_array_element(Src, Dest, SNO, 0, DNO, DElemNo, + Builder, isVolatile); + ++DElemNo; } else { - // Copied content from current source field, so move to next field. - ++SNO; + for (unsigned i = 0; i < SElemTy->getNumElements(); ++i) { + llvm_x86_extract_mrv_array_element(Src, Dest, SNO, i, DNO, DElemNo, + Builder, isVolatile); + ++DElemNo; + } } + // Consumed this src field. Try next one. + ++SNO; } - // Process next DNO element. + // Finished building current dest field. ++DNO; } } From evan.cheng at apple.com Wed Apr 16 18:44:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Apr 2008 23:44:44 -0000 Subject: [llvm-commits] [llvm] r49830 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-04-16-ReMatBug.ll Message-ID: <200804162344.m3GNiica022261@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 18:44:44 2008 New Revision: 49830 URL: http://llvm.org/viewvc/llvm-project?rev=49830&view=rev Log: Don't forget about sub-register indices when rematting instructions. Added: llvm/trunk/test/CodeGen/X86/2008-04-16-ReMatBug.ll Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=49830&r1=49829&r2=49830&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Apr 16 18:44:44 2008 @@ -831,6 +831,14 @@ MachineBasicBlock::iterator I, unsigned DestReg, const MachineInstr *Orig) const { + unsigned SubIdx = Orig->getOperand(0).isReg() + ? Orig->getOperand(0).getSubReg() : 0; + bool ChangeSubIdx = SubIdx != 0; + if (SubIdx && TargetRegisterInfo::isPhysicalRegister(DestReg)) { + DestReg = RI.getSubReg(DestReg, SubIdx); + SubIdx = 0; + } + // MOV32r0 etc. are implemented with xor which clobbers condition code. // Re-materialize them as movri instructions to avoid side effects. switch (Orig->getOpcode()) { @@ -853,6 +861,11 @@ break; } } + + if (ChangeSubIdx) { + MachineInstr *NewMI = prior(I); + NewMI->getOperand(0).setSubReg(SubIdx); + } } /// isInvariantLoad - Return true if the specified instruction (which is marked Added: llvm/trunk/test/CodeGen/X86/2008-04-16-ReMatBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-16-ReMatBug.ll?rev=49830&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-16-ReMatBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-04-16-ReMatBug.ll Wed Apr 16 18:44:44 2008 @@ -0,0 +1,46 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep movw | not grep {, %e} + + %struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 } + %struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* } + %struct.GENV_t = type { i32, i8*, i16, i8*, i8*, i32, i32, i32, i32, %struct.DBC_t*, i16 } + %struct.pthread_mutex_t = type { i32, [40 x i8] } + at iodbcdm_global_lock = external global %struct.pthread_mutex_t ; <%struct.pthread_mutex_t*> [#uses=1] + +define i16 @SQLDriversW(i8* %henv, i16 zeroext %fDir, i32* %szDrvDesc, i16 signext %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext %cbDrvAttrMax, i16* %pcbDrvAttr) signext nounwind { +entry: + %tmp12 = bitcast i8* %henv to %struct.GENV_t* ; <%struct.GENV_t*> [#uses=1] + br i1 true, label %bb28, label %bb +bb: ; preds = %entry + ret i16 0 +bb28: ; preds = %entry + br i1 false, label %bb37, label %done +bb37: ; preds = %bb28 + %tmp46 = getelementptr %struct.GENV_t* %tmp12, i32 0, i32 10 ; [#uses=1] + store i16 0, i16* %tmp46, align 4 + br i1 false, label %bb74, label %bb92 +bb74: ; preds = %bb37 + br label %bb92 +bb92: ; preds = %bb74, %bb37 + %tmp95180 = shl i16 %cbDrvAttrMax, 2 ; [#uses=1] + %tmp100178 = shl i16 %cbDrvDescMax, 2 ; [#uses=1] + %tmp113 = tail call i16 @SQLDrivers_Internal( i8* %henv, i16 zeroext %fDir, i8* null, i16 signext %tmp100178, i16* %pcbDrvDesc, i8* null, i16 signext %tmp95180, i16* %pcbDrvAttr, i8 zeroext 87 ) signext nounwind ; [#uses=1] + br i1 false, label %done, label %bb137 +bb137: ; preds = %bb92 + ret i16 0 +done: ; preds = %bb92, %bb28 + %retcode.0 = phi i16 [ -2, %bb28 ], [ %tmp113, %bb92 ] ; [#uses=2] + br i1 false, label %bb167, label %bb150 +bb150: ; preds = %done + %tmp157158 = sext i16 %retcode.0 to i32 ; [#uses=1] + tail call void @trace_SQLDriversW( i32 1, i32 %tmp157158, i8* %henv, i16 zeroext %fDir, i32* %szDrvDesc, i16 signext %cbDrvDescMax, i16* %pcbDrvDesc, i32* %szDrvAttr, i16 signext %cbDrvAttrMax, i16* %pcbDrvAttr ) nounwind + ret i16 0 +bb167: ; preds = %done + %tmp168 = tail call i32 @pthread_mutex_unlock( %struct.pthread_mutex_t* @iodbcdm_global_lock ) nounwind ; [#uses=0] + ret i16 %retcode.0 +} + +declare i32 @pthread_mutex_unlock(%struct.pthread_mutex_t*) + +declare i16 @SQLDrivers_Internal(i8*, i16 zeroext , i8*, i16 signext , i16*, i8*, i16 signext , i16*, i8 zeroext ) signext nounwind + +declare void @trace_SQLDriversW(i32, i32, i8*, i16 zeroext , i32*, i16 signext , i16*, i32*, i16 signext , i16*) From scottm at aero.org Wed Apr 16 18:46:40 2008 From: scottm at aero.org (Scott Michel) Date: Wed, 16 Apr 2008 23:46:40 -0000 Subject: [llvm-commits] [llvm] r49831 - in /llvm/trunk: include/llvm/Support/CFG.h lib/Transforms/Utils/BreakCriticalEdges.cpp Message-ID: <200804162346.m3GNkegr022444@zion.cs.uiuc.edu> Author: pingbak Date: Wed Apr 16 18:46:39 2008 New Revision: 49831 URL: http://llvm.org/viewvc/llvm-project?rev=49831&view=rev Log: Workaround for PR2207, in which pred_iterator assert gets triggered due to a wee problem in Xcode 2.[45]/gcc 4.0.1. Modified: llvm/trunk/include/llvm/Support/CFG.h llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Modified: llvm/trunk/include/llvm/Support/CFG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CFG.h?rev=49831&r1=49830&r2=49831&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/CFG.h (original) +++ llvm/trunk/include/llvm/Support/CFG.h Wed Apr 16 18:46:39 2008 @@ -36,8 +36,11 @@ inline void advancePastNonPreds() { // Loop to ignore non predecessor uses (for example PHI nodes)... - while (!It.atEnd() && !isa(*It) && !isa(*It)) + while (!It.atEnd()) { + if (isa(*It) || isa(*It)) + break; ++It; + } } inline PredIterator(_Ptr *bb) : It(bb->use_begin()) { Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=49831&r1=49830&r2=49831&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed Apr 16 18:46:39 2008 @@ -103,8 +103,15 @@ // If AllowIdenticalEdges is true, then we allow this edge to be considered // non-critical iff all preds come from TI's block. - for (; I != E; ++I) - if (*I != FirstPred) return true; + while (I != E) { + pred_const_iterator E1 = E; + if (*I != FirstPred) + return true; + // Note: leave this as is until no one ever compiles with either gcc 4.0.1 + // or Xcode 2. This seems to work around the pred_iterator assert in PR 2207 + E = pred_end(*I); + ++I; + } return false; } From evan.cheng at apple.com Wed Apr 16 19:06:42 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Apr 2008 00:06:42 -0000 Subject: [llvm-commits] [llvm] r49832 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2008-04-16-CoalescerBug.ll Message-ID: <200804170006.m3H06gIs024098@zion.cs.uiuc.edu> Author: evancheng Date: Wed Apr 16 19:06:42 2008 New Revision: 49832 URL: http://llvm.org/viewvc/llvm-project?rev=49832&view=rev Log: Fix a sub-register indice propagation bug. Added: llvm/trunk/test/CodeGen/X86/2008-04-16-CoalescerBug.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49832&r1=49831&r2=49832&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Wed Apr 16 19:06:42 2008 @@ -457,15 +457,14 @@ MachineOperand &O = I.getOperand(); MachineInstr *UseMI = &*I; ++I; + unsigned OldSubIdx = O.getSubReg(); if (DstIsPhys) { - unsigned UseSubIdx = O.getSubReg(); unsigned UseDstReg = DstReg; - if (UseSubIdx) - UseDstReg = tri_->getSubReg(DstReg, UseSubIdx); + if (OldSubIdx) + UseDstReg = tri_->getSubReg(DstReg, OldSubIdx); O.setReg(UseDstReg); O.setSubReg(0); } else { - unsigned OldSubIdx = O.getSubReg(); // Sub-register indexes goes from small to large. e.g. // RAX: 0 -> AL, 1 -> AH, 2 -> AX, 3 -> EAX // EAX: 0 -> AL, 1 -> AH, 2 -> AX @@ -849,10 +848,20 @@ if (SrcIsPhys && isExtSubReg) { // r1024 = EXTRACT_SUBREG EAX, 0 then r1024 is really going to be // coalesced with AX. - SrcReg = tri_->getSubReg(SrcReg, SubIdx); + unsigned DstSubIdx = CopyMI->getOperand(0).getSubReg(); + assert(!DstSubIdx || DstSubIdx == SubIdx); + if (DstSubIdx != SubIdx) + // r1024<2> = EXTRACT_SUBREG EAX, 0. Then r1024 has already been + // coalesced to an INSERT_SUBREG so the subreg indices cancel out. + SrcReg = tri_->getSubReg(SrcReg, SubIdx); SubIdx = 0; } else if (DstIsPhys && isInsSubReg) { // EAX = INSERT_SUBREG EAX, r1024, 0 + unsigned SrcSubIdx = CopyMI->getOperand(2).getSubReg(); + assert(!SrcSubIdx || SrcSubIdx == SubIdx); + if (SrcSubIdx != SubIdx) + // EAX = INSERT_SUBREG EAX, r1024<2>, 0 Then r1024 has already been + // coalesced to an EXTRACT_SUBREG so the subreg indices cancel out. DstReg = tri_->getSubReg(DstReg, SubIdx); SubIdx = 0; } else if ((DstIsPhys && isExtSubReg) || (SrcIsPhys && isInsSubReg)) { Added: llvm/trunk/test/CodeGen/X86/2008-04-16-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-16-CoalescerBug.ll?rev=49832&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-16-CoalescerBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-04-16-CoalescerBug.ll Wed Apr 16 19:06:42 2008 @@ -0,0 +1,33 @@ +; RUN: llvm-as < %s | llc -march=x86 + +define void @Hubba(i8* %saveunder, i32 %firstBlob, i32 %select) nounwind { +entry: + br i1 false, label %bb53.us, label %bb53 +bb53.us: ; preds = %bb94.us, %bb53.us, %entry + switch i8 1, label %bb71.us [ + i8 0, label %bb53.us + i8 1, label %bb94.us + ] +bb94.us: ; preds = %bb71.us, %bb53.us + %result.0.us = phi i32 [ %tmp93.us, %bb71.us ], [ 0, %bb53.us ] ; [#uses=2] + %tmp101.us = lshr i32 %result.0.us, 3 ; [#uses=1] + %result.0163.us = trunc i32 %result.0.us to i16 ; [#uses=2] + shl i16 %result.0163.us, 7 ; :0 [#uses=1] + %tmp106.us = and i16 %0, -1024 ; [#uses=1] + shl i16 %result.0163.us, 2 ; :1 [#uses=1] + %tmp109.us = and i16 %1, -32 ; [#uses=1] + %tmp111112.us = trunc i32 %tmp101.us to i16 ; [#uses=1] + %tmp110.us = or i16 %tmp109.us, %tmp111112.us ; [#uses=1] + %tmp113.us = or i16 %tmp110.us, %tmp106.us ; [#uses=1] + store i16 %tmp113.us, i16* null, align 2 + br label %bb53.us +bb71.us: ; preds = %bb53.us + %tmp80.us = load i8* null, align 1 ; [#uses=1] + %tmp8081.us = zext i8 %tmp80.us to i32 ; [#uses=1] + %tmp87.us = mul i32 %tmp8081.us, 0 ; [#uses=1] + %tmp92.us = add i32 0, %tmp87.us ; [#uses=1] + %tmp93.us = udiv i32 %tmp92.us, 255 ; [#uses=1] + br label %bb94.us +bb53: ; preds = %entry + ret void +} From ggreif at gmail.com Wed Apr 16 19:28:25 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 00:28:25 -0000 Subject: [llvm-commits] [llvm] r49833 - /llvm/branches/ggreif/parallelized-test/ Message-ID: <200804170028.m3H0SPIE025850@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 19:28:25 2008 New Revision: 49833 URL: http://llvm.org/viewvc/llvm-project?rev=49833&view=rev Log: suppress .report files Modified: llvm/branches/ggreif/parallelized-test/ (props changed) Propchange: llvm/branches/ggreif/parallelized-test/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Apr 16 19:28:25 2008 @@ -2,3 +2,4 @@ *.sum site.exp site.bak +*.report From dpatel at apple.com Wed Apr 16 19:33:04 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Apr 2008 00:33:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49834 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h Message-ID: <200804170033.m3H0X4pV026241@zion.cs.uiuc.edu> Author: dpatel Date: Wed Apr 16 19:33:04 2008 New Revision: 49834 URL: http://llvm.org/viewvc/llvm-project?rev=49834&view=rev Log: _Complex deserves special treatement. 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=49834&r1=49833&r2=49834&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 Wed Apr 16 19:33:04 2008 @@ -151,6 +151,15 @@ #define LLVM_SHOULD_RETURN_VECTOR_AS_SHADOW(X,isBuiltin)\ llvm_x86_should_return_vector_as_shadow((X),(isBuiltin)) +extern bool +llvm_x86_should_not_return_complex_in_memory(tree type); + +/* LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY - A hook to allow + special _Complex handling. Return true if X should be returned using + multiple value return instruction. */ +#define LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY(X) \ + llvm_x86_should_not_return_complex_in_memory((X)) + extern bool llvm_x86_should_pass_aggregate_in_memory(tree, const Type *); #define LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(X, TY) \ 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=49834&r1=49833&r2=49834&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 Wed Apr 16 19:33:04 2008 @@ -900,12 +900,27 @@ return false; } +// llvm_x86_should_not_return_complex_in_memory - Return true if TYPE +// should be returned using multiple value return instruction. +bool llvm_x86_should_not_return_complex_in_memory(tree type) { + if (!TARGET_64BIT) + return false; + + if (AGGREGATE_TYPE_P(type)) { + tree field = TYPE_FIELDS(type); + if (field && TREE_CHAIN(field) == NULL + && TREE_CODE(TREE_TYPE(field)) == COMPLEX_TYPE) + return true; + } + return false; +} + // llvm_suitable_multiple_ret_value_type - Return TRUE if return value // of type TY should be returned using multiple value return instruction. static bool llvm_suitable_multiple_ret_value_type(const Type *Ty, tree TreeType) { //NOTE: Work in progress. Do not open the flood gate yet. - return false; + // return false; if (!TARGET_64BIT) return false; @@ -914,6 +929,9 @@ if (!STy) return false; + if (llvm_x86_should_not_return_complex_in_memory(TreeType)) + return true; + // llvm only accepts first class types for multiple values in ret instruction. bool foundNonInt = false; bool foundInt = false; @@ -922,7 +940,7 @@ const Type *ETy = STy->getElementType(i); if (const ArrayType *ATy = dyn_cast(ETy)) ETy = ATy->getElementType(); - if (!ETy->isFirstClassType()) + if (!ETy->isFirstClassType() && ETy->getTypeID() != Type::X86_FP80TyID) return false; if (!ETy->isInteger()) foundNonInt = true; @@ -987,8 +1005,15 @@ const StructType *STy = cast(Ty); unsigned NumElements = STy->getNumElements(); - std::vector ElementTypes; + + // Special handling for _Complex. + if (llvm_x86_should_not_return_complex_in_memory(type)) { + ElementTypes.push_back(Type::X86_FP80Ty); + ElementTypes.push_back(Type::X86_FP80Ty); + return StructType::get(ElementTypes, STy->isPacked()); + } + for (unsigned i = 0; i < NumElements; ++i) { const Type *T = STy->getElementType(i); @@ -1086,8 +1111,22 @@ ++RNO; ++SNO; continue; + } + // Special treatement for _Complex. + if (const StructType *ComplexType = dyn_cast(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(ElemType); unsigned ArraySize = ATy->getNumElements(); unsigned AElemNo = 0; @@ -1172,6 +1211,26 @@ ++DNO; ++SNO; continue; } + + // Special treatement for _Complex. + if (const StructType *ComplexType = dyn_cast(DestElemType)) { + llvm::Value *Idxs[3]; + Idxs[0] = ConstantInt::get(llvm::Type::Int32Ty, 0); + Idxs[1] = ConstantInt::get(llvm::Type::Int32Ty, DNO); + + 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); + ++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); + ++DNO; ++SNO; + continue; + } // Access array elements individually. Note, Src and Dest type may // not match. For example { <2 x float>, float } and { float[3]; } 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=49834&r1=49833&r2=49834&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Wed Apr 16 19:33:04 2008 @@ -104,6 +104,14 @@ TREE_CODE(type) == COMPLEX_TYPE; } +// LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY - A hook to allow +// special _Complex handling. Return true if X should be returned using +// multiple value return instruction. +#ifndef LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY +#define LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY(X) \ + false +#endif + // doNotUseShadowReturn - Return true if the specified GCC type // should not be returned using a pointer to struct parameter. static bool doNotUseShadowReturn(tree type, tree fndecl) { @@ -111,6 +119,9 @@ return false; if (TREE_CODE(TYPE_SIZE(type)) != INTEGER_CST) return false; + // LLVM says do no use shadow argument. + if (LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY(type)) + return true; // GCC says use shadow argument. if (aggregate_value_p(type, fndecl)) return false; From dpatel at apple.com Wed Apr 16 19:33:44 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Apr 2008 00:33:44 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49835 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804170033.m3H0XiQd026314@zion.cs.uiuc.edu> Author: dpatel Date: Wed Apr 16 19:33:44 2008 New Revision: 49835 URL: http://llvm.org/viewvc/llvm-project?rev=49835&view=rev Log: Not yet :) Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49835&r1=49834&r2=49835&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 Wed Apr 16 19:33:44 2008 @@ -920,7 +920,7 @@ static bool llvm_suitable_multiple_ret_value_type(const Type *Ty, tree TreeType) { //NOTE: Work in progress. Do not open the flood gate yet. - // return false; + return false; if (!TARGET_64BIT) return false; From ggreif at gmail.com Wed Apr 16 20:02:38 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 01:02:38 -0000 Subject: [llvm-commits] [llvm] r49837 - in /llvm/branches/ggreif/use-diet: include/llvm/Use.h include/llvm/Value.h lib/VMCore/Use.cpp Message-ID: <200804170102.m3H12clw028929@zion.cs.uiuc.edu> Author: ggreif Date: Wed Apr 16 20:02:37 2008 New Revision: 49837 URL: http://llvm.org/viewvc/llvm-project?rev=49837&view=rev Log: go forward and attack: drop Use::U Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/include/llvm/Value.h llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49837&r1=49836&r2=49837&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Wed Apr 16 20:02:37 2008 @@ -116,7 +116,6 @@ Use *getNext() const { return Next; } private: - User *U; Use *Next, **Prev; Value *Val; Modified: llvm/branches/ggreif/use-diet/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Value.h?rev=49837&r1=49836&r2=49837&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Value.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Value.h Wed Apr 16 20:02:37 2008 @@ -225,8 +225,6 @@ void Use::init(Value *V, User *user) { Val = transferTag(V); - U = user; - assert((!U || U == getUser()) && "Use::init discrepancy?"); if (V) V->addUse(*this); } Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49837&r1=49836&r2=49837&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Wed Apr 16 20:02:37 2008 @@ -57,7 +57,6 @@ while (Start != Stop) { --Stop; - Stop->U = 0; if (!Count) { Stop->Val = reinterpret_cast(Done == 0 ? fullStopTag : stopTag); ++Done; @@ -100,13 +99,12 @@ //===----------------------------------------------------------------------===// User *Use::getUser() const { - const Use* End = getImpliedUser(); + const Use *End = getImpliedUser(); User *She = static_cast(End - 1)->ref; She = extractTag(She) ? llvm::stripTag(She) : reinterpret_cast(const_cast(End)); - assert((!U || U == She) && "Implicit User differs?"); return She; } From scottm at aero.org Wed Apr 16 20:30:44 2008 From: scottm at aero.org (Scott Michel) Date: Thu, 17 Apr 2008 01:30:44 -0000 Subject: [llvm-commits] [llvm] r49838 - /llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Message-ID: <200804170130.m3H1UihD031528@zion.cs.uiuc.edu> Author: pingbak Date: Wed Apr 16 20:30:44 2008 New Revision: 49838 URL: http://llvm.org/viewvc/llvm-project?rev=49838&view=rev Log: Remove unused variable Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=49838&r1=49837&r2=49838&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Wed Apr 16 20:30:44 2008 @@ -104,7 +104,6 @@ // If AllowIdenticalEdges is true, then we allow this edge to be considered // non-critical iff all preds come from TI's block. while (I != E) { - pred_const_iterator E1 = E; if (*I != FirstPred) return true; // Note: leave this as is until no one ever compiles with either gcc 4.0.1 From gohman at apple.com Wed Apr 16 21:09:26 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Apr 2008 02:09:26 -0000 Subject: [llvm-commits] [llvm] r49839 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200804170209.m3H29Qjj002220@zion.cs.uiuc.edu> Author: djg Date: Wed Apr 16 21:09:26 2008 New Revision: 49839 URL: http://llvm.org/viewvc/llvm-project?rev=49839&view=rev Log: Correct the SrcValue information in the Expand code for va_copy. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=49839&r1=49838&r2=49839&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Apr 16 21:09:26 2008 @@ -3283,8 +3283,8 @@ // output, returning the chain. const Value *VD = cast(Node->getOperand(3))->getValue(); const Value *VS = cast(Node->getOperand(4))->getValue(); - Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, VD, 0); - Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, VS, 0); + Tmp4 = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp3, VS, 0); + Result = DAG.getStore(Tmp4.getValue(1), Tmp4, Tmp2, VD, 0); break; } break; From criswell at uiuc.edu Wed Apr 16 21:43:56 2008 From: criswell at uiuc.edu (John Criswell) Date: Thu, 17 Apr 2008 02:43:56 -0000 Subject: [llvm-commits] [poolalloc] r49840 - /poolalloc/branches/SVA/include/dsa/DSNode.h Message-ID: <200804170243.m3H2hu9c004962@zion.cs.uiuc.edu> Author: criswell Date: Wed Apr 16 21:43:56 2008 New Revision: 49840 URL: http://llvm.org/viewvc/llvm-project?rev=49840&view=rev Log: Test for the correct flag in isIONode() method. Modified: poolalloc/branches/SVA/include/dsa/DSNode.h Modified: poolalloc/branches/SVA/include/dsa/DSNode.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/branches/SVA/include/dsa/DSNode.h?rev=49840&r1=49839&r2=49840&view=diff ============================================================================== --- poolalloc/branches/SVA/include/dsa/DSNode.h (original) +++ poolalloc/branches/SVA/include/dsa/DSNode.h Wed Apr 16 21:43:56 2008 @@ -420,7 +420,7 @@ bool isComplete() const { return !isIncomplete(); } bool isDeadNode() const { return NodeType & DEAD; } bool isExternalNode() const { return NodeType & External; } - bool isIONode() const { return IONode & External; } + bool isIONode() const { return NodeType & IONode; } DSNode *setAllocaNodeMarker() { NodeType |= AllocaNode; return this; } DSNode *setHeapNodeMarker() { NodeType |= HeapNode; return this; } From isanbard at gmail.com Thu Apr 17 00:20:39 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Apr 2008 05:20:39 -0000 Subject: [llvm-commits] [llvm] r49841 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200804170520.m3H5Kdou016337@zion.cs.uiuc.edu> Author: void Date: Thu Apr 17 00:20:39 2008 New Revision: 49841 URL: http://llvm.org/viewvc/llvm-project?rev=49841&view=rev Log: Use correct name for method in comment. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49841&r1=49840&r2=49841&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Apr 17 00:20:39 2008 @@ -613,10 +613,10 @@ } } -/// ShortenDeadCopyLiveRange - Shorten a live range as it's artificially -/// extended by a dead copy. Mark the last use (if any) of the val# as kill -/// as ends the live range there. If there isn't another use, then this -/// live range is dead. Return true if live interval is removed. +/// ShortenDeadCopySrcLiveRange - Shorten a live range as it's artificially +/// extended by a dead copy. Mark the last use (if any) of the val# as kill as +/// ends the live range there. If there isn't another use, then this live range +/// is dead. Return true if live interval is removed. bool SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI) { From resistor at mac.com Thu Apr 17 00:36:50 2008 From: resistor at mac.com (Owen Anderson) Date: Thu, 17 Apr 2008 05:36:50 -0000 Subject: [llvm-commits] [llvm] r49842 - in /llvm/trunk: lib/Analysis/MemoryDependenceAnalysis.cpp lib/Transforms/Scalar/GVN.cpp test/Analysis/BasicAA/const-dce.ll test/Analysis/BasicAA/pure-const-dce.ll Message-ID: <200804170536.m3H5aorc016729@zion.cs.uiuc.edu> Author: resistor Date: Thu Apr 17 00:36:50 2008 New Revision: 49842 URL: http://llvm.org/viewvc/llvm-project?rev=49842&view=rev Log: Make GVN able to remove unnecessary calls to read-only functions again. Added: llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll Removed: llvm/trunk/test/Analysis/BasicAA/const-dce.ll Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=49842&r1=49841&r2=49842&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Thu Apr 17 00:36:50 2008 @@ -134,8 +134,7 @@ } else if (isa(QI)) { AliasAnalysis::ModRefBehavior result = AA.getModRefBehavior(CallSite::get(QI)); - if (result != AliasAnalysis::DoesNotAccessMemory && - result != AliasAnalysis::OnlyReadsMemory) { + if (result != AliasAnalysis::DoesNotAccessMemory) { if (!start && !block) { cachedResult.first = QI; cachedResult.second = true; Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=49842&r1=49841&r2=49842&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Apr 17 00:36:50 2008 @@ -135,6 +135,7 @@ DenseMap valueNumbering; DenseMap expressionNumbering; AliasAnalysis* AA; + MemoryDependenceAnalysis* MD; uint32_t nextValueNumber; @@ -159,6 +160,7 @@ void erase(Value* v); unsigned size(); void setAliasAnalysis(AliasAnalysis* A) { AA = A; } + void setMemDep(MemoryDependenceAnalysis* M) { MD = M; } }; } @@ -432,6 +434,33 @@ return nextValueNumber++; } + } else if (AA->onlyReadsMemory(C)) { + Expression e = create_expression(C); + + Instruction* dep = MD->getDependency(C); + + if (dep == MemoryDependenceAnalysis::NonLocal || + !isa(dep)) { + expressionNumbering.insert(std::make_pair(e, nextValueNumber)); + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + + return nextValueNumber++; + } + + CallInst* cdep = cast(dep); + Expression d_exp = create_expression(cdep); + + if (e != d_exp) { + expressionNumbering.insert(std::make_pair(e, nextValueNumber)); + valueNumbering.insert(std::make_pair(V, nextValueNumber)); + + return nextValueNumber++; + } else { + uint32_t v = expressionNumbering[d_exp]; + valueNumbering.insert(std::make_pair(V, v)); + return v; + } + } else { valueNumbering.insert(std::make_pair(V, nextValueNumber)); return nextValueNumber++; @@ -993,22 +1022,6 @@ } else if (currAvail.test(num)) { Value* repl = find_leader(currAvail, num); - if (CallInst* CI = dyn_cast(I)) { - AliasAnalysis& AA = getAnalysis(); - if (!AA.doesNotAccessMemory(CI)) { - MemoryDependenceAnalysis& MD = getAnalysis(); - if (cast(repl)->getParent() != CI->getParent() || - MD.getDependency(CI) != MD.getDependency(cast(repl))) { - // There must be an intervening may-alias store, so nothing from - // this point on will be able to be replaced with the preceding call - currAvail.erase(repl); - currAvail.insert(I); - - return false; - } - } - } - // Remove it! MemoryDependenceAnalysis& MD = getAnalysis(); MD.removeInstruction(I); @@ -1030,6 +1043,7 @@ // bool GVN::runOnFunction(Function& F) { VN.setAliasAnalysis(&getAnalysis()); + VN.setMemDep(&getAnalysis()); bool changed = false; bool shouldContinue = true; Removed: llvm/trunk/test/Analysis/BasicAA/const-dce.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/const-dce.ll?rev=49841&view=auto ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/const-dce.ll (original) +++ llvm/trunk/test/Analysis/BasicAA/const-dce.ll (removed) @@ -1,33 +0,0 @@ -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst | count 2 -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure | count 4 -; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone | count 4 - at g = global i32 0 ; [#uses=1] - -define i32 @test() { -entry: - %tmp0 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] - %tmp1 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] - %tmp2 = call i32 @TestNone( i32 7 ) ; [#uses=1] - store i32 1, i32* @g - %tmp3 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] - %tmp4 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] - %tmp5 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] - %tmp6 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] - %tmp7 = call i32 @TestNone( i32 7 ) ; [#uses=1] - %tmp8 = call i32 @TestNone( i32 7 ) ; [#uses=1] - %sum0 = add i32 %tmp0, %tmp1 ; [#uses=1] - %sum1 = add i32 %sum0, %tmp2 ; [#uses=1] - %sum2 = add i32 %sum1, %tmp3 ; [#uses=1] - %sum3 = add i32 %sum2, %tmp4 ; [#uses=1] - %sum4 = add i32 %sum3, %tmp5 ; [#uses=1] - %sum5 = add i32 %sum4, %tmp6 ; [#uses=1] - %sum6 = add i32 %sum5, %tmp7 ; [#uses=1] - %sum7 = add i32 %sum6, %tmp8 ; [#uses=1] - ret i32 %sum7 -} - -declare i32 @TestConst(i32) readnone - -declare i32 @TestPure(i32) readonly - -declare i32 @TestNone(i32) Added: llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll?rev=49842&view=auto ============================================================================== --- llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll (added) +++ llvm/trunk/test/Analysis/BasicAA/pure-const-dce.ll Thu Apr 17 00:36:50 2008 @@ -0,0 +1,33 @@ +; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestConst | count 2 +; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestPure | count 3 +; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep TestNone | count 4 + at g = global i32 0 ; [#uses=1] + +define i32 @test() { +entry: + %tmp0 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] + %tmp1 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] + %tmp2 = call i32 @TestNone( i32 7 ) ; [#uses=1] + store i32 1, i32* @g + %tmp3 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] + %tmp4 = call i32 @TestConst( i32 5 ) readnone ; [#uses=1] + %tmp5 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] + %tmp6 = call i32 @TestPure( i32 6 ) readonly ; [#uses=1] + %tmp7 = call i32 @TestNone( i32 7 ) ; [#uses=1] + %tmp8 = call i32 @TestNone( i32 7 ) ; [#uses=1] + %sum0 = add i32 %tmp0, %tmp1 ; [#uses=1] + %sum1 = add i32 %sum0, %tmp2 ; [#uses=1] + %sum2 = add i32 %sum1, %tmp3 ; [#uses=1] + %sum3 = add i32 %sum2, %tmp4 ; [#uses=1] + %sum4 = add i32 %sum3, %tmp5 ; [#uses=1] + %sum5 = add i32 %sum4, %tmp6 ; [#uses=1] + %sum6 = add i32 %sum5, %tmp7 ; [#uses=1] + %sum7 = add i32 %sum6, %tmp8 ; [#uses=1] + ret i32 %sum7 +} + +declare i32 @TestConst(i32) readnone + +declare i32 @TestPure(i32) readonly + +declare i32 @TestNone(i32) From baldrick at free.fr Thu Apr 17 02:48:41 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Apr 2008 09:48:41 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r49834 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h In-Reply-To: <200804170033.m3H0X4pV026241@zion.cs.uiuc.edu> References: <200804170033.m3H0X4pV026241@zion.cs.uiuc.edu> Message-ID: <200804170948.41974.baldrick@free.fr> Hi Devang, > //NOTE: Work in progress. Do not open the flood gate yet. > - return false; > + // return false; did you mean to open the floodgate? :) > + // LLVM says do no use shadow argument. do no use -> do not use Ciao, Duncan. From evan.cheng at apple.com Thu Apr 17 02:58:05 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Apr 2008 07:58:05 -0000 Subject: [llvm-commits] [llvm] r49843 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2008-04-17-CoalescerBug.ll Message-ID: <200804170758.m3H7w5XT028207@zion.cs.uiuc.edu> Author: evancheng Date: Thu Apr 17 02:58:04 2008 New Revision: 49843 URL: http://llvm.org/viewvc/llvm-project?rev=49843&view=rev Log: Be more careful with insert_subreg and extract_subreg where either source or destination operand has already been coalesced with another register that's defined by a insert_subreg or extract_subreg. Added: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49843&r1=49842&r2=49843&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Thu Apr 17 02:58:04 2008 @@ -849,20 +849,28 @@ // r1024 = EXTRACT_SUBREG EAX, 0 then r1024 is really going to be // coalesced with AX. unsigned DstSubIdx = CopyMI->getOperand(0).getSubReg(); - assert(!DstSubIdx || DstSubIdx == SubIdx); - if (DstSubIdx != SubIdx) - // r1024<2> = EXTRACT_SUBREG EAX, 0. Then r1024 has already been - // coalesced to an INSERT_SUBREG so the subreg indices cancel out. + if (DstSubIdx) { + // r1024<2> = EXTRACT_SUBREG EAX, 2. Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + if (DstSubIdx != SubIdx) { + DOUT << "\t Sub-register indices mismatch.\n"; + return false; // Not coalescable. + } + } else SrcReg = tri_->getSubReg(SrcReg, SubIdx); SubIdx = 0; } else if (DstIsPhys && isInsSubReg) { // EAX = INSERT_SUBREG EAX, r1024, 0 unsigned SrcSubIdx = CopyMI->getOperand(2).getSubReg(); - assert(!SrcSubIdx || SrcSubIdx == SubIdx); - if (SrcSubIdx != SubIdx) - // EAX = INSERT_SUBREG EAX, r1024<2>, 0 Then r1024 has already been - // coalesced to an EXTRACT_SUBREG so the subreg indices cancel out. - DstReg = tri_->getSubReg(DstReg, SubIdx); + if (SrcSubIdx) { + // EAX = INSERT_SUBREG EAX, r1024<2>, 2 Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + if (SrcSubIdx != SubIdx) { + DOUT << "\t Sub-register indices mismatch.\n"; + return false; // Not coalescable. + } + } else + DstReg = tri_->getSubReg(DstReg, SubIdx); SubIdx = 0; } else if ((DstIsPhys && isExtSubReg) || (SrcIsPhys && isInsSubReg)) { // If this is a extract_subreg where dst is a physical register, e.g. @@ -870,6 +878,11 @@ // then create and update the actual physical register allocated to RHS. // Ditto for // reg1024 = INSERT_SUBREG r1024, cl, 1 + if (CopyMI->getOperand(1).getSubReg()) { + DOUT << "\tSrc of extract_ / insert_subreg already coalesced with reg" + << " of a super-class.\n"; + return false; // Not coalescable. + } const TargetRegisterClass *RC = mri_->getRegClass(isExtSubReg ? SrcReg : DstReg); if (isExtSubReg) { @@ -899,24 +912,38 @@ } SubIdx = 0; } else { - unsigned LargeReg = isExtSubReg ? SrcReg : DstReg; - unsigned SmallReg = isExtSubReg ? DstReg : SrcReg; - unsigned LargeRegSize = - li_->getInterval(LargeReg).getSize() / InstrSlots::NUM; - unsigned SmallRegSize = - li_->getInterval(SmallReg).getSize() / InstrSlots::NUM; - const TargetRegisterClass *RC = mri_->getRegClass(SmallReg); - unsigned Threshold = allocatableRCRegs_[RC].count(); - // Be conservative. If both sides are virtual registers, do not coalesce - // if this will cause a high use density interval to target a smaller set - // of registers. - if (SmallRegSize > Threshold || LargeRegSize > Threshold) { - LiveVariables::VarInfo &svi = lv_->getVarInfo(LargeReg); - LiveVariables::VarInfo &dvi = lv_->getVarInfo(SmallReg); - if ((float)dvi.NumUses / SmallRegSize < - (float)svi.NumUses / LargeRegSize) { - Again = true; // May be possible to coalesce later. - return false; + unsigned OldSubIdx = isExtSubReg ? CopyMI->getOperand(0).getSubReg() + : CopyMI->getOperand(2).getSubReg(); + if (OldSubIdx) { + if (OldSubIdx == SubIdx) + // r1024<2> = EXTRACT_SUBREG r1025, 2. Then r1024 has already been + // coalesced to a larger register so the subreg indices cancel out. + SubIdx = 0; + else { + DOUT << "\t Sub-register indices mismatch.\n"; + return false; // Not coalescable. + } + } + if (SubIdx) { + unsigned LargeReg = isExtSubReg ? SrcReg : DstReg; + unsigned SmallReg = isExtSubReg ? DstReg : SrcReg; + unsigned LargeRegSize = + li_->getInterval(LargeReg).getSize() / InstrSlots::NUM; + unsigned SmallRegSize = + li_->getInterval(SmallReg).getSize() / InstrSlots::NUM; + const TargetRegisterClass *RC = mri_->getRegClass(SmallReg); + unsigned Threshold = allocatableRCRegs_[RC].count(); + // Be conservative. If both sides are virtual registers, do not coalesce + // if this will cause a high use density interval to target a smaller + // set of registers. + if (SmallRegSize > Threshold || LargeRegSize > Threshold) { + LiveVariables::VarInfo &svi = lv_->getVarInfo(LargeReg); + LiveVariables::VarInfo &dvi = lv_->getVarInfo(SmallReg); + if ((float)dvi.NumUses / SmallRegSize < + (float)svi.NumUses / LargeRegSize) { + Again = true; // May be possible to coalesce later. + return false; + } } } } Added: llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll?rev=49843&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-04-17-CoalescerBug.ll Thu Apr 17 02:58:04 2008 @@ -0,0 +1,171 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin | grep xorl | grep {%e} +; Make sure xorl operands are 32-bit registers. + + %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* } + %struct.wxDateTime = type { %struct.wxLongLong } + %"struct.wxDateTime::TimeZone" = type { i32 } + %struct.wxLongLong = type { i64 } + %struct.wxString = type { %struct.wxStringBase } + %struct.wxStringBase = type { i32* } + at .str = external constant [27 x i32] ; <[27 x i32]*> [#uses=1] + at .str4 = external constant [14 x i32] ; <[14 x i32]*> [#uses=1] + at _ZZNK10wxDateTime5GetTmERKNS_8TimeZoneEE12__FUNCTION__ = external constant [6 x i8] ; <[6 x i8]*> [#uses=1] + at .str33 = external constant [29 x i32] ; <[29 x i32]*> [#uses=1] + at .str89 = external constant [5 x i32] ; <[5 x i32]*> [#uses=1] + +define void @_ZNK10wxDateTime6FormatEPKwRKNS_8TimeZoneE(%struct.wxString* noalias sret %agg.result, %struct.wxDateTime* %this, i32* %format, %"struct.wxDateTime::TimeZone"* %tz) { +entry: + br i1 false, label %bb116.i, label %bb115.critedge.i +bb115.critedge.i: ; preds = %entry + ret void +bb116.i: ; preds = %entry + br i1 false, label %bb52.i.i, label %bb3118 +bb3118: ; preds = %bb116.i + ret void +bb52.i.i: ; preds = %bb116.i + br i1 false, label %bb142.i, label %bb115.critedge.i.i +bb115.critedge.i.i: ; preds = %bb52.i.i + ret void +bb142.i: ; preds = %bb52.i.i + br i1 false, label %bb161.i, label %bb182.i +bb161.i: ; preds = %bb142.i + br label %bb3261 +bb182.i: ; preds = %bb142.i + ret void +bb3261: ; preds = %bb7834, %bb161.i + %tmp3263 = load i32* null, align 4 ; [#uses=1] + %tmp3264 = icmp eq i32 %tmp3263, 37 ; [#uses=1] + br i1 %tmp3264, label %bb3306, label %bb3267 +bb3267: ; preds = %bb3261 + ret void +bb3306: ; preds = %bb3261 + %tmp3310 = invoke %struct.wxStringBase* @_ZN12wxStringBaseaSEPKw( %struct.wxStringBase* null, i32* getelementptr ([5 x i32]* @.str89, i32 0, i32 0) ) + to label %bb3314 unwind label %lpad ; <%struct.wxStringBase*> [#uses=0] +bb3314: ; preds = %bb3306 + %tmp3316 = load i32* null, align 4 ; [#uses=1] + switch i32 %tmp3316, label %bb7595 [ + i32 0, label %bb7819 + i32 37, label %bb7806 + i32 66, label %bb3477 + i32 72, label %bb5334 + i32 73, label %bb5484 + i32 77, label %bb6118 + i32 83, label %bb6406 + i32 85, label %bb6556 + i32 87, label %bb6708 + i32 89, label %bb7308 + i32 98, label %bb3477 + i32 99, label %bb3626 + i32 100, label %bb5184 + i32 106, label %bb5657 + i32 108, label %bb5809 + i32 109, label %bb5968 + i32 119, label %bb6860 + i32 120, label %bb3626 + i32 121, label %bb7158 + ] +bb3477: ; preds = %bb3314, %bb3314 + ret void +bb3626: ; preds = %bb3314, %bb3314 + ret void +bb5184: ; preds = %bb3314 + ret void +bb5334: ; preds = %bb3314 + ret void +bb5484: ; preds = %bb3314 + ret void +bb5657: ; preds = %bb3314 + %tmp5661 = invoke i16 @_ZNK10wxDateTime12GetDayOfYearERKNS_8TimeZoneE( %struct.wxDateTime* %this, %"struct.wxDateTime::TimeZone"* %tz ) zeroext + to label %invcont5660 unwind label %lpad ; [#uses=0] +invcont5660: ; preds = %bb5657 + ret void +bb5809: ; preds = %bb3314 + %tmp61.i.i8486 = icmp sgt i64 0, -1 ; [#uses=1] + %tmp95.i.i8490 = icmp slt i64 0, 2147483647000 ; [#uses=1] + %bothcond9308 = and i1 %tmp61.i.i8486, %tmp95.i.i8490 ; [#uses=1] + br i1 %bothcond9308, label %bb91.i8504, label %bb115.critedge.i.i8492 +bb115.critedge.i.i8492: ; preds = %bb5809 + ret void +bb91.i8504: ; preds = %bb5809 + br i1 false, label %bb155.i8541, label %bb182.i8560 +bb155.i8541: ; preds = %bb91.i8504 + %tmp156.i85398700 = invoke %struct.tm* @gmtime_r( i32* null, %struct.tm* null ) + to label %bb182.i8560 unwind label %lpad ; <%struct.tm*> [#uses=1] +bb182.i8560: ; preds = %bb155.i8541, %bb91.i8504 + %tm48.0.i8558 = phi %struct.tm* [ null, %bb91.i8504 ], [ %tmp156.i85398700, %bb155.i8541 ] ; <%struct.tm*> [#uses=0] + br i1 false, label %bb278.i8617, label %bb187.i8591 +bb187.i8591: ; preds = %bb182.i8560 + %tmp245.i8588 = srem i64 0, 86400000 ; [#uses=1] + br i1 false, label %bb264.i8592, label %bb265.i8606 +bb264.i8592: ; preds = %bb187.i8591 + ret void +bb265.i8606: ; preds = %bb187.i8591 + %tmp268269.i8593 = trunc i64 %tmp245.i8588 to i32 ; [#uses=1] + %tmp273.i8594 = srem i32 %tmp268269.i8593, 1000 ; [#uses=1] + %tmp273274.i8595 = trunc i32 %tmp273.i8594 to i16 ; [#uses=1] + br label %invcont5814 +bb278.i8617: ; preds = %bb182.i8560 + %timeOnly50.0.i8622 = add i32 0, 0 ; [#uses=1] + br i1 false, label %bb440.i8663, label %bb448.i8694 +bb440.i8663: ; preds = %bb278.i8617 + invoke void @_Z10wxOnAssertPKwiPKcS0_S0_( i32* getelementptr ([27 x i32]* @.str, i32 0, i32 0), i32 1717, i8* getelementptr ([6 x i8]* @_ZZNK10wxDateTime5GetTmERKNS_8TimeZoneEE12__FUNCTION__, i32 0, i32 0), i32* getelementptr ([29 x i32]* @.str33, i32 0, i32 0), i32* getelementptr ([14 x i32]* @.str4, i32 0, i32 0) ) + to label %bb448.i8694 unwind label %lpad +bb448.i8694: ; preds = %bb440.i8663, %bb278.i8617 + %tmp477.i8669 = srem i32 %timeOnly50.0.i8622, 1000 ; [#uses=1] + %tmp477478.i8670 = trunc i32 %tmp477.i8669 to i16 ; [#uses=1] + br label %invcont5814 +invcont5814: ; preds = %bb448.i8694, %bb265.i8606 + %tmp812.0.0 = phi i16 [ %tmp477478.i8670, %bb448.i8694 ], [ %tmp273274.i8595, %bb265.i8606 ] ; [#uses=1] + %tmp58165817 = zext i16 %tmp812.0.0 to i32 ; [#uses=1] + invoke void (%struct.wxString*, i32*, ...)* @_ZN8wxString6FormatEPKwz( %struct.wxString* noalias sret null, i32* null, i32 %tmp58165817 ) + to label %invcont5831 unwind label %lpad +invcont5831: ; preds = %invcont5814 + %tmp5862 = invoke i8 @_ZN12wxStringBase10ConcatSelfEmPKwm( %struct.wxStringBase* null, i32 0, i32* null, i32 0 ) zeroext + to label %bb7834 unwind label %lpad8185 ; [#uses=0] +bb5968: ; preds = %bb3314 + invoke void (%struct.wxString*, i32*, ...)* @_ZN8wxString6FormatEPKwz( %struct.wxString* noalias sret null, i32* null, i32 0 ) + to label %invcont5981 unwind label %lpad +invcont5981: ; preds = %bb5968 + ret void +bb6118: ; preds = %bb3314 + ret void +bb6406: ; preds = %bb3314 + ret void +bb6556: ; preds = %bb3314 + ret void +bb6708: ; preds = %bb3314 + ret void +bb6860: ; preds = %bb3314 + ret void +bb7158: ; preds = %bb3314 + ret void +bb7308: ; preds = %bb3314 + ret void +bb7595: ; preds = %bb3314 + ret void +bb7806: ; preds = %bb3314 + %tmp7814 = invoke %struct.wxStringBase* @_ZN12wxStringBase6appendEmw( %struct.wxStringBase* null, i32 1, i32 0 ) + to label %bb7834 unwind label %lpad ; <%struct.wxStringBase*> [#uses=0] +bb7819: ; preds = %bb3314 + ret void +bb7834: ; preds = %bb7806, %invcont5831 + br label %bb3261 +lpad: ; preds = %bb7806, %bb5968, %invcont5814, %bb440.i8663, %bb155.i8541, %bb5657, %bb3306 + ret void +lpad8185: ; preds = %invcont5831 + ret void +} + +declare void @_Z10wxOnAssertPKwiPKcS0_S0_(i32*, i32, i8*, i32*, i32*) + +declare i8 @_ZN12wxStringBase10ConcatSelfEmPKwm(%struct.wxStringBase*, i32, i32*, i32) zeroext + +declare %struct.tm* @gmtime_r(i32*, %struct.tm*) + +declare i16 @_ZNK10wxDateTime12GetDayOfYearERKNS_8TimeZoneE(%struct.wxDateTime*, %"struct.wxDateTime::TimeZone"*) zeroext + +declare %struct.wxStringBase* @_ZN12wxStringBase6appendEmw(%struct.wxStringBase*, i32, i32) + +declare %struct.wxStringBase* @_ZN12wxStringBaseaSEPKw(%struct.wxStringBase*, i32*) + +declare void @_ZN8wxString6FormatEPKwz(%struct.wxString* noalias sret , i32*, ...) From romix.llvm at googlemail.com Thu Apr 17 04:29:49 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Thu, 17 Apr 2008 09:29:49 -0000 Subject: [llvm-commits] [llvm] r49844 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200804170929.m3H9TngL002515@zion.cs.uiuc.edu> Author: romix Date: Thu Apr 17 04:29:48 2008 New Revision: 49844 URL: http://llvm.org/viewvc/llvm-project?rev=49844&view=rev Log: Minor clean-up based on Dan's comments. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49844&r1=49843&r2=49844&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Apr 17 04:29:48 2008 @@ -879,25 +879,17 @@ /// the SDOperand. class SDUse { SDOperand Operand; - /// parent - Parent node of this operand. - SDNode *parent; + /// User - Parent node of this operand. + SDNode *User; /// Prev, next - Pointers to the uses list of the SDNode referred by /// this operand. SDUse **Prev, *Next; public: friend class SDNode; - SDUse(): Operand(), parent(NULL), Prev(NULL), Next(NULL) {} + SDUse(): Operand(), User(NULL), Prev(NULL), Next(NULL) {} SDUse(SDNode *val, unsigned resno) : - Operand(val,resno), parent(NULL), Prev(NULL), Next(NULL) {} - - - SDUse& operator= (SDOperand& Op) { - Operand = Op; - Next = NULL; - Prev = NULL; - return *this; - } + Operand(val,resno), User(NULL), Prev(NULL), Next(NULL) {} SDUse& operator= (const SDOperand& Op) { Operand = Op; @@ -906,13 +898,6 @@ return *this; } - SDUse& operator= (SDUse& Op) { - Operand = Op; - Next = NULL; - Prev = NULL; - return *this; - } - SDUse& operator= (const SDUse& Op) { Operand = Op; Next = NULL; @@ -922,9 +907,9 @@ SDUse * getNext() { return Next; } - SDNode *getUser() { return parent; } + SDNode *getUser() { return User; } - void setUser(SDNode *p) { parent = p; } + void setUser(SDNode *p) { User = p; } operator SDOperand() const { return Operand; } @@ -975,7 +960,7 @@ }; -/// SDOperandPtr - A helper SDOperand poiner class, that can handle +/// SDOperandPtr - A helper SDOperand pointer class, that can handle /// arrays of SDUse and arrays of SDOperand objects. This is required /// in many places inside the SelectionDAG. /// From ggreif at gmail.com Thu Apr 17 05:16:39 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 10:16:39 -0000 Subject: [llvm-commits] [llvm] r49845 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804171016.m3HAGdhg003864@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 05:16:38 2008 New Revision: 49845 URL: http://llvm.org/viewvc/llvm-project?rev=49845&view=rev Log: massage output to appear like before Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49845&r1=49844&r2=49845&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Thu Apr 17 05:16:38 2008 @@ -63,20 +63,34 @@ @ cat $^ %.report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) - @ cat $^ | grep "^$(basename $@): " | wc -l | xargs echo "$(basename $@):" | (grep -v ': 0' ; true) > $@ + @ cat $^ \ + | grep "^$(basename $@): " \ + | wc -l \ + | xargs echo "$(basename $@):" \ + | (grep -v ': 0$$' ; true) > $@ .PHONY: report +PRETTIFY-DEJA = sed \ + -e 's/Running /Preparing /1' \ + -e 's/ === Summary ===/--- Running llvm tests ---/1' \ + -e 's/ === /--- Running /1' \ + -e 's/ Summary ===/ tests ---/1' + +PRETTIFY-REPORT = sed \ + -e 's|XPASS: |\# of unexpected successes |1' \ + -e 's|PASS: |\# of expected passes |1' \ + -e 's|XFAIL: |\# of expected failures |1' \ + -e 's|FAIL: |\# of unexpected failures |1' + check-local:: site.exp - @ ( ulimit -t 600 ; ulimit -d 512000 ; \ - PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ - $(RUNTEST) $(RUNTESTFLAGS) ) | sed -e 's/Running /Preparing /1' - @ echo '--- Running llvm tests ---' + @ ( PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ + $(RUNTEST) $(RUNTESTFLAGS) ) | $(PRETTIFY-DEJA) @ ( ulimit -t 600 ; ulimit -d 512000 ; \ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile))) @ $(DONE) @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make PASS.report FAIL.report XPASS.report XFAIL.report - @ cat PASS.report FAIL.report XPASS.report XFAIL.report + @ cat PASS.report FAIL.report XPASS.report XFAIL.report | $(PRETTIFY-REPORT) else check-local:: site.exp @echo "*** dejagnu not found. Make sure runtest is in your PATH, then reconfigure llvm." From ggreif at gmail.com Thu Apr 17 05:54:43 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 10:54:43 -0000 Subject: [llvm-commits] [llvm] r49846 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804171054.m3HAsmq6005013@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 05:54:31 2008 New Revision: 49846 URL: http://llvm.org/viewvc/llvm-project?rev=49846&view=rev Log: output is almost perfect now. starting to understand sed :-) Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49846&r1=49845&r2=49846&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Thu Apr 17 05:54:31 2008 @@ -72,16 +72,15 @@ .PHONY: report PRETTIFY-DEJA = sed \ - -e 's/Running /Preparing /1' \ + -e 's/Running \(.*\) \.\.\./Preparing \1 .../1' \ -e 's/ === Summary ===/--- Running llvm tests ---/1' \ - -e 's/ === /--- Running /1' \ - -e 's/ Summary ===/ tests ---/1' + -e 's/ === \(.*\) Summary ===/--- Running \1 tests ---/1' PRETTIFY-REPORT = sed \ - -e 's|XPASS: |\# of unexpected successes |1' \ - -e 's|PASS: |\# of expected passes |1' \ - -e 's|XFAIL: |\# of expected failures |1' \ - -e 's|FAIL: |\# of unexpected failures |1' + -e 's/XPASS: /\# of unexpected successes /1' \ + -e 's/PASS: /\# of expected passes /1' \ + -e 's/XFAIL: /\# of expected failures /1' \ + -e 's/FAIL: /\# of unexpected failures /1' check-local:: site.exp @ ( PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ @@ -90,6 +89,9 @@ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile))) @ $(DONE) @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make PASS.report FAIL.report XPASS.report XFAIL.report + @ echo + @ echo " === $(TESTDIRS) Summary ===" + @ echo @ cat PASS.report FAIL.report XPASS.report XFAIL.report | $(PRETTIFY-REPORT) else check-local:: site.exp From ggreif at gmail.com Thu Apr 17 06:30:45 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 11:30:45 -0000 Subject: [llvm-commits] [llvm] r49847 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804171130.m3HBUl3F006019@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 06:30:38 2008 New Revision: 49847 URL: http://llvm.org/viewvc/llvm-project?rev=49847&view=rev Log: be less chatty in non-verbose mode. style more uniform now Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49847&r1=49846&r2=49847&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Thu Apr 17 06:30:38 2008 @@ -52,8 +52,10 @@ ifdef VERBOSE DONE = true +PREPARATION = -e 's/Running \(.*\) \.\.\./Preparing \1 .../1' else DONE = echo +PREPARATION = -e '/Running \(.*\) \.\.\./d' endif %.makefile.out: %.makefile @@ -72,9 +74,9 @@ .PHONY: report PRETTIFY-DEJA = sed \ - -e 's/Running \(.*\) \.\.\./Preparing \1 .../1' \ - -e 's/ === Summary ===/--- Running llvm tests ---/1' \ - -e 's/ === \(.*\) Summary ===/--- Running \1 tests ---/1' + $(PREPARATION) \ + -e 's/ === Summary ===/ === Running llvm tests ===/1' \ + -e 's/ === \(.*\) Summary ===/ === Running \1 tests ===/1' PRETTIFY-REPORT = sed \ -e 's/XPASS: /\# of unexpected successes /1' \ From baldrick at free.fr Thu Apr 17 07:03:51 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 17 Apr 2008 12:03:51 -0000 Subject: [llvm-commits] [llvm] r49848 - /llvm/trunk/tools/opt/opt.cpp Message-ID: <200804171203.m3HC3r8f006939@zion.cs.uiuc.edu> Author: baldrick Date: Thu Apr 17 07:03:38 2008 New Revision: 49848 URL: http://llvm.org/viewvc/llvm-project?rev=49848&view=rev Log: Run SimplifyLibCalls near the beginning, not at the end. It is now run at the same moment as in llvm-gcc. Also, run StripDeadPrototypes at the end, just before running DeadTypeElimination. This may be useful when doing LTO. Note that llvm-gcc runs StripDeadPrototypes but not DeadTypeElimination. Modified: llvm/trunk/tools/opt/opt.cpp Modified: llvm/trunk/tools/opt/opt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=49848&r1=49847&r2=49848&view=diff ============================================================================== --- llvm/trunk/tools/opt/opt.cpp (original) +++ llvm/trunk/tools/opt/opt.cpp Thu Apr 17 07:03:38 2008 @@ -262,6 +262,7 @@ if (!DisableInline) addPass(PM, createFunctionInliningPass()); // Inline small functions + addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations addPass(PM, createArgumentPromotionPass()); // Scalarize uninlined fn args addPass(PM, createTailDuplicationPass()); // Simplify cfg by copying code @@ -294,7 +295,7 @@ addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores addPass(PM, createAggressiveDCEPass()); // SSA based 'Aggressive DCE' addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations + addPass(PM, createStripDeadPrototypesPass()); // Get rid of dead prototypes addPass(PM, createDeadTypeEliminationPass()); // Eliminate dead types addPass(PM, createConstantMergePass()); // Merge dup global constants } From ggreif at gmail.com Thu Apr 17 07:08:55 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 12:08:55 -0000 Subject: [llvm-commits] [llvm] r49849 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804171208.m3HC8tmG007156@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 07:08:55 2008 New Revision: 49849 URL: http://llvm.org/viewvc/llvm-project?rev=49849&view=rev Log: do not unnecessarily traverse dirs searching Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49849&r1=49848&r2=49849&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Thu Apr 17 07:08:55 2008 @@ -58,13 +58,17 @@ PREPARATION = -e '/Running \(.*\) \.\.\./d' endif +ifndef TESTDIRS-MAKEFILES +TESTDIRS-MAKEFILES := $(shell echo "Z" >> Z && find $(TESTDIRS) -name Test.makefile) +endif + %.makefile.out: %.makefile @ $(MAKE) --always-make -C $(dir $<) -f $(notdir $<) $(notdir $@) -report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) +report:: $(addsuffix .out, $(TESTDIRS-MAKEFILES)) @ cat $^ -%.report:: $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile)) +%.report:: $(addsuffix .out, $(TESTDIRS-MAKEFILES)) @ cat $^ \ | grep "^$(basename $@): " \ | wc -l \ @@ -79,18 +83,20 @@ -e 's/ === \(.*\) Summary ===/ === Running \1 tests ===/1' PRETTIFY-REPORT = sed \ - -e 's/XPASS: /\# of unexpected successes /1' \ + -e 's/XPASS: /\# of unexpected successes /1' \ -e 's/PASS: /\# of expected passes /1' \ -e 's/XFAIL: /\# of expected failures /1' \ - -e 's/FAIL: /\# of unexpected failures /1' + -e 's/FAIL: /\# of unexpected failures /1' check-local:: site.exp @ ( PATH="$(LLVMToolDir):$(LLVM_SRC_ROOT)/test/Scripts:$(PATH)" \ $(RUNTEST) $(RUNTESTFLAGS) ) | $(PRETTIFY-DEJA) @ ( ulimit -t 600 ; ulimit -d 512000 ; \ - $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile $(addsuffix .out, $(shell find $(TESTDIRS) -name Test.makefile))) + $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile TESTDIRS-MAKEFILES="$(TESTDIRS-MAKEFILES)" \ + $(addsuffix .out, $(TESTDIRS-MAKEFILES))) @ $(DONE) - @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make PASS.report FAIL.report XPASS.report XFAIL.report + @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make TESTDIRS-MAKEFILES="$(TESTDIRS-MAKEFILES)" \ + PASS.report FAIL.report XPASS.report XFAIL.report @ echo @ echo " === $(TESTDIRS) Summary ===" @ echo From ggreif at gmail.com Thu Apr 17 07:35:10 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 12:35:10 -0000 Subject: [llvm-commits] [llvm] r49850 - /llvm/branches/ggreif/parallelized-test/Makefile Message-ID: <200804171235.m3HCZACL007906@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 07:35:10 2008 New Revision: 49850 URL: http://llvm.org/viewvc/llvm-project?rev=49850&view=rev Log: some more tweaks. remove debugging code Modified: llvm/branches/ggreif/parallelized-test/Makefile Modified: llvm/branches/ggreif/parallelized-test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/Makefile?rev=49850&r1=49849&r2=49850&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/Makefile (original) +++ llvm/branches/ggreif/parallelized-test/Makefile Thu Apr 17 07:35:10 2008 @@ -31,8 +31,10 @@ CLEANED_TESTSUITE := $(patsubst test/%,%,$(CLEANED_TESTSUITE)) RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE) TESTDIRS = $(CLEANED_TESTSUITE) +DISPLAYDIRS = $(TESTDIRS) else TESTDIRS = . +DISPLAYDIRS = endif IGNORE_TESTS := @@ -59,16 +61,18 @@ endif ifndef TESTDIRS-MAKEFILES -TESTDIRS-MAKEFILES := $(shell echo "Z" >> Z && find $(TESTDIRS) -name Test.makefile) +TESTDIRS-MAKEFILES := $(shell find $(TESTDIRS) -name Test.makefile) endif +TESTDIRS-OUTFILES := $(addsuffix .out, $(TESTDIRS-MAKEFILES)) + %.makefile.out: %.makefile @ $(MAKE) --always-make -C $(dir $<) -f $(notdir $<) $(notdir $@) -report:: $(addsuffix .out, $(TESTDIRS-MAKEFILES)) +report:: $(TESTDIRS-OUTFILES) @ cat $^ -%.report:: $(addsuffix .out, $(TESTDIRS-MAKEFILES)) +%.report:: $(TESTDIRS-OUTFILES) @ cat $^ \ | grep "^$(basename $@): " \ | wc -l \ @@ -93,12 +97,12 @@ $(RUNTEST) $(RUNTESTFLAGS) ) | $(PRETTIFY-DEJA) @ ( ulimit -t 600 ; ulimit -d 512000 ; \ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile TESTDIRS-MAKEFILES="$(TESTDIRS-MAKEFILES)" \ - $(addsuffix .out, $(TESTDIRS-MAKEFILES))) + $(TESTDIRS-OUTFILES)) @ $(DONE) @ $(MAKE) -f $(LLVM_SRC_ROOT)/test/Makefile --always-make TESTDIRS-MAKEFILES="$(TESTDIRS-MAKEFILES)" \ PASS.report FAIL.report XPASS.report XFAIL.report @ echo - @ echo " === $(TESTDIRS) Summary ===" + @ echo " === $(DISPLAYDIRS) Summary ===" @ echo @ cat PASS.report FAIL.report XPASS.report XFAIL.report | $(PRETTIFY-REPORT) else @@ -109,7 +113,7 @@ ifdef TESTONE CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE)) CLEANED_TESTONE := $(patsubst test/%,%,$(CLEANED_TESTONE)) -SUBDIR := $(shell dirname $(CLEANED_TESTONE)) +SUBDIR := $(dir $(CLEANED_TESTONE)) TESTPATH := $(LLVM_SRC_ROOT)/test/$(CLEANED_TESTONE) check-one: site.exp $(TCLSH) $(Verb)( echo "source $(LLVM_OBJ_ROOT)/test/site.exp" ; \ From ggreif at gmail.com Thu Apr 17 07:53:15 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 12:53:15 -0000 Subject: [llvm-commits] [llvm] r49851 - /llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Message-ID: <200804171253.m3HCrFFk008452@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 07:53:15 2008 New Revision: 49851 URL: http://llvm.org/viewvc/llvm-project?rev=49851&view=rev Log: more precautions against unintentional name capture Modified: llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Modified: llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h?rev=49851&r1=49850&r2=49851&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/OperandTraits.h Thu Apr 17 07:53:15 2008 @@ -104,13 +104,13 @@ /// Macro for generating out-of-class operand accessor definitions #define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ -VALUECLASS *CLASS::getOperand(unsigned i) const { \ - assert(i < OperandTraits::operands(this) && "getOperand() out of range!"); \ - return static_cast(OperandTraits::op_begin(const_cast(this))[i]); \ -} \ -void CLASS::setOperand(unsigned i, VALUECLASS *Val) { \ - assert(i < OperandTraits::operands(this) && "setOperand() out of range!"); \ - OperandTraits::op_begin(this)[i] = Val; \ +VALUECLASS *CLASS::getOperand(unsigned i_nocapture) const { \ + assert(i_nocapture < OperandTraits::operands(this) && "getOperand() out of range!"); \ + return static_cast(OperandTraits::op_begin(const_cast(this))[i_nocapture]); \ +} \ +void CLASS::setOperand(unsigned i_nocapture, VALUECLASS *Val_nocapture) { \ + assert(i_nocapture < OperandTraits::operands(this) && "setOperand() out of range!"); \ + OperandTraits::op_begin(this)[i_nocapture] = Val_nocapture; \ } \ unsigned CLASS::getNumOperands() const { return OperandTraits::operands(this); } \ template Use &CLASS::Op() { \ @@ -124,13 +124,13 @@ /// Macro for generating out-of-class operand accessor /// definitions with casted result #define DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ -VALUECLASS *CLASS::getOperand(unsigned i) const { \ - assert(i < OperandTraits::operands(this) && "getOperand() out of range!"); \ - return cast(OperandTraits::op_begin(const_cast(this))[i]); \ -} \ -void CLASS::setOperand(unsigned i, VALUECLASS *Val) { \ - assert(i < OperandTraits::operands(this) && "setOperand() out of range!"); \ - OperandTraits::op_begin(this)[i] = Val; \ +VALUECLASS *CLASS::getOperand(unsigned i_nocapture) const { \ + assert(i_nocapture < OperandTraits::operands(this) && "getOperand() out of range!"); \ + return cast(OperandTraits::op_begin(const_cast(this))[i_nocapture]); \ +} \ +void CLASS::setOperand(unsigned i_nocapture, VALUECLASS *Val_nocapture) { \ + assert(i_nocapture < OperandTraits::operands(this) && "setOperand() out of range!"); \ + OperandTraits::op_begin(this)[i_nocapture] = Val_nocapture; \ } \ unsigned CLASS::getNumOperands() const { return OperandTraits::operands(this); } \ template Use &CLASS::Op() { \ From ggreif at gmail.com Thu Apr 17 08:14:49 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 13:14:49 -0000 Subject: [llvm-commits] [llvm] r49852 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp Message-ID: <200804171314.m3HDEnYD009056@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 08:14:49 2008 New Revision: 49852 URL: http://llvm.org/viewvc/llvm-project?rev=49852&view=rev Log: tweak regex to not require leading space Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=49852&r1=49851&r2=49852&view=diff ============================================================================== --- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original) +++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Thu Apr 17 08:14:49 2008 @@ -159,7 +159,7 @@ puts $makeFileId "Test.makefile.out: \$(TESTS)" puts $makeFileId "\t@ cat \$(TESTS) /dev/null > \$@" if $verbose<1 { - puts $makeFileId "\t@ wc \$(TESTS) /dev/null | grep -E ' +0 +0 +0 ' | grep -v ' total\$\$' | grep -v ' /dev/null\$\$' | sed -e 's| *0 *0 *0 |PASS: \$(SUBDIR)\\/|1' -e 's|.testresults\$\$||1' >> \$@" + puts $makeFileId "\t@ wc \$(TESTS) /dev/null | grep -E ' *0 +0 +0 ' | grep -v ' total\$\$' | grep -v ' /dev/null\$\$' | sed -e 's| *0 *0 *0 |PASS: \$(SUBDIR)\\/|1' -e 's|.testresults\$\$||1' >> \$@" } puts $makeFileId "" From gabor at mac.com Thu Apr 17 08:37:24 2008 From: gabor at mac.com (Gabor Greif) Date: Thu, 17 Apr 2008 15:37:24 +0200 Subject: [llvm-commits] [llvm] r49831 - in /llvm/trunk: include/llvm/Support/CFG.h lib/Transforms/Utils/BreakCriticalEdges.cpp Message-ID: <48075294.8070805@mac.com> Yay! Thanks, Scott, I can confirm that this unbreaks my release build. Great detective work! Cheers, Gabor From romix.llvm at googlemail.com Thu Apr 17 09:14:36 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Thu, 17 Apr 2008 15:14:36 +0100 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/C Message-ID: Hi Dan, 2008/4/16, Dan Gohman : > Hi Roman, > > I have a few more comments, not on this commit specifically, but > on this overall series. > > > On Apr 16, 2008, at 9:15 AM, Roman Levenstein wrote: > > > > > -/// SDOperand - Represents a use of the SDNode referred by > > -/// the SDOperandImpl. > > -class SDOperand: public SDOperandImpl { > > +/// SDUse - Represents a use of the SDNode referred by > > +/// the SDOperand. > > +class SDUse { > > + SDOperand Operand; > > /// parent - Parent node of this operand. > > > Can you rename parent? I know the public accessor is already > renamed, but I'd like the private member's name to match > too :-). Done and committed. Also your const-related comment is taken into account. > > > > /// Retrieve a reference to the current operand. > > - SDOperand &operator*() const { > > + SDUse &operator*() const { > > assert(Op && "Cannot dereference end iterator!"); > > return *Op; > > } > > > > /// Retrieve a pointer to the current operand. > > - SDOperand *operator->() const { > > + SDUse *operator->() const { > > assert(Op && "Cannot dereference end iterator!"); > > return Op; > > > (this is in SDNode::use_iterator) > > Now that the SDUse change is in we can take another > look at use_iterator::operator* (and operator->). > The parallel to Use::value_use_iterator would be to have > it return the user SDNode * (i.e., operator* calls > getUser). > > At first glance, that seems a little questionable because > it doesn't convey which value is being used. Yes. It does ;-) > But I think that's addressed if we persue the idea mentioned earlier > about providing a way to iterate through the users of a > specific value of a node. > > What do you think? So, we should have iterators that iterate only over the users of a specific value. Do you mean something like providing a constructor parameter with the specific value number and then having the iterator pointing only to the uses of this value and skipping everything not matching this value? I attach a possible patch implementing this. Please have a look and tell me if this is what you mean. -Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: SDNodeUses.patch6 Type: application/octet-stream Size: 14742 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080417/93e71281/attachment.obj From akyrtzi at gmail.com Thu Apr 17 08:56:31 2008 From: akyrtzi at gmail.com (Argiris Kirtzidis) Date: Thu, 17 Apr 2008 13:56:31 -0000 Subject: [llvm-commits] [llvm] r49854 - /llvm/trunk/include/llvm/ADT/SmallString.h Message-ID: <200804171356.m3HDuWXa010373@zion.cs.uiuc.edu> Author: akirtzidis Date: Thu Apr 17 08:56:31 2008 New Revision: 49854 URL: http://llvm.org/viewvc/llvm-project?rev=49854&view=rev Log: Bring in uint32_t, uint64_t, and int64_t types for MSVC. Modified: llvm/trunk/include/llvm/ADT/SmallString.h Modified: llvm/trunk/include/llvm/ADT/SmallString.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SmallString.h?rev=49854&r1=49853&r2=49854&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/SmallString.h (original) +++ llvm/trunk/include/llvm/ADT/SmallString.h Thu Apr 17 08:56:31 2008 @@ -15,6 +15,7 @@ #define LLVM_ADT_SMALLSTRING_H #include "llvm/ADT/SmallVector.h" +#include "llvm/Support/DataTypes.h" #include namespace llvm { From dpatel at apple.com Thu Apr 17 11:41:40 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Apr 2008 16:41:40 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49857 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804171641.m3HGfedm015356@zion.cs.uiuc.edu> Author: dpatel Date: Thu Apr 17 11:41:39 2008 New Revision: 49857 URL: http://llvm.org/viewvc/llvm-project?rev=49857&view=rev Log: Check _Complex return type. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49857&r1=49856&r2=49857&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 17 11:41:39 2008 @@ -906,6 +906,9 @@ if (!TARGET_64BIT) return false; + if (TREE_CODE(type) == COMPLEX_TYPE) + return true; +` if (AGGREGATE_TYPE_P(type)) { tree field = TYPE_FIELDS(type); if (field && TREE_CHAIN(field) == NULL From dpatel at apple.com Thu Apr 17 11:42:39 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Apr 2008 16:42:39 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49858 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h Message-ID: <200804171642.m3HGgdDj015411@zion.cs.uiuc.edu> Author: dpatel Date: Thu Apr 17 11:42:39 2008 New Revision: 49858 URL: http://llvm.org/viewvc/llvm-project?rev=49858&view=rev Log: typo Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h 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=49858&r1=49857&r2=49858&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Thu Apr 17 11:42:39 2008 @@ -119,7 +119,7 @@ return false; if (TREE_CODE(TYPE_SIZE(type)) != INTEGER_CST) return false; - // LLVM says do no use shadow argument. + // LLVM says do not use shadow argument. if (LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY(type)) return true; // GCC says use shadow argument. From nicolas.geoffray at lip6.fr Thu Apr 17 11:45:26 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 17 Apr 2008 16:45:26 -0000 Subject: [llvm-commits] [vmkit] r49859 - in /vmkit/trunk: ./ include/mvm/ include/mvm/GC/ include/mvm/Threads/ lib/JnJVM/Classpath/ lib/JnJVM/VMCore/ lib/Mvm/ lib/Mvm/GCMmap2/ lib/N3/VMCore/ Message-ID: <200804171645.m3HGjSTR015665@zion.cs.uiuc.edu> Author: geoffray Date: Thu Apr 17 11:45:26 2008 New Revision: 49859 URL: http://llvm.org/viewvc/llvm-project?rev=49859&view=rev Log: More multi-mmap porting. In a multi-mmap environment, the collector is given as a parameter to trace functions Modified: vmkit/trunk/configure.ac vmkit/trunk/include/mvm/CollectableArea.h vmkit/trunk/include/mvm/GC/GC.h vmkit/trunk/include/mvm/Method.h vmkit/trunk/include/mvm/MvmMemoryManager.h vmkit/trunk/include/mvm/Object.h vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/include/mvm/Threads/Cond.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaCache.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.h vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h vmkit/trunk/lib/JnJVM/VMCore/JavaString.h vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h vmkit/trunk/lib/JnJVM/VMCore/Reader.h vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.cpp vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.h vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp vmkit/trunk/lib/JnJVM/VMCore/Zip.h vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp vmkit/trunk/lib/Mvm/JIT.cpp vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp vmkit/trunk/lib/Mvm/Object.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/BackTrace.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp vmkit/trunk/lib/N3/VMCore/Reader.h vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMCache.h vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VMThread.h vmkit/trunk/lib/N3/VMCore/VirtualMachine.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure.ac?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/configure.ac (original) +++ vmkit/trunk/configure.ac Thu Apr 17 11:45:26 2008 @@ -177,10 +177,10 @@ dnl ************************************************************************** AC_ARG_WITH(gc, [AS_HELP_STRING(--with-gc=something, - [GC type ('mmap2' or 'boehm')])], + [GC type ('single-mmap' 'multi-mmap' or 'boehm')])], [[gc=$withval]], [[ echo Using mmap2 as vvm gc type. - gc=mmap2 + gc=single-mmap ]] ) @@ -203,6 +203,10 @@ ;; esac else + if test "x$gc" = "xmulti-mmap"; then + CFLAGS="$CFLAGS -I$PWD/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC" + CXXFLAGS="$CXXFLAGS -I$PWD/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC" + fi GC_LIBS="$PWD/lib/Mvm/GCMmap2/libuvm_gc_mmap2.a \ $PWD/lib/Mvm/Allocator/libuvm_alloc.a" CFLAGS="$CFLAGS -I$PWD/lib/Mvm/GCMmap2 -DWITH_TRACER" Modified: vmkit/trunk/include/mvm/CollectableArea.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/CollectableArea.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/CollectableArea.h (original) +++ vmkit/trunk/include/mvm/CollectableArea.h Thu Apr 17 11:45:26 2008 @@ -59,7 +59,7 @@ } - virtual void tracer(size_t sz) { + virtual void TRACER { CollectableArea *const self= (CollectableArea *)this; register T **e = self->elements(); size_t lim= self->lastIndex; @@ -67,7 +67,7 @@ lim = ((lim << 2) < sz) ? lim : 0; idx = ((idx << 2) < sz) ? idx : (sz >> 2); for (; idx < lim; ++idx) - e[idx]->markAndTrace(); + e[idx]->MARK_AND_TRACE; } }; Modified: vmkit/trunk/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/GC/GC.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/GC/GC.h (original) +++ vmkit/trunk/include/mvm/GC/GC.h Thu Apr 17 11:45:26 2008 @@ -21,7 +21,11 @@ public: virtual ~gcRoot() {} virtual void destroyer(size_t) {} - virtual void tracer(size_t) {} +#ifdef MULTIPLE_GC + virtual void tracer(void* GC) {} +#else + virtual void tracer(void) {} +#endif }; class gc_header { Modified: vmkit/trunk/include/mvm/Method.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Method.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Method.h (original) +++ vmkit/trunk/include/mvm/Method.h Thu Apr 17 11:45:26 2008 @@ -11,6 +11,11 @@ #define MVM_METHOD_H #include "mvm/Object.h" +#include "mvm/Threads/Thread.h" + +namespace llvm { + class Function; +} namespace mvm { @@ -26,6 +31,7 @@ GC_defass(Object, definition); GC_defass(Object, literals); GC_defass(ExceptionTable, exceptionTable); + const llvm::Function* llvmFunction; size_t codeSize; /* use this constructor to map a function which is compiled by llvm */ @@ -35,7 +41,7 @@ } virtual void print(PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -57,7 +63,15 @@ inline Method *method() { return meth; } virtual void print(PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; + + static Code* getCodeFromPointer(void* ptr) { +#ifdef MULTIPLE_GC + return (mvm::Code*)mvm::Thread::get()->GC->begOf(ptr); +#else + return (mvm::Code*)Collector::begOf(ptr); +#endif + } }; class ExceptionTable : public Object { Modified: vmkit/trunk/include/mvm/MvmMemoryManager.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/MvmMemoryManager.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/MvmMemoryManager.h (original) +++ vmkit/trunk/include/mvm/MvmMemoryManager.h Thu Apr 17 11:45:26 2008 @@ -29,7 +29,7 @@ Method* currentMethod; // Current method being compiled unsigned char *GOTBase; // Target Specific reserved memory #ifdef MULTIPLE_GC - std::map GCMap; + std::map GCMap; mvm::Lock* lock; #endif public: Modified: vmkit/trunk/include/mvm/Object.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Object.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Object.h (original) +++ vmkit/trunk/include/mvm/Object.h Thu Apr 17 11:45:26 2008 @@ -54,7 +54,7 @@ #endif virtual void destroyer(size_t) {} - virtual void tracer(size_t) {} + virtual void TRACER {} virtual void print(PrintBuffer *buf) const; virtual intptr_t hashCode(){ return (intptr_t)this;} Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Thu Apr 17 11:45:26 2008 @@ -139,7 +139,7 @@ public: static PrintBuffer *alloc(void); - virtual void tracer(size_t sz); + virtual void TRACER; }; } // end namespace mvm Modified: vmkit/trunk/include/mvm/Threads/Cond.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Cond.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Cond.h (original) +++ vmkit/trunk/include/mvm/Threads/Cond.h Thu Apr 17 11:45:26 2008 @@ -25,6 +25,8 @@ unsigned int go; unsigned int n_wait; public: + + Cond() : no_barrier(0), go(0), n_wait(0) { } static Cond *allocCond(void); void broadcast(void); void wait(Lock *l); Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMStackWalker.cpp Thu Apr 17 11:45:26 2008 @@ -31,12 +31,7 @@ ArrayObject* recGetClassContext(int** stack, uint32 size, uint32 first, uint32 rec) { if (size != first) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(stack[first]); -#else - int *begIp = (int*)Collector::begOf(stack[first]); -#endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = ip_to_meth(stack[first]); if (meth) { ArrayObject* res = recGetClassContext(stack, size, first + 1, rec + 1); res->setAt(rec, meth->classDef->getClassDelegatee()); @@ -63,12 +58,7 @@ CommonClass* cl = Classpath::vmStackWalker; while (i < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); -#else - int *begIp = (int*)Collector::begOf(ips[i++]); -#endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = ip_to_meth(ips[i++]); if (meth && meth->classDef == cl) { first = i; break; @@ -96,12 +86,7 @@ int i = 0; while (i < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); -#else - int *begIp = (int*)Collector::begOf(ips[i++]); -#endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = ip_to_meth(ips[i++]); if (meth) { ++n; if (n == 1) return meth->classDef->getClassDelegatee(); @@ -118,12 +103,7 @@ int i = 0; while (i < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[i++]); -#else - int *begIp = (int*)Collector::begOf(ips[i++]); -#endif - JavaMethod* meth = ip_to_meth(begIp); + JavaMethod* meth = ip_to_meth(ips[i++]); if (meth) { ++n; if (n == 1) return meth->classDef->classLoader; Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.cpp Thu Apr 17 11:45:26 2008 @@ -67,6 +67,9 @@ ts->nonDaemonLock->unlock(); } +#ifdef SERVICE_DOMAIN + ((ServiceDomain*)isolate)->numThreads++; +#endif JavaMethod* method = vmthClass->lookupMethod(Jnjvm::runName, Jnjvm::clinitType, ACC_VIRTUAL, true); method->invokeIntSpecial(isolate, vmThread); @@ -79,6 +82,10 @@ ts->nonDaemonLock->unlock(); } +#ifdef SERVICE_DOMAIN + ((ServiceDomain*)isolate)->numThreads--; +#endif + #ifdef MULTIPLE_GC intern->GC->remove_my_thread(); #else @@ -94,9 +101,10 @@ JavaObject* vmThread = (JavaObject*)_vmThread; JavaObject* javaThread = (JavaObject*)(*ClasspathThread::assocThread)(vmThread).PointerVal; assert(javaThread); + Jnjvm* vm = JavaThread::get()->isolate; - JavaThread* th = vm_new(JavaThread::get()->isolate, JavaThread)(); - th->initialise(javaThread, JavaThread::get()->isolate); + JavaThread* th = vm_new(vm, JavaThread)(); + th->initialise(javaThread, vm); (*ClasspathThread::vmdata)(vmThread, (JavaObject*)th); int tid = 0; arg_thread_t* arg = (arg_thread_t*)malloc(sizeof(arg_thread_t)); @@ -105,6 +113,7 @@ #ifdef MULTIPLE_GC th->GC = mvm::Thread::get()->GC; #endif + mvm::Thread::start(&tid, (int (*)(void *))start, (void*)arg); } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Thu Apr 17 11:45:26 2008 @@ -63,7 +63,7 @@ else if (n > JavaArray::MaxArraySize) \ JavaThread::get()->isolate->outOfMemoryError(n); \ name* res = (name*) \ - (Object*) vm->allocateObject(sizeof(name) + n * primSize, name::VT); \ + (Object*) vm->allocateObject(sizeof(name) + n * primSize, name::VT); \ res->initialise(atype); \ res->size = n; \ memset(res->elements, 0, primSize * n); \ Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Thu Apr 17 11:45:26 2008 @@ -57,7 +57,7 @@ static llvm::ConstantInt* elementsOffset(); static JavaArray* multiCallNew(ClassArray* cl, uint32 len, ...); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -73,7 +73,7 @@ elmt at(sint32) const; \ void setAt(sint32, elmt); \ virtual void print(mvm::PrintBuffer* buf) const; \ - virtual void tracer(size_t sz); \ + virtual void TRACER; \ } ARRAYCLASS(ArrayUInt8, uint8); @@ -97,7 +97,7 @@ JavaObject* at(sint32) const; void setAt(sint32, JavaObject*); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; class UTF8 : public JavaArray { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaBacktrace.cpp Thu Apr 17 11:45:26 2008 @@ -9,6 +9,7 @@ #include #include +#include #include "llvm/Function.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" @@ -25,161 +26,42 @@ using namespace jnjvm; -extern "C" int** get_frame_pointer() { -/* - int** fp = 0; -#if defined (__PPC__) - asm volatile("1:\n" - " mr %0, 1\n" - : "=&r"(fp)); -#else - asm volatile("1:\n" - " movl %%ebp, %0\n" - : "=&r"(fp)); -#endif - return fp; -*/ - return (int**)__builtin_frame_address(0); -} - -extern "C" int *debug_frame_ip(int **fp) { -#if defined(__MACH__) && !defined(__i386__) - return fp[2]; -#else - return fp[1]; -#endif -} - -extern "C" int **debug_frame_caller_fp(int **fp) { - return (int**)fp[0]; -} - - -extern "C" int **debug_frame_caller_from_first_fp(int **fp) { -#if defined (__PPC__) - return fp; -#else - return fp; -#endif -} - -extern "C" bool frame_end(int **fp) { -#if defined(__PPC__) - return fp == 0; -#else - return fp == 0; -#endif -} - extern "C" JavaMethod* ip_to_meth(int* begIp) { - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - JavaMethod* meth = (JavaMethod*)m->definition(); - if (meth && meth->getVirtualTable() == JavaMethod::VT) { - return meth; - } - } + mvm::Code* val = mvm::Code::getCodeFromPointer(begIp); + if (val) { + mvm::Method* m = val->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == JavaMethod::VT) { + return (JavaMethod*)meth; } } return 0; } -#if 0 -extern "C" int backtrace(void** ips, int size) { - int** fp = get_frame_pointer(); - fp = debug_frame_caller_from_first_fp(fp); - int i = 0; - while ((!frame_end(fp)) && (debug_frame_ip(fp) != 0) && i < size) { - int * ip = debug_frame_ip(fp); - ips[i++] = (void*)ip; - fp = debug_frame_caller_fp(fp); - } - return i; -} -#else -#include -#endif -extern "C" int backtrace_fp(int** ips, int size, int** fp) { - fp = debug_frame_caller_from_first_fp(fp); - int i = 0; - while ((!frame_end(fp)) && (debug_frame_ip(fp) != 0) && i < size) { - int * ip = debug_frame_ip(fp); - ips[i++] = ip; - fp = debug_frame_caller_fp(fp); - } - return i; -} - -extern "C" void debug_backtrace(int **fp) { - fp = debug_frame_caller_from_first_fp(fp); - while ((!frame_end(fp)) && (debug_frame_ip(fp) != 0)) { - int * ip = debug_frame_ip(fp); -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ip); -#else - int *begIp = (int*)Collector::begOf(ip); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - printf("; 0x%p in %s\n", ip, - ((llvm::Function*)glob)->getNameStr().c_str()); - } else JavaThread::get()->isolate->unknownError("in global variable?"); - } else printf("; 0x%p in stub\n", ip); - } else { - Dl_info info; - int res = dladdr(begIp, &info); - if (res != 0) { - printf("; 0x%p in %s\n", ip, info.dli_fname); - } - } - fp = debug_frame_caller_fp(fp); - } -} - - void JavaJIT::printBacktrace() { int* ips[100]; int real_size = backtrace((void**)(void*)ips, 100); int n = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - JavaMethod* meth = (JavaMethod*)m->definition(); - if (meth) - printf("; 0x%p in %s\n", ips[n - 1], meth->printString()); - else - printf("; 0x%p in %s\n", ips[n - 1], - ((llvm::Function*)glob)->getNameStr().c_str()); - } else JavaThread::get()->isolate->unknownError("in global variable?"); - } else printf("; 0x%p in stub\n", ips[n - 1]); + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == JavaMethod::VT) { + printf("; %p in %s\n", ips[n - 1], meth->printString()); + } else if (m->llvmFunction) { + printf("; %p in %s\n", ips[n - 1], + m->llvmFunction->getNameStr().c_str()); + } else { + printf("; %p in %s\n", ips[n - 1], "stub (probably)"); + } } else { Dl_info info; - int res = dladdr(begIp, &info); + int res = dladdr(ips[n++], &info); if (res != 0) { - printf("; 0x%p in %s\n", ips[n - 1], info.dli_fname); + printf("; %p in %s\n", ips[n - 1], info.dli_sname); } else { - printf("; 0x%p in Unknown\n", ips[n - 1]); + printf("; %p in Unknown\n", ips[n - 1]); } } } @@ -194,25 +76,14 @@ int n = 0; int i = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - JavaMethod* meth = (JavaMethod*)m->definition(); - if (meth && i == 1) return meth->classDef; - else ++i; - } else { - JavaThread::get()->isolate->unknownError("in global variable?"); - } + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == JavaMethod::VT && i == 0) { + return ((JavaMethod*)meth)->classDef; + } else { + ++i; } } } @@ -225,27 +96,13 @@ int n = 0; int i = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - JavaMethod* meth = (JavaMethod*)m->definition(); - if (meth && i == 1) { - return meth->classDef; - } else ++i; - } else { - JavaThread::get()->isolate->unknownError("in global variable?"); - } - } + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == JavaMethod::VT && i == 1) { + return ((JavaMethod*)meth)->classDef; + } else ++i; } } return 0; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaCache.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaCache.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaCache.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaCache.cpp Thu Apr 17 11:45:26 2008 @@ -31,6 +31,10 @@ using namespace jnjvm; using namespace llvm; +void Enveloppe::destroyer(size_t sz) { + delete cacheLock; +} + void CacheNode::print(mvm::PrintBuffer* buf) const { buf->write("CacheNode<"); if (lastCible) { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h Thu Apr 17 11:45:26 2008 @@ -28,7 +28,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void* methPtr; Class* lastCible; @@ -43,9 +43,10 @@ class Enveloppe : public mvm::Object { public: static VirtualTable* VT; - virtual void tracer(size_t sz); + virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const; - + virtual void destroyer(size_t sz); + CacheNode *firstCache; JavaCtpInfo* ctpInfo; mvm::Lock* cacheLock; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Thu Apr 17 11:45:26 2008 @@ -226,11 +226,11 @@ // We can compile it, since if we're here, it's for a good reason void* val = mvm::jit::executionEngine->getPointerToGlobal(methPtr); #ifndef MULTIPLE_GC - if (Collector::isObject(val)) { + mvm::Code* temp = (mvm::Code*)(Collector::begOf(val)); #else - if (classDef->isolate->GC->isObject(val)) { + mvm::Code* temp = (mvm::Code*)(classDef->isolate->GC->begOf(val)); #endif - mvm::Code* temp = (mvm::Code*)((unsigned*)val - 2); + if (temp) { temp->method()->definition(this); } code = (mvm::Code*)val; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Thu Apr 17 11:45:26 2008 @@ -69,7 +69,7 @@ static const UTF8* sourceFileAttribut; virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; class CommonClass : public mvm::Object { @@ -134,7 +134,7 @@ virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; bool inheritName(const UTF8* Tname); bool isOfTypeName(const UTF8* Tname); @@ -193,7 +193,7 @@ JavaObject* doNewUnknown(Jnjvm* vm); JavaObject* initialiseObject(JavaObject* obj); virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; JavaObject* operator()(Jnjvm* vm); @@ -224,7 +224,7 @@ unsigned int end); virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static CommonClass* SuperArray; static std::vector InterfacesArray; @@ -250,7 +250,7 @@ mvm::Code* code; virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void* compiledPtr(); const llvm::FunctionType* llvmType; @@ -325,7 +325,7 @@ void initField(JavaObject* obj); virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; llvm::GenericValue operator()(JavaObject* obj = 0); void operator()(JavaObject* obj, float val); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h Thu Apr 17 11:45:26 2008 @@ -50,7 +50,7 @@ static const uint32 ConstantNameAndType; virtual void print(mvm::PrintBuffer* buf); - virtual void tracer(size_t sz); + virtual void TRACER; static ctpReader funcsReader[16]; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Thu Apr 17 11:45:26 2008 @@ -326,6 +326,9 @@ } void JavaIsolate::executeClass(const char* className, ArrayObject* args) { +#ifdef SERVICE_VM + JavaThread::get()->executionTime = time(0); +#endif try { JavaJIT::invokeOnceVoid(this, appClassLoader, className, "main", "([Ljava/lang/String;)V", ACC_STATIC, args); @@ -438,14 +441,11 @@ isolate->functions); JavaJIT::initialiseJITIsolateVM(isolate); - isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); -#ifndef MULTIPLE_GC - mvm::Thread* th = mvm::Thread::get(); - isolate->bootstrapThread->GC = th->GC; -#else +#ifdef MULTIPLE_GC isolate->bootstrapThread->GC = isolate->GC; + isolate->GC->inject_my_thread(0); mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); #endif JavaThread::threadKey->set(isolate->bootstrapThread); @@ -505,11 +505,9 @@ isolate->bootstrapThread = vm_new(isolate, JavaThread)(); isolate->bootstrapThread->initialise(0, isolate); -#ifndef MULTIPLE_GC - mvm::Thread* th = mvm::Thread::get(); - isolate->bootstrapThread->GC = th->GC; -#else +#ifdef MULTIPLE_GC isolate->bootstrapThread->GC = isolate->GC; + isolate->GC->inject_my_thread(0); mvm::jit::memoryManager->addGCForModule(isolate->module, isolate->GC); #endif JavaThread::threadKey->set(isolate->bootstrapThread); @@ -540,5 +538,5 @@ } void JavaIsolate::destroyer(size_t sz) { - Jnjvm::destroyer(); + Jnjvm::destroyer(sz); } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.h Thu Apr 17 11:45:26 2008 @@ -31,7 +31,7 @@ mvm::Cond* nonDaemonVar; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void initialise(); }; @@ -43,7 +43,7 @@ JavaThread* bootstrapThread; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; virtual void destroyer(size_t sz); JavaObject* loadAppClassLoader(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Thu Apr 17 11:45:26 2008 @@ -322,8 +322,8 @@ if (compilingClass->isolate == Jnjvm::bootstrapVM) { isolateLocal = args[args.size() - 1]; } else { - ServiceDomain* vm = - (ServiceDomain*)(*Classpath::vmdataClassLoader)(compilingClass->classLoader).PointerVal; + JavaObject* loader = compilingClass->classLoader; + ServiceDomain* vm = ServiceDomain::getDomainFromLoader(loader); isolateLocal = new LoadInst(vm->llvmDelegatee(), "", currentBlock); } #endif @@ -450,8 +450,8 @@ if (compilingClass->isolate == Jnjvm::bootstrapVM) { isolateLocal = i; } else { - ServiceDomain* vm = - (ServiceDomain*)(*Classpath::vmdataClassLoader)(compilingClass->classLoader).PointerVal; + JavaObject* loader = compilingClass->classLoader; + ServiceDomain* vm = ServiceDomain::getDomainFromLoader(loader); isolateLocal = new LoadInst(vm->llvmDelegatee(), "", currentBlock); } #endif @@ -1182,9 +1182,24 @@ val = lowerMathOps(name, args); } + if (!val) { Function* func = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_VIRTUAL, signature, meth); +#ifdef SERVICE_VM + bool serviceCall = false; + if (meth && meth->classDef->classLoader != compilingClass->classLoader && + meth->classDef->isolate != Jnjvm::bootstrapVM){ + JavaObject* loader = meth->classDef->classLoader; + ServiceDomain* calling = ServiceDomain::getDomainFromLoader(loader); + serviceCall = true; + std::vector Args; + Args.push_back(isolateLocal); + Args.push_back(calling->llvmDelegatee()); + CallInst::Create(ServiceDomain::serviceCallStartLLVM, Args.begin(), + Args.end(), "", currentBlock); + } +#endif if (meth && meth->canBeInlined && meth != compilingMethod && inlineMethods[meth] == 0) { @@ -1192,6 +1207,19 @@ } else { val = invoke(func, args, "", currentBlock); } + +#ifdef SERVICE_VM + if (serviceCall) { + JavaObject* loader = meth->classDef->classLoader; + ServiceDomain* calling = ServiceDomain::getDomainFromLoader(loader); + serviceCall = true; + std::vector Args; + Args.push_back(isolateLocal); + Args.push_back(calling->llvmDelegatee()); + CallInst::Create(ServiceDomain::serviceCallStopLLVM, Args.begin(), + Args.end(), "", currentBlock); + } +#endif } const llvm::Type* retType = signature->virtualType->getReturnType(); @@ -1225,6 +1253,21 @@ if (!val) { Function* func = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_STATIC, signature, meth); + +#ifdef SERVICE_VM + bool serviceCall = false; + if (meth && meth->classDef->classLoader != compilingClass->classLoader && + meth->classDef->isolate != Jnjvm::bootstrapVM){ + JavaObject* loader = meth->classDef->classLoader; + ServiceDomain* calling = ServiceDomain::getDomainFromLoader(loader); + serviceCall = true; + std::vector Args; + Args.push_back(isolateLocal); + Args.push_back(calling->llvmDelegatee()); + CallInst::Create(ServiceDomain::serviceCallStartLLVM, Args.begin(), + Args.end(), "", currentBlock); + } +#endif if (meth && meth->canBeInlined && meth != compilingMethod && inlineMethods[meth] == 0) { @@ -1232,6 +1275,18 @@ } else { val = invoke(func, args, "", currentBlock); } + +#ifdef SERVICE_VM + if (serviceCall) { + JavaObject* loader = meth->classDef->classLoader; + ServiceDomain* calling = ServiceDomain::getDomainFromLoader(loader); + std::vector Args; + Args.push_back(isolateLocal); + Args.push_back(calling->llvmDelegatee()); + CallInst::Create(ServiceDomain::serviceCallStopLLVM, Args.begin(), Args.end(), "", + currentBlock); + } +#endif } const llvm::Type* retType = signature->staticType->getReturnType(); @@ -1290,6 +1345,14 @@ ctpInfo->checkInfoOfClass(index); Class* cl = (Class*)(ctpInfo->getMethodClassIfLoaded(index)); +#ifdef SERVICE_VM + if (cl && cl->classLoader != compilingClass->classLoader && + cl->isolate != Jnjvm::bootstrapVM) { + ServiceDomain* vm = (ServiceDomain*)JavaThread::get()->isolate; + assert(vm->getVirtualTable() == ServiceDomain::VT && "vm not a service?"); + vm->serviceError("The service called new on another service"); + } +#endif Value* val = 0; if (!cl || !cl->isReady()) { Value* node = getInitializedClass(index); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITInitialise.cpp Thu Apr 17 11:45:26 2008 @@ -24,6 +24,9 @@ #include "JavaThread.h" #include "Jnjvm.h" #include "JnjvmModuleProvider.h" +#ifdef SERVICE_VM +#include "ServiceDomain.h" +#endif using namespace jnjvm; using namespace llvm; @@ -144,10 +147,17 @@ { std::vector args; args.push_back(JavaObject::llvmType); +#ifdef MULTIPLE_GC + args.push_back(mvm::jit::ptrType); +#endif const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); javaObjectTracerLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN5jnjvm10JavaObject6tracerEj", +#ifdef MULTIPLE_GC + "_ZN5jnjvm10JavaObject6tracerEPv", +#else + "_ZN5jnjvm10JavaObject6tracerEv", +#endif module); } @@ -545,19 +555,41 @@ } - #ifdef WITH_TRACER // Create markAndTraceLLVM { std::vector args; args.push_back(JavaObject::llvmType); +#ifdef MULTIPLE_GC + args.push_back(mvm::jit::ptrType); +#endif markAndTraceLLVMType = FunctionType::get(llvm::Type::VoidTy, args, false); markAndTraceLLVM = Function::Create(markAndTraceLLVMType, GlobalValue::ExternalLinkage, +#ifdef MULTIPLE_GC + "_ZNK2gc12markAndTraceEP9Collector", +#else "_ZNK2gc12markAndTraceEv", +#endif module); } #endif +#ifdef SERVICE_VM + // Create serviceCallStart/Stop + { + std::vector args; + args.push_back(mvm::jit::ptrType); + args.push_back(mvm::jit::ptrType); + const FunctionType* type = FunctionType::get(llvm::Type::VoidTy, args, false); + ServiceDomain::serviceCallStartLLVM = + Function::Create(type, GlobalValue::ExternalLinkage, "serviceCallStart", + module); + + ServiceDomain::serviceCallStopLLVM = + Function::Create(type, GlobalValue::ExternalLinkage, "serviceCallStop", + module); + } +#endif mvm::jit::unprotectTypes();//->unlock(); mvm::jit::protectConstants();//->lock(); constantUTF8Null = Constant::getNullValue(UTF8::llvmType); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaMetaJIT.cpp Thu Apr 17 11:45:26 2008 @@ -191,13 +191,26 @@ Argument* arg = func->arg_begin(); BasicBlock* block = BasicBlock::Create("", func); llvm::Value* realArg = new BitCastInst(arg, type, "", block); - + +#ifdef MULTIPLE_GC + Value* GC = ++func->arg_begin(); + std::vector Args; + Args.push_back(arg); + Args.push_back(GC); + if (stat || cl->super == 0) { + CallInst::Create(javaObjectTracerLLVM, Args.begin(), Args.end(), "", block); + } else { + CallInst::Create(((Class*)cl->super)->virtualTracer, Args.begin(), + Args.end(), "", block); + } +#else if (stat || cl->super == 0) { CallInst::Create(javaObjectTracerLLVM, arg, "", block); } else { CallInst::Create(((Class*)cl->super)->virtualTracer, arg, "", block); } - +#endif + for (std::vector::iterator i = fields.begin(), e = fields.end(); i!= e; ++i) { if ((*i)->signature->funcs->doTrace) { @@ -208,7 +221,14 @@ block); Value* val = new LoadInst(ptr, "", block); Value* valCast = new BitCastInst(val, JavaObject::llvmType, "", block); +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(valCast); + Args.push_back(GC); + CallInst::Create(markAndTraceLLVM, Args.begin(), Args.end(), "", block); +#else CallInst::Create(markAndTraceLLVM, valCast, "", block); +#endif } } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Thu Apr 17 11:45:26 2008 @@ -41,7 +41,7 @@ void wait(JavaThread* th); void remove(JavaThread* th); - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -52,7 +52,7 @@ JavaCond* varcond; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static LockObj* allocate(); void aquire(); @@ -70,7 +70,7 @@ static const llvm::Type* llvmType; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void aquire(); void unlock(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaPrimitive.h Thu Apr 17 11:45:26 2008 @@ -43,7 +43,7 @@ static JavaPrimitive* funcsToPrimitive(AssessorDesc* funcs); virtual void print(mvm::PrintBuffer* buf); - virtual void tracer(size_t sz); + virtual void TRACER; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaString.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaString.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaString.h Thu Apr 17 11:45:26 2008 @@ -25,7 +25,7 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("Java string"); } - virtual void tracer(size_t sz); + virtual void TRACER; // CLASSPATH FIELDS!! const UTF8* value; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Thu Apr 17 11:45:26 2008 @@ -48,7 +48,7 @@ JavaObject* cacheObject; // cache for allocations patching virtual void print(mvm::PrintBuffer *buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; virtual void destroyer(size_t sz); void initialise(JavaObject* thread, Jnjvm* isolate); @@ -62,6 +62,9 @@ static bool compareException(Class*); static JavaObject* getJavaException(); void returnFromNative(); +#ifdef SERVICE_VM + time_t executionTime; +#endif }; } // end namespace jnjvm Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h Thu Apr 17 11:45:26 2008 @@ -82,7 +82,7 @@ virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static void analyseIntern(const UTF8* name, uint32 pos, uint32 meth, AssessorDesc*& ass, @@ -118,7 +118,7 @@ Jnjvm* isolate; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; CommonClass* assocClass(JavaObject* loader); void typePrint(mvm::PrintBuffer* buf); @@ -148,7 +148,7 @@ uint32 nbIn; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static const llvm::FunctionType* createVirtualType( const std::vector*, Typedef*); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.h Thu Apr 17 11:45:26 2008 @@ -36,6 +36,7 @@ class JavaField; class JavaMethod; class Class; +class ClassArray; class ClasspathThread { public: Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Thu Apr 17 11:45:26 2008 @@ -643,7 +643,7 @@ ServiceDomain* vm = (ServiceDomain*)(*Classpath::vmdataClassLoader)(loader).PointerVal; if (!vm) { - vm = ServiceDomain::allocateService(Jnjvm::bootstrapVM); + vm = ServiceDomain::allocateService((JavaIsolate*)Jnjvm::bootstrapVM); (*Classpath::vmdataClassLoader)(loader, (JavaObject*)vm); } map = vm->classes; @@ -693,7 +693,7 @@ ServiceDomain* vm = (ServiceDomain*)(*Classpath::vmdataClassLoader)(loader).PointerVal; if (!vm) { - vm = ServiceDomain::allocateService(Jnjvm::bootstrapVM); + vm = ServiceDomain::allocateService((JavaIsolate*)Jnjvm::bootstrapVM); (*Classpath::vmdataClassLoader)(loader, (JavaObject*)vm); } map = vm->classes; @@ -735,7 +735,7 @@ ServiceDomain* vm = (ServiceDomain*)(*Classpath::vmdataClassLoader)(loader).PointerVal; if (!vm) { - vm = ServiceDomain::allocateService(Jnjvm::bootstrapVM); + vm = ServiceDomain::allocateService((JavaIsolate*)Jnjvm::bootstrapVM); (*Classpath::vmdataClassLoader)(loader, (JavaObject*)vm); } map = vm->classes; @@ -837,6 +837,7 @@ #ifndef MULTIPLE_VM JavaObject* Jnjvm::getClassDelegatee(CommonClass* cl) { + cl->aquire(); if (!(cl->delegatee)) { JavaObject* delegatee = (*Classpath::newClass)(this); cl->delegatee = delegatee; @@ -848,10 +849,12 @@ Classpath::initClassWithProtectionDomain->invokeIntSpecial(this, delegatee, cl, pd); } + cl->release(); return cl->delegatee; } #else JavaObject* Jnjvm::getClassDelegatee(CommonClass* cl) { + cl->aquire(); JavaObject* val = delegatees->lookup(cl); if (!val) { val = (*Classpath::newClass)(this); @@ -860,15 +863,17 @@ } else if (val->classOf != Classpath::newClass) { JavaObject* pd = val; val = (*Classpath::newClass)(this); + delegatees->remove(cl); delegatees->hash(cl, val); Classpath::initClassWithProtectionDomain->invokeIntSpecial(this, val, cl, pd); } + cl->release(); return val; } #endif -void Jnjvm::destroyer() { +void Jnjvm::destroyer(size_t sz) { #ifdef MULTIPLE_GC GC->destroy(); delete GC; Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Thu Apr 17 11:45:26 2008 @@ -218,12 +218,12 @@ JavaObject* getClassDelegatee(CommonClass*); CommonClass* loadInClassLoader(const UTF8* utf8, JavaObject* loader); - virtual void tracer(size_t sz); + virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const { buf->write("Jnjvm<>"); } - virtual void destroyer(); + virtual void destroyer(size_t sz); void addProperty(char* key, char* value); @@ -264,13 +264,13 @@ JnjvmModuleProvider* TheModuleProvider; FunctionMap* functions; -#ifndef MULTIPLE_VM +#ifndef MULTIPLE_GC void* allocateObject(unsigned int sz, VirtualTable* VT) { return gc::operator new(sz, VT); } #else void* allocateObject(unsigned int sz, VirtualTable* VT) { - return gc::operator new(sz, VT); + return gc::operator new(sz, VT, GC); } #endif }; Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Thu Apr 17 11:45:26 2008 @@ -73,6 +73,12 @@ return ((Container)(I->second)); } } + + inline void remove(Key V) { + lock->lock(); + map.erase(V); + lock->unlock(); + } inline Container lookup(Key V) { lock->lock(); @@ -108,12 +114,7 @@ const UTF8* lookupAsciiz(const char* asciiz); const UTF8* lookupReader(const uint16* buf, uint32 size); - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) { buf->write("UTF8 Hashtable<>"); @@ -160,12 +161,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; class FieldMap : @@ -177,12 +173,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; class MethodMap : @@ -194,12 +185,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; struct ltstr @@ -219,12 +205,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; class StringMap : @@ -236,12 +217,7 @@ lock = mvm::Lock::allocRecursive(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; class FunctionMap : @@ -253,12 +229,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->first->markAndTrace(); - } - } + virtual void TRACER; }; class FunctionDefMap : @@ -270,12 +241,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; class TypeMap : @@ -292,12 +258,7 @@ lock = mvm::Lock::allocRecursive(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); - } - } + virtual void TRACER; }; @@ -310,13 +271,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->first->markAndTrace(); - i->second->second->markAndTrace(); - } - } + virtual void TRACER; virtual void destroyer(size_t sz) { for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { @@ -334,13 +289,7 @@ lock = mvm::Lock::allocNormal(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->first->markAndTrace(); - i->second->markAndTrace(); - } - } + virtual void TRACER; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/JnJVM/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Reader.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Reader.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Reader.h Thu Apr 17 11:45:26 2008 @@ -51,7 +51,7 @@ void seek(uint32 pos, int from); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.cpp Thu Apr 17 11:45:26 2008 @@ -10,6 +10,8 @@ #include "mvm/JIT.h" #include "JavaJIT.h" +#include "JavaThread.h" +#include "JavaUpcalls.h" #include "JnjvmModuleProvider.h" #include "ServiceDomain.h" @@ -19,8 +21,12 @@ extern "C" struct JNINativeInterface JNI_JNIEnvTable; extern "C" const struct JNIInvokeInterface JNI_JavaVMTable; + using namespace jnjvm; +llvm::Function* ServiceDomain::serviceCallStartLLVM; +llvm::Function* ServiceDomain::serviceCallStopLLVM; + GlobalVariable* ServiceDomain::llvmDelegatee() { if (!_llvmDelegatee) { @@ -48,11 +54,8 @@ void ServiceDomain::destroyer(size_t sz) { - mvm::jit::protectEngine->lock(); - mvm::jit::executionEngine->removeModuleProvider(TheModuleProvider); - mvm::jit::protectEngine->unlock(); - delete TheModuleProvider; - delete module; + Jnjvm::destroyer(sz); + delete lock; } void ServiceDomain::print(mvm::PrintBuffer* buf) const { @@ -60,9 +63,13 @@ buf->write(name); } -ServiceDomain* ServiceDomain::allocateService(Jnjvm* callingVM) { +ServiceDomain* ServiceDomain::allocateService(JavaIsolate* callingVM) { ServiceDomain* service = vm_new(callingVM, ServiceDomain)(); - + service->threadSystem = callingVM->threadSystem; +#ifdef MULTIPLE_GC + service->GC = Collector::allocate(); +#endif + service->functions = vm_new(service, FunctionMap)(); service->module = new llvm::Module("Service Domain"); service->protectModule = mvm::Lock::allocNormal(); @@ -92,7 +99,6 @@ // Here are the classes it loaded service->classes = vm_new(service, ClassMap)(); - service->started = 0; service->executionTime = 0; service->memoryUsed = 0; service->gcTriggered = 0; @@ -109,3 +115,41 @@ loadName(asciizConstructUTF8("java/lang/Math"), CommonClass::jnjvmClassLoader, true, true, true); } + +void ServiceDomain::serviceError(const char* str) { + fprintf(stderr, str); + abort(); +} + +ServiceDomain* ServiceDomain::getDomainFromLoader(JavaObject* loader) { + ServiceDomain* vm = + (ServiceDomain*)(*Classpath::vmdataClassLoader)(loader).PointerVal; + return vm; +} + +#ifdef SERVICE_VM +extern "C" void ServiceDomainStart(ServiceDomain* caller, + ServiceDomain* callee) { + JavaThread* th = JavaThread::get(); + th->isolate = callee; + time_t t = time(NULL); + caller->lock->lock(); + caller->executionTime += t - th->executionTime; + caller->interactions[callee]++; + caller->lock->unlock(); + th->executionTime = t; + +} + +extern "C" void ServiceDomainStop(ServiceDomain* caller, + ServiceDomain* callee) { + JavaThread* th = JavaThread::get(); + th->isolate = caller; + time_t t = time(NULL); + callee->lock->lock(); + callee->executionTime += t - th->executionTime; + callee->lock->unlock(); + th->executionTime = t; +} + +#endif Modified: vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/ServiceDomain.h Thu Apr 17 11:45:26 2008 @@ -11,11 +11,15 @@ #define JNJVM_SERVICE_DOMAIN_H #include +#include -#include "Jnjvm.h" +#include + +#include "JavaIsolate.h" namespace llvm { class GlobalVariable; + class Function; } namespace mvm { @@ -26,26 +30,32 @@ class ClassMap; -class ServiceDomain : public Jnjvm { +class ServiceDomain : public JavaIsolate { private: llvm::GlobalVariable* _llvmDelegatee; - mvm::Lock* lock; public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; virtual void destroyer(size_t sz); void loadBootstrap(); - static ServiceDomain* allocateService(Jnjvm* callingVM); + static ServiceDomain* allocateService(JavaIsolate* callingVM); llvm::GlobalVariable* llvmDelegatee(); + void serviceError(const char* str); + mvm::Lock* lock; ClassMap* classes; - time_t started; + struct timeval started; uint64 executionTime; uint64 memoryUsed; uint64 gcTriggered; uint64 numThreads; + std::map interactions; + + static ServiceDomain* getDomainFromLoader(JavaObject* loader); + static llvm::Function* serviceCallStartLLVM; + static llvm::Function* serviceCallStopLLVM; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Thu Apr 17 11:45:26 2008 @@ -82,20 +82,20 @@ #undef INIT -void JavaArray::tracer(size_t sz) { - JavaObject::tracer(sz); +void JavaArray::TRACER { + JavaObject::PARENT_TRACER; } -void ArrayObject::tracer(size_t sz) { - JavaObject::tracer(sz); +void ArrayObject::TRACER { + JavaObject::PARENT_TRACER; for (sint32 i = 0; i < size; i++) { - elements[i]->markAndTrace(); + elements[i]->MARK_AND_TRACE; } } #define ARRAYTRACER(name) \ - void name::tracer(size_t sz) { \ - JavaObject::tracer(sz); \ + void name::TRACER { \ + JavaObject::PARENT_TRACER; \ } @@ -112,181 +112,250 @@ #undef ARRAYTRACER -void Attribut::tracer(size_t sz) { - name->markAndTrace(); +void Attribut::TRACER { + name->MARK_AND_TRACE; } #define TRACE_VECTOR(type,alloc,name) { \ for (std::vector >::iterator i = name.begin(), \ e = name.end(); i!= e; ++i) { \ - (*i)->markAndTrace(); }} + (*i)->MARK_AND_TRACE; }} -void CommonClass::tracer(size_t sz) { - name->markAndTrace(); - super->markAndTrace(); - superUTF8->markAndTrace(); +void CommonClass::TRACER { + name->MARK_AND_TRACE; + super->MARK_AND_TRACE; + superUTF8->MARK_AND_TRACE; TRACE_VECTOR(const UTF8*, std::allocator, interfacesUTF8); TRACE_VECTOR(Class*, std::allocator, interfaces); - //lockVar->markAndTrace(); - //condVar->markAndTrace(); + //lockVar->MARK_AND_TRACE; + //condVar->MARK_AND_TRACE; TRACE_VECTOR(JavaMethod*, std::allocator, virtualMethods); TRACE_VECTOR(JavaMethod*, std::allocator, staticMethods); TRACE_VECTOR(JavaField*, std::allocator, virtualFields); TRACE_VECTOR(JavaField*, std::allocator, staticFields); - classLoader->markAndTrace(); + classLoader->MARK_AND_TRACE; #ifndef MULTIPLE_VM - delegatee->markAndTrace(); + delegatee->MARK_AND_TRACE; #endif TRACE_VECTOR(CommonClass*, std::allocator, display); - isolate->markAndTrace(); + isolate->MARK_AND_TRACE; } -void Class::tracer(size_t sz) { - CommonClass::tracer(sz); - bytes->markAndTrace(); - _staticInstance->markAndTrace(); - virtualInstance->markAndTrace(); - ctpInfo->markAndTrace(); +void Class::TRACER { + CommonClass::PARENT_TRACER; + bytes->MARK_AND_TRACE; + _staticInstance->MARK_AND_TRACE; + virtualInstance->MARK_AND_TRACE; + ctpInfo->MARK_AND_TRACE; TRACE_VECTOR(Attribut*, gc_allocator, attributs); TRACE_VECTOR(Class*, std::allocator, innerClasses); - outerClass->markAndTrace(); - codeStaticTracer->markAndTrace(); - codeVirtualTracer->markAndTrace(); + outerClass->MARK_AND_TRACE; + codeStaticTracer->MARK_AND_TRACE; + codeVirtualTracer->MARK_AND_TRACE; } -void ClassArray::tracer(size_t sz) { - CommonClass::tracer(sz); - _baseClass->markAndTrace(); - _funcs->markAndTrace(); +void ClassArray::TRACER { + CommonClass::PARENT_TRACER; + _baseClass->MARK_AND_TRACE; + _funcs->MARK_AND_TRACE; } -void JavaMethod::tracer(size_t sz) { - signature->markAndTrace(); +void JavaMethod::TRACER { + signature->MARK_AND_TRACE; TRACE_VECTOR(Attribut*, gc_allocator, attributs); TRACE_VECTOR(Enveloppe*, gc_allocator, caches); - classDef->markAndTrace(); - name->markAndTrace(); - type->markAndTrace(); - code->markAndTrace(); + classDef->MARK_AND_TRACE; + name->MARK_AND_TRACE; + type->MARK_AND_TRACE; + code->MARK_AND_TRACE; } -void JavaField::tracer(size_t sz) { - name->markAndTrace(); - signature->markAndTrace(); - type->markAndTrace(); +void JavaField::TRACER { + name->MARK_AND_TRACE; + signature->MARK_AND_TRACE; + type->MARK_AND_TRACE; TRACE_VECTOR(Attribut*, gc_allocator, attributs); - classDef->markAndTrace(); + classDef->MARK_AND_TRACE; } -void JavaCtpInfo::tracer(size_t sz) { - classDef->markAndTrace(); +void JavaCtpInfo::TRACER { + classDef->MARK_AND_TRACE; // Everything is hashed in the constant pool, // do not trace them here } -void JavaCond::tracer(size_t sz) { +void JavaCond::TRACER { TRACE_VECTOR(JavaThread*, std::allocator, threads); } -void LockObj::tracer(size_t sz) { - //lock->markAndTrace(); - varcond->markAndTrace(); +void LockObj::TRACER { + //lock->MARK_AND_TRACE; + varcond->MARK_AND_TRACE; } -void JavaObject::tracer(size_t sz) { - classOf->markAndTrace(); - lockObj->markAndTrace(); +void JavaObject::TRACER { + classOf->MARK_AND_TRACE; + lockObj->MARK_AND_TRACE; } -void JavaThread::tracer(size_t sz) { - javaThread->markAndTrace(); - isolate->markAndTrace(); - //lock->markAndTrace(); - //varcond->markAndTrace(); - pendingException->markAndTrace(); +void JavaThread::TRACER { + javaThread->MARK_AND_TRACE; + isolate->MARK_AND_TRACE; + //lock->MARK_AND_TRACE; + //varcond->MARK_AND_TRACE; + pendingException->MARK_AND_TRACE; } -void AssessorDesc::tracer(size_t sz) { - classType->markAndTrace(); +void AssessorDesc::TRACER { + classType->MARK_AND_TRACE; } -void Typedef::tracer(size_t sz) { - keyName->markAndTrace(); - pseudoAssocClassName->markAndTrace(); - funcs->markAndTrace(); - isolate->markAndTrace(); +void Typedef::TRACER { + keyName->MARK_AND_TRACE; + pseudoAssocClassName->MARK_AND_TRACE; + funcs->MARK_AND_TRACE; + isolate->MARK_AND_TRACE; } -void Signdef::tracer(size_t sz) { - Typedef::tracer(sz); +void Signdef::TRACER { + Typedef::PARENT_TRACER; TRACE_VECTOR(Typedef*, std::allocator, args); - ret->markAndTrace(); - _staticCallBuf->markAndTrace(); - _virtualCallBuf->markAndTrace(); - _staticCallAP->markAndTrace(); - _virtualCallAP->markAndTrace(); -} - -void ThreadSystem::tracer(size_t sz) { - //nonDaemonLock->markAndTrace(); - //nonDaemonVar->markAndTrace(); -} - -void Jnjvm::tracer(size_t sz) { - appClassLoader->markAndTrace(); - hashUTF8->markAndTrace(); - hashStr->markAndTrace(); - bootstrapClasses->markAndTrace(); - loadedMethods->markAndTrace(); - loadedFields->markAndTrace(); - javaTypes->markAndTrace(); + ret->MARK_AND_TRACE; + _staticCallBuf->MARK_AND_TRACE; + _virtualCallBuf->MARK_AND_TRACE; + _staticCallAP->MARK_AND_TRACE; + _virtualCallAP->MARK_AND_TRACE; +} + +void ThreadSystem::TRACER { + //nonDaemonLock->MARK_AND_TRACE; + //nonDaemonVar->MARK_AND_TRACE; +} + +void Jnjvm::TRACER { + appClassLoader->MARK_AND_TRACE; + hashUTF8->MARK_AND_TRACE; + hashStr->MARK_AND_TRACE; + bootstrapClasses->MARK_AND_TRACE; + loadedMethods->MARK_AND_TRACE; + loadedFields->MARK_AND_TRACE; + javaTypes->MARK_AND_TRACE; TRACE_VECTOR(JavaObject*, gc_allocator, globalRefs); - //globalRefsLock->markAndTrace(); - functions->markAndTrace(); + //globalRefsLock->MARK_AND_TRACE; + functions->MARK_AND_TRACE; #ifdef MULTIPLE_VM - statics->markAndTrace(); - delegatees->markAndTrace(); + statics->MARK_AND_TRACE; + delegatees->MARK_AND_TRACE; #endif - //protectModule->markAndTrace(); + //protectModule->MARK_AND_TRACE; } -void Reader::tracer(size_t sz) { - bytes->markAndTrace(); +void Reader::TRACER { + bytes->MARK_AND_TRACE; } -void ZipFile::tracer(size_t sz) { +void ZipFile::TRACER { } -void ZipArchive::tracer(size_t sz) { - reader->markAndTrace(); - filetable->markAndTrace(); +void ZipArchive::TRACER { + reader->MARK_AND_TRACE; + filetable->MARK_AND_TRACE; } -void JavaIsolate::tracer(size_t sz) { - Jnjvm::tracer(sz); - threadSystem->markAndTrace(); - bootstrapThread->markAndTrace(); +void JavaIsolate::TRACER { + Jnjvm::PARENT_TRACER; + threadSystem->MARK_AND_TRACE; + bootstrapThread->MARK_AND_TRACE; } -void JavaString::tracer(size_t sz) { +void JavaString::TRACER { } -void CacheNode::tracer(size_t sz) { - ((mvm::Object*)methPtr)->markAndTrace(); - lastCible->markAndTrace(); - next->markAndTrace(); - enveloppe->markAndTrace(); +void CacheNode::TRACER { + ((mvm::Object*)methPtr)->MARK_AND_TRACE; + lastCible->MARK_AND_TRACE; + next->MARK_AND_TRACE; + enveloppe->MARK_AND_TRACE; } -void Enveloppe::tracer(size_t sz) { - firstCache->markAndTrace(); - ctpInfo->markAndTrace(); - //cacheLock->markAndTrace(); +void Enveloppe::TRACER { + firstCache->MARK_AND_TRACE; + ctpInfo->MARK_AND_TRACE; + //cacheLock->MARK_AND_TRACE; +} + +void UTF8Map::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void ClassMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void FieldMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + + +void MethodMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void ZipFileMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void StringMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void FunctionMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->first->MARK_AND_TRACE; + } +} + +void FunctionDefMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void TypeMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } +} + +void StaticInstanceMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->first->MARK_AND_TRACE; + i->second->second->MARK_AND_TRACE; + } +} + +void DelegateeMap::TRACER { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->first->MARK_AND_TRACE; + i->second->MARK_AND_TRACE; + } } #ifdef SERVICE_VM -void ServiceDomain::tracer(size_t sz) { - Jnjvm::tracer(sz); +void ServiceDomain::TRACER { + JavaIsolate::PARENT_TRACER; } #endif Modified: vmkit/trunk/lib/JnJVM/VMCore/Zip.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Zip.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Zip.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Zip.h Thu Apr 17 11:45:26 2008 @@ -39,7 +39,7 @@ buf->write(filename); buf->write(">"); } - virtual void tracer(size_t sz); + virtual void TRACER; }; class ZipArchive : public mvm::Object { @@ -56,7 +56,7 @@ buf->write(name); buf->write(">"); } - virtual void tracer(size_t sz); + virtual void TRACER; static ZipArchive* hashedArchive(Jnjvm* vm, char* archname); static ZipArchive* singleArchive(Jnjvm* vm, char* archname); Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Thu Apr 17 11:45:26 2008 @@ -18,12 +18,25 @@ #define gc_new(Class) __gc_new(Class::VT) Class #define __gc_new new + +#ifdef MULTIPLE_GC +#define TRACER tracer(void* GC) +#define PARENT_TRACER tracer(GC) +#define MARK_AND_TRACE markAndTrace((Collector*)GC) +#else +#define TRACER tracer() +#define PARENT_TRACER tracer() +#define MARK_AND_TRACE markAndTrace() +#endif + class Collector; class gc : public gcRoot { public: - + +#ifndef MULTIPLE_GC void markAndTrace() const; +#endif size_t objectSize() const; void * operator new(size_t sz, VirtualTable *VT); void * operator new(size_t sz); @@ -65,7 +78,9 @@ STATIC void collect(void); STATIC void inject_my_thread(void *sp); STATIC void remove_my_thread(); +#ifdef MULTIPLE_GC static Collector* allocate(); +#endif STATIC gc *begOf(const void *o); STATIC int byteOffset(void *o); Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Thu Apr 17 11:45:26 2008 @@ -26,9 +26,15 @@ memoryError_t GCCollector::internMemoryError; +#ifdef MULTIPLE_GC +void gc::markAndTrace(Collector* GC) const { + ((GCCollector*)GC)->markAndTrace((void*)this); +} +#else void gc::markAndTrace() const { - COLLECTOR markAndTrace((void*)this); + GCCollector::markAndTrace((void*)this); } +#endif size_t gc::objectSize() const { return COLLECTOR objectSize((gc*)this); @@ -52,9 +58,6 @@ #ifdef MULTIPLE_GC -void gc::markAndTrace(Collector* GC) const { - ((GCCollector*)GC)->markAndTrace((void*)this); -} size_t gc::objectSize(Collector* GC) const { return ((GCCollector*)GC)->objectSize((gc*)this); @@ -104,6 +107,7 @@ void Collector::initialise(markerFn marker, void *base_sp) { #ifdef MULTIPLE_GC GCCollector* GC = new GCCollector(); + GCCollector::bootstrapGC = GC; mvm::Thread::get()->GC = GC; GC->initialise(marker); GC->inject_my_thread(base_sp); @@ -190,8 +194,12 @@ #undef COLLECTOR void GCCollector::siggc_handler(int) { -#ifdef MULTIPLE_GC +#if defined(MULTIPLE_GC) +#if defined(SERVICE_GC) + GCCollector* GC = collectingGC; +#else GCCollector* GC = ((GCCollector*)mvm::Thread::get()->GC); +#endif #define COLLECTOR GC-> #else #define COLLECTOR GCCollector:: @@ -227,12 +235,12 @@ COLLECTOR threads->stackUnlock(); #undef COLLECTOR } -#endif - +#endif // HAVE_PTHREAD +#ifdef MULTIPLE_GC Collector* Collector::allocate() { GCCollector* GC = new GCCollector(); - GC->initialise(0); + GC->initialise(GCCollector::bootstrapGC->_marker); return GC; } - +#endif // MULTIPLE_GC Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp Thu Apr 17 11:45:26 2008 @@ -34,8 +34,13 @@ GCChunkNode *GCCollector::unused_nodes; unsigned int GCCollector::current_mark; +#else +GCCollector* GCCollector::bootstrapGC; #endif +#ifdef SERVICE_GC +GCCollector* GCCollector::collectingGC; +#endif void GCCollector::do_collect() { //printf("----- do collect -----\n"); @@ -48,6 +53,10 @@ unused_nodes->attrape(used_nodes); +#ifdef SERVICE_GC + collectingGC = this; +#endif + #ifdef HAVE_PTHREAD threads->synchronize(); #endif @@ -81,7 +90,7 @@ //printf(" !!!! reject %p [%p]\n", cur->chunk()->_2gc(), cur); allocator->reject_chunk(cur); } - + used_nodes->alone(); } void GCCollector::collect_unprotect() { Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.h Thu Apr 17 11:45:26 2008 @@ -31,7 +31,6 @@ #endif STATIC GCAllocator *allocator; /* The allocator */ - STATIC Collector::markerFn _marker; /* The function which traces roots */ STATIC GCChunkNode *used_nodes; /* Used memory nodes */ STATIC GCChunkNode *unused_nodes; /* Unused memory nodes */ @@ -45,7 +44,8 @@ STATIC bool _enable_maybe; /* Collection in maybeCollect()? */ STATIC bool _enable_collection; /* collection authorized? */ STATIC int status; - + + enum { stat_collect, stat_finalize, stat_alloc, stat_broken }; #ifdef HAVE_PTHREAD @@ -72,6 +72,13 @@ } public: + STATIC Collector::markerFn _marker; /* The function which traces roots */ +#ifdef SERVICE_GC + static GCCollector* collectingGC; +#endif +#ifdef MULTIPLE_GC + static GCCollector* bootstrapGC; +#endif STATIC GCThread *threads; /* le gestionnaire de thread et de synchro */ static void (*internMemoryError)(unsigned int); @@ -206,7 +213,11 @@ STATIC inline void trace(GCChunkNode *node) { gc_header *o = node->chunk(); - o->_2gc()->tracer(real_nbb(node)); +#ifdef MULTIPLE_GC + o->_2gc()->tracer(this); +#else + o->_2gc()->tracer(); +#endif markAndTrace(o); } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp Thu Apr 17 11:45:26 2008 @@ -30,8 +30,15 @@ used_nodes = new GCChunkNode(); unused_nodes = new GCChunkNode(); #ifdef HAVE_PTHREAD +#ifdef SERVICE_GC + if (this != bootstrapGC) + threads = bootstrapGC->threads; + else + threads = new GCThread(); +#else threads = new GCThread(); #endif +#endif struct sigaction sa; sigset_t mask; Modified: vmkit/trunk/lib/Mvm/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/JIT.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/JIT.cpp Thu Apr 17 11:45:26 2008 @@ -553,17 +553,8 @@ constantPtrNull = Constant::getNullValue(ptrType); arrayPtrType = PointerType::getUnqual(ArrayType::get(Type::Int8Ty, 0)); - - //mvm::jit::protectTypes = mvm::Lock::allocNormal(); - //mvm::Object::pushRoot((mvm::Object*)mvm::jit::protectTypes); - - //mvm::jit::protectConstants = mvm::Lock::allocNormal(); - //mvm::Object::pushRoot((mvm::Object*)mvm::jit::protectConstants); - mvm::jit::protectEngine = mvm::Lock::allocNormal(); - mvm::Object::pushRoot((mvm::Object*)mvm::jit::protectEngine); - } llvm::Function* mvm::jit::llvm_memcpy_i32; Modified: vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp (original) +++ vmkit/trunk/lib/Mvm/MvmMemoryManager.cpp Thu Apr 17 11:45:26 2008 @@ -20,8 +20,8 @@ unsigned char* MvmMemoryManager::startFunctionBody(const Function* F, uintptr_t &ActualSize) { size_t nbb = ((ActualSize - 1) & -4) + 4 + sizeof(Method *); -#ifdef MUTLIPLE_GC - Collector* GC = GCMap[F->getModule()]; +#ifdef MULTIPLE_GC + Collector* GC = GCMap[F->getParent()]; assert(GC && "GC not available in a multi-GC environment"); Code *res = (Code *)gc::operator new(nbb, Code::VT, GC); Method* meth = collector_new(Method, GC)(res, ActualSize); @@ -29,6 +29,7 @@ Code *res = (Code *)gc::operator new(nbb, Code::VT); Method* meth = gc_new(Method)(res, ActualSize); #endif + meth->llvmFunction = F; res->method(meth); currentMethod = meth; return (unsigned char*)((unsigned int*)res + 2); @@ -65,8 +66,8 @@ unsigned char *MvmMemoryManager::startExceptionTable(const Function* F, uintptr_t &ActualSize) { -#ifdef MUTLIPLE_GC - Collector* GC = GCMap[F->getModule()]; +#ifdef MULTIPLE_GC + Collector* GC = GCMap[F->getParent()]; assert(GC && "GC not available in a multi-GC environment"); ExceptionTable *res = (ExceptionTable*)gc::operator new(ActualSize + 4, ExceptionTable::VT, Modified: vmkit/trunk/lib/Mvm/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Object.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Object.cpp Thu Apr 17 11:45:26 2008 @@ -47,7 +47,11 @@ void Object::markAndTraceRoots(void) { for (int i= 0; i < rootTableSize; ++i) - rootTable[i]->markAndTrace(); +#ifdef MULTIPLE_GC + rootTable[i]->markAndTrace(mvm::Thread::get()->GC); +#else + rootTable[i]->markAndTrace();; +#endif } void Object::initialise() { @@ -65,21 +69,21 @@ #undef INIT } -void Code::tracer(size_t sz) { - this->method(sz)->markAndTrace(); +void Code::TRACER { + this->method()->MARK_AND_TRACE; } -void Method::tracer(size_t sz) { +void Method::TRACER { Method *const self= (Method *)this; - self->definition()->markAndTrace(); - self->literals()->markAndTrace(); - self->name()->markAndTrace(); - self->code()->markAndTrace(); - self->exceptionTable()->markAndTrace(); + self->definition()->MARK_AND_TRACE; + self->literals()->MARK_AND_TRACE; + self->name()->MARK_AND_TRACE; + self->code()->MARK_AND_TRACE; + self->exceptionTable()->MARK_AND_TRACE; } -void PrintBuffer::tracer(size_t sz) { - ((PrintBuffer *)this)->contents()->markAndTrace(); +void PrintBuffer::TRACER { + ((PrintBuffer *)this)->contents()->MARK_AND_TRACE; } PrintBuffer *PrintBuffer::alloc(void) { @@ -88,7 +92,11 @@ PrintBuffer *PrintBuffer::writeObj(const Object *obj) { +#ifdef MULTIPLE_GC Object *beg = (Object*)mvm::Thread::get()->GC->begOf(obj); +#else + Object *beg = (Object*)Collector::begOf(obj); +#endif if(beg) { if(beg == obj) { Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Thu Apr 17 11:45:26 2008 @@ -53,7 +53,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; char* name; uint32 virtualSize; @@ -73,7 +73,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; char* name; uint32 realOffset; @@ -84,7 +84,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 offset; uint32 rowsNumber; @@ -102,7 +102,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 signature; uint32 major; @@ -134,7 +134,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; VMClassPointer* constructPointer(VMCommonClass* base, uint32 dims); VMClassArray* constructArray(VMCommonClass* base, uint32 dims); Modified: vmkit/trunk/lib/N3/VMCore/BackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/BackTrace.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/BackTrace.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/BackTrace.cpp Thu Apr 17 11:45:26 2008 @@ -35,34 +35,25 @@ int real_size = backtrace((void**)(void*)ips, 100); int n = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - VMMethod* meth = (VMMethod*)m->definition(); - if (meth) - printf("; 0x%08x in %s\n", (uint32) ips[n - 1], meth->printString()); - else - printf("; 0x%08x in %s\n", (uint32) ips[n - 1], - ((llvm::Function*)glob)->getNameStr().c_str()); - } else VMThread::get()->vm->unknownError("in global variable?"); - } else printf("; 0x%08x in stub\n", (uint32) ips[n - 1]); + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == VMMethod::VT) { + printf("; %p in %s\n", ips[n - 1], meth->printString()); + } else if (m->llvmFunction) { + printf("; %p in %s\n", ips[n - 1], + m->llvmFunction->getNameStr().c_str()); + } else { + printf("; %p in %s\n", ips[n - 1], "stub (probably)"); + } } else { Dl_info info; - int res = dladdr(begIp, &info); + int res = dladdr(ips[n++], &info); if (res != 0) { - printf("; 0x%08x in %s\n", (uint32) ips[n - 1], info.dli_fname); + printf("; %p in %s\n", ips[n - 1], info.dli_sname); } else { - printf("; 0x%08x in Unknown\n", (uint32) ips[n - 1]); + printf("; %p in Unknown\n", ips[n - 1]); } } } @@ -74,30 +65,13 @@ int* ips[10]; int real_size = backtrace((void**)(void*)ips, 10); int n = 0; - int i = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - VMMethod* meth = (VMMethod*)m->definition(); - if (meth && meth->getVirtualTable() == VMMethod::VT) { - return meth->classDef->assembly; - } else { - ++i; - } - } else { - VMThread::get()->vm->unknownError("in global variable?"); - } + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && meth->getVirtualTable() == VMMethod::VT) { + return ((VMMethod*)meth)->classDef->assembly; } } } @@ -110,28 +84,14 @@ int n = 0; int i = 0; while (n < real_size) { -#ifdef MULTIPLE_GC - int *begIp = (int*)mvm::Thread::get()->GC->begOf(ips[n++]); -#else - int *begIp = (int*)Collector::begOf(ips[n++]); -#endif - if (begIp) { - unsigned char* val = (unsigned char*)begIp + sizeof(mvm::Code); - const llvm::GlobalValue * glob = - mvm::jit::executionEngine->getGlobalValueAtAddress(val); - if (glob) { - if (llvm::isa(glob)) { - mvm::Code* c = (mvm::Code*)begIp; - mvm::Method* m = c->method(); - VMMethod* meth = (VMMethod*)m->definition(); - if (meth && i >= 1 && meth->getVirtualTable() == VMMethod::VT) { - return meth->classDef->assembly; - } else { - ++i; - } - } else { - VMThread::get()->vm->unknownError("in global variable?"); - } + mvm::Code* code = mvm::Code::getCodeFromPointer(ips[n++]); + if (code) { + mvm::Method* m = code->method(); + mvm::Object* meth = m->definition(); + if (meth && i >= 1 && meth->getVirtualTable() == VMMethod::VT) { + return ((VMMethod*)meth)->classDef->assembly; + } else { + ++i; } } } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Thu Apr 17 11:45:26 2008 @@ -55,9 +55,14 @@ #ifdef WITH_TRACER // for structs -static void traceStruct(VMCommonClass* cl, BasicBlock* block, Value* arg) { +static void traceStruct(VMCommonClass* cl, BasicBlock* block, Value* arg) { +#ifdef MULTIPLE_GC + Value* GC = ++(block->getParent()->arg_begin()); +#endif + for (std::vector::iterator i = cl->virtualFields.begin(), e = cl->virtualFields.end(); i!= e; ++i) { + VMField* field = *i; if (field->signature->super == N3::pValue) { if (!field->signature->isPrimitive) { @@ -67,11 +72,27 @@ } else if (field->signature == N3::pIntPtr || field->signature == N3::pUIntPtr) { Value* valCast = new BitCastInst(arg, VMObject::llvmType, "", block); +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(valCast); + Args.push_back(GC); + CallInst::Create(CLIJit::markAndTraceLLVM, Args.begin(), Args.end(), + "", block); +#else CallInst::Create(CLIJit::markAndTraceLLVM, valCast, "", block); +#endif } } else if (field->signature->super != N3::pEnum) { Value* valCast = new BitCastInst(arg, VMObject::llvmType, "", block); +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(valCast); + Args.push_back(GC); + CallInst::Create(CLIJit::markAndTraceLLVM, Args.begin(), Args.end(), + "", block); +#else CallInst::Create(CLIJit::markAndTraceLLVM, valCast, "", block); +#endif } } } @@ -80,6 +101,9 @@ // Always classes static void traceClass(VMCommonClass* cl, BasicBlock* block, Value* arg, std::vector& fields, bool boxed = false) { +#ifdef MULTIPLE_GC + Value* GC = ++(block->getParent()->arg_begin()); +#endif Constant* zero = mvm::jit::constantZero; for (std::vector::iterator i = fields.begin(), @@ -112,7 +136,15 @@ block); Value* val = new LoadInst(ptr, "", block); Value* valCast = new BitCastInst(val, VMObject::llvmType, "", block); +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(valCast); + Args.push_back(GC); + CallInst::Create(CLIJit::markAndTraceLLVM, Args.begin(), Args.end(), + "", block); +#else CallInst::Create(CLIJit::markAndTraceLLVM, valCast, "", block); +#endif } } } @@ -127,7 +159,9 @@ "markAndTraceObject", cl->vm->module); Argument* arg = func->arg_begin(); - +#ifdef MULTIPLE_GC + Argument* GC = ++(func->arg_begin()); +#endif // Constant Definitions Constant* const_int32_8 = mvm::jit::constantZero; ConstantInt* const_int32_9 = mvm::jit::constantOne; @@ -181,7 +215,15 @@ } else if (cl->baseClass->super != N3::pEnum) { LoadInst* ptr_tmp4 = new LoadInst(ptr_tmp3, "tmp4", false, label_bb); Value* arg = new BitCastInst(ptr_tmp4, VMObject::llvmType, "", label_bb); +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(arg); + Args.push_back(GC); + CallInst::Create(markAndTraceLLVM, Args.begin(), Args.end(), "", + label_bb); +#else CallInst::Create(markAndTraceLLVM, arg, "", label_bb); +#endif } BinaryOperator* int32_tmp6 = BinaryOperator::create(Instruction::Add, int32_i_015_0, const_int32_9, @@ -202,7 +244,7 @@ void* tracer = mvm::jit::executionEngine->getPointerToGlobal(func); ((void**)res)[VT_TRACER_OFFSET] = tracer; cl->virtualTracer = func; - cl->codeVirtualTracer = (mvm::Code*)((intptr_t)tracer - sizeof(intptr_t)); + cl->codeVirtualTracer = mvm::Code::getCodeFromPointer(tracer); #endif return res; @@ -221,14 +263,29 @@ cl->vm->module); Argument* arg = func->arg_begin(); +#ifdef MULTIPLE_GC + Argument* GC = ++(func->arg_begin()); +#endif BasicBlock* block = BasicBlock::Create("", func); llvm::Value* realArg = new BitCastInst(arg, type, "", block); - + +#ifdef MULTIPLE_GC + std::vector Args; + Args.push_back(arg); + Args.push_back(GC); + if (stat || cl->super == 0) { + CallInst::Create(vmObjectTracerLLVM, Args.begin(), Args.end(), "", block); + } else { + CallInst::Create(((VMClass*)cl->super)->virtualTracer, Args.begin(), + Args.end(), "", block); + } +#else if (stat || cl->super == 0) { CallInst::Create(vmObjectTracerLLVM, arg, "", block); } else { CallInst::Create(((VMClass*)cl->super)->virtualTracer, arg, "", block); } +#endif traceClass(cl, block, realArg, fields, (cl->super == N3::pValue && !stat)); ReturnInst::Create(block); @@ -238,10 +295,10 @@ if (!stat) { cl->virtualTracer = func; - cl->codeVirtualTracer = (mvm::Code*)((intptr_t)tracer - sizeof(intptr_t)); + cl->codeVirtualTracer = mvm::Code::getCodeFromPointer(tracer); } else { cl->staticTracer = func; - cl->codeStaticTracer = (mvm::Code*)((intptr_t)tracer - sizeof(intptr_t)); + cl->codeStaticTracer = mvm::Code::getCodeFromPointer(tracer); } #endif return res; @@ -1443,11 +1500,7 @@ extern "C" bool isInCode(void* value) { -#ifdef MULTIPLE_GC - mvm::Object* obj = (mvm::Object*)mvm::Thread::get()->GC->begOf(value); -#else - mvm::Object* obj = (mvm::Object*)Collector::begOf(value); -#endif + mvm::Object *obj = mvm::Code::getCodeFromPointer(value); if (obj && obj->getVirtualTable() == mvm::Code::VT) { return true; } else { @@ -1584,10 +1637,17 @@ { std::vector args; args.push_back(VMObject::llvmType); +#ifdef MULTIPLE_GC + args.push_back(mvm::jit::ptrType); +#endif markAndTraceLLVMType = FunctionType::get(llvm::Type::VoidTy, args, false); markAndTraceLLVM = Function::Create(markAndTraceLLVMType, GlobalValue::ExternalLinkage, +#ifdef MULTIPLE_GC + "_ZNK2gc12markAndTraceEP9Collector", +#else "_ZNK2gc12markAndTraceEv", +#endif module); } #endif @@ -1596,10 +1656,17 @@ { std::vector args; args.push_back(VMObject::llvmType); +#ifdef MULTIPLE_GC + args.push_back(mvm::jit::ptrType); +#endif const FunctionType* type = FunctionType::get(Type::VoidTy, args, false); vmObjectTracerLLVM = Function::Create(type, GlobalValue::ExternalLinkage, - "_ZN2n38VMObject6tracerEj", +#ifdef MULTIPLE_GC + "_ZN2n38VMObject6tracerEPv", +#else + "_ZN2n38VMObject6tracerEv", +#endif module); } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Thu Apr 17 11:45:26 2008 @@ -50,7 +50,7 @@ llvm::BasicBlock* handler; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; class Opinfo : public mvm::Object { @@ -64,7 +64,7 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("Opinfo"); } - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -75,7 +75,7 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLIJit"); } - virtual void tracer(size_t sz); + virtual void TRACER; static const char* OpcodeNames[0xE1]; Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Thu Apr 17 11:45:26 2008 @@ -28,7 +28,7 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLI string"); } - virtual void tracer(size_t sz); + virtual void TRACER; // !!! pnetlib layout !!! sint32 capacity; Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Thu Apr 17 11:45:26 2008 @@ -90,10 +90,10 @@ lock->unlock(); } - virtual void tracer(size_t sz) { - //lock->markAndTrace(); + virtual void TRACER { + //lock->MARK_AND_TRACE; for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); + i->second->MARK_AND_TRACE; } } @@ -210,10 +210,10 @@ const UTF8* lookupOrCreateAsciiz(const char* asciiz); const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); - virtual void tracer(size_t sz) { - //lock->markAndTrace(); + virtual void TRACER { + //lock->MARK_AND_TRACE; for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->markAndTrace(); + i->second->MARK_AND_TRACE; } } Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Thu Apr 17 11:45:26 2008 @@ -36,7 +36,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; VMObject* asciizToStr(const char* asciiz); VMObject* UTF8ToStr(const UTF8* utf8); Modified: vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp Thu Apr 17 11:45:26 2008 @@ -40,7 +40,7 @@ if (res == 0) { CLIJit::compile(meth->classDef, meth); void* res = mvm::jit::executionEngine->getPointerToGlobal(meth->methPtr); - meth->code = (mvm::Code*)((intptr_t)res - sizeof(mvm::Code)); + meth->code = mvm::Code::getCodeFromPointer(res); meth->code->method()->definition(meth); } meth->classDef->release(); Modified: vmkit/trunk/lib/N3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.h (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.h Thu Apr 17 11:45:26 2008 @@ -50,7 +50,7 @@ void seek(uint32 pos, int from); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; static sint8 inline READ_S1(ArrayUInt8* bytes, uint32& offset) { Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Thu Apr 17 11:45:26 2008 @@ -37,7 +37,7 @@ static llvm::ConstantInt* sizeOffset(); static llvm::ConstantInt* elementsOffset(); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -54,7 +54,7 @@ elmt at(sint32) const; \ void setAt(sint32, elmt); \ virtual void print(mvm::PrintBuffer* buf) const; \ - virtual void tracer(size_t sz); \ + virtual void TRACER; \ } ARRAYCLASS(ArrayUInt8, uint8); @@ -79,7 +79,7 @@ VMObject* at(sint32) const; void setAt(sint32, VMObject*); virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; }; class UTF8 : public VMArray { Modified: vmkit/trunk/lib/N3/VMCore/VMCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.h Thu Apr 17 11:45:26 2008 @@ -29,7 +29,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void* methPtr; VMClass* lastCible; @@ -46,7 +46,7 @@ class Enveloppe : public mvm::Object { public: static VirtualTable* VT; - virtual void tracer(size_t sz); + virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const; CacheNode *firstCache; Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Thu Apr 17 11:45:26 2008 @@ -45,7 +45,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; std::vector virtualMethods; std::vector staticMethods; @@ -130,7 +130,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; void resolveFields(); void resolveStaticFields(); @@ -153,7 +153,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 dims; VMCommonClass* baseClass; @@ -175,7 +175,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 dims; VMCommonClass* baseClass; @@ -187,7 +187,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 flags; uint32 offset; @@ -228,7 +228,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 flags; llvm::ConstantInt* offset; @@ -261,7 +261,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; uint32 flags; uint32 sequence; @@ -273,7 +273,7 @@ public: static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; std::vector parameters; VMCommonClass* type; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Thu Apr 17 11:45:26 2008 @@ -41,7 +41,7 @@ void wait(VMThread* th); void remove(VMThread* th); - virtual void tracer(size_t sz); + virtual void TRACER; }; @@ -52,7 +52,7 @@ VMCond* varcond; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static LockObj* allocate(); void aquire(); @@ -72,7 +72,7 @@ static const llvm::Type* llvmType; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static VMObject* allocate(VMCommonClass* cl); void aquire(); Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Thu Apr 17 11:45:26 2008 @@ -44,7 +44,7 @@ static const unsigned int StateInterrupted; virtual void print(mvm::PrintBuffer *buf); - virtual void tracer(size_t sz); + virtual void TRACER; virtual void destroyer(size_t sz); static VMThread* get(); Modified: vmkit/trunk/lib/N3/VMCore/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualMachine.h?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualMachine.h (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualMachine.h Thu Apr 17 11:45:26 2008 @@ -38,7 +38,7 @@ mvm::Cond* nonDaemonVar; virtual void print(mvm::PrintBuffer* buf) const; - virtual void tracer(size_t sz); + virtual void TRACER; static ThreadSystem* allocateThreadSystem(); }; @@ -110,7 +110,7 @@ void error(const char* className, const char* fmt, va_list ap); - virtual void tracer(size_t sz); + virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const { buf->write("Virtual Machine<>"); } Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=49859&r1=49858&r2=49859&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Thu Apr 17 11:45:26 2008 @@ -76,50 +76,50 @@ #undef INIT -void Opinfo::tracer(size_t sz) { +void Opinfo::TRACER { } -void CLIJit::tracer(size_t sz) { - compilingMethod->markAndTrace(); - compilingClass->markAndTrace(); +void CLIJit::TRACER { + compilingMethod->MARK_AND_TRACE; + compilingClass->MARK_AND_TRACE; } -void ThreadSystem::tracer(size_t sz) { - //nonDaemonLock->markAndTrace(); - //nonDaemonVar->markAndTrace(); +void ThreadSystem::TRACER { + //nonDaemonLock->MARK_AND_TRACE; + //nonDaemonVar->MARK_AND_TRACE; } -void Reader::tracer(size_t sz) { - bytes->markAndTrace(); +void Reader::TRACER { + bytes->MARK_AND_TRACE; } -void CacheNode::tracer(size_t sz) { - ((mvm::Object*)methPtr)->markAndTrace(); - lastCible->markAndTrace(); - next->markAndTrace(); - enveloppe->markAndTrace(); +void CacheNode::TRACER { + ((mvm::Object*)methPtr)->MARK_AND_TRACE; + lastCible->MARK_AND_TRACE; + next->MARK_AND_TRACE; + enveloppe->MARK_AND_TRACE; } -void Enveloppe::tracer(size_t sz) { - firstCache->markAndTrace(); - //cacheLock->markAndTrace(); - originalMethod->markAndTrace(); +void Enveloppe::TRACER { + firstCache->MARK_AND_TRACE; + //cacheLock->MARK_AND_TRACE; + originalMethod->MARK_AND_TRACE; } -void VMArray::tracer(size_t sz) { - VMObject::tracer(sz); +void VMArray::TRACER { + VMObject::PARENT_TRACER; } -void ArrayObject::tracer(size_t sz) { - VMObject::tracer(sz); +void ArrayObject::TRACER { + VMObject::PARENT_TRACER; for (sint32 i = 0; i < size; i++) { - elements[i]->markAndTrace(); + elements[i]->MARK_AND_TRACE; } } #define ARRAYTRACER(name) \ - void name::tracer(size_t sz) { \ - VMObject::tracer(sz); \ + void name::TRACER { \ + VMObject::PARENT_TRACER; \ } @@ -139,154 +139,154 @@ #define TRACE_VECTOR(type, name, alloc) { \ for (std::vector >::iterator i = name.begin(), e = name.end(); \ i!= e; ++i) { \ - (*i)->markAndTrace(); }} + (*i)->MARK_AND_TRACE; }} -void VMCommonClass::tracer(size_t sz) { - name->markAndTrace(); - nameSpace->markAndTrace(); - super->markAndTrace(); +void VMCommonClass::TRACER { + name->MARK_AND_TRACE; + nameSpace->MARK_AND_TRACE; + super->MARK_AND_TRACE; TRACE_VECTOR(VMClass*, interfaces, std::allocator); - //lockVar->markAndTrace(); - //condVar->markAndTrace(); + //lockVar->MARK_AND_TRACE; + //condVar->MARK_AND_TRACE; TRACE_VECTOR(VMMethod*, virtualMethods, std::allocator); TRACE_VECTOR(VMMethod*, staticMethods, std::allocator); TRACE_VECTOR(VMField*, virtualFields, std::allocator); TRACE_VECTOR(VMField*, staticFields, std::allocator); - delegatee->markAndTrace(); + delegatee->MARK_AND_TRACE; TRACE_VECTOR(VMCommonClass*, display, std::allocator); - vm->markAndTrace(); + vm->MARK_AND_TRACE; - assembly->markAndTrace(); - //funcs->markAndTrace(); + assembly->MARK_AND_TRACE; + //funcs->MARK_AND_TRACE; TRACE_VECTOR(Property*, properties, gc_allocator); - codeVirtualTracer->markAndTrace(); - codeStaticTracer->markAndTrace(); + codeVirtualTracer->MARK_AND_TRACE; + codeStaticTracer->MARK_AND_TRACE; } -void VMClass::tracer(size_t sz) { - VMCommonClass::tracer(sz); - staticInstance->markAndTrace(); - virtualInstance->markAndTrace(); +void VMClass::TRACER { + VMCommonClass::PARENT_TRACER; + staticInstance->MARK_AND_TRACE; + virtualInstance->MARK_AND_TRACE; TRACE_VECTOR(VMClass*, innerClasses, std::allocator); - outerClass->markAndTrace(); + outerClass->MARK_AND_TRACE; } -void VMClassArray::tracer(size_t sz) { - VMCommonClass::tracer(sz); - baseClass->markAndTrace(); +void VMClassArray::TRACER { + VMCommonClass::PARENT_TRACER; + baseClass->MARK_AND_TRACE; } -void VMClassPointer::tracer(size_t sz) { - VMCommonClass::tracer(sz); - baseClass->markAndTrace(); +void VMClassPointer::TRACER { + VMCommonClass::PARENT_TRACER; + baseClass->MARK_AND_TRACE; } -void VMMethod::tracer(size_t sz) { - delegatee->markAndTrace(); - //signature->markAndTrace(); - classDef->markAndTrace(); +void VMMethod::TRACER { + delegatee->MARK_AND_TRACE; + //signature->MARK_AND_TRACE; + classDef->MARK_AND_TRACE; TRACE_VECTOR(Param*, params, gc_allocator); TRACE_VECTOR(Enveloppe*, caches, gc_allocator); - name->markAndTrace(); - code->markAndTrace(); + name->MARK_AND_TRACE; + code->MARK_AND_TRACE; } -void VMField::tracer(size_t sz) { - signature->markAndTrace(); - classDef->markAndTrace(); - name->markAndTrace(); +void VMField::TRACER { + signature->MARK_AND_TRACE; + classDef->MARK_AND_TRACE; + name->MARK_AND_TRACE; } -void VMCond::tracer(size_t sz) { +void VMCond::TRACER { TRACE_VECTOR(VMThread*, threads, std::allocator); } -void LockObj::tracer(size_t sz) { - //lock->markAndTrace(); - varcond->markAndTrace(); -} - -void VMObject::tracer(size_t sz) { - classOf->markAndTrace(); - lockObj->markAndTrace(); -} - -void VMThread::tracer(size_t sz) { - vmThread->markAndTrace(); - vm->markAndTrace(); - //lock->markAndTrace(); - //varcond->markAndTrace(); - pendingException->markAndTrace(); -} - -void VirtualMachine::tracer(size_t sz) { - threadSystem->markAndTrace(); - hashUTF8->markAndTrace(); - functions->markAndTrace(); - //protectModule->markAndTrace(); - bootstrapThread->markAndTrace(); -} - -void Param::tracer(size_t sz) { - method->markAndTrace(); - name->markAndTrace(); -} - -void Property::tracer(size_t sz) { - type->markAndTrace(); - //signature->markAndTrace(); - name->markAndTrace(); - delegatee->markAndTrace(); -} - -void Assembly::tracer(size_t sz) { - loadedNameClasses->markAndTrace(); - loadedTokenClasses->markAndTrace(); - loadedTokenMethods->markAndTrace(); - loadedTokenFields->markAndTrace(); - //lockVar->markAndTrace(); - //condVar->markAndTrace(); - name->markAndTrace(); - bytes->markAndTrace(); - textSection->markAndTrace(); - rsrcSection->markAndTrace(); - relocSection->markAndTrace(); - CLIHeader->markAndTrace(); - vm->markAndTrace(); - delegatee->markAndTrace(); +void LockObj::TRACER { + //lock->MARK_AND_TRACE; + varcond->MARK_AND_TRACE; +} + +void VMObject::TRACER { + classOf->MARK_AND_TRACE; + lockObj->MARK_AND_TRACE; +} + +void VMThread::TRACER { + vmThread->MARK_AND_TRACE; + vm->MARK_AND_TRACE; + //lock->MARK_AND_TRACE; + //varcond->MARK_AND_TRACE; + pendingException->MARK_AND_TRACE; +} + +void VirtualMachine::TRACER { + threadSystem->MARK_AND_TRACE; + hashUTF8->MARK_AND_TRACE; + functions->MARK_AND_TRACE; + //protectModule->MARK_AND_TRACE; + bootstrapThread->MARK_AND_TRACE; +} + +void Param::TRACER { + method->MARK_AND_TRACE; + name->MARK_AND_TRACE; +} + +void Property::TRACER { + type->MARK_AND_TRACE; + //signature->MARK_AND_TRACE; + name->MARK_AND_TRACE; + delegatee->MARK_AND_TRACE; +} + +void Assembly::TRACER { + loadedNameClasses->MARK_AND_TRACE; + loadedTokenClasses->MARK_AND_TRACE; + loadedTokenMethods->MARK_AND_TRACE; + loadedTokenFields->MARK_AND_TRACE; + //lockVar->MARK_AND_TRACE; + //condVar->MARK_AND_TRACE; + name->MARK_AND_TRACE; + bytes->MARK_AND_TRACE; + textSection->MARK_AND_TRACE; + rsrcSection->MARK_AND_TRACE; + relocSection->MARK_AND_TRACE; + CLIHeader->MARK_AND_TRACE; + vm->MARK_AND_TRACE; + delegatee->MARK_AND_TRACE; // TODO trace assembly refs... } -void N3::tracer(size_t sz) { - VirtualMachine::tracer(sz); - hashUTF8->markAndTrace(); - hashStr->markAndTrace(); - loadedAssemblies->markAndTrace(); +void N3::TRACER { + VirtualMachine::PARENT_TRACER; + hashUTF8->MARK_AND_TRACE; + hashStr->MARK_AND_TRACE; + loadedAssemblies->MARK_AND_TRACE; } -void Section::tracer(size_t sz) { +void Section::TRACER { } -void Stream::tracer(size_t sz) { +void Stream::TRACER { } -void Table::tracer(size_t sz) { +void Table::TRACER { } -void Header::tracer(size_t sz) { - versionName->markAndTrace(); - tildStream->markAndTrace(); - stringStream->markAndTrace(); - usStream->markAndTrace(); - blobStream->markAndTrace(); - guidStream->markAndTrace(); +void Header::TRACER { + versionName->MARK_AND_TRACE; + tildStream->MARK_AND_TRACE; + stringStream->MARK_AND_TRACE; + usStream->MARK_AND_TRACE; + blobStream->MARK_AND_TRACE; + guidStream->MARK_AND_TRACE; TRACE_VECTOR(Table*, tables, gc_allocator); } -void CLIString::tracer(size_t sz) { +void CLIString::TRACER { } -void Exception::tracer(size_t sz) { - catchClass->markAndTrace(); +void Exception::TRACER { + catchClass->MARK_AND_TRACE; } From isanbard at gmail.com Thu Apr 17 13:23:05 2008 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 17 Apr 2008 11:23:05 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49857 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <200804171641.m3HGfedm015356@zion.cs.uiuc.edu> References: <200804171641.m3HGfedm015356@zion.cs.uiuc.edu> Message-ID: <16e5fdf90804171123m19f3daa3q533f6b3fc7062228@mail.gmail.com> On Thu, Apr 17, 2008 at 9:41 AM, Devang Patel wrote: > Author: dpatel > Date: Thu Apr 17 11:41:39 2008 > New Revision: 49857 > > URL: http://llvm.org/viewvc/llvm-project?rev=49857&view=rev > Log: > Check _Complex return type. > > Modified: > llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49857&r1=49856&r2=49857&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 17 11:41:39 2008 > @@ -906,6 +906,9 @@ > if (!TARGET_64BIT) > return false; > > + if (TREE_CODE(type) == COMPLEX_TYPE) > + return true; > +` What's the ` doing? -bw > if (AGGREGATE_TYPE_P(type)) { > tree field = TYPE_FIELDS(type); > if (field && TREE_CHAIN(field) == NULL > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From gohman at apple.com Thu Apr 17 13:46:01 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Apr 2008 11:46:01 -0700 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/C In-Reply-To: References: Message-ID: On Apr 17, 2008, at 7:14 AM, Roman Levenstein wrote: > > So, we should have iterators that iterate only over the users of a > specific value. Do you mean something like providing a constructor > parameter with the specific value number and then having the iterator > pointing only to the uses of this value and skipping everything not > matching this value? > > I attach a possible patch implementing this. Please have a look and > tell me if this is what you mean. I think so. I don't have time at the moment to look at it in detail, but if you can rewrite hasAnyUseOfValue using this, then it's quite likely a good direction :-). Dan From romix.llvm at googlemail.com Thu Apr 17 14:56:27 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Thu, 17 Apr 2008 23:56:27 +0400 Subject: [llvm-commits] [llvm] r49795 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/C In-Reply-To: References: Message-ID: 2008/4/17, Dan Gohman : > > On Apr 17, 2008, at 7:14 AM, Roman Levenstein wrote: > > > > So, we should have iterators that iterate only over the users of a > > specific value. Do you mean something like providing a constructor > > parameter with the specific value number and then having the iterator > > pointing only to the uses of this value and skipping everything not > > matching this value? > > > > I attach a possible patch implementing this. Please have a look and > > tell me if this is what you mean. > > > I think so. I don't have time at the moment to look at it in detail, > but if you can rewrite hasAnyUseOfValue using this, then it's quite > likely a good direction :-). I agree that this appraoch provides a more elegant and simpler way to express some things. But it does not provide any performance wins, as far as I can see (unless we link all the uses of the same SDNode result together for faster iteration over them). So, what is the aim of doing it this way? Only the elegance of the code? Or do you have something else in mind? -Roman From ggreif at gmail.com Thu Apr 17 15:31:40 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 20:31:40 -0000 Subject: [llvm-commits] [llvm] r49866 - /llvm/branches/ggreif/use-diet/include/llvm/Use.h Message-ID: <200804172031.m3HKVeD2022637@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 15:31:38 2008 New Revision: 49866 URL: http://llvm.org/viewvc/llvm-project?rev=49866&view=rev Log: first step of getting rid of tagged Use::Val. tagging Prev instead. the tags are never initialized, but that should not matter anyway. Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49866&r1=49865&r2=49866&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Thu Apr 17 15:31:38 2008 @@ -116,8 +116,8 @@ Use *getNext() const { return Next; } private: - Use *Next, **Prev; Value *Val; + Use *Next, **Prev; static Value *stripTag(Value *V) { return llvm::stripTag(V); @@ -127,13 +127,13 @@ } void addToList(Use **List) { Next = *List; - if (Next) Next->Prev = &Next; - Prev = List; + if (Next) Next->Prev = llvm::transferTag(Next->Prev, &Next); + Prev = llvm::transferTag(Prev, List); *List = this; } void removeFromList() { - *Prev = Next; - if (Next) Next->Prev = Prev; + *llvm::stripTag(Prev) = Next; + if (Next) Next->Prev = llvm::transferTag(Next->Prev, Prev); } friend class Value; From ggreif at gmail.com Thu Apr 17 15:51:25 2008 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 17 Apr 2008 20:51:25 -0000 Subject: [llvm-commits] [llvm] r49867 - in /llvm/branches/ggreif/use-diet: include/llvm/Use.h lib/VMCore/Use.cpp Message-ID: <200804172051.m3HKpQFL023591@zion.cs.uiuc.edu> Author: ggreif Date: Thu Apr 17 15:51:13 2008 New Revision: 49867 URL: http://llvm.org/viewvc/llvm-project?rev=49867&view=rev Log: now the tags are seriously on the Prev member Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49867&r1=49866&r2=49867&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Thu Apr 17 15:51:13 2008 @@ -85,10 +85,10 @@ /// that is valid to do with this use is to call the "init" method. inline Use() {} - enum ValuePtrTag { zeroDigitTag = noTag - , oneDigitTag = tagOne - , stopTag = tagTwo - , fullStopTag = tagThree }; + enum PrevPtrTag { zeroDigitTag = noTag + , oneDigitTag = tagOne + , stopTag = tagTwo + , fullStopTag = tagThree }; public: Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49867&r1=49866&r2=49867&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Thu Apr 17 15:51:13 2008 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Value.h" +//#include "llvm/Value.h" #include "llvm/User.h" namespace llvm { @@ -26,7 +26,7 @@ const Use *Current = this; while (true) { - unsigned Tag = extractTag(Current->Val); + unsigned Tag = extractTag(Current->Prev); switch (Tag) { case zeroDigitTag: @@ -58,11 +58,11 @@ { --Stop; if (!Count) { - Stop->Val = reinterpret_cast(Done == 0 ? fullStopTag : stopTag); + Stop->Prev = reinterpret_cast(Done == 0 ? fullStopTag : stopTag); ++Done; Count = Done; } else { - Stop->Val = reinterpret_cast(Count & 1); + Stop->Prev = reinterpret_cast(Count & 1); Count >>= 1; ++Done; } From evan.cheng at apple.com Thu Apr 17 16:26:35 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Apr 2008 21:26:35 -0000 Subject: [llvm-commits] [llvm] r49869 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200804172126.m3HLQZ05024875@zion.cs.uiuc.edu> Author: evancheng Date: Thu Apr 17 16:26:35 2008 New Revision: 49869 URL: http://llvm.org/viewvc/llvm-project?rev=49869&view=rev Log: Fix assembly code for atomic operations. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49869&r1=49868&r2=49869&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Apr 17 16:26:35 2008 @@ -2548,9 +2548,9 @@ let Defs = [EAX, EFLAGS], Uses = [EAX] in { def CMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), - "cmpxchgl $swap,$ptr", []>, TB; + "cmpxchg{l} $swap,$ptr", []>, TB; def LCMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), - "lock cmpxchgl $swap,$ptr", + "lock cmpxchg{l} $swap,$ptr", [(X86cas addr:$ptr, GR32:$swap, 4)]>, TB, LOCK; } let Defs = [EAX, EBX, ECX, EDX, EFLAGS], Uses = [EAX, EBX, ECX, EDX] in { @@ -2563,55 +2563,55 @@ let Defs = [AX, EFLAGS], Uses = [AX] in { def CMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), - "cmpxchgw $swap,($ptr)", []>, TB, OpSize; + "cmpxchg{w} $swap,($ptr)", []>, TB, OpSize; def LCMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), - "lock cmpxchgw $swap,$ptr", + "lock cmpxchg{w} $swap,$ptr", [(X86cas addr:$ptr, GR16:$swap, 2)]>, TB, OpSize, LOCK; } let Defs = [AL, EFLAGS], Uses = [AL] in { def CMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), - "cmpxchgb $swap,($ptr)", []>, TB; + "cmpxchg{b} $swap,($ptr)", []>, TB; def LCMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), - "lock cmpxchgb $swap,$ptr", + "lock cmpxchg{b} $swap,$ptr", [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK; } let Constraints = "$val = $dst", Defs = [EFLAGS] in { def LXADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xadd $val, $ptr", + "lock xadd{l} $val, $ptr", [(set GR32:$dst, (atomic_las_32 addr:$ptr, GR32:$val))]>, TB, LOCK; def LXADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xadd $val, $ptr", + "lock xadd{w} $val, $ptr", [(set GR16:$dst, (atomic_las_16 addr:$ptr, GR16:$val))]>, TB, OpSize, LOCK; def LXADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xadd $val, $ptr", + "lock xadd{b} $val, $ptr", [(set GR8:$dst, (atomic_las_8 addr:$ptr, GR8:$val))]>, TB, LOCK; def XADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xadd $val, $ptr", []>, TB; + "xadd{l} $val, $ptr", []>, TB; def XADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xadd $val, $ptr", []>, TB, OpSize; + "xadd{w} $val, $ptr", []>, TB, OpSize; def XADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xadd $val, $ptr", []>, TB; + "xadd{b} $val, $ptr", []>, TB; def LXCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xchg $val, $ptr", + "lock xchg{l} $val, $ptr", [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>, LOCK; def LXCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xchg $val, $ptr", + "lock xchg{w} $val, $ptr", [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, OpSize, LOCK; def LXCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xchg $val, $ptr", + "lock xchg{b} $val, $ptr", [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>, LOCK; def XCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xchg $val, $ptr", []>; + "xchg{l} $val, $ptr", []>; def XCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xchg $val, $ptr", []>, OpSize; + "xchg{w} $val, $ptr", []>, OpSize; def XCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xchg $val, $ptr", []>; + "xchg{b} $val, $ptr", []>; } //===----------------------------------------------------------------------===// From dpatel at apple.com Thu Apr 17 16:37:54 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Apr 2008 21:37:54 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49872 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804172137.m3HLbsNg025238@zion.cs.uiuc.edu> Author: dpatel Date: Thu Apr 17 16:37:54 2008 New Revision: 49872 URL: http://llvm.org/viewvc/llvm-project?rev=49872&view=rev Log: oops Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49872&r1=49871&r2=49872&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 17 16:37:54 2008 @@ -908,7 +908,7 @@ if (TREE_CODE(type) == COMPLEX_TYPE) return true; -` + if (AGGREGATE_TYPE_P(type)) { tree field = TYPE_FIELDS(type); if (field && TREE_CHAIN(field) == NULL From gohman at apple.com Thu Apr 17 17:27:29 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Apr 2008 15:27:29 -0700 Subject: [llvm-commits] [llvm] r49869 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <200804172126.m3HLQZ05024875@zion.cs.uiuc.edu> References: <200804172126.m3HLQZ05024875@zion.cs.uiuc.edu> Message-ID: <4DF215AD-0EE9-4611-BE62-74B55DA0760A@apple.com> On Apr 17, 2008, at 2:26 PM, Evan Cheng wrote: > Author: evancheng > Date: Thu Apr 17 16:26:35 2008 > New Revision: 49869 > > URL: http://llvm.org/viewvc/llvm-project?rev=49869&view=rev > Log: > Fix assembly code for atomic operations. > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49869&r1=49868&r2=49869&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Apr 17 16:26:35 2008 > @@ -2548,9 +2548,9 @@ > > let Defs = [EAX, EFLAGS], Uses = [EAX] in { > def CMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), > - "cmpxchgl $swap,$ptr", []>, TB; > + "cmpxchg{l} $swap,$ptr", []>, TB; > def LCMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, > GR32:$swap), > - "lock cmpxchgl $swap,$ptr", > + "lock cmpxchg{l} $swap,$ptr", Isn't it also necessary to switch the order of the operands between Intel and AT&T syntax for these? Dan From gohman at apple.com Thu Apr 17 18:02:12 2008 From: gohman at apple.com (Dan Gohman) Date: Thu, 17 Apr 2008 23:02:12 -0000 Subject: [llvm-commits] [llvm] r49876 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200804172302.m3HN2DS7028185@zion.cs.uiuc.edu> Author: djg Date: Thu Apr 17 18:02:12 2008 New Revision: 49876 URL: http://llvm.org/viewvc/llvm-project?rev=49876&view=rev Log: Remove the implicit conversion from SDOperandPtr to SDOperand*; this may fix a build error on Visual Studio. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=49876&r1=49875&r2=49876&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Apr 17 18:02:12 2008 @@ -968,6 +968,8 @@ const SDOperand *ptr; // The pointer to the SDOperand object int object_size; // The size of the object containg the SDOperand public: + SDOperandPtr() : ptr(0), object_size(0) {} + SDOperandPtr(SDUse * use_ptr) { ptr = &use_ptr->getSDOperand(); object_size = sizeof(SDUse); @@ -978,12 +980,6 @@ object_size = sizeof(SDOperand); } - operator const SDOperand *() const { - assert(object_size == sizeof(SDOperand) && - "Only SDOperand can be converted"); - return ptr; - } - const SDOperand operator *() { return *ptr; } const SDOperand *operator ->() { return ptr; } SDOperandPtr operator ++ () { @@ -1300,7 +1296,7 @@ /// opcode, types, and operands to the specified value. This should only be /// used by the SelectionDAG class. void MorphNodeTo(unsigned Opc, SDVTList L, - const SDOperand *Ops, unsigned NumOps); + SDOperandPtr Ops, unsigned NumOps); void addUser(unsigned i, SDNode *User) { assert(User->OperandList[i].getUser() && "Node without parent"); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=49876&r1=49875&r2=49876&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Apr 17 18:02:12 2008 @@ -337,7 +337,7 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, unsigned short OpC, SDVTList VTList, - const SDOperand *OpList, unsigned N) { + SDOperandPtr OpList, unsigned N) { AddNodeIDOpcode(ID, OpC); AddNodeIDValueTypes(ID, VTList); AddNodeIDOperands(ID, OpList, N); @@ -3342,7 +3342,7 @@ /// opcode, types, and operands to the specified value. This should only be /// used by the SelectionDAG class. void SDNode::MorphNodeTo(unsigned Opc, SDVTList L, - const SDOperand *Ops, unsigned NumOps) { + SDOperandPtr Ops, unsigned NumOps) { NodeType = Opc; ValueList = L.VTs; NumValues = L.NumVTs; @@ -3393,7 +3393,7 @@ RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, 0, 0); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc, VTs, SDOperandPtr(), 0); CSEMap.InsertNode(N, IP); return N; @@ -3951,7 +3951,7 @@ HandleSDNode::~HandleSDNode() { SDVTList VTs = { 0, 0 }; - MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0); // Drops operand uses. + MorphNodeTo(ISD::HANDLENODE, VTs, SDOperandPtr(), 0); // Drops operand uses. } GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, From evan.cheng at apple.com Thu Apr 17 18:32:24 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Apr 2008 16:32:24 -0700 Subject: [llvm-commits] [llvm] r49869 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <4DF215AD-0EE9-4611-BE62-74B55DA0760A@apple.com> References: <200804172126.m3HLQZ05024875@zion.cs.uiuc.edu> <4DF215AD-0EE9-4611-BE62-74B55DA0760A@apple.com> Message-ID: <005F8606-C629-498A-BBA4-B683654DCB51@apple.com> Yep. I'll fix. Evan On Apr 17, 2008, at 3:27 PM, Dan Gohman wrote: > > On Apr 17, 2008, at 2:26 PM, Evan Cheng wrote: >> Author: evancheng >> Date: Thu Apr 17 16:26:35 2008 >> New Revision: 49869 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=49869&view=rev >> Log: >> Fix assembly code for atomic operations. >> >> Modified: >> llvm/trunk/lib/Target/X86/X86InstrInfo.td >> >> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49869&r1=49868&r2=49869&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Apr 17 16:26:35 >> 2008 >> @@ -2548,9 +2548,9 @@ >> >> let Defs = [EAX, EFLAGS], Uses = [EAX] in { >> def CMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, >> GR32:$swap), >> - "cmpxchgl $swap,$ptr", []>, TB; >> + "cmpxchg{l} $swap,$ptr", []>, TB; >> def LCMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, >> GR32:$swap), >> - "lock cmpxchgl $swap,$ptr", >> + "lock cmpxchg{l} $swap,$ptr", > > Isn't it also necessary to switch the order of the operands > between Intel and AT&T syntax for these? > > Dan > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Thu Apr 17 18:35:11 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 17 Apr 2008 23:35:11 -0000 Subject: [llvm-commits] [llvm] r49878 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200804172335.m3HNZCjP029145@zion.cs.uiuc.edu> Author: evancheng Date: Thu Apr 17 18:35:10 2008 New Revision: 49878 URL: http://llvm.org/viewvc/llvm-project?rev=49878&view=rev Log: Also support Intel asm syntax. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49878&r1=49877&r2=49878&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Thu Apr 17 18:35:10 2008 @@ -2548,70 +2548,70 @@ let Defs = [EAX, EFLAGS], Uses = [EAX] in { def CMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), - "cmpxchg{l} $swap,$ptr", []>, TB; + "cmpxchg{l}\t{$swap, $ptr|$ptr, $swap}", []>, TB; def LCMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), - "lock cmpxchg{l} $swap,$ptr", + "lock cmpxchg{l}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR32:$swap, 4)]>, TB, LOCK; } let Defs = [EAX, EBX, ECX, EDX, EFLAGS], Uses = [EAX, EBX, ECX, EDX] in { def CMPXCHG8B : I<0xC7, Pseudo, (outs), (ins i32mem:$ptr), - "cmpxchg8b $ptr", []>, TB; + "cmpxchg8b\t$ptr", []>, TB; def LCMPXCHG8B : I<0xC7, Pseudo, (outs), (ins i32mem:$ptr), - "lock cmpxchg8b $ptr", + "lock cmpxchg8b\t$ptr", [(X86cas8 addr:$ptr)]>, TB, LOCK; } let Defs = [AX, EFLAGS], Uses = [AX] in { def CMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), - "cmpxchg{w} $swap,($ptr)", []>, TB, OpSize; + "cmpxchg{w}\t{$swap, $ptr|$ptr, $swap}", []>, TB, OpSize; def LCMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), - "lock cmpxchg{w} $swap,$ptr", + "lock cmpxchg{w}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR16:$swap, 2)]>, TB, OpSize, LOCK; } let Defs = [AL, EFLAGS], Uses = [AL] in { def CMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), - "cmpxchg{b} $swap,($ptr)", []>, TB; + "cmpxchg{b}\t{$swap, $ptr|$ptr, $swap}", []>, TB; def LCMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), - "lock cmpxchg{b} $swap,$ptr", + "lock cmpxchg{b}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK; } let Constraints = "$val = $dst", Defs = [EFLAGS] in { def LXADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xadd{l} $val, $ptr", + "lock xadd{l}\t{$val, $ptr|$ptr, $val}", [(set GR32:$dst, (atomic_las_32 addr:$ptr, GR32:$val))]>, TB, LOCK; def LXADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xadd{w} $val, $ptr", + "lock xadd{w}\t{$val, $ptr|$ptr, $val}", [(set GR16:$dst, (atomic_las_16 addr:$ptr, GR16:$val))]>, TB, OpSize, LOCK; def LXADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xadd{b} $val, $ptr", + "lock xadd{b}\t{$val, $ptr|$ptr, $val}", [(set GR8:$dst, (atomic_las_8 addr:$ptr, GR8:$val))]>, TB, LOCK; def XADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xadd{l} $val, $ptr", []>, TB; + "xadd{l}\t{$val, $ptr|$ptr, $val}", []>, TB; def XADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xadd{w} $val, $ptr", []>, TB, OpSize; + "xadd{w}\t{$val, $ptr|$ptr, $val}", []>, TB, OpSize; def XADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xadd{b} $val, $ptr", []>, TB; + "xadd{b}\t{$val, $ptr|$ptr, $val}", []>, TB; def LXCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xchg{l} $val, $ptr", + "lock xchg{l}\t{$val, $ptr|$ptr, $val}", [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>, LOCK; def LXCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xchg{w} $val, $ptr", + "lock xchg{w}\t{$val, $ptr|$ptr, $val}", [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, OpSize, LOCK; def LXCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xchg{b} $val, $ptr", + "lock xchg{b}\t{$val, $ptr|$ptr, $val}", [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>, LOCK; def XCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xchg{l} $val, $ptr", []>; + "xchg{l}\t{$val, $ptr|$ptr, $val}", []>; def XCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xchg{w} $val, $ptr", []>, OpSize; + "xchg{w}\t{$val, $ptr|$ptr, $val}", []>, OpSize; def XCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xchg{b} $val, $ptr", []>; + "xchg{b}\t{$val, $ptr|$ptr, $val}", []>; } //===----------------------------------------------------------------------===// From romix.llvm at googlemail.com Fri Apr 18 06:31:08 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Fri, 18 Apr 2008 12:31:08 +0100 Subject: [llvm-commits] Speeding up instruction selection In-Reply-To: <6878E8F2-B19D-430F-ADCF-DA84A7F3B742@apple.com> References: <00FB5805-1FA5-4534-BBD0-E6E34EC17BF1@apple.com> <84648A85-6EB1-4FE5-96B4-749BD5A8D938@apple.com> <039F7990-10A9-4153-A91B-024551DF3541@apple.com> <6878E8F2-B19D-430F-ADCF-DA84A7F3B742@apple.com> Message-ID: Hi Evan, 2008/4/2, Evan Cheng : > > On Apr 2, 2008, at 1:57 AM, Roman Levenstein wrote: > > > 2008/4/2, Evan Cheng : > >> > >> On Apr 2, 2008, at 12:55 AM, Roman Levenstein wrote: > >> > >>> Hi Evan, > >>> > >>> 2008/4/1, Evan Cheng : > >>>> Please hold off checking it in for a bit. llvm tot is having some > >>>> problems and I'd like to get to the bottom of it first. > >>> > >>> OK. > >>> > >>>> Also, the tie breaker is less than ideal. I think we need a tie- > >>>> breaker that is "the SUnit that's added to the queue is preferred". > >>>> That means it prefers nodes which are closer to the end of block. > >>>> What > >>>> do you think? > >>> > >>> Do you actually mean "the SUnit that's added to the queue LAST (or > >>> FIRST) is preferred"? I'll think about it. > >> > >> > >> Yep "first". Basically, if all else being equal, let the node that's > >> ready first be scheduled first. We can add a order id to SUnit which > >> gets set when it's pushed into the ready queue. What do you think? > > > > Makes sense. The queue should have a global "current id" counter. Its > > current value is assigned to each node being inserted into the ready > > queue and then incremented. When the node is removed from the queue > > for any reason, its queue order id is reset. It should be rather easy > > to implement. > > BTW, do you really want this queue order id in the SUnit or in a > > separate array indexed by SUnit unique ids? > > > It should be in SUnit since the sort functions don't have access to > ScheduleDAG members. Please find and review the attached patch implementing: - a proper tie-breaker as discussed above. - and unmodified part for replacing the slow std::priority_queue by std::set, as it I already did before. What do you think? -Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: ScheduleDAGRRList.patch Type: text/x-patch Size: 5590 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080418/26a3bcfb/attachment.bin From ggreif at gmail.com Fri Apr 18 09:00:35 2008 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 18 Apr 2008 14:00:35 -0000 Subject: [llvm-commits] [llvm] r49900 - in /llvm/branches/ggreif/use-diet: include/llvm/Use.h lib/VMCore/Use.cpp Message-ID: <200804181400.m3IE0ZFF032274@zion.cs.uiuc.edu> Author: ggreif Date: Fri Apr 18 09:00:34 2008 New Revision: 49900 URL: http://llvm.org/viewvc/llvm-project?rev=49900&view=rev Log: clearing of Val still necessary, transferTag takes an *untagged* To pointer, cleanups Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49900&r1=49899&r2=49900&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Fri Apr 18 09:00:34 2008 @@ -132,8 +132,9 @@ *List = this; } void removeFromList() { - *llvm::stripTag(Prev) = Next; - if (Next) Next->Prev = llvm::transferTag(Next->Prev, Prev); + Use **StrippedPrev = llvm::stripTag(Prev); + *StrippedPrev = Next; + if (Next) Next->Prev = llvm::transferTag(Next->Prev, StrippedPrev); } friend class Value; Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49900&r1=49899&r2=49900&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Fri Apr 18 09:00:34 2008 @@ -11,7 +11,6 @@ // //===----------------------------------------------------------------------===// -//#include "llvm/Value.h" #include "llvm/User.h" namespace llvm { @@ -27,8 +26,7 @@ while (true) { unsigned Tag = extractTag(Current->Prev); - switch (Tag) - { + switch (Tag) { case zeroDigitTag: case oneDigitTag: if (StopEncountered) @@ -54,9 +52,9 @@ Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) { ptrdiff_t Count = 0; - while (Start != Stop) - { + while (Start != Stop) { --Stop; + Stop->Val = 0; if (!Count) { Stop->Prev = reinterpret_cast(Done == 0 ? fullStopTag : stopTag); ++Done; From ggreif at gmail.com Fri Apr 18 09:30:42 2008 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 18 Apr 2008 14:30:42 -0000 Subject: [llvm-commits] [llvm] r49901 - in /llvm/branches/ggreif/use-diet/include/llvm: Use.h Value.h Message-ID: <200804181430.m3IEUg2V000766@zion.cs.uiuc.edu> Author: ggreif Date: Fri Apr 18 09:30:41 2008 New Revision: 49901 URL: http://llvm.org/viewvc/llvm-project?rev=49901&view=rev Log: Use::Val no more tagged, interface simplified Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h llvm/branches/ggreif/use-diet/include/llvm/Value.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49901&r1=49900&r2=49901&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Fri Apr 18 09:30:41 2008 @@ -93,8 +93,8 @@ public: - operator Value*() const { return stripTag(Val); } - Value *get() const { return stripTag(Val); } + operator Value*() const { return Val; } + Value *get() const { return Val; } User *getUser() const; const Use* getImpliedUser() const; static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0); @@ -111,30 +111,24 @@ return *this; } - Value *operator->() { return stripTag(Val); } - const Value *operator->() const { return stripTag(Val); } + Value *operator->() { return Val; } + const Value *operator->() const { return Val; } Use *getNext() const { return Next; } private: Value *Val; Use *Next, **Prev; - static Value *stripTag(Value *V) { - return llvm::stripTag(V); - } - Value *transferTag(Value *V) { - return llvm::transferTag(Val, V); - } void addToList(Use **List) { Next = *List; - if (Next) Next->Prev = llvm::transferTag(Next->Prev, &Next); - Prev = llvm::transferTag(Prev, List); + if (Next) Next->Prev = transferTag(Next->Prev, &Next); + Prev = transferTag(Prev, List); *List = this; } void removeFromList() { - Use **StrippedPrev = llvm::stripTag(Prev); + Use **StrippedPrev = stripTag(Prev); *StrippedPrev = Next; - if (Next) Next->Prev = llvm::transferTag(Next->Prev, StrippedPrev); + if (Next) Next->Prev = transferTag(Next->Prev, StrippedPrev); } friend class Value; Modified: llvm/branches/ggreif/use-diet/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Value.h?rev=49901&r1=49900&r2=49901&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Value.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Value.h Fri Apr 18 09:30:41 2008 @@ -224,13 +224,13 @@ } void Use::init(Value *V, User *user) { - Val = transferTag(V); + Val = V; if (V) V->addUse(*this); } void Use::set(Value *V) { - if (stripTag(Val)) removeFromList(); - Val = transferTag(V); + if (Val) removeFromList(); + Val = V; if (V) V->addUse(*this); } From ggreif at gmail.com Fri Apr 18 09:48:22 2008 From: ggreif at gmail.com (Gabor Greif) Date: Fri, 18 Apr 2008 14:48:22 -0000 Subject: [llvm-commits] [llvm] r49902 - /llvm/branches/ggreif/use-diet/include/llvm/Use.h Message-ID: <200804181448.m3IEmMct001311@zion.cs.uiuc.edu> Author: ggreif Date: Fri Apr 18 09:48:22 2008 New Revision: 49902 URL: http://llvm.org/viewvc/llvm-project?rev=49902&view=rev Log: simplify tagging logic by introducing private helper Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h Modified: llvm/branches/ggreif/use-diet/include/llvm/Use.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Use.h?rev=49902&r1=49901&r2=49902&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/Use.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/Use.h Fri Apr 18 09:48:22 2008 @@ -119,16 +119,19 @@ Value *Val; Use *Next, **Prev; + void setPrev(Use **NewPrev) { + Prev = transferTag(Prev, NewPrev); + } void addToList(Use **List) { Next = *List; - if (Next) Next->Prev = transferTag(Next->Prev, &Next); - Prev = transferTag(Prev, List); + if (Next) Next->setPrev(&Next); + setPrev(List); *List = this; } void removeFromList() { Use **StrippedPrev = stripTag(Prev); *StrippedPrev = Next; - if (Next) Next->Prev = transferTag(Next->Prev, StrippedPrev); + if (Next) Next->setPrev(StrippedPrev); } friend class Value; From dpatel at apple.com Fri Apr 18 11:01:11 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 18 Apr 2008 16:01:11 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49905 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h Message-ID: <200804181601.m3IG1BPS003336@zion.cs.uiuc.edu> Author: dpatel Date: Fri Apr 18 11:01:11 2008 New Revision: 49905 URL: http://llvm.org/viewvc/llvm-project?rev=49905&view=rev Log: By default, _Complex are returned in memory. Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h 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=49905&r1=49904&r2=49905&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Fri Apr 18 11:01:11 2008 @@ -109,7 +109,7 @@ // multiple value return instruction. #ifndef LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY #define LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY(X) \ - false + true #endif // doNotUseShadowReturn - Return true if the specified GCC type From dpatel at apple.com Fri Apr 18 11:03:09 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 18 Apr 2008 16:03:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49906 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200804181603.m3IG395b003400@zion.cs.uiuc.edu> Author: dpatel Date: Fri Apr 18 11:03:09 2008 New Revision: 49906 URL: http://llvm.org/viewvc/llvm-project?rev=49906&view=rev Log: Disable special _Complex return handling for now. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.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=49906&r1=49905&r2=49906&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 Apr 18 11:03:09 2008 @@ -903,6 +903,9 @@ // llvm_x86_should_not_return_complex_in_memory - Return true if TYPE // should be returned using multiple value return instruction. bool llvm_x86_should_not_return_complex_in_memory(tree type) { + + return false; +#if 0 if (!TARGET_64BIT) return false; @@ -916,6 +919,7 @@ return true; } return false; +#endif } // llvm_suitable_multiple_ret_value_type - Return TRUE if return value From evan.cheng at apple.com Fri Apr 18 14:22:23 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 18 Apr 2008 19:22:23 -0000 Subject: [llvm-commits] [llvm] r49911 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200804181922.m3IJMNOZ009296@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 14:22:23 2008 New Revision: 49911 URL: http://llvm.org/viewvc/llvm-project?rev=49911&view=rev Log: Not safe to "kill" a register if its live range extends pass the end of block branch. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49911&r1=49910&r2=49911&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Apr 18 14:22:23 2008 @@ -613,6 +613,19 @@ } } +/// isSameOrFallThroughBB - Return true if MBB == SuccMBB or MBB simply +/// fallthoughs to SuccMBB. +static bool isSameOrFallThroughBB(MachineBasicBlock *MBB, + MachineBasicBlock *SuccMBB, + const TargetInstrInfo *tii_) { + if (MBB == SuccMBB) + return true; + MachineBasicBlock *TBB = 0, *FBB = 0; + std::vector Cond; + return !tii_->AnalyzeBranch(*MBB, TBB, FBB, Cond) && !TBB && !FBB && + MBB->isSuccessor(SuccMBB); +} + /// ShortenDeadCopySrcLiveRange - Shorten a live range as it's artificially /// extended by a dead copy. Mark the last use (if any) of the val# as kill as /// ends the live range there. If there isn't another use, then this live range @@ -643,14 +656,29 @@ // More uses past this copy? Nothing to do. return false; + MachineBasicBlock *CopyMBB = CopyMI->getParent(); + unsigned MBBStart = li_->getMBBStartIdx(CopyMBB); unsigned LastUseIdx; MachineOperand *LastUse = lastRegisterUse(LR->start, CopyIdx-1, li.reg, LastUseIdx); if (LastUse) { + MachineInstr *LastUseMI = LastUse->getParent(); + if (!isSameOrFallThroughBB(LastUseMI->getParent(), CopyMBB, tii_)) { + // r1024 = op + // ... + // BB1: + // = r1024 + // + // BB2: + // r1025 = r1024 + if (MBBStart < LR->end) + removeRange(li, MBBStart, LR->end, li_, tri_); + return false; + } + // There are uses before the copy, just shorten the live range to the end // of last use. LastUse->setIsKill(); - MachineInstr *LastUseMI = LastUse->getParent(); removeRange(li, li_->getDefIndex(LastUseIdx), LR->end, li_, tri_); unsigned SrcReg, DstReg; if (tii_->isMoveInstr(*LastUseMI, SrcReg, DstReg) && @@ -663,8 +691,6 @@ } // Is it livein? - MachineBasicBlock *CopyMBB = CopyMI->getParent(); - unsigned MBBStart = li_->getMBBStartIdx(CopyMBB); if (LR->start <= MBBStart && LR->end > MBBStart) { if (LR->start == 0) { assert(TargetRegisterInfo::isPhysicalRegister(li.reg)); From evan.cheng at apple.com Fri Apr 18 14:25:26 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 18 Apr 2008 19:25:26 -0000 Subject: [llvm-commits] [llvm] r49913 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200804181925.m3IJPQ2L009394@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 14:25:26 2008 New Revision: 49913 URL: http://llvm.org/viewvc/llvm-project?rev=49913&view=rev Log: Correct comment. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=49913&r1=49912&r2=49913&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Apr 18 14:25:26 2008 @@ -466,8 +466,8 @@ O.setSubReg(0); } else { // Sub-register indexes goes from small to large. e.g. - // RAX: 0 -> AL, 1 -> AH, 2 -> AX, 3 -> EAX - // EAX: 0 -> AL, 1 -> AH, 2 -> AX + // RAX: 1 -> AL, 2 -> AX, 3 -> EAX + // EAX: 1 -> AL, 2 -> AX // So RAX's sub-register 2 is AX, RAX's sub-regsiter 3 is EAX, whose // sub-register 2 is also AX. if (SubIdx && OldSubIdx && SubIdx != OldSubIdx) From baldrick at free.fr Fri Apr 18 15:25:15 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Apr 2008 20:25:15 -0000 Subject: [llvm-commits] [llvm] r49915 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.cpp LegalizeTypes.h LegalizeTypesExpand.cpp Message-ID: <200804182025.m3IKPFdr010995@zion.cs.uiuc.edu> Author: baldrick Date: Fri Apr 18 15:25:14 2008 New Revision: 49915 URL: http://llvm.org/viewvc/llvm-project?rev=49915&view=rev Log: Provide an explicit list of operands to MakeLibcall, rather than having it suck them out of a node. Add a bunch of new libcalls, and remove dead softfloat code (dead, because FloatToInt is used not Expand in this case). Note that indexed stores probably aren't handled properly, likewise for loads. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=49915&r1=49914&r2=49915&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Apr 18 15:25:14 2008 @@ -525,15 +525,18 @@ SplitInteger(Op, HalfVT, HalfVT, Lo, Hi); } -/// MakeLibCall - Expand a node into a libcall and return the result. -SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, SDNode *N, +/// MakeLibCall - Generate a libcall taking the given operands as arguments and +/// returning a result of type RetVT. +SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, MVT::ValueType RetVT, + const SDOperand *Ops, unsigned NumOps, bool isSigned) { TargetLowering::ArgListTy Args; + Args.reserve(NumOps); + TargetLowering::ArgListEntry Entry; - for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { - MVT::ValueType ArgVT = N->getOperand(i).getValueType(); - Entry.Node = N->getOperand(i); - Entry.Ty = MVT::getTypeForValueType(ArgVT); + for (unsigned i = 0; i != NumOps; ++i) { + Entry.Node = Ops[i]; + Entry.Ty = MVT::getTypeForValueType(Entry.Node.getValueType()); Entry.isSExt = isSigned; Entry.isZExt = !isSigned; Args.push_back(Entry); @@ -541,7 +544,7 @@ SDOperand Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC), TLI.getPointerTy()); - const Type *RetTy = MVT::getTypeForValueType(N->getValueType(0)); + const Type *RetTy = MVT::getTypeForValueType(RetVT); std::pair CallInfo = TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false, CallingConv::C, false, Callee, Args, DAG); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49915&r1=49914&r2=49915&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Fri Apr 18 15:25:14 2008 @@ -169,7 +169,8 @@ void SplitInteger(SDOperand Op, SDOperand &Lo, SDOperand &Hi); void SplitInteger(SDOperand Op, MVT::ValueType LoVT, MVT::ValueType HiVT, SDOperand &Lo, SDOperand &Hi); - SDOperand MakeLibCall(RTLIB::Libcall LC, SDNode *N, bool isSigned); + SDOperand MakeLibCall(RTLIB::Libcall LC, MVT::ValueType RetVT, + const SDOperand *Ops, unsigned NumOps, bool isSigned); //===--------------------------------------------------------------------===// // Promotion Support: LegalizeTypesPromote.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=49915&r1=49914&r2=49915&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Fri Apr 18 15:25:14 2008 @@ -324,61 +324,64 @@ void DAGTypeLegalizer::ExpandResult_FP_TO_SINT(SDNode *N, SDOperand &Lo, SDOperand &Hi) { MVT::ValueType VT = N->getValueType(0); + SDOperand Op = N->getOperand(0); RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; if (VT == MVT::i64) { - if (N->getOperand(0).getValueType() == MVT::f32) + if (Op.getValueType() == MVT::f32) LC = RTLIB::FPTOSINT_F32_I64; - else if (N->getOperand(0).getValueType() == MVT::f64) + else if (Op.getValueType() == MVT::f64) LC = RTLIB::FPTOSINT_F64_I64; - else if (N->getOperand(0).getValueType() == MVT::f80) + else if (Op.getValueType() == MVT::f80) LC = RTLIB::FPTOSINT_F80_I64; - else if (N->getOperand(0).getValueType() == MVT::ppcf128) + else if (Op.getValueType() == MVT::ppcf128) LC = RTLIB::FPTOSINT_PPCF128_I64; } else if (VT == MVT::i128) { - if (N->getOperand(0).getValueType() == MVT::f32) + if (Op.getValueType() == MVT::f32) LC = RTLIB::FPTOSINT_F32_I128; - else if (N->getOperand(0).getValueType() == MVT::f64) + else if (Op.getValueType() == MVT::f64) LC = RTLIB::FPTOSINT_F64_I128; - else if (N->getOperand(0).getValueType() == MVT::f80) + else if (Op.getValueType() == MVT::f80) LC = RTLIB::FPTOSINT_F80_I128; - else if (N->getOperand(0).getValueType() == MVT::ppcf128) + else if (Op.getValueType() == MVT::ppcf128) LC = RTLIB::FPTOSINT_PPCF128_I128; } else { assert(0 && "Unexpected fp-to-sint conversion!"); } - SplitInteger(MakeLibCall(LC, N, true/*sign irrelevant*/), Lo, Hi); + SplitInteger(MakeLibCall(LC, VT, &Op, 1, true/*sign irrelevant*/), Lo, Hi); } void DAGTypeLegalizer::ExpandResult_FP_TO_UINT(SDNode *N, SDOperand &Lo, SDOperand &Hi) { MVT::ValueType VT = N->getValueType(0); + SDOperand Op = N->getOperand(0); RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; if (VT == MVT::i64) { - if (N->getOperand(0).getValueType() == MVT::f32) + if (Op.getValueType() == MVT::f32) LC = RTLIB::FPTOUINT_F32_I64; - else if (N->getOperand(0).getValueType() == MVT::f64) + else if (Op.getValueType() == MVT::f64) LC = RTLIB::FPTOUINT_F64_I64; - else if (N->getOperand(0).getValueType() == MVT::f80) + else if (Op.getValueType() == MVT::f80) LC = RTLIB::FPTOUINT_F80_I64; - else if (N->getOperand(0).getValueType() == MVT::ppcf128) + else if (Op.getValueType() == MVT::ppcf128) LC = RTLIB::FPTOUINT_PPCF128_I64; } else if (VT == MVT::i128) { - if (N->getOperand(0).getValueType() == MVT::f32) + if (Op.getValueType() == MVT::f32) LC = RTLIB::FPTOUINT_F32_I128; - else if (N->getOperand(0).getValueType() == MVT::f64) + else if (Op.getValueType() == MVT::f64) LC = RTLIB::FPTOUINT_F64_I128; - else if (N->getOperand(0).getValueType() == MVT::f80) + else if (Op.getValueType() == MVT::f80) LC = RTLIB::FPTOUINT_F80_I128; - else if (N->getOperand(0).getValueType() == MVT::ppcf128) + else if (Op.getValueType() == MVT::ppcf128) LC = RTLIB::FPTOUINT_PPCF128_I128; } else { assert(0 && "Unexpected fp-to-uint conversion!"); } - SplitInteger(MakeLibCall(LC, N, false/*sign irrelevant*/), Lo, Hi); + SplitInteger(MakeLibCall(LC, VT, &Op, 1, false/*sign irrelevant*/), Lo, Hi); } void DAGTypeLegalizer::ExpandResult_LOAD(LoadSDNode *N, SDOperand &Lo, SDOperand &Hi) { + // FIXME: Add support for indexed loads. MVT::ValueType VT = N->getValueType(0); MVT::ValueType NVT = TLI.getTypeToTransformTo(VT); SDOperand Ch = N->getChain(); // Legalize the chain. @@ -518,9 +521,6 @@ GetExpandedOp(N->getOperand(1), LL, LH); GetExpandedOp(N->getOperand(2), RL, RH); Lo = DAG.getNode(ISD::SELECT, LL.getValueType(), N->getOperand(0), LL, RL); - - assert(N->getOperand(0).getValueType() != MVT::f32 && - "FIXME: softfp shouldn't use expand!"); Hi = DAG.getNode(ISD::SELECT, LL.getValueType(), N->getOperand(0), LH, RH); } @@ -531,9 +531,6 @@ GetExpandedOp(N->getOperand(3), RL, RH); Lo = DAG.getNode(ISD::SELECT_CC, LL.getValueType(), N->getOperand(0), N->getOperand(1), LL, RL, N->getOperand(4)); - - assert(N->getOperand(0).getValueType() != MVT::f32 && - "FIXME: softfp shouldn't use expand!"); Hi = DAG.getNode(ISD::SELECT_CC, LL.getValueType(), N->getOperand(0), N->getOperand(1), LH, RH, N->getOperand(4)); } @@ -667,37 +664,43 @@ return; } } - - abort(); -#if 0 // FIXME! + // If nothing else, we can make a libcall. - Lo = ExpandLibCall(TLI.getLibcallName(RTLIB::MUL_I64), N, - false/*sign irrelevant*/, Hi); -#endif -} + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(RTLIB::MUL_I64, VT, Ops, 2, true/*sign irrelevant*/), + Lo, Hi); +} void DAGTypeLegalizer::ExpandResult_SDIV(SDNode *N, SDOperand &Lo, SDOperand &Hi) { assert(N->getValueType(0) == MVT::i64 && "Unsupported sdiv!"); - SplitInteger(MakeLibCall(RTLIB::SDIV_I64, N, true), Lo, Hi); + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(RTLIB::SDIV_I64, N->getValueType(0), Ops, 2, true), + Lo, Hi); } void DAGTypeLegalizer::ExpandResult_SREM(SDNode *N, SDOperand &Lo, SDOperand &Hi) { assert(N->getValueType(0) == MVT::i64 && "Unsupported srem!"); - SplitInteger(MakeLibCall(RTLIB::SREM_I64, N, true), Lo, Hi); + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(RTLIB::SREM_I64, N->getValueType(0), Ops, 2, true), + Lo, Hi); } void DAGTypeLegalizer::ExpandResult_UDIV(SDNode *N, SDOperand &Lo, SDOperand &Hi) { assert(N->getValueType(0) == MVT::i64 && "Unsupported udiv!"); - SplitInteger(MakeLibCall(RTLIB::UDIV_I64, N, false), Lo, Hi); + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(RTLIB::UDIV_I64, N->getValueType(0), Ops, 2, false), + Lo, Hi); } void DAGTypeLegalizer::ExpandResult_UREM(SDNode *N, SDOperand &Lo, SDOperand &Hi) { assert(N->getValueType(0) == MVT::i64 && "Unsupported urem!"); - SplitInteger(MakeLibCall(RTLIB::UREM_I64, N, false), Lo, Hi); + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(RTLIB::UREM_I64, N->getValueType(0), Ops, 2, false), + Lo, Hi); } void DAGTypeLegalizer::ExpandResult_Shift(SDNode *N, @@ -716,11 +719,11 @@ // If this target supports shift_PARTS, use it. First, map to the _PARTS opc. unsigned PartsOpc; - if (N->getOpcode() == ISD::SHL) + if (N->getOpcode() == ISD::SHL) { PartsOpc = ISD::SHL_PARTS; - else if (N->getOpcode() == ISD::SRL) + } else if (N->getOpcode() == ISD::SRL) { PartsOpc = ISD::SRL_PARTS; - else { + } else { assert(N->getOpcode() == ISD::SRA && "Unknown shift!"); PartsOpc = ISD::SRA_PARTS; } @@ -741,16 +744,27 @@ Hi = Lo.getValue(1); return; } - - abort(); -#if 0 // FIXME! + // Otherwise, emit a libcall. - unsigned RuntimeCode = ; // SRL -> SRL_I64 etc. - bool Signed = ; - Lo = ExpandLibCall(TLI.getLibcallName(RTLIB::SRL_I64), N, - false/*lshr is unsigned*/, Hi); -#endif -} + assert(VT == MVT::i64 && "Unsupported shift!"); + + RTLIB::Libcall LC; + bool isSigned; + if (N->getOpcode() == ISD::SHL) { + LC = RTLIB::SHL_I64; + isSigned = false; /*sign irrelevant*/ + } else if (N->getOpcode() == ISD::SRL) { + LC = RTLIB::SRL_I64; + isSigned = false; + } else { + assert(N->getOpcode() == ISD::SRA && "Unknown shift!"); + LC = RTLIB::SRA_I64; + isSigned = true; + } + + SDOperand Ops[2] = { N->getOperand(0), N->getOperand(1) }; + SplitInteger(MakeLibCall(LC, VT, Ops, 2, isSigned), Lo, Hi); +} void DAGTypeLegalizer::ExpandResult_CTLZ(SDNode *N, SDOperand &Lo, SDOperand &Hi) { @@ -1106,7 +1120,7 @@ break; // The target lowered this. } - RTLIB::Libcall LC; + RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL; if (SourceVT == MVT::i64) { if (DestTy == MVT::f32) LC = RTLIB::SINTTOFP_I64_F32; @@ -1128,15 +1142,10 @@ } else { assert(0 && "Unknown int value type!"); } - - assert(0 && "FIXME: no libcalls yet!"); - abort(); -#if 0 - assert(TLI.getLibcallName(LC) && "Don't know how to expand this SINT_TO_FP!"); - Source = DAG.getNode(ISD::SINT_TO_FP, DestTy, Source); - SDOperand UnusedHiPart; - return ExpandLibCall(TLI.getLibcallName(LC), Source.Val, true, UnusedHiPart); -#endif + + assert(LC != RTLIB::UNKNOWN_LIBCALL && + "Don't know how to expand this SINT_TO_FP!"); + return MakeLibCall(LC, DestTy, &Source, 1, true); } SDOperand DAGTypeLegalizer::ExpandOperand_UINT_TO_FP(SDOperand Source, @@ -1224,12 +1233,8 @@ SDOperand LHSLo, LHSHi, RHSLo, RHSHi; GetExpandedOp(NewLHS, LHSLo, LHSHi); GetExpandedOp(NewRHS, RHSLo, RHSHi); - + MVT::ValueType VT = NewLHS.getValueType(); - if (VT == MVT::f32 || VT == MVT::f64) { - assert(0 && "FIXME: softfp not implemented yet! should be promote not exp"); - } - if (VT == MVT::ppcf128) { // FIXME: This generated code sucks. We want to generate // FCMP crN, hi1, hi2 @@ -1247,8 +1252,7 @@ NewRHS = SDOperand(); // LHS is the result, not a compare. return; } - - + if (CCCode == ISD::SETEQ || CCCode == ISD::SETNE) { if (RHSLo == RHSHi) if (ConstantSDNode *RHSCST = dyn_cast(RHSLo)) @@ -1336,6 +1340,7 @@ } SDOperand DAGTypeLegalizer::ExpandOperand_STORE(StoreSDNode *N, unsigned OpNo) { + // FIXME: Add support for indexed stores. assert(OpNo == 1 && "Can only expand the stored value so far"); MVT::ValueType VT = N->getOperand(1).getValueType(); From baldrick at free.fr Fri Apr 18 15:27:13 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Apr 2008 20:27:13 -0000 Subject: [llvm-commits] [llvm] r49916 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypesPromote.cpp LegalizeTypesScalarize.cpp LegalizeTypesSplit.cpp Message-ID: <200804182027.m3IKRDOW011055@zion.cs.uiuc.edu> Author: baldrick Date: Fri Apr 18 15:27:12 2008 New Revision: 49916 URL: http://llvm.org/viewvc/llvm-project?rev=49916&view=rev Log: Add some more FIXME's for indexed loads and stores. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp?rev=49916&r1=49915&r2=49916&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp Fri Apr 18 15:27:12 2008 @@ -193,6 +193,7 @@ } SDOperand DAGTypeLegalizer::PromoteResult_LOAD(LoadSDNode *N) { + // FIXME: Add support for indexed loads. MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); ISD::LoadExtType ExtType = ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType(); @@ -637,6 +638,7 @@ } SDOperand DAGTypeLegalizer::PromoteOperand_STORE(StoreSDNode *N, unsigned OpNo){ + // FIXME: Add support for indexed stores. SDOperand Ch = N->getChain(), Ptr = N->getBasePtr(); int SVOffset = N->getSrcValueOffset(); unsigned Alignment = N->getAlignment(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp?rev=49916&r1=49915&r2=49916&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp Fri Apr 18 15:27:12 2008 @@ -93,6 +93,7 @@ } SDOperand DAGTypeLegalizer::ScalarizeRes_LOAD(LoadSDNode *N) { + // FIXME: Add support for indexed loads. SDOperand Result = DAG.getLoad(MVT::getVectorElementType(N->getValueType(0)), N->getChain(), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), @@ -224,6 +225,7 @@ /// ScalarizeOp_STORE - If the value to store is a vector that needs to be /// scalarized, it must be <1 x ty>. Just store the element. SDOperand DAGTypeLegalizer::ScalarizeOp_STORE(StoreSDNode *N, unsigned OpNo) { + // FIXME: Add support for indexed stores. assert(OpNo == 1 && "Do not know how to scalarize this operand!"); return DAG.getStore(N->getChain(), GetScalarizedOp(N->getOperand(1)), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp?rev=49916&r1=49915&r2=49916&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp Fri Apr 18 15:27:12 2008 @@ -126,6 +126,7 @@ void DAGTypeLegalizer::SplitRes_LOAD(LoadSDNode *LD, SDOperand &Lo, SDOperand &Hi) { + // FIXME: Add support for indexed loads. MVT::ValueType LoVT, HiVT; GetSplitDestVTs(LD->getValueType(0), LoVT, HiVT); @@ -398,6 +399,7 @@ } SDOperand DAGTypeLegalizer::SplitOp_STORE(StoreSDNode *N, unsigned OpNo) { + // FIXME: Add support for indexed stores. assert(OpNo == 1 && "Can only split the stored value"); SDOperand Ch = N->getChain(); From evan.cheng at apple.com Fri Apr 18 15:54:46 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 18 Apr 2008 20:54:46 -0000 Subject: [llvm-commits] [test-suite] r49919 - /test-suite/trunk/SingleSource/UnitTests/AtomicOps.c Message-ID: <200804182054.m3IKskEo011872@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 15:54:46 2008 New Revision: 49919 URL: http://llvm.org/viewvc/llvm-project?rev=49919&view=rev Log: Add a test for atomic builtins. Added: test-suite/trunk/SingleSource/UnitTests/AtomicOps.c Added: test-suite/trunk/SingleSource/UnitTests/AtomicOps.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/AtomicOps.c?rev=49919&view=auto ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/AtomicOps.c (added) +++ test-suite/trunk/SingleSource/UnitTests/AtomicOps.c Fri Apr 18 15:54:46 2008 @@ -0,0 +1,17 @@ +#include + +int foo(volatile *mem, int val, int c) { + int oldval = __sync_fetch_and_add(mem, val); + return oldval + c; +} + +int main() { + volatile int x = 0; + int y = foo(&x, 1, 2); + printf("%d, %d\n", y, x); + y = __sync_val_compare_and_swap(&x, 1, 2); + printf("%d, %d\n", y, x); + y = __sync_lock_test_and_set(&x, 1); + printf("%d, %d\n", y, x); + return 0; +} From gohman at apple.com Fri Apr 18 15:54:58 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Apr 2008 20:54:58 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49920 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200804182054.m3IKswXG011891@zion.cs.uiuc.edu> Author: djg Date: Fri Apr 18 15:54:58 2008 New Revision: 49920 URL: http://llvm.org/viewvc/llvm-project?rev=49920&view=rev Log: Fix llvm-gcc's translation of va_copy on x86-64 and other targets that use struct va_lists. This fixes the llvm-gcc side of PR2230. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp 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=49920&r1=49919&r2=49920&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Apr 18 15:54:58 2008 @@ -4992,18 +4992,16 @@ Value *Arg1 = Emit(Arg1T, 0); // Emit the address of the destination. // The second arg of llvm.va_copy is a pointer to a valist. Value *Arg2; - if (!isAggregateTreeType(TREE_TYPE(Arg2T))) { + if (!isAggregateTreeType(va_list_type_node)) { // Emit it as a value, then store it to a temporary slot. Value *V2 = Emit(Arg2T, 0); Arg2 = CreateTemporary(V2->getType()); Builder.CreateStore(V2, Arg2); } else { - // If the target has aggregate valists, emit the srcval directly into a - // temporary. - const Type *VAListTy = cast(Arg1->getType())->getElementType(); - MemRef DestLoc = CreateTempLoc(VAListTy); - Emit(Arg2T, &DestLoc); - Arg2 = DestLoc.Ptr; + // If the target has aggregate valists, then the second argument + // from GCC is the address of the source valist and we don't + // need to do anything special. + Arg2 = Emit(Arg2T, 0); } static const Type *VPTy = PointerType::getUnqual(Type::Int8Ty); From evan.cheng at apple.com Fri Apr 18 15:55:36 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 18 Apr 2008 20:55:36 -0000 Subject: [llvm-commits] [llvm] r49921 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86Instr64bit.td X86InstrInfo.td Message-ID: <200804182055.m3IKtaaa011916@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 15:55:36 2008 New Revision: 49921 URL: http://llvm.org/viewvc/llvm-project?rev=49921&view=rev Log: - Fix atomic operation JIT encoding. - Remove unused instructions. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=49921&r1=49920&r2=49921&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Fri Apr 18 15:55:36 2008 @@ -471,7 +471,10 @@ unsigned NumOps = Desc->getNumOperands(); unsigned CurOp = 0; if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1) - CurOp++; + ++CurOp; + else if (NumOps > 2 && Desc->getOperandConstraint(NumOps-1, TOI::TIED_TO)== 0) + // Skip the last source operand that is tied_to the dest reg. e.g. LXADD32 + --NumOps; unsigned char BaseOpcode = II->getBaseOpcodeFor(Desc); switch (Desc->TSFlags & X86II::FormMask) { Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=49921&r1=49920&r2=49921&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Fri Apr 18 15:55:36 2008 @@ -1107,29 +1107,20 @@ // Atomic Instructions //===----------------------------------------------------------------------===// -//FIXME: Please check the format Pseudo is certainly wrong, but the opcode and -// prefixes should be correct - let Defs = [RAX, EFLAGS], Uses = [RAX] in { -def CMPXCHG64 : RI<0xB1, Pseudo, (outs), (ins i64mem:$ptr, GR64:$swap), - "cmpxchgq $swap,$ptr", []>, TB; -def LCMPXCHG64 : RI<0xB1, Pseudo, (outs), (ins i64mem:$ptr, GR64:$swap), +def LCMPXCHG64 : RI<0xB1, MRMDestMem, (outs), (ins i64mem:$ptr, GR64:$swap), "lock cmpxchgq $swap,$ptr", [(X86cas addr:$ptr, GR64:$swap, 8)]>, TB, LOCK; } let Constraints = "$val = $dst", Defs = [EFLAGS] in { -def LXADD64 : RI<0xC1, Pseudo, (outs GR64:$dst), (ins i64mem:$ptr, GR64:$val), +def LXADD64 : RI<0xC1, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val), "lock xadd $val, $ptr", [(set GR64:$dst, (atomic_las_64 addr:$ptr, GR64:$val))]>, TB, LOCK; -def XADD64 : RI<0xC1, Pseudo, (outs GR64:$dst), (ins i64mem:$ptr, GR64:$val), - "xadd $val, $ptr", []>, TB; -def LXCHG64 : RI<0x87, Pseudo, (outs GR64:$dst), (ins i64mem:$ptr, GR64:$val), +def LXCHG64 : RI<0x87, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val), "lock xchg $val, $ptr", [(set GR64:$dst, (atomic_swap_64 addr:$ptr, GR64:$val))]>, LOCK; -def XCHG64 : RI<0x87, Pseudo, (outs GR64:$dst), (ins i64mem:$ptr, GR64:$val), - "xchg $val, $ptr", []>; } Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49921&r1=49920&r2=49921&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Fri Apr 18 15:55:36 2008 @@ -2543,75 +2543,57 @@ // Atomic support // -//FIXME: Please check the format Pseudo is certainly wrong, but the opcode and -// prefixes should be correct - +// Atomic compare and swap. let Defs = [EAX, EFLAGS], Uses = [EAX] in { -def CMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), - "cmpxchg{l}\t{$swap, $ptr|$ptr, $swap}", []>, TB; -def LCMPXCHG32 : I<0xB1, Pseudo, (outs), (ins i32mem:$ptr, GR32:$swap), +def LCMPXCHG32 : I<0xB1, MRMDestMem, (outs), (ins i32mem:$ptr, GR32:$swap), "lock cmpxchg{l}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR32:$swap, 4)]>, TB, LOCK; } let Defs = [EAX, EBX, ECX, EDX, EFLAGS], Uses = [EAX, EBX, ECX, EDX] in { -def CMPXCHG8B : I<0xC7, Pseudo, (outs), (ins i32mem:$ptr), - "cmpxchg8b\t$ptr", []>, TB; -def LCMPXCHG8B : I<0xC7, Pseudo, (outs), (ins i32mem:$ptr), +def LCMPXCHG8B : I<0xC7, MRMDestMem, (outs), (ins i32mem:$ptr), "lock cmpxchg8b\t$ptr", [(X86cas8 addr:$ptr)]>, TB, LOCK; } let Defs = [AX, EFLAGS], Uses = [AX] in { -def CMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), - "cmpxchg{w}\t{$swap, $ptr|$ptr, $swap}", []>, TB, OpSize; -def LCMPXCHG16 : I<0xB1, Pseudo, (outs), (ins i16mem:$ptr, GR16:$swap), +def LCMPXCHG16 : I<0xB1, MRMDestMem, (outs), (ins i16mem:$ptr, GR16:$swap), "lock cmpxchg{w}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR16:$swap, 2)]>, TB, OpSize, LOCK; } let Defs = [AL, EFLAGS], Uses = [AL] in { -def CMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), - "cmpxchg{b}\t{$swap, $ptr|$ptr, $swap}", []>, TB; -def LCMPXCHG8 : I<0xB0, Pseudo, (outs), (ins i8mem:$ptr, GR8:$swap), +def LCMPXCHG8 : I<0xB0, MRMDestMem, (outs), (ins i8mem:$ptr, GR8:$swap), "lock cmpxchg{b}\t{$swap, $ptr|$ptr, $swap}", [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK; } +// Atomic swap let Constraints = "$val = $dst", Defs = [EFLAGS] in { -def LXADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), +def LXCHG32 : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), + "lock xchg{l}\t{$val, $ptr|$ptr, $val}", + [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>, LOCK; +def LXCHG16 : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), + "lock xchg{w}\t{$val, $ptr|$ptr, $val}", + [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, + OpSize, LOCK; +def LXCHG8 : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), + "lock xchg{b}\t{$val, $ptr|$ptr, $val}", + [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>, LOCK; +} + +// Atomic exchange and add +let Constraints = "$val = $dst", Defs = [EFLAGS] in { +def LXADD32 : I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), "lock xadd{l}\t{$val, $ptr|$ptr, $val}", [(set GR32:$dst, (atomic_las_32 addr:$ptr, GR32:$val))]>, TB, LOCK; -def LXADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), +def LXADD16 : I<0xC1, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), "lock xadd{w}\t{$val, $ptr|$ptr, $val}", [(set GR16:$dst, (atomic_las_16 addr:$ptr, GR16:$val))]>, TB, OpSize, LOCK; -def LXADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), +def LXADD8 : I<0xC0, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), "lock xadd{b}\t{$val, $ptr|$ptr, $val}", [(set GR8:$dst, (atomic_las_8 addr:$ptr, GR8:$val))]>, TB, LOCK; -def XADD32 : I<0xC1, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xadd{l}\t{$val, $ptr|$ptr, $val}", []>, TB; -def XADD16 : I<0xC1, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xadd{w}\t{$val, $ptr|$ptr, $val}", []>, TB, OpSize; -def XADD8 : I<0xC0, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xadd{b}\t{$val, $ptr|$ptr, $val}", []>, TB; - -def LXCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xchg{l}\t{$val, $ptr|$ptr, $val}", - [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>, LOCK; -def LXCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xchg{w}\t{$val, $ptr|$ptr, $val}", - [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, - OpSize, LOCK; -def LXCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xchg{b}\t{$val, $ptr|$ptr, $val}", - [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>, LOCK; -def XCHG32 : I<0x87, Pseudo, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "xchg{l}\t{$val, $ptr|$ptr, $val}", []>; -def XCHG16 : I<0x87, Pseudo, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "xchg{w}\t{$val, $ptr|$ptr, $val}", []>, OpSize; -def XCHG8 : I<0x86, Pseudo, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "xchg{b}\t{$val, $ptr|$ptr, $val}", []>; } //===----------------------------------------------------------------------===// From gohman at apple.com Fri Apr 18 15:55:41 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Apr 2008 20:55:41 -0000 Subject: [llvm-commits] [llvm] r49922 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200804182055.m3IKtf4S011932@zion.cs.uiuc.edu> Author: djg Date: Fri Apr 18 15:55:41 2008 New Revision: 49922 URL: http://llvm.org/viewvc/llvm-project?rev=49922&view=rev Log: Fix the handling of va_copy on x86-64. As of llvm-gcc r49920 llvm-gcc is now lowering va_copy on x86-64, so this completes the fix for PR2230. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=49922&r1=49921&r2=49922&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Apr 18 15:55:41 2008 @@ -4954,26 +4954,16 @@ SDOperand X86TargetLowering::LowerVACOPY(SDOperand Op, SelectionDAG &DAG) { // X86-64 va_list is a struct { i32, i32, i8*, i8* }. + assert(Subtarget->is64Bit() && "This code only handles 64-bit va_copy!"); SDOperand Chain = Op.getOperand(0); SDOperand DstPtr = Op.getOperand(1); SDOperand SrcPtr = Op.getOperand(2); const Value *DstSV = cast(Op.getOperand(3))->getValue(); const Value *SrcSV = cast(Op.getOperand(4))->getValue(); - SrcPtr = DAG.getLoad(getPointerTy(), Chain, SrcPtr, SrcSV, 0); - Chain = SrcPtr.getValue(1); - for (unsigned i = 0; i < 3; ++i) { - SDOperand Val = DAG.getLoad(MVT::i64, Chain, SrcPtr, SrcSV, 0); - Chain = Val.getValue(1); - Chain = DAG.getStore(Chain, Val, DstPtr, DstSV, 0); - if (i == 2) - break; - SrcPtr = DAG.getNode(ISD::ADD, getPointerTy(), SrcPtr, - DAG.getIntPtrConstant(8)); - DstPtr = DAG.getNode(ISD::ADD, getPointerTy(), DstPtr, - DAG.getIntPtrConstant(8)); - } - return Chain; + return DAG.getMemcpy(Chain, DstPtr, SrcPtr, + DAG.getIntPtrConstant(24), 8, false, + DstSV, 0, SrcSV, 0); } SDOperand From baldrick at free.fr Fri Apr 18 15:56:03 2008 From: baldrick at free.fr (Duncan Sands) Date: Fri, 18 Apr 2008 20:56:03 -0000 Subject: [llvm-commits] [llvm] r49923 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.h LegalizeTypesFloatToInt.cpp Message-ID: <200804182056.m3IKu3ZH011957@zion.cs.uiuc.edu> Author: baldrick Date: Fri Apr 18 15:56:03 2008 New Revision: 49923 URL: http://llvm.org/viewvc/llvm-project?rev=49923&view=rev Log: Implement a bit more softfloat support in LegalizeTypes. Correct the load logic so that it actually works, and also teach it to handle floating point extending loads. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=49923&r1=49922&r2=49923&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Fri Apr 18 15:56:03 2008 @@ -316,8 +316,13 @@ void FloatToIntResult(SDNode *N, unsigned OpNo); SDOperand FloatToIntRes_BIT_CONVERT(SDNode *N); SDOperand FloatToIntRes_BUILD_PAIR(SDNode *N); + SDOperand FloatToIntRes_ConstantFP(ConstantFPSDNode *N); + SDOperand FloatToIntRes_FADD(SDNode *N); SDOperand FloatToIntRes_FCOPYSIGN(SDNode *N); + SDOperand FloatToIntRes_FMUL(SDNode *N); + SDOperand FloatToIntRes_FSUB(SDNode *N); SDOperand FloatToIntRes_LOAD(SDNode *N); + SDOperand FloatToIntRes_XINT_TO_FP(SDNode *N); // Operand Float to Integer Conversion. bool FloatToIntOperand(SDNode *N, unsigned OpNo); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp?rev=49923&r1=49922&r2=49923&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp Fri Apr 18 15:56:03 2008 @@ -11,12 +11,29 @@ // is the act of turning a computation in an invalid floating point type into // a computation in an integer type of the same size. For example, turning // f32 arithmetic into operations using i32. Also known as "soft float". +// The result is equivalent to bitcasting the float value to the integer type. // //===----------------------------------------------------------------------===// +#include "llvm/CodeGen/PseudoSourceValue.h" +#include "llvm/DerivedTypes.h" #include "LegalizeTypes.h" using namespace llvm; +/// GetFPLibCall - Return the right libcall for the given floating point type. +static RTLIB::Libcall GetFPLibCall(MVT::ValueType VT, + RTLIB::Libcall Call_F32, + RTLIB::Libcall Call_F64, + RTLIB::Libcall Call_F80, + RTLIB::Libcall Call_PPCF128) { + return + VT == MVT::f32 ? Call_F32 : + VT == MVT::f64 ? Call_F64 : + VT == MVT::f80 ? Call_F80 : + VT == MVT::ppcf128 ? Call_PPCF128 : + RTLIB::UNKNOWN_LIBCALL; +} + //===----------------------------------------------------------------------===// // Result Float to Integer Conversion. //===----------------------------------------------------------------------===// @@ -52,8 +69,17 @@ case ISD::BIT_CONVERT: R = FloatToIntRes_BIT_CONVERT(N); break; case ISD::BUILD_PAIR: R = FloatToIntRes_BUILD_PAIR(N); break; + case ISD::ConstantFP: + R = FloatToIntRes_ConstantFP(cast(N)); + break; case ISD::FCOPYSIGN: R = FloatToIntRes_FCOPYSIGN(N); break; case ISD::LOAD: R = FloatToIntRes_LOAD(N); break; + case ISD::SINT_TO_FP: + case ISD::UINT_TO_FP: R = FloatToIntRes_XINT_TO_FP(N); break; + + case ISD::FADD: R = FloatToIntRes_FADD(N); break; + case ISD::FMUL: R = FloatToIntRes_FMUL(N); break; + case ISD::FSUB: R = FloatToIntRes_FSUB(N); break; } // If R is null, the sub-method took care of registering the result. @@ -73,6 +99,23 @@ BitConvertToInteger(N->getOperand(1))); } +SDOperand DAGTypeLegalizer::FloatToIntRes_ConstantFP(ConstantFPSDNode *N) { + return DAG.getConstant(N->getValueAPF().convertToAPInt(), + TLI.getTypeToTransformTo(N->getValueType(0))); +} + +SDOperand DAGTypeLegalizer::FloatToIntRes_FADD(SDNode *N) { + MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)), + GetIntegerOp(N->getOperand(1)) }; + return MakeLibCall(GetFPLibCall(N->getValueType(0), + RTLIB::ADD_F32, + RTLIB::ADD_F64, + RTLIB::ADD_F80, + RTLIB::ADD_PPCF128), + NVT, Ops, 2, false/*sign irrelevant*/); +} + SDOperand DAGTypeLegalizer::FloatToIntRes_FCOPYSIGN(SDNode *N) { SDOperand LHS = GetIntegerOp(N->getOperand(0)); SDOperand RHS = BitConvertToInteger(N->getOperand(1)); @@ -112,14 +155,148 @@ return DAG.getNode(ISD::OR, LVT, LHS, SignBit); } -SDOperand DAGTypeLegalizer::FloatToIntRes_LOAD(SDNode *N) { +SDOperand DAGTypeLegalizer::FloatToIntRes_FMUL(SDNode *N) { + MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)), + GetIntegerOp(N->getOperand(1)) }; + return MakeLibCall(GetFPLibCall(N->getValueType(0), + RTLIB::MUL_F32, + RTLIB::MUL_F64, + RTLIB::MUL_F80, + RTLIB::MUL_PPCF128), + NVT, Ops, 2, false/*sign irrelevant*/); +} + +SDOperand DAGTypeLegalizer::FloatToIntRes_FSUB(SDNode *N) { MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0)); + SDOperand Ops[2] = { GetIntegerOp(N->getOperand(0)), + GetIntegerOp(N->getOperand(1)) }; + return MakeLibCall(GetFPLibCall(N->getValueType(0), + RTLIB::SUB_F32, + RTLIB::SUB_F64, + RTLIB::SUB_F80, + RTLIB::SUB_PPCF128), + NVT, Ops, 2, false/*sign irrelevant*/); +} + +SDOperand DAGTypeLegalizer::FloatToIntRes_LOAD(SDNode *N) { LoadSDNode *L = cast(N); + MVT::ValueType VT = N->getValueType(0); + MVT::ValueType NVT = TLI.getTypeToTransformTo(VT); + + if (L->getExtensionType() == ISD::NON_EXTLOAD) + return DAG.getLoad(L->getAddressingMode(), L->getExtensionType(), + NVT, L->getChain(), L->getBasePtr(), L->getOffset(), + L->getSrcValue(), L->getSrcValueOffset(), NVT, + L->isVolatile(), L->getAlignment()); + + // Do a non-extending load followed by FP_EXTEND. + SDOperand NL = DAG.getLoad(L->getAddressingMode(), ISD::NON_EXTLOAD, + L->getMemoryVT(), L->getChain(), + L->getBasePtr(), L->getOffset(), + L->getSrcValue(), L->getSrcValueOffset(), + L->getMemoryVT(), + L->isVolatile(), L->getAlignment()); + return BitConvertToInteger(DAG.getNode(ISD::FP_EXTEND, VT, NL)); +} + +SDOperand DAGTypeLegalizer::FloatToIntRes_XINT_TO_FP(SDNode *N) { + bool isSigned = N->getOpcode() == ISD::SINT_TO_FP; + MVT::ValueType DestVT = N->getValueType(0); + SDOperand Op = N->getOperand(0); + + if (Op.getValueType() == MVT::i32) { + // simple 32-bit [signed|unsigned] integer to float/double expansion + + // Get the stack frame index of a 8 byte buffer. + SDOperand StackSlot = DAG.CreateStackTemporary(MVT::f64); + + // word offset constant for Hi/Lo address computation + SDOperand Offset = DAG.getConstant(MVT::getSizeInBits(MVT::i32) / 8, + TLI.getPointerTy()); + // set up Hi and Lo (into buffer) address based on endian + SDOperand Hi = StackSlot; + SDOperand Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, Offset); + if (TLI.isLittleEndian()) + std::swap(Hi, Lo); + + // if signed map to unsigned space + SDOperand OpMapped; + if (isSigned) { + // constant used to invert sign bit (signed to unsigned mapping) + SDOperand SignBit = DAG.getConstant(0x80000000u, MVT::i32); + OpMapped = DAG.getNode(ISD::XOR, MVT::i32, Op, SignBit); + } else { + OpMapped = Op; + } + // store the lo of the constructed double - based on integer input + SDOperand Store1 = DAG.getStore(DAG.getEntryNode(), + OpMapped, Lo, NULL, 0); + // initial hi portion of constructed double + SDOperand InitialHi = DAG.getConstant(0x43300000u, MVT::i32); + // store the hi of the constructed double - biased exponent + SDOperand Store2=DAG.getStore(Store1, InitialHi, Hi, NULL, 0); + // load the constructed double + SDOperand Load = DAG.getLoad(MVT::f64, Store2, StackSlot, NULL, 0); + // FP constant to bias correct the final result + SDOperand Bias = DAG.getConstantFP(isSigned ? + BitsToDouble(0x4330000080000000ULL) + : BitsToDouble(0x4330000000000000ULL), + MVT::f64); + // subtract the bias + SDOperand Sub = DAG.getNode(ISD::FSUB, MVT::f64, Load, Bias); + // final result + SDOperand Result; + // handle final rounding + if (DestVT == MVT::f64) { + // do nothing + Result = Sub; + } else if (MVT::getSizeInBits(DestVT) < MVT::getSizeInBits(MVT::f64)) { + Result = DAG.getNode(ISD::FP_ROUND, DestVT, Sub, + DAG.getIntPtrConstant(0)); + } else if (MVT::getSizeInBits(DestVT) > MVT::getSizeInBits(MVT::f64)) { + Result = DAG.getNode(ISD::FP_EXTEND, DestVT, Sub); + } + return BitConvertToInteger(Result); + } + assert(!isSigned && "Legalize cannot Expand SINT_TO_FP for i64 yet"); + SDOperand Tmp1 = DAG.getNode(ISD::SINT_TO_FP, DestVT, Op); + + SDOperand SignSet = DAG.getSetCC(TLI.getSetCCResultType(Op), Op, + DAG.getConstant(0, Op.getValueType()), + ISD::SETLT); + SDOperand Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4); + SDOperand CstOffset = DAG.getNode(ISD::SELECT, Zero.getValueType(), + SignSet, Four, Zero); + + // If the sign bit of the integer is set, the large number will be treated + // as a negative number. To counteract this, the dynamic code adds an + // offset depending on the data type. + uint64_t FF; + switch (Op.getValueType()) { + default: assert(0 && "Unsupported integer type!"); + case MVT::i8 : FF = 0x43800000ULL; break; // 2^8 (as a float) + case MVT::i16: FF = 0x47800000ULL; break; // 2^16 (as a float) + case MVT::i32: FF = 0x4F800000ULL; break; // 2^32 (as a float) + case MVT::i64: FF = 0x5F800000ULL; break; // 2^64 (as a float) + } + if (TLI.isLittleEndian()) FF <<= 32; + static Constant *FudgeFactor = ConstantInt::get(Type::Int64Ty, FF); + + SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy()); + CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset); + SDOperand FudgeInReg; + if (DestVT == MVT::f32) + FudgeInReg = DAG.getLoad(MVT::f32, DAG.getEntryNode(), CPIdx, + PseudoSourceValue::getConstantPool(), 0); + else { + FudgeInReg = DAG.getExtLoad(ISD::EXTLOAD, DestVT, + DAG.getEntryNode(), CPIdx, + PseudoSourceValue::getConstantPool(), 0, + MVT::f32); + } - return DAG.getLoad(L->getAddressingMode(), L->getExtensionType(), - NVT, L->getChain(), L->getBasePtr(), L->getOffset(), - L->getSrcValue(), L->getSrcValueOffset(), - L->getMemoryVT(), L->isVolatile(), L->getAlignment()); + return BitConvertToInteger(DAG.getNode(ISD::FADD, DestVT, Tmp1, FudgeInReg)); } From nicolas.geoffray at lip6.fr Fri Apr 18 15:59:31 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 18 Apr 2008 20:59:31 -0000 Subject: [llvm-commits] [llvm] r49924 - in /llvm/trunk: include/llvm/ExecutionEngine/JITMemoryManager.h lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp lib/ExecutionEngine/JIT/JITDwarfEmitter.h lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200804182059.m3IKxWv7012139@zion.cs.uiuc.edu> Author: geoffray Date: Fri Apr 18 15:59:31 2008 New Revision: 49924 URL: http://llvm.org/viewvc/llvm-project?rev=49924&view=rev Log: Enable jitting with a known memory size. Modified: llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h?rev=49924&r1=49923&r2=49924&view=diff ============================================================================== --- llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h (original) +++ llvm/trunk/include/llvm/ExecutionEngine/JITMemoryManager.h Fri Apr 18 15:59:31 2008 @@ -26,8 +26,9 @@ class JITMemoryManager { protected: bool HasGOT; + bool SizeRequired; public: - JITMemoryManager() : HasGOT(false) {} + JITMemoryManager() : HasGOT(false), SizeRequired(false) {} virtual ~JITMemoryManager(); /// CreateDefaultMemManager - This is used to create the default @@ -53,6 +54,12 @@ /// return a pointer to its base. virtual unsigned char *getGOTBase() const = 0; + /// RequireSize - If the memory manager requires to know the size of the + /// objects to be emitted + bool RequiresSize() const { + return SizeRequired; + } + //===--------------------------------------------------------------------===// // Main Allocation Functions //===--------------------------------------------------------------------===// Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp?rev=49924&r1=49923&r2=49924&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp Fri Apr 18 15:59:31 2008 @@ -634,3 +634,472 @@ return StartEHPtr; } + +unsigned JITDwarfEmitter::GetDwarfTableSize(MachineFunction& F, + MachineCodeEmitter& mce, + unsigned char* StartFunction, + unsigned char* EndFunction) { + const TargetMachine& TM = F.getTarget(); + TD = TM.getTargetData(); + needsIndirectEncoding = TM.getTargetAsmInfo()->getNeedsIndirectEncoding(); + stackGrowthDirection = TM.getFrameInfo()->getStackGrowthDirection(); + RI = TM.getRegisterInfo(); + MCE = &mce; + unsigned FinalSize = 0; + + FinalSize += GetExceptionTableSize(&F); + + const std::vector Personalities = MMI->getPersonalities(); + FinalSize += GetCommonEHFrameSize(Personalities[MMI->getPersonalityIndex()]); + + FinalSize += GetEHFrameSize(Personalities[MMI->getPersonalityIndex()], StartFunction); + + return FinalSize; +} + +/// AddAlignment - Add the specified alignment. +static void AddAlignment(unsigned& FinalSize, unsigned Alignment) { + if (Alignment == 0) Alignment = 1; + FinalSize = (FinalSize + Alignment - 1) & ~(Alignment - 1); +} + + +/// SizeULEB128Bytes - Gives the size of the ULEB128. +static unsigned SizeULEB128Bytes(unsigned Value) { + unsigned FinalSize = 0; + do { + Value >>= 7; + ++FinalSize; + } while (Value); + return FinalSize; +} + +/// SizeSLEB128Bytes - Gives the size of the SLEB128. +static unsigned SizeSLEB128Bytes(int Value) { + int Sign = Value >> (8 * sizeof(Value) - 1); + bool IsMore; + unsigned FinalSize = 0; + + do { + unsigned char Byte = Value & 0x7f; + Value >>= 7; + IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; + ++FinalSize; + } while (IsMore); + + return FinalSize; +} + +/// SizeString - Gives the size of the string. +static unsigned SizeString(const std::string &String) { + return String.size() + 1; +} + +unsigned JITDwarfEmitter::GetEHFrameSize(const Function* Personality, + unsigned char* StartFunction) { + unsigned PointerSize = TD->getPointerSize(); + unsigned FinalSize = 0; + // EH frame header. + FinalSize += PointerSize; + // FDE CIE Offset + FinalSize += 3 * PointerSize; + // If there is a personality and landing pads then point to the language + // specific data area in the exception table. + if (MMI->getPersonalityIndex()) { + FinalSize += SizeULEB128Bytes(4); + FinalSize += PointerSize; + } else { + FinalSize += SizeULEB128Bytes(0); + } + + // Indicate locations of function specific callee saved registers in + // frame. + FinalSize += GetFrameMovesSize((intptr_t)StartFunction, MMI->getFrameMoves()); + + AddAlignment(FinalSize, 4); + + // Double zeroes for the unwind runtime + FinalSize += 2 * PointerSize; + + return FinalSize; +} + +unsigned JITDwarfEmitter::GetCommonEHFrameSize(const Function* Personality) { + + unsigned PointerSize = TD->getPointerSize(); + int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ? + PointerSize : -PointerSize; + unsigned FinalSize = 0; + // EH Common Frame header + FinalSize += PointerSize; + FinalSize += 4; + FinalSize += 1; + FinalSize += SizeString(Personality ? "zPLR" : "zR"); + FinalSize += SizeULEB128Bytes(1); + FinalSize += SizeSLEB128Bytes(stackGrowth); + FinalSize += 1; + + if (Personality) { + FinalSize += SizeULEB128Bytes(7); + + // Encoding + FinalSize+= 1; + //Personality + FinalSize += PointerSize; + + FinalSize += SizeULEB128Bytes(dwarf::DW_EH_PE_pcrel); + FinalSize += SizeULEB128Bytes(dwarf::DW_EH_PE_pcrel); + + } else { + FinalSize += SizeULEB128Bytes(1); + FinalSize += SizeULEB128Bytes(dwarf::DW_EH_PE_pcrel); + } + + std::vector Moves; + RI->getInitialFrameState(Moves); + FinalSize += GetFrameMovesSize(0, Moves); + AddAlignment(FinalSize, 4); + return FinalSize; +} + +unsigned +JITDwarfEmitter::GetFrameMovesSize(intptr_t BaseLabelPtr, + const std::vector &Moves) { + unsigned PointerSize = TD->getPointerSize(); + int stackGrowth = stackGrowthDirection == TargetFrameInfo::StackGrowsUp ? + PointerSize : -PointerSize; + bool IsLocal = BaseLabelPtr; + unsigned FinalSize = 0; + + for (unsigned i = 0, N = Moves.size(); i < N; ++i) { + const MachineMove &Move = Moves[i]; + unsigned LabelID = Move.getLabelID(); + + if (LabelID) { + LabelID = MMI->MappedLabel(LabelID); + + // Throw out move if the label is invalid. + if (!LabelID) continue; + } + + intptr_t LabelPtr = 0; + if (LabelID) LabelPtr = MCE->getLabelAddress(LabelID); + + const MachineLocation &Dst = Move.getDestination(); + const MachineLocation &Src = Move.getSource(); + + // Advance row if new location. + if (BaseLabelPtr && LabelID && (BaseLabelPtr != LabelPtr || !IsLocal)) { + FinalSize++; + FinalSize += PointerSize; + BaseLabelPtr = LabelPtr; + IsLocal = true; + } + + // If advancing cfa. + if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { + if (!Src.isRegister()) { + if (Src.getRegister() == MachineLocation::VirtualFP) { + ++FinalSize; + } else { + ++FinalSize; + FinalSize += + SizeULEB128Bytes(RI->getDwarfRegNum(Src.getRegister(), true)); + } + + int Offset = -Src.getOffset(); + + FinalSize += SizeULEB128Bytes(Offset); + } else { + assert(0 && "Machine move no supported yet."); + } + } else if (Src.isRegister() && + Src.getRegister() == MachineLocation::VirtualFP) { + if (Dst.isRegister()) { + ++FinalSize; + FinalSize += + SizeULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister(), true)); + } else { + assert(0 && "Machine move no supported yet."); + } + } else { + unsigned Reg = RI->getDwarfRegNum(Src.getRegister(), true); + int Offset = Dst.getOffset() / stackGrowth; + + if (Offset < 0) { + ++FinalSize; + FinalSize += SizeULEB128Bytes(Reg); + FinalSize += SizeSLEB128Bytes(Offset); + } else if (Reg < 64) { + ++FinalSize; + FinalSize += SizeULEB128Bytes(Offset); + } else { + ++FinalSize; + FinalSize += SizeULEB128Bytes(Reg); + FinalSize += SizeULEB128Bytes(Offset); + } + } + } + return FinalSize; +} + +unsigned JITDwarfEmitter::GetExceptionTableSize(MachineFunction* MF) { + unsigned FinalSize = 0; + + // Map all labels and get rid of any dead landing pads. + MMI->TidyLandingPads(); + + const std::vector &TypeInfos = MMI->getTypeInfos(); + const std::vector &FilterIds = MMI->getFilterIds(); + const std::vector &PadInfos = MMI->getLandingPads(); + if (PadInfos.empty()) return 0; + + // Sort the landing pads in order of their type ids. This is used to fold + // duplicate actions. + SmallVector LandingPads; + LandingPads.reserve(PadInfos.size()); + for (unsigned i = 0, N = PadInfos.size(); i != N; ++i) + LandingPads.push_back(&PadInfos[i]); + std::sort(LandingPads.begin(), LandingPads.end(), PadLT); + + // Negative type ids index into FilterIds, positive type ids index into + // TypeInfos. The value written for a positive type id is just the type + // id itself. For a negative type id, however, the value written is the + // (negative) byte offset of the corresponding FilterIds entry. The byte + // offset is usually equal to the type id, because the FilterIds entries + // are written using a variable width encoding which outputs one byte per + // entry as long as the value written is not too large, but can differ. + // This kind of complication does not occur for positive type ids because + // type infos are output using a fixed width encoding. + // FilterOffsets[i] holds the byte offset corresponding to FilterIds[i]. + SmallVector FilterOffsets; + FilterOffsets.reserve(FilterIds.size()); + int Offset = -1; + for(std::vector::const_iterator I = FilterIds.begin(), + E = FilterIds.end(); I != E; ++I) { + FilterOffsets.push_back(Offset); + Offset -= AsmPrinter::SizeULEB128(*I); + } + + // Compute the actions table and gather the first action index for each + // landing pad site. + SmallVector Actions; + SmallVector FirstActions; + FirstActions.reserve(LandingPads.size()); + + int FirstAction = 0; + unsigned SizeActions = 0; + for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) { + const LandingPadInfo *LP = LandingPads[i]; + const std::vector &TypeIds = LP->TypeIds; + const unsigned NumShared = i ? SharedTypeIds(LP, LandingPads[i-1]) : 0; + unsigned SizeSiteActions = 0; + + if (NumShared < TypeIds.size()) { + unsigned SizeAction = 0; + ActionEntry *PrevAction = 0; + + if (NumShared) { + const unsigned SizePrevIds = LandingPads[i-1]->TypeIds.size(); + assert(Actions.size()); + PrevAction = &Actions.back(); + SizeAction = AsmPrinter::SizeSLEB128(PrevAction->NextAction) + + AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID); + for (unsigned j = NumShared; j != SizePrevIds; ++j) { + SizeAction -= AsmPrinter::SizeSLEB128(PrevAction->ValueForTypeID); + SizeAction += -PrevAction->NextAction; + PrevAction = PrevAction->Previous; + } + } + + // Compute the actions. + for (unsigned I = NumShared, M = TypeIds.size(); I != M; ++I) { + int TypeID = TypeIds[I]; + assert(-1-TypeID < (int)FilterOffsets.size() && "Unknown filter id!"); + int ValueForTypeID = TypeID < 0 ? FilterOffsets[-1 - TypeID] : TypeID; + unsigned SizeTypeID = AsmPrinter::SizeSLEB128(ValueForTypeID); + + int NextAction = SizeAction ? -(SizeAction + SizeTypeID) : 0; + SizeAction = SizeTypeID + AsmPrinter::SizeSLEB128(NextAction); + SizeSiteActions += SizeAction; + + ActionEntry Action = {ValueForTypeID, NextAction, PrevAction}; + Actions.push_back(Action); + + PrevAction = &Actions.back(); + } + + // Record the first action of the landing pad site. + FirstAction = SizeActions + SizeSiteActions - SizeAction + 1; + } // else identical - re-use previous FirstAction + + FirstActions.push_back(FirstAction); + + // Compute this sites contribution to size. + SizeActions += SizeSiteActions; + } + + // Compute the call-site table. Entries must be ordered by address. + SmallVector CallSites; + + RangeMapType PadMap; + for (unsigned i = 0, N = LandingPads.size(); i != N; ++i) { + const LandingPadInfo *LandingPad = LandingPads[i]; + for (unsigned j=0, E = LandingPad->BeginLabels.size(); j != E; ++j) { + unsigned BeginLabel = LandingPad->BeginLabels[j]; + assert(!PadMap.count(BeginLabel) && "Duplicate landing pad labels!"); + PadRange P = { i, j }; + PadMap[BeginLabel] = P; + } + } + + bool MayThrow = false; + unsigned LastLabel = 0; + for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); + I != E; ++I) { + for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end(); + MI != E; ++MI) { + if (MI->getOpcode() != TargetInstrInfo::LABEL) { + MayThrow |= MI->getDesc().isCall(); + continue; + } + + unsigned BeginLabel = MI->getOperand(0).getImm(); + assert(BeginLabel && "Invalid label!"); + + if (BeginLabel == LastLabel) + MayThrow = false; + + RangeMapType::iterator L = PadMap.find(BeginLabel); + + if (L == PadMap.end()) + continue; + + PadRange P = L->second; + const LandingPadInfo *LandingPad = LandingPads[P.PadIndex]; + + assert(BeginLabel == LandingPad->BeginLabels[P.RangeIndex] && + "Inconsistent landing pad map!"); + + // If some instruction between the previous try-range and this one may + // throw, create a call-site entry with no landing pad for the region + // between the try-ranges. + if (MayThrow) { + CallSiteEntry Site = {LastLabel, BeginLabel, 0, 0}; + CallSites.push_back(Site); + } + + LastLabel = LandingPad->EndLabels[P.RangeIndex]; + CallSiteEntry Site = {BeginLabel, LastLabel, + LandingPad->LandingPadLabel, FirstActions[P.PadIndex]}; + + assert(Site.BeginLabel && Site.EndLabel && Site.PadLabel && + "Invalid landing pad!"); + + // Try to merge with the previous call-site. + if (CallSites.size()) { + CallSiteEntry &Prev = CallSites[CallSites.size()-1]; + if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) { + // Extend the range of the previous entry. + Prev.EndLabel = Site.EndLabel; + continue; + } + } + + // Otherwise, create a new call-site. + CallSites.push_back(Site); + } + } + // If some instruction between the previous try-range and the end of the + // function may throw, create a call-site entry with no landing pad for the + // region following the try-range. + if (MayThrow) { + CallSiteEntry Site = {LastLabel, 0, 0, 0}; + CallSites.push_back(Site); + } + + // Final tallies. + unsigned SizeSites = CallSites.size() * (sizeof(int32_t) + // Site start. + sizeof(int32_t) + // Site length. + sizeof(int32_t)); // Landing pad. + for (unsigned i = 0, e = CallSites.size(); i < e; ++i) + SizeSites += AsmPrinter::SizeULEB128(CallSites[i].Action); + + unsigned SizeTypes = TypeInfos.size() * TD->getPointerSize(); + + unsigned TypeOffset = sizeof(int8_t) + // Call site format + // Call-site table length + AsmPrinter::SizeULEB128(SizeSites) + + SizeSites + SizeActions + SizeTypes; + + unsigned TotalSize = sizeof(int8_t) + // LPStart format + sizeof(int8_t) + // TType format + AsmPrinter::SizeULEB128(TypeOffset) + // TType base offset + TypeOffset; + + unsigned SizeAlign = (4 - TotalSize) & 3; + + // Begin the exception table. + AddAlignment(FinalSize, 4); + for (unsigned i = 0; i != SizeAlign; ++i) { + ++FinalSize; + } + + unsigned PointerSize = TD->getPointerSize(); + + // Emit the header. + ++FinalSize; + // Asm->EOL("LPStart format (DW_EH_PE_omit)"); + ++FinalSize; + // Asm->EOL("TType format (DW_EH_PE_absptr)"); + ++FinalSize; + // Asm->EOL("TType base offset"); + ++FinalSize; + // Asm->EOL("Call site format (DW_EH_PE_udata4)"); + ++FinalSize; + // Asm->EOL("Call-site table length"); + + // Emit the landing pad site information. + for (unsigned i = 0; i < CallSites.size(); ++i) { + CallSiteEntry &S = CallSites[i]; + + // Asm->EOL("Region start"); + FinalSize += PointerSize; + + //Asm->EOL("Region length"); + FinalSize += PointerSize; + + // Asm->EOL("Landing pad"); + FinalSize += PointerSize; + + FinalSize += SizeULEB128Bytes(S.Action); + // Asm->EOL("Action"); + } + + // Emit the actions. + for (unsigned I = 0, N = Actions.size(); I != N; ++I) { + ActionEntry &Action = Actions[I]; + + //Asm->EOL("TypeInfo index"); + FinalSize += SizeSLEB128Bytes(Action.ValueForTypeID); + //Asm->EOL("Next action"); + FinalSize += SizeSLEB128Bytes(Action.NextAction); + } + + // Emit the type ids. + for (unsigned M = TypeInfos.size(); M; --M) { + // Asm->EOL("TypeInfo"); + FinalSize += PointerSize; + } + + // Emit the filter typeids. + for (unsigned j = 0, M = FilterIds.size(); j < M; ++j) { + unsigned TypeID = FilterIds[j]; + FinalSize += SizeULEB128Bytes(TypeID); + //Asm->EOL("Filter TypeInfo index"); + } + + AddAlignment(FinalSize, 4); + + return FinalSize; +} Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h?rev=49924&r1=49923&r2=49924&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITDwarfEmitter.h Fri Apr 18 15:59:31 2008 @@ -35,9 +35,6 @@ bool needsIndirectEncoding; bool stackGrowthDirection; -public: - JITDwarfEmitter(JIT& jit); - unsigned char* EmitExceptionTable(MachineFunction* MF, unsigned char* StartFunction, unsigned char* EndFunction); @@ -53,17 +50,37 @@ unsigned char* EndFunction, unsigned char* ExceptionTable); + unsigned GetExceptionTableSize(MachineFunction* MF); + + unsigned GetFrameMovesSize(intptr_t BaseLabelPtr, + const std::vector &Moves); + + unsigned GetCommonEHFrameSize(const Function* Personality); + unsigned GetEHFrameSize(const Function* Personality, + unsigned char* StartFunction); + +public: + + JITDwarfEmitter(JIT& jit); + unsigned char* EmitDwarfTable(MachineFunction& F, MachineCodeEmitter& MCE, unsigned char* StartFunction, unsigned char* EndFunction); + + unsigned GetDwarfTableSize(MachineFunction& F, + MachineCodeEmitter& MCE, + unsigned char* StartFunction, + unsigned char* EndFunction); + void setModuleInfo(MachineModuleInfo* Info) { MMI = Info; } }; + } // end namespace llvm #endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=49924&r1=49923&r2=49924&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Fri Apr 18 15:59:31 2008 @@ -32,6 +32,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/MutexGuard.h" #include "llvm/System/Disassembler.h" +#include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/Statistic.h" #include using namespace llvm; @@ -597,9 +598,65 @@ return Resolver.getGlobalValueLazyPtr(V, GVAddress); } +static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP) { + const std::vector &Constants = MCP->getConstants(); + if (Constants.empty()) return 0; + + MachineConstantPoolEntry CPE = Constants.back(); + unsigned Size = CPE.Offset; + const Type *Ty = CPE.isMachineConstantPoolEntry() + ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); + Size += TheJIT->getTargetData()->getABITypeSize(Ty); + return Size; +} + +static unsigned GetJumpTableSizeInBytes(MachineJumpTableInfo *MJTI) { + const std::vector &JT = MJTI->getJumpTables(); + if (JT.empty()) return 0; + + unsigned NumEntries = 0; + for (unsigned i = 0, e = JT.size(); i != e; ++i) + NumEntries += JT[i].MBBs.size(); + + unsigned EntrySize = MJTI->getEntrySize(); + + return NumEntries * EntrySize; +} + +static void AddAlignment(uintptr_t& Size, unsigned Alignment) { + if (Alignment == 0) Alignment = 1; + Size = (Size + Alignment - 1) & (Alignment - 1); +} void JITEmitter::startFunction(MachineFunction &F) { - uintptr_t ActualSize; + uintptr_t ActualSize = 0; + if (MemMgr->RequiresSize()) { + const TargetInstrInfo* TII = F.getTarget().getInstrInfo(); + MachineJumpTableInfo *MJTI = F.getJumpTableInfo(); + MachineConstantPool *MCP = F.getConstantPool(); + + // Ensure the constant pool/jump table info is at least 4-byte aligned. + AddAlignment(ActualSize, 16); + + // Add the alignment of the constant pool + AddAlignment(ActualSize, 1 << MCP->getConstantPoolAlignment()); + + // Add the constant pool size + ActualSize += GetConstantPoolSizeInBytes(MCP); + + // Add the aligment of the jump table info + AddAlignment(ActualSize, MJTI->getAlignment()); + + // Add the jump table size + ActualSize += GetJumpTableSizeInBytes(MJTI); + + // Add the alignment for the function + AddAlignment(ActualSize, std::max(F.getFunction()->getAlignment(), 8U)); + + // Add the function size + ActualSize += TII->GetFunctionSizeInBytes(F); + } + BufferBegin = CurBufferPtr = MemMgr->startFunctionBody(F.getFunction(), ActualSize); BufferEnd = BufferBegin+ActualSize; @@ -714,10 +771,14 @@ << sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart); #endif if (ExceptionHandling) { - uintptr_t ActualSize; + uintptr_t ActualSize = 0; SavedBufferBegin = BufferBegin; SavedBufferEnd = BufferEnd; SavedCurBufferPtr = CurBufferPtr; + + if (MemMgr->RequiresSize()) { + ActualSize = DE->GetDwarfTableSize(F, *this, FnStart, FnEnd); + } BufferBegin = CurBufferPtr = MemMgr->startExceptionTable(F.getFunction(), ActualSize); From criswell at uiuc.edu Fri Apr 18 16:19:07 2008 From: criswell at uiuc.edu (John Criswell) Date: Fri, 18 Apr 2008 21:19:07 -0000 Subject: [llvm-commits] [poolalloc] r49926 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h lib/PoolAllocate/PASimple.cpp lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200804182119.m3ILJ7Bd012917@zion.cs.uiuc.edu> Author: criswell Date: Fri Apr 18 16:19:07 2008 New Revision: 49926 URL: http://llvm.org/viewvc/llvm-project?rev=49926&view=rev Log: Added support in the simple pool allocator for calloc(). Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h poolalloc/trunk/lib/PoolAllocate/PASimple.cpp poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=49926&r1=49925&r2=49926&view=diff ============================================================================== --- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original) +++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Fri Apr 18 16:19:07 2008 @@ -160,6 +160,7 @@ #endif Constant *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign; Constant *PoolFree; + Constant *PoolCalloc; Constant *PoolStrdup; static const Type *PoolDescPtrTy; Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=49926&r1=49925&r2=49926&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Fri Apr 18 16:19:07 2008 @@ -217,6 +217,48 @@ // Update def-use info CI->replaceAllUsesWith(Casted); + } else if (CF && (CF->isDeclaration()) && (CF->getName() == "calloc")) { + // Associate the global pool decriptor with the DSNode + DSNode * Node = ECG.getNodeForValue(CI).getNode(); + FInfo.PoolDescriptors.insert(make_pair(Node,TheGlobalPool)); + + // Mark the realloc as an instruction to delete + toDelete.push_back(ii); + + // Insertion point - Instruction before which all our instructions go + Instruction *InsertPt = CI; + Value *NumElements = CS.getArgument(0); + Value *Size = CS.getArgument(1); + + // Ensure the size and pointer arguments are of the correct type + if (Size->getType() != Type::Int32Ty) + Size = CastInst::createIntegerCast (Size, + Type::Int32Ty, + false, + Size->getName(), + InsertPt); + + if (NumElements->getType() != Type::Int32Ty) + NumElements = CastInst::createIntegerCast (Size, + Type::Int32Ty, + false, + NumElements->getName(), + InsertPt); + + std::string Name = CI->getName(); CI->setName(""); + Value* Opts[3] = {TheGlobalPool, NumElements, Size}; + Instruction *V = CallInst::Create (PoolCalloc, + Opts, + Opts + 3, + Name, + InsertPt); + + Instruction *Casted = V; + if (V->getType() != CI->getType()) + Casted = CastInst::createPointerCast (V, CI->getType(), V->getName(), InsertPt); + + // Update def-use info + CI->replaceAllUsesWith(Casted); } } else if (FreeInst * FI = dyn_cast(ii)) { Type * VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=49926&r1=49925&r2=49926&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Fri Apr 18 16:19:07 2008 @@ -213,6 +213,12 @@ PoolRealloc = M->getOrInsertFunction("poolrealloc", VoidPtrTy, PoolDescPtrTy, VoidPtrTy, Type::Int32Ty, NULL); + + // The poolcalloc function. + PoolCalloc = M->getOrInsertFunction("poolcalloc", + VoidPtrTy, PoolDescPtrTy, + Type::Int32Ty, Type::Int32Ty, NULL); + // The poolmemalign function. PoolMemAlign = M->getOrInsertFunction("poolmemalign", VoidPtrTy, PoolDescPtrTy, From kremenek at apple.com Fri Apr 18 16:34:01 2008 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 18 Apr 2008 21:34:01 -0000 Subject: [llvm-commits] [llvm] r49927 - /llvm/tags/checker/checker-0002/ Message-ID: <200804182134.m3ILY1Vo013410@zion.cs.uiuc.edu> Author: kremenek Date: Fri Apr 18 16:34:01 2008 New Revision: 49927 URL: http://llvm.org/viewvc/llvm-project?rev=49927&view=rev Log: Tagged branch: checker-0002. Added: llvm/tags/checker/checker-0002/ - copied from r49926, llvm/trunk/ From dalej at apple.com Fri Apr 18 16:38:32 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 18 Apr 2008 21:38:32 -0000 Subject: [llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> Author: johannes Date: Fri Apr 18 16:38:31 2008 New Revision: 49928 URL: http://llvm.org/viewvc/llvm-project?rev=49928&view=rev Log: Fix a scalar evolution bug. Reversing everything does not work because of 0; 2>0 but -2U is also >0. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49928&r1=49927&r2=49928&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 18 16:38:31 2008 @@ -1980,8 +1980,7 @@ break; } case ICmpInst::ICMP_UGT: { - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), - SE.getNegativeSCEV(RHS), L, false); + SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L); if (!isa(TC)) return TC; break; } From dalej at apple.com Fri Apr 18 16:39:08 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 18 Apr 2008 21:39:08 -0000 Subject: [llvm-commits] [test-suite] r49930 - /test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c Message-ID: <200804182139.m3ILd87t013650@zion.cs.uiuc.edu> Author: johannes Date: Fri Apr 18 16:39:07 2008 New Revision: 49930 URL: http://llvm.org/viewvc/llvm-project?rev=49930&view=rev Log: New test. Added: test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c Added: test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c?rev=49930&view=auto ============================================================================== --- test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c (added) +++ test-suite/trunk/SingleSource/UnitTests/2008-04-18-LoopBug.c Fri Apr 18 16:39:07 2008 @@ -0,0 +1,16 @@ +void foo( unsigned int i, int array[4]) { + unsigned int j; + for (j=3; j>i; j--) + array[j] = array[j-1]; + printf("%d %d %d %d %d\n", i, array[0], array[1], array[2], array[3]); +} +main() { + int array[4], i; + for (i=0; i<5; i++) { + array[0] = 5; array[1] = 6; array[2] = 7; array[3] = 8; + foo(i, array); + } + array[0] = 5; array[1] = 6; array[2] = 7; array[3] = 8; + foo(0xffffffffu, array); + return 0; +} From criswell at cs.uiuc.edu Fri Apr 18 17:03:47 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Fri, 18 Apr 2008 17:03:47 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200804182203.m3IM3lAs011211@maute.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.31 -> 1.32 --- Log message: Added Parfait from Sun Microsystems Laboratories. --- Diffs of the changes: (+8 -1) Users.html | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.31 llvm-www/Users.html:1.32 --- llvm-www/Users.html:1.31 Wed Apr 2 10:56:42 2008 +++ llvm-www/Users.html Fri Apr 18 17:02:59 2008 @@ -80,6 +80,13 @@ Siemens Technology-to-Business Center Compiler for embedded VLIW processor + + + + Sun Microsystems Laboratories + Parfait: Bug checker of C code + +
@@ -317,6 +324,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Development List
- Last modified: $Date: 2008/04/02 15:56:42 $ + Last modified: $Date: 2008/04/18 22:02:59 $ From kremenek at apple.com Fri Apr 18 17:17:03 2008 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 18 Apr 2008 22:17:03 -0000 Subject: [llvm-commits] [llvm] r49936 - /llvm/tags/checker/checker-0003/ Message-ID: <200804182217.m3IMH4Ln015206@zion.cs.uiuc.edu> Author: kremenek Date: Fri Apr 18 17:17:01 2008 New Revision: 49936 URL: http://llvm.org/viewvc/llvm-project?rev=49936&view=rev Log: Tagging checker-0003. Added: llvm/tags/checker/checker-0003/ - copied from r49935, llvm/trunk/ From gohman at apple.com Fri Apr 18 17:56:06 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Apr 2008 15:56:06 -0700 Subject: [llvm-commits] Speeding up instruction selection In-Reply-To: References: <1C1F9E6C-5B8E-4667-A119-4590F340FDE7@apple.com> <83CD954F-CD49-4D4B-950D-B6CB6CD1B32D@apple.com> <417E9823-6AF6-44B0-83FD-89F0CC079B6A@apple.com> <3F534552-8033-40A3-8E0A-733516299939@apple.com> Message-ID: <46F54225-290F-47D6-979B-2817F6FA429B@apple.com> On Apr 16, 2008, at 9:19 AM, Roman Levenstein wrote: > > BTW, Dan, have you had any time to look at the patch introducing > queues instead of heaps in the target specific instruction selectors? Is this the ScheduleDAGRRList patch that changes std::priority_queue to std::set? I know you checked in part of those changes already; could you send me an updated patch with just the outstanding changes? Thanks, Dan From kremenek at apple.com Fri Apr 18 18:05:02 2008 From: kremenek at apple.com (Ted Kremenek) Date: Fri, 18 Apr 2008 23:05:02 -0000 Subject: [llvm-commits] [llvm] r49940 - /llvm/tags/checker/checker-0004/ Message-ID: <200804182305.m3IN52mV016511@zion.cs.uiuc.edu> Author: kremenek Date: Fri Apr 18 18:04:58 2008 New Revision: 49940 URL: http://llvm.org/viewvc/llvm-project?rev=49940&view=rev Log: Tagging checker-0004. Added: llvm/tags/checker/checker-0004/ - copied from r49939, llvm/trunk/ From lattner at apple.com Fri Apr 18 18:21:51 2008 From: lattner at apple.com (Tanya Lattner) Date: Fri, 18 Apr 2008 16:21:51 -0700 Subject: [llvm-commits] CVS: llvm-www/Users.html In-Reply-To: <200804182203.m3IM3lAs011211@maute.cs.uiuc.edu> References: <200804182203.m3IM3lAs011211@maute.cs.uiuc.edu> Message-ID: <355419F1-EC41-4170-B383-2E44CBB28D4E@apple.com> I don't think the comment is necessary. Its not private anymore if its listed here. -Tanya On Apr 18, 2008, at 3:03 PM, John Criswell wrote: > > > Changes in directory llvm-www: > > Users.html updated: 1.31 -> 1.32 > --- > Log message: > > Added Parfait from Sun Microsystems Laboratories. > > > --- > Diffs of the changes: (+8 -1) > > Users.html | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletion(-) > > > Index: llvm-www/Users.html > diff -u llvm-www/Users.html:1.31 llvm-www/Users.html:1.32 > --- llvm-www/Users.html:1.31 Wed Apr 2 10:56:42 2008 > +++ llvm-www/Users.html Fri Apr 18 17:02:59 2008 > @@ -80,6 +80,13 @@ > Siemens Technology-to-Business Center > Compiler for embedded VLIW processor > > + > + > + > + Sun Microsystems Laboratories > + Parfait: Bug checker of C code > + > + > > >
> @@ -317,6 +324,6 @@ > src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML > 4.01!"> > >
LLVM Development List
> - Last modified: $Date: 2008/04/02 15:56:42 $ > + Last modified: $Date: 2008/04/18 22:02:59 $ > > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Fri Apr 18 19:24:42 2008 From: gohman at apple.com (Dan Gohman) Date: Sat, 19 Apr 2008 00:24:42 -0000 Subject: [llvm-commits] [llvm] r49945 - in /llvm/trunk: lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.h.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs test/Assembler/MultipleReturnValueType.ll Message-ID: <200804190024.m3J0OhEc018903@zion.cs.uiuc.edu> Author: djg Date: Fri Apr 18 19:24:39 2008 New Revision: 49945 URL: http://llvm.org/viewvc/llvm-project?rev=49945&view=rev Log: Teach llvm-as to accept function types with multiple return types. Added: llvm/trunk/test/Assembler/MultipleReturnValueType.ll Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=49945&r1=49944&r2=49945&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Fri Apr 18 19:24:39 2008 @@ -1,167 +1,386 @@ +/* A Bison parser, made by GNU Bison 2.3. */ -/* A Bison parser, made from /Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton implementation for Bison's Yacc-like parsers in C -#define YYBISON 1 /* Identify Bison output. */ + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define ESAPINTVAL 259 -#define EUAPINTVAL 260 -#define LOCALVAL_ID 261 -#define GLOBALVAL_ID 262 -#define FPVAL 263 -#define VOID 264 -#define INTTYPE 265 -#define FLOAT 266 -#define DOUBLE 267 -#define X86_FP80 268 -#define FP128 269 -#define PPC_FP128 270 -#define LABEL 271 -#define TYPE 272 -#define LOCALVAR 273 -#define GLOBALVAR 274 -#define LABELSTR 275 -#define STRINGCONSTANT 276 -#define ATSTRINGCONSTANT 277 -#define PCTSTRINGCONSTANT 278 -#define ZEROINITIALIZER 279 -#define TRUETOK 280 -#define FALSETOK 281 -#define BEGINTOK 282 -#define ENDTOK 283 -#define DECLARE 284 -#define DEFINE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define ALIAS 289 -#define VOLATILE 290 -#define THREAD_LOCAL 291 -#define TO 292 -#define DOTDOTDOT 293 -#define NULL_TOK 294 -#define UNDEF 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 -#define DLLIMPORT 300 -#define DLLEXPORT 301 -#define EXTERN_WEAK 302 -#define OPAQUE 303 -#define EXTERNAL 304 -#define TARGET 305 -#define TRIPLE 306 -#define ALIGN 307 -#define ADDRSPACE 308 -#define DEPLIBS 309 -#define CALL 310 -#define TAIL 311 -#define ASM_TOK 312 -#define MODULE 313 -#define SIDEEFFECT 314 -#define CC_TOK 315 -#define CCC_TOK 316 -#define FASTCC_TOK 317 -#define COLDCC_TOK 318 -#define X86_STDCALLCC_TOK 319 -#define X86_FASTCALLCC_TOK 320 -#define DATALAYOUT 321 -#define UNWINDS 322 -#define RET 323 -#define BR 324 -#define SWITCH 325 -#define INVOKE 326 -#define UNWIND 327 -#define UNREACHABLE 328 -#define ADD 329 -#define SUB 330 -#define MUL 331 -#define UDIV 332 -#define SDIV 333 -#define FDIV 334 -#define UREM 335 -#define SREM 336 -#define FREM 337 -#define AND 338 -#define OR 339 -#define XOR 340 -#define SHL 341 -#define LSHR 342 -#define ASHR 343 -#define ICMP 344 -#define FCMP 345 -#define EQ 346 -#define NE 347 -#define SLT 348 -#define SGT 349 -#define SLE 350 -#define SGE 351 -#define ULT 352 -#define UGT 353 -#define ULE 354 -#define UGE 355 -#define OEQ 356 -#define ONE 357 -#define OLT 358 -#define OGT 359 -#define OLE 360 -#define OGE 361 -#define ORD 362 -#define UNO 363 -#define UEQ 364 -#define UNE 365 -#define MALLOC 366 -#define ALLOCA 367 -#define FREE 368 -#define LOAD 369 -#define STORE 370 -#define GETELEMENTPTR 371 -#define TRUNC 372 -#define ZEXT 373 -#define SEXT 374 -#define FPTRUNC 375 -#define FPEXT 376 -#define BITCAST 377 -#define UITOFP 378 -#define SITOFP 379 -#define FPTOUI 380 -#define FPTOSI 381 -#define INTTOPTR 382 -#define PTRTOINT 383 -#define PHI_TOK 384 -#define SELECT 385 -#define VAARG 386 -#define EXTRACTELEMENT 387 -#define INSERTELEMENT 388 -#define SHUFFLEVECTOR 389 -#define GETRESULT 390 -#define SIGNEXT 391 -#define ZEROEXT 392 -#define NORETURN 393 -#define INREG 394 -#define SRET 395 -#define NOUNWIND 396 -#define NOALIAS 397 -#define BYVAL 398 -#define NEST 399 -#define READNONE 400 -#define READONLY 401 -#define GC 402 -#define DEFAULT 403 -#define HIDDEN 404 -#define PROTECTED 405 -#line 14 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + ESAPINTVAL = 260, + EUAPINTVAL = 261, + LOCALVAL_ID = 262, + GLOBALVAL_ID = 263, + FPVAL = 264, + VOID = 265, + INTTYPE = 266, + FLOAT = 267, + DOUBLE = 268, + X86_FP80 = 269, + FP128 = 270, + PPC_FP128 = 271, + LABEL = 272, + TYPE = 273, + LOCALVAR = 274, + GLOBALVAR = 275, + LABELSTR = 276, + STRINGCONSTANT = 277, + ATSTRINGCONSTANT = 278, + PCTSTRINGCONSTANT = 279, + ZEROINITIALIZER = 280, + TRUETOK = 281, + FALSETOK = 282, + BEGINTOK = 283, + ENDTOK = 284, + DECLARE = 285, + DEFINE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + ALIAS = 290, + VOLATILE = 291, + THREAD_LOCAL = 292, + TO = 293, + DOTDOTDOT = 294, + NULL_TOK = 295, + UNDEF = 296, + INTERNAL = 297, + LINKONCE = 298, + WEAK = 299, + APPENDING = 300, + DLLIMPORT = 301, + DLLEXPORT = 302, + EXTERN_WEAK = 303, + OPAQUE = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ALIGN = 308, + ADDRSPACE = 309, + DEPLIBS = 310, + CALL = 311, + TAIL = 312, + ASM_TOK = 313, + MODULE = 314, + SIDEEFFECT = 315, + CC_TOK = 316, + CCC_TOK = 317, + FASTCC_TOK = 318, + COLDCC_TOK = 319, + X86_STDCALLCC_TOK = 320, + X86_FASTCALLCC_TOK = 321, + DATALAYOUT = 322, + UNWINDS = 323, + RET = 324, + BR = 325, + SWITCH = 326, + INVOKE = 327, + UNWIND = 328, + UNREACHABLE = 329, + ADD = 330, + SUB = 331, + MUL = 332, + UDIV = 333, + SDIV = 334, + FDIV = 335, + UREM = 336, + SREM = 337, + FREM = 338, + AND = 339, + OR = 340, + XOR = 341, + SHL = 342, + LSHR = 343, + ASHR = 344, + ICMP = 345, + FCMP = 346, + EQ = 347, + NE = 348, + SLT = 349, + SGT = 350, + SLE = 351, + SGE = 352, + ULT = 353, + UGT = 354, + ULE = 355, + UGE = 356, + OEQ = 357, + ONE = 358, + OLT = 359, + OGT = 360, + OLE = 361, + OGE = 362, + ORD = 363, + UNO = 364, + UEQ = 365, + UNE = 366, + MALLOC = 367, + ALLOCA = 368, + FREE = 369, + LOAD = 370, + STORE = 371, + GETELEMENTPTR = 372, + TRUNC = 373, + ZEXT = 374, + SEXT = 375, + FPTRUNC = 376, + FPEXT = 377, + BITCAST = 378, + UITOFP = 379, + SITOFP = 380, + FPTOUI = 381, + FPTOSI = 382, + INTTOPTR = 383, + PTRTOINT = 384, + PHI_TOK = 385, + SELECT = 386, + VAARG = 387, + EXTRACTELEMENT = 388, + INSERTELEMENT = 389, + SHUFFLEVECTOR = 390, + GETRESULT = 391, + SIGNEXT = 392, + ZEROEXT = 393, + NORETURN = 394, + INREG = 395, + SRET = 396, + NOUNWIND = 397, + NOALIAS = 398, + BYVAL = 399, + NEST = 400, + READNONE = 401, + READONLY = 402, + GC = 403, + DEFAULT = 404, + HIDDEN = 405, + PROTECTED = 406 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define ESAPINTVAL 260 +#define EUAPINTVAL 261 +#define LOCALVAL_ID 262 +#define GLOBALVAL_ID 263 +#define FPVAL 264 +#define VOID 265 +#define INTTYPE 266 +#define FLOAT 267 +#define DOUBLE 268 +#define X86_FP80 269 +#define FP128 270 +#define PPC_FP128 271 +#define LABEL 272 +#define TYPE 273 +#define LOCALVAR 274 +#define GLOBALVAR 275 +#define LABELSTR 276 +#define STRINGCONSTANT 277 +#define ATSTRINGCONSTANT 278 +#define PCTSTRINGCONSTANT 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define DEFINE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define ALIAS 290 +#define VOLATILE 291 +#define THREAD_LOCAL 292 +#define TO 293 +#define DOTDOTDOT 294 +#define NULL_TOK 295 +#define UNDEF 296 +#define INTERNAL 297 +#define LINKONCE 298 +#define WEAK 299 +#define APPENDING 300 +#define DLLIMPORT 301 +#define DLLEXPORT 302 +#define EXTERN_WEAK 303 +#define OPAQUE 304 +#define EXTERNAL 305 +#define TARGET 306 +#define TRIPLE 307 +#define ALIGN 308 +#define ADDRSPACE 309 +#define DEPLIBS 310 +#define CALL 311 +#define TAIL 312 +#define ASM_TOK 313 +#define MODULE 314 +#define SIDEEFFECT 315 +#define CC_TOK 316 +#define CCC_TOK 317 +#define FASTCC_TOK 318 +#define COLDCC_TOK 319 +#define X86_STDCALLCC_TOK 320 +#define X86_FASTCALLCC_TOK 321 +#define DATALAYOUT 322 +#define UNWINDS 323 +#define RET 324 +#define BR 325 +#define SWITCH 326 +#define INVOKE 327 +#define UNWIND 328 +#define UNREACHABLE 329 +#define ADD 330 +#define SUB 331 +#define MUL 332 +#define UDIV 333 +#define SDIV 334 +#define FDIV 335 +#define UREM 336 +#define SREM 337 +#define FREM 338 +#define AND 339 +#define OR 340 +#define XOR 341 +#define SHL 342 +#define LSHR 343 +#define ASHR 344 +#define ICMP 345 +#define FCMP 346 +#define EQ 347 +#define NE 348 +#define SLT 349 +#define SGT 350 +#define SLE 351 +#define SGE 352 +#define ULT 353 +#define UGT 354 +#define ULE 355 +#define UGE 356 +#define OEQ 357 +#define ONE 358 +#define OLT 359 +#define OGT 360 +#define OLE 361 +#define OGE 362 +#define ORD 363 +#define UNO 364 +#define UEQ 365 +#define UNE 366 +#define MALLOC 367 +#define ALLOCA 368 +#define FREE 369 +#define LOAD 370 +#define STORE 371 +#define GETELEMENTPTR 372 +#define TRUNC 373 +#define ZEXT 374 +#define SEXT 375 +#define FPTRUNC 376 +#define FPEXT 377 +#define BITCAST 378 +#define UITOFP 379 +#define SITOFP 380 +#define FPTOUI 381 +#define FPTOSI 382 +#define INTTOPTR 383 +#define PTRTOINT 384 +#define PHI_TOK 385 +#define SELECT 386 +#define VAARG 387 +#define EXTRACTELEMENT 388 +#define INSERTELEMENT 389 +#define SHUFFLEVECTOR 390 +#define GETRESULT 391 +#define SIGNEXT 392 +#define ZEROEXT 393 +#define NORETURN 394 +#define INREG 395 +#define SRET 396 +#define NOUNWIND 397 +#define NOALIAS 398 +#define BYVAL 399 +#define NEST 400 +#define READNONE 401 +#define READONLY 402 +#define GC 403 +#define DEFAULT 404 +#define HIDDEN 405 +#define PROTECTED 406 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1097,8 +1316,29 @@ } -#line 950 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 950 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1143,1227 +1383,1913 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +} +/* Line 193 of yacc.c. */ +#line 1389 "llvmAsmParser.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -#define YYFINAL 635 -#define YYFLAG -32768 -#define YYNTBASE 166 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 405 ? yytranslate[x] : 250) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 152, - 153, 156, 2, 155, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 161, - 154, 162, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 158, 157, 160, 2, 2, 2, 2, 2, 165, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 159, - 2, 2, 163, 2, 164, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151 -}; +/* Copy the second part of user declarations. */ -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 127, 132, 133, 136, 137, 139, - 141, 143, 144, 147, 149, 151, 153, 155, 157, 159, - 161, 163, 164, 166, 168, 170, 171, 173, 175, 176, - 178, 180, 182, 184, 185, 187, 189, 190, 192, 194, - 196, 198, 200, 203, 205, 207, 209, 211, 213, 215, - 217, 219, 221, 224, 225, 228, 230, 232, 234, 236, - 238, 240, 241, 244, 245, 248, 249, 252, 253, 257, - 260, 261, 263, 264, 268, 270, 273, 275, 277, 279, - 281, 283, 285, 287, 289, 291, 295, 297, 300, 306, - 312, 318, 324, 328, 331, 337, 342, 345, 347, 349, - 351, 355, 357, 361, 363, 364, 366, 370, 375, 379, - 383, 388, 393, 397, 404, 410, 413, 416, 419, 422, - 425, 428, 431, 434, 437, 440, 443, 446, 453, 459, - 468, 475, 482, 490, 498, 505, 514, 523, 527, 529, - 531, 533, 535, 536, 539, 546, 548, 549, 551, 554, - 555, 559, 560, 564, 568, 572, 576, 577, 586, 587, - 597, 598, 608, 614, 617, 621, 623, 627, 631, 635, - 639, 641, 642, 648, 652, 654, 658, 660, 661, 672, - 674, 676, 681, 683, 685, 688, 692, 693, 695, 697, - 699, 701, 703, 705, 707, 709, 711, 715, 717, 723, - 725, 727, 729, 731, 733, 735, 738, 740, 744, 747, - 750, 754, 757, 758, 762, 764, 769, 772, 775, 779, - 789, 799, 808, 823, 825, 827, 834, 840, 843, 850, - 858, 863, 868, 875, 882, 883, 884, 888, 891, 893, - 899, 905, 912, 919, 924, 931, 936, 941, 948, 955, - 958, 967, 969, 971, 972, 976, 983, 987, 994, 997, - 1003, 1011, 1017 -}; -static const short yyrhs[] = { 75, - 0, 76, 0, 77, 0, 78, 0, 79, 0, 80, - 0, 81, 0, 82, 0, 83, 0, 87, 0, 88, - 0, 89, 0, 84, 0, 85, 0, 86, 0, 118, - 0, 119, 0, 120, 0, 121, 0, 122, 0, 123, - 0, 124, 0, 125, 0, 126, 0, 127, 0, 128, - 0, 129, 0, 92, 0, 93, 0, 94, 0, 95, - 0, 96, 0, 97, 0, 98, 0, 99, 0, 100, - 0, 101, 0, 102, 0, 103, 0, 104, 0, 105, - 0, 106, 0, 107, 0, 108, 0, 109, 0, 110, - 0, 111, 0, 98, 0, 99, 0, 100, 0, 101, - 0, 26, 0, 27, 0, 11, 0, 12, 0, 13, - 0, 16, 0, 15, 0, 14, 0, 19, 0, 22, - 0, 24, 0, 173, 0, 0, 54, 152, 4, 153, - 0, 0, 173, 154, 0, 0, 20, 0, 23, 0, - 179, 0, 0, 177, 154, 0, 42, 0, 44, 0, - 43, 0, 45, 0, 47, 0, 46, 0, 48, 0, - 50, 0, 0, 149, 0, 150, 0, 151, 0, 0, - 46, 0, 48, 0, 0, 42, 0, 43, 0, 44, - 0, 47, 0, 0, 44, 0, 42, 0, 0, 62, - 0, 63, 0, 64, 0, 65, 0, 66, 0, 61, - 4, 0, 138, 0, 119, 0, 137, 0, 120, 0, - 140, 0, 141, 0, 143, 0, 144, 0, 145, 0, - 53, 4, 0, 0, 188, 187, 0, 139, 0, 142, - 0, 138, 0, 137, 0, 146, 0, 147, 0, 0, - 190, 189, 0, 0, 148, 22, 0, 0, 53, 4, - 0, 0, 155, 53, 4, 0, 34, 22, 0, 0, - 194, 0, 0, 155, 197, 196, 0, 194, 0, 53, - 4, 0, 11, 0, 12, 0, 13, 0, 16, 0, - 15, 0, 14, 0, 17, 0, 49, 0, 198, 0, - 199, 175, 156, 0, 233, 0, 157, 4, 0, 199, - 152, 203, 153, 190, 0, 10, 152, 203, 153, 190, - 0, 158, 4, 159, 199, 160, 0, 161, 4, 159, - 199, 162, 0, 163, 204, 164, 0, 163, 164, 0, - 161, 163, 204, 164, 162, 0, 161, 163, 164, 162, - 0, 199, 188, 0, 199, 0, 10, 0, 200, 0, - 202, 155, 200, 0, 202, 0, 202, 155, 39, 0, - 39, 0, 0, 199, 0, 204, 155, 199, 0, 199, - 158, 207, 160, 0, 199, 158, 160, 0, 199, 165, - 22, 0, 199, 161, 207, 162, 0, 199, 163, 207, - 164, 0, 199, 163, 164, 0, 199, 161, 163, 207, - 164, 162, 0, 199, 161, 163, 164, 162, 0, 199, - 40, 0, 199, 41, 0, 199, 233, 0, 199, 206, - 0, 199, 25, 0, 171, 3, 0, 171, 5, 0, - 171, 4, 0, 171, 6, 0, 11, 26, 0, 11, - 27, 0, 172, 9, 0, 168, 152, 205, 38, 199, - 153, 0, 117, 152, 205, 245, 153, 0, 131, 152, - 205, 155, 205, 155, 205, 153, 0, 166, 152, 205, - 155, 205, 153, 0, 167, 152, 205, 155, 205, 153, - 0, 90, 169, 152, 205, 155, 205, 153, 0, 91, - 170, 152, 205, 155, 205, 153, 0, 133, 152, 205, - 155, 205, 153, 0, 134, 152, 205, 155, 205, 155, - 205, 153, 0, 135, 152, 205, 155, 205, 155, 205, - 153, 0, 207, 155, 205, 0, 205, 0, 32, 0, - 33, 0, 37, 0, 0, 201, 233, 0, 123, 152, - 210, 38, 199, 153, 0, 212, 0, 0, 213, 0, - 212, 213, 0, 0, 31, 214, 229, 0, 0, 30, - 215, 230, 0, 59, 58, 219, 0, 176, 18, 199, - 0, 176, 18, 10, 0, 0, 178, 182, 209, 208, - 205, 175, 216, 196, 0, 0, 178, 180, 182, 209, - 208, 205, 175, 217, 196, 0, 0, 178, 181, 182, - 209, 208, 199, 175, 218, 196, 0, 178, 182, 35, - 185, 210, 0, 51, 220, 0, 55, 154, 221, 0, - 22, 0, 52, 154, 22, 0, 67, 154, 22, 0, - 158, 222, 160, 0, 222, 155, 22, 0, 22, 0, - 0, 223, 155, 199, 188, 174, 0, 199, 188, 174, - 0, 223, 0, 223, 155, 39, 0, 39, 0, 0, - 186, 201, 177, 152, 224, 153, 190, 195, 192, 191, - 0, 28, 0, 163, 0, 184, 182, 225, 226, 0, - 29, 0, 164, 0, 237, 228, 0, 183, 182, 225, - 0, 0, 60, 0, 3, 0, 4, 0, 9, 0, - 26, 0, 27, 0, 40, 0, 41, 0, 25, 0, - 161, 207, 162, 0, 206, 0, 58, 231, 22, 155, - 22, 0, 7, 0, 8, 0, 173, 0, 177, 0, - 233, 0, 232, 0, 199, 234, 0, 235, 0, 236, - 155, 235, 0, 237, 238, 0, 227, 238, 0, 239, - 176, 240, 0, 239, 242, 0, 0, 68, 38, 234, - 0, 21, 0, 21, 68, 38, 234, 0, 69, 236, - 0, 69, 10, 0, 70, 17, 234, 0, 70, 11, - 234, 155, 17, 234, 155, 17, 234, 0, 71, 171, - 234, 155, 17, 234, 158, 241, 160, 0, 71, 171, - 234, 155, 17, 234, 158, 160, 0, 72, 186, 201, - 234, 152, 244, 153, 190, 38, 17, 234, 73, 17, - 234, 0, 73, 0, 74, 0, 241, 171, 232, 155, - 17, 234, 0, 171, 232, 155, 17, 234, 0, 176, - 247, 0, 199, 158, 234, 155, 234, 160, 0, 243, - 155, 158, 234, 155, 234, 160, 0, 199, 188, 234, - 188, 0, 17, 188, 234, 188, 0, 244, 155, 199, - 188, 234, 188, 0, 244, 155, 17, 188, 234, 188, - 0, 0, 0, 245, 155, 235, 0, 57, 56, 0, - 56, 0, 166, 199, 234, 155, 234, 0, 167, 199, - 234, 155, 234, 0, 90, 169, 199, 234, 155, 234, - 0, 91, 170, 199, 234, 155, 234, 0, 168, 235, - 38, 199, 0, 131, 235, 155, 235, 155, 235, 0, - 132, 235, 155, 199, 0, 133, 235, 155, 235, 0, - 134, 235, 155, 235, 155, 235, 0, 135, 235, 155, - 235, 155, 235, 0, 130, 243, 0, 246, 186, 201, - 234, 152, 244, 153, 190, 0, 249, 0, 36, 0, - 0, 112, 199, 193, 0, 112, 199, 155, 11, 234, - 193, 0, 113, 199, 193, 0, 113, 199, 155, 11, - 234, 193, 0, 114, 235, 0, 248, 115, 199, 234, - 193, 0, 248, 116, 235, 155, 199, 234, 193, 0, - 136, 199, 233, 155, 4, 0, 117, 199, 234, 245, - 0 -}; +/* Line 216 of yacc.c. */ +#line 1402 "llvmAsmParser.tab.c" +#ifdef short +# undef short #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1113, - 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114, 1114, 1114, - 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1118, 1118, 1119, - 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1126, 1126, 1127, - 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, 1131, 1132, - 1132, 1133, 1134, 1139, 1140, 1140, 1140, 1140, 1140, 1142, - 1142, 1142, 1143, 1143, 1145, 1146, 1150, 1154, 1159, 1159, - 1161, 1162, 1167, 1173, 1174, 1175, 1176, 1177, 1181, 1182, - 1183, 1187, 1188, 1189, 1190, 1194, 1195, 1196, 1200, 1201, - 1202, 1203, 1204, 1208, 1209, 1210, 1213, 1213, 1214, 1215, - 1216, 1217, 1218, 1226, 1227, 1228, 1229, 1230, 1231, 1232, - 1233, 1234, 1235, 1239, 1240, 1245, 1246, 1247, 1248, 1249, - 1250, 1253, 1254, 1259, 1260, 1267, 1267, 1274, 1274, 1284, - 1292, 1292, 1298, 1298, 1300, 1305, 1318, 1318, 1318, 1318, - 1318, 1318, 1318, 1321, 1325, 1329, 1336, 1341, 1349, 1379, - 1404, 1409, 1419, 1429, 1433, 1443, 1450, 1459, 1466, 1471, - 1476, 1483, 1484, 1491, 1498, 1506, 1512, 1524, 1552, 1568, - 1595, 1623, 1649, 1669, 1695, 1715, 1727, 1734, 1800, 1810, - 1820, 1826, 1836, 1842, 1852, 1857, 1862, 1875, 1887, 1909, - 1917, 1923, 1934, 1939, 1944, 1950, 1956, 1965, 1969, 1977, - 1977, 1980, 1980, 1983, 1995, 2016, 2021, 2029, 2030, 2034, - 2034, 2038, 2038, 2041, 2044, 2068, 2079, 2087, 2090, 2096, - 2099, 2106, 2110, 2150, 2153, 2159, 2169, 2173, 2178, 2180, - 2185, 2190, 2199, 2209, 2220, 2224, 2233, 2242, 2247, 2373, - 2373, 2375, 2384, 2384, 2386, 2391, 2403, 2407, 2412, 2416, - 2420, 2424, 2428, 2432, 2436, 2440, 2444, 2469, 2473, 2483, - 2487, 2491, 2496, 2503, 2503, 2509, 2518, 2523, 2528, 2532, - 2541, 2550, 2559, 2563, 2567, 2572, 2578, 2586, 2590, 2595, - 2605, 2624, 2633, 2714, 2718, 2725, 2736, 2749, 2759, 2770, - 2780, 2791, 2799, 2809, 2816, 2819, 2820, 2827, 2831, 2836, - 2852, 2869, 2883, 2897, 2909, 2917, 2924, 2930, 2936, 2942, - 2957, 3043, 3048, 3052, 3059, 3066, 3074, 3081, 3089, 3097, - 3111, 3128, 3136 -}; +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; #endif +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", -"VOID","INTTYPE","FLOAT","DOUBLE","X86_FP80","FP128","PPC_FP128","LABEL","TYPE", -"LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT","PCTSTRINGCONSTANT", -"ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK","DECLARE","DEFINE", -"GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE","THREAD_LOCAL","TO","DOTDOTDOT", -"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", -"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","ADDRSPACE","DEPLIBS", -"CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK", -"COLDCC_TOK","X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","UNWINDS", -"RET","BR","SWITCH","INVOKE","UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV", -"SDIV","FDIV","UREM","SREM","FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP", -"FCMP","EQ","NE","SLT","SGT","SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE", -"OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD", -"STORE","GETELEMENTPTR","TRUNC","ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP", -"SITOFP","FPTOUI","FPTOSI","INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG", -"EXTRACTELEMENT","INSERTELEMENT","SHUFFLEVECTOR","GETRESULT","SIGNEXT","ZEROEXT", -"NORETURN","INREG","SRET","NOUNWIND","NOALIAS","BYVAL","NEST","READNONE","READONLY", -"GC","DEFAULT","HIDDEN","PROTECTED","'('","')'","'='","','","'*'","'\\\\'","'['", -"'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps","LogicalOps","CastOps", -"IPredicates","FPredicates","IntType","FPType","LocalName","OptLocalName","OptAddrSpace", -"OptLocalAssign","GlobalName","OptGlobalAssign","GlobalAssign","GVInternalLinkage", -"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", -"AliasLinkage","OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs", -"OptGC","OptAlign","OptCAlign","SectionString","OptSection","GlobalVarAttributes", -"GlobalVarAttribute","PrimType","Types","ArgType","ResultTypes","ArgTypeList", -"ArgTypeListI","TypeListI","ConstVal","ConstExpr","ConstVector","GlobalType", -"ThreadLocal","AliaseeRef","Module","DefinitionList","Definition","@1","@2", -"@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition","LibList", -"ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END","Function", -"FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef","ValueRef", -"ResolvedVal","ReturnedVal","BasicBlockList","BasicBlock","InstructionList", -"BBTerminatorInst","JumpTable","Inst","PHIList","ParamList","IndexList","OptTailCall", -"InstVal","OptVolatile","MemoryInst", NULL -}; +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; #endif -static const short yyr1[] = { 0, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, - 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 170, 171, 172, 172, 172, 172, 172, 173, - 173, 173, 174, 174, 175, 175, 176, 176, 177, 177, - 178, 178, 179, 180, 180, 180, 180, 180, 181, 181, - 181, 182, 182, 182, 182, 183, 183, 183, 184, 184, - 184, 184, 184, 185, 185, 185, 186, 186, 186, 186, - 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 188, 188, 189, 189, 189, 189, 189, - 189, 190, 190, 191, 191, 192, 192, 193, 193, 194, - 195, 195, 196, 196, 197, 197, 198, 198, 198, 198, - 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 200, 201, 201, 202, - 202, 203, 203, 203, 203, 204, 204, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 207, 207, 208, - 208, 209, 209, 210, 210, 211, 211, 212, 212, 214, - 213, 215, 213, 213, 213, 213, 216, 213, 217, 213, - 218, 213, 213, 213, 213, 219, 220, 220, 221, 222, - 222, 222, 223, 223, 224, 224, 224, 224, 225, 226, - 226, 227, 228, 228, 229, 230, 231, 231, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, - 233, 233, 233, 234, 234, 235, 236, 236, 237, 237, - 238, 239, 239, 239, 239, 239, 240, 240, 240, 240, - 240, 240, 240, 240, 240, 241, 241, 242, 243, 243, - 244, 244, 244, 244, 244, 245, 245, 246, 246, 247, - 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 248, 248, 249, 249, 249, 249, 249, 249, - 249, 249, 249 -}; +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 4, 0, 2, 0, 1, 1, - 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, - 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 2, 1, 1, 1, 1, 1, - 1, 0, 2, 0, 2, 0, 2, 0, 3, 2, - 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 2, 5, 5, - 5, 5, 3, 2, 5, 4, 2, 1, 1, 1, - 3, 1, 3, 1, 0, 1, 3, 4, 3, 3, - 4, 4, 3, 6, 5, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 6, 5, 8, - 6, 6, 7, 7, 6, 8, 8, 3, 1, 1, - 1, 1, 0, 2, 6, 1, 0, 1, 2, 0, - 3, 0, 3, 3, 3, 3, 0, 8, 0, 9, - 0, 9, 5, 2, 3, 1, 3, 3, 3, 3, - 1, 0, 5, 3, 1, 3, 1, 0, 10, 1, - 1, 4, 1, 1, 2, 3, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, - 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, - 3, 2, 0, 3, 1, 4, 2, 2, 3, 9, - 9, 8, 14, 1, 1, 6, 5, 2, 6, 7, - 4, 4, 6, 6, 0, 0, 3, 2, 1, 5, - 5, 6, 6, 4, 6, 4, 4, 6, 6, 2, - 8, 1, 1, 0, 3, 6, 3, 6, 2, 5, - 7, 5, 4 -}; +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif -static const short yydefact[] = { 72, - 60, 69, 61, 70, 62, 212, 210, 0, 0, 0, - 0, 0, 0, 82, 71, 72, 208, 86, 89, 0, - 0, 224, 0, 0, 67, 0, 73, 74, 76, 75, - 77, 79, 78, 80, 81, 83, 84, 85, 82, 82, - 203, 209, 87, 88, 82, 213, 90, 91, 92, 93, - 82, 273, 211, 273, 0, 0, 232, 225, 226, 214, - 260, 261, 216, 137, 138, 139, 142, 141, 140, 143, - 144, 0, 0, 0, 0, 262, 263, 145, 215, 147, - 203, 203, 94, 202, 0, 97, 97, 275, 0, 270, - 68, 243, 244, 245, 269, 227, 228, 231, 0, 165, - 148, 0, 0, 0, 0, 154, 166, 0, 0, 165, - 0, 0, 0, 96, 95, 0, 200, 201, 0, 0, - 98, 99, 100, 101, 102, 0, 246, 0, 0, 0, - 314, 272, 0, 229, 164, 114, 160, 162, 0, 0, - 0, 0, 0, 0, 153, 0, 0, 146, 0, 0, - 159, 0, 158, 0, 223, 137, 138, 139, 142, 141, - 140, 0, 0, 66, 66, 103, 0, 240, 241, 242, - 0, 249, 250, 251, 256, 252, 253, 254, 255, 247, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, - 14, 15, 10, 11, 12, 0, 0, 0, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 0, 0, 0, 0, 0, 0, 0, 0, 258, 265, - 264, 274, 313, 299, 0, 0, 0, 0, 97, 284, - 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 271, 97, 288, - 0, 312, 230, 157, 0, 122, 66, 66, 156, 0, - 167, 0, 122, 66, 66, 0, 204, 185, 186, 181, - 183, 182, 184, 187, 180, 176, 177, 0, 0, 0, - 0, 179, 178, 217, 0, 276, 248, 0, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 0, 52, - 53, 48, 49, 50, 51, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, - 0, 199, 0, 0, 0, 0, 298, 278, 66, 267, - 277, 0, 0, 54, 0, 0, 0, 0, 128, 128, - 319, 66, 66, 310, 0, 0, 0, 0, 0, 66, - 66, 66, 0, 0, 0, 0, 0, 105, 107, 106, - 104, 108, 109, 110, 111, 112, 115, 163, 161, 150, - 151, 152, 155, 65, 149, 219, 221, 0, 169, 0, - 0, 0, 173, 0, 170, 133, 238, 0, 0, 0, - 296, 0, 0, 0, 0, 0, 257, 0, 0, 0, - 266, 0, 0, 279, 0, 0, 66, 66, 0, 315, - 0, 317, 296, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 66, 0, 113, 119, 118, - 116, 117, 120, 121, 123, 133, 133, 0, 168, 154, - 166, 0, 171, 172, 0, 218, 237, 114, 235, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 198, 0, - 0, 0, 268, 0, 0, 0, 0, 0, 0, 0, - 0, 323, 0, 0, 0, 306, 307, 0, 0, 0, - 0, 0, 304, 0, 128, 0, 220, 222, 66, 175, - 0, 0, 0, 135, 133, 64, 0, 122, 259, 0, - 0, 189, 0, 0, 0, 0, 0, 0, 0, 66, - 0, 0, 295, 0, 0, 128, 129, 128, 0, 0, - 0, 0, 0, 322, 300, 301, 295, 0, 320, 66, - 205, 174, 130, 136, 134, 63, 234, 236, 114, 131, - 0, 0, 297, 0, 195, 0, 0, 191, 192, 188, - 0, 0, 114, 114, 0, 302, 303, 316, 318, 0, - 0, 305, 308, 309, 0, 128, 64, 132, 126, 193, - 194, 0, 0, 0, 0, 0, 0, 0, 122, 0, - 289, 0, 122, 321, 233, 0, 124, 190, 196, 197, - 0, 282, 0, 0, 105, 107, 114, 114, 0, 114, - 114, 290, 311, 127, 0, 239, 280, 0, 281, 0, - 292, 291, 0, 0, 0, 125, 0, 0, 0, 114, - 114, 0, 0, 0, 294, 293, 287, 0, 0, 286, - 0, 283, 0, 0, 0 -}; +#if ! defined yyoverflow || YYERROR_VERBOSE -static const short yydefgoto[] = { 216, - 217, 218, 299, 316, 162, 163, 76, 537, 111, 12, - 77, 14, 15, 39, 40, 41, 45, 51, 116, 126, - 367, 254, 435, 370, 606, 587, 410, 494, 569, 446, - 495, 78, 164, 137, 154, 138, 139, 108, 322, 219, - 323, 119, 85, 155, 633, 16, 17, 19, 18, 386, - 436, 437, 60, 22, 58, 99, 449, 450, 127, 170, - 52, 94, 53, 46, 288, 220, 80, 222, 330, 331, - 54, 90, 91, 248, 594, 132, 344, 555, 454, 249, - 250, 251, 252 +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 43 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 2015 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 166 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 85 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 324 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 635 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 406 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 152, 153, 156, 2, 155, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 161, 154, 162, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 158, 157, 160, 2, 2, 2, 2, 2, 165, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 159, 2, 2, 163, 2, 164, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151 }; -static const short yypact[] = { 504, --32768,-32768,-32768,-32768,-32768,-32768,-32768, -13, -126, -26, - -90, 107, -69, 256,-32768, 633,-32768, 126, 205, 19, - 29,-32768, 31, 125,-32768, 1570,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 174, 174, - 190,-32768,-32768,-32768, 174,-32768,-32768,-32768,-32768,-32768, - 174, 1,-32768, -2, 178, 202, 212,-32768,-32768,-32768, --32768,-32768, 83,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 251, 257, 8, 33,-32768,-32768,-32768, 74,-32768, - 223, 223, 253,-32768, 82, 255, 255, 200, 235,-32768, - 245,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -88, 1124, --32768, 128, 137, 813, 83,-32768, 74, -65, 134, 1124, - 154, 82, 82,-32768,-32768, 1370,-32768,-32768, 1610, 307, --32768,-32768,-32768,-32768,-32768, 1650,-32768, -7, 289, 904, - 1865,-32768, 306,-32768,-32768, 74,-32768, 179, 176, 1690, - 1690, 177, -55, 1690,-32768, 338, 198,-32768, 1610, 1690, - 83, 191, 74, 365,-32768, 342, 344, 345, 351, 361, - 372, 273, 373, 1180, 332,-32768, 162,-32768,-32768,-32768, - 904,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 323, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 329, 489, 238,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 239, 246, 250, 258, 1610, 261, 263, 264,-32768,-32768, --32768,-32768,-32768,-32768, 341, 1730, 102, 392, 255,-32768, --32768, 329, 489, 1690, 1690, 1690, 1690, 1690, 1690, 1690, - 1690, 1690, 1690, 1690, 1690, 1690, 1690,-32768, 255,-32768, - 45,-32768,-32768, 221, 1450,-32768, 7, -29,-32768, 247, - 74, 265,-32768, 332, -30, 1370,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 1410, 1770, 853, - 386,-32768,-32768,-32768, 279,-32768,-32768, 395,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 280,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 282, 1610, 1610, 1610, 1610, - 1610,-32768, -67, 1610, 1610, 1610,-32768, 83, 764,-32768, - 285, 904, 904,-32768, 904, 1650, 1690, 1690, 43, 49, --32768, 764, -31, 288, 292, 293, 295, 296, 297, 51, - 764, 764, 397, 1650, 1690, 1690, 449,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 146, --32768,-32768,-32768,-32768, 146,-32768, 154, 416,-32768, -62, - 1078, -10,-32768, -15,-32768, 302, 1490, 303, 1610, 1610, --32768, 304, 309, 312, 313, 1610,-32768, 314, 315, 423, --32768, 1690, 316,-32768, 317, 904, 764, 764, 25,-32768, - 26,-32768,-32768, 904, 318, 1690, 1690, 1690, 1690, 1690, - 319, 320, 322, 1690, 904, 764, 325,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 302, 302, 1690,-32768, 321, - 1033, -11,-32768,-32768, 28,-32768,-32768, 74, 326, 331, - 456, 327, 330, 152, 1610, 1610, 1610, 1610,-32768, 1610, - 1610, 1690,-32768, 469, 470, 336, 335, 337, 904, 490, - 904, 340, 346, 904, 347, 74,-32768, 350, 354, 496, - 904, 904, 74, 362, 358, 1690,-32768,-32768, 23,-32768, - 355, 471, 502,-32768, 302, 113, 1530,-32768,-32768, 1610, - 1610,-32768, 1690, 364, 367, 370, 376, 379, 380, 54, - 904, 904, 1810, 904, 904, 358,-32768, 358, 904, 381, - 1690, 1690, 1690,-32768,-32768,-32768, 1810, 484,-32768, 764, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 74, -8, - 385, 387,-32768, 1610,-32768, 1610, 1610,-32768,-32768,-32768, - 384, 383, 114, 74, 180,-32768,-32768,-32768,-32768, 382, - 904,-32768,-32768,-32768, 197, 358, 113,-32768, 493,-32768, --32768, 390, 394, 398, 531, 3, 621, 621,-32768, 1850, --32768, 393,-32768,-32768,-32768, 546, 406,-32768,-32768,-32768, - 904,-32768, 1321, 9, 405, 408,-32768,-32768, 4, 114, - 74,-32768, 146,-32768, 540,-32768,-32768, 409,-32768, 1321, - 221, 221, 548, 621, 621,-32768, 549, 413, 904,-32768, --32768, 904, 552, 497, 221, 221,-32768, 904, 554,-32768, - 904,-32768, 572, 574,-32768 +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 123, 125, 127, 129, 130, 135, 136, 139, + 140, 142, 144, 146, 147, 150, 152, 154, 156, 158, + 160, 162, 164, 166, 167, 169, 171, 173, 174, 176, + 178, 179, 181, 183, 185, 187, 188, 190, 192, 193, + 195, 197, 199, 201, 203, 206, 208, 210, 212, 214, + 216, 218, 220, 222, 224, 227, 228, 231, 233, 235, + 237, 239, 241, 243, 244, 247, 248, 251, 252, 255, + 256, 260, 263, 264, 266, 267, 271, 273, 276, 278, + 280, 282, 284, 286, 288, 290, 292, 294, 298, 300, + 303, 309, 315, 321, 327, 331, 334, 340, 345, 348, + 350, 352, 354, 358, 360, 364, 366, 367, 369, 373, + 378, 382, 386, 391, 396, 400, 407, 413, 416, 419, + 422, 425, 428, 431, 434, 437, 440, 443, 446, 449, + 456, 462, 471, 478, 485, 493, 501, 508, 517, 526, + 530, 532, 534, 536, 538, 539, 542, 549, 551, 552, + 554, 557, 558, 562, 563, 567, 571, 575, 579, 580, + 589, 590, 600, 601, 611, 617, 620, 624, 626, 630, + 634, 638, 642, 644, 645, 651, 655, 657, 661, 663, + 664, 675, 677, 679, 684, 686, 688, 691, 695, 696, + 698, 700, 702, 704, 706, 708, 710, 712, 714, 718, + 720, 726, 728, 730, 732, 734, 736, 738, 741, 743, + 747, 750, 753, 757, 760, 761, 765, 767, 772, 775, + 778, 782, 792, 802, 811, 826, 828, 830, 837, 843, + 846, 853, 861, 866, 871, 878, 885, 886, 887, 891, + 894, 896, 902, 908, 915, 922, 927, 934, 939, 944, + 951, 958, 961, 970, 972, 974, 975, 979, 986, 990, + 997, 1000, 1006, 1014, 1020 }; -static const short yypgoto[] = { 445, - 446, 448, 348, 349, -227,-32768, 0, 14, -100, 492, - 13,-32768,-32768,-32768,-32768, 67,-32768,-32768,-32768, -166, --32768, -443,-32768, -257,-32768,-32768, -337, 44,-32768, -406, --32768,-32768, -24, 352, -108,-32768, 491, 498, -81, -147, - -245, 80, 127, 339,-32768,-32768, 587,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 517,-32768, --32768,-32768,-32768,-32768,-32768, -506, -70, 104, -232,-32768, --32768, 555,-32768,-32768,-32768,-32768,-32768, 79, 195,-32768, --32768,-32768,-32768 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 212, 0, -1, 75, -1, 76, -1, 77, -1, 78, + -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, + -1, 87, -1, 88, -1, 89, -1, 84, -1, 85, + -1, 86, -1, 118, -1, 119, -1, 120, -1, 121, + -1, 122, -1, 123, -1, 124, -1, 125, -1, 126, + -1, 127, -1, 128, -1, 129, -1, 92, -1, 93, + -1, 94, -1, 95, -1, 96, -1, 97, -1, 98, + -1, 99, -1, 100, -1, 101, -1, 102, -1, 103, + -1, 104, -1, 105, -1, 106, -1, 107, -1, 108, + -1, 109, -1, 110, -1, 111, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 26, -1, 27, -1, 11, + -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, + -1, 19, -1, 22, -1, 24, -1, 174, -1, -1, + 54, 152, 4, 153, -1, -1, 174, 154, -1, -1, + 20, -1, 23, -1, 180, -1, -1, 178, 154, -1, + 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, + 46, -1, 48, -1, 50, -1, -1, 149, -1, 150, + -1, 151, -1, -1, 46, -1, 48, -1, -1, 42, + -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, + 42, -1, -1, 62, -1, 63, -1, 64, -1, 65, + -1, 66, -1, 61, 4, -1, 138, -1, 119, -1, + 137, -1, 120, -1, 140, -1, 141, -1, 143, -1, + 144, -1, 145, -1, 53, 4, -1, -1, 189, 188, + -1, 139, -1, 142, -1, 138, -1, 137, -1, 146, + -1, 147, -1, -1, 191, 190, -1, -1, 148, 22, + -1, -1, 53, 4, -1, -1, 155, 53, 4, -1, + 34, 22, -1, -1, 195, -1, -1, 155, 198, 197, + -1, 195, -1, 53, 4, -1, 11, -1, 12, -1, + 13, -1, 16, -1, 15, -1, 14, -1, 17, -1, + 49, -1, 199, -1, 200, 176, 156, -1, 234, -1, + 157, 4, -1, 200, 152, 204, 153, 191, -1, 10, + 152, 204, 153, 191, -1, 158, 4, 159, 200, 160, + -1, 161, 4, 159, 200, 162, -1, 163, 205, 164, + -1, 163, 164, -1, 161, 163, 205, 164, 162, -1, + 161, 163, 164, 162, -1, 200, 189, -1, 200, -1, + 10, -1, 201, -1, 203, 155, 201, -1, 203, -1, + 203, 155, 39, -1, 39, -1, -1, 200, -1, 205, + 155, 200, -1, 200, 158, 208, 160, -1, 200, 158, + 160, -1, 200, 165, 22, -1, 200, 161, 208, 162, + -1, 200, 163, 208, 164, -1, 200, 163, 164, -1, + 200, 161, 163, 208, 164, 162, -1, 200, 161, 163, + 164, 162, -1, 200, 40, -1, 200, 41, -1, 200, + 234, -1, 200, 207, -1, 200, 25, -1, 172, 3, + -1, 172, 5, -1, 172, 4, -1, 172, 6, -1, + 11, 26, -1, 11, 27, -1, 173, 9, -1, 169, + 152, 206, 38, 200, 153, -1, 117, 152, 206, 246, + 153, -1, 131, 152, 206, 155, 206, 155, 206, 153, + -1, 167, 152, 206, 155, 206, 153, -1, 168, 152, + 206, 155, 206, 153, -1, 90, 170, 152, 206, 155, + 206, 153, -1, 91, 171, 152, 206, 155, 206, 153, + -1, 133, 152, 206, 155, 206, 153, -1, 134, 152, + 206, 155, 206, 155, 206, 153, -1, 135, 152, 206, + 155, 206, 155, 206, 153, -1, 208, 155, 206, -1, + 206, -1, 32, -1, 33, -1, 37, -1, -1, 202, + 234, -1, 123, 152, 211, 38, 200, 153, -1, 213, + -1, -1, 214, -1, 213, 214, -1, -1, 31, 215, + 230, -1, -1, 30, 216, 231, -1, 59, 58, 220, + -1, 177, 18, 200, -1, 177, 18, 10, -1, -1, + 179, 183, 210, 209, 206, 176, 217, 197, -1, -1, + 179, 181, 183, 210, 209, 206, 176, 218, 197, -1, + -1, 179, 182, 183, 210, 209, 200, 176, 219, 197, + -1, 179, 183, 35, 186, 211, -1, 51, 221, -1, + 55, 154, 222, -1, 22, -1, 52, 154, 22, -1, + 67, 154, 22, -1, 158, 223, 160, -1, 223, 155, + 22, -1, 22, -1, -1, 224, 155, 200, 189, 175, + -1, 200, 189, 175, -1, 224, -1, 224, 155, 39, + -1, 39, -1, -1, 187, 202, 178, 152, 225, 153, + 191, 196, 193, 192, -1, 28, -1, 163, -1, 185, + 183, 226, 227, -1, 29, -1, 164, -1, 238, 229, + -1, 184, 183, 226, -1, -1, 60, -1, 3, -1, + 4, -1, 9, -1, 26, -1, 27, -1, 40, -1, + 41, -1, 25, -1, 161, 208, 162, -1, 207, -1, + 58, 232, 22, 155, 22, -1, 7, -1, 8, -1, + 174, -1, 178, -1, 234, -1, 233, -1, 200, 235, + -1, 236, -1, 237, 155, 236, -1, 238, 239, -1, + 228, 239, -1, 240, 177, 241, -1, 240, 243, -1, + -1, 68, 38, 235, -1, 21, -1, 21, 68, 38, + 235, -1, 69, 237, -1, 69, 10, -1, 70, 17, + 235, -1, 70, 11, 235, 155, 17, 235, 155, 17, + 235, -1, 71, 172, 235, 155, 17, 235, 158, 242, + 160, -1, 71, 172, 235, 155, 17, 235, 158, 160, + -1, 72, 187, 202, 235, 152, 245, 153, 191, 38, + 17, 235, 73, 17, 235, -1, 73, -1, 74, -1, + 242, 172, 233, 155, 17, 235, -1, 172, 233, 155, + 17, 235, -1, 177, 248, -1, 200, 158, 235, 155, + 235, 160, -1, 244, 155, 158, 235, 155, 235, 160, + -1, 200, 189, 235, 189, -1, 17, 189, 235, 189, + -1, 245, 155, 200, 189, 235, 189, -1, 245, 155, + 17, 189, 235, 189, -1, -1, -1, 246, 155, 236, + -1, 57, 56, -1, 56, -1, 167, 200, 235, 155, + 235, -1, 168, 200, 235, 155, 235, -1, 90, 170, + 200, 235, 155, 235, -1, 91, 171, 200, 235, 155, + 235, -1, 169, 236, 38, 200, -1, 131, 236, 155, + 236, 155, 236, -1, 132, 236, 155, 200, -1, 133, + 236, 155, 236, -1, 134, 236, 155, 236, 155, 236, + -1, 135, 236, 155, 236, 155, 236, -1, 130, 244, + -1, 247, 187, 202, 235, 152, 245, 153, 191, -1, + 250, -1, 36, -1, -1, 112, 200, 194, -1, 112, + 200, 155, 11, 235, 194, -1, 113, 200, 194, -1, + 113, 200, 155, 11, 235, 194, -1, 114, 236, -1, + 249, 115, 200, 235, 194, -1, 249, 116, 236, 155, + 200, 235, 194, -1, 136, 200, 234, 155, 4, -1, + 117, 200, 235, 246, -1 }; +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, + 1112, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114, + 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1118, + 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1126, + 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, + 1131, 1132, 1132, 1133, 1134, 1139, 1140, 1140, 1140, 1140, + 1140, 1142, 1142, 1142, 1143, 1143, 1145, 1146, 1150, 1154, + 1159, 1159, 1161, 1162, 1167, 1173, 1174, 1175, 1176, 1177, + 1181, 1182, 1183, 1187, 1188, 1189, 1190, 1194, 1195, 1196, + 1200, 1201, 1202, 1203, 1204, 1208, 1209, 1210, 1213, 1214, + 1215, 1216, 1217, 1218, 1219, 1226, 1227, 1228, 1229, 1230, + 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1245, 1246, 1247, + 1248, 1249, 1250, 1253, 1254, 1259, 1260, 1267, 1268, 1274, + 1275, 1284, 1292, 1293, 1298, 1299, 1300, 1305, 1318, 1318, + 1318, 1318, 1318, 1318, 1318, 1321, 1325, 1329, 1336, 1341, + 1349, 1380, 1405, 1410, 1420, 1430, 1434, 1444, 1451, 1460, + 1467, 1472, 1477, 1484, 1485, 1492, 1499, 1507, 1513, 1525, + 1553, 1569, 1596, 1624, 1650, 1670, 1696, 1716, 1728, 1735, + 1801, 1811, 1821, 1827, 1837, 1843, 1853, 1858, 1863, 1876, + 1888, 1910, 1918, 1924, 1935, 1940, 1945, 1951, 1957, 1966, + 1970, 1978, 1978, 1981, 1981, 1984, 1996, 2017, 2022, 2030, + 2031, 2035, 2035, 2039, 2039, 2042, 2045, 2069, 2081, 2080, + 2092, 2091, 2101, 2100, 2111, 2151, 2154, 2160, 2170, 2174, + 2179, 2181, 2186, 2191, 2200, 2210, 2221, 2225, 2234, 2243, + 2248, 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, 2408, + 2413, 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2470, + 2474, 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, 2524, + 2529, 2533, 2542, 2551, 2560, 2564, 2568, 2573, 2580, 2587, + 2591, 2596, 2606, 2625, 2634, 2715, 2719, 2726, 2737, 2750, + 2760, 2771, 2781, 2792, 2800, 2810, 2817, 2820, 2821, 2828, + 2832, 2837, 2853, 2870, 2884, 2898, 2910, 2918, 2925, 2931, + 2937, 2943, 2958, 3044, 3049, 3053, 3060, 3067, 3075, 3082, + 3090, 3098, 3112, 3129, 3137 +}; +#endif -#define YYLAST 2013 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", + "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", + "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE", + "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT", + "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", + "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", + "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL", + "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", + "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", + "DATALAYOUT", "UNWINDS", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", + "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", + "SREM", "FREM", "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", + "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", + "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", + "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", + "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", + "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", + "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", + "GETRESULT", "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", + "NOUNWIND", "NOALIAS", "BYVAL", "NEST", "READNONE", "READONLY", "GC", + "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'", + "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'", + "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates", + "FPredicates", "IntType", "FPType", "LocalName", "OptLocalName", + "OptAddrSpace", "OptLocalAssign", "GlobalName", "OptGlobalAssign", + "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "AliasLinkage", "OptCallingConv", "ParamAttr", "OptParamAttrs", + "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", "OptCAlign", + "SectionString", "OptSection", "GlobalVarAttributes", + "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", + "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", + "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module", + "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", + "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", + "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", + "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal", + "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", + "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", "OptTailCall", + "InstVal", "OptVolatile", "MemoryInst", 0 +}; +#endif +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 40, 41, 61, 44, 42, 92, 91, 120, + 93, 60, 62, 123, 125, 99 +}; +# endif -static const short yytable[] = { 11, - 335, 79, 412, 341, 496, 375, 345, 346, 347, 348, - 349, 103, 13, 334, 353, 11, 282, 167, 88, 334, - 168, 88, 109, 109, 109, 492, 92, 23, 13, 487, - 488, 24, 380, 382, 384, 469, 471, 165, 20, 61, - 62, 613, 105, 64, 65, 66, 67, 68, 69, 70, - 107, 1, 2, 21, 3, 4, 5, 61, 62, 221, - 109, 492, 336, 25, 284, 89, 133, 264, 89, 1, - 2, 134, 3, 4, 5, 136, 109, 470, 470, 107, - 493, 71, 354, 267, 27, 136, 608, 396, 535, 144, - 11, 153, 396, 283, 397, 567, 109, 439, 145, 144, - 221, 153, 109, 618, 109, 81, 82, 109, 260, 577, - 578, 86, 332, 117, 118, 257, 258, 87, 333, 261, - 110, 110, 110, 427, 26, 265, 414, 109, 429, 430, - 431, 1, 372, 432, 3, 442, 5, 433, 434, 396, - 429, 430, 431, 396, 396, 432, 59, 529, 444, 433, - 434, 443, 491, 611, 612, 169, 614, 615, 110, 355, - 356, 93, 592, 376, 377, 357, 371, -143, 609, 463, - 104, 43, 55, 44, 110, 531, 625, 626, 558, 285, - 559, 2, 56, 475, 4, 477, 478, 479, 57, 72, - 73, 149, 150, 74, 110, 75, 106, 409, -66, 96, - 110, 329, 110, 411, -66, 110, 550, 112, 113, 339, - 340, 329, 342, 343, 329, 329, 329, 329, 329, 350, - 351, 352, 329, 97, 83, 110, 84, 406, 584, -66, - 136, 358, 359, 98, 100, 391, 392, 393, 394, 395, - 540, 153, 398, 399, 400, 425, 47, 48, 49, 360, - 361, 50, 362, 363, 101, 364, 365, 366, 221, 84, - 102, 221, 221, 1, 221, -143, 3, 129, 5, -143, - 543, 221, 130, 357, 286, 270, 271, 272, 273, 421, - 221, 221, 429, 430, 431, 146, 140, 432, 562, 563, - 564, 433, 434, 282, 114, 141, 115, 28, 29, 30, - 31, 32, 33, 34, 502, 35, 503, 452, 453, 148, - 166, 153, 407, 408, 459, 120, 121, 122, 123, 124, - 125, 599, 36, 37, 38, 603, 171, 253, 256, 153, - 426, 329, 579, 255, 580, 221, 221, 221, 259, 358, - 359, 262, 266, 221, -54, -54, -54, -54, 593, 583, - 263, 580, -55, -56, 221, 221, 441, 360, 361, -59, - 362, 363, 448, 364, 365, 366, 610, 268, 269, -58, - 283, 61, 62, 504, 505, 506, 507, 329, 508, 509, - -57, 274, 287, 1, 2, 109, 3, 4, 5, 317, - 318, 329, 476, 329, 329, 329, 327, 319, 221, 483, - 221, 320, 334, 221, 36, 37, 38, 385, 373, 321, - 221, 221, 324, 489, 325, 326, 388, 374, 541, 542, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 387, 389, 401, 390, 424, 403, 404, 510, 405, 402, - 221, 221, 415, 221, 221, 413, 416, 417, 221, 418, - 419, 420, 428, 438, 422, 423, 445, 451, 455, 221, - 462, 530, 572, 456, 573, 574, 457, 458, 460, 461, - 464, 465, 539, 480, 481, 474, 482, 499, 329, 486, - 497, 500, 490, 498, 501, 511, 512, 513, 554, 514, - 221, 515, 533, 517, 503, 536, 329, 329, 329, 524, - 519, 521, 554, -207, 522, 534, 221, 221, 523, 466, - 467, 468, 528, 527, 300, 301, 532, 473, 544, 545, - 221, -68, 1, 2, 546, 3, 4, 5, 484, 485, - 547, 548, 549, 6, 7, 561, 470, 570, 575, 571, - 576, 581, 588, 221, 221, 586, 589, 591, 221, 604, - 590, 221, 602, 605, 8, 601, -17, 221, 9, -18, - 221, 616, 10, 617, 619, 622, 536, 623, 628, 629, - 631, 634, 516, 635, 518, 245, 246, 520, 247, 337, - 585, 338, 131, 568, 525, 526, 302, 303, 304, 305, - 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 147, 143, 42, 128, 378, 565, 369, 472, 95, 0, - 0, 0, 0, 0, 551, 552, 0, 556, 557, 0, - 0, 0, 560, 172, 173, 0, 0, 61, 62, 174, - 0, 0, -206, 566, 0, 0, 0, 0, 0, 1, - 2, 0, 3, 4, 5, 175, 176, 177, 0, 0, - -68, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 178, 179, 6, 7, 582, 0, 0, 0, 0, 0, - 0, 0, 0, 357, 0, 0, 0, 0, 180, 0, - 597, 598, 0, 8, 0, 0, 0, 9, 0, 0, - 0, 10, 0, 0, 607, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 0, 0, 0, 0, 0, 620, 621, 0, - 0, 0, 624, 0, 0, 627, 0, 0, 0, 0, - 0, 630, 0, 0, 632, 0, 0, 198, 199, 595, - 596, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 0, 212, 213, 214, 0, 360, 361, 0, - 362, 363, 0, 364, 365, 366, 172, 173, 0, 0, - 61, 62, 174, 0, 0, 0, 0, 0, 0, 0, - 0, 215, 1, 2, 0, 3, 4, 5, 175, 176, - 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 178, 179, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 109, 0, 61, - 62, 180, 105, 64, 65, 66, 67, 68, 69, 70, - 0, 1, 2, 0, 3, 4, 5, 0, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 0, 0, 0, 0, 61, - 62, 71, 105, 156, 157, 158, 159, 160, 161, 70, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 0, 211, 0, 212, 213, 214, 0, - 0, 71, 0, 0, 0, 0, 172, 173, 0, 0, - 61, 62, 174, 0, 0, 110, 0, 0, 0, 0, - 0, 0, 1, 2, 215, 3, 4, 5, 175, 176, - 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 178, 179, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 180, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 142, 0, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 383, 0, 0, 0, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 0, 211, 0, 212, 213, 214, 61, - 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 2, 0, 3, 4, 5, 275, 0, 0, - 0, 0, 0, 0, 215, 0, 0, 0, 0, 0, - 0, 0, 276, 277, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 62, 109, 105, 156, 157, - 158, 159, 160, 161, 70, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 0, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 0, 0, 71, 0, 0, 0, - 61, 62, 0, 105, 64, 65, 66, 67, 68, 69, - 70, 0, 1, 2, 0, 3, 4, 5, 0, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 135, 211, 0, 212, 213, 214, 0, 0, - 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 110, 0, 61, 62, -66, 0, - 278, 0, 0, 279, 0, 280, 0, 281, 1, 2, - 0, 3, 4, 5, 275, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, - 277, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 109, 72, 73, 0, 0, 74, 0, - 75, 440, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 73, 0, 0, 74, 0, 75, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 0, - 211, 0, 212, 213, 214, 0, 0, 0, 0, 0, - 0, 0, 0, 172, 173, 0, 0, 0, 0, 174, - 0, 110, 0, 0, 0, 0, 0, 278, 0, 0, - 279, 0, 280, 0, 281, 175, 176, 177, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 178, 179, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 61, 62, 180, 151, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 0, 0, 0, 0, 61, 62, 71, 105, - 156, 157, 158, 159, 160, 161, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 0, 211, 0, 212, 213, 214, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 215, 0, 0, 0, 0, 0, 0, 368, 0, - 0, 0, 152, 0, 0, 0, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 447, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 538, 379, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 63, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 156, 157, 158, 159, 160, 161, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 151, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 328, - 64, 65, 66, 67, 68, 69, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 156, 157, 158, 159, 160, 161, 70, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 553, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 61, 62, 71, 105, - 64, 65, 66, 67, 68, 69, 600, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 0, 0, 71, 0, - 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 224, 225, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 381, 226, 227, 228, 229, 230, 231, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 232, 233, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 234, 235, 236, 0, - 0, 237, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 238, 239, 240, 241, 242, 243, - 244, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 166, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 168, 168, 168, 168, 168, 168, 169, 169, 169, + 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 172, 173, 173, 173, 173, + 173, 174, 174, 174, 175, 175, 176, 176, 177, 177, + 178, 178, 179, 179, 180, 181, 181, 181, 181, 181, + 182, 182, 182, 183, 183, 183, 183, 184, 184, 184, + 185, 185, 185, 185, 185, 186, 186, 186, 187, 187, + 187, 187, 187, 187, 187, 188, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 189, 189, 190, 190, 190, + 190, 190, 190, 191, 191, 192, 192, 193, 193, 194, + 194, 195, 196, 196, 197, 197, 198, 198, 199, 199, + 199, 199, 199, 199, 199, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 201, 202, + 202, 203, 203, 204, 204, 204, 204, 205, 205, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, + 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, + 213, 215, 214, 216, 214, 214, 214, 214, 217, 214, + 218, 214, 219, 214, 214, 214, 214, 220, 221, 221, + 222, 223, 223, 223, 224, 224, 225, 225, 225, 225, + 226, 227, 227, 228, 229, 229, 230, 231, 232, 232, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 234, 234, 234, 234, 235, 235, 236, 237, 237, + 238, 238, 239, 240, 240, 240, 240, 240, 241, 241, + 241, 241, 241, 241, 241, 241, 241, 242, 242, 243, + 244, 244, 245, 245, 245, 245, 245, 246, 246, 247, + 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, + 248, 248, 248, 248, 249, 249, 250, 250, 250, 250, + 250, 250, 250, 250, 250 }; -static const short yycheck[] = { 0, - 228, 26, 340, 236, 448, 263, 239, 240, 241, 242, - 243, 4, 0, 11, 247, 16, 164, 126, 21, 11, - 28, 21, 54, 54, 54, 34, 29, 154, 16, 436, - 437, 58, 278, 279, 280, 11, 11, 119, 52, 7, - 8, 38, 10, 11, 12, 13, 14, 15, 16, 17, - 75, 19, 20, 67, 22, 23, 24, 7, 8, 130, - 54, 34, 229, 154, 165, 68, 155, 149, 68, 19, - 20, 160, 22, 23, 24, 100, 54, 53, 53, 104, - 53, 49, 249, 154, 154, 110, 593, 155, 495, 155, - 91, 116, 155, 164, 162, 539, 54, 160, 164, 155, - 171, 126, 54, 610, 54, 39, 40, 54, 164, 553, - 554, 45, 11, 32, 33, 140, 141, 51, 17, 144, - 152, 152, 152, 356, 18, 150, 158, 54, 137, 138, - 139, 19, 162, 142, 22, 381, 24, 146, 147, 155, - 137, 138, 139, 155, 155, 142, 22, 485, 164, 146, - 147, 162, 164, 597, 598, 163, 600, 601, 152, 115, - 116, 164, 160, 264, 265, 53, 160, 54, 160, 402, - 163, 46, 154, 48, 152, 153, 620, 621, 516, 167, - 518, 20, 154, 416, 23, 418, 419, 420, 158, 157, - 158, 112, 113, 161, 152, 163, 164, 155, 156, 22, - 152, 226, 152, 155, 156, 152, 153, 81, 82, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 22, 35, 152, 37, 336, 566, 156, - 255, 119, 120, 22, 152, 317, 318, 319, 320, 321, - 498, 266, 324, 325, 326, 354, 42, 43, 44, 137, - 138, 47, 140, 141, 4, 143, 144, 145, 329, 37, - 4, 332, 333, 19, 335, 152, 22, 68, 24, 156, - 503, 342, 38, 53, 171, 3, 4, 5, 6, 350, - 351, 352, 137, 138, 139, 152, 159, 142, 521, 522, - 523, 146, 147, 441, 42, 159, 44, 42, 43, 44, - 45, 46, 47, 48, 153, 50, 155, 389, 390, 156, - 4, 336, 337, 338, 396, 61, 62, 63, 64, 65, - 66, 579, 149, 150, 151, 583, 38, 22, 153, 354, - 355, 356, 153, 155, 155, 406, 407, 408, 162, 119, - 120, 4, 152, 414, 3, 4, 5, 6, 576, 153, - 153, 155, 9, 9, 425, 426, 381, 137, 138, 9, - 140, 141, 387, 143, 144, 145, 594, 26, 27, 9, - 441, 7, 8, 455, 456, 457, 458, 402, 460, 461, - 9, 9, 60, 19, 20, 54, 22, 23, 24, 152, - 152, 416, 417, 418, 419, 420, 56, 152, 469, 424, - 471, 152, 11, 474, 149, 150, 151, 22, 162, 152, - 481, 482, 152, 438, 152, 152, 22, 153, 500, 501, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 152, 152, 329, 152, 38, 332, 333, 462, 335, 155, - 511, 512, 155, 514, 515, 342, 155, 155, 519, 155, - 155, 155, 4, 38, 351, 352, 155, 155, 155, 530, - 38, 486, 544, 155, 546, 547, 155, 155, 155, 155, - 155, 155, 497, 155, 155, 158, 155, 22, 503, 155, - 155, 155, 162, 153, 155, 17, 17, 152, 513, 155, - 561, 155, 22, 4, 155, 496, 521, 522, 523, 4, - 155, 155, 527, 0, 155, 4, 577, 578, 155, 406, - 407, 408, 155, 152, 26, 27, 162, 414, 155, 153, - 591, 18, 19, 20, 155, 22, 23, 24, 425, 426, - 155, 153, 153, 30, 31, 155, 53, 153, 155, 153, - 158, 160, 153, 614, 615, 53, 153, 17, 619, 4, - 153, 622, 160, 148, 51, 580, 152, 628, 55, 152, - 631, 22, 59, 155, 17, 17, 567, 155, 17, 73, - 17, 0, 469, 0, 471, 131, 131, 474, 131, 232, - 567, 233, 91, 540, 481, 482, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 110, 104, 16, 87, 266, 527, 255, 413, 54, -1, - -1, -1, -1, -1, 511, 512, -1, 514, 515, -1, - -1, -1, 519, 3, 4, -1, -1, 7, 8, 9, - -1, -1, 0, 530, -1, -1, -1, -1, -1, 19, - 20, -1, 22, 23, 24, 25, 26, 27, -1, -1, - 18, 19, 20, -1, 22, 23, 24, -1, -1, -1, - 40, 41, 30, 31, 561, -1, -1, -1, -1, -1, - -1, -1, -1, 53, -1, -1, -1, -1, 58, -1, - 577, 578, -1, 51, -1, -1, -1, 55, -1, -1, - -1, 59, -1, -1, 591, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, -1, -1, -1, -1, -1, 614, 615, -1, - -1, -1, 619, -1, -1, 622, -1, -1, -1, -1, - -1, 628, -1, -1, 631, -1, -1, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - -1, 131, -1, 133, 134, 135, -1, 137, 138, -1, - 140, 141, -1, 143, 144, 145, 3, 4, -1, -1, - 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, - -1, 161, 19, 20, -1, 22, 23, 24, 25, 26, - 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 54, -1, 7, - 8, 58, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, -1, -1, -1, -1, 7, - 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, -1, 131, -1, 133, 134, 135, -1, - -1, 49, -1, -1, -1, -1, 3, 4, -1, -1, - 7, 8, 9, -1, -1, 152, -1, -1, -1, -1, - -1, -1, 19, 20, 161, 22, 23, 24, 25, 26, - 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 58, -1, -1, -1, -1, -1, -1, -1, 157, - 158, -1, -1, 161, -1, 163, 164, -1, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, - 158, -1, -1, 161, -1, 163, 164, -1, -1, -1, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, -1, 131, -1, 133, 134, 135, 7, - 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 19, 20, -1, 22, 23, 24, 25, -1, -1, - -1, -1, -1, -1, 161, -1, -1, -1, -1, -1, - -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 7, 8, 54, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, -1, -1, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, -1, -1, 49, -1, -1, -1, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 39, 131, -1, 133, 134, 135, -1, -1, - -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 152, -1, 7, 8, 156, -1, - 158, -1, -1, 161, -1, 163, -1, 165, 19, 20, - -1, 22, 23, 24, 25, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, - 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 54, 157, 158, -1, -1, 161, -1, - 163, 164, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 157, 158, -1, -1, 161, -1, 163, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, -1, - 131, -1, 133, 134, 135, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, -1, -1, -1, -1, 9, - -1, 152, -1, -1, -1, -1, -1, 158, -1, -1, - 161, -1, 163, -1, 165, 25, 26, 27, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 7, 8, 58, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, -1, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - -1, 131, -1, 133, 134, 135, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, 161, -1, -1, -1, -1, -1, -1, 39, -1, - -1, -1, 123, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, 39, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, 39, 160, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 7, 8, 49, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, -1, -1, 49, -1, - 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 56, 57, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163, -1, -1, -1, 112, 113, 114, -1, - -1, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, -1, -1, -1, -1, -1, 157, 158, -1, -1, - 161, -1, 163 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 4, 0, 2, 0, + 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 0, 2, 1, 1, 1, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, + 5, 5, 5, 5, 3, 2, 5, 4, 2, 1, + 1, 1, 3, 1, 3, 1, 0, 1, 3, 4, + 3, 3, 4, 4, 3, 6, 5, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, + 5, 8, 6, 6, 7, 7, 6, 8, 8, 3, + 1, 1, 1, 1, 0, 2, 6, 1, 0, 1, + 2, 0, 3, 0, 3, 3, 3, 3, 0, 8, + 0, 9, 0, 9, 5, 2, 3, 1, 3, 3, + 3, 3, 1, 0, 5, 3, 1, 3, 1, 0, + 10, 1, 1, 4, 1, 1, 2, 3, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 5, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 2, 2, 3, 2, 0, 3, 1, 4, 2, 2, + 3, 9, 9, 8, 14, 1, 1, 6, 5, 2, + 6, 7, 4, 4, 6, 6, 0, 0, 3, 2, + 1, 5, 5, 6, 6, 4, 6, 4, 4, 6, + 6, 2, 8, 1, 1, 0, 3, 6, 3, 6, + 2, 5, 7, 5, 4 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" -/* This file comes from bison-1.28. */ -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 73, 61, 70, 62, 71, 63, 213, 211, 0, 0, + 0, 0, 0, 0, 83, 72, 0, 73, 209, 87, + 90, 0, 0, 225, 0, 0, 68, 0, 74, 75, + 77, 76, 78, 80, 79, 81, 82, 84, 85, 86, + 83, 83, 204, 1, 210, 88, 89, 83, 214, 91, + 92, 93, 94, 83, 274, 212, 274, 0, 0, 233, + 226, 227, 215, 261, 262, 217, 138, 139, 140, 143, + 142, 141, 144, 145, 0, 0, 0, 0, 263, 264, + 146, 216, 148, 204, 204, 95, 203, 0, 98, 98, + 276, 0, 271, 69, 244, 245, 246, 270, 228, 229, + 232, 0, 166, 149, 0, 0, 0, 0, 155, 167, + 0, 0, 166, 0, 0, 0, 97, 96, 0, 201, + 202, 0, 0, 99, 100, 101, 102, 103, 0, 247, + 0, 0, 0, 315, 273, 0, 230, 165, 115, 161, + 163, 0, 0, 0, 0, 0, 0, 154, 0, 0, + 147, 0, 0, 160, 0, 159, 0, 224, 138, 139, + 140, 143, 142, 141, 0, 0, 67, 67, 104, 0, + 241, 242, 243, 0, 250, 251, 252, 257, 253, 254, + 255, 256, 248, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 14, 15, 16, 11, 12, 13, 0, 0, + 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, + 0, 259, 266, 265, 275, 314, 300, 0, 0, 0, + 0, 98, 285, 286, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 272, 98, 289, 0, 313, 231, 158, 0, 123, 67, + 67, 157, 0, 168, 0, 123, 67, 67, 0, 205, + 186, 187, 182, 184, 183, 185, 188, 181, 177, 178, + 0, 0, 0, 0, 180, 179, 218, 0, 277, 249, + 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 0, 53, 54, 49, 50, 51, 52, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, + 0, 0, 0, 0, 200, 0, 0, 0, 0, 299, + 279, 67, 268, 278, 0, 0, 55, 0, 0, 0, + 0, 129, 129, 320, 67, 67, 311, 0, 0, 0, + 0, 0, 67, 67, 67, 0, 0, 0, 0, 0, + 106, 108, 107, 105, 109, 110, 111, 112, 113, 116, + 164, 162, 151, 152, 153, 156, 66, 150, 220, 222, + 0, 170, 0, 0, 0, 174, 0, 171, 134, 239, + 0, 0, 0, 297, 0, 0, 0, 0, 0, 258, + 0, 0, 0, 267, 0, 0, 280, 0, 0, 67, + 67, 0, 316, 0, 318, 297, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, + 114, 120, 119, 117, 118, 121, 122, 124, 134, 134, + 0, 169, 155, 167, 0, 172, 173, 0, 219, 238, + 115, 236, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 199, 0, 0, 0, 269, 0, 0, 0, 0, + 0, 0, 0, 0, 324, 0, 0, 0, 307, 308, + 0, 0, 0, 0, 0, 305, 0, 129, 0, 221, + 223, 67, 176, 0, 0, 0, 136, 134, 65, 0, + 123, 260, 0, 0, 190, 0, 0, 0, 0, 0, + 0, 0, 67, 0, 0, 296, 0, 0, 129, 130, + 129, 0, 0, 0, 0, 0, 323, 301, 302, 296, + 0, 321, 67, 206, 175, 131, 137, 135, 64, 235, + 237, 115, 132, 0, 0, 298, 0, 196, 0, 0, + 192, 193, 189, 0, 0, 115, 115, 0, 303, 304, + 317, 319, 0, 0, 306, 309, 310, 0, 129, 65, + 133, 127, 194, 195, 0, 0, 0, 0, 0, 0, + 0, 123, 0, 290, 0, 123, 322, 234, 0, 125, + 191, 197, 198, 0, 283, 0, 0, 106, 108, 115, + 115, 0, 115, 115, 291, 312, 128, 0, 240, 281, + 0, 282, 0, 293, 292, 0, 0, 0, 126, 0, + 0, 0, 115, 115, 0, 0, 0, 295, 294, 288, + 0, 0, 287, 0, 284 +}; - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 218, 219, 220, 301, 318, 164, 165, 78, 539, + 113, 12, 79, 14, 15, 40, 41, 42, 47, 53, + 118, 128, 369, 256, 437, 372, 608, 589, 412, 496, + 571, 448, 497, 80, 166, 139, 156, 140, 141, 110, + 324, 221, 325, 121, 87, 157, 16, 17, 18, 20, + 19, 388, 438, 439, 62, 23, 60, 101, 451, 452, + 129, 172, 54, 96, 55, 48, 290, 222, 82, 224, + 332, 333, 56, 92, 93, 250, 596, 134, 346, 557, + 456, 251, 252, 253, 254 +}; - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -524 +static const yytype_int16 yypact[] = +{ + 369, -524, -524, -524, -524, -524, -524, -524, 46, -130, + 11, -89, 62, -59, 258, -524, 135, 506, -524, 227, + 130, -12, 26, -524, -1, 180, -524, 1572, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + 119, 119, 250, -524, -524, -524, -524, 119, -524, -524, + -524, -524, -524, 119, 39, -524, -2, 214, 221, 229, + -524, -524, -524, -524, -524, 59, -524, -524, -524, -524, + -524, -524, -524, -524, 262, 268, 8, 35, -524, -524, + -524, 9, -524, 195, 195, 244, -524, 162, 233, 233, + 186, 238, -524, 127, -524, -524, -524, -524, -524, -524, + -524, 50, 1126, -524, 133, 161, 815, 59, -524, 9, + -88, 172, 1126, 181, 162, 162, -524, -524, 1372, -524, + -524, 1612, 337, -524, -524, -524, -524, -524, 1652, -524, + -3, 314, 906, 1867, -524, 334, -524, -524, 9, -524, + 205, 208, 1692, 1692, 200, -64, 1692, -524, 359, 211, + -524, 1612, 1692, 59, 216, 9, 410, -524, 223, 357, + 361, 362, 363, 365, 275, 366, 1182, 329, -524, 97, + -524, -524, -524, 906, -524, -524, -524, -524, -524, -524, + -524, -524, 324, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, 511, 491, + 234, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, 252, 253, 259, 260, 1612, 263, 267, + 271, -524, -524, -524, -524, -524, -524, 354, 1732, 68, + 374, 233, -524, -524, 511, 491, 1692, 1692, 1692, 1692, + 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, 1692, + -524, 233, -524, 197, -524, -524, 210, 1452, -524, -31, + 2, -524, 264, 9, 237, -524, 329, -25, 1372, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + 1412, 1772, 855, 403, -524, -524, -524, 279, -524, -524, + 405, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, 284, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, -524, -524, -524, -524, -524, -524, 285, 1612, + 1612, 1612, 1612, 1612, -524, -46, 1612, 1612, 1612, -524, + 59, 766, -524, 287, 906, 906, -524, 906, 1652, 1692, + 1692, 45, 51, -524, 766, 17, 290, 294, 295, 297, + 298, 299, 14, 766, 766, 417, 1652, 1692, 1692, 452, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + -524, -524, 189, -524, -524, -524, -524, 189, -524, 181, + 421, -524, 102, 1080, -32, -524, -49, -524, 305, 1492, + 306, 1612, 1612, -524, 308, 311, 315, 316, 1612, -524, + 317, 318, 431, -524, 1692, 319, -524, 321, 906, 766, + 766, 24, -524, 28, -524, -524, 906, 320, 1692, 1692, + 1692, 1692, 1692, 322, 325, 327, 1692, 906, 766, 328, + -524, -524, -524, -524, -524, -524, -524, -524, 305, 305, + 1692, -524, 323, 1035, -17, -524, -524, 30, -524, -524, + 9, 331, 326, 462, 332, 333, 154, 1612, 1612, 1612, + 1612, -524, 1612, 1612, 1692, -524, 472, 473, 340, 339, + 341, 906, 493, 906, 347, 348, 906, 349, 9, -524, + 352, 353, 507, 906, 906, 9, 343, 360, 1692, -524, + -524, 38, -524, 371, 494, 515, -524, 305, 115, 1532, + -524, -524, 1612, 1612, -524, 1692, 367, 368, 372, 379, + 382, 385, 56, 906, 906, 1812, 906, 906, 360, -524, + 360, 906, 384, 1692, 1692, 1692, -524, -524, -524, 1812, + 487, -524, 766, -524, -524, -524, -524, -524, -524, -524, + -524, 9, -6, 388, 389, -524, 1612, -524, 1612, 1612, + -524, -524, -524, 390, 386, 33, 9, 166, -524, -524, + -524, -524, 383, 906, -524, -524, -524, 170, 360, 115, + -524, 495, -524, -524, 396, 397, 399, 536, 3, 623, + 623, -524, 1852, -524, 395, -524, -524, -524, 552, 411, + -524, -524, -524, 906, -524, 1323, 7, 412, 414, -524, + -524, 6, 33, 9, -524, 189, -524, 540, -524, -524, + 413, -524, 1323, 210, 210, 550, 623, 623, -524, 553, + 416, 906, -524, -524, 906, 555, 500, 210, 210, -524, + 906, 557, -524, 906, -524 +}; - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -524, 443, 445, 446, 350, 346, -229, -524, 0, 16, + -141, 489, 13, -524, -524, -524, -524, 61, -524, -524, + -524, -190, -524, -444, -524, -263, -524, -524, -337, 41, + -524, -407, -524, -524, -24, 356, -108, -524, 474, 508, + -81, -150, -207, 228, 261, 351, -524, -524, 598, -524, + -524, -524, -524, -524, -524, -524, -524, -524, -524, -524, + 527, -524, -524, -524, -524, -524, -524, -523, -70, 104, + -234, -524, -524, 566, -524, -524, -524, -524, -524, 94, + 209, -524, -524, -524, -524 +}; -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -209 +static const yytype_int16 yytable[] = +{ + 11, 337, 377, 81, 343, 414, 498, 347, 348, 349, + 350, 351, 105, 13, 336, 355, 284, 11, 336, 90, + 169, 63, 64, 111, 24, 170, 286, 94, 494, 111, + 13, 489, 490, 1, 2, 471, 3, 4, 5, 473, + 167, 338, 63, 64, 615, 107, 66, 67, 68, 69, + 70, 71, 72, 109, 1, 2, 111, 3, 4, 5, + 90, 356, 223, 111, 494, 26, 91, 146, 111, 25, + 266, 111, 610, 382, 384, 386, 147, 472, 138, 334, + 27, 472, 109, 495, 73, 335, 269, -144, 138, 620, + 537, 146, 111, 11, 155, 28, 285, 569, 21, 111, + 262, 83, 84, 223, 155, 111, 398, 91, 88, 398, + 111, 579, 580, 22, 89, 446, 399, 2, 259, 260, + 4, 112, 263, 398, 429, 378, 379, 112, 267, 373, + 445, 431, 432, 433, 1, 43, 434, 3, 398, 5, + 435, 436, 57, 431, 432, 433, 1, 493, 434, 3, + 531, 5, 435, 436, 112, 613, 614, 59, 616, 617, + 171, 112, 95, 594, 374, -67, 112, 611, 359, 112, + 465, 106, 49, 50, 51, 416, 444, 52, 627, 628, + 58, 560, 287, 561, 477, -144, 479, 480, 481, -144, + 112, 533, 74, 75, 119, 120, 76, 112, 77, 108, + 411, -67, 61, 112, 331, 135, 413, -67, 112, 552, + 136, 102, 341, 342, 331, 344, 345, 331, 331, 331, + 331, 331, 352, 353, 354, 331, -55, -55, -55, -55, + 408, 586, 86, 138, 360, 361, 98, 542, 393, 394, + 395, 396, 397, 99, 155, 400, 401, 402, 427, 270, + 271, 100, 362, 363, 131, 364, 365, 398, 366, 367, + 368, 223, 441, 359, 223, 223, 103, 223, 37, 38, + 39, 545, 104, 45, 223, 46, 132, 288, 272, 273, + 274, 275, 423, 223, 223, 85, 116, 86, 117, 564, + 565, 566, 142, 284, 122, 123, 124, 125, 126, 127, + 29, 30, 31, 32, 33, 34, 35, 504, 36, 505, + 454, 455, 357, 358, 155, 409, 410, 461, 601, 581, + 143, 582, 605, 585, 148, 582, 431, 432, 433, 360, + 361, 434, 155, 428, 331, 435, 436, 150, 223, 223, + 223, 168, 151, 152, 114, 115, 223, 362, 363, 595, + 364, 365, 173, 366, 367, 368, 255, 223, 223, 443, + 257, 258, 261, 264, 265, 450, -56, 612, 268, -208, + -57, -60, -59, 285, -58, 276, 506, 507, 508, 509, + 331, 510, 511, 111, 289, 336, 319, -69, 1, 2, + 376, 3, 4, 5, 331, 478, 331, 331, 331, 6, + 7, 223, 485, 223, 320, 321, 223, 37, 38, 39, + 329, 322, 323, 223, 223, 326, 491, 63, 64, 327, + 8, 543, 544, 328, 9, 387, 375, 390, 10, 1, + 2, 389, 3, 4, 5, 403, 391, 392, 405, 406, + 512, 407, 404, 223, 223, 417, 223, 223, 415, 418, + 419, 223, 420, 421, 422, 426, 430, 424, 425, 440, + 447, 453, 223, 457, 532, 574, 458, 575, 576, 464, + 459, 460, 462, 463, 466, 541, 467, 482, 476, 500, + 483, 331, 484, 488, 501, 492, 499, 502, 503, 513, + 514, 556, 515, 223, 516, 529, 517, 519, 538, 331, + 331, 331, 505, 521, 523, 556, -207, 524, 525, 223, + 223, 526, 468, 469, 470, 530, 535, 302, 303, 536, + 475, 547, 546, 223, -69, 1, 2, 548, 3, 4, + 5, 486, 487, 534, 549, 550, 6, 7, 551, 563, + 472, 572, 573, 583, 578, 577, 223, 223, 588, 590, + 591, 223, 592, 593, 223, 604, 606, 8, 603, 607, + 223, 9, 618, 223, -18, 10, -19, 621, 619, 538, + 624, 625, 630, 631, 633, 518, 247, 520, 248, 249, + 522, 340, 133, 570, 339, 587, 149, 527, 528, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 371, 145, 44, 130, 553, 554, 380, + 558, 559, 97, 567, 474, 562, 174, 175, 0, 0, + 63, 64, 176, 0, 0, 0, 568, 0, 0, 0, + 0, 0, 1, 2, 0, 3, 4, 5, 177, 178, + 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 180, 181, 0, 0, 584, 0, 0, + 0, 0, 0, 0, 0, 0, 359, 0, 0, 0, + 0, 182, 0, 599, 600, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 609, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 0, 0, 0, 0, 0, + 622, 623, 0, 0, 0, 626, 0, 0, 629, 0, + 0, 0, 0, 0, 632, 0, 0, 634, 0, 0, + 200, 201, 597, 598, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 0, 213, 0, 214, 215, 216, 0, + 362, 363, 0, 364, 365, 0, 366, 367, 368, 174, + 175, 0, 0, 63, 64, 176, 0, 0, 0, 0, + 0, 0, 0, 0, 217, 1, 2, 0, 3, 4, + 5, 177, 178, 179, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 180, 181, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 111, 0, 63, 64, 182, 107, 66, 67, 68, 69, + 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, + 0, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 0, 0, + 0, 0, 63, 64, 73, 107, 158, 159, 160, 161, + 162, 163, 72, 0, 1, 2, 0, 3, 4, 5, + 0, 0, 0, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 0, 213, 0, 214, + 215, 216, 0, 0, 73, 0, 0, 0, 0, 174, + 175, 0, 0, 63, 64, 176, 0, 0, 112, 0, + 0, 0, 0, 0, 0, 1, 2, 217, 3, 4, + 5, 177, 178, 179, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 180, 181, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, + 0, 0, 74, 75, 0, 0, 76, 0, 77, 144, + 0, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 74, 75, 0, 0, 76, 0, 77, 385, + 0, 0, 0, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 0, 213, 0, 214, + 215, 216, 63, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 2, 0, 3, 4, 5, + 277, 0, 0, 0, 0, 0, 0, 217, 0, 0, + 0, 0, 0, 0, 0, 278, 279, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 64, 111, + 107, 158, 159, 160, 161, 162, 163, 72, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 0, 0, 73, + 0, 0, 0, 63, 64, 0, 107, 66, 67, 68, + 69, 70, 71, 72, 0, 1, 2, 0, 3, 4, + 5, 0, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 137, 213, 0, 214, 215, + 216, 0, 0, 0, 0, 73, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 112, 0, 63, + 64, -67, 0, 280, 0, 0, 281, 0, 282, 0, + 283, 1, 2, 0, 3, 4, 5, 277, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 278, 279, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 111, 74, 75, 0, + 0, 76, 0, 77, 442, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 0, 213, 0, 214, 215, 216, 0, 0, + 0, 0, 0, 0, 0, 0, 174, 175, 0, 0, + 0, 0, 176, 0, 112, 0, 0, 0, 0, 0, + 280, 0, 0, 281, 0, 282, 0, 283, 177, 178, + 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 180, 181, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, + 64, 182, 153, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 0, 0, 0, 0, 63, + 64, 73, 107, 158, 159, 160, 161, 162, 163, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 0, 213, 0, 214, 215, 216, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, + 0, 370, 0, 0, 0, 154, 0, 0, 0, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 449, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 540, 381, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 65, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 158, 159, 160, 161, 162, 163, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 153, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 330, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 158, 159, 160, 161, 162, 163, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 555, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 63, + 64, 73, 107, 66, 67, 68, 69, 70, 71, 602, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 0, + 0, 73, 0, 225, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 226, 227, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 383, 228, 229, 230, 231, + 232, 233, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 234, 235, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77, 0, 0, 0, 236, + 237, 238, 0, 0, 239, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 240, 241, 242, + 243, 244, 245, 246, 0, 0, 0, 0, 0, 74, + 75, 0, 0, 76, 0, 77 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const yytype_int16 yycheck[] = +{ + 0, 230, 265, 27, 238, 342, 450, 241, 242, 243, + 244, 245, 4, 0, 11, 249, 166, 17, 11, 21, + 128, 7, 8, 54, 154, 28, 167, 29, 34, 54, + 17, 438, 439, 19, 20, 11, 22, 23, 24, 11, + 121, 231, 7, 8, 38, 10, 11, 12, 13, 14, + 15, 16, 17, 77, 19, 20, 54, 22, 23, 24, + 21, 251, 132, 54, 34, 154, 68, 155, 54, 58, + 151, 54, 595, 280, 281, 282, 164, 53, 102, 11, + 18, 53, 106, 53, 49, 17, 156, 54, 112, 612, + 497, 155, 54, 93, 118, 154, 166, 541, 52, 54, + 164, 40, 41, 173, 128, 54, 155, 68, 47, 155, + 54, 555, 556, 67, 53, 164, 162, 20, 142, 143, + 23, 152, 146, 155, 358, 266, 267, 152, 152, 160, + 162, 137, 138, 139, 19, 0, 142, 22, 155, 24, + 146, 147, 154, 137, 138, 139, 19, 164, 142, 22, + 487, 24, 146, 147, 152, 599, 600, 158, 602, 603, + 163, 152, 164, 160, 162, 156, 152, 160, 53, 152, + 404, 163, 42, 43, 44, 158, 383, 47, 622, 623, + 154, 518, 169, 520, 418, 152, 420, 421, 422, 156, + 152, 153, 157, 158, 32, 33, 161, 152, 163, 164, + 155, 156, 22, 152, 228, 155, 155, 156, 152, 153, + 160, 152, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 3, 4, 5, 6, + 338, 568, 37, 257, 119, 120, 22, 500, 319, 320, + 321, 322, 323, 22, 268, 326, 327, 328, 356, 26, + 27, 22, 137, 138, 68, 140, 141, 155, 143, 144, + 145, 331, 160, 53, 334, 335, 4, 337, 149, 150, + 151, 505, 4, 46, 344, 48, 38, 173, 3, 4, + 5, 6, 352, 353, 354, 35, 42, 37, 44, 523, + 524, 525, 159, 443, 61, 62, 63, 64, 65, 66, + 42, 43, 44, 45, 46, 47, 48, 153, 50, 155, + 391, 392, 115, 116, 338, 339, 340, 398, 581, 153, + 159, 155, 585, 153, 152, 155, 137, 138, 139, 119, + 120, 142, 356, 357, 358, 146, 147, 156, 408, 409, + 410, 4, 114, 115, 83, 84, 416, 137, 138, 578, + 140, 141, 38, 143, 144, 145, 22, 427, 428, 383, + 155, 153, 162, 4, 153, 389, 9, 596, 152, 0, + 9, 9, 9, 443, 9, 9, 457, 458, 459, 460, + 404, 462, 463, 54, 60, 11, 152, 18, 19, 20, + 153, 22, 23, 24, 418, 419, 420, 421, 422, 30, + 31, 471, 426, 473, 152, 152, 476, 149, 150, 151, + 56, 152, 152, 483, 484, 152, 440, 7, 8, 152, + 51, 502, 503, 152, 55, 22, 162, 22, 59, 19, + 20, 152, 22, 23, 24, 331, 152, 152, 334, 335, + 464, 337, 155, 513, 514, 155, 516, 517, 344, 155, + 155, 521, 155, 155, 155, 38, 4, 353, 354, 38, + 155, 155, 532, 155, 488, 546, 155, 548, 549, 38, + 155, 155, 155, 155, 155, 499, 155, 155, 158, 153, + 155, 505, 155, 155, 22, 162, 155, 155, 155, 17, + 17, 515, 152, 563, 155, 152, 155, 4, 498, 523, + 524, 525, 155, 155, 155, 529, 0, 155, 155, 579, + 580, 4, 408, 409, 410, 155, 22, 26, 27, 4, + 416, 153, 155, 593, 18, 19, 20, 155, 22, 23, + 24, 427, 428, 162, 155, 153, 30, 31, 153, 155, + 53, 153, 153, 160, 158, 155, 616, 617, 53, 153, + 153, 621, 153, 17, 624, 160, 4, 51, 582, 148, + 630, 55, 22, 633, 152, 59, 152, 17, 155, 569, + 17, 155, 17, 73, 17, 471, 133, 473, 133, 133, + 476, 235, 93, 542, 234, 569, 112, 483, 484, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 257, 106, 17, 89, 513, 514, 268, + 516, 517, 56, 529, 415, 521, 3, 4, -1, -1, + 7, 8, 9, -1, -1, -1, 532, -1, -1, -1, + -1, -1, 19, 20, -1, 22, 23, 24, 25, 26, + 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 40, 41, -1, -1, 563, -1, -1, + -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, + -1, 58, -1, 579, 580, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 593, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, -1, -1, -1, -1, -1, + 616, 617, -1, -1, -1, 621, -1, -1, 624, -1, + -1, -1, -1, -1, 630, -1, -1, 633, -1, -1, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, -1, 131, -1, 133, 134, 135, -1, + 137, 138, -1, 140, 141, -1, 143, 144, 145, 3, + 4, -1, -1, 7, 8, 9, -1, -1, -1, -1, + -1, -1, -1, -1, 161, 19, 20, -1, 22, 23, + 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 54, -1, 7, 8, 58, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, -1, -1, + -1, -1, 7, 8, 49, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, -1, 131, -1, 133, + 134, 135, -1, -1, 49, -1, -1, -1, -1, 3, + 4, -1, -1, 7, 8, 9, -1, -1, 152, -1, + -1, -1, -1, -1, -1, 19, 20, 161, 22, 23, + 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, + -1, -1, 157, 158, -1, -1, 161, -1, 163, 164, + -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 157, 158, -1, -1, 161, -1, 163, 164, + -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, -1, 131, -1, 133, + 134, 135, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 19, 20, -1, 22, 23, 24, + 25, -1, -1, -1, -1, -1, -1, 161, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 7, 8, 54, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, -1, -1, 49, + -1, -1, -1, 7, 8, -1, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, -1, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 39, 131, -1, 133, 134, + 135, -1, -1, -1, -1, 49, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 152, -1, 7, + 8, 156, -1, 158, -1, -1, 161, -1, 163, -1, + 165, 19, 20, -1, 22, 23, 24, 25, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 54, 157, 158, -1, + -1, 161, -1, 163, 164, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 157, 158, -1, -1, 161, -1, 163, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, -1, 131, -1, 133, 134, 135, -1, -1, + -1, -1, -1, -1, -1, -1, 3, 4, -1, -1, + -1, -1, 9, -1, 152, -1, -1, -1, -1, -1, + 158, -1, -1, 161, -1, 163, -1, 165, 25, 26, + 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, + 8, 58, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, -1, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, -1, 131, -1, 133, 134, 135, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, 161, -1, -1, -1, -1, -1, + -1, 39, -1, -1, -1, 123, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, 39, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, 39, 160, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, -1, + -1, 49, -1, 36, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 56, 57, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163, -1, -1, -1, 112, + 113, 114, -1, -1, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, -1, -1, -1, -1, -1, 157, + 158, -1, -1, 161, -1, 163 +}; -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 19, 20, 22, 23, 24, 30, 31, 51, 55, + 59, 174, 177, 178, 179, 180, 212, 213, 214, 216, + 215, 52, 67, 221, 154, 58, 154, 18, 154, 42, + 43, 44, 45, 46, 47, 48, 50, 149, 150, 151, + 181, 182, 183, 0, 214, 46, 48, 184, 231, 42, + 43, 44, 47, 185, 228, 230, 238, 154, 154, 158, + 222, 22, 220, 7, 8, 10, 11, 12, 13, 14, + 15, 16, 17, 49, 157, 158, 161, 163, 174, 178, + 199, 200, 234, 183, 183, 35, 37, 210, 183, 183, + 21, 68, 239, 240, 29, 164, 229, 239, 22, 22, + 22, 223, 152, 4, 4, 4, 163, 10, 164, 200, + 205, 54, 152, 176, 210, 210, 42, 44, 186, 32, + 33, 209, 61, 62, 63, 64, 65, 66, 187, 226, + 226, 68, 38, 177, 243, 155, 160, 39, 200, 201, + 203, 204, 159, 159, 164, 205, 155, 164, 152, 204, + 156, 209, 209, 10, 123, 200, 202, 211, 11, 12, + 13, 14, 15, 16, 172, 173, 200, 206, 4, 202, + 28, 163, 227, 38, 3, 4, 9, 25, 26, 27, + 40, 41, 58, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 131, 133, 134, 135, 161, 167, 168, + 169, 207, 233, 234, 235, 36, 56, 57, 69, 70, + 71, 72, 73, 74, 90, 91, 112, 113, 114, 117, + 130, 131, 132, 133, 134, 135, 136, 167, 168, 169, + 241, 247, 248, 249, 250, 22, 189, 155, 153, 200, + 200, 162, 164, 200, 4, 153, 206, 200, 152, 234, + 26, 27, 3, 4, 5, 6, 9, 25, 40, 41, + 158, 161, 163, 165, 207, 234, 176, 178, 235, 60, + 232, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 170, 26, 27, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 171, 152, + 152, 152, 152, 152, 206, 208, 152, 152, 152, 56, + 10, 200, 236, 237, 11, 17, 11, 172, 187, 170, + 171, 200, 200, 236, 200, 200, 244, 236, 236, 236, + 236, 236, 200, 200, 200, 236, 187, 115, 116, 53, + 119, 120, 137, 138, 140, 141, 143, 144, 145, 188, + 39, 201, 191, 160, 162, 162, 153, 191, 176, 176, + 211, 160, 208, 163, 208, 164, 208, 22, 217, 152, + 22, 152, 152, 206, 206, 206, 206, 206, 155, 162, + 206, 206, 206, 235, 155, 235, 235, 235, 202, 200, + 200, 155, 194, 155, 194, 235, 158, 155, 155, 155, + 155, 155, 155, 234, 235, 235, 38, 202, 200, 236, + 4, 137, 138, 139, 142, 146, 147, 190, 218, 219, + 38, 160, 164, 200, 208, 162, 164, 155, 197, 39, + 200, 224, 225, 155, 206, 206, 246, 155, 155, 155, + 155, 206, 155, 155, 38, 236, 155, 155, 235, 235, + 235, 11, 53, 11, 246, 235, 158, 236, 200, 236, + 236, 236, 155, 155, 155, 200, 235, 235, 155, 197, + 197, 200, 162, 164, 34, 53, 195, 198, 189, 155, + 153, 22, 155, 155, 153, 155, 206, 206, 206, 206, + 206, 206, 200, 17, 17, 152, 155, 155, 235, 4, + 235, 155, 235, 155, 155, 155, 4, 235, 235, 152, + 155, 194, 200, 153, 162, 22, 4, 197, 174, 175, + 39, 200, 191, 206, 206, 236, 155, 153, 155, 155, + 153, 153, 153, 235, 235, 17, 200, 245, 235, 235, + 194, 194, 235, 155, 236, 236, 236, 245, 235, 189, + 195, 196, 153, 153, 206, 206, 206, 155, 158, 189, + 189, 153, 155, 160, 235, 153, 194, 175, 53, 193, + 153, 153, 153, 17, 160, 172, 242, 119, 120, 235, + 235, 191, 17, 200, 160, 191, 4, 148, 192, 235, + 233, 160, 172, 189, 189, 38, 189, 189, 22, 155, + 233, 17, 235, 235, 17, 155, 235, 189, 189, 235, + 17, 73, 235, 17, 235 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ + +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif -#else /* not YYLSP_NEEDED */ + + +/* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) +# define YYLEX yylex (YYLEX_PARAM) #else -#define YYLEX yylex(&yylval) +# define YYLEX yylex () #endif -#endif /* not YYLSP_NEEDED */ + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; #endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/* If nonreentrant, generate the variables here */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); -#ifndef YYPURE + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; #endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif { - register char *f = from; - register char *t = to; - register int i = count; + char *yyd = yydest; + const char *yys = yysrc; - while (i-- > 0) - *t++ = *f++; + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; } +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; -#else /* __cplusplus */ + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - register char *t = to; - register char *f = from; - register int i = count; + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; - while (i-- > 0) - *t++ = *f++; + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif -#endif - -#line 217 "/usr/share/bison.simple" +{ + YYUSE (yyvaluep); -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ #ifdef YYPARSE_PARAM -int yyparse (void *); +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); #else -int yyparse (void); +int yyparse (); #endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) #else -#define YYPOPSTACK (yyvsp--, yyssp--) +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; #endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; #endif #endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. - int yylen; + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2375,732 +3301,780 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: + goto yysetstate; - *++yyssp = yystate; +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif + yysetstate: + *yyssp = yystate; + if (yyss + yystacksize - 1 <= yyssp) + { /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - if (yyssp >= yyss + yystacksize - 1) + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ +/*-----------. +| yybackup. | +`-----------*/ +yybackup: - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* Not known => get a look-ahead token if don't already have one. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; -/* Do a reduction. yyn is the number of a rule to reduce with. */ + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int i; + case 29: +#line 1118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 28: -#line 1118 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; - break;} -case 29: -#line 1118 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_NE; ; - break;} -case 30: -#line 1119 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; - break;} -case 31: -#line 1119 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; - break;} -case 32: -#line 1120 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; - break;} -case 33: -#line 1120 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; - break;} -case 34: -#line 1121 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; - break;} -case 35: -#line 1121 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; - break;} -case 36: -#line 1122 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; - break;} -case 37: -#line 1122 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; - break;} -case 38: -#line 1126 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; - break;} -case 39: -#line 1126 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; - break;} -case 40: -#line 1127 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; - break;} -case 41: -#line 1127 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; - break;} -case 42: -#line 1128 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; - break;} -case 43: -#line 1128 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; - break;} -case 44: -#line 1129 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; - break;} -case 45: -#line 1129 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; - break;} -case 46: -#line 1130 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; - break;} -case 47: -#line 1130 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; - break;} -case 48: -#line 1131 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; - break;} -case 49: -#line 1131 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; - break;} -case 50: -#line 1132 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; - break;} -case 51: -#line 1132 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; - break;} -case 52: -#line 1133 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; - break;} -case 53: -#line 1134 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; - break;} -case 64: -#line 1143 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 65: -#line 1145 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal=yyvsp[-1].UInt64Val; ; - break;} -case 66: -#line 1146 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal=0; ; - break;} -case 67: -#line 1150 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + case 30: +#line 1118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} + break; + + case 31: +#line 1119 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} + break; + + case 32: +#line 1119 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} + break; + + case 33: +#line 1120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} + break; + + case 34: +#line 1120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} + break; + + case 35: +#line 1121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} + break; + + case 36: +#line 1121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} + break; + + case 37: +#line 1122 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} + break; + + case 38: +#line 1122 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} + break; + + case 39: +#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} + break; + + case 40: +#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} + break; + + case 41: +#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} + break; + + case 42: +#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} + break; + + case 43: +#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} + break; + + case 44: +#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} + break; + + case 45: +#line 1129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} + break; + + case 46: +#line 1129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} + break; + + case 47: +#line 1130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} + break; + + case 48: +#line 1130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} + break; + + case 49: +#line 1131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} + break; + + case 50: +#line 1131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} + break; + + case 51: +#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} + break; + + case 52: +#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} + break; + + case 53: +#line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} + break; + + case 54: +#line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} + break; + + case 65: +#line 1143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 66: +#line 1145 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} + break; + + case 67: +#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal)=0; ;} + break; + + case 68: +#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 68: -#line 1154 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 69: +#line 1154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 72: -#line 1162 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 73: +#line 1162 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 73: -#line 1167 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + ;} + break; + + case 74: +#line 1167 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 74: -#line 1173 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 75: -#line 1174 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 76: -#line 1175 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 77: -#line 1176 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 78: -#line 1177 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 79: -#line 1181 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 80: -#line 1182 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 81: -#line 1183 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 82: -#line 1187 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 83: -#line 1188 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 84: -#line 1189 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::HiddenVisibility; ; - break;} -case 85: -#line 1190 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::ProtectedVisibility; ; - break;} -case 86: -#line 1194 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 87: -#line 1195 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 88: -#line 1196 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 89: -#line 1200 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 90: -#line 1201 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 91: -#line 1202 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 92: -#line 1203 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 93: -#line 1204 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 94: -#line 1208 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 95: -#line 1209 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 96: -#line 1210 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 97: -#line 1213 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 98: -#line 1214 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 99: -#line 1215 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 100: -#line 1216 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 101: -#line 1217 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_StdCall; ; - break;} -case 102: -#line 1218 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_FastCall; ; - break;} -case 103: -#line 1219 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) + ;} + break; + + case 75: +#line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 76: +#line 1174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 77: +#line 1175 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 78: +#line 1176 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 79: +#line 1177 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 80: +#line 1181 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 81: +#line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 82: +#line 1183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 83: +#line 1187 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 84: +#line 1188 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 85: +#line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} + break; + + case 86: +#line 1190 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} + break; + + case 87: +#line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 88: +#line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 89: +#line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 90: +#line 1200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 91: +#line 1201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 92: +#line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 93: +#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 94: +#line 1204 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 95: +#line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 96: +#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 97: +#line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 98: +#line 1213 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 99: +#line 1214 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 100: +#line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} + break; + + case 101: +#line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} + break; + + case 102: +#line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} + break; + + case 103: +#line 1218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} + break; + + case 104: +#line 1219 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); - yyval.UIntVal = yyvsp[0].UInt64Val; + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); CHECK_FOR_ERROR - ; - break;} -case 104: -#line 1226 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 105: -#line 1227 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 106: -#line 1228 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 107: -#line 1229 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 108: -#line 1230 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::InReg; ; - break;} -case 109: -#line 1231 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::StructRet; ; - break;} -case 110: -#line 1232 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoAlias; ; - break;} -case 111: -#line 1233 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ByVal; ; - break;} -case 112: -#line 1234 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::Nest; ; - break;} -case 113: -#line 1235 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = - ParamAttr::constructAlignmentFromInt(yyvsp[0].UInt64Val); ; - break;} -case 114: -#line 1239 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 115: -#line 1240 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 116: -#line 1245 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoReturn; ; - break;} -case 117: -#line 1246 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; - break;} -case 118: -#line 1247 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 119: -#line 1248 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 120: -#line 1249 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ReadNone; ; - break;} -case 121: -#line 1250 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ReadOnly; ; - break;} -case 122: -#line 1253 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 123: -#line 1254 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 124: -#line 1259 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 125: -#line 1260 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[0].StrVal; - ; - break;} -case 126: -#line 1267 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 127: -#line 1268 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + ;} + break; + + case 105: +#line 1226 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 106: +#line 1227 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 107: +#line 1228 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 108: +#line 1229 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 109: +#line 1230 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} + break; + + case 110: +#line 1231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} + break; + + case 111: +#line 1232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} + break; + + case 112: +#line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} + break; + + case 113: +#line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::Nest; ;} + break; + + case 114: +#line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = + ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} + break; + + case 115: +#line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 116: +#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + ;} + break; + + case 117: +#line 1245 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} + break; + + case 118: +#line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} + break; + + case 119: +#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 120: +#line 1248 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 121: +#line 1249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} + break; + + case 122: +#line 1250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} + break; + + case 123: +#line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 124: +#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + ;} + break; + + case 125: +#line 1259 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 126: +#line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + ;} + break; + + case 127: +#line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 128: +#line 1268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 128: -#line 1274 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 129: -#line 1275 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) +;} + break; + + case 129: +#line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 130: +#line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 130: -#line 1284 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - for (unsigned i = 0, e = yyvsp[0].StrVal->length(); i != e; ++i) - if ((*yyvsp[0].StrVal)[i] == '"' || (*yyvsp[0].StrVal)[i] == '\\') +;} + break; + + case 131: +#line 1284 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) + if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') GEN_ERROR("Invalid character in section name"); - yyval.StrVal = yyvsp[0].StrVal; + (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); CHECK_FOR_ERROR -; - break;} -case 131: -#line 1292 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 132: -#line 1293 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 133: -#line 1298 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 134: -#line 1299 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 135: -#line 1300 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV->setSection(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; +;} + break; + + case 132: +#line 1292 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 133: +#line 1293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} + break; + + case 134: +#line 1298 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 135: +#line 1299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 136: +#line 1300 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 136: -#line 1305 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) + ;} + break; + + case 137: +#line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment(yyvsp[0].UInt64Val); + CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 144: -#line 1321 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(OpaqueType::get()); + ;} + break; + + case 145: +#line 1321 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ; - break;} -case 145: -#line 1325 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); + ;} + break; + + case 146: +#line 1325 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR - ; - break;} -case 146: -#line 1329 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Pointer type? - if (*yyvsp[-2].TypeVal == Type::LabelTy) + ;} + break; + + case 147: +#line 1329 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Pointer type? + if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-2].TypeVal, yyvsp[-1].UIntVal))); - delete yyvsp[-2].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal)))); + delete (yyvsp[(1) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 148: +#line 1336 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Named types are also simple types... + const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 147: -#line 1336 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Named types are also simple types... - const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TypeVal = new PATypeHolder(tmp); - ; - break;} -case 148: -#line 1341 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); + (yyval.TypeVal) = new PATypeHolder(tmp); + ;} + break; + + case 149: +#line 1341 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Type UpReference + if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... - yyval.TypeVal = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... + (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ; - break;} -case 149: -#line 1349 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 150: +#line 1349 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - const Type* RetTy = *yyvsp[-4].TypeVal; + const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal); if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy || + isa(RetTy) || isa(RetTy))) GEN_ERROR("LLVM Functions cannot return aggregates"); std::vector Params; - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); for (; I != E; ++I ) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3116,19 +4090,20 @@ CHECK_FOR_ERROR FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - delete yyvsp[-4].TypeVal; // Delete the return type handle - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 150: -#line 1379 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 151: +#line 1380 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. std::vector Params; - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); for ( ; I != E; ++I ) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); @@ -3143,282 +4118,303 @@ CHECK_FOR_ERROR - FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 151: -#line 1404 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Sized array type? - yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 152: -#line 1409 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Vector type? - const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) + FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg); + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 152: +#line 1405 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Sized array type? + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + delete (yyvsp[(4) - (5)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 153: +#line 1410 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Vector type? + const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); + if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a VectorType must be primitive"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + delete (yyvsp[(4) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 153: -#line 1419 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Structure type? + ;} + break; + + case 154: +#line 1420 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), + E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete yyvsp[-1].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete (yyvsp[(2) - (3)].TypeList); CHECK_FOR_ERROR - ; - break;} -case 154: -#line 1429 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ; - break;} -case 155: -#line 1433 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 155: +#line 1430 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ;} + break; + + case 156: +#line 1434 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { std::vector Elements; - for (std::list::iterator I = yyvsp[-2].TypeList->begin(), - E = yyvsp[-2].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), + E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete yyvsp[-2].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete (yyvsp[(3) - (5)].TypeList); CHECK_FOR_ERROR - ; - break;} -case 156: -#line 1443 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ; - break;} -case 157: -#line 1450 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 157: +#line 1444 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ;} + break; + + case 158: +#line 1451 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; - yyval.TypeWithAttrs.Attrs = ParamAttr::None; - ; - break;} -case 158: -#line 1459 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeWithAttrs).Attrs = ParamAttr::None; + ;} + break; + + case 159: +#line 1460 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - if (!(*yyvsp[0].TypeVal)->isFirstClassType() && !isa(yyvsp[0].TypeVal->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); + if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa((yyvsp[(1) - (1)].TypeVal)->get())) GEN_ERROR("LLVM functions cannot return aggregate types"); - yyval.TypeVal = yyvsp[0].TypeVal; - ; - break;} -case 159: -#line 1466 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(Type::VoidTy); - ; - break;} -case 160: -#line 1471 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); - yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); + (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + ;} + break; + + case 160: +#line 1467 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); + ;} + break; + + case 161: +#line 1472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 161: -#line 1476 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); + ;} + break; + + case 162: +#line 1477 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 163: -#line 1484 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; + ;} + break; + + case 164: +#line 1485 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 164: -#line 1491 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList; + ;} + break; + + case 165: +#line 1492 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 165: -#line 1498 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); + ;} + break; + + case 166: +#line 1499 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR - ; - break;} -case 166: -#line 1506 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeList = new std::list(); - yyval.TypeList->push_back(*yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 167: -#line 1512 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; + ;} + break; + + case 167: +#line 1507 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeList) = new std::list(); + (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); + delete (yyvsp[(1) - (1)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 168: -#line 1524 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + ;} + break; + + case 168: +#line 1513 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); + delete (yyvsp[(3) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 169: +#line 1525 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 169: -#line 1552 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 170: +#line 1553 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - yyval.ConstVal = ConstantArray::get(ATy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 170: -#line 1568 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 171: +#line 1569 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - if (NumElements != -1 && NumElements != int(yyvsp[0].StrVal->length())) + if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length())) GEN_ERROR("Can't build string constant of size " + - itostr((int)(yyvsp[0].StrVal->length())) + + itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned i = 0; i < yyvsp[0].StrVal->length(); ++i) - Vals.push_back(ConstantInt::get(ETy, (*yyvsp[0].StrVal)[i])); + for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i) + Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i])); } else { - delete yyvsp[0].StrVal; + delete (yyvsp[(3) - (3)].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - delete yyvsp[0].StrVal; - yyval.ConstVal = ConstantArray::get(ATy, Vals); - delete yyvsp[-2].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 171: -#line 1595 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + delete (yyvsp[(3) - (3)].StrVal); + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[(1) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 172: +#line 1596 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + const VectorType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 172: -#line 1623 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); + ;} + break; + + case 173: +#line 1624 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); - if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3429,20 +4425,21 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 173: -#line 1649 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 174: +#line 1650 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3452,25 +4449,26 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 174: -#line 1669 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); + ;} + break; + + case 175: +#line 1670 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-5].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'"); - if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3481,20 +4479,21 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); - delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); + delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 175: -#line 1695 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 176: +#line 1696 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-4].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3504,44 +4503,47 @@ GEN_ERROR("Vector initializer to non-vector type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-4].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[(1) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 176: -#line 1715 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 177: +#line 1716 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*yyvsp[-1].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'"); - yyval.ConstVal = ConstantPointerNull::get(PTy); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = ConstantPointerNull::get(PTy); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 177: -#line 1727 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 178: +#line 1728 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 178: -#line 1734 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); + delete (yyvsp[(1) - (2)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 179: +#line 1735 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); if (Ty == 0) - GEN_ERROR("Global const reference must be a pointer type " + (*yyvsp[-1].TypeVal)->getDescription()); + GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -3553,7 +4555,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); + Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -3568,16 +4570,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - yyvsp[0].ValIDVal.destroy(); + (yyvsp[(2) - (2)].ValIDVal).destroy(); } else { std::string Name; - if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) - Name = yyvsp[0].ValIDVal.getName(); - else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) + if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[(2) - (2)].ValIDVal).getName(); + else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -3593,342 +4595,377 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); V = GV; } } - yyval.ConstVal = cast(V); - delete yyvsp[-1].TypeVal; // Free the type handle + (yyval.ConstVal) = cast(V); + delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle CHECK_FOR_ERROR - ; - break;} -case 179: -#line 1800 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 180: +#line 1801 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); - yyval.ConstVal = yyvsp[0].ConstVal; - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 180: -#line 1810 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); + (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); + delete (yyvsp[(1) - (2)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 181: +#line 1811 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const Type *Ty = yyvsp[-1].TypeVal->get(); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - yyval.ConstVal = Constant::getNullValue(Ty); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = Constant::getNullValue(Ty); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 181: -#line 1820 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) + ;} + break; + + case 182: +#line 1821 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true); CHECK_FOR_ERROR - ; - break;} -case 182: -#line 1826 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 183: +#line 1827 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); + if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->sextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 183: -#line 1836 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) + (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 184: +#line 1837 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false); CHECK_FOR_ERROR - ; - break;} -case 184: -#line 1842 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 185: +#line 1843 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); + if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->zextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 185: -#line 1852 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ; - break;} -case 186: -#line 1857 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ; - break;} -case 187: -#line 1862 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Floating point constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal)) + (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 186: +#line 1853 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ;} + break; + + case 187: +#line 1858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ;} + break; + + case 188: +#line 1863 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Floating point constants + if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&yyvsp[0].FPVal->getSemantics()==&APFloat::IEEEdouble && yyvsp[-1].PrimType==Type::FloatTy) - yyvsp[0].FPVal->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); - yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, *yyvsp[0].FPVal); - delete yyvsp[0].FPVal; - CHECK_FOR_ERROR - ; - break;} -case 188: -#line 1875 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy) + (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)); + delete (yyvsp[(2) - (2)].FPVal); + CHECK_FOR_ERROR + ;} + break; + + case 189: +#line 1876 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - Constant *Val = yyvsp[-3].ConstVal; - const Type *DestTy = yyvsp[-1].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + Constant *Val = (yyvsp[(3) - (6)].ConstVal); + const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); - delete yyvsp[-1].TypeVal; - ; - break;} -case 189: -#line 1887 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-2].ConstVal->getType())) + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); + delete (yyvsp[(5) - (6)].TypeVal); + ;} + break; + + case 190: +#line 1888 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end(), + GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) - if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) + for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete yyvsp[-1].ValueList; + delete (yyvsp[(4) - (5)].ValueList); - yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ; - break;} -case 190: -#line 1909 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) + ;} + break; + + case 191: +#line 1910 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) GEN_ERROR("Select operand types must match"); - yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 191: -#line 1917 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 192: +#line 1918 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 192: -#line 1923 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + ;} + break; + + case 193: +#line 1924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); - if (!yyvsp[-3].ConstVal->getType()->isInteger()) { - if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || - !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) + if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { + if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || + !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 193: -#line 1934 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 194: +#line 1935 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); - yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 194: -#line 1939 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 195: +#line 1940 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); - yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 195: -#line 1944 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 196: +#line 1945 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); - yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 196: -#line 1950 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 197: +#line 1951 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); - yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 197: -#line 1956 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 198: +#line 1957 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); - yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 198: -#line 1965 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 199: +#line 1966 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 199: -#line 1969 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 200: +#line 1970 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 200: -#line 1977 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 201: -#line 1977 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 202: -#line 1980 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 203: -#line 1980 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 204: -#line 1983 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type* VTy = yyvsp[-1].TypeVal->get(); - Value *V = getVal(VTy, yyvsp[0].ValIDVal); + ;} + break; + + case 201: +#line 1978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 202: +#line 1978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 203: +#line 1981 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 204: +#line 1981 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 205: +#line 1984 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); + Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); CHECK_FOR_ERROR GlobalValue* Aliasee = dyn_cast(V); if (!Aliasee) GEN_ERROR("Aliases can be created only to global values"); - yyval.ConstVal = Aliasee; + (yyval.ConstVal) = Aliasee; CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 205: -#line 1995 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Constant *Val = yyvsp[-3].ConstVal; - const Type *DestTy = yyvsp[-1].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) + delete (yyvsp[(1) - (2)].TypeVal); + ;} + break; + + case 206: +#line 1996 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + Constant *Val = (yyvsp[(3) - (6)].ConstVal); + const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 206: -#line 2016 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + delete (yyvsp[(5) - (6)].TypeVal); + ;} + break; + + case 207: +#line 2017 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 207: -#line 2021 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 208: +#line 2022 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 210: -#line 2034 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = false; ; - break;} -case 211: -#line 2034 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 211: +#line 2035 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = false; ;} + break; + + case 212: +#line 2035 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 212: -#line 2038 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 213: -#line 2038 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 213: +#line 2039 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 214: +#line 2039 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 214: -#line 2041 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 215: +#line 2042 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 215: -#line 2044 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 216: +#line 2045 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -3938,100 +4975,108 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); + ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); - if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*yyvsp[0].TypeVal); + CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); } - delete yyvsp[0].TypeVal; + delete (yyvsp[(3) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 216: -#line 2068 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); + ;} + break; + + case 217: +#line 2069 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); - if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(yyvsp[0].PrimType); + CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); } CHECK_FOR_ERROR - ; - break;} -case 217: -#line 2080 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 218: +#line 2081 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { /* "Externally Visible" Linkage */ - if (yyvsp[-1].ConstVal == 0) + if ((yyvsp[(5) - (6)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, GlobalValue::ExternalLinkage, - yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal)); CHECK_FOR_ERROR - ; - break;} -case 218: -#line 2087 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 219: +#line 2088 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 219: -#line 2091 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-1].ConstVal == 0) + ;} + break; + + case 220: +#line 2092 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); CHECK_FOR_ERROR - ; - break;} -case 220: -#line 2096 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 221: +#line 2097 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 221: -#line 2100 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 222: +#line 2101 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, *yyvsp[-1].TypeVal, 0, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 222: -#line 2106 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(6) - (7)].TypeVal); + ;} + break; + + case 223: +#line 2107 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; CHECK_FOR_ERROR - ; - break;} -case 223: -#line 2110 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 224: +#line 2111 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { std::string Name; - if (yyvsp[-4].StrVal) { - Name = *yyvsp[-4].StrVal; - delete yyvsp[-4].StrVal; + if ((yyvsp[(1) - (5)].StrVal)) { + Name = *(yyvsp[(1) - (5)].StrVal); + delete (yyvsp[(1) - (5)].StrVal); } if (Name.empty()) GEN_ERROR("Alias name cannot be empty"); - Constant* Aliasee = yyvsp[0].ConstVal; + Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal); if (Aliasee == 0) GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name); - GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee, + GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee, CurModule.CurrentModule); - GA->setVisibility(yyvsp[-3].Visibility); + GA->setVisibility((yyvsp[(2) - (5)].Visibility)); InsertValue(GA, CurModule.Values); @@ -4055,150 +5100,165 @@ ID.destroy(); CHECK_FOR_ERROR - ; - break;} -case 224: -#line 2150 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CHECK_FOR_ERROR - ; - break;} -case 225: -#line 2153 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 225: +#line 2151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 226: -#line 2159 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 226: +#line 2154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 227: +#line 2160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) - CurModule.CurrentModule->setModuleInlineAsm(*yyvsp[0].StrVal); + CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal)); else - CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; + CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR -; - break;} -case 227: -#line 2169 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - ; - break;} -case 228: -#line 2173 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - ; - break;} -case 230: -#line 2180 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; +;} + break; + + case 228: +#line 2170 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); + ;} + break; + + case 229: +#line 2174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); + ;} + break; + + case 231: +#line 2181 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 231: -#line 2185 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; + ;} + break; + + case 232: +#line 2186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 232: -#line 2190 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 233: +#line 2191 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 233: -#line 2199 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 234: +#line 2200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = yyvsp[-4].ArgList; - yyvsp[-4].ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 234: -#line 2209 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); + (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); + (yyvsp[(1) - (5)].ArgList)->push_back(E); + CHECK_FOR_ERROR + ;} + break; + + case 235: +#line 2210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = new ArgListType; - yyval.ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 235: -#line 2220 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[0].ArgList; + ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); + (yyval.ArgList) = new ArgListType; + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 236: -#line 2224 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; + ;} + break; + + case 236: +#line 2221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + CHECK_FOR_ERROR + ;} + break; + + case 237: +#line 2225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 237: -#line 2233 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new ArgListType; + ;} + break; + + case 238: +#line 2234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 238: -#line 2242 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = 0; + ;} + break; + + case 239: +#line 2243 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = 0; CHECK_FOR_ERROR - ; - break;} -case 239: -#line 2248 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - std::string FunctionName(*yyvsp[-7].StrVal); - delete yyvsp[-7].StrVal; // Free strdup'd memory! + ;} + break; + + case 240: +#line 2249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); + delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-8].TypeVal)) - GEN_ERROR("Reference to abstract result: "+ yyvsp[-8].TypeVal->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription()); std::vector ParamTypeList; SmallVector Attrs; - if (yyvsp[-3].ParamAttrs != ParamAttr::None) - Attrs.push_back(ParamAttrsWithIndex::get(0, yyvsp[-3].ParamAttrs)); - if (yyvsp[-5].ArgList) { // If there are arguments... + if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) + Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs))); + if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = yyvsp[-5].ArgList->begin(); I != yyvsp[-5].ArgList->end(); ++I, ++index) { + for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4215,9 +5275,9 @@ if (!Attrs.empty()) PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); - FunctionType *FT = FunctionType::get(*yyvsp[-8].TypeVal, ParamTypeList, isVarArg); + FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg); const PointerType *PFT = PointerType::getUnqual(FT); - delete yyvsp[-8].TypeVal; + delete (yyvsp[(2) - (10)].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4271,31 +5331,31 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv(yyvsp[-9].UIntVal); + Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal)); Fn->setParamAttrs(PAL); - Fn->setAlignment(yyvsp[-1].UIntVal); - if (yyvsp[-2].StrVal) { - Fn->setSection(*yyvsp[-2].StrVal); - delete yyvsp[-2].StrVal; - } - if (yyvsp[0].StrVal) { - Fn->setCollector(yyvsp[0].StrVal->c_str()); - delete yyvsp[0].StrVal; + Fn->setAlignment((yyvsp[(9) - (10)].UIntVal)); + if ((yyvsp[(8) - (10)].StrVal)) { + Fn->setSection(*(yyvsp[(8) - (10)].StrVal)); + delete (yyvsp[(8) - (10)].StrVal); + } + if ((yyvsp[(10) - (10)].StrVal)) { + Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str()); + delete (yyvsp[(10) - (10)].StrVal); } // Add all of the arguments we parsed to the function... - if (yyvsp[-5].ArgList) { // Is null if empty... + if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert(yyvsp[-5].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-5].ArgList->back().Name == 0 && + assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete yyvsp[-5].ArgList->back().Ty; - yyvsp[-5].ArgList->pop_back(); // Delete the last entry + delete (yyvsp[(5) - (10)].ArgList)->back().Ty; + (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = yyvsp[-5].ArgList->begin(); - I != yyvsp[-5].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); + I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4303,114 +5363,128 @@ Idx++; } - delete yyvsp[-5].ArgList; // We're now done with the argument list + delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR -; - break;} -case 242: -#line 2375 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 243: +#line 2376 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); - yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); -; - break;} -case 245: -#line 2386 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; + (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); + (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); +;} + break; + + case 246: +#line 2387 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR -; - break;} -case 246: -#line 2391 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); - CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 247: +#line 2392 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); + CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); + (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 247: -#line 2403 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 248: +#line 2404 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; CHECK_FOR_ERROR - ; - break;} -case 248: -#line 2407 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 249: +#line 2408 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 249: -#line 2412 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A reference to a direct constant - yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); - CHECK_FOR_ERROR - ; - break;} -case 250: -#line 2416 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); + ;} + break; + + case 250: +#line 2413 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // A reference to a direct constant + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 251: -#line 2420 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Perhaps it's an FP constant? - yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); - CHECK_FOR_ERROR - ; - break;} -case 252: -#line 2424 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); + ;} + break; + + case 251: +#line 2417 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 253: -#line 2428 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); + ;} + break; + + case 252: +#line 2421 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Perhaps it's an FP constant? + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR - ; - break;} -case 254: -#line 2432 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createNull(); + ;} + break; + + case 253: +#line 2425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ; - break;} -case 255: -#line 2436 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createUndef(); + ;} + break; + + case 254: +#line 2429 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + CHECK_FOR_ERROR + ;} + break; + + case 255: +#line 2433 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createNull(); + CHECK_FOR_ERROR + ;} + break; + + case 256: +#line 2437 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR - ; - break;} -case 256: -#line 2440 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A vector zero constant. - yyval.ValIDVal = ValID::createZeroInit(); - CHECK_FOR_ERROR - ; - break;} -case 257: -#line 2444 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized packed vector - const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); - int NumElements = yyvsp[-1].ConstVector->size(); + ;} + break; + + case 257: +#line 2441 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // A vector zero constant. + (yyval.ValIDVal) = ValID::createZeroInit(); + CHECK_FOR_ERROR + ;} + break; + + case 258: +#line 2445 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized packed vector + const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); + int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -4422,266 +5496,290 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); - delete PTy; delete yyvsp[-1].ConstVector; + (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector))); + delete PTy; delete (yyvsp[(2) - (3)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 258: -#line 2469 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); + ;} + break; + + case 259: +#line 2470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 259: -#line 2473 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal); - delete yyvsp[-2].StrVal; - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 260: -#line 2483 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it an integer reference...? - yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); - CHECK_FOR_ERROR - ; - break;} -case 261: -#line 2487 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); + ;} + break; + + case 260: +#line 2474 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); + delete (yyvsp[(3) - (5)].StrVal); + delete (yyvsp[(5) - (5)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 262: -#line 2491 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 263: -#line 2496 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 266: -#line 2509 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 261: +#line 2484 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it an integer reference...? + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 262: +#line 2488 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 263: +#line 2492 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 264: +#line 2497 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 267: +#line 2510 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 267: -#line 2518 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = new std::vector(); - yyval.ValueList->push_back(yyvsp[0].ValueVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 268: -#line 2523 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ValueList=yyvsp[-2].ValueList)->push_back(yyvsp[0].ValueVal); + ;} + break; + + case 268: +#line 2519 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = new std::vector(); + (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 269: -#line 2528 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; + ;} + break; + + case 269: +#line 2524 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 270: +#line 2529 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 271: +#line 2533 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Do not allow functions with 0 basic blocks + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 272: +#line 2542 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); + CHECK_FOR_ERROR + InsertValue((yyvsp[(3) - (3)].TermInstVal)); + (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 273: +#line 2551 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) + if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) + if (CI2->getParent() == 0) + (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); + (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 274: +#line 2560 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty space between instruction lists + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), 0); + CHECK_FOR_ERROR + ;} + break; + + case 275: +#line 2564 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Only the unwind to block + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), getBBVal((yyvsp[(3) - (3)].ValIDVal))); + CHECK_FOR_ERROR + ;} + break; + + case 276: +#line 2568 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Labelled (named) basic block + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)), 0); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 277: +#line 2573 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (4)].StrVal)), getBBVal((yyvsp[(4) - (4)].ValIDVal))); + delete (yyvsp[(1) - (4)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 278: +#line 2580 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with a result... + ValueList &VL = *(yyvsp[(2) - (2)].ValueList); + assert(!VL.empty() && "Invalid ret operands!"); + (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size()); + delete (yyvsp[(2) - (2)].ValueList); + CHECK_FOR_ERROR + ;} + break; + + case 279: +#line 2587 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with no result... + (yyval.TermInstVal) = ReturnInst::Create(); + CHECK_FOR_ERROR + ;} + break; + + case 280: +#line 2591 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Unconditional Branch... + BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 270: -#line 2532 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Do not allow functions with 0 basic blocks - yyval.FunctionVal = yyvsp[-1].FunctionVal; - CHECK_FOR_ERROR - ; - break;} -case 271: -#line 2541 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); + (yyval.TermInstVal) = BranchInst::Create(tmpBB); + ;} + break; + + case 281: +#line 2596 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR - InsertValue(yyvsp[0].TermInstVal); - yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); - yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 272: -#line 2550 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) - if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) - if (CI2->getParent() == 0) - yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); - yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); - yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 273: -#line 2559 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty space between instruction lists - yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum), 0); - CHECK_FOR_ERROR - ; - break;} -case 274: -#line 2563 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Only the unwind to block - yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum), getBBVal(yyvsp[0].ValIDVal)); - CHECK_FOR_ERROR - ; - break;} -case 275: -#line 2567 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Labelled (named) basic block - yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal), 0); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 276: -#line 2572 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[-3].StrVal), getBBVal(yyvsp[0].ValIDVal)); - delete yyvsp[-3].StrVal; + BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 277: -#line 2579 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with a result... - ValueList &VL = *yyvsp[0].ValueList; - assert(!VL.empty() && "Invalid ret operands!"); - yyval.TermInstVal = ReturnInst::Create(&VL[0], VL.size()); - delete yyvsp[0].ValueList; + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 278: -#line 2586 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with no result... - yyval.TermInstVal = ReturnInst::Create(); - CHECK_FOR_ERROR - ; - break;} -case 279: -#line 2590 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Unconditional Branch... - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TermInstVal = BranchInst::Create(tmpBB); - ; - break;} -case 280: -#line 2595 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); - CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); - CHECK_FOR_ERROR - yyval.TermInstVal = BranchInst::Create(tmpBBA, tmpBBB, tmpVal); - ; - break;} -case 281: -#line 2605 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); + (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal); + ;} + break; + + case 282: +#line 2606 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR - SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); - yyval.TermInstVal = S; + SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); + (yyval.TermInstVal) = S; - std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), - E = yyvsp[-1].JumpTable->end(); + std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), + E = (yyvsp[(8) - (9)].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete yyvsp[-1].JumpTable; + delete (yyvsp[(8) - (9)].JumpTable); CHECK_FOR_ERROR - ; - break;} -case 282: -#line 2624 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); + ;} + break; + + case 283: +#line 2625 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); CHECK_FOR_ERROR SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0); - yyval.TermInstVal = S; + (yyval.TermInstVal) = S; CHECK_FOR_ERROR - ; - break;} -case 283: -#line 2634 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 284: +#line 2635 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end(); + ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false); + Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false); PFTy = PointerType::getUnqual(Ty); } - delete yyvsp[-11].TypeVal; + delete (yyvsp[(3) - (14)].TypeVal); - Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); + BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); CHECK_FOR_ERROR SmallVector Attrs; - if (yyvsp[-6].ParamAttrs != ParamAttr::None) - Attrs.push_back(ParamAttrsWithIndex::get(0, yyvsp[-6].ParamAttrs)); + if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) + Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs))); // Check the arguments ValueList Args; - if (yyvsp[-8].ParamList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -4691,7 +5789,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end(); + ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -4720,347 +5818,375 @@ // Create the InvokeInst InvokeInst *II = InvokeInst::Create(V, Normal, Except, Args.begin(),Args.end()); - II->setCallingConv(yyvsp[-12].UIntVal); + II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); II->setParamAttrs(PAL); - yyval.TermInstVal = II; - delete yyvsp[-8].ParamList; + (yyval.TermInstVal) = II; + delete (yyvsp[(6) - (14)].ParamList); CHECK_FOR_ERROR - ; - break;} -case 284: -#line 2714 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnwindInst(); + ;} + break; + + case 285: +#line 2715 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR - ; - break;} -case 285: -#line 2718 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnreachableInst(); + ;} + break; + + case 286: +#line 2719 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR - ; - break;} -case 286: -#line 2725 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = yyvsp[-5].JumpTable; - Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + ;} + break; + + case 287: +#line 2726 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); + Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 287: -#line 2736 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = new std::vector >(); - Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 288: +#line 2737 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = new std::vector >(); + Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 288: -#line 2749 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 289: +#line 2750 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is this definition named?? if so, assign the name... - setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); + setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); CHECK_FOR_ERROR - InsertValue(yyvsp[0].InstVal); - yyval.InstVal = yyvsp[0].InstVal; + InsertValue((yyvsp[(2) - (2)].InstVal)); + (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); CHECK_FOR_ERROR - ; - break;} -case 289: -#line 2759 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Used for PHI nodes + ;} + break; + + case 290: +#line 2760 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); - yyval.PHIList = new std::list >(); - Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); - CHECK_FOR_ERROR - yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); - delete yyvsp[-5].TypeVal; - ; - break;} -case 290: -#line 2770 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.PHIList = yyvsp[-6].PHIList; - Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); + (yyval.PHIList) = new std::list >(); + Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + delete (yyvsp[(1) - (6)].TypeVal); + ;} + break; + + case 291: +#line 2771 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); + Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); CHECK_FOR_ERROR - yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); - ; - break;} -case 291: -#line 2780 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + ;} + break; + + case 292: +#line 2781 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); // Used for call and invoke instructions - yyval.ParamList = new ParamList(); - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - delete yyvsp[-3].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 292: -#line 2791 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.ParamList) = new ParamList(); + ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal)); + (yyval.ParamList)->push_back(E); + delete (yyvsp[(1) - (4)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 293: +#line 2792 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs - yyval.ParamList = new ParamList(); - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 293: -#line 2799 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.ParamList) = new ParamList(); + ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal)); + (yyval.ParamList)->push_back(E); + CHECK_FOR_ERROR + ;} + break; + + case 294: +#line 2800 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - yyval.ParamList = yyvsp[-5].ParamList; - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - delete yyvsp[-3].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 294: -#line 2809 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); + ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal)); + (yyval.ParamList)->push_back(E); + delete (yyvsp[(3) - (6)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 295: +#line 2810 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 - yyval.ParamList = yyvsp[-5].ParamList; - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 295: -#line 2816 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamList = new ParamList(); ; - break;} -case 296: -#line 2819 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueList = new std::vector(); ; - break;} -case 297: -#line 2820 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = yyvsp[-2].ValueList; - yyval.ValueList->push_back(yyvsp[0].ValueVal); + (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); + ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + (yyval.ParamList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 298: -#line 2827 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 296: +#line 2817 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamList) = new ParamList(); ;} + break; + + case 297: +#line 2820 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueList) = new std::vector(); ;} + break; + + case 298: +#line 2821 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); + (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 299: -#line 2831 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 299: +#line 2828 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 300: -#line 2836 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 300: +#line 2832 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 301: +#line 2837 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && - !isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); + if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && + !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); CHECK_FOR_ERROR - Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); - if (yyval.InstVal == 0) + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); + if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 301: -#line 2852 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 302: +#line 2853 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isInteger()) { - if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) || - !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); + if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { + if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || + !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 302: -#line 2869 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 303: +#line 2870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) GEN_ERROR("Vector types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("icmp operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 303: -#line 2883 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 304: +#line 2884 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) GEN_ERROR("Vector types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("fcmp operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 304: -#line 2897 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 305: +#line 2898 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - Value* Val = yyvsp[-2].ValueVal; - const Type* DestTy = yyvsp[0].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); + Value* Val = (yyvsp[(2) - (4)].ValueVal); + const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); - delete yyvsp[0].TypeVal; - ; - break;} -case 305: -#line 2909 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) + (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); + delete (yyvsp[(4) - (4)].TypeVal); + ;} + break; + + case 306: +#line 2910 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) + if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) GEN_ERROR("select value types should match"); - yyval.InstVal = SelectInst::Create(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 306: -#line 2917 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 307: +#line 2918 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 307: -#line 2924 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); + (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); + delete (yyvsp[(4) - (4)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 308: +#line 2925 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); - yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 308: -#line 2930 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 309: +#line 2931 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); - yyval.InstVal = InsertElementInst::Create(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 309: -#line 2936 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 310: +#line 2937 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); - yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 310: -#line 2942 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type *Ty = yyvsp[0].PHIList->front().first->getType(); + ;} + break; + + case 311: +#line 2943 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); - yyval.InstVal = PHINode::Create(Ty); - ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); - while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { - if (yyvsp[0].PHIList->front().first->getType() != Ty) + (yyval.InstVal) = PHINode::Create(Ty); + ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); + while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { + if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); - yyvsp[0].PHIList->pop_front(); + cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); + (yyvsp[(2) - (2)].PHIList)->pop_front(); } - delete yyvsp[0].PHIList; // Free the list... + delete (yyvsp[(2) - (2)].PHIList); // Free the list... CHECK_FOR_ERROR - ; - break;} -case 311: -#line 2958 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 312: +#line 2959 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end(); + ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false); + Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false); PFTy = PointerType::getUnqual(Ty); } - Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR // Check for call to invalid intrinsic to avoid crashing later. @@ -5074,11 +6200,11 @@ // Set up the ParamAttrs for the function SmallVector Attrs; - if (yyvsp[0].ParamAttrs != ParamAttr::None) - Attrs.push_back(ParamAttrsWithIndex::get(0, yyvsp[0].ParamAttrs)); + if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) + Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs))); // Check the arguments ValueList Args; - if (yyvsp[-2].ParamList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5088,7 +6214,7 @@ // correctly. Also, gather any parameter attributes. FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end(); + ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -5117,377 +6243,384 @@ // Create the call node CallInst *CI = CallInst::Create(V, Args.begin(), Args.end()); - CI->setTailCall(yyvsp[-7].BoolVal); - CI->setCallingConv(yyvsp[-6].UIntVal); + CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); + CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); CI->setParamAttrs(PAL); - yyval.InstVal = CI; - delete yyvsp[-2].ParamList; - delete yyvsp[-5].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 312: -#line 3043 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = yyvsp[0].InstVal; + (yyval.InstVal) = CI; + delete (yyvsp[(6) - (8)].ParamList); + delete (yyvsp[(3) - (8)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 313: -#line 3048 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 313: +#line 3044 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR - ; - break;} -case 314: -#line 3052 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 314: +#line 3049 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 315: -#line 3059 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 315: +#line 3053 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 316: +#line 3060 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 316: -#line 3066 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); + (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 317: +#line 3067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 317: -#line 3074 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); + ;} + break; + + case 318: +#line 3075 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 318: -#line 3081 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); + (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 319: +#line 3082 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 319: -#line 3089 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[0].ValueVal->getType())) + (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); + ;} + break; + + case 320: +#line 3090 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + - yyvsp[0].ValueVal->getType()->getDescription() + ""); - yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); + (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + ""); + (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 320: -#line 3097 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 321: +#line 3098 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (!isa(yyvsp[-2].TypeVal->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + if (!isa((yyvsp[(3) - (5)].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*yyvsp[-2].TypeVal)->getDescription()); - if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType()) + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + if (!cast((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*yyvsp[-2].TypeVal)->getDescription()); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal); - delete yyvsp[-2].TypeVal; - ; - break;} -case 321: -#line 3111 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal)); + delete (yyvsp[(3) - (5)].TypeVal); + ;} + break; + + case 322: +#line 3112 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[(5) - (7)].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*yyvsp[-2].TypeVal)->getDescription()); + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != yyvsp[-4].ValueVal->getType()) - GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + + if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal); - delete yyvsp[-2].TypeVal; - ; - break;} -case 322: -#line 3128 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value *TmpVal = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-2].ValIDVal); - if (!GetResultInst::isValidOperands(TmpVal, yyvsp[0].UInt64Val)) + (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); + delete (yyvsp[(5) - (7)].TypeVal); + ;} + break; + + case 323: +#line 3129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal)); + if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val))) GEN_ERROR("Invalid getresult operands"); - yyval.InstVal = new GetResultInst(TmpVal, yyvsp[0].UInt64Val); - delete yyvsp[-3].TypeVal; + (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val)); + delete (yyvsp[(2) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 323: -#line 3136 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 324: +#line 3137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (!isa(yyvsp[-2].TypeVal->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); + if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end(), true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*yyvsp[-2].TypeVal)->getDescription()+ "'"); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); + Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = GetElementPtrInst::Create(tmpVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end()); - delete yyvsp[-2].TypeVal; - delete yyvsp[0].ValueList; - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif + (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()); + delete (yyvsp[(2) - (4)].TypeVal); + delete (yyvsp[(4) - (4)].ValueList); + ;} + break; -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif + +/* Line 1267 of yacc.c. */ +#line 6410 "llvmAsmParser.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; -yyerrlab: /* here on detecting error */ - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + if (yyerrstatus == 3) { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; -yyerrdefault: /* current state does not do anything special for the error token. */ -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ -#if YYDEBUG != 0 - if (yydebug) + for (;;) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); #endif - } - return 1; + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 3153 "/Users/ggreif/llvm/lib/AsmParser/llvmAsmParser.y" + + +#line 3154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -5562,3 +6695,4 @@ GenerateError(errMsg); return 0; } + Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=49945&r1=49944&r2=49945&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Fri Apr 18 19:24:39 2008 @@ -1,4 +1,353 @@ -typedef union { +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + ESAPINTVAL = 260, + EUAPINTVAL = 261, + LOCALVAL_ID = 262, + GLOBALVAL_ID = 263, + FPVAL = 264, + VOID = 265, + INTTYPE = 266, + FLOAT = 267, + DOUBLE = 268, + X86_FP80 = 269, + FP128 = 270, + PPC_FP128 = 271, + LABEL = 272, + TYPE = 273, + LOCALVAR = 274, + GLOBALVAR = 275, + LABELSTR = 276, + STRINGCONSTANT = 277, + ATSTRINGCONSTANT = 278, + PCTSTRINGCONSTANT = 279, + ZEROINITIALIZER = 280, + TRUETOK = 281, + FALSETOK = 282, + BEGINTOK = 283, + ENDTOK = 284, + DECLARE = 285, + DEFINE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + ALIAS = 290, + VOLATILE = 291, + THREAD_LOCAL = 292, + TO = 293, + DOTDOTDOT = 294, + NULL_TOK = 295, + UNDEF = 296, + INTERNAL = 297, + LINKONCE = 298, + WEAK = 299, + APPENDING = 300, + DLLIMPORT = 301, + DLLEXPORT = 302, + EXTERN_WEAK = 303, + OPAQUE = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ALIGN = 308, + ADDRSPACE = 309, + DEPLIBS = 310, + CALL = 311, + TAIL = 312, + ASM_TOK = 313, + MODULE = 314, + SIDEEFFECT = 315, + CC_TOK = 316, + CCC_TOK = 317, + FASTCC_TOK = 318, + COLDCC_TOK = 319, + X86_STDCALLCC_TOK = 320, + X86_FASTCALLCC_TOK = 321, + DATALAYOUT = 322, + UNWINDS = 323, + RET = 324, + BR = 325, + SWITCH = 326, + INVOKE = 327, + UNWIND = 328, + UNREACHABLE = 329, + ADD = 330, + SUB = 331, + MUL = 332, + UDIV = 333, + SDIV = 334, + FDIV = 335, + UREM = 336, + SREM = 337, + FREM = 338, + AND = 339, + OR = 340, + XOR = 341, + SHL = 342, + LSHR = 343, + ASHR = 344, + ICMP = 345, + FCMP = 346, + EQ = 347, + NE = 348, + SLT = 349, + SGT = 350, + SLE = 351, + SGE = 352, + ULT = 353, + UGT = 354, + ULE = 355, + UGE = 356, + OEQ = 357, + ONE = 358, + OLT = 359, + OGT = 360, + OLE = 361, + OGE = 362, + ORD = 363, + UNO = 364, + UEQ = 365, + UNE = 366, + MALLOC = 367, + ALLOCA = 368, + FREE = 369, + LOAD = 370, + STORE = 371, + GETELEMENTPTR = 372, + TRUNC = 373, + ZEXT = 374, + SEXT = 375, + FPTRUNC = 376, + FPEXT = 377, + BITCAST = 378, + UITOFP = 379, + SITOFP = 380, + FPTOUI = 381, + FPTOSI = 382, + INTTOPTR = 383, + PTRTOINT = 384, + PHI_TOK = 385, + SELECT = 386, + VAARG = 387, + EXTRACTELEMENT = 388, + INSERTELEMENT = 389, + SHUFFLEVECTOR = 390, + GETRESULT = 391, + SIGNEXT = 392, + ZEROEXT = 393, + NORETURN = 394, + INREG = 395, + SRET = 396, + NOUNWIND = 397, + NOALIAS = 398, + BYVAL = 399, + NEST = 400, + READNONE = 401, + READONLY = 402, + GC = 403, + DEFAULT = 404, + HIDDEN = 405, + PROTECTED = 406 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define ESAPINTVAL 260 +#define EUAPINTVAL 261 +#define LOCALVAL_ID 262 +#define GLOBALVAL_ID 263 +#define FPVAL 264 +#define VOID 265 +#define INTTYPE 266 +#define FLOAT 267 +#define DOUBLE 268 +#define X86_FP80 269 +#define FP128 270 +#define PPC_FP128 271 +#define LABEL 272 +#define TYPE 273 +#define LOCALVAR 274 +#define GLOBALVAR 275 +#define LABELSTR 276 +#define STRINGCONSTANT 277 +#define ATSTRINGCONSTANT 278 +#define PCTSTRINGCONSTANT 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define DEFINE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define ALIAS 290 +#define VOLATILE 291 +#define THREAD_LOCAL 292 +#define TO 293 +#define DOTDOTDOT 294 +#define NULL_TOK 295 +#define UNDEF 296 +#define INTERNAL 297 +#define LINKONCE 298 +#define WEAK 299 +#define APPENDING 300 +#define DLLIMPORT 301 +#define DLLEXPORT 302 +#define EXTERN_WEAK 303 +#define OPAQUE 304 +#define EXTERNAL 305 +#define TARGET 306 +#define TRIPLE 307 +#define ALIGN 308 +#define ADDRSPACE 309 +#define DEPLIBS 310 +#define CALL 311 +#define TAIL 312 +#define ASM_TOK 313 +#define MODULE 314 +#define SIDEEFFECT 315 +#define CC_TOK 316 +#define CCC_TOK 317 +#define FASTCC_TOK 318 +#define COLDCC_TOK 319 +#define X86_STDCALLCC_TOK 320 +#define X86_FASTCALLCC_TOK 321 +#define DATALAYOUT 322 +#define UNWINDS 323 +#define RET 324 +#define BR 325 +#define SWITCH 326 +#define INVOKE 327 +#define UNWIND 328 +#define UNREACHABLE 329 +#define ADD 330 +#define SUB 331 +#define MUL 332 +#define UDIV 333 +#define SDIV 334 +#define FDIV 335 +#define UREM 336 +#define SREM 337 +#define FREM 338 +#define AND 339 +#define OR 340 +#define XOR 341 +#define SHL 342 +#define LSHR 343 +#define ASHR 344 +#define ICMP 345 +#define FCMP 346 +#define EQ 347 +#define NE 348 +#define SLT 349 +#define SGT 350 +#define SLE 351 +#define SGE 352 +#define ULT 353 +#define UGT 354 +#define ULE 355 +#define UGE 356 +#define OEQ 357 +#define ONE 358 +#define OLT 359 +#define OGT 360 +#define OLE 361 +#define OGE 362 +#define ORD 363 +#define UNO 364 +#define UEQ 365 +#define UNE 366 +#define MALLOC 367 +#define ALLOCA 368 +#define FREE 369 +#define LOAD 370 +#define STORE 371 +#define GETELEMENTPTR 372 +#define TRUNC 373 +#define ZEXT 374 +#define SEXT 375 +#define FPTRUNC 376 +#define FPEXT 377 +#define BITCAST 378 +#define UITOFP 379 +#define SITOFP 380 +#define FPTOUI 381 +#define FPTOSI 382 +#define INTTOPTR 383 +#define PTRTOINT 384 +#define PHI_TOK 385 +#define SELECT 386 +#define VAARG 387 +#define EXTRACTELEMENT 388 +#define INSERTELEMENT 389 +#define SHUFFLEVECTOR 390 +#define GETRESULT 391 +#define SIGNEXT 392 +#define ZEROEXT 393 +#define NORETURN 394 +#define INREG 395 +#define SRET 396 +#define NOUNWIND 397 +#define NOALIAS 398 +#define BYVAL 399 +#define NEST 400 +#define READNONE 401 +#define READONLY 402 +#define GC 403 +#define DEFAULT 404 +#define HIDDEN 405 +#define PROTECTED 406 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 950 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -43,156 +392,14 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define ESAPINTVAL 259 -#define EUAPINTVAL 260 -#define LOCALVAL_ID 261 -#define GLOBALVAL_ID 262 -#define FPVAL 263 -#define VOID 264 -#define INTTYPE 265 -#define FLOAT 266 -#define DOUBLE 267 -#define X86_FP80 268 -#define FP128 269 -#define PPC_FP128 270 -#define LABEL 271 -#define TYPE 272 -#define LOCALVAR 273 -#define GLOBALVAR 274 -#define LABELSTR 275 -#define STRINGCONSTANT 276 -#define ATSTRINGCONSTANT 277 -#define PCTSTRINGCONSTANT 278 -#define ZEROINITIALIZER 279 -#define TRUETOK 280 -#define FALSETOK 281 -#define BEGINTOK 282 -#define ENDTOK 283 -#define DECLARE 284 -#define DEFINE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define ALIAS 289 -#define VOLATILE 290 -#define THREAD_LOCAL 291 -#define TO 292 -#define DOTDOTDOT 293 -#define NULL_TOK 294 -#define UNDEF 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 -#define DLLIMPORT 300 -#define DLLEXPORT 301 -#define EXTERN_WEAK 302 -#define OPAQUE 303 -#define EXTERNAL 304 -#define TARGET 305 -#define TRIPLE 306 -#define ALIGN 307 -#define ADDRSPACE 308 -#define DEPLIBS 309 -#define CALL 310 -#define TAIL 311 -#define ASM_TOK 312 -#define MODULE 313 -#define SIDEEFFECT 314 -#define CC_TOK 315 -#define CCC_TOK 316 -#define FASTCC_TOK 317 -#define COLDCC_TOK 318 -#define X86_STDCALLCC_TOK 319 -#define X86_FASTCALLCC_TOK 320 -#define DATALAYOUT 321 -#define UNWINDS 322 -#define RET 323 -#define BR 324 -#define SWITCH 325 -#define INVOKE 326 -#define UNWIND 327 -#define UNREACHABLE 328 -#define ADD 329 -#define SUB 330 -#define MUL 331 -#define UDIV 332 -#define SDIV 333 -#define FDIV 334 -#define UREM 335 -#define SREM 336 -#define FREM 337 -#define AND 338 -#define OR 339 -#define XOR 340 -#define SHL 341 -#define LSHR 342 -#define ASHR 343 -#define ICMP 344 -#define FCMP 345 -#define EQ 346 -#define NE 347 -#define SLT 348 -#define SGT 349 -#define SLE 350 -#define SGE 351 -#define ULT 352 -#define UGT 353 -#define ULE 354 -#define UGE 355 -#define OEQ 356 -#define ONE 357 -#define OLT 358 -#define OGT 359 -#define OLE 360 -#define OGE 361 -#define ORD 362 -#define UNO 363 -#define UEQ 364 -#define UNE 365 -#define MALLOC 366 -#define ALLOCA 367 -#define FREE 368 -#define LOAD 369 -#define STORE 370 -#define GETELEMENTPTR 371 -#define TRUNC 372 -#define ZEXT 373 -#define SEXT 374 -#define FPTRUNC 375 -#define FPEXT 376 -#define BITCAST 377 -#define UITOFP 378 -#define SITOFP 379 -#define FPTOUI 380 -#define FPTOSI 381 -#define INTTOPTR 382 -#define PTRTOINT 383 -#define PHI_TOK 384 -#define SELECT 385 -#define VAARG 386 -#define EXTRACTELEMENT 387 -#define INSERTELEMENT 388 -#define SHUFFLEVECTOR 389 -#define GETRESULT 390 -#define SIGNEXT 391 -#define ZEROEXT 392 -#define NORETURN 393 -#define INREG 394 -#define SRET 395 -#define NOUNWIND 396 -#define NOALIAS 397 -#define BYVAL 398 -#define NEST 399 -#define READNONE 400 -#define READONLY 401 -#define GC 402 -#define DEFAULT 403 -#define HIDDEN 404 -#define PROTECTED 405 - +} +/* Line 1529 of yacc.c. */ +#line 398 "llvmAsmParser.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE llvmAsmlval; + Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=49945&r1=49944&r2=49945&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Fri Apr 18 19:24:39 2008 @@ -1351,6 +1351,7 @@ // FIXME: remove in LLVM 3.0. const Type* RetTy = *$1; if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy || + isa(RetTy) || isa(RetTy))) GEN_ERROR("LLVM Functions cannot return aggregates"); Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=49945&r1=49944&r2=49945&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Fri Apr 18 19:24:39 2008 @@ -1351,6 +1351,7 @@ // FIXME: remove in LLVM 3.0. const Type* RetTy = *$1; if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy || + isa(RetTy) || isa(RetTy))) GEN_ERROR("LLVM Functions cannot return aggregates"); Added: llvm/trunk/test/Assembler/MultipleReturnValueType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/MultipleReturnValueType.ll?rev=49945&view=auto ============================================================================== --- llvm/trunk/test/Assembler/MultipleReturnValueType.ll (added) +++ llvm/trunk/test/Assembler/MultipleReturnValueType.ll Fri Apr 18 19:24:39 2008 @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s + + %struct.S_102 = type { float, float } + +declare %struct.S_102 @f_102() nounwind + + at callthis = external global void ()* ; [#uses=50] + + +define void @foo() { + store void ()* bitcast (%struct.S_102 ()* @f_102 to void ()*), void ()** @callthis, align 8 + ret void +} From evan.cheng at apple.com Fri Apr 18 20:20:31 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Apr 2008 01:20:31 -0000 Subject: [llvm-commits] [llvm] r49946 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200804190120.m3J1KWop020470@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 20:20:30 2008 New Revision: 49946 URL: http://llvm.org/viewvc/llvm-project?rev=49946&view=rev Log: xchg which references a memory operand does not need to lock prefix. Atomicity is guaranteed. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49946&r1=49945&r2=49946&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Fri Apr 18 20:20:30 2008 @@ -2543,6 +2543,21 @@ // Atomic support // +// Atomic swap. These are just normal xchg instructions. But since a memory +// operand is referenced, the atomicity is ensured. +let Constraints = "$val = $dst", Defs = [EFLAGS] in { +def XCHG32rm : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), + "xchg{l}\t{$val, $ptr|$ptr, $val}", + [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>; +def XCHG16rm : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), + "xchg{w}\t{$val, $ptr|$ptr, $val}", + [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, + OpSize; +def XCHG8rm : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), + "xchg{b}\t{$val, $ptr|$ptr, $val}", + [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>; +} + // Atomic compare and swap. let Defs = [EAX, EFLAGS], Uses = [EAX] in { def LCMPXCHG32 : I<0xB1, MRMDestMem, (outs), (ins i32mem:$ptr, GR32:$swap), @@ -2566,20 +2581,6 @@ [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK; } -// Atomic swap -let Constraints = "$val = $dst", Defs = [EFLAGS] in { -def LXCHG32 : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), - "lock xchg{l}\t{$val, $ptr|$ptr, $val}", - [(set GR32:$dst, (atomic_swap_32 addr:$ptr, GR32:$val))]>, LOCK; -def LXCHG16 : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val), - "lock xchg{w}\t{$val, $ptr|$ptr, $val}", - [(set GR16:$dst, (atomic_swap_16 addr:$ptr, GR16:$val))]>, - OpSize, LOCK; -def LXCHG8 : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val), - "lock xchg{b}\t{$val, $ptr|$ptr, $val}", - [(set GR8:$dst, (atomic_swap_8 addr:$ptr, GR8:$val))]>, LOCK; -} - // Atomic exchange and add let Constraints = "$val = $dst", Defs = [EFLAGS] in { def LXADD32 : I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val), From gohman at apple.com Fri Apr 18 20:25:40 2008 From: gohman at apple.com (Dan Gohman) Date: Fri, 18 Apr 2008 18:25:40 -0700 Subject: [llvm-commits] [llvm] r49946 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <200804190120.m3J1KWop020470@zion.cs.uiuc.edu> References: <200804190120.m3J1KWop020470@zion.cs.uiuc.edu> Message-ID: <3D992165-956F-4171-A854-0B01359C0EEB@apple.com> Don't forget about LXCHG64! Dan On Apr 18, 2008, at 6:20 PM, Evan Cheng wrote: > Author: evancheng > Date: Fri Apr 18 20:20:30 2008 > New Revision: 49946 > > URL: http://llvm.org/viewvc/llvm-project?rev=49946&view=rev > Log: > xchg which references a memory operand does not need to lock prefix. > Atomicity is guaranteed. > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=49946&r1=49945&r2=49946&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Fri Apr 18 20:20:30 2008 > @@ -2543,6 +2543,21 @@ > // Atomic support > // > > +// Atomic swap. These are just normal xchg instructions. But since > a memory > +// operand is referenced, the atomicity is ensured. > +let Constraints = "$val = $dst", Defs = [EFLAGS] in { > +def XCHG32rm : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem: > $ptr, GR32:$val), > + "xchg{l}\t{$val, $ptr|$ptr, $val}", > + [(set GR32:$dst, (atomic_swap_32 addr:$ptr, > GR32:$val))]>; > +def XCHG16rm : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem: > $ptr, GR16:$val), > + "xchg{w}\t{$val, $ptr|$ptr, $val}", > + [(set GR16:$dst, (atomic_swap_16 addr:$ptr, > GR16:$val))]>, > + OpSize; > +def XCHG8rm : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, > GR8:$val), > + "xchg{b}\t{$val, $ptr|$ptr, $val}", > + [(set GR8:$dst, (atomic_swap_8 addr:$ptr, > GR8:$val))]>; > +} > + > // Atomic compare and swap. > let Defs = [EAX, EFLAGS], Uses = [EAX] in { > def LCMPXCHG32 : I<0xB1, MRMDestMem, (outs), (ins i32mem:$ptr, > GR32:$swap), > @@ -2566,20 +2581,6 @@ > [(X86cas addr:$ptr, GR8:$swap, 1)]>, TB, LOCK; > } > > -// Atomic swap > -let Constraints = "$val = $dst", Defs = [EFLAGS] in { > -def LXCHG32 : I<0x87, MRMSrcMem, (outs GR32:$dst), (ins i32mem: > $ptr, GR32:$val), > - "lock xchg{l}\t{$val, $ptr|$ptr, $val}", > - [(set GR32:$dst, (atomic_swap_32 addr:$ptr, > GR32:$val))]>, LOCK; > -def LXCHG16 : I<0x87, MRMSrcMem, (outs GR16:$dst), (ins i16mem: > $ptr, GR16:$val), > - "lock xchg{w}\t{$val, $ptr|$ptr, $val}", > - [(set GR16:$dst, (atomic_swap_16 addr:$ptr, > GR16:$val))]>, > - OpSize, LOCK; > -def LXCHG8 : I<0x86, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, > GR8:$val), > - "lock xchg{b}\t{$val, $ptr|$ptr, $val}", > - [(set GR8:$dst, (atomic_swap_8 addr:$ptr, > GR8:$val))]>, LOCK; > -} > - > // Atomic exchange and add > let Constraints = "$val = $dst", Defs = [EFLAGS] in { > def LXADD32 : I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, > GR32:$val), > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Fri Apr 18 20:30:48 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Apr 2008 01:30:48 -0000 Subject: [llvm-commits] [llvm] r49947 - in /llvm/trunk/lib/Target/PowerPC: PPCISelLowering.cpp PPCISelLowering.h PPCInstrInfo.td Message-ID: <200804190130.m3J1UmXs020747@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 20:30:48 2008 New Revision: 49947 URL: http://llvm.org/viewvc/llvm-project?rev=49947&view=rev Log: PPC32 atomic operations. Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49947&r1=49946&r2=49947&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Apr 18 20:30:48 2008 @@ -39,7 +39,8 @@ cl::Hidden); PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) - : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) { + : TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()), + PPCAtomicLabelIndex(0) { setPow2DivIsCheap(); @@ -202,6 +203,10 @@ setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Custom); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64 , Custom); + setOperationAction(ISD::ATOMIC_LAS , MVT::i32 , Custom); + setOperationAction(ISD::ATOMIC_LCS , MVT::i32 , Custom); + setOperationAction(ISD::ATOMIC_SWAP , MVT::i32 , Custom); + // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); @@ -393,6 +398,9 @@ case PPCISD::VCMPo: return "PPCISD::VCMPo"; case PPCISD::LBRX: return "PPCISD::LBRX"; case PPCISD::STBRX: return "PPCISD::STBRX"; + case PPCISD::LWARX: return "PPCISD::LWARX"; + case PPCISD::STWCX: return "PPCISD::STWCX"; + case PPCISD::CMP_UNRESERVE: return "PPCISD::CMP_UNRESERVE"; case PPCISD::COND_BRANCH: return "PPCISD::COND_BRANCH"; case PPCISD::MFFS: return "PPCISD::MFFS"; case PPCISD::MTFSB0: return "PPCISD::MTFSB0"; @@ -2295,6 +2303,117 @@ return DAG.getNode(PPCISD::DYNALLOC, VTs, Ops, 3); } +SDOperand PPCTargetLowering::LowerAtomicLAS(SDOperand Op, SelectionDAG &DAG) { + MVT::ValueType VT = Op.getValueType(); + SDOperand Chain = Op.getOperand(0); + SDOperand Ptr = Op.getOperand(1); + SDOperand Incr = Op.getOperand(2); + + // Issue a "load and reserve". + std::vector VTs; + VTs.push_back(VT); + VTs.push_back(MVT::Other); + + SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); + SDOperand Ops[] = { + Chain, // Chain + Ptr, // Ptr + Label, // Label + }; + SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + Chain = Load.getValue(1); + + // Compute new value. + SDOperand NewVal = DAG.getNode(ISD::ADD, VT, Load, Incr); + + // Issue a "store and check". + SDOperand Ops2[] = { + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label + }; + SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops2, 4); + SDOperand OutOps[] = { Load, Store }; + return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), + OutOps, 2); +} + +SDOperand PPCTargetLowering::LowerAtomicLCS(SDOperand Op, SelectionDAG &DAG) { + MVT::ValueType VT = Op.getValueType(); + SDOperand Chain = Op.getOperand(0); + SDOperand Ptr = Op.getOperand(1); + SDOperand NewVal = Op.getOperand(2); + SDOperand OldVal = Op.getOperand(3); + + // Issue a "load and reserve". + std::vector VTs; + VTs.push_back(VT); + VTs.push_back(MVT::Other); + + SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); + SDOperand Ops[] = { + Chain, // Chain + Ptr, // Ptr + Label, // Label + }; + SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + Chain = Load.getValue(1); + + // Compare and unreserve if not equal. + SDOperand Ops2[] = { + Chain, // Chain + OldVal, // Old value + Load, // Value in memory + Label, // Label + }; + Chain = DAG.getNode(PPCISD::CMP_UNRESERVE, MVT::Other, Ops2, 4); + + // Issue a "store and check". + SDOperand Ops3[] = { + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label + }; + SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops3, 4); + SDOperand OutOps[] = { Load, Store }; + return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), + OutOps, 2); +} + +SDOperand PPCTargetLowering::LowerAtomicSWAP(SDOperand Op, SelectionDAG &DAG) { + MVT::ValueType VT = Op.getValueType(); + SDOperand Chain = Op.getOperand(0); + SDOperand Ptr = Op.getOperand(1); + SDOperand NewVal = Op.getOperand(2); + + // Issue a "load and reserve". + std::vector VTs; + VTs.push_back(VT); + VTs.push_back(MVT::Other); + + SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); + SDOperand Ops[] = { + Chain, // Chain + Ptr, // Ptr + Label, // Label + }; + SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + Chain = Load.getValue(1); + + // Issue a "store and check". + SDOperand Ops2[] = { + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label + }; + SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops2, 4); + SDOperand OutOps[] = { Load, Store }; + return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), + OutOps, 2); +} /// LowerSELECT_CC - Lower floating point select_cc's into fsel instruction when /// possible. @@ -3404,6 +3523,10 @@ case ISD::STACKRESTORE: return LowerSTACKRESTORE(Op, DAG, PPCSubTarget); case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG, PPCSubTarget); + + case ISD::ATOMIC_LAS: return LowerAtomicLAS(Op, DAG); + case ISD::ATOMIC_LCS: return LowerAtomicLCS(Op, DAG); + case ISD::ATOMIC_SWAP: return LowerAtomicSWAP(Op, DAG); case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG); case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h?rev=49947&r1=49946&r2=49947&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Fri Apr 18 20:30:48 2008 @@ -150,7 +150,19 @@ FADDRTZ, /// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR. - MTFSF + MTFSF, + + /// LWARX = This corresponds to PPC lwarx instrcution: load word and + /// reserve indexed. This is used to implement atomic operations. + LWARX, + + /// STWCX = This corresponds to PPC stwcx. instrcution: store word + /// conditional indexed. This is used to implement atomic operations. + STWCX, + + /// CMP_UNRESERVE = Test for equality and "unreserve" if not true. This + /// is used to implement atomic operations. + CMP_UNRESERVE }; } @@ -296,6 +308,11 @@ /// the offset of the target addressing mode. virtual bool isLegalAddressImmediate(GlobalValue *GV) const; + private: + /// PPCAtomicLabelIndex - Keep track the number of PPC atomic labels. + /// + unsigned PPCAtomicLabelIndex; + SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG); SDOperand LowerFRAMEADDR(SDOperand Op, SelectionDAG &DAG); SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG); @@ -324,6 +341,9 @@ SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget); SDOperand LowerSELECT_CC(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerAtomicLAS(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerAtomicLCS(SDOperand Op, SelectionDAG &DAG); + SDOperand LowerAtomicSWAP(SDOperand Op, SelectionDAG &DAG); SDOperand LowerFP_TO_SINT(SDOperand Op, SelectionDAG &DAG); SDOperand LowerSINT_TO_FP(SDOperand Op, SelectionDAG &DAG); SDOperand LowerFP_ROUND_INREG(SDOperand Op, SelectionDAG &DAG); Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=49947&r1=49946&r2=49947&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Fri Apr 18 20:30:48 2008 @@ -42,6 +42,16 @@ SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>, SDTCisVT<3, OtherVT> ]>; +def SDT_PPClwarx : SDTypeProfile<1, 2, [ + SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32> +]>; +def SDT_PPCstwcx : SDTypeProfile<0, 3, [ + SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32> +]>; +def SDT_PPCcmp_unres : SDTypeProfile<0, 3, [ + SDTCisVT<0, i32>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2> +]>; + //===----------------------------------------------------------------------===// // PowerPC specific DAG Nodes. // @@ -122,6 +132,13 @@ def PPCstbrx : SDNode<"PPCISD::STBRX", SDT_PPCstbrx, [SDNPHasChain, SDNPMayStore]>; +def PPClwarx : SDNode<"PPCISD::LWARX", SDT_PPClwarx, + [SDNPHasChain, SDNPMayLoad]>; +def PPCstwcx : SDNode<"PPCISD::STWCX", SDT_PPCstwcx, + [SDNPHasChain, SDNPMayStore]>; +def PPCcmp_unres : SDNode<"PPCISD::CMP_UNRESERVE", SDT_PPCcmp_unres, + [SDNPHasChain]>; + // Instructions to support dynamic alloca. def SDTDynOp : SDTypeProfile<1, 2, []>; def PPCdynalloc : SDNode<"PPCISD::DYNALLOC", SDTDynOp, [SDNPHasChain]>; @@ -462,6 +479,24 @@ "dcbzl $dst", LdStDCBF, [(int_ppc_dcbzl xoaddr:$dst)]>, PPC970_DGroup_Single; +// Atomic operations. +def LWARX : Pseudo<(outs GPRC:$rD), (ins memrr:$ptr, i32imm:$label), + "\nLa${label}_entry:\n\tlwarx $rD, $ptr", + [(set GPRC:$rD, (PPClwarx xoaddr:$ptr, imm:$label))]>; + +let Defs = [CR0] in { +def STWCX : Pseudo<(outs), (ins GPRC:$rS, memrr:$dst, i32imm:$label), + "stwcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:", + [(PPCstwcx GPRC:$rS, xoaddr:$dst, imm:$label)]>; + +def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:$label), + "cmpw $rA, $rB\n\tbne- La${label}_exit", + [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:$label)]>; +def CMP_UNRESwi : Pseudo<(outs), (ins GPRC:$rA, s16imm:$imm, i32imm:$label), + "cmpwi $rA, $imm\n\tbne- La${label}_exit", + [(PPCcmp_unres GPRC:$rA, imm:$imm, imm:$label)]>; +} + //===----------------------------------------------------------------------===// // PPC32 Load Instructions. // @@ -1229,5 +1264,9 @@ def : Pat<(extloadf32 xaddr:$src), (FMRSD (LFSX xaddr:$src))>; +// Atomic operations +def : Pat<(PPCcmp_unres imm:$imm, GPRC:$rA, imm:$label), + (CMP_UNRESwi GPRC:$rA, imm:$imm, imm:$label)>; + include "PPCInstrAltivec.td" include "PPCInstr64Bit.td" From evan.cheng at apple.com Fri Apr 18 21:05:42 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Apr 2008 02:05:42 -0000 Subject: [llvm-commits] [llvm] r49948 - /llvm/trunk/lib/Target/X86/X86Instr64bit.td Message-ID: <200804190205.m3J25gNA021723@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 21:05:42 2008 New Revision: 49948 URL: http://llvm.org/viewvc/llvm-project?rev=49948&view=rev Log: Also LXCHG64 -> XCHG64rm. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=49948&r1=49947&r2=49948&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Fri Apr 18 21:05:42 2008 @@ -1118,9 +1118,9 @@ "lock xadd $val, $ptr", [(set GR64:$dst, (atomic_las_64 addr:$ptr, GR64:$val))]>, TB, LOCK; -def LXCHG64 : RI<0x87, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val), - "lock xchg $val, $ptr", - [(set GR64:$dst, (atomic_swap_64 addr:$ptr, GR64:$val))]>, LOCK; +def XCHG64rm : RI<0x87, MRMSrcMem, (outs GR64:$dst), (ins i64mem:$ptr,GR64:$val), + "xchg $val, $ptr", + [(set GR64:$dst, (atomic_swap_64 addr:$ptr, GR64:$val))]>; } From evan.cheng at apple.com Fri Apr 18 21:30:38 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Apr 2008 02:30:38 -0000 Subject: [llvm-commits] [llvm] r49949 - in /llvm/trunk: lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCISelLowering.h lib/Target/PowerPC/PPCInstr64Bit.td lib/Target/PowerPC/PPCInstrInfo.td test/CodeGen/PowerPC/atomic-1.ll test/CodeGen/PowerPC/atomic-2.ll Message-ID: <200804190230.m3J2UcCj022466@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 21:30:38 2008 New Revision: 49949 URL: http://llvm.org/viewvc/llvm-project?rev=49949&view=rev Log: 64-bit atomic operations. Added: llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll llvm/trunk/test/CodeGen/PowerPC/atomic-2.ll Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=49949&r1=49948&r2=49949&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Fri Apr 18 21:30:38 2008 @@ -206,6 +206,11 @@ setOperationAction(ISD::ATOMIC_LAS , MVT::i32 , Custom); setOperationAction(ISD::ATOMIC_LCS , MVT::i32 , Custom); setOperationAction(ISD::ATOMIC_SWAP , MVT::i32 , Custom); + if (TM.getSubtarget().has64BitSupport()) { + setOperationAction(ISD::ATOMIC_LAS , MVT::i64 , Custom); + setOperationAction(ISD::ATOMIC_LCS , MVT::i64 , Custom); + setOperationAction(ISD::ATOMIC_SWAP , MVT::i64 , Custom); + } // We want to custom lower some of our intrinsics. setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); @@ -398,8 +403,8 @@ case PPCISD::VCMPo: return "PPCISD::VCMPo"; case PPCISD::LBRX: return "PPCISD::LBRX"; case PPCISD::STBRX: return "PPCISD::STBRX"; - case PPCISD::LWARX: return "PPCISD::LWARX"; - case PPCISD::STWCX: return "PPCISD::STWCX"; + case PPCISD::LARX: return "PPCISD::LARX"; + case PPCISD::STCX: return "PPCISD::STCX"; case PPCISD::CMP_UNRESERVE: return "PPCISD::CMP_UNRESERVE"; case PPCISD::COND_BRANCH: return "PPCISD::COND_BRANCH"; case PPCISD::MFFS: return "PPCISD::MFFS"; @@ -2304,7 +2309,7 @@ } SDOperand PPCTargetLowering::LowerAtomicLAS(SDOperand Op, SelectionDAG &DAG) { - MVT::ValueType VT = Op.getValueType(); + MVT::ValueType VT = Op.Val->getValueType(0); SDOperand Chain = Op.getOperand(0); SDOperand Ptr = Op.getOperand(1); SDOperand Incr = Op.getOperand(2); @@ -2316,11 +2321,11 @@ SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); SDOperand Ops[] = { - Chain, // Chain - Ptr, // Ptr - Label, // Label + Chain, // Chain + Ptr, // Ptr + Label, // Label }; - SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3); Chain = Load.getValue(1); // Compute new value. @@ -2328,19 +2333,19 @@ // Issue a "store and check". SDOperand Ops2[] = { - Chain, // Chain - NewVal, // Value - Ptr, // Ptr - Label, // Label + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label }; - SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops2, 4); + SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops2, 4); SDOperand OutOps[] = { Load, Store }; return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), OutOps, 2); } SDOperand PPCTargetLowering::LowerAtomicLCS(SDOperand Op, SelectionDAG &DAG) { - MVT::ValueType VT = Op.getValueType(); + MVT::ValueType VT = Op.Val->getValueType(0); SDOperand Chain = Op.getOperand(0); SDOperand Ptr = Op.getOperand(1); SDOperand NewVal = Op.getOperand(2); @@ -2353,37 +2358,37 @@ SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); SDOperand Ops[] = { - Chain, // Chain - Ptr, // Ptr - Label, // Label + Chain, // Chain + Ptr, // Ptr + Label, // Label }; - SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3); Chain = Load.getValue(1); // Compare and unreserve if not equal. SDOperand Ops2[] = { - Chain, // Chain - OldVal, // Old value - Load, // Value in memory - Label, // Label + Chain, // Chain + OldVal, // Old value + Load, // Value in memory + Label, // Label }; Chain = DAG.getNode(PPCISD::CMP_UNRESERVE, MVT::Other, Ops2, 4); // Issue a "store and check". SDOperand Ops3[] = { - Chain, // Chain - NewVal, // Value - Ptr, // Ptr - Label, // Label + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label }; - SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops3, 4); + SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops3, 4); SDOperand OutOps[] = { Load, Store }; return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), OutOps, 2); } SDOperand PPCTargetLowering::LowerAtomicSWAP(SDOperand Op, SelectionDAG &DAG) { - MVT::ValueType VT = Op.getValueType(); + MVT::ValueType VT = Op.Val->getValueType(0); SDOperand Chain = Op.getOperand(0); SDOperand Ptr = Op.getOperand(1); SDOperand NewVal = Op.getOperand(2); @@ -2395,21 +2400,21 @@ SDOperand Label = DAG.getConstant(PPCAtomicLabelIndex++, MVT::i32); SDOperand Ops[] = { - Chain, // Chain - Ptr, // Ptr - Label, // Label + Chain, // Chain + Ptr, // Ptr + Label, // Label }; - SDOperand Load = DAG.getNode(PPCISD::LWARX, VTs, Ops, 3); + SDOperand Load = DAG.getNode(PPCISD::LARX, VTs, Ops, 3); Chain = Load.getValue(1); // Issue a "store and check". SDOperand Ops2[] = { - Chain, // Chain - NewVal, // Value - Ptr, // Ptr - Label, // Label + Chain, // Chain + NewVal, // Value + Ptr, // Ptr + Label, // Label }; - SDOperand Store = DAG.getNode(PPCISD::STWCX, MVT::Other, Ops2, 4); + SDOperand Store = DAG.getNode(PPCISD::STCX, MVT::Other, Ops2, 4); SDOperand OutOps[] = { Load, Store }; return DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other), OutOps, 2); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h?rev=49949&r1=49948&r2=49949&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Fri Apr 18 21:30:38 2008 @@ -152,13 +152,13 @@ /// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR. MTFSF, - /// LWARX = This corresponds to PPC lwarx instrcution: load word and + /// LARX = This corresponds to PPC l{w|d}arx instrcution: load and /// reserve indexed. This is used to implement atomic operations. - LWARX, + LARX, - /// STWCX = This corresponds to PPC stwcx. instrcution: store word - /// conditional indexed. This is used to implement atomic operations. - STWCX, + /// STCX = This corresponds to PPC stcx. instrcution: store conditional + /// indexed. This is used to implement atomic operations. + STCX, /// CMP_UNRESERVE = Test for equality and "unreserve" if not true. This /// is used to implement atomic operations. Modified: llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td?rev=49949&r1=49948&r2=49949&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td Fri Apr 18 21:30:38 2008 @@ -116,6 +116,25 @@ def : Pat<(PPCcall_ELF (i64 texternalsym:$dst)), (BL8_ELF texternalsym:$dst)>; + +// Atomic operations. +def LDARX : Pseudo<(outs G8RC:$rD), (ins memrr:$ptr, i32imm:$label), + "\nLa${label}_entry:\n\tldarx $rD, $ptr", + [(set G8RC:$rD, (PPClarx xoaddr:$ptr, imm:$label))]>; + +let Defs = [CR0] in { +def STDCX : Pseudo<(outs), (ins G8RC:$rS, memrr:$dst, i32imm:$label), + "stdcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:", + [(PPCstcx G8RC:$rS, xoaddr:$dst, imm:$label)]>; + +def CMP_UNRESd : Pseudo<(outs), (ins G8RC:$rA, G8RC:$rB, i32imm:$label), + "cmpd $rA, $rB\n\tbne- La${label}_exit", + [(PPCcmp_unres G8RC:$rA, G8RC:$rB, imm:$label)]>; +def CMP_UNRESdi : Pseudo<(outs), (ins G8RC:$rA, s16imm64:$imm, i32imm:$label), + "cmpdi $rA, $imm\n\tbne- La${label}_exit", + [(PPCcmp_unres G8RC:$rA, immSExt16:$imm, imm:$label)]>; +} + //===----------------------------------------------------------------------===// // 64-bit SPR manipulation instrs. Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=49949&r1=49948&r2=49949&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Fri Apr 18 21:30:38 2008 @@ -42,14 +42,14 @@ SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, OtherVT>, SDTCisVT<3, OtherVT> ]>; -def SDT_PPClwarx : SDTypeProfile<1, 2, [ - SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32> +def SDT_PPClarx : SDTypeProfile<1, 2, [ + SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisVT<2, i32> ]>; -def SDT_PPCstwcx : SDTypeProfile<0, 3, [ - SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32> +def SDT_PPCstcx : SDTypeProfile<0, 3, [ + SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisVT<2, i32> ]>; def SDT_PPCcmp_unres : SDTypeProfile<0, 3, [ - SDTCisVT<0, i32>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2> + SDTCisSameAs<0, 1>, SDTCisInt<1>, SDTCisVT<2, i32> ]>; //===----------------------------------------------------------------------===// @@ -132,10 +132,10 @@ def PPCstbrx : SDNode<"PPCISD::STBRX", SDT_PPCstbrx, [SDNPHasChain, SDNPMayStore]>; -def PPClwarx : SDNode<"PPCISD::LWARX", SDT_PPClwarx, - [SDNPHasChain, SDNPMayLoad]>; -def PPCstwcx : SDNode<"PPCISD::STWCX", SDT_PPCstwcx, - [SDNPHasChain, SDNPMayStore]>; +def PPClarx : SDNode<"PPCISD::LARX", SDT_PPClarx, + [SDNPHasChain, SDNPMayLoad]>; +def PPCstcx : SDNode<"PPCISD::STCX", SDT_PPCstcx, + [SDNPHasChain, SDNPMayStore]>; def PPCcmp_unres : SDNode<"PPCISD::CMP_UNRESERVE", SDT_PPCcmp_unres, [SDNPHasChain]>; @@ -482,19 +482,19 @@ // Atomic operations. def LWARX : Pseudo<(outs GPRC:$rD), (ins memrr:$ptr, i32imm:$label), "\nLa${label}_entry:\n\tlwarx $rD, $ptr", - [(set GPRC:$rD, (PPClwarx xoaddr:$ptr, imm:$label))]>; + [(set GPRC:$rD, (PPClarx xoaddr:$ptr, imm:$label))]>; let Defs = [CR0] in { def STWCX : Pseudo<(outs), (ins GPRC:$rS, memrr:$dst, i32imm:$label), - "stwcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:", - [(PPCstwcx GPRC:$rS, xoaddr:$dst, imm:$label)]>; + "stwcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:", + [(PPCstcx GPRC:$rS, xoaddr:$dst, imm:$label)]>; def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:$label), "cmpw $rA, $rB\n\tbne- La${label}_exit", [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:$label)]>; def CMP_UNRESwi : Pseudo<(outs), (ins GPRC:$rA, s16imm:$imm, i32imm:$label), "cmpwi $rA, $imm\n\tbne- La${label}_exit", - [(PPCcmp_unres GPRC:$rA, imm:$imm, imm:$label)]>; + [(PPCcmp_unres GPRC:$rA, immSExt16:$imm, imm:$label)]>; } //===----------------------------------------------------------------------===// @@ -1265,8 +1265,8 @@ (FMRSD (LFSX xaddr:$src))>; // Atomic operations -def : Pat<(PPCcmp_unres imm:$imm, GPRC:$rA, imm:$label), - (CMP_UNRESwi GPRC:$rA, imm:$imm, imm:$label)>; +def : Pat<(PPCcmp_unres immSExt16:$imm, GPRC:$rA, imm:$label), + (CMP_UNRESwi GPRC:$rA, immSExt16:$imm, imm:$label)>; include "PPCInstrAltivec.td" include "PPCInstr64Bit.td" Added: llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll?rev=49949&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/atomic-1.ll Fri Apr 18 21:30:38 2008 @@ -0,0 +1,27 @@ +; RUN: llvm-as < %s | llc -march=ppc32 | grep lwarx | count 4 +; RUN: llvm-as < %s | llc -march=ppc32 | grep stwcx. | count 4 + +define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind { + %tmp = call i32 @llvm.atomic.las.i32( i32* %mem, i32 %val ) + ret i32 %tmp +} + +define i32 @exchange_and_cmp(i32* %mem) nounwind { + %tmp = call i32 @llvm.atomic.lcs.i32( i32* %mem, i32 0, i32 1 ) + ret i32 %tmp +} + +define i16 @exchange_and_cmp16(i16* %mem) nounwind { + %tmp = call i16 @llvm.atomic.lcs.i16( i16* %mem, i16 0, i16 1 ) + ret i16 %tmp +} + +define i32 @exchange(i32* %mem, i32 %val) nounwind { + %tmp = call i32 @llvm.atomic.swap.i32( i32* %mem, i32 1 ) + ret i32 %tmp +} + +declare i32 @llvm.atomic.las.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.lcs.i32(i32*, i32, i32) nounwind +declare i16 @llvm.atomic.lcs.i16(i16*, i16, i16) nounwind +declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind Added: llvm/trunk/test/CodeGen/PowerPC/atomic-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/atomic-2.ll?rev=49949&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/atomic-2.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/atomic-2.ll Fri Apr 18 21:30:38 2008 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | llc -march=ppc64 | grep ldarx | count 3 +; RUN: llvm-as < %s | llc -march=ppc64 | grep stdcx. | count 3 + +define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind { + %tmp = call i64 @llvm.atomic.las.i64( i64* %mem, i64 %val ) + ret i64 %tmp +} + +define i64 @exchange_and_cmp(i64* %mem) nounwind { + %tmp = call i64 @llvm.atomic.lcs.i64( i64* %mem, i64 0, i64 1 ) + ret i64 %tmp +} + +define i64 @exchange(i64* %mem, i64 %val) nounwind { + %tmp = call i64 @llvm.atomic.swap.i64( i64* %mem, i64 1 ) + ret i64 %tmp +} + +declare i64 @llvm.atomic.las.i64(i64*, i64) nounwind +declare i64 @llvm.atomic.lcs.i64(i64*, i64, i64) nounwind +declare i64 @llvm.atomic.swap.i64(i64*, i64) nounwind From evan.cheng at apple.com Fri Apr 18 22:33:01 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Sat, 19 Apr 2008 03:33:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r49950 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200804190333.m3J3X18A024345@zion.cs.uiuc.edu> Author: evancheng Date: Fri Apr 18 22:32:59 2008 New Revision: 49950 URL: http://llvm.org/viewvc/llvm-project?rev=49950&view=rev Log: Enable PPC atomic operations codegen. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp 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=49950&r1=49949&r2=49950&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Apr 18 22:32:59 2008 @@ -4351,7 +4351,7 @@ C, C + 5); return true; } -#if defined(TARGET_ALPHA) || defined(TARGET_386) +#if defined(TARGET_ALPHA) || defined(TARGET_386) || defined(TARGET_POWERPC) //gcc uses many names for the sync intrinsics case BUILT_IN_VAL_COMPARE_AND_SWAP_1: case BUILT_IN_VAL_COMPARE_AND_SWAP_2: From clattner at apple.com Fri Apr 18 22:34:59 2008 From: clattner at apple.com (Chris Lattner) Date: Fri, 18 Apr 2008 20:34:59 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r49950 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200804190333.m3J3X18A024345@zion.cs.uiuc.edu> References: <200804190333.m3J3X18A024345@zion.cs.uiuc.edu> Message-ID: <82384CFB-26BC-4427-9EFF-F99C83840B2A@apple.com> On Apr 18, 2008, at 8:33 PM, Evan Cheng wrote: > Author: evancheng > Date: Fri Apr 18 22:32:59 2008 > New Revision: 49950 > > URL: http://llvm.org/viewvc/llvm-project?rev=49950&view=rev > Log: > Enable PPC atomic operations codegen. Nice! -Chris > > > Modified: > llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp > > 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=49950&r1=49949&r2=49950&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Apr 18 22:32:59 2008 > @@ -4351,7 +4351,7 @@ > C, C + 5); > return true; > } > -#if defined(TARGET_ALPHA) || defined(TARGET_386) > +#if defined(TARGET_ALPHA) || defined(TARGET_386) || > defined(TARGET_POWERPC) > //gcc uses many names for the sync intrinsics > case BUILT_IN_VAL_COMPARE_AND_SWAP_1: > case BUILT_IN_VAL_COMPARE_AND_SWAP_2: > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicholas at mxc.ca Fri Apr 18 23:27:09 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Fri, 18 Apr 2008 21:27:09 -0700 Subject: [llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> References: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> Message-ID: <4809749D.80207@mxc.ca> Hi Dale, I don't think this is right. The correct fix is to replace getNegativeSCEV with getNotSCEV. Nick Dale Johannesen wrote: > Author: johannes > Date: Fri Apr 18 16:38:31 2008 > New Revision: 49928 > > URL: http://llvm.org/viewvc/llvm-project?rev=49928&view=rev > Log: > Fix a scalar evolution bug. Reversing everything > does not work because of 0; 2>0 but -2U is also >0. > > > Modified: > llvm/trunk/lib/Analysis/ScalarEvolution.cpp > > Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49928&r1=49927&r2=49928&view=diff > > ============================================================================== > --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) > +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 18 16:38:31 2008 > @@ -1980,8 +1980,7 @@ > break; > } > case ICmpInst::ICMP_UGT: { > - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), > - SE.getNegativeSCEV(RHS), L, false); > + SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L); > if (!isa(TC)) return TC; > break; > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From romix.llvm at googlemail.com Sat Apr 19 01:04:38 2008 From: romix.llvm at googlemail.com (Roman Levenstein) Date: Sat, 19 Apr 2008 10:04:38 +0400 Subject: [llvm-commits] Speeding up instruction selection In-Reply-To: <46F54225-290F-47D6-979B-2817F6FA429B@apple.com> References: <1C1F9E6C-5B8E-4667-A119-4590F340FDE7@apple.com> <83CD954F-CD49-4D4B-950D-B6CB6CD1B32D@apple.com> <417E9823-6AF6-44B0-83FD-89F0CC079B6A@apple.com> <3F534552-8033-40A3-8E0A-733516299939@apple.com> <46F54225-290F-47D6-979B-2817F6FA429B@apple.com> Message-ID: Hi Dan, Hi Evan, 2008/4/19, Dan Gohman : > > On Apr 16, 2008, at 9:19 AM, Roman Levenstein wrote: > > > > > BTW, Dan, have you had any time to look at the patch introducing > > queues instead of heaps in the target specific instruction selectors? > > > Is this the ScheduleDAGRRList patch that changes std::priority_queue > to std::set? I know you checked in part of those changes already; > could you send me an updated patch with just the outstanding changes? No. I don't mean the ScheduleDAGRRList.pacth. For this one, I proposed the remaining patch just with the outstanding patches yesterday (see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080414/061236.html). And it is also about using the std::set :-) The patch for instruction selectors was proposed by me here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080303/059215.html It is related to the Select() and SelectRoot implementations inside the target-specific code selectors generated by tablegen. Regarding my questions about std::set vs std;;multiset in the mentioned patch: Having looked into it again, I have the impression that std::set could be used and there is no need for std::multiset. Basically, the this code: void AddToISelQueue(SDOperand N) DISABLE_INLINE { int Id = N.Val->getNodeId(); if (Id != -1 && !isQueued(Id)) { ... } ensures that only one node with a given NodeId can be inserted into the ISelQueue. One possible further improvement, I'm thinking about is the following: Why do we use a sorted data structure (e.g. sorted vector, set) for the ISelQueue at all? 1) If we look into the SelectRoot logic, it basically takes the node with the SMALLEST NodeId from the pending selection queue. 2) More over, it seems to me (please, confirm if it is true!) that the next node taken for selection in the loop inside the SelectRoot, at any point in time, has a NodeId that is GREATER than the NodeId of the last selected node. 3) Even if the selection of the node puts new nodes into the selection queue, they ALWAYS have NodeIds GREATER than that of this node. Therefore the property (2) is preserved. I checked (2) and (3) by adding some debug output to the SelectRoot. Only one test of all llvm/test test-cases does not fulfill this assumptions and even there it is not quite obvious if it is a contradiction to (2) and (3) or a bug. So, assuming that properties (2) and (3) do hold, the following can be probably done: - We iterate over the NodeId numbers from 0 till the DAGSize. - We check if a Node with a given NodeId (by looking into the TopOrder???), if isQueued(NodeId) is true, i.e. this is in the queue - We then check if isSelected(NodeId) is true or false and call Select() for this node, if it is not selected yet. - If a new node needs to be inserted into the queue, only setQueued(NodeId) is called With these changes, no online sorting would be required at all, which is a great improvement over the current approach. What do you think about it? Is it a correct analysis? - Roman From ggreif at gmail.com Sat Apr 19 12:13:45 2008 From: ggreif at gmail.com (Gabor Greif) Date: Sat, 19 Apr 2008 17:13:45 -0000 Subject: [llvm-commits] [llvm] r49953 - in /llvm/branches/ggreif/use-diet: include/llvm/User.h lib/VMCore/Use.cpp Message-ID: <200804191713.m3JHDjFq023609@zion.cs.uiuc.edu> Author: ggreif Date: Sat Apr 19 12:13:44 2008 New Revision: 49953 URL: http://llvm.org/viewvc/llvm-project?rev=49953&view=rev Log: update documentation, fix a bug in initTags and make the Use::zap method more performant Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49953&r1=49952&r2=49953&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/include/llvm/User.h (original) +++ llvm/branches/ggreif/use-diet/include/llvm/User.h Sat Apr 19 12:13:44 2008 @@ -62,7 +62,7 @@ # by the Use[] array. # # ...---.---.---.---.-------... -# | V | V | V | V | User +# | P | P | P | P | User # '''---'---'---'---'-------''' @@ -74,18 +74,18 @@ # | # v # .---.---.---.---... -# | V | V | V | V | +# | P | P | P | P | # '---'---'---'---''' - (In the above figures 'V' stands for the Value* that - is stored in each Use object) + (In the above figures 'P' stands for the Use** that + is stored in each Use object in the member Use::Prev) Since the Use objects will be deprived of the direct pointer to their User objects, there must be a fast and exact method to recover it. This is accomplished by the following scheme: -A bit-encoding in the 2 LSBits of the Use::Val will allow to find the +A bit-encoding in the 2 LSBits of the Use::Prev will allow to find the start of the User object: 00 --> binary digit 0 @@ -176,12 +176,12 @@ OK, passed 500 tests. -To maintain the invariant that the 2 LSBits of each Value* in Use -never change after being set up, setters of Use::Val must re-tag the -new Value* on every modification. Accordingly getters must strip the +To maintain the invariant that the 2 LSBits of each Use** in Use +never change after being set up, setters of Use::Prev must re-tag the +new Use** on every modification. Accordingly getters must strip the tag bits. -For layout b) instead of the User we will find a pointer (with LSBit set). +For layout b) instead of the User we will find a pointer (User* with LSBit set). Following this pointer brings us to the User. A portable trick will ensure that the first bytes of User (if interpreted as a pointer) will never have the LSBit set. Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49953&r1=49952&r2=49953&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original) +++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Sat Apr 19 12:13:44 2008 @@ -51,7 +51,7 @@ //===----------------------------------------------------------------------===// Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) { - ptrdiff_t Count = 0; + ptrdiff_t Count = Done; while (Start != Stop) { --Stop; Stop->Val = 0; @@ -74,12 +74,17 @@ //===----------------------------------------------------------------------===// void Use::zap(Use *Start, const Use *Stop, bool del) { - Use *Iter = Start; - while (Iter != Stop) { - (Iter++)->set(0); - } - if (del) + if (del) { + while (Start != Stop) { + (--Stop)->~Use(); + } ::operator delete(Start); + return; + } + + while (Start != Stop) { + (Start++)->set(0); + } } //===----------------------------------------------------------------------===// From kremenek at apple.com Sat Apr 19 13:50:09 2008 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 19 Apr 2008 18:50:09 -0000 Subject: [llvm-commits] [llvm] r49957 - /llvm/tags/checker/checker-0005/ Message-ID: <200804191850.m3JIo9BD026251@zion.cs.uiuc.edu> Author: kremenek Date: Sat Apr 19 13:50:08 2008 New Revision: 49957 URL: http://llvm.org/viewvc/llvm-project?rev=49957&view=rev Log: Tagging checker-0005. Added: llvm/tags/checker/checker-0005/ - copied from r49956, llvm/trunk/ From kremenek at apple.com Sat Apr 19 14:13:31 2008 From: kremenek at apple.com (Ted Kremenek) Date: Sat, 19 Apr 2008 19:13:31 -0000 Subject: [llvm-commits] [llvm] r49960 - /llvm/tags/checker/checker-0006/ Message-ID: <200804191913.m3JJDVnB026866@zion.cs.uiuc.edu> Author: kremenek Date: Sat Apr 19 14:13:31 2008 New Revision: 49960 URL: http://llvm.org/viewvc/llvm-project?rev=49960&view=rev Log: Tagging checker-0006. Added: llvm/tags/checker/checker-0006/ - copied from r49959, llvm/trunk/ From dalej at apple.com Sat Apr 19 14:29:47 2008 From: dalej at apple.com (Dale Johannesen) Date: Sat, 19 Apr 2008 12:29:47 -0700 Subject: [llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: <4809749D.80207@mxc.ca> References: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> <4809749D.80207@mxc.ca> Message-ID: That seems to work equally well, but results in noticeably worse code, 7 instructions instead of 4 in the preheader in my example test. Could you explain why what we did was wrong? On Apr 18, 2008, at 9:27 PM, Nick Lewycky wrote: > Hi Dale, > > I don't think this is right. The correct fix is to replace > getNegativeSCEV with getNotSCEV. > > Nick > > Dale Johannesen wrote: >> Author: johannes >> Date: Fri Apr 18 16:38:31 2008 >> New Revision: 49928 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=49928&view=rev >> Log: >> Fix a scalar evolution bug. Reversing everything >> does not work because of 0; 2>0 but -2U is also >0. >> >> >> Modified: >> llvm/trunk/lib/Analysis/ScalarEvolution.cpp >> >> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49928&r1=49927&r2=49928&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) >> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 18 16:38:31 >> 2008 >> @@ -1980,8 +1980,7 @@ >> break; >> } >> case ICmpInst::ICMP_UGT: { >> - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), >> - SE.getNegativeSCEV(RHS), L, >> false); >> + SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L); >> if (!isa(TC)) return TC; >> break; >> } >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicholas at mxc.ca Sat Apr 19 14:37:05 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Sat, 19 Apr 2008 12:37:05 -0700 Subject: [llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: References: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> <4809749D.80207@mxc.ca> Message-ID: <480A49E1.4070708@mxc.ca> Dale Johannesen wrote: > That seems to work equally well, but results in noticeably worse code, > 7 instructions instead of 4 in the preheader in my example test. > Could you explain why what we did was wrong? Yes, your code would miscompile in the case where the loop test was false to begin with and thus never executes at all. See PR2003 for the discussion and an example of what goes wrong in the ULT case. I don't have an example handy using UGT (and I find them hard to come up with). Nick > On Apr 18, 2008, at 9:27 PM, Nick Lewycky wrote: > >> Hi Dale, >> >> I don't think this is right. The correct fix is to replace >> getNegativeSCEV with getNotSCEV. >> >> Nick >> >> Dale Johannesen wrote: >>> Author: johannes >>> Date: Fri Apr 18 16:38:31 2008 >>> New Revision: 49928 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=49928&view=rev >>> Log: >>> Fix a scalar evolution bug. Reversing everything >>> does not work because of 0; 2>0 but -2U is also >0. >>> >>> >>> Modified: >>> llvm/trunk/lib/Analysis/ScalarEvolution.cpp >>> >>> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49928&r1=49927&r2=49928&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ===================================================================== >>> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) >>> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 18 16:38:31 >>> 2008 >>> @@ -1980,8 +1980,7 @@ >>> break; >>> } >>> case ICmpInst::ICMP_UGT: { >>> - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), >>> - SE.getNegativeSCEV(RHS), L, >>> false); >>> + SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L); >>> if (!isa(TC)) return TC; >>> break; >>> } >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From sabre at nondot.org Sat Apr 19 14:50:01 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 19 Apr 2008 19:50:01 -0000 Subject: [llvm-commits] [llvm] r49962 - in /llvm/trunk: include/llvm/Transforms/IPO.h lib/Transforms/IPO/ArgumentPromotion.cpp Message-ID: <200804191950.m3JJo1GS027937@zion.cs.uiuc.edu> Author: lattner Date: Sat Apr 19 14:50:01 2008 New Revision: 49962 URL: http://llvm.org/viewvc/llvm-project?rev=49962&view=rev Log: Allow argpromote to promote struct arguments with a specified number of elements. Patch by Matthijs Kooijman! Modified: llvm/trunk/include/llvm/Transforms/IPO.h llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Modified: llvm/trunk/include/llvm/Transforms/IPO.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO.h?rev=49962&r1=49961&r2=49962&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/IPO.h (original) +++ llvm/trunk/include/llvm/Transforms/IPO.h Sat Apr 19 14:50:01 2008 @@ -123,9 +123,10 @@ //===----------------------------------------------------------------------===// /// createArgumentPromotionPass - This pass promotes "by reference" arguments to -/// be passed by value. +/// be passed by value if the number of elements passed is smaller or +/// equal to maxElements (maxElements == 0 means always promote). /// -Pass *createArgumentPromotionPass(); +Pass *createArgumentPromotionPass(unsigned maxElements = 3); Pass *createStructRetPromotionPass(); //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=49962&r1=49961&r2=49962&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Sat Apr 19 14:50:01 2008 @@ -17,9 +17,10 @@ // // This pass also handles aggregate arguments that are passed into a function, // scalarizing them if the elements of the aggregate are only loaded. Note that -// it refuses to scalarize aggregates which would require passing in more than +// by default it refuses to scalarize aggregates which would require passing in more than // three operands to the function, because passing thousands of operands for a -// large array or structure is unprofitable! +// large array or structure is unprofitable! This limit is can be configured or +// disabled, however. // // Note that this transformation could also be done for arguments that are only // stored to (returning the value instead), but does not currently. This case @@ -65,7 +66,7 @@ virtual bool runOnSCC(const std::vector &SCC); static char ID; // Pass identification, replacement for typeid - ArgPromotion() : CallGraphSCCPass((intptr_t)&ID) {} + ArgPromotion(unsigned maxElements = 3) : CallGraphSCCPass((intptr_t)&ID), maxElements(maxElements) {} private: bool PromoteArguments(CallGraphNode *CGN); @@ -73,6 +74,8 @@ Function *DoPromotion(Function *F, SmallPtrSet &ArgsToPromote, SmallPtrSet &ByValArgsToTransform); + /// The maximum number of elements to expand, or 0 for unlimited. + unsigned maxElements; }; char ArgPromotion::ID = 0; @@ -80,8 +83,8 @@ "Promote 'by reference' arguments to scalars"); } -Pass *llvm::createArgumentPromotionPass() { - return new ArgPromotion(); +Pass *llvm::createArgumentPromotionPass(unsigned maxElements) { + return new ArgPromotion(maxElements); } bool ArgPromotion::runOnSCC(const std::vector &SCC) { @@ -145,7 +148,11 @@ if (isByVal) { const Type *AgTy = cast(PtrArg->getType())->getElementType(); if (const StructType *STy = dyn_cast(AgTy)) - if (STy->getNumElements() <= 3) { + if (maxElements > 0 && STy->getNumElements() > maxElements) { + DOUT << "argpromotion disable promoting argument '" + << PtrArg->getName() << "' because it would require adding more " + << "than " << maxElements << " arguments to the function.\n"; + } else { // If all the elements are first class types, we can promote it. bool AllSimple = true; for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) @@ -278,12 +285,12 @@ // to do. if (std::find(GEPIndices.begin(), GEPIndices.end(), Operands) == GEPIndices.end()) { - if (GEPIndices.size() == 3) { + if (maxElements > 0 && GEPIndices.size() == maxElements) { DOUT << "argpromotion disable promoting argument '" << Arg->getName() << "' because it would require adding more " - << "than 3 arguments to the function.\n"; - // We limit aggregate promotion to only promoting up to three elements - // of the aggregate. + << "than " << maxElements << " arguments to the function.\n"; + // We limit aggregate promotion to only promoting up to a fixed number + // of elements of the aggregate. return false; } GEPIndices.push_back(Operands); From sabre at nondot.org Sat Apr 19 16:01:16 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 19 Apr 2008 21:01:16 -0000 Subject: [llvm-commits] [llvm] r49963 - /llvm/trunk/docs/LangRef.html Message-ID: <200804192101.m3JL1GO0030003@zion.cs.uiuc.edu> Author: lattner Date: Sat Apr 19 16:01:16 2008 New Revision: 49963 URL: http://llvm.org/viewvc/llvm-project?rev=49963&view=rev Log: Some clarifications suggested by Jon Sargeant Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=49963&r1=49962&r2=49963&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Sat Apr 19 16:01:16 2008 @@ -2017,7 +2017,7 @@
Semantics:
-

The 'unwind' intrinsic causes execution of the current function to +

The 'unwind' instruction causes execution of the current function to immediately halt. The dynamic call stack is then searched for the first invoke instruction on the call stack. Once found, execution continues at the "exceptional" destination block specified by the @@ -2337,7 +2337,8 @@

Arguments:

Both arguments to the 'shl' instruction must be the same integer type.

+ href="#t_integer">integer type. 'var2' is treated as an +unsigned value.

Semantics:
@@ -2366,7 +2367,8 @@
Arguments:

Both arguments to the 'lshr' instruction must be the same -integer type.

+integer type. 'var2' is treated as an +unsigned value.

Semantics:
@@ -2400,7 +2402,8 @@
Arguments:

Both arguments to the 'ashr' instruction must be the same -integer type.

+integer type. 'var2' is treated as an +unsigned value.

Semantics:

This instruction always performs an arithmetic shift right operation, @@ -2796,8 +2799,8 @@

Semantics:

Memory is allocated using the system "malloc" function, and -a pointer is returned. Allocating zero bytes is undefined. The result is null -if there is insufficient memory available.

+a pointer is returned. The result of a zero byte allocattion is undefined. The +result is null if there is insufficient memory available.

Example:
@@ -2839,7 +2842,7 @@
Semantics:

Access to the memory pointed to by the pointer is no longer defined -after this instruction executes. If the pointer is null, the result is +after this instruction executes. If the pointer is null, the behavior is undefined.

Example:
@@ -2884,7 +2887,8 @@
Semantics:
-

Memory is allocated; a pointer is returned. 'alloca'd +

Memory is allocated; a pointer is returned. The operation is undefiend if +there is insufficient stack space for the allocation. 'alloca'd memory is automatically released when the function returns. The 'alloca' instruction is commonly used to represent automatic variables that must have an address available. When the function returns (either with the Author: lattner Date: Sat Apr 19 16:13:00 2008 New Revision: 49964 URL: http://llvm.org/viewvc/llvm-project?rev=49964&view=rev Log: indentation fix. Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=49964&r1=49963&r2=49964&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Sat Apr 19 16:13:00 2008 @@ -726,31 +726,31 @@ if ((CP1 != NULL || isa(C1)) && (CP2 != NULL || isa(C2))) { switch (Opcode) { - default: - break; - case Instruction::Add: + default: + break; + case Instruction::Add: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAdd); - case Instruction::Sub: + case Instruction::Sub: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSub); - case Instruction::Mul: + case Instruction::Mul: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getMul); - case Instruction::UDiv: + case Instruction::UDiv: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getUDiv); - case Instruction::SDiv: + case Instruction::SDiv: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSDiv); - case Instruction::FDiv: + case Instruction::FDiv: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFDiv); - case Instruction::URem: + case Instruction::URem: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getURem); - case Instruction::SRem: + case Instruction::SRem: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getSRem); - case Instruction::FRem: + case Instruction::FRem: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getFRem); - case Instruction::And: + case Instruction::And: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getAnd); - case Instruction::Or: + case Instruction::Or: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getOr); - case Instruction::Xor: + case Instruction::Xor: return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getXor); } } From sabre at nondot.org Sat Apr 19 16:58:20 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 19 Apr 2008 21:58:20 -0000 Subject: [llvm-commits] [llvm] r49965 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Integer/a1.ll.out Message-ID: <200804192158.m3JLwKTS031774@zion.cs.uiuc.edu> Author: lattner Date: Sat Apr 19 16:58:19 2008 New Revision: 49965 URL: http://llvm.org/viewvc/llvm-project?rev=49965&view=rev Log: refactor handling of symbolic constant folding, picking up a few new cases( see Integer/a1.ll), but not anything that would happen in practice. Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp llvm/trunk/test/Integer/a1.ll.out Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=49965&r1=49964&r2=49965&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Sat Apr 19 16:58:19 2008 @@ -519,56 +519,50 @@ } } - if (const ConstantExpr *CE1 = dyn_cast(C1)) { - if (isa(C2)) { - // There are many possible foldings we could do here. We should probably - // at least fold add of a pointer with an integer into the appropriate - // getelementptr. This will improve alias analysis a bit. - } else { - // Just implement a couple of simple identities. - switch (Opcode) { - case Instruction::Add: - if (C2->isNullValue()) return const_cast(C1); // X + 0 == X - break; - case Instruction::Sub: - if (C2->isNullValue()) return const_cast(C1); // X - 0 == X - break; - case Instruction::Mul: - if (C2->isNullValue()) return const_cast(C2); // X * 0 == 0 - if (const ConstantInt *CI = dyn_cast(C2)) - if (CI->equalsInt(1)) - return const_cast(C1); // X * 1 == X - break; - case Instruction::UDiv: - case Instruction::SDiv: - if (const ConstantInt *CI = dyn_cast(C2)) - if (CI->equalsInt(1)) - return const_cast(C1); // X / 1 == X - break; - case Instruction::URem: - case Instruction::SRem: - if (const ConstantInt *CI = dyn_cast(C2)) - if (CI->equalsInt(1)) - return Constant::getNullValue(CI->getType()); // X % 1 == 0 - break; - case Instruction::And: - if (const ConstantInt *CI = dyn_cast(C2)) { - if (CI->isZero()) return const_cast(C2); // X & 0 == 0 - if (CI->isAllOnesValue()) - return const_cast(C1); // X & -1 == X - - // (zext i32 to i64) & 4294967295 -> (zext i32 to i64) - if (CE1->getOpcode() == Instruction::ZExt) { - APInt PossiblySetBits - = cast(CE1->getOperand(0)->getType())->getMask(); - PossiblySetBits.zext(C1->getType()->getPrimitiveSizeInBits()); - if ((PossiblySetBits & CI->getValue()) == PossiblySetBits) - return const_cast(C1); - } - } - if (CE1->isCast() && isa(CE1->getOperand(0))) { + // Handle simplifications of the RHS when a constant int. + if (const ConstantInt *CI2 = dyn_cast(C2)) { + switch (Opcode) { + case Instruction::Add: + if (CI2->equalsInt(0)) return const_cast(C1); // X + 0 == X + break; + case Instruction::Sub: + if (CI2->equalsInt(0)) return const_cast(C1); // X - 0 == X + break; + case Instruction::Mul: + if (CI2->equalsInt(0)) return const_cast(C2); // X * 0 == 0 + if (CI2->equalsInt(1)) + return const_cast(C1); // X * 1 == X + break; + case Instruction::UDiv: + case Instruction::SDiv: + if (CI2->equalsInt(1)) + return const_cast(C1); // X / 1 == X + break; + case Instruction::URem: + case Instruction::SRem: + if (CI2->equalsInt(1)) + return Constant::getNullValue(CI2->getType()); // X % 1 == 0 + break; + case Instruction::And: + if (CI2->isZero()) return const_cast(C2); // X & 0 == 0 + if (CI2->isAllOnesValue()) + return const_cast(C1); // X & -1 == X + + // (zext i32 to i64) & 4294967295 -> (zext i32 to i64) + if (const ConstantExpr *CE1 = dyn_cast(C1)) { + if (CE1->getOpcode() == Instruction::ZExt) { + unsigned DstWidth = CI2->getType()->getBitWidth(); + unsigned SrcWidth = + CE1->getOperand(0)->getType()->getPrimitiveSizeInBits(); + APInt PossiblySetBits(APInt::getLowBitsSet(DstWidth, SrcWidth)); + if ((PossiblySetBits & CI2->getValue()) == PossiblySetBits) + return const_cast(C1); + } + + if (CE1->getOpcode() == Instruction::PtrToInt && + isa(CE1->getOperand(0))) { GlobalValue *CPR = cast(CE1->getOperand(0)); - + // Functions are at least 4-byte aligned. If and'ing the address of a // function with a constant < 4, fold it to zero. if (const ConstantInt *CI = dyn_cast(C2)) @@ -576,24 +570,30 @@ isa(CPR)) return Constant::getNullValue(CI->getType()); } - break; - case Instruction::Or: - if (C2->isNullValue()) return const_cast(C1); // X | 0 == X - if (const ConstantInt *CI = dyn_cast(C2)) - if (CI->isAllOnesValue()) - return const_cast(C2); // X | -1 == -1 - break; - case Instruction::Xor: - if (C2->isNullValue()) return const_cast(C1); // X ^ 0 == X - break; - case Instruction::AShr: - // ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2 + } + break; + case Instruction::Or: + if (CI2->equalsInt(0)) return const_cast(C1); // X | 0 == X + if (CI2->isAllOnesValue()) + return const_cast(C2); // X | -1 == -1 + break; + case Instruction::Xor: + if (CI2->equalsInt(0)) return const_cast(C1); // X ^ 0 == X + break; + case Instruction::AShr: + // ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2 + if (const ConstantExpr *CE1 = dyn_cast(C1)) if (CE1->getOpcode() == Instruction::ZExt) // Top bits known zero. return ConstantExpr::getLShr(const_cast(C1), const_cast(C2)); - break; - } + break; } + } + + if (isa(C1)) { + // There are many possible foldings we could do here. We should probably + // at least fold add of a pointer with an integer into the appropriate + // getelementptr. This will improve alias analysis a bit. } else if (isa(C2)) { // If C2 is a constant expr and C1 isn't, flop them around and fold the // other way if possible. Modified: llvm/trunk/test/Integer/a1.ll.out URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Integer/a1.ll.out?rev=49965&r1=49964&r2=49965&view=diff ============================================================================== --- llvm/trunk/test/Integer/a1.ll.out (original) +++ llvm/trunk/test/Integer/a1.ll.out Sat Apr 19 16:58:19 2008 @@ -10,10 +10,10 @@ @j = constant i1 undef ; [#uses=0] @m = constant i1 undef ; [#uses=0] @n = constant i1 true ; [#uses=0] - at o = constant i1 sdiv (i1 true, i1 true) ; [#uses=0] - at p = constant i1 sdiv (i1 true, i1 true) ; [#uses=0] + at o = constant i1 true ; [#uses=0] + at p = constant i1 true ; [#uses=0] @q = constant i1 true ; [#uses=0] @r = constant i1 true ; [#uses=0] - at s = constant i1 srem (i1 true, i1 true) ; [#uses=0] + at s = constant i1 false ; [#uses=0] @t = constant i1 false ; [#uses=0] - at u = constant i1 srem (i1 true, i1 true) ; [#uses=0] + at u = constant i1 false ; [#uses=0] From dalej at apple.com Sat Apr 19 17:17:05 2008 From: dalej at apple.com (Dale Johannesen) Date: Sat, 19 Apr 2008 15:17:05 -0700 Subject: [llvm-commits] [llvm] r49928 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp In-Reply-To: <480A49E1.4070708@mxc.ca> References: <200804182138.m3ILcW7E013611@zion.cs.uiuc.edu> <4809749D.80207@mxc.ca> <480A49E1.4070708@mxc.ca> Message-ID: <3F866BA1-30D7-4218-A004-86BC76F472E6@apple.com> On Apr 19, 2008, at 12:37 PM, Nick Lewycky wrote: > Dale Johannesen wrote: >> That seems to work equally well, but results in noticeably worse >> code, >> 7 instructions instead of 4 in the preheader in my example test. >> Could you explain why what we did was wrong? > > Yes, your code would miscompile in the case where the loop test was > false to begin with and thus never executes at all. Actually the test I checked in exercises that, and it works. But you are right that the SCEV expression isn't right for that case; it works because there's a check for never-executed before getting into the loop proper. That may be an artifact of llvm-gcc; I'll play around at the llvm IR level and see if I can break it. I am concerned about the inferior code quality though. You actually get best codegen on my test if you remove the UGT case entirely:) > See PR2003 for the discussion and an example of what goes wrong in the > ULT case. I don't have an example handy using UGT (and I find them > hard > to come up with). > > Nick > >> On Apr 18, 2008, at 9:27 PM, Nick Lewycky wrote: >> >>> Hi Dale, >>> >>> I don't think this is right. The correct fix is to replace >>> getNegativeSCEV with getNotSCEV. >>> >>> Nick >>> >>> Dale Johannesen wrote: >>>> Author: johannes >>>> Date: Fri Apr 18 16:38:31 2008 >>>> New Revision: 49928 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=49928&view=rev >>>> Log: >>>> Fix a scalar evolution bug. Reversing everything >>>> does not work because of 0; 2>0 but -2U is also >0. >>>> >>>> >>>> Modified: >>>> llvm/trunk/lib/Analysis/ScalarEvolution.cpp >>>> >>>> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=49928&r1=49927&r2=49928&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) >>>> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 18 16:38:31 >>>> 2008 >>>> @@ -1980,8 +1980,7 @@ >>>> break; >>>> } >>>> case ICmpInst::ICMP_UGT: { >>>> - SCEVHandle TC = HowManyLessThans(SE.getNegativeSCEV(LHS), >>>> - SE.getNegativeSCEV(RHS), L, >>>> false); >>>> + SCEVHandle TC = HowFarToZero(SE.getMinusSCEV(LHS, RHS), L); >>>> if (!isa(TC)) return TC; >>>> break; >>>> } >>>> >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From ggreif at gmail.com Sat Apr 19 17:17:20 2008 From: ggreif at gmail.com (Gabor Greif) Date: Sat, 19 Apr 2008 22:17:20 -0000 Subject: [llvm-commits] [llvm] r49966 - in /llvm/branches/ggreif/use-diet/docs: Stacker.html tutorial/JITTutorial1.html tutorial/JITTutorial2.html tutorial/LangImpl3.html tutorial/LangImpl4.html tutorial/LangImpl5.html tutorial/LangImpl6.html tutorial/LangImpl7.html Message-ID: <200804192217.m3JMHKCs032354@zion.cs.uiuc.edu> Author: ggreif Date: Sat Apr 19 17:17:20 2008 New Revision: 49966 URL: http://llvm.org/viewvc/llvm-project?rev=49966&view=rev Log: fix tutorials to use the new API Modified: llvm/branches/ggreif/use-diet/docs/Stacker.html llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial1.html llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial2.html llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl3.html llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl4.html llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl5.html llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl6.html llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl7.html Modified: llvm/branches/ggreif/use-diet/docs/Stacker.html URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/Stacker.html?rev=49966&r1=49965&r2=49966&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/docs/Stacker.html (original) +++ llvm/branches/ggreif/use-diet/docs/Stacker.html Sat Apr 19 17:17:20 2008 @@ -219,8 +219,8 @@

The foregoing is such an important principal, its worth making an idiom:

-BasicBlock* bb = new BasicBlock();
-bb->getInstList().push_back( new Branch( ... ) );
+BasicBlock* bb = BasicBlock::Create();
+bb->getInstList().push_back( BranchInst::Create( ... ) );
 new Instruction(..., bb->getTerminator() );
 

To make this clear, consider the typical if-then-else statement @@ -232,16 +232,16 @@ MyCompiler::handle_if( BasicBlock* bb, ICmpInst* condition ) { // Create the blocks to contain code in the structure of if/then/else - BasicBlock* then_bb = new BasicBlock(); - BasicBlock* else_bb = new BasicBlock(); - BasicBlock* exit_bb = new BasicBlock(); + BasicBlock* then_bb = BasicBlock::Create(); + BasicBlock* else_bb = BasicBlock::Create(); + BasicBlock* exit_bb = BasicBlock::Create(); // Insert the branch instruction for the "if" - bb->getInstList().push_back( new BranchInst( then_bb, else_bb, condition ) ); + bb->getInstList().push_back( BranchInst::Create( then_bb, else_bb, condition ) ); // Set up the terminating instructions - then->getInstList().push_back( new BranchInst( exit_bb ) ); - else->getInstList().push_back( new BranchInst( exit_bb ) ); + then->getInstList().push_back( BranchInst::Create( exit_bb ) ); + else->getInstList().push_back( BranchInst::Create( exit_bb ) ); // Fill in the then part .. details excised for brevity this->fill_in( then_bb ); @@ -310,7 +310,7 @@ std::vector<Value*> index_vector; index_vector.push_back( ConstantInt::get( Type::LongTy, 0 ); // ... push other indices ... -GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector ); +GetElementPtrInst* gep = GetElementPtrInst::Create( ptr, index_vector );

For example, suppose we have a global variable whose type is [24 x int]. The variable itself represents a pointer to that array. To subscript the Modified: llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial1.html URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial1.html?rev=49966&r1=49965&r2=49966&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial1.html (original) +++ llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial1.html Sat Apr 19 17:17:20 2008 @@ -142,7 +142,7 @@

-  BasicBlock* block = new BasicBlock("entry", mul_add);
+  BasicBlock* block = BasicBlock::Create("entry", mul_add);
   LLVMBuilder builder(block);
 
Modified: llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial2.html URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial2.html?rev=49966&r1=49965&r2=49966&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial2.html (original) +++ llvm/branches/ggreif/use-diet/docs/tutorial/JITTutorial2.html Sat Apr 19 17:17:20 2008 @@ -98,11 +98,11 @@
-  BasicBlock* entry = new BasicBlock("entry", gcd);
-  BasicBlock* ret = new BasicBlock("return", gcd);
-  BasicBlock* cond_false = new BasicBlock("cond_false", gcd);
-  BasicBlock* cond_true = new BasicBlock("cond_true", gcd);
-  BasicBlock* cond_false_2 = new BasicBlock("cond_false", gcd);
+  BasicBlock* entry = BasicBlock::Create("entry", gcd);
+  BasicBlock* ret = BasicBlock::Create("return", gcd);
+  BasicBlock* cond_false = BasicBlock::Create("cond_false", gcd);
+  BasicBlock* cond_true = BasicBlock::Create("cond_true", gcd);
+  BasicBlock* cond_false_2 = BasicBlock::Create("cond_false", gcd);
 
Modified: llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl3.html?rev=49966&r1=49965&r2=49966&view=diff ============================================================================== --- llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl3.html (original) +++ llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl3.html Sat Apr 19 17:17:20 2008 @@ -306,7 +306,7 @@ std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy); FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false); - Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule); + Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule); @@ -435,7 +435,7 @@
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {
@@ -1079,7 +1079,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1122,7 +1122,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl4.html?rev=49966&r1=49965&r2=49966&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl4.html (original)
+++ llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl4.html Sat Apr 19 17:17:20 2008
@@ -925,7 +925,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -968,7 +968,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl5.html?rev=49966&r1=49965&r2=49966&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl5.html (original)
+++ llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl5.html Sat Apr 19 17:17:20 2008
@@ -379,9 +379,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
 
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
 
@@ -727,7 +727,7 @@ // block. Function *TheFunction = Builder.GetInsertBlock()->getParent(); BasicBlock *PreheaderBB = Builder.GetInsertBlock(); - BasicBlock *LoopBB = new BasicBlock("loop", TheFunction); + BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction); // Insert an explicit fall through from the current block to the LoopBB. Builder.CreateBr(LoopBB); @@ -828,7 +828,7 @@
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1417,9 +1417,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1479,7 +1479,7 @@
   // block.
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1525,7 +1525,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1552,7 +1552,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1595,7 +1595,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl6.html?rev=49966&r1=49965&r2=49966&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl6.html (original)
+++ llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl6.html Sat Apr 19 17:17:20 2008
@@ -321,7 +321,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {
@@ -1442,9 +1442,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1504,7 +1504,7 @@
   // block.
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1550,7 +1550,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1577,7 +1577,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1624,7 +1624,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl7.html?rev=49966&r1=49965&r2=49966&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl7.html (original)
+++ llvm/branches/ggreif/use-diet/docs/tutorial/LangImpl7.html Sat Apr 19 17:17:20 2008
@@ -1722,9 +1722,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1795,7 +1795,7 @@
   // Make the new basic block for the loop header, inserting after current
   // block.
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1841,7 +1841,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1912,7 +1912,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1972,7 +1972,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   // Add all arguments to the symbol table and create their allocas.




From sabre at nondot.org  Sat Apr 19 17:17:26 2008
From: sabre at nondot.org (Chris Lattner)
Date: Sat, 19 Apr 2008 22:17:26 -0000
Subject: [llvm-commits] [llvm] r49967 - in /llvm/trunk:
 lib/VMCore/ConstantFold.cpp test/Assembler/ConstantExprFold.llx
Message-ID: <200804192217.m3JMHQUN032368@zion.cs.uiuc.edu>

Author: lattner
Date: Sat Apr 19 17:17:26 2008
New Revision: 49967

URL: http://llvm.org/viewvc/llvm-project?rev=49967&view=rev
Log:
Implement PR2206.

Modified:
    llvm/trunk/lib/VMCore/ConstantFold.cpp
    llvm/trunk/test/Assembler/ConstantExprFold.llx

Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=49967&r1=49966&r2=49967&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
+++ llvm/trunk/lib/VMCore/ConstantFold.cpp Sat Apr 19 17:17:26 2008
@@ -548,8 +548,8 @@
       if (CI2->isAllOnesValue())
         return const_cast(C1);                     // X & -1 == X
       
-      // (zext i32 to i64) & 4294967295 -> (zext i32 to i64)
       if (const ConstantExpr *CE1 = dyn_cast(C1)) {
+        // (zext i32 to i64) & 4294967295 -> (zext i32 to i64)
         if (CE1->getOpcode() == Instruction::ZExt) {
           unsigned DstWidth = CI2->getType()->getBitWidth();
           unsigned SrcWidth =
@@ -559,16 +559,25 @@
             return const_cast(C1);
         }
         
+        // If and'ing the address of a global with a constant, fold it.
         if (CE1->getOpcode() == Instruction::PtrToInt && 
             isa(CE1->getOperand(0))) {
-          GlobalValue *CPR = cast(CE1->getOperand(0));
+          GlobalValue *GV = cast(CE1->getOperand(0));
         
-          // Functions are at least 4-byte aligned.  If and'ing the address of a
-          // function with a constant < 4, fold it to zero.
-          if (const ConstantInt *CI = dyn_cast(C2))
-            if (CI->getValue().ult(APInt(CI->getType()->getBitWidth(),4)) && 
-                isa(CPR))
-              return Constant::getNullValue(CI->getType());
+          // Functions are at least 4-byte aligned.
+          unsigned GVAlign = GV->getAlignment();
+          if (isa(GV))
+            GVAlign = std::max(GVAlign, 4U);
+          
+          if (GVAlign > 1) {
+            unsigned DstWidth = CI2->getType()->getBitWidth();
+            unsigned SrcWidth = std::min(SrcWidth, Log2_32(GVAlign));
+            APInt BitsNotSet(APInt::getLowBitsSet(DstWidth, SrcWidth));
+
+            // If checking bits we know are clear, return zero.
+            if ((CI2->getValue() & BitsNotSet) == CI2->getValue())
+              return Constant::getNullValue(CI2->getType());
+          }
         }
       }
       break;

Modified: llvm/trunk/test/Assembler/ConstantExprFold.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/ConstantExprFold.llx?rev=49967&r1=49966&r2=49967&view=diff

==============================================================================
--- llvm/trunk/test/Assembler/ConstantExprFold.llx (original)
+++ llvm/trunk/test/Assembler/ConstantExprFold.llx Sat Apr 19 17:17:26 2008
@@ -24,3 +24,7 @@
                    i32* getelementptr (%Ty* @B, i64 0, i32 1))            ; true
 ;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*))                 ; true
 
+; PR2206
+ at cons = weak global i32 0, align 8              ;  [#uses=1]
+global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
+




From ggreif at gmail.com  Sat Apr 19 17:25:09 2008
From: ggreif at gmail.com (Gabor Greif)
Date: Sat, 19 Apr 2008 22:25:09 -0000
Subject: [llvm-commits] [llvm] r49968 - in /llvm/trunk/docs: Stacker.html
 tutorial/JITTutorial1.html tutorial/JITTutorial2.html
 tutorial/LangImpl3.html tutorial/LangImpl4.html tutorial/LangImpl5.html
 tutorial/LangImpl6.html tutorial/LangImpl7.html
Message-ID: <200804192225.m3JMP9RL032608@zion.cs.uiuc.edu>

Author: ggreif
Date: Sat Apr 19 17:25:09 2008
New Revision: 49968

URL: http://llvm.org/viewvc/llvm-project?rev=49968&view=rev
Log:
merge of 49966 from branches/ggreif/use-diet to trunk. these are already active API changes

Modified:
    llvm/trunk/docs/Stacker.html
    llvm/trunk/docs/tutorial/JITTutorial1.html
    llvm/trunk/docs/tutorial/JITTutorial2.html
    llvm/trunk/docs/tutorial/LangImpl3.html
    llvm/trunk/docs/tutorial/LangImpl4.html
    llvm/trunk/docs/tutorial/LangImpl5.html
    llvm/trunk/docs/tutorial/LangImpl6.html
    llvm/trunk/docs/tutorial/LangImpl7.html

Modified: llvm/trunk/docs/Stacker.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Stacker.html?rev=49968&r1=49967&r2=49968&view=diff

==============================================================================
--- llvm/trunk/docs/Stacker.html (original)
+++ llvm/trunk/docs/Stacker.html Sat Apr 19 17:25:09 2008
@@ -219,8 +219,8 @@
 
 

The foregoing is such an important principal, its worth making an idiom:

-BasicBlock* bb = new BasicBlock();
-bb->getInstList().push_back( new Branch( ... ) );
+BasicBlock* bb = BasicBlock::Create();
+bb->getInstList().push_back( BranchInst::Create( ... ) );
 new Instruction(..., bb->getTerminator() );
 

To make this clear, consider the typical if-then-else statement @@ -232,16 +232,16 @@ MyCompiler::handle_if( BasicBlock* bb, ICmpInst* condition ) { // Create the blocks to contain code in the structure of if/then/else - BasicBlock* then_bb = new BasicBlock(); - BasicBlock* else_bb = new BasicBlock(); - BasicBlock* exit_bb = new BasicBlock(); + BasicBlock* then_bb = BasicBlock::Create(); + BasicBlock* else_bb = BasicBlock::Create(); + BasicBlock* exit_bb = BasicBlock::Create(); // Insert the branch instruction for the "if" - bb->getInstList().push_back( new BranchInst( then_bb, else_bb, condition ) ); + bb->getInstList().push_back( BranchInst::Create( then_bb, else_bb, condition ) ); // Set up the terminating instructions - then->getInstList().push_back( new BranchInst( exit_bb ) ); - else->getInstList().push_back( new BranchInst( exit_bb ) ); + then->getInstList().push_back( BranchInst::Create( exit_bb ) ); + else->getInstList().push_back( BranchInst::Create( exit_bb ) ); // Fill in the then part .. details excised for brevity this->fill_in( then_bb ); @@ -310,7 +310,7 @@ std::vector<Value*> index_vector; index_vector.push_back( ConstantInt::get( Type::LongTy, 0 ); // ... push other indices ... -GetElementPtrInst* gep = new GetElementPtrInst( ptr, index_vector ); +GetElementPtrInst* gep = GetElementPtrInst::Create( ptr, index_vector );

For example, suppose we have a global variable whose type is [24 x int]. The variable itself represents a pointer to that array. To subscript the Modified: llvm/trunk/docs/tutorial/JITTutorial1.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/JITTutorial1.html?rev=49968&r1=49967&r2=49968&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/JITTutorial1.html (original) +++ llvm/trunk/docs/tutorial/JITTutorial1.html Sat Apr 19 17:25:09 2008 @@ -142,7 +142,7 @@

-  BasicBlock* block = new BasicBlock("entry", mul_add);
+  BasicBlock* block = BasicBlock::Create("entry", mul_add);
   IRBuilder builder(block);
 
Modified: llvm/trunk/docs/tutorial/JITTutorial2.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/JITTutorial2.html?rev=49968&r1=49967&r2=49968&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/JITTutorial2.html (original) +++ llvm/trunk/docs/tutorial/JITTutorial2.html Sat Apr 19 17:25:09 2008 @@ -98,11 +98,11 @@
-  BasicBlock* entry = new BasicBlock("entry", gcd);
-  BasicBlock* ret = new BasicBlock("return", gcd);
-  BasicBlock* cond_false = new BasicBlock("cond_false", gcd);
-  BasicBlock* cond_true = new BasicBlock("cond_true", gcd);
-  BasicBlock* cond_false_2 = new BasicBlock("cond_false", gcd);
+  BasicBlock* entry = BasicBlock::Create("entry", gcd);
+  BasicBlock* ret = BasicBlock::Create("return", gcd);
+  BasicBlock* cond_false = BasicBlock::Create("cond_false", gcd);
+  BasicBlock* cond_true = BasicBlock::Create("cond_true", gcd);
+  BasicBlock* cond_false_2 = BasicBlock::Create("cond_false", gcd);
 
Modified: llvm/trunk/docs/tutorial/LangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=49968&r1=49967&r2=49968&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl3.html (original) +++ llvm/trunk/docs/tutorial/LangImpl3.html Sat Apr 19 17:25:09 2008 @@ -306,7 +306,7 @@ std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy); FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false); - Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule); + Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
@@ -435,7 +435,7 @@
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {
@@ -1079,7 +1079,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1122,7 +1122,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/trunk/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=49968&r1=49967&r2=49968&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl4.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl4.html Sat Apr 19 17:25:09 2008
@@ -913,7 +913,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -956,7 +956,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/trunk/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=49968&r1=49967&r2=49968&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl5.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl5.html Sat Apr 19 17:25:09 2008
@@ -379,9 +379,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
 
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
 
@@ -727,7 +727,7 @@ // block. Function *TheFunction = Builder.GetInsertBlock()->getParent(); BasicBlock *PreheaderBB = Builder.GetInsertBlock(); - BasicBlock *LoopBB = new BasicBlock("loop", TheFunction); + BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction); // Insert an explicit fall through from the current block to the LoopBB. Builder.CreateBr(LoopBB); @@ -828,7 +828,7 @@
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1417,9 +1417,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1479,7 +1479,7 @@
   // block.
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1525,7 +1525,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1552,7 +1552,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1595,7 +1595,7 @@
     return 0;
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/trunk/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=49968&r1=49967&r2=49968&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl6.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl6.html Sat Apr 19 17:25:09 2008
@@ -321,7 +321,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {
@@ -1442,9 +1442,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1504,7 +1504,7 @@
   // block.
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1550,7 +1550,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1577,7 +1577,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1624,7 +1624,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   if (Value *RetVal = Body->Codegen()) {

Modified: llvm/trunk/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=49968&r1=49967&r2=49968&view=diff

==============================================================================
--- llvm/trunk/docs/tutorial/LangImpl7.html (original)
+++ llvm/trunk/docs/tutorial/LangImpl7.html Sat Apr 19 17:25:09 2008
@@ -1722,9 +1722,9 @@
   
   // Create blocks for the then and else cases.  Insert the 'then' block at the
   // end of the function.
-  BasicBlock *ThenBB = new BasicBlock("then", TheFunction);
-  BasicBlock *ElseBB = new BasicBlock("else");
-  BasicBlock *MergeBB = new BasicBlock("ifcont");
+  BasicBlock *ThenBB = BasicBlock::Create("then", TheFunction);
+  BasicBlock *ElseBB = BasicBlock::Create("else");
+  BasicBlock *MergeBB = BasicBlock::Create("ifcont");
   
   Builder.CreateCondBr(CondV, ThenBB, ElseBB);
   
@@ -1795,7 +1795,7 @@
   // Make the new basic block for the loop header, inserting after current
   // block.
   BasicBlock *PreheaderBB = Builder.GetInsertBlock();
-  BasicBlock *LoopBB = new BasicBlock("loop", TheFunction);
+  BasicBlock *LoopBB = BasicBlock::Create("loop", TheFunction);
   
   // Insert an explicit fall through from the current block to the LoopBB.
   Builder.CreateBr(LoopBB);
@@ -1841,7 +1841,7 @@
   
   // Create the "after loop" block and insert it.
   BasicBlock *LoopEndBB = Builder.GetInsertBlock();
-  BasicBlock *AfterBB = new BasicBlock("afterloop", TheFunction);
+  BasicBlock *AfterBB = BasicBlock::Create("afterloop", TheFunction);
   
   // Insert the conditional branch into the end of LoopEndBB.
   Builder.CreateCondBr(EndCond, LoopBB, AfterBB);
@@ -1912,7 +1912,7 @@
   std::vector<const Type*> Doubles(Args.size(), Type::DoubleTy);
   FunctionType *FT = FunctionType::get(Type::DoubleTy, Doubles, false);
   
-  Function *F = new Function(FT, Function::ExternalLinkage, Name, TheModule);
+  Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule);
   
   // If F conflicted, there was already something named 'Name'.  If it has a
   // body, don't allow redefinition or reextern.
@@ -1972,7 +1972,7 @@
     BinopPrecedence[Proto->getOperatorName()] = Proto->getBinaryPrecedence();
   
   // Create a new basic block to start insertion into.
-  BasicBlock *BB = new BasicBlock("entry", TheFunction);
+  BasicBlock *BB = BasicBlock::Create("entry", TheFunction);
   Builder.SetInsertPoint(BB);
   
   // Add all arguments to the symbol table and create their allocas.




From sabre at nondot.org  Sat Apr 19 17:26:30 2008
From: sabre at nondot.org (Chris Lattner)
Date: Sat, 19 Apr 2008 22:26:30 -0000
Subject: [llvm-commits] [llvm] r49969 [1/3] - /llvm/trunk/test/Assembler/
Message-ID: <200804192226.m3JMQVTh032708@zion.cs.uiuc.edu>

Author: lattner
Date: Sat Apr 19 17:26:29 2008
New Revision: 49969

URL: http://llvm.org/viewvc/llvm-project?rev=49969&view=rev
Log:
rename *.llx -> *.ll

Added:
    llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx
    llvm/trunk/test/Assembler/2002-04-07-InfConstant.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx
    llvm/trunk/test/Assembler/2002-04-29-NameBinding.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx
    llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx
    llvm/trunk/test/Assembler/2002-07-14-InternalLossage.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx
    llvm/trunk/test/Assembler/2002-07-14-OpaqueType.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx
    llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx
    llvm/trunk/test/Assembler/2002-07-25-QuoteInString.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx
    llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx
    llvm/trunk/test/Assembler/2002-07-31-SlashInString.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx
    llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx
    llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx
    llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx
    llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx
    llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx
    llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx
    llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx
    llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx
    llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx
    llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx
    llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx
    llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx
    llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx
    llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx
    llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx
    llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx
    llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx
    llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx
    llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx
    llvm/trunk/test/Assembler/2004-02-01-NegativeZero.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx
    llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx
    llvm/trunk/test/Assembler/2004-06-07-VerifierBug.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx
    llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx
    llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx
    llvm/trunk/test/Assembler/ConstantExprFold.ll
      - copied unchanged from r49967, llvm/trunk/test/Assembler/ConstantExprFold.llx
    llvm/trunk/test/Assembler/ConstantExprFoldCast.ll
      - copied unchanged from r49950, llvm/trunk/test/Assembler/ConstantExprFoldCast.llx
Removed:
    llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx
    llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx
    llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx
    llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx
    llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx
    llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx
    llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx
    llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx
    llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx
    llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx
    llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx
    llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx
    llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx
    llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx
    llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx
    llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx
    llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx
    llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx
    llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx
    llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx
    llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx
    llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx
    llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx
    llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx
    llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx
    llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx
    llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx
    llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx
    llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx
    llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx
    llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx
    llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx
    llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx
    llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx
    llvm/trunk/test/Assembler/ConstantExprFold.llx
    llvm/trunk/test/Assembler/ConstantExprFoldCast.llx

Removed: llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx (original)
+++ llvm/trunk/test/Assembler/2002-04-07-HexFloatConstants.llx (removed)
@@ -1,16 +0,0 @@
-; This testcase checks to make sure that the assembler can handle floating 
-; point constants in IEEE hex format. This also checks that the disassembler,
-; when presented with a FP constant that cannot be represented exactly in 
-; exponential form, outputs it correctly in hex format.  This is a distillation
-; of the bug that was causing the Olden Health benchmark to output incorrect
-; results!
-;
-; RUN: llvm-as < %s | opt -constprop | llvm-dis > %t.1
-; RUN: llvm-as < %s | llvm-dis | llvm-as | opt -constprop | \
-; RUN: llvm-dis > %t.2
-; RUN: diff %t.1 %t.2
-
-define double @test() {
-        %tmp = mul double 7.200000e+101, 0x427F4000             ;  [#uses=1]
-        ret double %tmp
-}

Removed: llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx (original)
+++ llvm/trunk/test/Assembler/2002-04-07-InfConstant.llx (removed)
@@ -1,9 +0,0 @@
-; The output formater prints out 1.0e100 as Inf!
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-
-define float @test() {
-        %tmp = mul float 0x7FF0000000000000, 1.000000e+01               ;  [#uses=1]
-        ret float %tmp
-}
-

Removed: llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx (original)
+++ llvm/trunk/test/Assembler/2002-04-29-NameBinding.llx (removed)
@@ -1,18 +0,0 @@
-; There should be NO references to the global v1.  The local v1 should
-; have all of the references!
-;
-; Check by running globaldce, which will remove the constant if there are
-; no references to it!
-; 
-; RUN: llvm-as < %s | opt -globaldce | llvm-dis | \
-; RUN:   not grep constant
-;
-
- at v1 = internal constant i32 5           
-
-define i32 @createtask() {
-        %v1 = alloca i32                ;; Alloca should have one use! 
-        %reg112 = load i32* %v1         ;; This load should not use the global!
-        ret i32 %reg112
-}
-

Removed: llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-08-HugePerformanceProblem.llx (removed)
@@ -1,67 +0,0 @@
-; This file takes about 48 __MINUTES__ to assemble using as.  This is WAY too
-; long.  The type resolution code needs to be sped up a lot.
-; RUN: llvm-as < %s -o /dev/null -f	
-	%ALL_INTERSECTIONS_METHOD = type i32 (%OBJECT*, %RAY*, %ISTACK*)*
-	%BBOX = type { %BBOX_VECT, %BBOX_VECT }
-	%BBOX_TREE = type { i16, i16, %BBOX, %BBOX_TREE** }
-	%BBOX_VECT = type [3 x float]
-	%BLEND_MAP = type { i16, i16, i16, i32, %BLEND_MAP_ENTRY* }
-	%BLEND_MAP_ENTRY = type { float, i8, { %COLOUR, %PIGMENT*, %TNORMAL*, %TEXTURE*, %UV_VECT } }
-	%CAMERA = type { %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, i32, double, double, i32, double, %TNORMAL* }
-	%COLOUR = type [5 x float]
-	%COPY_METHOD = type i8* (%OBJECT*)*
-	%COUNTER = type { i32, i32 }
-	%DENSITY_FILE = type { i32, %DENSITY_FILE_DATA* }
-	%DENSITY_FILE_DATA = type { i32, i8*, i32, i32, i32, i8*** }
-	%DESTROY_METHOD = type void (%OBJECT*)*
-	%FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
-	%FILE_HANDLE = type { i8*, i32, i32, i32, i32, i8*, %FILE*, i32, i32 (%FILE_HANDLE*, i8*, i32*, i32*, i32, i32)*, void (%FILE_HANDLE*, %COLOUR*, i32)*, i32 (%FILE_HANDLE*, %COLOUR*, i32*)*, void (%IMAGE*, i8*)*, void (%FILE_HANDLE*)* }
-	%FINISH = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, %BBOX_VECT, %BBOX_VECT }
-	%FOG = type { i32, double, double, double, %COLOUR, %VECTOR, %TURB*, float, %FOG* }
-	%FRAME = type { %CAMERA*, i32, i32, i32, %LIGHT_SOURCE*, %OBJECT*, double, double, %COLOUR, %COLOUR, %COLOUR, %IMEDIA*, %FOG*, %RAINBOW*, %SKYSPHERE* }
-	%FRAMESEQ = type { i32, double, i32, i32, double, i32, i32, double, i32, double, i32, double, i32, i32 }
-	%IMAGE = type { i32, i32, i32, i32, i32, i16, i16, %VECTOR, float, float, i32, i32, i16, %IMAGE_COLOUR*, { %IMAGE_LINE*, i8** } }
-	%IMAGE_COLOUR = type { i16, i16, i16, i16, i16 }
-	%IMAGE_LINE = type { i8*, i8*, i8*, i8* }
-	%IMEDIA = type { i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, %COLOUR, %COLOUR, %COLOUR, %COLOUR, double, double, double, double*, %PIGMENT*, %IMEDIA* }
-	%INSIDE_METHOD = type i32 (double*, %OBJECT*)*
-	%INTERIOR = type { i32, i32, float, float, float, float, float, %IMEDIA* }
-	%INTERSECTION = type { double, %VECTOR, %VECTOR, %OBJECT*, i32, i32, double, double, i8* }
-	%INVERT_METHOD = type void (%OBJECT*)*
-	%ISTACK = type { %ISTACK*, %INTERSECTION*, i32 }
-	%LIGHT_SOURCE = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32, %OBJECT*, %COLOUR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, %VECTOR, double, double, double, double, double, %LIGHT_SOURCE*, i8, i8, i8, i8, i32, i32, i32, i32, i32, %COLOUR**, %OBJECT*, [6 x %PROJECT_TREE_NODE*] }
-	%MATRIX = type [4 x %VECTOR_4D]
-	%METHODS = type { %ALL_INTERSECTIONS_METHOD, %INSIDE_METHOD, %NORMAL_METHOD, %COPY_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %ROTATE_METHOD, %TRANSFORM_METHOD, %DESTROY_METHOD, %DESTROY_METHOD }
-	%NORMAL_METHOD = type void (double*, %OBJECT*, %INTERSECTION*)*
-	%OBJECT = type { %METHODS*, i32, %OBJECT*, %TEXTURE*, %INTERIOR*, %OBJECT*, %OBJECT*, %BBOX, i32 }
-	%Opts = type { i32, i32, i8, i8, i8, i32, [150 x i8], [150 x i8], [150 x i8], [150 x i8], [150 x i8], double, double, i32, i32, double, double, i32, [25 x i8*], i32, i32, i32, double, double, i32, i32, double, double, double, i32, i32, i32, i32, i32, %FRAMESEQ, double, i32, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [150 x i8], %SHELLDATA*, [150 x i8], i32, i32 }
-	%PIGMENT = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %COLOUR }
-	%PRIORITY_QUEUE = type { i32, i32, %QELEM* }
-	%PROJECT = type { i32, i32, i32, i32 }
-	%PROJECT_QUEUE = type { i32, i32, %PROJECT_TREE_NODE** }
-	%PROJECT_TREE_NODE = type { i16, %BBOX_TREE*, %PROJECT, i16, %PROJECT_TREE_NODE** }
-	%QELEM = type { double, %BBOX_TREE* }
-	%RAINBOW = type { double, double, double, double, double, double, double, %VECTOR, %VECTOR, %VECTOR, %PIGMENT*, %RAINBOW* }
-	%RAY = type { %VECTOR, %VECTOR, i32, [100 x %INTERIOR*] }
-	%RAYINFO = type { %VECTOR, %VECTOR, %VECTORI, %VECTORI }
-	%RGB = type [3 x float]
-	%ROTATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
-	%SCALE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
-	%SHELLDATA = type { i32, i32, [250 x i8] }
-	%SKYSPHERE = type { i32, %PIGMENT**, %TRANSFORM* }
-	%SNGL_VECT = type [3 x float]
-	%TEXTURE = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, %TEXTURE*, %PIGMENT*, %TNORMAL*, %FINISH*, %TEXTURE*, i32 }
-	%TNORMAL = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float }, float }
-	%TPATTERN = type { i16, i16, i16, i32, float, float, float, %WARP*, %TPATTERN*, %BLEND_MAP*, { %DENSITY_FILE*, %IMAGE*, %VECTOR, float, i16, i16, i16, { float, %VECTOR }, %complex.float } }
-	%TRANSFORM = type { %MATRIX, %MATRIX }
-	%TRANSFORM_METHOD = type void (%OBJECT*, %TRANSFORM*)*
-	%TRANSLATE_METHOD = type void (%OBJECT*, double*, %TRANSFORM*)*
-	%TURB = type { i16, %WARP*, %VECTOR, i32, float, float }
-	%UV_VECT = type [2 x double]
-	%VECTOR = type [3 x double]
-	%VECTORI = type [3 x i32]
-	%VECTOR_4D = type [4 x double]
-	%WARP = type { i16, %WARP* }
-	%__FILE = type { i32, i8*, i8*, i8, i8, i32, i32, i32 }
-	%_h_val = type { [2 x i32], double }
-	%complex.float = type { float, float }

Removed: llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-14-InternalLossage.llx (removed)
@@ -1,9 +0,0 @@
-; Test to make sure that the 'internal' tag is not lost!
-;
-; RUN: llvm-as < %s | llvm-dis | grep internal
-
-declare void @foo()
-
-define internal void @foo() {
-        ret void
-}

Removed: llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-14-OpaqueType.llx (removed)
@@ -1,10 +0,0 @@
-; Test that opaque types are preserved correctly
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-;
-
-%Ty = type opaque
-
-define %Ty* @func() {
-	ret %Ty* null
-}
- 

Removed: llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-25-ParserAssertionFailure.llx (removed)
@@ -1,13 +0,0 @@
-; Make sure we don't get an assertion failure, even though this is a parse 
-; error
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {No arguments}
-
-%ty = type void (i32)
-
-declare %ty* @foo()
-
-define void @test() {
-        call %ty* @foo( )               ; <%ty*>:0 [#uses=0]
-        ret void
-}
-

Removed: llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-25-QuoteInString.llx (removed)
@@ -1,5 +0,0 @@
-; Test double quotes in strings work correctly!
-; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
-;
- at str = internal global [6 x i8] c"\22foo\22\00"         ; <[6 x i8]*> [#uses=0]
-

Removed: llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-25-ReturnPtrFunction.llx (removed)
@@ -1,15 +0,0 @@
-; Test that returning a pointer to a function causes the disassembler to print 
-; the right thing.
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
-%ty = type void (i32)
-
-declare %ty* @foo()
-
-define void @test() {
-        call %ty* ()* @foo( )           ; <%ty*>:1 [#uses=0]
-        ret void
-}
-
-

Removed: llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx (original)
+++ llvm/trunk/test/Assembler/2002-07-31-SlashInString.llx (removed)
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | llvm-as 
-
-; Make sure that \\ works in a string initializer
- at Slashtest = internal global [8 x i8] c"\5Cbegin{\00"
-

Removed: llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx (original)
+++ llvm/trunk/test/Assembler/2002-08-16-ConstExprInlined.llx (removed)
@@ -1,22 +0,0 @@
-; In this testcase, the bytecode reader or writer is not correctly handling the
-; ConstExpr reference.  Disassembling this program assembled yields invalid
-; assembly (because there are placeholders still around), which the assembler
-; dies on.
-
-; There are two things that need to be fixed here.  Obviously assembling and
-; disassembling this would be good, but in addition to that, the bytecode
-; reader should NEVER produce a program "successfully" with placeholders still
-; around!
-;
-; RUN: llvm-as < %s | llvm-dis | llvm-as
-
- at .LC0 = internal global [4 x i8] c"foo\00"		; <[4 x i8]*> [#uses=1]
- at X = global i8* null		;  [#uses=0]
-
-declare i32 @puts(i8*)
-
-define void @main() {
-bb1:
-	%reg211 = call i32 @puts( i8* getelementptr ([4 x i8]* @.LC0, i64 0, i64 0) )		;  [#uses=0]
-	ret void
-}

Removed: llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx (original)
+++ llvm/trunk/test/Assembler/2002-08-19-BytecodeReader.llx (removed)
@@ -1,17 +0,0 @@
-; Testcase that seems to break the bytecode reader.  This comes from the
-; "crafty" spec benchmark.
-;
-; RUN: llvm-as < %s | opt -instcombine | llvm-dis | llvm-as
-	
-%CHESS_POSITION = type { i32, i32 }
- at pawn_probes = external global i32		;  [#uses=0]
- at pawn_hash_mask = external global i32		;  [#uses=0]
- at search = external global %CHESS_POSITION		; <%CHESS_POSITION*> [#uses=2]
-
-define void @Evaluate() {
-	%reg1321 = getelementptr %CHESS_POSITION* @search, i64 0, i32 1		;  [#uses=1]
-	%reg114 = load i32* %reg1321		;  [#uses=0]
-	%reg1801 = getelementptr %CHESS_POSITION* @search, i64 0, i32 0		;  [#uses=1]
-	%reg182 = load i32* %reg1801		;  [#uses=0]
-	ret void
-}

Removed: llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx (original)
+++ llvm/trunk/test/Assembler/2002-10-13-ConstantEncodingProblem.llx (removed)
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-%Domain = type { %Domain**, %Domain* }
- at D = global %Domain zeroinitializer             ; <%Domain*> [#uses=0]
-

Removed: llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx (original)
+++ llvm/trunk/test/Assembler/2003-04-15-ConstantInitAssertion.llx (removed)
@@ -1,4 +0,0 @@
-; RUN: not llvm-as < %s >/dev/null |& grep {Expected type 'i32' for element #0}
-; Test the case of a misformed constant initializer
-; This should cause an assembler error, not an assertion failure!
-constant { i32 } { float 1.0 }

Removed: llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx (original)
+++ llvm/trunk/test/Assembler/2003-05-03-BytecodeReaderProblem.llx (removed)
@@ -1,6 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define void @test() {
-        %tmp.123 = trunc i64 0 to i32           ;  [#uses=0]
-        ret void
-}

Removed: llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx (original)
+++ llvm/trunk/test/Assembler/2003-05-12-MinIntProblem.llx (removed)
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep -- -2147483648
-
-define i32 @foo() {
-        ret i32 -2147483648
-}

Removed: llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx (original)
+++ llvm/trunk/test/Assembler/2003-05-15-AssemblerProblem.llx (removed)
@@ -1,14 +0,0 @@
-; This bug was caused by two CPR's existing for the same global variable, 
-; colliding in the Module level CPR map.
-; RUN: llvm-as < %s -o /dev/null -f
-
-define void @test() {
-        call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
-        ret void
-}
-
-define void @AddString(i16* %tmp.124, i32 %tmp.127) {
-        call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
-        ret void
-}
-

Removed: llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx (original)
+++ llvm/trunk/test/Assembler/2003-05-21-MalformedShiftCrash.llx (removed)
@@ -1,4 +0,0 @@
-; Found by inspection of the code
-; RUN: not llvm-as < %s > /dev/null |& grep {Logical operator requires integral}
-
-global i32 ashr (float 1.0, float 2.0)

Removed: llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx (original)
+++ llvm/trunk/test/Assembler/2003-05-21-MalformedStructCrash.llx (removed)
@@ -1,4 +0,0 @@
-; Found by inspection of the code
-; RUN: not llvm-as < %s  > /dev/null |& grep {Illegal number of init}
-
-global {} { i32 7, float 1.0, i32 7, i32 8 }

Removed: llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx (original)
+++ llvm/trunk/test/Assembler/2003-06-17-InvokeDisassemble.llx (removed)
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define void @test() {
-        invoke void @test( )
-                        to label %Next unwind label %Next
-
-Next:           ; preds = %0, %0
-        ret void
-}

Removed: llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx (original)
+++ llvm/trunk/test/Assembler/2003-08-20-ConstantExprGEP-Fold.llx (removed)
@@ -1,16 +0,0 @@
-; RUN: llvm-as < %s | opt -instcombine -simplifycfg | llvm-dis | not grep br
-
- at .str_1 = internal constant [6 x i8] c"_Bool\00"                ; <[6 x i8]*> [#uses=2]
-
-define i32 @test() {
-        %tmp.54 = load i8* getelementptr ([6 x i8]* @.str_1, i64 0, i64 1)            ;  [#uses=1]
-        %tmp.55 = icmp ne i8 %tmp.54, 66                ;  [#uses=1]
-        br i1 %tmp.55, label %then.7, label %endif.7
-
-then.7:         ; preds = %then.7, %0
-        br label %then.7
-
-endif.7:                ; preds = %0
-        ret i32 0
-}
-

Removed: llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx (original)
+++ llvm/trunk/test/Assembler/2003-08-21-ConstantExprCast-Fold.llx (removed)
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep getelementptr
-
- at A = external global { float }          ; <{ float }*> [#uses=2]
-global i32* bitcast ({ float }* @A to i32*)             ; :0 [#uses=0]

Removed: llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx (original)
+++ llvm/trunk/test/Assembler/2003-11-05-ConstantExprShift.llx (removed)
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis
-
-define i32 @test() {
-        ret i32 ashr (i32 ptrtoint (i32 ()* @test to i32), i32 2)
-}

Removed: llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx (original)
+++ llvm/trunk/test/Assembler/2003-11-11-ImplicitRename.llx (removed)
@@ -1,8 +0,0 @@
-; RUN: not llvm-as < %s > /dev/null
-
-void %test() {
-  %X = add int 0, 1
-  %X = add int 1, 2
-  ret void
-}
-

Removed: llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx (original)
+++ llvm/trunk/test/Assembler/2003-11-12-ConstantExprCast.llx (removed)
@@ -1,10 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | not grep { bitcast (}
-
- at .Base64_1 = external constant [4 x i8]         ; <[4 x i8]*> [#uses=1]
-
-define i8 @test(i8 %Y) {
-        %X = bitcast i8 %Y to i8                ;  [#uses=1]
-        %tmp.13 = add i8 %X, sub (i8 0, i8 ptrtoint ([4 x i8]* @.Base64_1 to i8))     ;  [#uses=1]
-        ret i8 %tmp.13
-}
-

Removed: llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx (original)
+++ llvm/trunk/test/Assembler/2003-11-24-SymbolTableCrash.llx (removed)
@@ -1,11 +0,0 @@
-; RUN: not llvm-as < %s |& not grep Asserti
-; RUN: not llvm-as < %s |& grep Redefinition
-
-define void @test() {
-	%tmp.1 = add i32 0, 1
-	br label %return
-return:
-	%tmp.1 = add i32 0, 1
-	ret void
-}
-

Removed: llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx (original)
+++ llvm/trunk/test/Assembler/2003-12-30-TypeMapInvalidMemory.llx (removed)
@@ -1,55 +0,0 @@
-; RUN: not llvm-as < %s -o /dev/null -f |& grep {Undefined type remains}
-; END.
-
- at d_reduction_0_dparser_gram = global { 
-  i32 (i8*, i8**, i32, i32, { 
-    %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, 
-    void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-      void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-      %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, 
-        %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*,
-        %struct.ParseNode_User }**)*, 
-        void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-          void (\8, %struct.d_loc_t*, i8**)*, 
-          %struct.Grammar*, %struct.ParseNode_User }*)*, 
-        %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32,
-        i32 }*)*, 
-        i32 (i8*, i8**, i32, i32, { %struct.Grammar*, 
-        void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, { 
-          i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-          void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-          %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, 
-            %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, 
-            %struct.Grammar*, %struct.ParseNode_User }**)*, 
-            void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-              void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-              %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32,
-              i32, i32, i32, i32, i32, i32, i32, i32 }*)** }
-
-        { i32 (i8*, i8**, i32, i32, { 
-          %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, 
-          %struct.D_Scope*, void (\4)*, { 
-            i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-            void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-            %struct.ParseNode_User 
-          }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-            void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-            %struct.ParseNode_User }**)*, 
-          void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-            void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-            %struct.ParseNode_User }*)*, 
-          %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 
-          i32, i32 }*)* null, 
-        i32 (i8*, i8**, i32, i32, { 
-          %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, 
-          %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, 
-            %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, 
-            %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32, 
-              %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-              void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-              %struct.ParseNode_User }**)*, 
-              void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, 
-                void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, 
-                %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, 
-                i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)** null 
-        }

Removed: llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx (original)
+++ llvm/trunk/test/Assembler/2004-01-11-getelementptrfolding.llx (removed)
@@ -1,12 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | \
-; RUN:   not grep {getelementptr.*getelementptr}
-
-%struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] }
-%struct.TUVVertex = type { i16, i16, i16, i16 }
- at data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer; <[2908 x %struct.TTriangleItem]*> [#uses=2]
-
-define void @foo() {
-        store i16 0, i16* getelementptr ([2908 x %struct.TTriangleItem]* @data_triangleItems, i64 0, i64 0, i32 2, i64 0, i32 0)
-        ret void
-}
-

Removed: llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx (original)
+++ llvm/trunk/test/Assembler/2004-01-20-MaxLongLong.llx (removed)
@@ -1,4 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep 9223372036854775808
-
-global i64 -9223372036854775808
-

Removed: llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx (original)
+++ llvm/trunk/test/Assembler/2004-02-01-NegativeZero.llx (removed)
@@ -1,5 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis | grep -- -0.0
-
-global double 0x8000000000000000
-global float -0.0
-

Removed: llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx (original)
+++ llvm/trunk/test/Assembler/2004-03-30-UnclosedFunctionCrash.llx (removed)
@@ -1,3 +0,0 @@
-; RUN: not llvm-as %s |& grep error
-
-void %foo() {

Removed: llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx (original)
+++ llvm/trunk/test/Assembler/2004-06-07-VerifierBug.llx (removed)
@@ -1,11 +0,0 @@
-; RUN: llvm-as < %s > /dev/null
-
-define void @t() {
-entry:
-     ret void
-
-loop:           ; preds = %loop
-     %tmp.4.i9 = getelementptr i32* null, i32 %tmp.5.i10             ;  [#uses=1]
-     %tmp.5.i10 = load i32* %tmp.4.i9                ;  [#uses=1]
-     br label %loop
-}




From sabre at nondot.org  Sat Apr 19 17:26:30 2008
From: sabre at nondot.org (Chris Lattner)
Date: Sat, 19 Apr 2008 22:26:30 -0000
Subject: [llvm-commits] [llvm] r49969 [3/3] - /llvm/trunk/test/Assembler/
Message-ID: <200804192226.m3JMQWNA032717@zion.cs.uiuc.edu>

Removed: llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx (original)
+++ llvm/trunk/test/Assembler/2004-10-22-BCWriterUndefBug.llx (removed)
@@ -1,5 +0,0 @@
-;; The bytecode writer was trying to treat undef values as ConstantArray's when
-;; they looked like strings.
-;; RUN: llvm-as < %s -o /dev/null -f
- at G = internal global [8 x i8] undef
-

Removed: llvm/trunk/test/Assembler/ConstantExprFold.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/ConstantExprFold.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/ConstantExprFold.llx (original)
+++ llvm/trunk/test/Assembler/ConstantExprFold.llx (removed)
@@ -1,30 +0,0 @@
-; This test checks to make sure that constant exprs fold in some simple 
-; situations
-
-; RUN: llvm-as < %s | llvm-dis | not grep {(}
-
- at A = global i64 0
-
-global i64* inttoptr (i64 add (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X + 0 == X
-global i64* inttoptr (i64 sub (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X - 0 == X
-global i64* inttoptr (i64 mul (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X * 0 == 0
-global i64* inttoptr (i64 sdiv (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X / 1 == X
-global i64* inttoptr (i64 srem (i64 ptrtoint (i64* @A to i64), i64 1) to i64*) ; X % 1 == 0
-global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X & 0 == 0
-global i64* inttoptr (i64 and (i64 ptrtoint (i64* @A to i64), i64 -1) to i64*) ; X & -1 == X
-global i64 or (i64 ptrtoint (i64* @A to i64), i64 -1)  ; X | -1 == -1
-global i64* inttoptr (i64 xor (i64 ptrtoint (i64* @A to i64), i64 0) to i64*) ; X ^ 0 == X
-
-%Ty = type { i32, i32 }
- at B = external global %Ty 
-
-global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 1))        ; true
-global i1 icmp slt (i64* @A, i64* getelementptr (i64* @A, i64 0))        ; false
-global i1 icmp slt (i32* getelementptr (%Ty* @B, i64 0, i32 0), 
-                   i32* getelementptr (%Ty* @B, i64 0, i32 1))            ; true
-;global i1 icmp ne (i64* @A, i64* bitcast (%Ty* @B to i64*))                 ; true
-
-; PR2206
- at cons = weak global i32 0, align 8              ;  [#uses=1]
-global i64 and (i64 ptrtoint (i32* @cons to i64), i64 7)
-

Removed: llvm/trunk/test/Assembler/ConstantExprFoldCast.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/ConstantExprFoldCast.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/ConstantExprFoldCast.llx (original)
+++ llvm/trunk/test/Assembler/ConstantExprFoldCast.llx (removed)
@@ -1,14 +0,0 @@
-; This test checks to make sure that constant exprs fold in some simple situations
-
-; RUN: llvm-as < %s | llvm-dis | not grep cast
-
- at A = global i32* bitcast (i8* null to i32*)  ; Cast null -> fold
- at B = global i32** bitcast (i32** @A to i32**)   ; Cast to same type -> fold
- at C = global i32 trunc (i64 42 to i32)        ; Integral casts
- at D = global i32* bitcast(float*  bitcast (i32* @C to float*) to i32*)  ; cast of cast ptr->ptr
- at E = global i32 ptrtoint(float* inttoptr (i8 5 to float*) to i32)  ; i32 -> ptr -> i32
-
-; Test folding of binary instrs
- at F = global i32* inttoptr (i32 add (i32 5, i32 -5) to i32*)
- at G = global i32* inttoptr (i32 sub (i32 5, i32 5) to i32*)
-




From sabre at nondot.org  Sat Apr 19 17:26:30 2008
From: sabre at nondot.org (Chris Lattner)
Date: Sat, 19 Apr 2008 22:26:30 -0000
Subject: [llvm-commits] [llvm] r49969 [2/3] - /llvm/trunk/test/Assembler/
Message-ID: <200804192226.m3JMQWwo032713@zion.cs.uiuc.edu>

Removed: llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx?rev=49968&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx (original)
+++ llvm/trunk/test/Assembler/2004-09-29-VerifierIsReallySlow.llx (removed)
@@ -1,24452 +0,0 @@
-; Check to see that the verifier does not take an outrageous amount of time on 
-; this testcase.
-; RUN: llvm-as < %s -o /dev/null -f
-
-%"complex long double" = type { double, double }
-%"struct.std::dcomplex" = type { %"complex long double" }
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-declare %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_(%"struct.std::dcomplex"*, %"struct.std::dcomplex"*)
-
-define void @_Z11determinantPA6_St8dcomplex(%"struct.std::dcomplex"* %agg.result, [6 x %"struct.std::dcomplex"]* %_m) {
-entry:
-	%mem_tmp.i34350 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34336 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34322 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34308 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34280 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34266 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34224 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34210 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34134 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34080 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34066 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34038 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34024 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i34010 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33996 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33982 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33940 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33912 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33898 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33864 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33810 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33796 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33768 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33754 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33740 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33712 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33698 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33684 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33670 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33656 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33642 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33628 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33594 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33512 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33498 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33484 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33470 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33456 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33442 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33428 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33414 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33400 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33386 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33372 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33358 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33270 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33214 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33200 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33186 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33172 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33158 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33144 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33130 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33102 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33088 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33074 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i33032 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32998 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32944 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32930 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32916 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32902 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32888 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32874 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32860 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32846 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32832 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32818 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32804 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32776 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32762 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32728 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32674 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32660 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32632 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32618 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32604 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32576 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32562 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32548 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32534 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32520 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32506 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32492 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32458 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32404 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32390 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32376 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32362 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32348 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32334 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32320 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32306 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32292 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32278 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32264 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32250 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32236 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32222 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32134 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32078 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32064 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32050 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32036 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32022 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i32008 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31994 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31980 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31966 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31952 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31938 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31862 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31808 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31794 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31766 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31752 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31738 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31696 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31682 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31668 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31626 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31592 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31538 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31524 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31510 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31496 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31482 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31468 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31440 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31426 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31412 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31398 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31384 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31370 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31356 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31322 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31268 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31240 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31226 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31212 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31198 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31184 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31170 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31156 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31142 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31128 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31114 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31100 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31086 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i31052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30998 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30942 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30928 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30914 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30900 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30886 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30872 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30858 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30844 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30830 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30816 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30802 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30760 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30672 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30658 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30644 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30630 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30616 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30602 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30546 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30532 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30504 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30490 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30456 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30402 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30388 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30374 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30360 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30346 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30332 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30304 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30290 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30276 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30262 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30248 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30234 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30220 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30186 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30132 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30118 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30104 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30090 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30076 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30062 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30048 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30034 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30020 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i30006 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29992 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29978 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29964 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29950 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29916 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29862 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29806 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29792 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29778 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29764 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29750 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29736 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29694 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29680 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29666 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29652 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29638 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29624 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29536 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29522 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29508 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29494 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29480 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29466 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29424 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29410 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29396 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29368 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29354 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29320 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29266 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29224 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29210 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29154 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29140 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29112 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29098 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29084 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i29050 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28996 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28982 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28940 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28912 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28898 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28884 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28870 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28856 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28842 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28828 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28814 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28670 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28614 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28600 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28572 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28558 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28544 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28530 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28516 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28474 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28460 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28398 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28344 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28330 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28288 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28274 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28246 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28232 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28204 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28176 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28162 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28128 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28074 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28032 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28018 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i28004 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27990 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27976 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27962 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27948 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27934 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27920 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27906 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27892 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27858 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27804 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27776 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27762 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27748 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27734 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27720 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27706 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27692 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27678 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27664 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27650 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27636 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27622 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27534 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27478 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27464 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27450 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27436 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27422 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27408 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27394 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27380 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27366 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27352 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27338 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27310 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27296 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27262 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27208 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27194 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27166 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27152 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27138 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27124 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27110 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27096 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27082 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27068 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27054 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27040 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i27026 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26992 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26938 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26882 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26868 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26854 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26840 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26826 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26812 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26798 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26784 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26770 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26756 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26668 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26626 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26612 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26598 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26584 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26570 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26556 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26542 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26528 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26514 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26500 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26486 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26398 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26342 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26328 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26314 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26300 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26286 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26272 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26258 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26244 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26230 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26216 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26202 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26174 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26160 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26072 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26058 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26044 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26030 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26016 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i26002 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25988 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25974 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25960 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25946 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25932 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25918 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25904 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25890 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25856 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25802 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25760 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25746 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25732 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25718 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25704 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25690 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25676 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25648 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25634 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25620 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25532 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25504 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25490 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25476 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25462 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25448 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25434 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25420 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25406 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25392 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25378 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25364 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25350 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25262 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25206 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25192 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25178 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25164 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25150 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25136 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25122 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25108 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25094 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25080 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25066 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25038 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i25024 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24990 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24936 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24922 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24908 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24894 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24880 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24866 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24852 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24838 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24824 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24810 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24796 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24768 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24754 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24720 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24666 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24652 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24638 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24624 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24610 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24596 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24582 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24568 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24554 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24512 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24498 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24484 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24450 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24396 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24368 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24354 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24340 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24326 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24312 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24298 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24284 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24270 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24256 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24242 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24228 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24214 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24070 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24056 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24042 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24028 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24014 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i24000 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23986 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23972 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23958 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23944 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23930 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23916 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23902 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23888 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23854 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23800 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23786 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23772 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23758 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23744 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23730 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23702 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23688 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23674 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23660 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23632 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23618 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23584 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23530 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23516 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23474 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23460 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23418 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23404 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23390 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23376 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23362 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23348 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23314 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23246 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23232 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23204 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23176 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23162 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23148 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23134 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23120 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23106 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23092 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23078 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i23044 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22990 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22934 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22878 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22864 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22850 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22836 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22822 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22808 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22794 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22766 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22752 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22738 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22696 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22608 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22594 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22580 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22566 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22552 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22538 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22524 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22510 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22496 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22482 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22468 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22440 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22426 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22392 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22338 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22310 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22296 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22282 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22268 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22240 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22226 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22212 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22198 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22184 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22170 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22156 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22122 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22068 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22054 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22040 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22026 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i22012 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21998 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21984 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21970 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21956 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21942 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21928 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21914 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21900 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21886 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21852 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21798 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21742 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21728 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21714 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21700 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21686 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21672 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21658 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21644 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21630 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21616 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21602 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21472 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21458 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21444 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21430 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21416 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21402 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21388 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21374 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21360 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21346 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21332 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21304 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21290 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21256 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21202 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21174 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21160 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21146 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21132 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21118 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21104 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21090 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21076 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21062 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21048 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21034 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i21020 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20986 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20932 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20918 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20904 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20890 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20876 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20862 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20848 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20834 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20820 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20806 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20792 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20778 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20764 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20750 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20606 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20592 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20578 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20564 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20550 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20536 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20522 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20508 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20494 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20480 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20466 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20424 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20390 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20336 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20322 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20308 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20280 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20266 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20224 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20210 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20154 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20120 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20066 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20038 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20024 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i20010 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19996 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19982 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19940 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19912 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19898 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19884 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19850 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19796 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19768 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19754 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19740 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19712 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19698 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19684 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19670 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19656 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19642 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19628 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19614 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19580 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19470 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19456 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19442 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19428 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19414 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19400 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19386 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19372 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19358 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19344 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19330 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19288 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19200 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19186 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19172 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19158 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19144 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19130 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19102 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19088 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19074 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19032 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i19018 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18984 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18930 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18916 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18902 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18888 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18874 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18860 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18846 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18832 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18818 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18804 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18776 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18762 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18748 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18714 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18660 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18632 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18618 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18604 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18576 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18562 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18548 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18534 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18520 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18506 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18492 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18478 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18444 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18390 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18334 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18320 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18306 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18292 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18278 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18264 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18250 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18236 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18222 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18208 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18194 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18166 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18152 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18118 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18064 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18050 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18036 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18022 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i18008 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17994 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17980 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17966 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17952 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17938 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17882 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17848 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17794 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17766 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17752 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17738 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17696 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17682 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17668 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17626 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17612 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17578 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17524 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17510 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17496 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17482 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17468 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17440 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17426 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17412 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17398 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17384 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17370 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17356 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17342 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17308 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17198 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17142 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17128 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17114 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17100 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17086 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17072 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17058 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17044 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17030 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17016 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i17002 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16988 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16974 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16960 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16872 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16858 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16844 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16830 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16816 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16802 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16760 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16746 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16732 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16718 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16704 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16690 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16656 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16602 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16546 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16532 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16504 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16490 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16476 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16462 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16448 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16434 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16420 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16386 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16332 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16304 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16290 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16276 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16262 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16248 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16234 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16220 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16206 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16192 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16178 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16164 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16150 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16062 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i16006 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15992 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15978 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15964 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15950 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15936 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15922 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15908 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15894 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15880 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15866 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15852 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15838 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15824 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15736 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15694 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15680 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15666 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15652 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15638 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15624 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15610 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15596 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15582 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15568 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15554 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15520 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15466 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15424 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15410 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15396 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15368 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15354 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15340 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15326 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15312 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15298 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15284 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15250 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15154 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15140 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15112 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15098 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15084 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15070 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15056 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15042 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15028 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i15014 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14980 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14870 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14856 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14842 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14828 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14814 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14800 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14786 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14772 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14758 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14744 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14730 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14702 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14688 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14600 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14572 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14558 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14544 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14530 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14516 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14474 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14460 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14418 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14384 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14330 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14288 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14274 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14246 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14232 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14204 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14176 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14162 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14148 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14114 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14032 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14018 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i14004 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13990 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13976 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13962 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13948 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13934 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13920 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13906 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13892 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13878 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13844 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13734 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13720 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13706 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13692 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13678 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13664 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13650 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13636 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13622 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13608 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13594 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13580 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13566 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13552 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13464 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13450 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13436 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13422 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13408 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13394 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13380 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13366 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13352 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13338 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13310 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13296 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13282 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13248 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13194 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13166 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13152 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13138 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13124 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13110 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13096 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13082 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13068 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13054 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13040 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13026 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i13012 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12978 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12882 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12868 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12854 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12840 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12826 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12812 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12798 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12784 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12770 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12756 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12742 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12598 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12584 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12570 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12556 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12542 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12528 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12514 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12500 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12486 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12472 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12458 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12444 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12430 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12416 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12328 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12314 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12300 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12286 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12272 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12258 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12244 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12230 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12216 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12202 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12174 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12160 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12146 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12112 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12058 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12044 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12030 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12016 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i12002 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11988 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11974 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11960 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11946 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11932 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11918 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11904 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11890 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11876 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11842 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11760 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11746 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11732 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11718 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11704 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11690 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11676 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11648 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11634 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11620 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11606 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11572 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11462 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11406 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11392 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11378 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11364 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11350 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11336 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11322 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11308 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11280 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11266 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11224 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11136 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11122 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11108 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11094 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11080 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11066 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11038 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11024 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i11010 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10996 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10982 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10920 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10866 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10852 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10838 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10824 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10810 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10796 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10768 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10754 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10740 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10712 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10698 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10684 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10650 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10596 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10582 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10568 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10554 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10512 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10498 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10484 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10470 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10456 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10442 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10428 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10414 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10380 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10326 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10270 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10256 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10242 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10228 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10214 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10200 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10186 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10172 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10158 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10144 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10130 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10102 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10088 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10054 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i10000 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9986 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9972 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9958 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9944 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9930 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9916 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9902 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9888 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9874 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9860 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9846 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9832 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9818 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9784 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9730 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9702 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9688 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9674 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9660 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9632 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9618 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9604 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9576 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9562 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9548 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9514 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9460 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9418 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9404 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9390 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9376 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9362 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9348 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9334 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9320 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9306 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9292 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9278 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9244 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9134 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9120 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9106 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9092 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9078 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9064 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9050 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9036 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9022 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i9008 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8994 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8980 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8966 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8952 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8918 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8864 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8850 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8836 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8822 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8808 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8794 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8766 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8752 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8738 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8696 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8682 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8648 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8594 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8580 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8566 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8552 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8538 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8524 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8510 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8496 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8482 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8468 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8440 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8426 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8412 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8378 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8310 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8296 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8282 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8268 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8240 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8226 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8212 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8198 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8184 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8170 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8156 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8142 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8108 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i8054 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7998 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7984 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7970 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7956 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7942 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7928 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7914 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7900 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7886 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7872 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7858 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7844 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7830 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7816 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7728 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7714 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7700 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7686 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7672 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7658 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7644 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7630 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7616 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7602 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7546 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7512 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7458 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7444 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7430 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7416 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7402 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7388 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7374 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7360 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7346 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7332 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7304 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7290 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7276 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7242 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7174 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7160 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7146 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7132 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7118 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7104 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7090 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7076 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7062 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7048 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7034 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7020 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i7006 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6972 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6918 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6862 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6848 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6834 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6820 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6806 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6792 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6778 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6764 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6750 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6736 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6694 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6680 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6592 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6578 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6564 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6550 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6536 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6522 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6508 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6494 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6480 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6466 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6424 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6410 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6376 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6322 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6308 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6280 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6266 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6224 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6210 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6154 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6140 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6106 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6052 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6038 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6024 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i6010 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5996 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5982 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5940 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5926 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5912 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5898 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5884 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5870 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5836 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5782 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5670 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5656 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5642 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5628 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5614 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5600 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5572 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5558 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5544 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5530 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5516 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5400 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5386 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5372 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5358 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5344 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5330 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5288 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5274 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5246 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5232 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5184 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5130 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5102 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5088 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5074 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5032 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5018 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i5004 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4990 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4976 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4962 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4948 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4914 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4860 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4846 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4832 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4818 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4804 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4790 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4776 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4762 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4748 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4734 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4720 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4706 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4692 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4678 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4644 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4534 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4520 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4506 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4492 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4478 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4464 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4450 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4436 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4422 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4408 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4394 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4380 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4366 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4352 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4264 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4250 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4236 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4222 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4208 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4194 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4166 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4152 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4138 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4124 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4110 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4096 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4082 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i4048 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3994 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3980 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3966 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3952 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3938 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3882 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3868 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3854 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3840 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3826 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3812 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3778 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3696 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3682 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3668 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3654 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3626 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3612 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3598 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3584 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3570 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3556 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3542 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3508 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3454 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3398 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3384 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3370 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3356 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3342 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3328 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3314 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3300 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3286 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3272 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3258 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3244 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3230 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3216 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3128 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3114 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3100 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3086 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3072 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3058 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3044 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3030 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3016 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i3002 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2988 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2974 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2960 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2946 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2912 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2858 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2844 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2830 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2816 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2802 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2760 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2746 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2732 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2718 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2704 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2690 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2676 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2642 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2546 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2532 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2504 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2490 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2476 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2462 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2448 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2434 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2420 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2406 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2372 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2318 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2262 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2248 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2234 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2220 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2206 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2192 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2178 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2164 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2150 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2136 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2122 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2108 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2094 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2080 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i2046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1992 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1978 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1964 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1950 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1936 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1922 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1908 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1894 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1880 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1866 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1852 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1838 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1824 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1810 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1776 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1694 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1680 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1666 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1652 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1638 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1624 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1610 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1596 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1582 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1568 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1554 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1506 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1424 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1410 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1396 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1368 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1354 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1340 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1326 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1312 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1298 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1284 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1270 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1236 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1112 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1098 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1084 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1070 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1056 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1042 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1028 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1014 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i1000 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i986 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i972 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i958 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i944 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i856 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i842 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i828 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i814 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i800 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i786 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i772 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i758 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i744 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i730 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i702 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i688 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i674 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i572 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i558 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i544 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i530 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i516 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i474 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i460 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i418 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i404 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i370 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i288 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i274 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i246 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i232 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i204 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i176 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i162 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i148 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i134 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i100 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i46 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.i = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%ret5 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=8]
-	%ret4 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=32]
-	%ret3 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=122]
-	%mem_tmp.5 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.6 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.9 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.10 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.13 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.20 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.21 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.24 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.25 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.28 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.35 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.36 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.39 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.40 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.43 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.50 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.51 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.54 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.55 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.58 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.66 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.67 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.70 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.71 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.74 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.81 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.82 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.85 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.86 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.89 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.96 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.97 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.100 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.101 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.104 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.111 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.112 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.115 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.116 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.119 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.127 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.128 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.131 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.132 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.135 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.142 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.143 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.146 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.147 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.150 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.157 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.158 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.161 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.162 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.165 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.172 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.173 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.176 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.177 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.180 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.188 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.189 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.192 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.193 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.196 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.203 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.204 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.207 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.208 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.211 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.218 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.219 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.222 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.223 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.226 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.233 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.234 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.237 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.238 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.241 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.249 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.250 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.253 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.254 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.257 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.264 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.265 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.268 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.269 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.272 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.279 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.280 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.283 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.284 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.287 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.295 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.298 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.299 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.302 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.311 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.312 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.315 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.316 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.319 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.326 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.327 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.330 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.331 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.334 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.341 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.342 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.345 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.346 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.349 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.356 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.357 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.360 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.361 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.364 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.372 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.373 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.376 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.377 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.380 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.387 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.388 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.391 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.392 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.395 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.402 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.403 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.406 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.407 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.410 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.417 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.418 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.421 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.422 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.425 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.433 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.434 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.437 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.438 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.441 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.448 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.449 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.452 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.453 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.456 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.463 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.464 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.467 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.468 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.471 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.478 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.479 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.482 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.483 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.486 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.494 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.495 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.498 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.499 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.502 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.509 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.510 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.513 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.514 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.517 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.524 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.525 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.528 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.529 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.532 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.539 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.543 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.544 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.547 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.555 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.556 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.559 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.560 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.563 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.570 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.571 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.574 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.575 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.578 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.585 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.586 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.589 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.590 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.593 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.600 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.601 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.604 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.605 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.608 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.617 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.618 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.621 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.622 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.625 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.632 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.633 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.636 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.637 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.640 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.647 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.648 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.651 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.652 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.655 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.663 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.666 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.667 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.670 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.678 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.679 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.682 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.683 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.686 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.693 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.694 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.697 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.698 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.701 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.708 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.709 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.712 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.713 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.716 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.723 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.724 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.727 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.728 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.731 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.739 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.740 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.743 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.744 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.747 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.754 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.755 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.758 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.759 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.762 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.769 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.770 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.773 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.774 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.777 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.784 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.785 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.788 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.789 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.792 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.800 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.801 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.804 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.805 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.808 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.815 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.816 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.819 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.820 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.823 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.830 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.831 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.834 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.835 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.838 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.845 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.846 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.849 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.850 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.853 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.861 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.862 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.865 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.866 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.869 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.876 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.877 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.880 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.881 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.884 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.891 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.892 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.895 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.896 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.899 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.906 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.907 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.910 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.911 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.914 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.923 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.924 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.927 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.928 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.931 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.938 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.939 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.942 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.943 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.946 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.953 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.954 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.957 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.958 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.961 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.968 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.969 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.972 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.973 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.976 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.984 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.985 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.988 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.989 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.992 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.999 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1000 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1003 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1004 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1007 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1014 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1015 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1018 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1019 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1022 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1029 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1030 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1033 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1034 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1037 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1045 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1046 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1049 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1050 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1053 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1060 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1061 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1064 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1065 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1068 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1075 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1076 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1079 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1080 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1083 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1090 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1091 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1094 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1095 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1098 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1106 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1107 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1110 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1111 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1114 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1121 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1122 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1125 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1126 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1129 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1136 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1137 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1140 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1141 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1144 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1151 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1152 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1155 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1156 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1159 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1167 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1168 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1171 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1172 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1175 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1182 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1183 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1186 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1187 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1190 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1197 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1198 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1201 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1202 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1205 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1212 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1213 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1216 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1217 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1220 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1229 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1230 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1233 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1234 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1237 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1244 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1245 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1248 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1249 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1252 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1259 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1260 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1263 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1264 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1267 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1274 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1275 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1278 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1279 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1282 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1290 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1291 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1294 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1295 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1298 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1305 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1306 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1309 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1310 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1313 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1320 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1321 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1324 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1325 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1328 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1335 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1336 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1339 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1340 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1343 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1351 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1352 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1355 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1356 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1359 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1366 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1367 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1370 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1371 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1374 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1381 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1382 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1385 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1386 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1389 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1396 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1397 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1400 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1401 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1404 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1412 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1413 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1416 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1417 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1420 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1427 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1428 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1431 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1432 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1435 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1442 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1443 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1446 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1447 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1450 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1457 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1458 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1461 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1462 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1465 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1473 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1474 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1477 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1478 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1481 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1488 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1489 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1492 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1493 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1496 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1503 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1504 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1507 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1508 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1511 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1518 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1519 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1522 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1523 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1526 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1535 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1536 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1539 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1540 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1543 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1550 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1551 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1554 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1555 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1558 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1565 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1566 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1569 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1570 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1573 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1580 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1581 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1584 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1585 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1588 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1596 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1597 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1600 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1601 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1604 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1611 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1612 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1615 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1616 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1619 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1626 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1627 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1630 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1631 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1634 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1641 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1642 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1645 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1646 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1649 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1657 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1658 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1661 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1662 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1665 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1672 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1673 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1676 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1677 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1680 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1687 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1688 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1691 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1692 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1695 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1702 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1703 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1706 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1707 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1710 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1718 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1719 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1722 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1723 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1726 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1733 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1734 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1737 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1738 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1741 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1748 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1749 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1752 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1753 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1756 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1763 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1764 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1767 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1768 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1771 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1779 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1780 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1783 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1784 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1787 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1794 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1795 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1798 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1799 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1802 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1809 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1810 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1813 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1814 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1817 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1824 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1825 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1828 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1829 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%mem_tmp.1832 = alloca %"struct.std::dcomplex"		; <%"struct.std::dcomplex"*> [#uses=3]
-	%tmp.2.i = getelementptr %"struct.std::dcomplex"* %agg.result, i32 0, i32 0, i32 0		;  [#uses=13]
-	store double 0.000000e+00, double* %tmp.2.i
-	%tmp.6.i = getelementptr %"struct.std::dcomplex"* %agg.result, i32 0, i32 0, i32 1		;  [#uses=13]
-	store double 0.000000e+00, double* %tmp.6.i
-	%tmp.2.i34368 = getelementptr %"struct.std::dcomplex"* %ret5, i32 0, i32 0, i32 0		;  [#uses=66]
-	store double 0.000000e+00, double* %tmp.2.i34368
-	%tmp.6.i34369 = getelementptr %"struct.std::dcomplex"* %ret5, i32 0, i32 0, i32 1		;  [#uses=66]
-	store double 0.000000e+00, double* %tmp.6.i34369
-	%tmp.2.i34366 = getelementptr %"struct.std::dcomplex"* %ret4, i32 0, i32 0, i32 0		;  [#uses=270]
-	store double 0.000000e+00, double* %tmp.2.i34366
-	%tmp.6.i34367 = getelementptr %"struct.std::dcomplex"* %ret4, i32 0, i32 0, i32 1		;  [#uses=270]
-	store double 0.000000e+00, double* %tmp.6.i34367
-	%tmp.2.i34364 = getelementptr %"struct.std::dcomplex"* %ret3, i32 0, i32 0, i32 0		;  [#uses=121]
-	store double 0.000000e+00, double* %tmp.2.i34364
-	%tmp.6.i34365 = getelementptr %"struct.std::dcomplex"* %ret3, i32 0, i32 0, i32 1		;  [#uses=121]
-	store double 0.000000e+00, double* %tmp.6.i34365
-	%tmp.6 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 1		; <%"struct.std::dcomplex"*> [#uses=120]
-	%tmp.4.i34351 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34350, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i34352 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 0, i32 0, i32 0		;  [#uses=120]
-	%tmp.6.i34353 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i34353, double* %tmp.4.i34351
-	%tmp.7.i34354 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34350, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i34355 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 0, i32 0, i32 1		;  [#uses=120]
-	%tmp.9.i34356 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i34356, double* %tmp.7.i34354
-	%tmp.0.i34357 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34350, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34359 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34357, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34360 = load double* %tmp.14.i34359		;  [#uses=1]
-	%tmp.17.i34362 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34357, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34363 = load double* %tmp.17.i34362		;  [#uses=1]
-	%tmp.12 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 0		; <%"struct.std::dcomplex"*> [#uses=120]
-	%tmp.4.i34337 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34336, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i34338 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 1, i32 0, i32 0		;  [#uses=120]
-	%tmp.6.i34339 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i34339, double* %tmp.4.i34337
-	%tmp.7.i34340 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34336, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i34341 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 1, i32 0, i32 1		;  [#uses=120]
-	%tmp.9.i34342 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i34342, double* %tmp.7.i34340
-	%tmp.0.i34343 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34336, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34344 = getelementptr %"struct.std::dcomplex"* %mem_tmp.5, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34345 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34343, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34346 = load double* %tmp.14.i34345		;  [#uses=1]
-	store double %tmp.15.i34346, double* %tmp.13.i34344
-	%tmp.16.i34347 = getelementptr %"struct.std::dcomplex"* %mem_tmp.5, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34348 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34343, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34349 = load double* %tmp.17.i34348		;  [#uses=1]
-	store double %tmp.18.i34349, double* %tmp.16.i34347
-	%tmp.4.i34323 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34322, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34360, double* %tmp.4.i34323
-	%tmp.7.i34326 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34322, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34363, double* %tmp.7.i34326
-	%tmp.0.i34329 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34322, %"struct.std::dcomplex"* %mem_tmp.5 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34331 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34329, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34332 = load double* %tmp.14.i34331		;  [#uses=1]
-	%tmp.17.i34334 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34329, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34335 = load double* %tmp.17.i34334		;  [#uses=1]
-	%tmp.15 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 2		; <%"struct.std::dcomplex"*> [#uses=60]
-	%tmp.4.i34309 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34308, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34332, double* %tmp.4.i34309
-	%tmp.7.i34312 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34308, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34335, double* %tmp.7.i34312
-	%tmp.0.i34315 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34308, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34317 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34315, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34318 = load double* %tmp.14.i34317		;  [#uses=1]
-	%tmp.17.i34320 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34315, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34321 = load double* %tmp.17.i34320		;  [#uses=1]
-	%tmp.21 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 2		; <%"struct.std::dcomplex"*> [#uses=120]
-	%tmp.4.i34295 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34294, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34297 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i34297, double* %tmp.4.i34295
-	%tmp.7.i34298 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34294, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34300 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i34300, double* %tmp.7.i34298
-	%tmp.0.i34301 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34294, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34303 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34301, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34304 = load double* %tmp.14.i34303		;  [#uses=1]
-	%tmp.17.i34306 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34301, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34307 = load double* %tmp.17.i34306		;  [#uses=1]
-	%tmp.4.i34281 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34280, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i34282 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 2, i32 0, i32 0		;  [#uses=120]
-	%tmp.6.i34283 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i34283, double* %tmp.4.i34281
-	%tmp.7.i34284 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34280, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i34285 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 2, i32 0, i32 1		;  [#uses=120]
-	%tmp.9.i34286 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i34286, double* %tmp.7.i34284
-	%tmp.0.i34287 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34280, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34288 = getelementptr %"struct.std::dcomplex"* %mem_tmp.9, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34289 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34287, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34290 = load double* %tmp.14.i34289		;  [#uses=1]
-	store double %tmp.15.i34290, double* %tmp.13.i34288
-	%tmp.16.i34291 = getelementptr %"struct.std::dcomplex"* %mem_tmp.9, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34292 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34287, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34293 = load double* %tmp.17.i34292		;  [#uses=1]
-	store double %tmp.18.i34293, double* %tmp.16.i34291
-	%tmp.4.i34267 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34266, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34304, double* %tmp.4.i34267
-	%tmp.7.i34270 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34266, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34307, double* %tmp.7.i34270
-	%tmp.0.i34273 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34266, %"struct.std::dcomplex"* %mem_tmp.9 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34275 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34273, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34276 = load double* %tmp.14.i34275		;  [#uses=1]
-	%tmp.17.i34278 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34273, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34279 = load double* %tmp.17.i34278		;  [#uses=1]
-	%tmp.30 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 0		; <%"struct.std::dcomplex"*> [#uses=60]
-	%tmp.4.i34253 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34252, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34276, double* %tmp.4.i34253
-	%tmp.7.i34256 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34252, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34279, double* %tmp.7.i34256
-	%tmp.0.i34259 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34252, %"struct.std::dcomplex"* %tmp.30 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34260 = getelementptr %"struct.std::dcomplex"* %mem_tmp.6, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34261 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34259, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34262 = load double* %tmp.14.i34261		;  [#uses=1]
-	store double %tmp.15.i34262, double* %tmp.13.i34260
-	%tmp.16.i34263 = getelementptr %"struct.std::dcomplex"* %mem_tmp.6, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34264 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34259, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34265 = load double* %tmp.17.i34264		;  [#uses=1]
-	store double %tmp.18.i34265, double* %tmp.16.i34263
-	%tmp.4.i34239 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34238, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34318, double* %tmp.4.i34239
-	%tmp.7.i34242 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34238, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34321, double* %tmp.7.i34242
-	%tmp.0.i34245 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34238, %"struct.std::dcomplex"* %mem_tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34247 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34245, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34248 = load double* %tmp.14.i34247		;  [#uses=1]
-	%tmp.17.i34250 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34245, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34251 = load double* %tmp.17.i34250		;  [#uses=1]
-	%tmp.4.i34225 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34224, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34227 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i34227, double* %tmp.4.i34225
-	%tmp.7.i34228 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34224, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34230 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i34230, double* %tmp.7.i34228
-	%tmp.0.i34231 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34224, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34233 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34231, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34234 = load double* %tmp.14.i34233		;  [#uses=1]
-	%tmp.17.i34236 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34231, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34237 = load double* %tmp.17.i34236		;  [#uses=1]
-	%tmp.4.i34211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34210, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34213 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i34213, double* %tmp.4.i34211
-	%tmp.7.i34214 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34210, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34216 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i34216, double* %tmp.7.i34214
-	%tmp.0.i34217 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34210, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.13, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34219 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34217, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34220 = load double* %tmp.14.i34219		;  [#uses=1]
-	store double %tmp.15.i34220, double* %tmp.13.i34218
-	%tmp.16.i34221 = getelementptr %"struct.std::dcomplex"* %mem_tmp.13, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34222 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34217, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34223 = load double* %tmp.17.i34222		;  [#uses=1]
-	store double %tmp.18.i34223, double* %tmp.16.i34221
-	%tmp.4.i34197 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34196, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34234, double* %tmp.4.i34197
-	%tmp.7.i34200 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34196, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34237, double* %tmp.7.i34200
-	%tmp.0.i34203 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34196, %"struct.std::dcomplex"* %mem_tmp.13 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34205 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34203, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34206 = load double* %tmp.14.i34205		;  [#uses=1]
-	%tmp.17.i34208 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34203, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34209 = load double* %tmp.17.i34208		;  [#uses=1]
-	%tmp.45 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 1		; <%"struct.std::dcomplex"*> [#uses=60]
-	%tmp.4.i34183 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34182, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34206, double* %tmp.4.i34183
-	%tmp.7.i34186 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34182, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34209, double* %tmp.7.i34186
-	%tmp.0.i34189 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34182, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.10, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34191 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34189, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34192 = load double* %tmp.14.i34191		;  [#uses=1]
-	store double %tmp.15.i34192, double* %tmp.13.i34190
-	%tmp.16.i34193 = getelementptr %"struct.std::dcomplex"* %mem_tmp.10, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34194 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34189, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34195 = load double* %tmp.17.i34194		;  [#uses=1]
-	store double %tmp.18.i34195, double* %tmp.16.i34193
-	%tmp.4.i34169 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34168, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34248, double* %tmp.4.i34169
-	%tmp.7.i34172 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34168, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34251, double* %tmp.7.i34172
-	%tmp.0.i34175 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34168, %"struct.std::dcomplex"* %mem_tmp.10 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34177 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34175, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34178 = load double* %tmp.14.i34177		;  [#uses=1]
-	%tmp.17.i34180 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34175, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34181 = load double* %tmp.17.i34180		;  [#uses=1]
-	store double %tmp.15.i34178, double* %tmp.2.i34364
-	store double %tmp.18.i34181, double* %tmp.6.i34365
-	%tmp.4.i34135 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34134, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i34136 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 3, i32 0, i32 0		;  [#uses=20]
-	%tmp.6.i34137 = load double* %tmp.5.i34136		;  [#uses=1]
-	store double %tmp.6.i34137, double* %tmp.4.i34135
-	%tmp.7.i34138 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34134, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i34139 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 3, i32 0, i32 1		;  [#uses=20]
-	%tmp.9.i34140 = load double* %tmp.8.i34139		;  [#uses=1]
-	store double %tmp.9.i34140, double* %tmp.7.i34138
-	%tmp.0.i34141 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34134, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34143 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34141, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34144 = load double* %tmp.14.i34143		;  [#uses=1]
-	%tmp.17.i34146 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34141, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34147 = load double* %tmp.17.i34146		;  [#uses=1]
-	%tmp.7.i34101 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i34115 = add double %tmp.7.i34101, %tmp.15.i34144		;  [#uses=1]
-	store double %tmp.15.i34115, double* %tmp.2.i34366
-	%tmp.26.i34122 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i34133 = add double %tmp.26.i34122, %tmp.18.i34147		;  [#uses=1]
-	store double %tmp.31.i34133, double* %tmp.6.i34367
-	%tmp.4.i34081 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34080, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i34082 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 3, i32 0, i32 0		;  [#uses=120]
-	%tmp.6.i34083 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i34083, double* %tmp.4.i34081
-	%tmp.7.i34084 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34080, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i34085 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 3, i32 0, i32 1		;  [#uses=120]
-	%tmp.9.i34086 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i34086, double* %tmp.7.i34084
-	%tmp.0.i34087 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34080, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34089 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34087, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34090 = load double* %tmp.14.i34089		;  [#uses=1]
-	%tmp.17.i34092 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34087, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34093 = load double* %tmp.17.i34092		;  [#uses=1]
-	%tmp.62 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 3		; <%"struct.std::dcomplex"*> [#uses=120]
-	%tmp.4.i34067 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34066, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34069 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i34069, double* %tmp.4.i34067
-	%tmp.7.i34070 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34066, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34072 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i34072, double* %tmp.7.i34070
-	%tmp.0.i34073 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34066, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34074 = getelementptr %"struct.std::dcomplex"* %mem_tmp.20, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34075 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34073, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34076 = load double* %tmp.14.i34075		;  [#uses=1]
-	store double %tmp.15.i34076, double* %tmp.13.i34074
-	%tmp.16.i34077 = getelementptr %"struct.std::dcomplex"* %mem_tmp.20, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34078 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34073, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34079 = load double* %tmp.17.i34078		;  [#uses=1]
-	store double %tmp.18.i34079, double* %tmp.16.i34077
-	%tmp.4.i34053 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34052, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34090, double* %tmp.4.i34053
-	%tmp.7.i34056 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34052, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34093, double* %tmp.7.i34056
-	%tmp.0.i34059 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i34052, %"struct.std::dcomplex"* %mem_tmp.20 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34061 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34059, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34062 = load double* %tmp.14.i34061		;  [#uses=1]
-	%tmp.17.i34064 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34059, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34065 = load double* %tmp.17.i34064		;  [#uses=1]
-	%tmp.4.i34039 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34038, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34062, double* %tmp.4.i34039
-	%tmp.7.i34042 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34038, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34065, double* %tmp.7.i34042
-	%tmp.0.i34045 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34038, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34047 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34045, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34048 = load double* %tmp.14.i34047		;  [#uses=1]
-	%tmp.17.i34050 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34045, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34051 = load double* %tmp.17.i34050		;  [#uses=1]
-	%tmp.4.i34025 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34024, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34027 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i34027, double* %tmp.4.i34025
-	%tmp.7.i34028 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34024, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34030 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i34030, double* %tmp.7.i34028
-	%tmp.0.i34031 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34024, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34033 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34031, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34034 = load double* %tmp.14.i34033		;  [#uses=1]
-	%tmp.17.i34036 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34031, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34037 = load double* %tmp.17.i34036		;  [#uses=1]
-	%tmp.4.i34011 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34010, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i34013 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i34013, double* %tmp.4.i34011
-	%tmp.7.i34014 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i34010, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i34016 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i34016, double* %tmp.7.i34014
-	%tmp.0.i34017 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i34010, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i34018 = getelementptr %"struct.std::dcomplex"* %mem_tmp.24, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i34019 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34017, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34020 = load double* %tmp.14.i34019		;  [#uses=1]
-	store double %tmp.15.i34020, double* %tmp.13.i34018
-	%tmp.16.i34021 = getelementptr %"struct.std::dcomplex"* %mem_tmp.24, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i34022 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34017, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34023 = load double* %tmp.17.i34022		;  [#uses=1]
-	store double %tmp.18.i34023, double* %tmp.16.i34021
-	%tmp.4.i33997 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33996, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34034, double* %tmp.4.i33997
-	%tmp.7.i34000 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33996, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34037, double* %tmp.7.i34000
-	%tmp.0.i34003 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33996, %"struct.std::dcomplex"* %mem_tmp.24 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i34005 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34003, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i34006 = load double* %tmp.14.i34005		;  [#uses=1]
-	%tmp.17.i34008 = getelementptr %"struct.std::dcomplex"* %tmp.0.i34003, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i34009 = load double* %tmp.17.i34008		;  [#uses=1]
-	%tmp.4.i33983 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33982, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34006, double* %tmp.4.i33983
-	%tmp.7.i33986 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33982, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34009, double* %tmp.7.i33986
-	%tmp.0.i33989 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33982, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33990 = getelementptr %"struct.std::dcomplex"* %mem_tmp.21, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33991 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33989, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33992 = load double* %tmp.14.i33991		;  [#uses=1]
-	store double %tmp.15.i33992, double* %tmp.13.i33990
-	%tmp.16.i33993 = getelementptr %"struct.std::dcomplex"* %mem_tmp.21, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33994 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33989, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33995 = load double* %tmp.17.i33994		;  [#uses=1]
-	store double %tmp.18.i33995, double* %tmp.16.i33993
-	%tmp.4.i33969 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33968, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i34048, double* %tmp.4.i33969
-	%tmp.7.i33972 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33968, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i34051, double* %tmp.7.i33972
-	%tmp.0.i33975 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33968, %"struct.std::dcomplex"* %mem_tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33977 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33975, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33978 = load double* %tmp.14.i33977		;  [#uses=1]
-	%tmp.17.i33980 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33975, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33981 = load double* %tmp.17.i33980		;  [#uses=1]
-	%tmp.4.i33955 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33954, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33957 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i33957, double* %tmp.4.i33955
-	%tmp.7.i33958 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33954, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33960 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i33960, double* %tmp.7.i33958
-	%tmp.0.i33961 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33954, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33963 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33961, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33964 = load double* %tmp.14.i33963		;  [#uses=1]
-	%tmp.17.i33966 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33961, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33967 = load double* %tmp.17.i33966		;  [#uses=1]
-	%tmp.4.i33941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33940, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33943 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i33943, double* %tmp.4.i33941
-	%tmp.7.i33944 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33940, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33946 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i33946, double* %tmp.7.i33944
-	%tmp.0.i33947 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33940, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.28, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33949 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33947, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33950 = load double* %tmp.14.i33949		;  [#uses=1]
-	store double %tmp.15.i33950, double* %tmp.13.i33948
-	%tmp.16.i33951 = getelementptr %"struct.std::dcomplex"* %mem_tmp.28, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33952 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33947, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33953 = load double* %tmp.17.i33952		;  [#uses=1]
-	store double %tmp.18.i33953, double* %tmp.16.i33951
-	%tmp.4.i33927 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33926, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33964, double* %tmp.4.i33927
-	%tmp.7.i33930 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33926, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33967, double* %tmp.7.i33930
-	%tmp.0.i33933 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33926, %"struct.std::dcomplex"* %mem_tmp.28 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33935 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33933, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33936 = load double* %tmp.14.i33935		;  [#uses=1]
-	%tmp.17.i33938 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33933, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33939 = load double* %tmp.17.i33938		;  [#uses=1]
-	%tmp.95 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 3		; <%"struct.std::dcomplex"*> [#uses=60]
-	%tmp.4.i33913 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33912, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33936, double* %tmp.4.i33913
-	%tmp.7.i33916 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33912, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33939, double* %tmp.7.i33916
-	%tmp.0.i33919 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33912, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.25, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33921 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33919, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33922 = load double* %tmp.14.i33921		;  [#uses=1]
-	store double %tmp.15.i33922, double* %tmp.13.i33920
-	%tmp.16.i33923 = getelementptr %"struct.std::dcomplex"* %mem_tmp.25, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33924 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33919, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33925 = load double* %tmp.17.i33924		;  [#uses=1]
-	store double %tmp.18.i33925, double* %tmp.16.i33923
-	%tmp.4.i33899 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33898, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33978, double* %tmp.4.i33899
-	%tmp.7.i33902 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33898, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33981, double* %tmp.7.i33902
-	%tmp.0.i33905 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33898, %"struct.std::dcomplex"* %mem_tmp.25 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33907 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33905, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33908 = load double* %tmp.14.i33907		;  [#uses=1]
-	%tmp.17.i33910 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33905, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33911 = load double* %tmp.17.i33910		;  [#uses=1]
-	store double %tmp.15.i33908, double* %tmp.2.i34364
-	store double %tmp.18.i33911, double* %tmp.6.i34365
-	%tmp.4.i33865 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33864, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i33866 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 0, i32 0, i32 0		;  [#uses=20]
-	%tmp.6.i33867 = load double* %tmp.5.i33866		;  [#uses=1]
-	store double %tmp.6.i33867, double* %tmp.4.i33865
-	%tmp.7.i33868 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33864, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i33869 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 0, i32 0, i32 1		;  [#uses=20]
-	%tmp.9.i33870 = load double* %tmp.8.i33869		;  [#uses=1]
-	store double %tmp.9.i33870, double* %tmp.7.i33868
-	%tmp.0.i33871 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33864, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33873 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33871, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33874 = load double* %tmp.14.i33873		;  [#uses=1]
-	%tmp.17.i33876 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33871, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33877 = load double* %tmp.17.i33876		;  [#uses=1]
-	%tmp.7.i33831 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i33845 = add double %tmp.7.i33831, %tmp.15.i33874		;  [#uses=1]
-	store double %tmp.15.i33845, double* %tmp.2.i34366
-	%tmp.26.i33852 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i33863 = add double %tmp.26.i33852, %tmp.18.i33877		;  [#uses=1]
-	store double %tmp.31.i33863, double* %tmp.6.i34367
-	%tmp.4.i33811 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33810, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33813 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i33813, double* %tmp.4.i33811
-	%tmp.7.i33814 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33810, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33816 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i33816, double* %tmp.7.i33814
-	%tmp.0.i33817 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33810, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33819 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33817, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33820 = load double* %tmp.14.i33819		;  [#uses=1]
-	%tmp.17.i33822 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33817, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33823 = load double* %tmp.17.i33822		;  [#uses=1]
-	%tmp.4.i33797 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33796, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33799 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i33799, double* %tmp.4.i33797
-	%tmp.7.i33800 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33796, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33802 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i33802, double* %tmp.7.i33800
-	%tmp.0.i33803 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33796, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33804 = getelementptr %"struct.std::dcomplex"* %mem_tmp.35, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33805 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33803, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33806 = load double* %tmp.14.i33805		;  [#uses=1]
-	store double %tmp.15.i33806, double* %tmp.13.i33804
-	%tmp.16.i33807 = getelementptr %"struct.std::dcomplex"* %mem_tmp.35, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33808 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33803, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33809 = load double* %tmp.17.i33808		;  [#uses=1]
-	store double %tmp.18.i33809, double* %tmp.16.i33807
-	%tmp.4.i33783 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33782, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33820, double* %tmp.4.i33783
-	%tmp.7.i33786 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33782, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33823, double* %tmp.7.i33786
-	%tmp.0.i33789 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33782, %"struct.std::dcomplex"* %mem_tmp.35 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33791 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33789, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33792 = load double* %tmp.14.i33791		;  [#uses=1]
-	%tmp.17.i33794 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33789, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33795 = load double* %tmp.17.i33794		;  [#uses=1]
-	%tmp.4.i33769 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33768, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33792, double* %tmp.4.i33769
-	%tmp.7.i33772 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33768, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33795, double* %tmp.7.i33772
-	%tmp.0.i33775 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33768, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33777 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33775, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33778 = load double* %tmp.14.i33777		;  [#uses=1]
-	%tmp.17.i33780 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33775, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33781 = load double* %tmp.17.i33780		;  [#uses=1]
-	%tmp.4.i33755 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33754, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33757 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i33757, double* %tmp.4.i33755
-	%tmp.7.i33758 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33754, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33760 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i33760, double* %tmp.7.i33758
-	%tmp.0.i33761 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33754, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33763 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33761, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33764 = load double* %tmp.14.i33763		;  [#uses=1]
-	%tmp.17.i33766 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33761, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33767 = load double* %tmp.17.i33766		;  [#uses=1]
-	%tmp.4.i33741 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33740, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33743 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33743, double* %tmp.4.i33741
-	%tmp.7.i33744 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33740, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33746 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33746, double* %tmp.7.i33744
-	%tmp.0.i33747 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33740, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33748 = getelementptr %"struct.std::dcomplex"* %mem_tmp.39, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33749 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33747, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33750 = load double* %tmp.14.i33749		;  [#uses=1]
-	store double %tmp.15.i33750, double* %tmp.13.i33748
-	%tmp.16.i33751 = getelementptr %"struct.std::dcomplex"* %mem_tmp.39, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33752 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33747, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33753 = load double* %tmp.17.i33752		;  [#uses=1]
-	store double %tmp.18.i33753, double* %tmp.16.i33751
-	%tmp.4.i33727 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33726, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33764, double* %tmp.4.i33727
-	%tmp.7.i33730 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33726, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33767, double* %tmp.7.i33730
-	%tmp.0.i33733 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33726, %"struct.std::dcomplex"* %mem_tmp.39 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33735 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33733, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33736 = load double* %tmp.14.i33735		;  [#uses=1]
-	%tmp.17.i33738 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33733, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33739 = load double* %tmp.17.i33738		;  [#uses=1]
-	%tmp.4.i33713 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33712, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33736, double* %tmp.4.i33713
-	%tmp.7.i33716 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33712, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33739, double* %tmp.7.i33716
-	%tmp.0.i33719 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33712, %"struct.std::dcomplex"* %tmp.30 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33720 = getelementptr %"struct.std::dcomplex"* %mem_tmp.36, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33721 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33719, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33722 = load double* %tmp.14.i33721		;  [#uses=1]
-	store double %tmp.15.i33722, double* %tmp.13.i33720
-	%tmp.16.i33723 = getelementptr %"struct.std::dcomplex"* %mem_tmp.36, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33724 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33719, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33725 = load double* %tmp.17.i33724		;  [#uses=1]
-	store double %tmp.18.i33725, double* %tmp.16.i33723
-	%tmp.4.i33699 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33698, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33778, double* %tmp.4.i33699
-	%tmp.7.i33702 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33698, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33781, double* %tmp.7.i33702
-	%tmp.0.i33705 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33698, %"struct.std::dcomplex"* %mem_tmp.36 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33707 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33705, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33708 = load double* %tmp.14.i33707		;  [#uses=1]
-	%tmp.17.i33710 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33705, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33711 = load double* %tmp.17.i33710		;  [#uses=1]
-	%tmp.4.i33685 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33684, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33687 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33687, double* %tmp.4.i33685
-	%tmp.7.i33688 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33684, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33690 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33690, double* %tmp.7.i33688
-	%tmp.0.i33691 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33684, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33693 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33691, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33694 = load double* %tmp.14.i33693		;  [#uses=1]
-	%tmp.17.i33696 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33691, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33697 = load double* %tmp.17.i33696		;  [#uses=1]
-	%tmp.4.i33671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33670, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33673 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i33673, double* %tmp.4.i33671
-	%tmp.7.i33674 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33670, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33676 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i33676, double* %tmp.7.i33674
-	%tmp.0.i33677 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33670, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.43, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33679 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33677, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33680 = load double* %tmp.14.i33679		;  [#uses=1]
-	store double %tmp.15.i33680, double* %tmp.13.i33678
-	%tmp.16.i33681 = getelementptr %"struct.std::dcomplex"* %mem_tmp.43, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33682 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33677, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33683 = load double* %tmp.17.i33682		;  [#uses=1]
-	store double %tmp.18.i33683, double* %tmp.16.i33681
-	%tmp.4.i33657 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33656, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33694, double* %tmp.4.i33657
-	%tmp.7.i33660 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33656, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33697, double* %tmp.7.i33660
-	%tmp.0.i33663 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33656, %"struct.std::dcomplex"* %mem_tmp.43 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33665 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33663, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33666 = load double* %tmp.14.i33665		;  [#uses=1]
-	%tmp.17.i33668 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33663, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33669 = load double* %tmp.17.i33668		;  [#uses=1]
-	%tmp.4.i33643 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33642, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33666, double* %tmp.4.i33643
-	%tmp.7.i33646 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33642, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33669, double* %tmp.7.i33646
-	%tmp.0.i33649 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33642, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.40, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33651 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33649, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33652 = load double* %tmp.14.i33651		;  [#uses=1]
-	store double %tmp.15.i33652, double* %tmp.13.i33650
-	%tmp.16.i33653 = getelementptr %"struct.std::dcomplex"* %mem_tmp.40, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33654 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33649, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33655 = load double* %tmp.17.i33654		;  [#uses=1]
-	store double %tmp.18.i33655, double* %tmp.16.i33653
-	%tmp.4.i33629 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33628, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33708, double* %tmp.4.i33629
-	%tmp.7.i33632 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33628, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33711, double* %tmp.7.i33632
-	%tmp.0.i33635 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33628, %"struct.std::dcomplex"* %mem_tmp.40 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33637 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33635, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33638 = load double* %tmp.14.i33637		;  [#uses=1]
-	%tmp.17.i33640 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33635, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33641 = load double* %tmp.17.i33640		;  [#uses=1]
-	store double %tmp.15.i33638, double* %tmp.2.i34364
-	store double %tmp.18.i33641, double* %tmp.6.i34365
-	%tmp.4.i33595 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33594, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i33596 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 1, i32 0, i32 0		;  [#uses=20]
-	%tmp.6.i33597 = load double* %tmp.5.i33596		;  [#uses=1]
-	store double %tmp.6.i33597, double* %tmp.4.i33595
-	%tmp.7.i33598 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33594, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i33599 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 1, i32 0, i32 1		;  [#uses=20]
-	%tmp.9.i33600 = load double* %tmp.8.i33599		;  [#uses=1]
-	store double %tmp.9.i33600, double* %tmp.7.i33598
-	%tmp.0.i33601 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33594, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33603 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33601, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33604 = load double* %tmp.14.i33603		;  [#uses=1]
-	%tmp.17.i33606 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33601, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33607 = load double* %tmp.17.i33606		;  [#uses=1]
-	%tmp.7.i33561 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i33575 = add double %tmp.7.i33561, %tmp.15.i33604		;  [#uses=1]
-	store double %tmp.15.i33575, double* %tmp.2.i34366
-	%tmp.26.i33582 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i33593 = add double %tmp.26.i33582, %tmp.18.i33607		;  [#uses=1]
-	store double %tmp.31.i33593, double* %tmp.6.i34367
-	%tmp.4.i33541 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33540, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33543 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i33543, double* %tmp.4.i33541
-	%tmp.7.i33544 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33540, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33546 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i33546, double* %tmp.7.i33544
-	%tmp.0.i33547 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33540, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33549 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33547, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33550 = load double* %tmp.14.i33549		;  [#uses=1]
-	%tmp.17.i33552 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33547, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33553 = load double* %tmp.17.i33552		;  [#uses=1]
-	%tmp.4.i33527 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33526, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33529 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33529, double* %tmp.4.i33527
-	%tmp.7.i33530 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33526, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33532 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33532, double* %tmp.7.i33530
-	%tmp.0.i33533 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33526, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33534 = getelementptr %"struct.std::dcomplex"* %mem_tmp.50, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33535 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33533, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33536 = load double* %tmp.14.i33535		;  [#uses=1]
-	store double %tmp.15.i33536, double* %tmp.13.i33534
-	%tmp.16.i33537 = getelementptr %"struct.std::dcomplex"* %mem_tmp.50, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33538 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33533, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33539 = load double* %tmp.17.i33538		;  [#uses=1]
-	store double %tmp.18.i33539, double* %tmp.16.i33537
-	%tmp.4.i33513 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33512, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33550, double* %tmp.4.i33513
-	%tmp.7.i33516 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33512, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33553, double* %tmp.7.i33516
-	%tmp.0.i33519 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33512, %"struct.std::dcomplex"* %mem_tmp.50 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33521 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33519, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33522 = load double* %tmp.14.i33521		;  [#uses=1]
-	%tmp.17.i33524 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33519, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33525 = load double* %tmp.17.i33524		;  [#uses=1]
-	%tmp.4.i33499 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33498, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33522, double* %tmp.4.i33499
-	%tmp.7.i33502 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33498, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33525, double* %tmp.7.i33502
-	%tmp.0.i33505 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33498, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33507 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33505, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33508 = load double* %tmp.14.i33507		;  [#uses=1]
-	%tmp.17.i33510 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33505, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33511 = load double* %tmp.17.i33510		;  [#uses=1]
-	%tmp.4.i33485 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33484, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33487 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i33487, double* %tmp.4.i33485
-	%tmp.7.i33488 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33484, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33490 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i33490, double* %tmp.7.i33488
-	%tmp.0.i33491 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33484, %"struct.std::dcomplex"* %tmp.12 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33493 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33491, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33494 = load double* %tmp.14.i33493		;  [#uses=1]
-	%tmp.17.i33496 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33491, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33497 = load double* %tmp.17.i33496		;  [#uses=1]
-	%tmp.4.i33471 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33470, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33473 = load double* %tmp.5.i34352		;  [#uses=1]
-	store double %tmp.6.i33473, double* %tmp.4.i33471
-	%tmp.7.i33474 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33470, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33476 = load double* %tmp.8.i34355		;  [#uses=1]
-	store double %tmp.9.i33476, double* %tmp.7.i33474
-	%tmp.0.i33477 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33470, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33478 = getelementptr %"struct.std::dcomplex"* %mem_tmp.54, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33479 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33477, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33480 = load double* %tmp.14.i33479		;  [#uses=1]
-	store double %tmp.15.i33480, double* %tmp.13.i33478
-	%tmp.16.i33481 = getelementptr %"struct.std::dcomplex"* %mem_tmp.54, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33482 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33477, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33483 = load double* %tmp.17.i33482		;  [#uses=1]
-	store double %tmp.18.i33483, double* %tmp.16.i33481
-	%tmp.4.i33457 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33456, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33494, double* %tmp.4.i33457
-	%tmp.7.i33460 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33456, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33497, double* %tmp.7.i33460
-	%tmp.0.i33463 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33456, %"struct.std::dcomplex"* %mem_tmp.54 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33465 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33463, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33466 = load double* %tmp.14.i33465		;  [#uses=1]
-	%tmp.17.i33468 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33463, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33469 = load double* %tmp.17.i33468		;  [#uses=1]
-	%tmp.4.i33443 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33442, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33466, double* %tmp.4.i33443
-	%tmp.7.i33446 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33442, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33469, double* %tmp.7.i33446
-	%tmp.0.i33449 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33442, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33450 = getelementptr %"struct.std::dcomplex"* %mem_tmp.51, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33451 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33449, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33452 = load double* %tmp.14.i33451		;  [#uses=1]
-	store double %tmp.15.i33452, double* %tmp.13.i33450
-	%tmp.16.i33453 = getelementptr %"struct.std::dcomplex"* %mem_tmp.51, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33454 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33449, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33455 = load double* %tmp.17.i33454		;  [#uses=1]
-	store double %tmp.18.i33455, double* %tmp.16.i33453
-	%tmp.4.i33429 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33428, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33508, double* %tmp.4.i33429
-	%tmp.7.i33432 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33428, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33511, double* %tmp.7.i33432
-	%tmp.0.i33435 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33428, %"struct.std::dcomplex"* %mem_tmp.51 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33437 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33435, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33438 = load double* %tmp.14.i33437		;  [#uses=1]
-	%tmp.17.i33440 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33435, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33441 = load double* %tmp.17.i33440		;  [#uses=1]
-	%tmp.4.i33415 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33414, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33417 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33417, double* %tmp.4.i33415
-	%tmp.7.i33418 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33414, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33420 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33420, double* %tmp.7.i33418
-	%tmp.0.i33421 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33414, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33423 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33421, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33424 = load double* %tmp.14.i33423		;  [#uses=1]
-	%tmp.17.i33426 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33421, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33427 = load double* %tmp.17.i33426		;  [#uses=1]
-	%tmp.4.i33401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33400, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33403 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i33403, double* %tmp.4.i33401
-	%tmp.7.i33404 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33400, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33406 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i33406, double* %tmp.7.i33404
-	%tmp.0.i33407 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33400, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.58, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33409 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33407, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33410 = load double* %tmp.14.i33409		;  [#uses=1]
-	store double %tmp.15.i33410, double* %tmp.13.i33408
-	%tmp.16.i33411 = getelementptr %"struct.std::dcomplex"* %mem_tmp.58, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33412 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33407, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33413 = load double* %tmp.17.i33412		;  [#uses=1]
-	store double %tmp.18.i33413, double* %tmp.16.i33411
-	%tmp.4.i33387 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33386, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33424, double* %tmp.4.i33387
-	%tmp.7.i33390 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33386, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33427, double* %tmp.7.i33390
-	%tmp.0.i33393 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33386, %"struct.std::dcomplex"* %mem_tmp.58 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33395 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33393, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33396 = load double* %tmp.14.i33395		;  [#uses=1]
-	%tmp.17.i33398 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33393, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33399 = load double* %tmp.17.i33398		;  [#uses=1]
-	%tmp.4.i33373 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33372, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33396, double* %tmp.4.i33373
-	%tmp.7.i33376 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33372, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33399, double* %tmp.7.i33376
-	%tmp.0.i33379 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33372, %"struct.std::dcomplex"* %tmp.30 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.55, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33381 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33379, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33382 = load double* %tmp.14.i33381		;  [#uses=1]
-	store double %tmp.15.i33382, double* %tmp.13.i33380
-	%tmp.16.i33383 = getelementptr %"struct.std::dcomplex"* %mem_tmp.55, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33384 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33379, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33385 = load double* %tmp.17.i33384		;  [#uses=1]
-	store double %tmp.18.i33385, double* %tmp.16.i33383
-	%tmp.4.i33359 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33358, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33438, double* %tmp.4.i33359
-	%tmp.7.i33362 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33358, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33441, double* %tmp.7.i33362
-	%tmp.0.i33365 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33358, %"struct.std::dcomplex"* %mem_tmp.55 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33367 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33365, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33368 = load double* %tmp.14.i33367		;  [#uses=1]
-	%tmp.17.i33370 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33365, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33371 = load double* %tmp.17.i33370		;  [#uses=1]
-	store double %tmp.15.i33368, double* %tmp.2.i34364
-	store double %tmp.18.i33371, double* %tmp.6.i34365
-	%tmp.4.i33325 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33324, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i33326 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 2, i32 0, i32 0		;  [#uses=20]
-	%tmp.6.i33327 = load double* %tmp.5.i33326		;  [#uses=1]
-	store double %tmp.6.i33327, double* %tmp.4.i33325
-	%tmp.7.i33328 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33324, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i33329 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 2, i32 0, i32 1		;  [#uses=20]
-	%tmp.9.i33330 = load double* %tmp.8.i33329		;  [#uses=1]
-	store double %tmp.9.i33330, double* %tmp.7.i33328
-	%tmp.0.i33331 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33324, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33333 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33331, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33334 = load double* %tmp.14.i33333		;  [#uses=1]
-	%tmp.17.i33336 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33331, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33337 = load double* %tmp.17.i33336		;  [#uses=1]
-	%tmp.7.i33291 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i33305 = add double %tmp.7.i33291, %tmp.15.i33334		;  [#uses=1]
-	store double %tmp.15.i33305, double* %tmp.2.i34366
-	%tmp.26.i33312 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i33323 = add double %tmp.26.i33312, %tmp.18.i33337		;  [#uses=1]
-	store double %tmp.31.i33323, double* %tmp.6.i34367
-	%tmp.4.i33271 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33270, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i33272 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 4, i32 0, i32 0		;  [#uses=5]
-	%tmp.6.i33273 = load double* %tmp.5.i33272		;  [#uses=1]
-	store double %tmp.6.i33273, double* %tmp.4.i33271
-	%tmp.7.i33274 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33270, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i33275 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 4, i32 4, i32 0, i32 1		;  [#uses=5]
-	%tmp.9.i33276 = load double* %tmp.8.i33275		;  [#uses=1]
-	store double %tmp.9.i33276, double* %tmp.7.i33274
-	%tmp.0.i33277 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33270, %"struct.std::dcomplex"* %ret4 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33279 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33277, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33280 = load double* %tmp.14.i33279		;  [#uses=1]
-	%tmp.17.i33282 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33277, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33283 = load double* %tmp.17.i33282		;  [#uses=1]
-	%tmp.7.i33237 = load double* %tmp.2.i34368		;  [#uses=1]
-	%tmp.15.i33251 = add double %tmp.7.i33237, %tmp.15.i33280		;  [#uses=1]
-	store double %tmp.15.i33251, double* %tmp.2.i34368
-	%tmp.26.i33258 = load double* %tmp.6.i34369		;  [#uses=1]
-	%tmp.31.i33269 = add double %tmp.26.i33258, %tmp.18.i33283		;  [#uses=1]
-	store double %tmp.31.i33269, double* %tmp.6.i34369
-	store double 0.000000e+00, double* %tmp.2.i34366
-	store double 0.000000e+00, double* %tmp.6.i34367
-	%tmp.4.i33215 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33214, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33217 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i33217, double* %tmp.4.i33215
-	%tmp.7.i33218 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33214, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33220 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i33220, double* %tmp.7.i33218
-	%tmp.0.i33221 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33214, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33223 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33221, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33224 = load double* %tmp.14.i33223		;  [#uses=1]
-	%tmp.17.i33226 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33221, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33227 = load double* %tmp.17.i33226		;  [#uses=1]
-	%tmp.4.i33201 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33200, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33203 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33203, double* %tmp.4.i33201
-	%tmp.7.i33204 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33200, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33206 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33206, double* %tmp.7.i33204
-	%tmp.0.i33207 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33200, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33208 = getelementptr %"struct.std::dcomplex"* %mem_tmp.66, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33209 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33207, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33210 = load double* %tmp.14.i33209		;  [#uses=1]
-	store double %tmp.15.i33210, double* %tmp.13.i33208
-	%tmp.16.i33211 = getelementptr %"struct.std::dcomplex"* %mem_tmp.66, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33212 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33207, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33213 = load double* %tmp.17.i33212		;  [#uses=1]
-	store double %tmp.18.i33213, double* %tmp.16.i33211
-	%tmp.4.i33187 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33186, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33224, double* %tmp.4.i33187
-	%tmp.7.i33190 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33186, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33227, double* %tmp.7.i33190
-	%tmp.0.i33193 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33186, %"struct.std::dcomplex"* %mem_tmp.66 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33195 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33193, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33196 = load double* %tmp.14.i33195		;  [#uses=1]
-	%tmp.17.i33198 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33193, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33199 = load double* %tmp.17.i33198		;  [#uses=1]
-	%tmp.220 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 2, i32 4		; <%"struct.std::dcomplex"*> [#uses=60]
-	%tmp.4.i33173 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33172, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33196, double* %tmp.4.i33173
-	%tmp.7.i33176 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33172, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33199, double* %tmp.7.i33176
-	%tmp.0.i33179 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33172, %"struct.std::dcomplex"* %tmp.220 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33181 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33179, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33182 = load double* %tmp.14.i33181		;  [#uses=1]
-	%tmp.17.i33184 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33179, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33185 = load double* %tmp.17.i33184		;  [#uses=1]
-	%tmp.226 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 1, i32 4		; <%"struct.std::dcomplex"*> [#uses=120]
-	%tmp.4.i33159 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33158, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33161 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i33161, double* %tmp.4.i33159
-	%tmp.7.i33162 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33158, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33164 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i33164, double* %tmp.7.i33162
-	%tmp.0.i33165 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33158, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33167 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33165, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33168 = load double* %tmp.14.i33167		;  [#uses=1]
-	%tmp.17.i33170 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33165, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33171 = load double* %tmp.17.i33170		;  [#uses=1]
-	%tmp.4.i33145 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33144, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i33146 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 4, i32 0, i32 0		;  [#uses=120]
-	%tmp.6.i33147 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i33147, double* %tmp.4.i33145
-	%tmp.7.i33148 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33144, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i33149 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 0, i32 4, i32 0, i32 1		;  [#uses=120]
-	%tmp.9.i33150 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i33150, double* %tmp.7.i33148
-	%tmp.0.i33151 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33144, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33152 = getelementptr %"struct.std::dcomplex"* %mem_tmp.70, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33153 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33151, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33154 = load double* %tmp.14.i33153		;  [#uses=1]
-	store double %tmp.15.i33154, double* %tmp.13.i33152
-	%tmp.16.i33155 = getelementptr %"struct.std::dcomplex"* %mem_tmp.70, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33156 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33151, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33157 = load double* %tmp.17.i33156		;  [#uses=1]
-	store double %tmp.18.i33157, double* %tmp.16.i33155
-	%tmp.4.i33131 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33130, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33168, double* %tmp.4.i33131
-	%tmp.7.i33134 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33130, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33171, double* %tmp.7.i33134
-	%tmp.0.i33137 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33130, %"struct.std::dcomplex"* %mem_tmp.70 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33139 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33137, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33140 = load double* %tmp.14.i33139		;  [#uses=1]
-	%tmp.17.i33142 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33137, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33143 = load double* %tmp.17.i33142		;  [#uses=1]
-	%tmp.4.i33117 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33116, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33140, double* %tmp.4.i33117
-	%tmp.7.i33120 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33116, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33143, double* %tmp.7.i33120
-	%tmp.0.i33123 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33116, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33124 = getelementptr %"struct.std::dcomplex"* %mem_tmp.67, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33125 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33123, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33126 = load double* %tmp.14.i33125		;  [#uses=1]
-	store double %tmp.15.i33126, double* %tmp.13.i33124
-	%tmp.16.i33127 = getelementptr %"struct.std::dcomplex"* %mem_tmp.67, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33128 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33123, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33129 = load double* %tmp.17.i33128		;  [#uses=1]
-	store double %tmp.18.i33129, double* %tmp.16.i33127
-	%tmp.4.i33103 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33102, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33182, double* %tmp.4.i33103
-	%tmp.7.i33106 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33102, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33185, double* %tmp.7.i33106
-	%tmp.0.i33109 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33102, %"struct.std::dcomplex"* %mem_tmp.67 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33111 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33109, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33112 = load double* %tmp.14.i33111		;  [#uses=1]
-	%tmp.17.i33114 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33109, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33115 = load double* %tmp.17.i33114		;  [#uses=1]
-	%tmp.4.i33089 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33088, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33091 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i33091, double* %tmp.4.i33089
-	%tmp.7.i33092 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33088, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33094 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i33094, double* %tmp.7.i33092
-	%tmp.0.i33095 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33088, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33097 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33095, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33098 = load double* %tmp.14.i33097		;  [#uses=1]
-	%tmp.17.i33100 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33095, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33101 = load double* %tmp.17.i33100		;  [#uses=1]
-	%tmp.4.i33075 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33074, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33077 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i33077, double* %tmp.4.i33075
-	%tmp.7.i33078 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33074, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33080 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i33080, double* %tmp.7.i33078
-	%tmp.0.i33081 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33074, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33082 = getelementptr %"struct.std::dcomplex"* %mem_tmp.74, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33083 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33081, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33084 = load double* %tmp.14.i33083		;  [#uses=1]
-	store double %tmp.15.i33084, double* %tmp.13.i33082
-	%tmp.16.i33085 = getelementptr %"struct.std::dcomplex"* %mem_tmp.74, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33086 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33081, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33087 = load double* %tmp.17.i33086		;  [#uses=1]
-	store double %tmp.18.i33087, double* %tmp.16.i33085
-	%tmp.4.i33061 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33060, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33098, double* %tmp.4.i33061
-	%tmp.7.i33064 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33060, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33101, double* %tmp.7.i33064
-	%tmp.0.i33067 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i33060, %"struct.std::dcomplex"* %mem_tmp.74 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33069 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33067, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33070 = load double* %tmp.14.i33069		;  [#uses=1]
-	%tmp.17.i33072 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33067, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33073 = load double* %tmp.17.i33072		;  [#uses=1]
-	%tmp.4.i33047 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33046, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33070, double* %tmp.4.i33047
-	%tmp.7.i33050 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33046, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33073, double* %tmp.7.i33050
-	%tmp.0.i33053 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33046, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i33054 = getelementptr %"struct.std::dcomplex"* %mem_tmp.71, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i33055 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33053, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33056 = load double* %tmp.14.i33055		;  [#uses=1]
-	store double %tmp.15.i33056, double* %tmp.13.i33054
-	%tmp.16.i33057 = getelementptr %"struct.std::dcomplex"* %mem_tmp.71, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i33058 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33053, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33059 = load double* %tmp.17.i33058		;  [#uses=1]
-	store double %tmp.18.i33059, double* %tmp.16.i33057
-	%tmp.4.i33033 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33032, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i33112, double* %tmp.4.i33033
-	%tmp.7.i33036 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i33032, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i33115, double* %tmp.7.i33036
-	%tmp.0.i33039 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i33032, %"struct.std::dcomplex"* %mem_tmp.71 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33041 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33039, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33042 = load double* %tmp.14.i33041		;  [#uses=1]
-	%tmp.17.i33044 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33039, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33045 = load double* %tmp.17.i33044		;  [#uses=1]
-	store double %tmp.15.i33042, double* %tmp.2.i34364
-	store double %tmp.18.i33045, double* %tmp.6.i34365
-	%tmp.4.i32999 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32998, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i33001 = load double* %tmp.5.i33326		;  [#uses=1]
-	store double %tmp.6.i33001, double* %tmp.4.i32999
-	%tmp.7.i33002 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32998, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i33004 = load double* %tmp.8.i33329		;  [#uses=1]
-	store double %tmp.9.i33004, double* %tmp.7.i33002
-	%tmp.0.i33005 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32998, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i33007 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33005, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i33008 = load double* %tmp.14.i33007		;  [#uses=1]
-	%tmp.17.i33010 = getelementptr %"struct.std::dcomplex"* %tmp.0.i33005, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i33011 = load double* %tmp.17.i33010		;  [#uses=1]
-	%tmp.7.i32965 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i32979 = add double %tmp.7.i32965, %tmp.15.i33008		;  [#uses=1]
-	store double %tmp.15.i32979, double* %tmp.2.i34366
-	%tmp.26.i32986 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i32997 = add double %tmp.26.i32986, %tmp.18.i33011		;  [#uses=1]
-	store double %tmp.31.i32997, double* %tmp.6.i34367
-	%tmp.4.i32945 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32944, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32947 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i32947, double* %tmp.4.i32945
-	%tmp.7.i32948 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32944, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32950 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i32950, double* %tmp.7.i32948
-	%tmp.0.i32951 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32944, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32953 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32951, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32954 = load double* %tmp.14.i32953		;  [#uses=1]
-	%tmp.17.i32956 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32951, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32957 = load double* %tmp.17.i32956		;  [#uses=1]
-	%tmp.4.i32931 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32930, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32933 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i32933, double* %tmp.4.i32931
-	%tmp.7.i32934 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32930, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32936 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i32936, double* %tmp.7.i32934
-	%tmp.0.i32937 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32930, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32938 = getelementptr %"struct.std::dcomplex"* %mem_tmp.81, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32939 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32937, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32940 = load double* %tmp.14.i32939		;  [#uses=1]
-	store double %tmp.15.i32940, double* %tmp.13.i32938
-	%tmp.16.i32941 = getelementptr %"struct.std::dcomplex"* %mem_tmp.81, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32942 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32937, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32943 = load double* %tmp.17.i32942		;  [#uses=1]
-	store double %tmp.18.i32943, double* %tmp.16.i32941
-	%tmp.4.i32917 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32916, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32954, double* %tmp.4.i32917
-	%tmp.7.i32920 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32916, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32957, double* %tmp.7.i32920
-	%tmp.0.i32923 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32916, %"struct.std::dcomplex"* %mem_tmp.81 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32925 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32923, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32926 = load double* %tmp.14.i32925		;  [#uses=1]
-	%tmp.17.i32928 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32923, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32929 = load double* %tmp.17.i32928		;  [#uses=1]
-	%tmp.4.i32903 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32902, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32926, double* %tmp.4.i32903
-	%tmp.7.i32906 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32902, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32929, double* %tmp.7.i32906
-	%tmp.0.i32909 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32902, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32911 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32909, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32912 = load double* %tmp.14.i32911		;  [#uses=1]
-	%tmp.17.i32914 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32909, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32915 = load double* %tmp.17.i32914		;  [#uses=1]
-	%tmp.4.i32889 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32888, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32891 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32891, double* %tmp.4.i32889
-	%tmp.7.i32892 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32888, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32894 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32894, double* %tmp.7.i32892
-	%tmp.0.i32895 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32888, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32897 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32895, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32898 = load double* %tmp.14.i32897		;  [#uses=1]
-	%tmp.17.i32900 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32895, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32901 = load double* %tmp.17.i32900		;  [#uses=1]
-	%tmp.4.i32875 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32874, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32877 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i32877, double* %tmp.4.i32875
-	%tmp.7.i32878 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32874, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32880 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i32880, double* %tmp.7.i32878
-	%tmp.0.i32881 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32874, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32882 = getelementptr %"struct.std::dcomplex"* %mem_tmp.85, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32883 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32881, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32884 = load double* %tmp.14.i32883		;  [#uses=1]
-	store double %tmp.15.i32884, double* %tmp.13.i32882
-	%tmp.16.i32885 = getelementptr %"struct.std::dcomplex"* %mem_tmp.85, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32886 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32881, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32887 = load double* %tmp.17.i32886		;  [#uses=1]
-	store double %tmp.18.i32887, double* %tmp.16.i32885
-	%tmp.4.i32861 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32860, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32898, double* %tmp.4.i32861
-	%tmp.7.i32864 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32860, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32901, double* %tmp.7.i32864
-	%tmp.0.i32867 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32860, %"struct.std::dcomplex"* %mem_tmp.85 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32869 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32867, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32870 = load double* %tmp.14.i32869		;  [#uses=1]
-	%tmp.17.i32872 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32867, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32873 = load double* %tmp.17.i32872		;  [#uses=1]
-	%tmp.4.i32847 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32846, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32870, double* %tmp.4.i32847
-	%tmp.7.i32850 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32846, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32873, double* %tmp.7.i32850
-	%tmp.0.i32853 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32846, %"struct.std::dcomplex"* %tmp.220 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32854 = getelementptr %"struct.std::dcomplex"* %mem_tmp.82, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32855 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32853, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32856 = load double* %tmp.14.i32855		;  [#uses=1]
-	store double %tmp.15.i32856, double* %tmp.13.i32854
-	%tmp.16.i32857 = getelementptr %"struct.std::dcomplex"* %mem_tmp.82, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32858 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32853, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32859 = load double* %tmp.17.i32858		;  [#uses=1]
-	store double %tmp.18.i32859, double* %tmp.16.i32857
-	%tmp.4.i32833 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32832, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32912, double* %tmp.4.i32833
-	%tmp.7.i32836 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32832, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32915, double* %tmp.7.i32836
-	%tmp.0.i32839 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32832, %"struct.std::dcomplex"* %mem_tmp.82 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32841 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32839, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32842 = load double* %tmp.14.i32841		;  [#uses=1]
-	%tmp.17.i32844 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32839, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32845 = load double* %tmp.17.i32844		;  [#uses=1]
-	%tmp.4.i32819 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32818, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32821 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i32821, double* %tmp.4.i32819
-	%tmp.7.i32822 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32818, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32824 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i32824, double* %tmp.7.i32822
-	%tmp.0.i32825 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32818, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32827 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32825, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32828 = load double* %tmp.14.i32827		;  [#uses=1]
-	%tmp.17.i32830 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32825, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32831 = load double* %tmp.17.i32830		;  [#uses=1]
-	%tmp.4.i32805 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32804, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32807 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32807, double* %tmp.4.i32805
-	%tmp.7.i32808 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32804, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32810 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32810, double* %tmp.7.i32808
-	%tmp.0.i32811 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32804, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32812 = getelementptr %"struct.std::dcomplex"* %mem_tmp.89, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32813 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32811, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32814 = load double* %tmp.14.i32813		;  [#uses=1]
-	store double %tmp.15.i32814, double* %tmp.13.i32812
-	%tmp.16.i32815 = getelementptr %"struct.std::dcomplex"* %mem_tmp.89, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32816 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32811, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32817 = load double* %tmp.17.i32816		;  [#uses=1]
-	store double %tmp.18.i32817, double* %tmp.16.i32815
-	%tmp.4.i32791 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32790, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32828, double* %tmp.4.i32791
-	%tmp.7.i32794 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32790, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32831, double* %tmp.7.i32794
-	%tmp.0.i32797 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32790, %"struct.std::dcomplex"* %mem_tmp.89 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32799 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32797, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32800 = load double* %tmp.14.i32799		;  [#uses=1]
-	%tmp.17.i32802 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32797, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32803 = load double* %tmp.17.i32802		;  [#uses=1]
-	%tmp.4.i32777 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32776, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32800, double* %tmp.4.i32777
-	%tmp.7.i32780 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32776, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32803, double* %tmp.7.i32780
-	%tmp.0.i32783 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32776, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32784 = getelementptr %"struct.std::dcomplex"* %mem_tmp.86, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32785 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32783, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32786 = load double* %tmp.14.i32785		;  [#uses=1]
-	store double %tmp.15.i32786, double* %tmp.13.i32784
-	%tmp.16.i32787 = getelementptr %"struct.std::dcomplex"* %mem_tmp.86, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32788 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32783, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32789 = load double* %tmp.17.i32788		;  [#uses=1]
-	store double %tmp.18.i32789, double* %tmp.16.i32787
-	%tmp.4.i32763 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32762, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32842, double* %tmp.4.i32763
-	%tmp.7.i32766 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32762, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32845, double* %tmp.7.i32766
-	%tmp.0.i32769 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32762, %"struct.std::dcomplex"* %mem_tmp.86 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32771 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32769, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32772 = load double* %tmp.14.i32771		;  [#uses=1]
-	%tmp.17.i32774 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32769, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32775 = load double* %tmp.17.i32774		;  [#uses=1]
-	store double %tmp.15.i32772, double* %tmp.2.i34364
-	store double %tmp.18.i32775, double* %tmp.6.i34365
-	%tmp.4.i32729 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32728, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32731 = load double* %tmp.5.i34136		;  [#uses=1]
-	store double %tmp.6.i32731, double* %tmp.4.i32729
-	%tmp.7.i32732 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32728, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32734 = load double* %tmp.8.i34139		;  [#uses=1]
-	store double %tmp.9.i32734, double* %tmp.7.i32732
-	%tmp.0.i32735 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32728, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32737 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32735, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32738 = load double* %tmp.14.i32737		;  [#uses=1]
-	%tmp.17.i32740 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32735, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32741 = load double* %tmp.17.i32740		;  [#uses=1]
-	%tmp.7.i32695 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i32709 = add double %tmp.7.i32695, %tmp.15.i32738		;  [#uses=1]
-	store double %tmp.15.i32709, double* %tmp.2.i34366
-	%tmp.26.i32716 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i32727 = add double %tmp.26.i32716, %tmp.18.i32741		;  [#uses=1]
-	store double %tmp.31.i32727, double* %tmp.6.i34367
-	%tmp.4.i32675 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32674, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32677 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32677, double* %tmp.4.i32675
-	%tmp.7.i32678 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32674, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32680 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32680, double* %tmp.7.i32678
-	%tmp.0.i32681 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32674, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32683 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32681, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32684 = load double* %tmp.14.i32683		;  [#uses=1]
-	%tmp.17.i32686 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32681, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32687 = load double* %tmp.17.i32686		;  [#uses=1]
-	%tmp.4.i32661 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32660, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32663 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i32663, double* %tmp.4.i32661
-	%tmp.7.i32664 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32660, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32666 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i32666, double* %tmp.7.i32664
-	%tmp.0.i32667 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32660, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32668 = getelementptr %"struct.std::dcomplex"* %mem_tmp.96, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32669 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32667, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32670 = load double* %tmp.14.i32669		;  [#uses=1]
-	store double %tmp.15.i32670, double* %tmp.13.i32668
-	%tmp.16.i32671 = getelementptr %"struct.std::dcomplex"* %mem_tmp.96, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32672 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32667, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32673 = load double* %tmp.17.i32672		;  [#uses=1]
-	store double %tmp.18.i32673, double* %tmp.16.i32671
-	%tmp.4.i32647 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32646, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32684, double* %tmp.4.i32647
-	%tmp.7.i32650 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32646, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32687, double* %tmp.7.i32650
-	%tmp.0.i32653 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32646, %"struct.std::dcomplex"* %mem_tmp.96 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32655 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32653, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32656 = load double* %tmp.14.i32655		;  [#uses=1]
-	%tmp.17.i32658 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32653, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32659 = load double* %tmp.17.i32658		;  [#uses=1]
-	%tmp.4.i32633 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32632, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32656, double* %tmp.4.i32633
-	%tmp.7.i32636 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32632, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32659, double* %tmp.7.i32636
-	%tmp.0.i32639 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32632, %"struct.std::dcomplex"* %tmp.45 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32641 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32639, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32642 = load double* %tmp.14.i32641		;  [#uses=1]
-	%tmp.17.i32644 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32639, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32645 = load double* %tmp.17.i32644		;  [#uses=1]
-	%tmp.4.i32619 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32618, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32621 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i32621, double* %tmp.4.i32619
-	%tmp.7.i32622 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32618, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32624 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i32624, double* %tmp.7.i32622
-	%tmp.0.i32625 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32618, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32627 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32625, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32628 = load double* %tmp.14.i32627		;  [#uses=1]
-	%tmp.17.i32630 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32625, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32631 = load double* %tmp.17.i32630		;  [#uses=1]
-	%tmp.4.i32605 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32604, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32607 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i32607, double* %tmp.4.i32605
-	%tmp.7.i32608 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32604, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32610 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i32610, double* %tmp.7.i32608
-	%tmp.0.i32611 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32604, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32612 = getelementptr %"struct.std::dcomplex"* %mem_tmp.100, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32613 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32611, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32614 = load double* %tmp.14.i32613		;  [#uses=1]
-	store double %tmp.15.i32614, double* %tmp.13.i32612
-	%tmp.16.i32615 = getelementptr %"struct.std::dcomplex"* %mem_tmp.100, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32616 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32611, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32617 = load double* %tmp.17.i32616		;  [#uses=1]
-	store double %tmp.18.i32617, double* %tmp.16.i32615
-	%tmp.4.i32591 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32590, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32628, double* %tmp.4.i32591
-	%tmp.7.i32594 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32590, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32631, double* %tmp.7.i32594
-	%tmp.0.i32597 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32590, %"struct.std::dcomplex"* %mem_tmp.100 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32599 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32597, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32600 = load double* %tmp.14.i32599		;  [#uses=1]
-	%tmp.17.i32602 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32597, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32603 = load double* %tmp.17.i32602		;  [#uses=1]
-	%tmp.4.i32577 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32576, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32600, double* %tmp.4.i32577
-	%tmp.7.i32580 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32576, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32603, double* %tmp.7.i32580
-	%tmp.0.i32583 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32576, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32584 = getelementptr %"struct.std::dcomplex"* %mem_tmp.97, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32585 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32583, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32586 = load double* %tmp.14.i32585		;  [#uses=1]
-	store double %tmp.15.i32586, double* %tmp.13.i32584
-	%tmp.16.i32587 = getelementptr %"struct.std::dcomplex"* %mem_tmp.97, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32588 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32583, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32589 = load double* %tmp.17.i32588		;  [#uses=1]
-	store double %tmp.18.i32589, double* %tmp.16.i32587
-	%tmp.4.i32563 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32562, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32642, double* %tmp.4.i32563
-	%tmp.7.i32566 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32562, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32645, double* %tmp.7.i32566
-	%tmp.0.i32569 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32562, %"struct.std::dcomplex"* %mem_tmp.97 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32571 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32569, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32572 = load double* %tmp.14.i32571		;  [#uses=1]
-	%tmp.17.i32574 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32569, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32575 = load double* %tmp.17.i32574		;  [#uses=1]
-	%tmp.4.i32549 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32548, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32551 = load double* %tmp.5.i34338		;  [#uses=1]
-	store double %tmp.6.i32551, double* %tmp.4.i32549
-	%tmp.7.i32552 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32548, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32554 = load double* %tmp.8.i34341		;  [#uses=1]
-	store double %tmp.9.i32554, double* %tmp.7.i32552
-	%tmp.0.i32555 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32548, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32557 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32555, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32558 = load double* %tmp.14.i32557		;  [#uses=1]
-	%tmp.17.i32560 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32555, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32561 = load double* %tmp.17.i32560		;  [#uses=1]
-	%tmp.4.i32535 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32534, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32537 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32537, double* %tmp.4.i32535
-	%tmp.7.i32538 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32534, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32540 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32540, double* %tmp.7.i32538
-	%tmp.0.i32541 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32534, %"struct.std::dcomplex"* %tmp.6 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32542 = getelementptr %"struct.std::dcomplex"* %mem_tmp.104, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32543 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32541, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32544 = load double* %tmp.14.i32543		;  [#uses=1]
-	store double %tmp.15.i32544, double* %tmp.13.i32542
-	%tmp.16.i32545 = getelementptr %"struct.std::dcomplex"* %mem_tmp.104, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32546 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32541, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32547 = load double* %tmp.17.i32546		;  [#uses=1]
-	store double %tmp.18.i32547, double* %tmp.16.i32545
-	%tmp.4.i32521 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32520, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32558, double* %tmp.4.i32521
-	%tmp.7.i32524 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32520, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32561, double* %tmp.7.i32524
-	%tmp.0.i32527 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32520, %"struct.std::dcomplex"* %mem_tmp.104 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32529 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32527, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32530 = load double* %tmp.14.i32529		;  [#uses=1]
-	%tmp.17.i32532 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32527, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32533 = load double* %tmp.17.i32532		;  [#uses=1]
-	%tmp.4.i32507 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32506, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32530, double* %tmp.4.i32507
-	%tmp.7.i32510 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32506, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32533, double* %tmp.7.i32510
-	%tmp.0.i32513 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32506, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32514 = getelementptr %"struct.std::dcomplex"* %mem_tmp.101, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32515 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32513, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32516 = load double* %tmp.14.i32515		;  [#uses=1]
-	store double %tmp.15.i32516, double* %tmp.13.i32514
-	%tmp.16.i32517 = getelementptr %"struct.std::dcomplex"* %mem_tmp.101, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32518 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32513, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32519 = load double* %tmp.17.i32518		;  [#uses=1]
-	store double %tmp.18.i32519, double* %tmp.16.i32517
-	%tmp.4.i32493 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32492, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32572, double* %tmp.4.i32493
-	%tmp.7.i32496 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32492, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32575, double* %tmp.7.i32496
-	%tmp.0.i32499 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32492, %"struct.std::dcomplex"* %mem_tmp.101 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32501 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32499, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32502 = load double* %tmp.14.i32501		;  [#uses=1]
-	%tmp.17.i32504 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32499, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32505 = load double* %tmp.17.i32504		;  [#uses=1]
-	store double %tmp.15.i32502, double* %tmp.2.i34364
-	store double %tmp.18.i32505, double* %tmp.6.i34365
-	%tmp.4.i32459 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32458, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.5.i32460 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 4, i32 0, i32 0		;  [#uses=20]
-	%tmp.6.i32461 = load double* %tmp.5.i32460		;  [#uses=1]
-	store double %tmp.6.i32461, double* %tmp.4.i32459
-	%tmp.7.i32462 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32458, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.8.i32463 = getelementptr [6 x %"struct.std::dcomplex"]* %_m, i32 3, i32 4, i32 0, i32 1		;  [#uses=20]
-	%tmp.9.i32464 = load double* %tmp.8.i32463		;  [#uses=1]
-	store double %tmp.9.i32464, double* %tmp.7.i32462
-	%tmp.0.i32465 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32458, %"struct.std::dcomplex"* %ret3 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32467 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32465, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32468 = load double* %tmp.14.i32467		;  [#uses=1]
-	%tmp.17.i32470 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32465, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32471 = load double* %tmp.17.i32470		;  [#uses=1]
-	%tmp.7.i32425 = load double* %tmp.2.i34366		;  [#uses=1]
-	%tmp.15.i32439 = add double %tmp.7.i32425, %tmp.15.i32468		;  [#uses=1]
-	store double %tmp.15.i32439, double* %tmp.2.i34366
-	%tmp.26.i32446 = load double* %tmp.6.i34367		;  [#uses=1]
-	%tmp.31.i32457 = add double %tmp.26.i32446, %tmp.18.i32471		;  [#uses=1]
-	store double %tmp.31.i32457, double* %tmp.6.i34367
-	%tmp.4.i32405 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32404, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32407 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32407, double* %tmp.4.i32405
-	%tmp.7.i32408 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32404, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32410 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32410, double* %tmp.7.i32408
-	%tmp.0.i32411 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32404, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32413 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32411, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32414 = load double* %tmp.14.i32413		;  [#uses=1]
-	%tmp.17.i32416 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32411, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32417 = load double* %tmp.17.i32416		;  [#uses=1]
-	%tmp.4.i32391 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32390, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32393 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i32393, double* %tmp.4.i32391
-	%tmp.7.i32394 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32390, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32396 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i32396, double* %tmp.7.i32394
-	%tmp.0.i32397 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32390, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32398 = getelementptr %"struct.std::dcomplex"* %mem_tmp.111, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32399 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32397, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32400 = load double* %tmp.14.i32399		;  [#uses=1]
-	store double %tmp.15.i32400, double* %tmp.13.i32398
-	%tmp.16.i32401 = getelementptr %"struct.std::dcomplex"* %mem_tmp.111, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32402 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32397, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32403 = load double* %tmp.17.i32402		;  [#uses=1]
-	store double %tmp.18.i32403, double* %tmp.16.i32401
-	%tmp.4.i32377 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32376, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32414, double* %tmp.4.i32377
-	%tmp.7.i32380 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32376, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32417, double* %tmp.7.i32380
-	%tmp.0.i32383 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32376, %"struct.std::dcomplex"* %mem_tmp.111 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32385 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32383, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32386 = load double* %tmp.14.i32385		;  [#uses=1]
-	%tmp.17.i32388 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32383, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32389 = load double* %tmp.17.i32388		;  [#uses=1]
-	%tmp.4.i32363 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32362, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32386, double* %tmp.4.i32363
-	%tmp.7.i32366 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32362, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32389, double* %tmp.7.i32366
-	%tmp.0.i32369 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32362, %"struct.std::dcomplex"* %tmp.95 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32371 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32369, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32372 = load double* %tmp.14.i32371		;  [#uses=1]
-	%tmp.17.i32374 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32369, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32375 = load double* %tmp.17.i32374		;  [#uses=1]
-	%tmp.4.i32349 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32348, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32351 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i32351, double* %tmp.4.i32349
-	%tmp.7.i32352 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32348, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32354 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i32354, double* %tmp.7.i32352
-	%tmp.0.i32355 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32348, %"struct.std::dcomplex"* %tmp.21 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32357 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32355, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32358 = load double* %tmp.14.i32357		;  [#uses=1]
-	%tmp.17.i32360 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32355, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32361 = load double* %tmp.17.i32360		;  [#uses=1]
-	%tmp.4.i32335 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32334, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32337 = load double* %tmp.5.i34282		;  [#uses=1]
-	store double %tmp.6.i32337, double* %tmp.4.i32335
-	%tmp.7.i32338 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32334, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32340 = load double* %tmp.8.i34285		;  [#uses=1]
-	store double %tmp.9.i32340, double* %tmp.7.i32338
-	%tmp.0.i32341 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32334, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32342 = getelementptr %"struct.std::dcomplex"* %mem_tmp.115, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32343 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32341, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32344 = load double* %tmp.14.i32343		;  [#uses=1]
-	store double %tmp.15.i32344, double* %tmp.13.i32342
-	%tmp.16.i32345 = getelementptr %"struct.std::dcomplex"* %mem_tmp.115, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32346 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32341, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32347 = load double* %tmp.17.i32346		;  [#uses=1]
-	store double %tmp.18.i32347, double* %tmp.16.i32345
-	%tmp.4.i32321 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32320, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32358, double* %tmp.4.i32321
-	%tmp.7.i32324 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32320, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32361, double* %tmp.7.i32324
-	%tmp.0.i32327 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32320, %"struct.std::dcomplex"* %mem_tmp.115 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32329 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32327, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32330 = load double* %tmp.14.i32329		;  [#uses=1]
-	%tmp.17.i32332 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32327, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32333 = load double* %tmp.17.i32332		;  [#uses=1]
-	%tmp.4.i32307 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32306, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32330, double* %tmp.4.i32307
-	%tmp.7.i32310 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32306, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32333, double* %tmp.7.i32310
-	%tmp.0.i32313 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32306, %"struct.std::dcomplex"* %tmp.220 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32314 = getelementptr %"struct.std::dcomplex"* %mem_tmp.112, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32315 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32313, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32316 = load double* %tmp.14.i32315		;  [#uses=1]
-	store double %tmp.15.i32316, double* %tmp.13.i32314
-	%tmp.16.i32317 = getelementptr %"struct.std::dcomplex"* %mem_tmp.112, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32318 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32313, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32319 = load double* %tmp.17.i32318		;  [#uses=1]
-	store double %tmp.18.i32319, double* %tmp.16.i32317
-	%tmp.4.i32293 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32292, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32372, double* %tmp.4.i32293
-	%tmp.7.i32296 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32292, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32375, double* %tmp.7.i32296
-	%tmp.0.i32299 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexpLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32292, %"struct.std::dcomplex"* %mem_tmp.112 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32301 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32299, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32302 = load double* %tmp.14.i32301		;  [#uses=1]
-	%tmp.17.i32304 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32299, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32305 = load double* %tmp.17.i32304		;  [#uses=1]
-	%tmp.4.i32279 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32278, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32281 = load double* %tmp.5.i33146		;  [#uses=1]
-	store double %tmp.6.i32281, double* %tmp.4.i32279
-	%tmp.7.i32282 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32278, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32284 = load double* %tmp.8.i33149		;  [#uses=1]
-	store double %tmp.9.i32284, double* %tmp.7.i32282
-	%tmp.0.i32285 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32278, %"struct.std::dcomplex"* %tmp.62 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32287 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32285, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32288 = load double* %tmp.14.i32287		;  [#uses=1]
-	%tmp.17.i32290 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32285, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32291 = load double* %tmp.17.i32290		;  [#uses=1]
-	%tmp.4.i32265 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32264, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.6.i32267 = load double* %tmp.5.i34082		;  [#uses=1]
-	store double %tmp.6.i32267, double* %tmp.4.i32265
-	%tmp.7.i32268 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32264, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.9.i32270 = load double* %tmp.8.i34085		;  [#uses=1]
-	store double %tmp.9.i32270, double* %tmp.7.i32268
-	%tmp.0.i32271 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32264, %"struct.std::dcomplex"* %tmp.226 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32272 = getelementptr %"struct.std::dcomplex"* %mem_tmp.119, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32273 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32271, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32274 = load double* %tmp.14.i32273		;  [#uses=1]
-	store double %tmp.15.i32274, double* %tmp.13.i32272
-	%tmp.16.i32275 = getelementptr %"struct.std::dcomplex"* %mem_tmp.119, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.17.i32276 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32271, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32277 = load double* %tmp.17.i32276		;  [#uses=1]
-	store double %tmp.18.i32277, double* %tmp.16.i32275
-	%tmp.4.i32251 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32250, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32288, double* %tmp.4.i32251
-	%tmp.7.i32254 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32250, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32291, double* %tmp.7.i32254
-	%tmp.0.i32257 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmIERKS_( %"struct.std::dcomplex"* %mem_tmp.i32250, %"struct.std::dcomplex"* %mem_tmp.119 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.14.i32259 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32257, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32260 = load double* %tmp.14.i32259		;  [#uses=1]
-	%tmp.17.i32262 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32257, i32 0, i32 0, i32 1		;  [#uses=1]
-	%tmp.18.i32263 = load double* %tmp.17.i32262		;  [#uses=1]
-	%tmp.4.i32237 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32236, i32 0, i32 0, i32 0		;  [#uses=1]
-	store double %tmp.15.i32260, double* %tmp.4.i32237
-	%tmp.7.i32240 = getelementptr %"struct.std::dcomplex"* %mem_tmp.i32236, i32 0, i32 0, i32 1		;  [#uses=1]
-	store double %tmp.18.i32263, double* %tmp.7.i32240
-	%tmp.0.i32243 = call %"struct.std::dcomplex"* @_ZNSt8dcomplexmLERKS_( %"struct.std::dcomplex"* %mem_tmp.i32236, %"struct.std::dcomplex"* %tmp.15 )		; <%"struct.std::dcomplex"*> [#uses=2]
-	%tmp.13.i32244 = getelementptr %"struct.std::dcomplex"* %mem_tmp.116, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.14.i32245 = getelementptr %"struct.std::dcomplex"* %tmp.0.i32243, i32 0, i32 0, i32 0		;  [#uses=1]
-	%tmp.15.i32246 = load double* %tmp.14.i