From sabre at nondot.org Mon Apr 9 00:11:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:11:20 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/inline-asm-x-scalar.ll Message-ID: <200704090511.l395BKmq015838@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: inline-asm-x-scalar.ll added (r1.1) --- Log message: The x constraint allows scalar FP values as well as vectors. --- Diffs of the changes: (+12 -0) inline-asm-x-scalar.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/X86/inline-asm-x-scalar.ll diff -c /dev/null llvm/test/CodeGen/X86/inline-asm-x-scalar.ll:1.1 *** /dev/null Mon Apr 9 00:11:13 2007 --- llvm/test/CodeGen/X86/inline-asm-x-scalar.ll Mon Apr 9 00:11:03 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah + + define void @borkv() { + tail call void asm sideeffect "ucomiss $0", "x"( float 0x41E0000000000000) + ret void + } + + define void @blah() { + %tmp53 = tail call i32 asm "ucomiss $1, $3\0Acmovae $2, $0 ", "=r,mx,mr,x,0,~{dirflag},~{fpsr},~{flags},~{cc}"( float 0x41E0000000000000, i32 2147483647, float 0.000000e+00, i32 0 ) ; [#uses + unreachable + } + From sabre at nondot.org Mon Apr 9 00:11:46 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:11:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200704090511.l395BkOA015887@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.383 -> 1.384 --- Log message: implement CodeGen/X86/inline-asm-x-scalar.ll --- Diffs of the changes: (+15 -1) X86ISelLowering.cpp | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.383 llvm/lib/Target/X86/X86ISelLowering.cpp:1.384 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.383 Fri Mar 30 18:15:24 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 9 00:11:28 2007 @@ -4640,7 +4640,6 @@ return TargetLowering::isOperandValidForConstraint(Op, Constraint, DAG); } - std::vector X86TargetLowering:: getRegClassForInlineAsmConstraint(const std::string &Constraint, MVT::ValueType VT) const { @@ -4709,6 +4708,21 @@ std::pair X86TargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint, MVT::ValueType VT) const { + // First, see if this is a constraint that directly corresponds to an LLVM + // register class. + if (Constraint.size() == 1) { + // GCC Constraint Letters + switch (Constraint[0]) { + default: break; + case 'x': + if (VT == MVT::f32) + return std::make_pair(0U, X86::FR32RegisterClass); + if (VT == MVT::f64) + return std::make_pair(0U, X86::FR64RegisterClass); + break; + } + } + // Use the default implementation in TargetLowering to convert the register // constraint into a member of a register class. std::pair Res; From sabre at nondot.org Mon Apr 9 00:23:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:23:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200704090523.l395NUKe016502@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.395 -> 1.396 --- Log message: add some assertions --- Diffs of the changes: (+13 -0) SelectionDAG.cpp | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.395 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.396 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.395 Sun Apr 1 02:32:19 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Apr 9 00:23:13 2007 @@ -1046,19 +1046,30 @@ switch (Opcode) { case ISD::TokenFactor: return Operand; // Factor of one node? No factor. + case ISD::FP_ROUND: + case ISD::FP_EXTEND: + assert(MVT::isFloatingPoint(VT) && + MVT::isFloatingPoint(Operand.getValueType()) && "Invalid FP cast!"); + break; case ISD::SIGN_EXTEND: + assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) && + "Invalid SIGN_EXTEND!"); if (Operand.getValueType() == VT) return Operand; // noop extension assert(Operand.getValueType() < VT && "Invalid sext node, dst < src!"); if (OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ZERO_EXTEND) return getNode(OpOpcode, VT, Operand.Val->getOperand(0)); break; case ISD::ZERO_EXTEND: + assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) && + "Invalid ZERO_EXTEND!"); if (Operand.getValueType() == VT) return Operand; // noop extension assert(Operand.getValueType() < VT && "Invalid zext node, dst < src!"); if (OpOpcode == ISD::ZERO_EXTEND) // (zext (zext x)) -> (zext x) return getNode(ISD::ZERO_EXTEND, VT, Operand.Val->getOperand(0)); break; case ISD::ANY_EXTEND: + assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) && + "Invalid ANY_EXTEND!"); if (Operand.getValueType() == VT) return Operand; // noop extension assert(Operand.getValueType() < VT && "Invalid anyext node, dst < src!"); if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND) @@ -1066,6 +1077,8 @@ return getNode(OpOpcode, VT, Operand.Val->getOperand(0)); break; case ISD::TRUNCATE: + assert(MVT::isInteger(VT) && MVT::isInteger(Operand.getValueType()) && + "Invalid TRUNCATE!"); if (Operand.getValueType() == VT) return Operand; // noop truncate assert(Operand.getValueType() > VT && "Invalid truncate node, src < dst!"); if (OpOpcode == ISD::TRUNCATE) From sabre at nondot.org Mon Apr 9 00:27:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:27:05 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/inline-asm-x-scalar.ll Message-ID: <200704090527.l395R5Q9016733@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: inline-asm-x-scalar.ll updated: 1.1 -> 1.2 --- Log message: add another test --- Diffs of the changes: (+7 -2) inline-asm-x-scalar.ll | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/X86/inline-asm-x-scalar.ll diff -u llvm/test/CodeGen/X86/inline-asm-x-scalar.ll:1.1 llvm/test/CodeGen/X86/inline-asm-x-scalar.ll:1.2 --- llvm/test/CodeGen/X86/inline-asm-x-scalar.ll:1.1 Mon Apr 9 00:11:03 2007 +++ llvm/test/CodeGen/X86/inline-asm-x-scalar.ll Mon Apr 9 00:26:48 2007 @@ -1,12 +1,17 @@ ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -define void @borkv() { +define void @test1() { tail call void asm sideeffect "ucomiss $0", "x"( float 0x41E0000000000000) ret void } -define void @blah() { +define void @test2() { %tmp53 = tail call i32 asm "ucomiss $1, $3\0Acmovae $2, $0 ", "=r,mx,mr,x,0,~{dirflag},~{fpsr},~{flags},~{cc}"( float 0x41E0000000000000, i32 2147483647, float 0.000000e+00, i32 0 ) ; [#uses unreachable } +define void @test3() { + tail call void asm sideeffect "ucomiss $0, $1", "mx,x,~{dirflag},~{fpsr},~{flags},~{cc}"( float 0x41E0000000000000, i32 65536 ) + ret void +} + From sabre at nondot.org Mon Apr 9 00:31:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:31:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704090531.l395VbQq017113@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.407 -> 1.408 --- Log message: implement CodeGen/X86/inline-asm-x-scalar.ll:test3 --- Diffs of the changes: (+9 -2) SelectionDAGISel.cpp | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.407 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.408 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.407 Sun Apr 8 19:33:58 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 00:31:20 2007 @@ -2656,13 +2656,20 @@ if (MVT::isVector(RegVT)) { assert(Val.getValueType() == MVT::Vector &&"Not a vector-vector cast?"); Val = DAG.getNode(ISD::VBIT_CONVERT, RegVT, Val); - } else if (MVT::isInteger(RegVT)) { + } else if (MVT::isInteger(RegVT) && MVT::isInteger(Val.getValueType())) { if (RegVT < ValueVT) Val = DAG.getNode(ISD::TRUNCATE, RegVT, Val); else Val = DAG.getNode(ISD::ANY_EXTEND, RegVT, Val); - } else + } else if (MVT::isFloatingPoint(RegVT) && + MVT::isFloatingPoint(Val.getValueType())) { Val = DAG.getNode(ISD::FP_EXTEND, RegVT, Val); + } else if (MVT::getSizeInBits(RegVT) == + MVT::getSizeInBits(Val.getValueType())) { + Val = DAG.getNode(ISD::BIT_CONVERT, RegVT, Val); + } else { + assert(0 && "Unknown mismatch!"); + } } Chain = DAG.getCopyToReg(Chain, Regs[0], Val, Flag); Flag = Chain.getValue(1); From sabre at nondot.org Mon Apr 9 00:32:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:32:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200704090532.l395W6T6017148@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.384 -> 1.385 --- Log message: implement support for CodeGen/X86/inline-asm-x-scalar.ll:test3 - i32/i64 values used with x constraints. --- Diffs of the changes: (+2 -2) X86ISelLowering.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.384 llvm/lib/Target/X86/X86ISelLowering.cpp:1.385 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.384 Mon Apr 9 00:11:28 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 9 00:31:48 2007 @@ -4715,9 +4715,9 @@ switch (Constraint[0]) { default: break; case 'x': - if (VT == MVT::f32) + if (VT == MVT::f32 || VT == MVT::i32) return std::make_pair(0U, X86::FR32RegisterClass); - if (VT == MVT::f64) + if (VT == MVT::f64 || VT == MVT::i64) return std::make_pair(0U, X86::FR64RegisterClass); break; } From sabre at nondot.org Mon Apr 9 00:49:39 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 00:49:39 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200704090549.l395ndGU018063@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.385 -> 1.386 --- Log message: move a bunch of register constraints from being handled by getRegClassForInlineAsmConstraint to being handled by getRegForInlineAsmConstraint. This allows us to let the llvm register allocator allocate, which gives us better code. For example, X86/2007-01-29-InlineAsm-ir.ll used to compile to: _run_init_process: subl $4, %esp movl %ebx, (%esp) xorl %ebx, %ebx movl $11, %eax movl %ebx, %ecx movl %ebx, %edx # InlineAsm Start push %ebx ; movl %ebx,%ebx ; int $0x80 ; pop %ebx # InlineAsm End Now we get: _run_init_process: xorl %ecx, %ecx movl $11, %eax movl %ecx, %edx # InlineAsm Start push %ebx ; movl %ecx,%ebx ; int $0x80 ; pop %ebx # InlineAsm End --- Diffs of the changes: (+36 -42) X86ISelLowering.cpp | 78 ++++++++++++++++++++++++---------------------------- 1 files changed, 36 insertions(+), 42 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.385 llvm/lib/Target/X86/X86ISelLowering.cpp:1.386 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.385 Mon Apr 9 00:31:48 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 9 00:49:22 2007 @@ -4645,39 +4645,12 @@ MVT::ValueType VT) const { if (Constraint.size() == 1) { // FIXME: not handling fp-stack yet! - // FIXME: not handling MMX registers yet ('y' constraint). switch (Constraint[0]) { // GCC X86 Constraint Letters default: break; // Unknown constraint letter case 'A': // EAX/EDX if (VT == MVT::i32 || VT == MVT::i64) return make_vector(X86::EAX, X86::EDX, 0); break; - case 'r': // GENERAL_REGS - case 'R': // LEGACY_REGS - if (VT == MVT::i64 && Subtarget->is64Bit()) - return make_vector(X86::RAX, X86::RDX, X86::RCX, X86::RBX, - X86::RSI, X86::RDI, X86::RBP, X86::RSP, - X86::R8, X86::R9, X86::R10, X86::R11, - X86::R12, X86::R13, X86::R14, X86::R15, 0); - if (VT == MVT::i32) - return make_vector(X86::EAX, X86::EDX, X86::ECX, X86::EBX, - X86::ESI, X86::EDI, X86::EBP, X86::ESP, 0); - else if (VT == MVT::i16) - return make_vector(X86::AX, X86::DX, X86::CX, X86::BX, - X86::SI, X86::DI, X86::BP, X86::SP, 0); - else if (VT == MVT::i8) - return make_vector(X86::AL, X86::DL, X86::CL, X86::BL, 0); - break; - case 'l': // INDEX_REGS - if (VT == MVT::i32) - return make_vector(X86::EAX, X86::EDX, X86::ECX, X86::EBX, - X86::ESI, X86::EDI, X86::EBP, 0); - else if (VT == MVT::i16) - return make_vector(X86::AX, X86::DX, X86::CX, X86::BX, - X86::SI, X86::DI, X86::BP, 0); - else if (VT == MVT::i8) - return make_vector(X86::AL, X86::DL, X86::CL, X86::DL, 0); - break; case 'q': // Q_REGS (GENERAL_REGS in 64-bit mode) case 'Q': // Q_REGS if (VT == MVT::i32) @@ -4687,18 +4660,6 @@ else if (VT == MVT::i8) return make_vector(X86::AL, X86::DL, X86::CL, X86::DL, 0); break; - case 'x': // SSE_REGS if SSE1 allowed - if (Subtarget->hasSSE1()) - return make_vector(X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, - X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7, - 0); - return std::vector(); - case 'Y': // SSE_REGS if SSE2 allowed - if (Subtarget->hasSSE2()) - return make_vector(X86::XMM0, X86::XMM1, X86::XMM2, X86::XMM3, - X86::XMM4, X86::XMM5, X86::XMM6, X86::XMM7, - 0); - return std::vector(); } } @@ -4714,11 +4675,44 @@ // GCC Constraint Letters switch (Constraint[0]) { default: break; - case 'x': - if (VT == MVT::f32 || VT == MVT::i32) + case 'r': // GENERAL_REGS + case 'R': // LEGACY_REGS + case 'l': // INDEX_REGS + if (VT == MVT::i64 && Subtarget->is64Bit()) + return std::make_pair(0U, X86::GR64RegisterClass); + if (VT == MVT::i32) + return std::make_pair(0U, X86::GR32RegisterClass); + else if (VT == MVT::i16) + return std::make_pair(0U, X86::GR16RegisterClass); + else if (VT == MVT::i8) + return std::make_pair(0U, X86::GR8RegisterClass); + break; + // FIXME: not handling MMX registers yet ('y' constraint). + case 'Y': // SSE_REGS if SSE2 allowed + if (!Subtarget->hasSSE2()) break; + // FALL THROUGH. + case 'x': // SSE_REGS if SSE1 allowed + if (!Subtarget->hasSSE1()) break; + + switch (VT) { + default: break; + // Scalar SSE types. + case MVT::f32: + case MVT::i32: return std::make_pair(0U, X86::FR32RegisterClass); - if (VT == MVT::f64 || VT == MVT::i64) + case MVT::f64: + case MVT::i64: return std::make_pair(0U, X86::FR64RegisterClass); + // Vector types. + case MVT::Vector: + case MVT::v16i8: + case MVT::v8i16: + case MVT::v4i32: + case MVT::v2i64: + case MVT::v4f32: + case MVT::v2f64: + return std::make_pair(0U, X86::VR128RegisterClass); + } break; } } From reid at x10sys.com Mon Apr 9 01:07:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:07:15 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h Message-ID: <200704090607.l3967F1b019021@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: DerivedTypes.h updated: 1.90 -> 1.91 --- Log message: For PR1146: http://llvm.org/PR1146 : Remove the handling of ParameterAttributes from FunctionType as they are their own object defined in ParameterAttributes.h now. --- Diffs of the changes: (+8 -37) DerivedTypes.h | 45 ++++++++------------------------------------- 1 files changed, 8 insertions(+), 37 deletions(-) Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.90 llvm/include/llvm/DerivedTypes.h:1.91 --- llvm/include/llvm/DerivedTypes.h:1.90 Thu Apr 5 21:02:19 2007 +++ llvm/include/llvm/DerivedTypes.h Mon Apr 9 01:06:57 2007 @@ -31,6 +31,7 @@ class VectorValType; class IntegerValType; class APInt; +class ParamAttrsList; class DerivedType : public Type { friend class Type; @@ -137,22 +138,6 @@ /// FunctionType - Class to represent function types /// class FunctionType : public DerivedType { -public: - /// Function parameters can have attributes to indicate how they should be - /// treated by optimizations and code generation. This enumeration lists the - /// set of possible attributes. - /// @brief Function parameter attributes enumeration. - enum ParameterAttributes { - NoAttributeSet = 0, ///< No attribute value has been set - ZExtAttribute = 1, ///< zero extended before/after call - SExtAttribute = 1 << 1, ///< sign extended before/after call - NoReturnAttribute = 1 << 2, ///< mark the function as not returning - InRegAttribute = 1 << 3, ///< force argument to be passed in register - StructRetAttribute= 1 << 4, ///< hidden pointer to structure to return - NoUnwindAttribute = 1 << 5 ///< Function doesn't unwind stack - }; - typedef std::vector ParamAttrsList; -private: friend class TypeMap; bool isVarArgs; ParamAttrsList *ParamAttrs; @@ -160,10 +145,10 @@ FunctionType(const FunctionType &); // Do not implement const FunctionType &operator=(const FunctionType &); // Do not implement FunctionType(const Type *Result, const std::vector &Params, - bool IsVarArgs, const ParamAttrsList &Attrs); + bool IsVarArgs, ParamAttrsList *Attrs = 0); public: - virtual ~FunctionType() { delete ParamAttrs; } + virtual ~FunctionType(); /// FunctionType::get - This static method is the primary way of constructing /// a FunctionType. /// @@ -171,10 +156,11 @@ const Type *Result, ///< The result type const std::vector &Params, ///< The types of the parameters bool isVarArg, ///< Whether this is a variable argument length function - const ParamAttrsList & Attrs = ParamAttrsList() + ParamAttrsList *Attrs = 0 ///< Indicates the parameter attributes to use, if any. The 0th entry ///< in the list refers to the return type. Parameters are numbered - ///< starting at 1. + ///< starting at 1. This argument must be on the heap and FunctionType + ///< owns it after its passed here. ); inline bool isVarArg() const { return isVarArgs; } @@ -192,28 +178,13 @@ /// unsigned getNumParams() const { return NumContainedTys - 1; } - bool isStructReturn() const { - return (getNumParams() && paramHasAttr(1, StructRetAttribute)); - } + bool isStructReturn() const; /// The parameter attributes for the \p ith parameter are returned. The 0th /// parameter refers to the return type of the function. /// @returns The ParameterAttributes for the \p ith parameter. /// @brief Get the attributes for a parameter - ParameterAttributes getParamAttrs(unsigned i) const; - - /// @brief Determine if a parameter attribute is set - bool paramHasAttr(unsigned i, ParameterAttributes attr) const { - return getParamAttrs(i) & attr; - } - - /// @brief Return the number of parameter attributes this type has. - unsigned getNumAttrs() const { - return (ParamAttrs ? unsigned(ParamAttrs->size()) : 0); - } - - /// @brief Convert a ParameterAttribute into its assembly text - static std::string getParamAttrsText(ParameterAttributes Attr); + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); From reid at x10sys.com Mon Apr 9 01:08:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:08:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200704090608.l39689vw019078@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.178 -> 1.179 --- Log message: For PR1146: http://llvm.org/PR1146 : Move parameter attributes functionality to ParamAttrsList class. --- Diffs of the changes: (+106 -52) Type.cpp | 158 ++++++++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 106 insertions(+), 52 deletions(-) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.178 llvm/lib/VMCore/Type.cpp:1.179 --- llvm/lib/VMCore/Type.cpp:1.178 Thu Apr 5 21:02:20 2007 +++ llvm/lib/VMCore/Type.cpp Mon Apr 9 01:07:52 2007 @@ -13,6 +13,7 @@ #include "llvm/AbstractTypeUser.h" #include "llvm/DerivedTypes.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Constants.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/StringExtras.h" @@ -279,11 +280,13 @@ Result += " "; Result += getTypeDescription(FTy->getReturnType(), TypeStack) + " ("; unsigned Idx = 1; + const ParamAttrsList *Attrs = FTy->getParamAttrs(); for (FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Result += ", "; - Result += FunctionType::getParamAttrsText(FTy->getParamAttrs(Idx)); + if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) + Result += Attrs->getParamAttrsTextByIndex(Idx); Idx++; Result += getTypeDescription(*I, TypeStack); } @@ -292,8 +295,8 @@ Result += "..."; } Result += ")"; - if (FTy->getParamAttrs(0)) { - Result += " " + FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); + if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + Result += " " + Attrs->getParamAttrsTextByIndex(0); } break; } @@ -411,8 +414,8 @@ FunctionType::FunctionType(const Type *Result, const std::vector &Params, - bool IsVarArgs, const ParamAttrsList &Attrs) - : DerivedType(FunctionTyID), isVarArgs(IsVarArgs), ParamAttrs(0) { + bool IsVarArgs, ParamAttrsList *Attrs) + : DerivedType(FunctionTyID), isVarArgs(IsVarArgs), ParamAttrs(Attrs) { ContainedTys = reinterpret_cast(this+1); NumContainedTys = Params.size() + 1; // + 1 for result type assert((Result->isFirstClassType() || Result == Type::VoidTy || @@ -428,12 +431,6 @@ isAbstract |= Params[i]->isAbstract(); } - // Set the ParameterAttributes - if (!Attrs.empty()) - ParamAttrs = new ParamAttrsList(Attrs); - else - ParamAttrs = 0; - // Calculate whether or not this type is abstract setAbstract(isAbstract); @@ -639,12 +636,24 @@ const FunctionType *FTy2 = cast(Ty2); if (FTy->isVarArg() != FTy2->isVarArg() || FTy->getNumParams() != FTy2->getNumParams() || - FTy->getNumAttrs() != FTy2->getNumAttrs() || - FTy->getParamAttrs(0) != FTy2->getParamAttrs(0) || !TypesEqual(FTy->getReturnType(), FTy2->getReturnType(), EqTypes)) return false; + const ParamAttrsList *Attrs1 = FTy->getParamAttrs(); + const ParamAttrsList *Attrs2 = FTy2->getParamAttrs(); + if ((!Attrs1 && Attrs2 && !Attrs2->empty()) || + (!Attrs2 && Attrs1 && !Attrs1->empty()) || + (Attrs1 && Attrs2 && (Attrs1->size() != Attrs2->size() || + (Attrs1->size() > 0 && + Attrs1->getParamAttrs(0) != Attrs2->getParamAttrs(0))))) + return false; + ParamAttrsList PAL1; + if (Attrs1) + PAL1 = *Attrs1; + ParamAttrsList PAL2; + if (Attrs2) + PAL2 = *Attrs2; for (unsigned i = 0, e = FTy2->getNumParams(); i != e; ++i) { - if (FTy->getParamAttrs(i+1) != FTy->getParamAttrs(i+1)) + if (PAL1.getParamAttrs(i+1) != PAL2.getParamAttrs(i+1)) return false; if (!TypesEqual(FTy->getParamType(i), FTy2->getParamType(i), EqTypes)) return false; @@ -1024,22 +1033,23 @@ class FunctionValType { const Type *RetTy; std::vector ArgTypes; - std::vector ParamAttrs; + const ParamAttrsList *ParamAttrs; bool isVarArg; public: FunctionValType(const Type *ret, const std::vector &args, - bool IVA, const FunctionType::ParamAttrsList &attrs) - : RetTy(ret), isVarArg(IVA) { + bool IVA, const ParamAttrsList *attrs) + : RetTy(ret), ParamAttrs(attrs), isVarArg(IVA) { for (unsigned i = 0; i < args.size(); ++i) ArgTypes.push_back(args[i]); - for (unsigned i = 0; i < attrs.size(); ++i) - ParamAttrs.push_back(attrs[i]); } static FunctionValType get(const FunctionType *FT); static unsigned hashTypeStructure(const FunctionType *FT) { - return FT->getNumParams()*64+FT->getNumAttrs()*2+FT->isVarArg(); + unsigned Result = FT->getNumParams()*64 + FT->isVarArg(); + if (FT->getParamAttrs()) + Result += FT->getParamAttrs()->size()*2; + return Result; } inline bool operator<(const FunctionValType &MTV) const { @@ -1048,7 +1058,20 @@ if (isVarArg < MTV.isVarArg) return true; if (isVarArg > MTV.isVarArg) return false; if (ArgTypes < MTV.ArgTypes) return true; - return ArgTypes == MTV.ArgTypes && ParamAttrs < MTV.ParamAttrs; + if (ArgTypes > MTV.ArgTypes) return false; + if (ParamAttrs) + if (MTV.ParamAttrs) + return *ParamAttrs < *MTV.ParamAttrs; + else if (ParamAttrs->empty()) + return true; + else + return false; + else if (MTV.ParamAttrs) + if (MTV.ParamAttrs->empty()) + return false; + else + return true; + return false; } }; } @@ -1059,14 +1082,11 @@ FunctionValType FunctionValType::get(const FunctionType *FT) { // Build up a FunctionValType std::vector ParamTypes; - std::vector ParamAttrs; ParamTypes.reserve(FT->getNumParams()); for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) ParamTypes.push_back(FT->getParamType(i)); - for (unsigned i = 0, e = FT->getNumAttrs(); i != e; ++i) - ParamAttrs.push_back(FT->getParamAttrs(i)); return FunctionValType(FT->getReturnType(), ParamTypes, FT->isVarArg(), - ParamAttrs); + FT->getParamAttrs()); } @@ -1074,24 +1094,15 @@ FunctionType *FunctionType::get(const Type *ReturnType, const std::vector &Params, bool isVarArg, - const std::vector &Attrs) { - bool noAttrs = true; - for (unsigned i = 0, e = Attrs.size(); i < e; ++i) - if (Attrs[i] != FunctionType::NoAttributeSet) { - noAttrs = false; - break; - } - const std::vector NullAttrs; - const std::vector *TheAttrs = &Attrs; - if (noAttrs) - TheAttrs = &NullAttrs; - FunctionValType VT(ReturnType, Params, isVarArg, *TheAttrs); + ParamAttrsList *Attrs) { + + FunctionValType VT(ReturnType, Params, isVarArg, Attrs); FunctionType *MT = FunctionTypes->get(VT); if (MT) return MT; MT = (FunctionType*) new char[sizeof(FunctionType) + sizeof(PATypeHandle)*(Params.size()+1)]; - new (MT) FunctionType(ReturnType, Params, isVarArg, *TheAttrs); + new (MT) FunctionType(ReturnType, Params, isVarArg, Attrs); FunctionTypes->add(VT, MT); #ifdef DEBUG_MERGE_TYPES @@ -1100,32 +1111,75 @@ return MT; } -FunctionType::ParameterAttributes -FunctionType::getParamAttrs(unsigned Idx) const { - if (!ParamAttrs) - return NoAttributeSet; - if (Idx >= ParamAttrs->size()) - return NoAttributeSet; - return (*ParamAttrs)[Idx]; +FunctionType::~FunctionType() { + delete ParamAttrs; } -std::string FunctionType::getParamAttrsText(ParameterAttributes Attr) { +bool FunctionType::isStructReturn() const { + if (ParamAttrs) + return ParamAttrs->paramHasAttr(1, StructRetAttribute); + return false; +} + +uint16_t +ParamAttrsList::getParamAttrs(uint16_t Index) const { + unsigned limit = attrs.size(); + for (unsigned i = 0; i < limit; ++i) + if (attrs[i].index == Index) + return attrs[i].attrs; + return NoAttributeSet; +} + + +std::string +ParamAttrsList::getParamAttrsText(uint16_t Attrs) { std::string Result; - if (Attr & ZExtAttribute) + if (Attrs & ZExtAttribute) Result += "zext "; - if (Attr & SExtAttribute) + if (Attrs & SExtAttribute) Result += "sext "; - if (Attr & NoReturnAttribute) + if (Attrs & NoReturnAttribute) Result += "noreturn "; - if (Attr & NoUnwindAttribute) + if (Attrs & NoUnwindAttribute) Result += "nounwind "; - if (Attr & InRegAttribute) + if (Attrs & InRegAttribute) Result += "inreg "; - if (Attr & StructRetAttribute) + if (Attrs & StructRetAttribute) Result += "sret "; return Result; } +void +ParamAttrsList::addAttributes(uint16_t Index, uint16_t Attrs) { + // First, try to replace an existing one + for (unsigned i = 0; i < attrs.size(); ++i) + if (attrs[i].index == Index) { + attrs[i].attrs |= Attrs; + return; + } + + // If not found, add a new one + ParamAttrsWithIndex Val; + Val.attrs = Attrs; + Val.index = Index; + attrs.push_back(Val); +} + +void +ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) { + // Find the index from which to remove the attributes + for (unsigned i = 0; i < attrs.size(); ++i) + if (attrs[i].index == Index) { + attrs[i].attrs &= ~Attrs; + if (attrs[i].attrs == NoAttributeSet) + attrs.erase(&attrs[i]); + return; + } + + // The index wasn't found above + assert(0 && "Index not found for removeAttributes"); +} + //===----------------------------------------------------------------------===// // Array Type Factory... // From sabre at nondot.org Mon Apr 9 01:10:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 01:10:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200704090610.l396ANnp019275@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.90 -> 1.91 --- Log message: minor cleanups --- Diffs of the changes: (+16 -14) Dominators.cpp | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.90 llvm/lib/VMCore/Dominators.cpp:1.91 --- llvm/lib/VMCore/Dominators.cpp:1.90 Sun Apr 8 23:07:36 2007 +++ llvm/lib/VMCore/Dominators.cpp Mon Apr 9 01:10:06 2007 @@ -48,19 +48,6 @@ static RegisterPass C("idom", "Immediate Dominators Construction", true); -namespace { - class DFCalculateWorkObject { - public: - DFCalculateWorkObject(BasicBlock *B, BasicBlock *P, - const DominatorTree::Node *N, - const DominatorTree::Node *PN) - : currentBB(B), parentBB(P), Node(N), parentNode(PN) {} - BasicBlock *currentBB; - BasicBlock *parentBB; - const DominatorTree::Node *Node; - const DominatorTree::Node *parentNode; - }; -} unsigned ImmediateDominators::DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N) { VInfo.Semi = ++N; @@ -362,6 +349,20 @@ static RegisterPass G("domfrontier", "Dominance Frontier Construction", true); +namespace { + class DFCalculateWorkObject { + public: + DFCalculateWorkObject(BasicBlock *B, BasicBlock *P, + const DominatorTree::Node *N, + const DominatorTree::Node *PN) + : currentBB(B), parentBB(P), Node(N), parentNode(PN) {} + BasicBlock *currentBB; + BasicBlock *parentBB; + const DominatorTree::Node *Node; + const DominatorTree::Node *parentNode; + }; +} + const DominanceFrontier::DomSetType & DominanceFrontier::calculate(const DominatorTree &DT, const DominatorTree::Node *Node) { @@ -406,7 +407,8 @@ DominatorTree::Node *IDominee = *NI; BasicBlock *childBB = IDominee->getBlock(); if (visited.count(childBB) == 0) { - workList.push_back(DFCalculateWorkObject(childBB, currentBB, IDominee, currentNode)); + workList.push_back(DFCalculateWorkObject(childBB, currentBB, + IDominee, currentNode)); visitChild = true; } } From reid at x10sys.com Mon Apr 9 01:11:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:11:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200704090611.l396B0PN019317@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.266 -> 1.267 --- Log message: For PR1146: http://llvm.org/PR1146 : Adjust writing of parameter attributes to use ParamAttrList class. --- Diffs of the changes: (+36 -30) AsmWriter.cpp | 66 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 36 insertions(+), 30 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.266 llvm/lib/VMCore/AsmWriter.cpp:1.267 --- llvm/lib/VMCore/AsmWriter.cpp:1.266 Tue Mar 27 20:53:20 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Apr 9 01:10:42 2007 @@ -20,6 +20,7 @@ #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ParameterAttributes.h" #include "llvm/InlineAsm.h" #include "llvm/Instruction.h" #include "llvm/Instructions.h" @@ -284,14 +285,15 @@ calcTypeName(FTy->getReturnType(), TypeStack, TypeNames, Result); Result += " ("; unsigned Idx = 1; + const ParamAttrsList *Attrs = FTy->getParamAttrs(); for (FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Result += ", "; calcTypeName(*I, TypeStack, TypeNames, Result); - if (FTy->getParamAttrs(Idx)) { + if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { Result += + " "; - Result += FunctionType::getParamAttrsText(FTy->getParamAttrs(Idx)); + Result += Attrs->getParamAttrsTextByIndex(Idx); } Idx++; } @@ -300,9 +302,9 @@ Result += "..."; } Result += ")"; - if (FTy->getParamAttrs(0)) { + if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { Result += " "; - Result += FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); + Result += Attrs->getParamAttrsTextByIndex(0); } break; } @@ -697,7 +699,7 @@ void printTypeSymbolTable(const TypeSymbolTable &ST); void printGlobal(const GlobalVariable *GV); void printFunction(const Function *F); - void printArgument(const Argument *FA, FunctionType::ParameterAttributes A); + void printArgument(const Argument *FA, uint16_t ParamAttrs); void printBasicBlock(const BasicBlock *BB); void printInstruction(const Instruction &I); @@ -729,13 +731,14 @@ printType(FTy->getReturnType()); Out << " ("; unsigned Idx = 1; + const ParamAttrsList *Attrs = FTy->getParamAttrs(); for (FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Out << ", "; printType(*I); - if (FTy->getParamAttrs(Idx)) { - Out << " " << FunctionType::getParamAttrsText(FTy->getParamAttrs(Idx)); + if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + Out << " " << Attrs->getParamAttrsTextByIndex(Idx); } Idx++; } @@ -744,8 +747,8 @@ Out << "..."; } Out << ')'; - if (FTy->getParamAttrs(0)) - Out << ' ' << FunctionType::getParamAttrsText(FTy->getParamAttrs(0)); + if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + Out << ' ' << Attrs->getParamAttrsTextByIndex(0); } else if (const StructType *STy = dyn_cast(Ty)) { if (STy->isPacked()) Out << '<'; @@ -954,6 +957,7 @@ } const FunctionType *FT = F->getFunctionType(); + const ParamAttrsList *Attrs = FT->getParamAttrs(); printType(F->getReturnType()) << ' '; if (!F->getName().empty()) Out << getLLVMName(F->getName(), GlobalPrefix); @@ -969,7 +973,8 @@ I != E; ++I) { // Insert commas as we go... the first arg doesn't get a comma if (I != F->arg_begin()) Out << ", "; - printArgument(I, FT->getParamAttrs(Idx)); + printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) + : uint16_t(NoAttributeSet))); Idx++; } @@ -979,8 +984,8 @@ Out << "..."; // Output varargs portion of signature! } Out << ')'; - if (FT->getParamAttrs(0)) - Out << ' ' << FunctionType::getParamAttrsText(FT->getParamAttrs(0)); + if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + Out << ' ' << Attrs->getParamAttrsTextByIndex(0); if (F->hasSection()) Out << " section \"" << F->getSection() << '"'; if (F->getAlignment()) @@ -1004,13 +1009,12 @@ /// printArgument - This member is called for every argument that is passed into /// the function. Simply print it out /// -void AssemblyWriter::printArgument(const Argument *Arg, - FunctionType::ParameterAttributes attrs) { +void AssemblyWriter::printArgument(const Argument *Arg, uint16_t Attrs) { // Output type... printType(Arg->getType()); - if (attrs != FunctionType::NoAttributeSet) - Out << ' ' << FunctionType::getParamAttrsText(attrs); + if (Attrs != NoAttributeSet) + Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs); // Output name, if available... if (Arg->hasName()) @@ -1162,9 +1166,10 @@ default: Out << " cc" << CI->getCallingConv(); break; } - const PointerType *PTy = cast(Operand->getType()); - const FunctionType *FTy = cast(PTy->getElementType()); - const Type *RetTy = FTy->getReturnType(); + const PointerType *PTy = cast(Operand->getType()); + const FunctionType *FTy = cast(PTy->getElementType()); + const Type *RetTy = FTy->getReturnType(); + const ParamAttrsList *PAL = FTy->getParamAttrs(); // If possible, print out the short form of the call instruction. We can // only do this if the first argument is a pointer to a nonvararg function, @@ -1183,16 +1188,17 @@ if (op > 1) Out << ','; writeOperand(I.getOperand(op), true); - if (FTy->getParamAttrs(op) != FunctionType::NoAttributeSet) - Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op)); + if (PAL && PAL->getParamAttrs(op) != NoAttributeSet) + Out << " " << PAL->getParamAttrsTextByIndex(op); } Out << " )"; - if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) - Out << ' ' << FTy->getParamAttrsText(FTy->getParamAttrs(0)); + if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + Out << ' ' << PAL->getParamAttrsTextByIndex(0); } else if (const InvokeInst *II = dyn_cast(&I)) { - const PointerType *PTy = cast(Operand->getType()); - const FunctionType *FTy = cast(PTy->getElementType()); - const Type *RetTy = FTy->getReturnType(); + const PointerType *PTy = cast(Operand->getType()); + const FunctionType *FTy = cast(PTy->getElementType()); + const Type *RetTy = FTy->getReturnType(); + const ParamAttrsList *PAL = FTy->getParamAttrs(); // Print the calling convention being used. switch (II->getCallingConv()) { @@ -1222,13 +1228,13 @@ if (op > 3) Out << ','; writeOperand(I.getOperand(op), true); - if (FTy->getParamAttrs(op-2) != FunctionType::NoAttributeSet) - Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op-2)); + if (PAL && PAL->getParamAttrs(op-2) != NoAttributeSet) + Out << " " << PAL->getParamAttrsTextByIndex(op-2); } Out << " )"; - if (FTy->getParamAttrs(0) != FunctionType::NoAttributeSet) - Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(0)); + if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + Out << " " << PAL->getParamAttrsTextByIndex(0); Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); Out << " unwind"; From reid at x10sys.com Mon Apr 9 01:11:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:11:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200704090611.l396BeM4019360@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.115 -> 1.116 --- Log message: For PR1146: http://llvm.org/PR1146 : Parameter attributes can now be defaulted for intrinsics. --- Diffs of the changes: (+2 -2) Function.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.115 llvm/lib/VMCore/Function.cpp:1.116 --- llvm/lib/VMCore/Function.cpp:1.115 Sun Apr 1 02:25:33 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 9 01:11:23 2007 @@ -13,6 +13,7 @@ #include "llvm/Module.h" #include "llvm/DerivedTypes.h" +#include "llvm/ParameterAttributes.h" #include "llvm/IntrinsicInst.h" #include "llvm/Support/LeakDetector.h" #include "SymbolTableListTraitsImpl.h" @@ -197,14 +198,13 @@ uint32_t numTys) { const Type *ResultTy = NULL; std::vector ArgTys; - std::vector Attrs; bool IsVarArg = false; #define GET_INTRINSIC_GENERATOR #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_GENERATOR - return FunctionType::get(ResultTy, ArgTys, IsVarArg, Attrs); + return FunctionType::get(ResultTy, ArgTys, IsVarArg); } Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys, From reid at x10sys.com Mon Apr 9 01:12:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:12:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Module.cpp Message-ID: <200704090612.l396CPjH019409@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Module.cpp updated: 1.77 -> 1.78 --- Log message: For PR1146: http://llvm.org/PR1146 : Simplify construction of FunctionType to use default arguments. --- Diffs of the changes: (+1 -2) Module.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.77 llvm/lib/VMCore/Module.cpp:1.78 --- llvm/lib/VMCore/Module.cpp:1.77 Mon Feb 5 15:19:13 2007 +++ llvm/lib/VMCore/Module.cpp Mon Apr 9 01:12:07 2007 @@ -32,8 +32,7 @@ Function *ilist_traits::createSentinel() { FunctionType *FTy = - FunctionType::get(Type::VoidTy, std::vector(), false, - std::vector() ); + FunctionType::get(Type::VoidTy, std::vector(), false); Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); From reid at x10sys.com Mon Apr 9 01:13:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:13:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/ParserInternals.h llvmAsmParser.y Message-ID: <200704090613.l396DOhT019455@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: ParserInternals.h updated: 1.54 -> 1.55 llvmAsmParser.y updated: 1.336 -> 1.337 --- Log message: For PR1146: http://llvm.org/PR1146 : Adapt handling of parameter attributes to use the new ParamAttrsList class. --- Diffs of the changes: (+82 -46) ParserInternals.h | 7 +-- llvmAsmParser.y | 121 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 82 insertions(+), 46 deletions(-) Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.54 llvm/lib/AsmParser/ParserInternals.h:1.55 --- llvm/lib/AsmParser/ParserInternals.h:1.54 Mon Mar 19 13:34:28 2007 +++ llvm/lib/AsmParser/ParserInternals.h Mon Apr 9 01:13:07 2007 @@ -17,6 +17,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" #include "llvm/Assembly/Parser.h" @@ -231,13 +232,13 @@ struct TypeWithAttrs { llvm::PATypeHolder *Ty; - FunctionType::ParameterAttributes Attrs; + uint16_t Attrs; }; typedef std::vector TypeWithAttrsList; struct ArgListEntry { - FunctionType::ParameterAttributes Attrs; + uint16_t Attrs; llvm::PATypeHolder *Ty; char *Name; }; @@ -246,7 +247,7 @@ struct ValueRefListEntry { Value *Val; - FunctionType::ParameterAttributes Attrs; + uint16_t Attrs; }; typedef std::vector ValueRefList; Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.336 llvm/lib/AsmParser/llvmAsmParser.y:1.337 --- llvm/lib/AsmParser/llvmAsmParser.y:1.336 Sun Apr 8 20:55:42 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Apr 9 01:13:07 2007 @@ -200,8 +200,6 @@ } return false; } - - } CurModule; static struct PerFunctionInfo { @@ -962,7 +960,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; - llvm::FunctionType::ParameterAttributes ParamAttrs; + uint16_t ParamAttrs; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1191,26 +1189,26 @@ CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; } - | SEXT { $$ = FunctionType::SExtAttribute; } - | INREG { $$ = FunctionType::InRegAttribute; } - | SRET { $$ = FunctionType::StructRetAttribute; } +ParamAttr : ZEXT { $$ = ZExtAttribute; } + | SEXT { $$ = SExtAttribute; } + | INREG { $$ = InRegAttribute; } + | SRET { $$ = StructRetAttribute; } ; -OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } | OptParamAttrs ParamAttr { - $$ = FunctionType::ParameterAttributes($1 | $2); + $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = FunctionType::NoReturnAttribute; } - | NOUNWIND { $$ = FunctionType::NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = NoReturnAttribute; } + | NOUNWIND { $$ = NoUnwindAttribute; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } | OptFuncAttrs FuncAttr { - $$ = FunctionType::ParameterAttributes($1 | $2); + $$ = $1 | $2; } ; @@ -1299,18 +1297,25 @@ } | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; - std::vector Attrs; - Attrs.push_back($5); - for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ($5 != NoAttributeSet) + Attrs.addAttributes(0, $5); + unsigned index = 1; + TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*$1, Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + FunctionType *FT = FunctionType::get(*$1, Params, isVarArg, ActualAttrs); delete $3; // Delete the argument list delete $1; // Delete the return type handle $$ = new PATypeHolder(HandleUpRefs(FT)); @@ -1318,18 +1323,26 @@ } | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; - std::vector Attrs; - Attrs.push_back($5); - for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ($5 != NoAttributeSet) + Attrs.addAttributes(0, $5); + TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); + unsigned index = 1; + for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get($1, Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + + FunctionType *FT = FunctionType::get($1, Params, isVarArg, ActualAttrs); delete $3; // Delete the argument list $$ = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR @@ -1417,14 +1430,14 @@ : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2087,7 +2100,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; $$->push_back(E); CHECK_FOR_ERROR } @@ -2096,7 +2109,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; $$->push_back(E); CHECK_FOR_ERROR } @@ -2117,24 +2130,31 @@ GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription()); std::vector ParamTypeList; - std::vector ParamAttrs; - ParamAttrs.push_back($7); + ParamAttrsList ParamAttrs; + if ($7 != NoAttributeSet) + ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... - for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I) { + unsigned index = 1; + for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg, - ParamAttrs); + ParamAttrsList *ActualAttrs = 0; + if (!ParamAttrs.empty()) + ActualAttrs = new ParamAttrsList(ParamAttrs); + + FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg, + ActualAttrs); const PointerType *PFT = PointerType::get(FT); delete $2; @@ -2465,17 +2485,24 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back($8); - for (ValueRefList::iterator I = $6->begin(), E = $6->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ($8 != NoAttributeSet) + ParamAttrs.addAttributes(0, $8); + ValueRefList::iterator I = $6->begin(), E = $6->end(); + unsigned index = 1; + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get($3->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + Ty = FunctionType::get($3->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } @@ -2764,17 +2791,25 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back($8); - for (ValueRefList::iterator I = $6->begin(), E = $6->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ($8 != NoAttributeSet) + ParamAttrs.addAttributes(0, $8); + unsigned index = 1; + ValueRefList::iterator I = $6->begin(), E = $6->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get($3->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + + Ty = FunctionType::get($3->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } From reid at x10sys.com Mon Apr 9 01:13:46 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:13:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200704090613.l396DkXF019480@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.37 -> 1.38 llvmAsmParser.cpp.cvs updated: 1.81 -> 1.82 llvmAsmParser.h.cvs updated: 1.63 -> 1.64 llvmAsmParser.y.cvs updated: 1.82 -> 1.83 --- Log message: Regenerate --- Diffs of the changes: (+569 -499) Lexer.cpp.cvs | 282 ++++++++++----------- llvmAsmParser.cpp.cvs | 661 ++++++++++++++++++++++++++------------------------ llvmAsmParser.h.cvs | 4 llvmAsmParser.y.cvs | 121 +++++---- 4 files changed, 569 insertions(+), 499 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.37 llvm/lib/AsmParser/Lexer.cpp.cvs:1.38 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.37 Sun Apr 8 20:56:05 2007 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Mon Apr 9 01:13:29 2007 @@ -20,7 +20,7 @@ /* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.37 2007/04/09 01:56:05 reid Exp $ + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.38 2007/04/09 06:13:29 reid Exp $ */ #define FLEX_SCANNER @@ -869,7 +869,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 1 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" #define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // @@ -884,7 +884,7 @@ // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 -#line 28 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 28 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -1168,7 +1168,7 @@ register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 190 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 190 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" #line 1175 "Lexer.cpp" @@ -1264,257 +1264,257 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 192 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 194 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 195 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 196 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 197 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 198 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 199 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DEFINE; } YY_BREAK case 8: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 200 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 9: YY_RULE_SETUP -#line 201 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 201 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 10: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 202 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 11: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 203 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 12: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 204 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 13: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 205 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 14: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 206 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DLLIMPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 207 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DLLEXPORT; } YY_BREAK case 16: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 208 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return HIDDEN; } YY_BREAK case 17: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 209 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return EXTERN_WEAK; } YY_BREAK case 18: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 210 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 19: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 211 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 20: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 212 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 21: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 213 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 22: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 214 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 215 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 24: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 216 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 25: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 217 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 26: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 218 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 27: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 219 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 28: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 220 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return DATALAYOUT; } YY_BREAK case 29: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 221 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 30: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 222 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ALIGN; } YY_BREAK case 31: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 223 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SECTION; } YY_BREAK case 32: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 224 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return MODULE; } YY_BREAK case 33: YY_RULE_SETUP -#line 225 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 225 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ASM_TOK; } YY_BREAK case 34: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 226 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SIDEEFFECT; } YY_BREAK case 35: YY_RULE_SETUP -#line 228 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 228 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return CC_TOK; } YY_BREAK case 36: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 229 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return CCC_TOK; } YY_BREAK case 37: YY_RULE_SETUP -#line 230 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 230 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return FASTCC_TOK; } YY_BREAK case 38: YY_RULE_SETUP -#line 231 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 231 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return COLDCC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 232 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 232 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return X86_STDCALLCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 233 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return X86_FASTCALLCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 235 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 235 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return INREG; } YY_BREAK case 42: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 236 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SRET; } YY_BREAK case 43: YY_RULE_SETUP -#line 237 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 237 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return NOUNWIND; } YY_BREAK case 44: YY_RULE_SETUP -#line 238 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 238 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return NORETURN; } YY_BREAK case 45: YY_RULE_SETUP -#line 240 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 240 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TY(Type::VoidTy, VOID); } YY_BREAK case 46: YY_RULE_SETUP -#line 241 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 241 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TY(Type::FloatTy, FLOAT); } YY_BREAK case 47: YY_RULE_SETUP -#line 242 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 242 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TY(Type::DoubleTy,DOUBLE);} YY_BREAK case 48: YY_RULE_SETUP -#line 243 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 243 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TY(Type::LabelTy, LABEL); } YY_BREAK case 49: YY_RULE_SETUP -#line 244 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 244 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return TYPE; } YY_BREAK case 50: YY_RULE_SETUP -#line 245 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 245 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OPAQUE; } YY_BREAK case 51: YY_RULE_SETUP -#line 246 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 246 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { uint64_t NumBits = atoull(yytext+1); if (NumBits < IntegerType::MIN_INT_BITS || NumBits > IntegerType::MAX_INT_BITS) @@ -1525,347 +1525,347 @@ YY_BREAK case 52: YY_RULE_SETUP -#line 254 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 254 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 53: YY_RULE_SETUP -#line 255 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 255 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 54: YY_RULE_SETUP -#line 256 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 256 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 55: YY_RULE_SETUP -#line 257 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 257 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, UDiv, UDIV); } YY_BREAK case 56: YY_RULE_SETUP -#line 258 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 258 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SDiv, SDIV); } YY_BREAK case 57: YY_RULE_SETUP -#line 259 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 259 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FDiv, FDIV); } YY_BREAK case 58: YY_RULE_SETUP -#line 260 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 260 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, URem, UREM); } YY_BREAK case 59: YY_RULE_SETUP -#line 261 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 261 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SRem, SREM); } YY_BREAK case 60: YY_RULE_SETUP -#line 262 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 262 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FRem, FREM); } YY_BREAK case 61: YY_RULE_SETUP -#line 263 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 263 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Shl, SHL); } YY_BREAK case 62: YY_RULE_SETUP -#line 264 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 264 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, LShr, LSHR); } YY_BREAK case 63: YY_RULE_SETUP -#line 265 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 265 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, AShr, ASHR); } YY_BREAK case 64: YY_RULE_SETUP -#line 266 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 266 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 65: YY_RULE_SETUP -#line 267 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 267 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 66: YY_RULE_SETUP -#line 268 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 268 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 67: YY_RULE_SETUP -#line 269 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 269 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ICmp, ICMP); } YY_BREAK case 68: YY_RULE_SETUP -#line 270 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 270 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, FCmp, FCMP); } YY_BREAK case 69: YY_RULE_SETUP -#line 272 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 272 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return EQ; } YY_BREAK case 70: YY_RULE_SETUP -#line 273 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 273 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return NE; } YY_BREAK case 71: YY_RULE_SETUP -#line 274 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 274 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SLT; } YY_BREAK case 72: YY_RULE_SETUP -#line 275 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 275 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SGT; } YY_BREAK case 73: YY_RULE_SETUP -#line 276 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 276 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SLE; } YY_BREAK case 74: YY_RULE_SETUP -#line 277 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 277 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return SGE; } YY_BREAK case 75: YY_RULE_SETUP -#line 278 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 278 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ULT; } YY_BREAK case 76: YY_RULE_SETUP -#line 279 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 279 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UGT; } YY_BREAK case 77: YY_RULE_SETUP -#line 280 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 280 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ULE; } YY_BREAK case 78: YY_RULE_SETUP -#line 281 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 281 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UGE; } YY_BREAK case 79: YY_RULE_SETUP -#line 282 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 282 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OEQ; } YY_BREAK case 80: YY_RULE_SETUP -#line 283 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 283 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ONE; } YY_BREAK case 81: YY_RULE_SETUP -#line 284 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 284 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OLT; } YY_BREAK case 82: YY_RULE_SETUP -#line 285 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 285 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OGT; } YY_BREAK case 83: YY_RULE_SETUP -#line 286 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 286 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OLE; } YY_BREAK case 84: YY_RULE_SETUP -#line 287 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 287 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return OGE; } YY_BREAK case 85: YY_RULE_SETUP -#line 288 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 288 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return ORD; } YY_BREAK case 86: YY_RULE_SETUP -#line 289 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 289 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UNO; } YY_BREAK case 87: YY_RULE_SETUP -#line 290 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 290 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UEQ; } YY_BREAK case 88: YY_RULE_SETUP -#line 291 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 291 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return UNE; } YY_BREAK case 89: YY_RULE_SETUP -#line 293 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 293 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 90: YY_RULE_SETUP -#line 294 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 294 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 91: YY_RULE_SETUP -#line 295 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 295 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, Trunc, TRUNC); } YY_BREAK case 92: YY_RULE_SETUP -#line 296 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 296 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, ZExt, ZEXT); } YY_BREAK case 93: YY_RULE_SETUP -#line 297 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 297 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SExt, SEXT); } YY_BREAK case 94: YY_RULE_SETUP -#line 298 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 298 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } YY_BREAK case 95: YY_RULE_SETUP -#line 299 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 299 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPExt, FPEXT); } YY_BREAK case 96: YY_RULE_SETUP -#line 300 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 300 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, UIToFP, UITOFP); } YY_BREAK case 97: YY_RULE_SETUP -#line 301 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 301 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SIToFP, SITOFP); } YY_BREAK case 98: YY_RULE_SETUP -#line 302 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 302 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToUI, FPTOUI); } YY_BREAK case 99: YY_RULE_SETUP -#line 303 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 303 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToSI, FPTOSI); } YY_BREAK case 100: YY_RULE_SETUP -#line 304 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 304 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } YY_BREAK case 101: YY_RULE_SETUP -#line 305 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 305 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } YY_BREAK case 102: YY_RULE_SETUP -#line 306 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 306 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, BitCast, BITCAST); } YY_BREAK case 103: YY_RULE_SETUP -#line 307 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 307 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 104: YY_RULE_SETUP -#line 308 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 308 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 105: YY_RULE_SETUP -#line 309 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 309 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 106: YY_RULE_SETUP -#line 310 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 310 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 107: YY_RULE_SETUP -#line 311 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 311 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 108: YY_RULE_SETUP -#line 312 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 312 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 109: YY_RULE_SETUP -#line 313 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 313 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 110: YY_RULE_SETUP -#line 314 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 314 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK case 111: YY_RULE_SETUP -#line 316 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 316 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK case 112: YY_RULE_SETUP -#line 317 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 317 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK case 113: YY_RULE_SETUP -#line 318 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 318 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK case 114: YY_RULE_SETUP -#line 319 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 319 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK case 115: YY_RULE_SETUP -#line 320 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 320 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK case 116: YY_RULE_SETUP -#line 321 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 321 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK case 117: YY_RULE_SETUP -#line 323 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 323 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK case 118: YY_RULE_SETUP -#line 324 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 324 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK case 119: YY_RULE_SETUP -#line 325 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 325 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK case 120: YY_RULE_SETUP -#line 328 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 328 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % @@ -1874,7 +1874,7 @@ YY_BREAK case 121: YY_RULE_SETUP -#line 333 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 333 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip @ @@ -1883,7 +1883,7 @@ YY_BREAK case 122: YY_RULE_SETUP -#line 338 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 338 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1893,7 +1893,7 @@ YY_BREAK case 123: YY_RULE_SETUP -#line 344 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 344 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1903,7 +1903,7 @@ YY_BREAK case 124: YY_RULE_SETUP -#line 351 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 351 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a @@ -1916,7 +1916,7 @@ YY_BREAK case 125: YY_RULE_SETUP -#line 360 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 360 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke end quote llvmAsmlval.StrVal = strdup(yytext+2); // Nuke @, quote @@ -1925,7 +1925,7 @@ YY_BREAK case 126: YY_RULE_SETUP -#line 366 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 366 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { int len = strlen(yytext); uint32_t numBits = ((len * 64) / 19) + 1; APInt Tmp(numBits, yytext, len, 10); @@ -1943,7 +1943,7 @@ YY_BREAK case 127: YY_RULE_SETUP -#line 380 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 380 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { int len = strlen(yytext); uint32_t numBits = (((len-1) * 64) / 19) + 2; APInt Tmp(numBits, yytext, len, 10); @@ -1961,7 +1961,7 @@ YY_BREAK case 128: YY_RULE_SETUP -#line 395 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 395 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { int len = strlen(yytext+3) - 3; uint32_t bits = len * 4; APInt Tmp(bits, yytext+3, len, 16); @@ -1982,7 +1982,7 @@ YY_BREAK case 129: YY_RULE_SETUP -#line 413 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 413 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -1993,7 +1993,7 @@ YY_BREAK case 130: YY_RULE_SETUP -#line 420 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 420 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -2004,16 +2004,16 @@ YY_BREAK case 131: YY_RULE_SETUP -#line 428 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 428 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 132: YY_RULE_SETUP -#line 429 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 429 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 431 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 431 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -2024,17 +2024,17 @@ YY_BREAK case 133: YY_RULE_SETUP -#line 439 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 439 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK case 134: YY_RULE_SETUP -#line 440 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 440 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK case 135: YY_RULE_SETUP -#line 442 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 442 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 2041 "Lexer.cpp" @@ -2915,5 +2915,5 @@ return 0; } #endif -#line 442 "/proj/llvm/llvm-4/lib/AsmParser/Lexer.l" +#line 442 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.81 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.82 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.81 Sun Apr 8 20:56:05 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Apr 9 01:13:29 2007 @@ -334,7 +334,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -524,8 +524,6 @@ } return false; } - - } CurModule; static struct PerFunctionInfo { @@ -1279,7 +1277,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 939 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 937 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1306,7 +1304,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; - llvm::FunctionType::ParameterAttributes ParamAttrs; + uint16_t ParamAttrs; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1327,7 +1325,7 @@ llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1331 "llvmAsmParser.tab.c" +#line 1329 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1339,7 +1337,7 @@ /* Line 219 of yacc.c. */ -#line 1343 "llvmAsmParser.tab.c" +#line 1341 "llvmAsmParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1687,35 +1685,35 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, - 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, - 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1099, - 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, - 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, - 1112, 1113, 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, - 1124, 1124, 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, - 1151, 1152, 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, - 1170, 1174, 1175, 1176, 1177, 1178, 1181, 1182, 1183, 1184, - 1185, 1186, 1187, 1194, 1195, 1196, 1197, 1200, 1201, 1206, - 1207, 1208, 1211, 1212, 1219, 1220, 1226, 1227, 1235, 1243, - 1244, 1249, 1250, 1251, 1256, 1269, 1269, 1269, 1269, 1272, - 1276, 1280, 1287, 1292, 1300, 1319, 1338, 1343, 1355, 1365, - 1369, 1379, 1386, 1393, 1400, 1405, 1410, 1417, 1418, 1425, - 1432, 1440, 1446, 1458, 1486, 1502, 1531, 1559, 1584, 1603, - 1629, 1649, 1661, 1668, 1734, 1744, 1754, 1760, 1770, 1776, - 1786, 1791, 1796, 1804, 1816, 1838, 1846, 1852, 1863, 1868, - 1873, 1879, 1885, 1894, 1898, 1906, 1906, 1917, 1922, 1930, - 1931, 1935, 1935, 1939, 1939, 1942, 1945, 1969, 1980, 1980, - 1990, 1990, 1998, 1998, 2008, 2011, 2017, 2030, 2034, 2039, - 2041, 2046, 2051, 2060, 2070, 2081, 2085, 2094, 2103, 2108, - 2220, 2220, 2222, 2231, 2231, 2233, 2238, 2250, 2254, 2259, - 2263, 2267, 2271, 2275, 2279, 2283, 2287, 2291, 2316, 2320, - 2334, 2338, 2342, 2346, 2352, 2352, 2358, 2367, 2371, 2380, - 2389, 2398, 2402, 2407, 2411, 2415, 2420, 2430, 2449, 2458, - 2527, 2531, 2538, 2549, 2562, 2572, 2583, 2593, 2602, 2611, - 2614, 2615, 2622, 2626, 2631, 2652, 2669, 2683, 2697, 2709, - 2717, 2724, 2730, 2736, 2742, 2757, 2821, 2826, 2830, 2837, - 2844, 2852, 2859, 2867, 2875, 2889, 2906 + 0, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1092, 1092, 1092, 1092, 1092, 1092, 1093, 1093, 1093, + 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1097, + 1097, 1098, 1098, 1099, 1099, 1100, 1100, 1101, 1101, 1105, + 1105, 1106, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1110, + 1110, 1111, 1111, 1112, 1113, 1118, 1119, 1119, 1121, 1121, + 1122, 1122, 1126, 1130, 1135, 1135, 1137, 1141, 1147, 1148, + 1149, 1150, 1151, 1155, 1156, 1157, 1161, 1162, 1166, 1167, + 1168, 1172, 1173, 1174, 1175, 1176, 1179, 1180, 1181, 1182, + 1183, 1184, 1185, 1192, 1193, 1194, 1195, 1198, 1199, 1204, + 1205, 1206, 1209, 1210, 1217, 1218, 1224, 1225, 1233, 1241, + 1242, 1247, 1248, 1249, 1254, 1267, 1267, 1267, 1267, 1270, + 1274, 1278, 1285, 1290, 1298, 1324, 1351, 1356, 1368, 1378, + 1382, 1392, 1399, 1406, 1413, 1418, 1423, 1430, 1431, 1438, + 1445, 1453, 1459, 1471, 1499, 1515, 1544, 1572, 1597, 1616, + 1642, 1662, 1674, 1681, 1747, 1757, 1767, 1773, 1783, 1789, + 1799, 1804, 1809, 1817, 1829, 1851, 1859, 1865, 1876, 1881, + 1886, 1892, 1898, 1907, 1911, 1919, 1919, 1930, 1935, 1943, + 1944, 1948, 1948, 1952, 1952, 1955, 1958, 1982, 1993, 1993, + 2003, 2003, 2011, 2011, 2021, 2024, 2030, 2043, 2047, 2052, + 2054, 2059, 2064, 2073, 2083, 2094, 2098, 2107, 2116, 2121, + 2240, 2240, 2242, 2251, 2251, 2253, 2258, 2270, 2274, 2279, + 2283, 2287, 2291, 2295, 2299, 2303, 2307, 2311, 2336, 2340, + 2354, 2358, 2362, 2366, 2372, 2372, 2378, 2387, 2391, 2400, + 2409, 2418, 2422, 2427, 2431, 2435, 2440, 2450, 2469, 2478, + 2554, 2558, 2565, 2576, 2589, 2599, 2610, 2620, 2629, 2638, + 2641, 2642, 2649, 2653, 2658, 2679, 2696, 2710, 2724, 2736, + 2744, 2751, 2757, 2763, 2769, 2784, 2856, 2861, 2865, 2872, + 2879, 2887, 2894, 2902, 2910, 2924, 2941 }; #endif @@ -3041,142 +3039,142 @@ switch (yyn) { case 29: -#line 1099 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1099 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1100 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1100 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1101 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1101 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1102 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1102 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1103 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1103 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1107 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1105 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1107 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1105 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1108 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1108 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1109 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1109 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1110 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1110 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1111 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1111 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1112 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1112 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1113 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1113 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1114 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1115 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 61: -#line 1124 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 62: -#line 1128 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR @@ -3184,7 +3182,7 @@ break; case 63: -#line 1132 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1130 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3192,7 +3190,7 @@ break; case 66: -#line 1139 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1137 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR @@ -3200,7 +3198,7 @@ break; case 67: -#line 1143 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1141 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3208,127 +3206,127 @@ break; case 68: -#line 1149 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1147 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 69: -#line 1150 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 70: -#line 1151 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 71: -#line 1152 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 72: -#line 1153 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 73: -#line 1157 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1155 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 74: -#line 1158 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 75: -#line 1159 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 76: -#line 1163 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 77: -#line 1164 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 78: -#line 1168 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1166 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1169 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1167 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 80: -#line 1170 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 81: -#line 1174 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 82: -#line 1175 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 83: -#line 1176 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 84: -#line 1177 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 85: -#line 1178 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 86: -#line 1181 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1179 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 87: -#line 1182 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 88: -#line 1183 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 89: -#line 1184 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 90: -#line 1185 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1183 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 91: -#line 1186 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 92: -#line 1187 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3338,66 +3336,66 @@ break; case 93: -#line 1194 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;} +#line 1192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ZExtAttribute; ;} break; case 94: -#line 1195 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;} +#line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = SExtAttribute; ;} break; case 95: -#line 1196 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;} +#line 1194 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = InRegAttribute; ;} break; case 96: -#line 1197 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;} +#line 1195 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = StructRetAttribute; ;} break; case 97: -#line 1200 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} +#line 1198 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = NoAttributeSet; ;} break; case 98: -#line 1201 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1199 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); ;} break; case 99: -#line 1206 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;} +#line 1204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = NoReturnAttribute; ;} break; case 100: -#line 1207 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoUnwindAttribute; ;} +#line 1205 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = NoUnwindAttribute; ;} break; case 102: -#line 1211 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} +#line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = NoAttributeSet; ;} break; case 103: -#line 1212 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs)); + (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); ;} break; case 104: -#line 1219 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 105: -#line 1220 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3407,12 +3405,12 @@ break; case 106: -#line 1226 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 107: -#line 1227 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -3422,7 +3420,7 @@ break; case 108: -#line 1235 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -3433,27 +3431,27 @@ break; case 109: -#line 1243 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 110: -#line 1244 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 111: -#line 1249 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" {;} break; case 112: -#line 1250 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" {;} break; case 113: -#line 1251 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3462,7 +3460,7 @@ break; case 114: -#line 1256 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -3472,7 +3470,7 @@ break; case 119: -#line 1272 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -3480,7 +3478,7 @@ break; case 120: -#line 1276 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR @@ -3488,7 +3486,7 @@ break; case 121: -#line 1280 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[-1].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -3499,7 +3497,7 @@ break; case 122: -#line 1287 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR @@ -3508,7 +3506,7 @@ break; case 123: -#line 1292 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -3520,21 +3518,28 @@ break; case 124: -#line 1300 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Params; - std::vector Attrs; - Attrs.push_back((yyvsp[0].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + unsigned index = 1; + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, ActualAttrs); delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list delete (yyvsp[-4].TypeVal); // Delete the return type handle (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); @@ -3543,21 +3548,29 @@ break; case 125: -#line 1319 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1324 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Params; - std::vector Attrs; - Attrs.push_back((yyvsp[0].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); + unsigned index = 1; + for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + + FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, ActualAttrs); delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR @@ -3565,7 +3578,7 @@ break; case 126: -#line 1338 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1351 "/proj/llvm/llvm-1/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); @@ -3574,7 +3587,7 @@ break; case 127: -#line 1343 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1356 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -3590,7 +3603,7 @@ break; case 128: -#line 1355 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1368 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -3604,7 +3617,7 @@ break; case 129: -#line 1365 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1378 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -3612,7 +3625,7 @@ break; case 130: -#line 1369 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1382 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(), @@ -3626,7 +3639,7 @@ break; case 131: -#line 1379 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1392 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -3634,7 +3647,7 @@ break; case 132: -#line 1386 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1399 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); @@ -3642,7 +3655,7 @@ break; case 133: -#line 1393 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1406 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -3653,14 +3666,14 @@ break; case 134: -#line 1400 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1413 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 135: -#line 1405 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1418 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); @@ -3669,7 +3682,7 @@ break; case 136: -#line 1410 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1423 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); CHECK_FOR_ERROR @@ -3677,10 +3690,10 @@ break; case 138: -#line 1418 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -3688,10 +3701,10 @@ break; case 139: -#line 1425 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1438 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -3699,7 +3712,7 @@ break; case 140: -#line 1432 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1445 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -3707,7 +3720,7 @@ break; case 141: -#line 1440 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1453 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); @@ -3717,7 +3730,7 @@ break; case 142: -#line 1446 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1459 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); @@ -3726,7 +3739,7 @@ break; case 143: -#line 1458 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1471 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -3758,7 +3771,7 @@ break; case 144: -#line 1486 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1499 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -3778,7 +3791,7 @@ break; case 145: -#line 1502 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1515 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -3811,7 +3824,7 @@ break; case 146: -#line 1531 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1544 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -3843,7 +3856,7 @@ break; case 147: -#line 1559 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1572 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) @@ -3872,7 +3885,7 @@ break; case 148: -#line 1584 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1597 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -3895,7 +3908,7 @@ break; case 149: -#line 1603 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1616 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); if (STy == 0) @@ -3925,7 +3938,7 @@ break; case 150: -#line 1629 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); @@ -3949,7 +3962,7 @@ break; case 151: -#line 1649 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1662 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -3965,7 +3978,7 @@ break; case 152: -#line 1661 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1674 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -3976,7 +3989,7 @@ break; case 153: -#line 1668 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1681 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -4046,7 +4059,7 @@ break; case 154: -#line 1734 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1747 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -4060,7 +4073,7 @@ break; case 155: -#line 1744 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1757 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -4074,7 +4087,7 @@ break; case 156: -#line 1754 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1767 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4084,7 +4097,7 @@ break; case 157: -#line 1760 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { @@ -4098,7 +4111,7 @@ break; case 158: -#line 1770 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1783 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4108,7 +4121,7 @@ break; case 159: -#line 1776 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1789 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { @@ -4122,7 +4135,7 @@ break; case 160: -#line 1786 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1799 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); @@ -4131,7 +4144,7 @@ break; case 161: -#line 1791 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); @@ -4140,7 +4153,7 @@ break; case 162: -#line 1796 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1809 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4150,7 +4163,7 @@ break; case 163: -#line 1804 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1817 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -4166,7 +4179,7 @@ break; case 164: -#line 1816 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1829 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4192,7 +4205,7 @@ break; case 165: -#line 1838 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1851 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4204,7 +4217,7 @@ break; case 166: -#line 1846 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1859 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4214,7 +4227,7 @@ break; case 167: -#line 1852 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1865 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -4229,7 +4242,7 @@ break; case 168: -#line 1863 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1876 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4238,7 +4251,7 @@ break; case 169: -#line 1868 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1881 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4247,7 +4260,7 @@ break; case 170: -#line 1873 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1886 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -4257,7 +4270,7 @@ break; case 171: -#line 1879 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1892 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -4267,7 +4280,7 @@ break; case 172: -#line 1885 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1898 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -4277,7 +4290,7 @@ break; case 173: -#line 1894 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1907 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR @@ -4285,7 +4298,7 @@ break; case 174: -#line 1898 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1911 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -4294,17 +4307,17 @@ break; case 175: -#line 1906 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1919 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 176: -#line 1906 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1919 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 177: -#line 1917 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1930 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4313,7 +4326,7 @@ break; case 178: -#line 1922 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4322,12 +4335,12 @@ break; case 181: -#line 1935 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 182: -#line 1935 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -4335,26 +4348,26 @@ break; case 183: -#line 1939 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1952 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 184: -#line 1939 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1952 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 185: -#line 1942 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1955 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 186: -#line 1945 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -4382,7 +4395,7 @@ break; case 187: -#line 1969 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1982 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); @@ -4397,7 +4410,7 @@ break; case 188: -#line 1980 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 1993 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[0].ConstVal) == 0) @@ -4409,14 +4422,14 @@ break; case 189: -#line 1987 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2000 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 190: -#line 1990 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2003 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -4426,14 +4439,14 @@ break; case 191: -#line 1995 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2008 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 192: -#line 1998 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2011 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -4444,7 +4457,7 @@ break; case 193: -#line 2004 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -4452,21 +4465,21 @@ break; case 194: -#line 2008 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 195: -#line 2011 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 196: -#line 2017 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -4482,7 +4495,7 @@ break; case 197: -#line 2030 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2043 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4490,7 +4503,7 @@ break; case 198: -#line 2034 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4498,7 +4511,7 @@ break; case 200: -#line 2041 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2054 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4507,7 +4520,7 @@ break; case 201: -#line 2046 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2059 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4516,14 +4529,14 @@ break; case 202: -#line 2051 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2064 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 203: -#line 2060 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2073 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -4537,7 +4550,7 @@ break; case 204: -#line 2070 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2083 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -4551,7 +4564,7 @@ break; case 205: -#line 2081 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2094 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR @@ -4559,33 +4572,33 @@ break; case 206: -#line 2085 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} break; case 207: -#line 2094 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} break; case 208: -#line 2103 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2116 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -4593,7 +4606,7 @@ break; case 209: -#line 2109 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { UnEscapeLexed((yyvsp[-6].StrVal)); std::string FunctionName((yyvsp[-6].StrVal)); @@ -4605,24 +4618,31 @@ GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); std::vector ParamTypeList; - std::vector ParamAttrs; - ParamAttrs.push_back((yyvsp[-2].ParamAttrs)); + ParamAttrsList ParamAttrs; + if ((yyvsp[-2].ParamAttrs) != NoAttributeSet) + ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); if ((yyvsp[-4].ArgList)) { // If there are arguments... - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I) { + unsigned index = 1; + for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].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()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, - ParamAttrs); + ParamAttrsList *ActualAttrs = 0; + if (!ParamAttrs.empty()) + ActualAttrs = new ParamAttrsList(ParamAttrs); + + FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, + ActualAttrs); const PointerType *PFT = PointerType::get(FT); delete (yyvsp[-7].TypeVal); @@ -4707,7 +4727,7 @@ break; case 212: -#line 2222 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2242 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -4719,7 +4739,7 @@ break; case 215: -#line 2233 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2253 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4727,7 +4747,7 @@ break; case 216: -#line 2238 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2258 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); @@ -4738,7 +4758,7 @@ break; case 217: -#line 2250 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2270 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4746,7 +4766,7 @@ break; case 218: -#line 2254 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2274 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4754,7 +4774,7 @@ break; case 219: -#line 2259 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2279 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR @@ -4762,7 +4782,7 @@ break; case 220: -#line 2263 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2283 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR @@ -4770,7 +4790,7 @@ break; case 221: -#line 2267 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2287 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR @@ -4778,7 +4798,7 @@ break; case 222: -#line 2271 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2291 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -4786,7 +4806,7 @@ break; case 223: -#line 2275 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2295 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -4794,7 +4814,7 @@ break; case 224: -#line 2279 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2299 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -4802,7 +4822,7 @@ break; case 225: -#line 2283 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2303 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -4810,7 +4830,7 @@ break; case 226: -#line 2287 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2307 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -4818,7 +4838,7 @@ break; case 227: -#line 2291 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2311 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -4847,7 +4867,7 @@ break; case 228: -#line 2316 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2336 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); CHECK_FOR_ERROR @@ -4855,7 +4875,7 @@ break; case 229: -#line 2320 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2340 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -4869,7 +4889,7 @@ break; case 230: -#line 2334 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2354 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR @@ -4877,7 +4897,7 @@ break; case 231: -#line 2338 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2358 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); CHECK_FOR_ERROR @@ -4885,7 +4905,7 @@ break; case 232: -#line 2342 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2362 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR @@ -4893,7 +4913,7 @@ break; case 233: -#line 2346 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2366 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); CHECK_FOR_ERROR @@ -4901,7 +4921,7 @@ break; case 236: -#line 2358 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2378 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -4912,7 +4932,7 @@ break; case 237: -#line 2367 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2387 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4920,7 +4940,7 @@ break; case 238: -#line 2371 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2391 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4928,7 +4948,7 @@ break; case 239: -#line 2380 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2400 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); CHECK_FOR_ERROR @@ -4940,7 +4960,7 @@ break; case 240: -#line 2389 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2409 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -4953,7 +4973,7 @@ break; case 241: -#line 2398 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2418 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -4961,7 +4981,7 @@ break; case 242: -#line 2402 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2422 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[0].StrVal))); CHECK_FOR_ERROR @@ -4969,7 +4989,7 @@ break; case 243: -#line 2407 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2427 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Return with a result... (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR @@ -4977,7 +4997,7 @@ break; case 244: -#line 2411 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR @@ -4985,7 +5005,7 @@ break; case 245: -#line 2415 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2435 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); CHECK_FOR_ERROR @@ -4994,7 +5014,7 @@ break; case 246: -#line 2420 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2440 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); @@ -5008,7 +5028,7 @@ break; case 247: -#line 2430 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2450 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); CHECK_FOR_ERROR @@ -5031,7 +5051,7 @@ break; case 248: -#line 2449 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2469 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); CHECK_FOR_ERROR @@ -5044,7 +5064,7 @@ break; case 249: -#line 2459 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2479 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -5054,17 +5074,24 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[-6].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ((yyvsp[-6].ParamAttrs) != NoAttributeSet) + ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); + ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); + unsigned index = 1; + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } @@ -5116,7 +5143,7 @@ break; case 250: -#line 2527 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2554 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -5124,7 +5151,7 @@ break; case 251: -#line 2531 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2558 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -5132,7 +5159,7 @@ break; case 252: -#line 2538 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2565 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); @@ -5147,7 +5174,7 @@ break; case 253: -#line 2549 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2576 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); @@ -5163,7 +5190,7 @@ break; case 254: -#line 2562 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2589 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); @@ -5175,7 +5202,7 @@ break; case 255: -#line 2572 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2599 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); @@ -5190,7 +5217,7 @@ break; case 256: -#line 2583 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2610 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); @@ -5202,7 +5229,7 @@ break; case 257: -#line 2593 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2620 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -5215,7 +5242,7 @@ break; case 258: -#line 2602 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2629 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -5228,17 +5255,17 @@ break; case 259: -#line 2611 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2638 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueRefList) = new ValueRefList(); ;} break; case 260: -#line 2614 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2641 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 261: -#line 2615 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -5247,7 +5274,7 @@ break; case 262: -#line 2622 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2649 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5255,7 +5282,7 @@ break; case 263: -#line 2626 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2653 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5263,7 +5290,7 @@ break; case 264: -#line 2631 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2658 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -5288,7 +5315,7 @@ break; case 265: -#line 2652 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2679 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -5309,7 +5336,7 @@ break; case 266: -#line 2669 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2696 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -5327,7 +5354,7 @@ break; case 267: -#line 2683 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2710 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription()); @@ -5345,7 +5372,7 @@ break; case 268: -#line 2697 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2724 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -5361,7 +5388,7 @@ break; case 269: -#line 2709 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2736 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -5373,7 +5400,7 @@ break; case 270: -#line 2717 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2744 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -5384,7 +5411,7 @@ break; case 271: -#line 2724 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2751 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5394,7 +5421,7 @@ break; case 272: -#line 2730 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2757 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5404,7 +5431,7 @@ break; case 273: -#line 2736 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2763 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5414,7 +5441,7 @@ break; case 274: -#line 2742 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2769 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -5433,7 +5460,7 @@ break; case 275: -#line 2758 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2785 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -5443,17 +5470,25 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[0].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + unsigned index = 1; + ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + + Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } @@ -5500,7 +5535,7 @@ break; case 276: -#line 2821 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2856 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR @@ -5508,7 +5543,7 @@ break; case 277: -#line 2826 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2861 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5516,7 +5551,7 @@ break; case 278: -#line 2830 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2865 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5524,7 +5559,7 @@ break; case 279: -#line 2837 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2872 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5535,7 +5570,7 @@ break; case 280: -#line 2844 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2879 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); @@ -5547,7 +5582,7 @@ break; case 281: -#line 2852 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2887 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5558,7 +5593,7 @@ break; case 282: -#line 2859 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2894 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription()); @@ -5570,7 +5605,7 @@ break; case 283: -#line 2867 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2902 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -5581,7 +5616,7 @@ break; case 284: -#line 2875 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2910 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5599,7 +5634,7 @@ break; case 285: -#line 2889 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2924 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); @@ -5620,7 +5655,7 @@ break; case 286: -#line 2906 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2941 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); @@ -5643,7 +5678,7 @@ } /* Line 1126 of yacc.c. */ -#line 5647 "llvmAsmParser.tab.c" +#line 5682 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -5911,7 +5946,7 @@ } -#line 2923 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 2958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.63 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.64 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.63 Sun Apr 8 20:56:05 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Mon Apr 9 01:13:29 2007 @@ -299,7 +299,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 939 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y" +#line 937 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -326,7 +326,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; - llvm::FunctionType::ParameterAttributes ParamAttrs; + uint16_t ParamAttrs; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.82 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.83 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.82 Sun Apr 8 20:56:05 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Apr 9 01:13:29 2007 @@ -200,8 +200,6 @@ } return false; } - - } CurModule; static struct PerFunctionInfo { @@ -962,7 +960,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; - llvm::FunctionType::ParameterAttributes ParamAttrs; + uint16_t ParamAttrs; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1191,26 +1189,26 @@ CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = FunctionType::ZExtAttribute; } - | SEXT { $$ = FunctionType::SExtAttribute; } - | INREG { $$ = FunctionType::InRegAttribute; } - | SRET { $$ = FunctionType::StructRetAttribute; } +ParamAttr : ZEXT { $$ = ZExtAttribute; } + | SEXT { $$ = SExtAttribute; } + | INREG { $$ = InRegAttribute; } + | SRET { $$ = StructRetAttribute; } ; -OptParamAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } | OptParamAttrs ParamAttr { - $$ = FunctionType::ParameterAttributes($1 | $2); + $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = FunctionType::NoReturnAttribute; } - | NOUNWIND { $$ = FunctionType::NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = NoReturnAttribute; } + | NOUNWIND { $$ = NoUnwindAttribute; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = FunctionType::NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } | OptFuncAttrs FuncAttr { - $$ = FunctionType::ParameterAttributes($1 | $2); + $$ = $1 | $2; } ; @@ -1299,18 +1297,25 @@ } | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; - std::vector Attrs; - Attrs.push_back($5); - for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ($5 != NoAttributeSet) + Attrs.addAttributes(0, $5); + unsigned index = 1; + TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*$1, Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + FunctionType *FT = FunctionType::get(*$1, Params, isVarArg, ActualAttrs); delete $3; // Delete the argument list delete $1; // Delete the return type handle $$ = new PATypeHolder(HandleUpRefs(FT)); @@ -1318,18 +1323,26 @@ } | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; - std::vector Attrs; - Attrs.push_back($5); - for (TypeWithAttrsList::iterator I=$3->begin(), E=$3->end(); I != E; ++I) { + ParamAttrsList Attrs; + if ($5 != NoAttributeSet) + Attrs.addAttributes(0, $5); + TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); + unsigned index = 1; + for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - Attrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get($1, Params, isVarArg, Attrs); + ParamAttrsList *ActualAttrs = 0; + if (!Attrs.empty()) + ActualAttrs = new ParamAttrsList(Attrs); + + FunctionType *FT = FunctionType::get($1, Params, isVarArg, ActualAttrs); delete $3; // Delete the argument list $$ = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR @@ -1417,14 +1430,14 @@ : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2087,7 +2100,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; $$->push_back(E); CHECK_FOR_ERROR } @@ -2096,7 +2109,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = FunctionType::NoAttributeSet; + E.Attrs = NoAttributeSet; $$->push_back(E); CHECK_FOR_ERROR } @@ -2117,24 +2130,31 @@ GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription()); std::vector ParamTypeList; - std::vector ParamAttrs; - ParamAttrs.push_back($7); + ParamAttrsList ParamAttrs; + if ($7 != NoAttributeSet) + ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... - for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I) { + unsigned index = 1; + for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg, - ParamAttrs); + ParamAttrsList *ActualAttrs = 0; + if (!ParamAttrs.empty()) + ActualAttrs = new ParamAttrsList(ParamAttrs); + + FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg, + ActualAttrs); const PointerType *PFT = PointerType::get(FT); delete $2; @@ -2465,17 +2485,24 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back($8); - for (ValueRefList::iterator I = $6->begin(), E = $6->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ($8 != NoAttributeSet) + ParamAttrs.addAttributes(0, $8); + ValueRefList::iterator I = $6->begin(), E = $6->end(); + unsigned index = 1; + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get($3->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + Ty = FunctionType::get($3->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } @@ -2764,17 +2791,25 @@ !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back($8); - for (ValueRefList::iterator I = $6->begin(), E = $6->end(); I != E; ++I) { + ParamAttrsList ParamAttrs; + if ($8 != NoAttributeSet) + ParamAttrs.addAttributes(0, $8); + unsigned index = 1; + ValueRefList::iterator I = $6->begin(), E = $6->end(); + for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - ParamAttrs.push_back(I->Attrs); + if (I->Attrs != NoAttributeSet) + ParamAttrs.addAttributes(index, I->Attrs); } - Ty = FunctionType::get($3->get(), ParamTypes, false, ParamAttrs); + ParamAttrsList *Attrs = 0; + if (!ParamAttrs.empty()) + Attrs = new ParamAttrsList(ParamAttrs); + + Ty = FunctionType::get($3->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(Ty); } From reid at x10sys.com Mon Apr 9 01:14:48 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:14:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp SlotCalculator.h Writer.cpp WriterInternals.h Message-ID: <200704090614.l396EmZw019515@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: SlotCalculator.cpp updated: 1.111 -> 1.112 SlotCalculator.h updated: 1.50 -> 1.51 Writer.cpp updated: 1.170 -> 1.171 WriterInternals.h updated: 1.33 -> 1.34 --- Log message: For PR1146: http://llvm.org/PR1146 : Use ParamAttrsList for writing parameter attributes. Since they are sparse now, we also write them sparsely (saves a few bytes). Unfortunately, this is a bytecode file format change. --- Diffs of the changes: (+36 -17) SlotCalculator.cpp | 9 ++++++--- SlotCalculator.h | 2 +- Writer.cpp | 40 +++++++++++++++++++++++++++------------- WriterInternals.h | 2 ++ 4 files changed, 36 insertions(+), 17 deletions(-) Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.111 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.112 --- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.111 Sun Feb 11 23:18:08 2007 +++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp Mon Apr 9 01:14:31 2007 @@ -332,6 +332,10 @@ SC_DEBUG("end purgeFunction!\n"); } +inline static bool hasImplicitNull(const Type* Ty) { + return Ty != Type::LabelTy && Ty != Type::VoidTy && !isa(Ty); +} + void SlotCalculator::CreateFunctionValueSlot(const Value *V) { assert(!NodeMap.count(V) && "Function-local value can't be inserted!"); @@ -353,7 +357,7 @@ // to insert the implicit null value. if (Table[TyPlane].empty()) { // Label's and opaque types can't have a null value. - if (Ty != Type::LabelTy && !isa(Ty)) { + if (hasImplicitNull(Ty)) { Value *ZeroInitializer = Constant::getNullValue(Ty); // If we are pushing zeroinit, it will be handled below. @@ -370,5 +374,4 @@ SC_DEBUG(" Inserting value [" << TyPlane << "] = " << *V << " slot=" << NodeMap[V] << "\n"); -} - +} Index: llvm/lib/Bytecode/Writer/SlotCalculator.h diff -u llvm/lib/Bytecode/Writer/SlotCalculator.h:1.50 llvm/lib/Bytecode/Writer/SlotCalculator.h:1.51 --- llvm/lib/Bytecode/Writer/SlotCalculator.h:1.50 Sat Feb 10 01:42:59 2007 +++ llvm/lib/Bytecode/Writer/SlotCalculator.h Mon Apr 9 01:14:31 2007 @@ -73,7 +73,7 @@ SlotCalculator(const Module *M); /// getSlot - Return the slot number of the specified value in it's type - /// plane. This returns < 0 on error! + /// plane. /// unsigned getSlot(const Value *V) const { NodeMapType::const_iterator I = NodeMap.find(V); Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.170 llvm/lib/Bytecode/Writer/Writer.cpp:1.171 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.170 Sun Apr 8 22:37:36 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Mon Apr 9 01:14:31 2007 @@ -17,12 +17,13 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "bytecodewriter" +#define DEBUG_TYPE "bcwriter" #include "WriterInternals.h" #include "llvm/Bytecode/WriteBytecodePass.h" #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/ParameterAttributes.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/Module.h" @@ -197,6 +198,21 @@ //=== Constant Output ===// //===----------------------------------------------------------------------===// +void BytecodeWriter::outputParamAttrsList(const ParamAttrsList *Attrs) { + if (!Attrs) { + output_vbr(unsigned(0)); + return; + } + unsigned numAttrs = Attrs->size(); + output_vbr(numAttrs); + for (unsigned i = 0; i < numAttrs; ++i) { + uint16_t index = Attrs->getParamIndex(i); + uint16_t attrs = Attrs->getParamAttrs(index); + output_vbr(uint32_t(index)); + output_vbr(uint32_t(attrs)); + } +} + void BytecodeWriter::outputType(const Type *T) { const StructType* STy = dyn_cast(T); if(STy && STy->isPacked()) @@ -213,25 +229,23 @@ output_vbr(cast(T)->getBitWidth()); break; case Type::FunctionTyID: { - const FunctionType *MT = cast(T); - output_typeid(Table.getTypeSlot(MT->getReturnType())); - output_vbr(unsigned(MT->getParamAttrs(0))); + const FunctionType *FT = cast(T); + output_typeid(Table.getTypeSlot(FT->getReturnType())); // Output the number of arguments to function (+1 if varargs): - output_vbr((unsigned)MT->getNumParams()+MT->isVarArg()); + output_vbr((unsigned)FT->getNumParams()+FT->isVarArg()); // Output all of the arguments... - FunctionType::param_iterator I = MT->param_begin(); - unsigned Idx = 1; - for (; I != MT->param_end(); ++I) { + FunctionType::param_iterator I = FT->param_begin(); + for (; I != FT->param_end(); ++I) output_typeid(Table.getTypeSlot(*I)); - output_vbr(unsigned(MT->getParamAttrs(Idx))); - Idx++; - } // Terminate list with VoidTy if we are a varargs function... - if (MT->isVarArg()) + if (FT->isVarArg()) output_typeid((unsigned)Type::VoidTyID); + + // Put out all the parameter attributes + outputParamAttrsList(FT->getParamAttrs()); break; } @@ -1107,7 +1121,7 @@ // Organize the symbol table by type typedef SmallVector PlaneMapVector; - typedef DenseMap PlaneMap; + typedef DenseMap PlaneMap; PlaneMap Planes; for (ValueSymbolTable::const_iterator SI = VST.begin(), SE = VST.end(); SI != SE; ++SI) Index: llvm/lib/Bytecode/Writer/WriterInternals.h diff -u llvm/lib/Bytecode/Writer/WriterInternals.h:1.33 llvm/lib/Bytecode/Writer/WriterInternals.h:1.34 --- llvm/lib/Bytecode/Writer/WriterInternals.h:1.33 Sun Feb 11 23:18:08 2007 +++ llvm/lib/Bytecode/Writer/WriterInternals.h Mon Apr 9 01:14:31 2007 @@ -24,6 +24,7 @@ class InlineAsm; class TypeSymbolTable; class ValueSymbolTable; + class ParamAttrsList; class BytecodeWriter { std::vector &Out; @@ -61,6 +62,7 @@ void outputTypeSymbolTable(const TypeSymbolTable &TST); void outputValueSymbolTable(const ValueSymbolTable &ST); void outputTypes(unsigned StartNo); + void outputParamAttrsList(const ParamAttrsList* Attrs); void outputConstantsInPlane(const Value *const*Plane, unsigned PlaneSize, unsigned StartNo); void outputConstant(const Constant *CPV); From reid at x10sys.com Mon Apr 9 01:14:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:14:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Reader.h Message-ID: <200704090614.l396EoHf019522@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.245 -> 1.246 Reader.h updated: 1.51 -> 1.52 --- Log message: For PR1146: http://llvm.org/PR1146 : Use ParamAttrsList for writing parameter attributes. Since they are sparse now, we also write them sparsely (saves a few bytes). Unfortunately, this is a bytecode file format change. --- Diffs of the changes: (+26 -8) Reader.cpp | 30 ++++++++++++++++++++++-------- Reader.h | 4 ++++ 2 files changed, 26 insertions(+), 8 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.245 llvm/lib/Bytecode/Reader/Reader.cpp:1.246 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.245 Sun Apr 8 18:58:41 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Apr 9 01:14:31 2007 @@ -23,6 +23,7 @@ #include "llvm/Constants.h" #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" +#include "llvm/ParameterAttributes.h" #include "llvm/TypeSymbolTable.h" #include "llvm/Bytecode/Format.h" #include "llvm/Config/alloca.h" @@ -288,6 +289,8 @@ if (Num < Locals->size()) return Locals->getOperand(Num); + // We did not find the value. + if (!Create) return 0; // Do not create a placeholder? // Did we already create a place holder? @@ -1005,21 +1008,18 @@ } case Type::FunctionTyID: { const Type *RetType = readType(); - unsigned RetAttr = read_vbr_uint(); - unsigned NumParams = read_vbr_uint(); std::vector Params; - std::vector Attrs; - Attrs.push_back(FunctionType::ParameterAttributes(RetAttr)); while (NumParams--) { Params.push_back(readType()); - if (Params.back() != Type::VoidTy) - Attrs.push_back(FunctionType::ParameterAttributes(read_vbr_uint())); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; - if (isVarArg) Params.pop_back(); + if (isVarArg) + Params.pop_back(); + + ParamAttrsList *Attrs = ParseParamAttrsList(); Result = FunctionType::get(RetType, Params, isVarArg, Attrs); break; @@ -1076,6 +1076,21 @@ return Result; } +ParamAttrsList *BytecodeReader::ParseParamAttrsList() { + unsigned NumAttrs = read_vbr_uint(); + ParamAttrsList *Attrs = 0; + if (NumAttrs) { + Attrs = new ParamAttrsList(); + while (NumAttrs--) { + uint16_t index = read_vbr_uint(); + uint16_t attrs = read_vbr_uint(); + Attrs->addAttributes(index, attrs); + } + } + return Attrs; +} + + // ParseTypes - We have to use this weird code to handle recursive // types. We know that recursive types will only reference the current slab of // values in the type plane, but they can forward reference types before they @@ -2106,4 +2121,3 @@ //===----------------------------------------------------------------------===// BytecodeHandler::~BytecodeHandler() {} - Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.51 llvm/lib/Bytecode/Reader/Reader.h:1.52 --- llvm/lib/Bytecode/Reader/Reader.h:1.51 Thu Mar 29 13:58:08 2007 +++ llvm/lib/Bytecode/Reader/Reader.h Mon Apr 9 01:14:31 2007 @@ -236,6 +236,7 @@ /// @brief Parse global types void ParseGlobalTypes(); + /// @brief Parse a basic block (for LLVM 1.0 basic block blocks) BasicBlock* ParseBasicBlock(unsigned BlockNo); @@ -264,6 +265,9 @@ /// @brief Parse a single type constant const Type *ParseType(); + /// @brief Parse a list of parameter attributes + ParamAttrsList *ParseParamAttrsList(); + /// @brief Parse a string constants block void ParseStringConstants(unsigned NumEntries, ValueTable &Tab); From reid at x10sys.com Mon Apr 9 01:16:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:16:16 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y Message-ID: <200704090616.l396GGSK019552@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.y updated: 1.78 -> 1.79 --- Log message: For PR1146: http://llvm.org/PR1146 : Adapt handling of parameter attributes to use ParamAttrsList class. --- Diffs of the changes: (+41 -25) UpgradeParser.y | 66 ++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 41 insertions(+), 25 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.78 llvm/tools/llvm-upgrade/UpgradeParser.y:1.79 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.78 Sat Apr 7 11:10:37 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Mon Apr 9 01:15:59 2007 @@ -17,6 +17,7 @@ #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" @@ -377,14 +378,21 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1, const FunctionType *F2) { if (F1->getReturnType() != F2->getReturnType() || - F1->getNumParams() != F2->getNumParams() || - F1->getParamAttrs(0) != F2->getParamAttrs(0)) + F1->getNumParams() != F2->getNumParams()) return false; - unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + ParamAttrsList PAL1; + if (F1->getParamAttrs()) + PAL1 = *F1->getParamAttrs(); + ParamAttrsList PAL2; + if (F2->getParamAttrs()) + PAL2 = *F2->getParamAttrs(); + if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(StructRetAttribute); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || - unsigned(F1->getParamAttrs(i+1)) & SRetMask != - unsigned(F2->getParamAttrs(i+1)) & SRetMask) + unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != + unsigned(PAL2.getParamAttrs(i+1)) & SRetMask) return false; } return true; @@ -423,13 +431,15 @@ if (PF1 && PF2) { const FunctionType *FT1 = dyn_cast(PF1->getElementType()); const FunctionType *FT2 = dyn_cast(PF2->getElementType()); - if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) - if (FT2->paramHasAttr(1, FunctionType::StructRetAttribute)) + if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { + const ParamAttrsList *PAL2 = FT2->getParamAttrs(); + if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); else return new BitCastInst(V, PF1, "upgrd.cast", CurBB); + } } return 0; @@ -2103,13 +2113,13 @@ Params.push_back(I->PAT->get()); $$.S.add(I->S); } - FunctionType::ParamAttrsList ParamAttrs; bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - $$.PAT = new PATypeHolder( - HandleUpRefs(FunctionType::get($1.PAT->get(), Params, isVarArg, - ParamAttrs), $$.S)); + const FunctionType *FTy = + FunctionType::get($1.PAT->get(), Params, isVarArg, 0); + + $$.PAT = new PATypeHolder( HandleUpRefs(FTy, $$.S) ); delete $1.PAT; // Delete the return type handle delete $3; // Delete the argument list } @@ -2891,14 +2901,15 @@ // Convert the CSRet calling convention into the corresponding parameter // attribute. - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ($1 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); // result - ParamAttrs.push_back(FunctionType::StructRetAttribute); // first arg + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // result + ParamAttrs->addAttributes(1, StructRetAttribute); // first arg } - const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, - ParamAttrs); + const FunctionType *FT = + FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); delete $2.PAT; @@ -3279,10 +3290,11 @@ FTySign.add(I->S); } } - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // Function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3296,6 +3308,7 @@ // and then the 0th element again to get the result type. $$.S.copy($3.S.get(0).get(0)); } + $4.S.makeComposite(FTySign); Value *V = getVal(PFTy, $4); // Get the function we're calling... BasicBlock *Normal = getBBVal($10); @@ -3656,7 +3669,7 @@ $$.S.copy($2.S); delete $2.P; // Free the list... } - | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { + | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; @@ -3674,11 +3687,6 @@ } } - FunctionType::ParamAttrsList ParamAttrs; - if ($2 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); - } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3686,6 +3694,14 @@ if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); + // Deal with CSRetCC + ParamAttrsList *ParamAttrs = 0; + if ($2 == OldCallingConv::CSRet) { + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + } + FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(FTy); $$.S.copy($3.S); From reid at x10sys.com Mon Apr 9 01:16:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:16:38 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y.cvs Message-ID: <200704090616.l396GcWs019574@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.72 -> 1.73 UpgradeParser.h.cvs updated: 1.53 -> 1.54 UpgradeParser.y.cvs updated: 1.71 -> 1.72 --- Log message: Regenerate --- Diffs of the changes: (+349 -317) UpgradeParser.cpp.cvs | 598 +++++++++++++++++++++++++------------------------- UpgradeParser.h.cvs | 2 UpgradeParser.y.cvs | 66 +++-- 3 files changed, 349 insertions(+), 317 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.72 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.73 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.72 Sat Apr 7 11:14:01 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Mon Apr 9 01:16:21 2007 @@ -377,6 +377,7 @@ #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" @@ -737,14 +738,21 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1, const FunctionType *F2) { if (F1->getReturnType() != F2->getReturnType() || - F1->getNumParams() != F2->getNumParams() || - F1->getParamAttrs(0) != F2->getParamAttrs(0)) + F1->getNumParams() != F2->getNumParams()) return false; - unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + ParamAttrsList PAL1; + if (F1->getParamAttrs()) + PAL1 = *F1->getParamAttrs(); + ParamAttrsList PAL2; + if (F2->getParamAttrs()) + PAL2 = *F2->getParamAttrs(); + if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(StructRetAttribute); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || - unsigned(F1->getParamAttrs(i+1)) & SRetMask != - unsigned(F2->getParamAttrs(i+1)) & SRetMask) + unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != + unsigned(PAL2.getParamAttrs(i+1)) & SRetMask) return false; } return true; @@ -783,13 +791,15 @@ if (PF1 && PF2) { const FunctionType *FT1 = dyn_cast(PF1->getElementType()); const FunctionType *FT2 = dyn_cast(PF2->getElementType()); - if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) - if (FT2->paramHasAttr(1, FunctionType::StructRetAttribute)) + if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { + const ParamAttrsList *PAL2 = FT2->getParamAttrs(); + if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); else return new BitCastInst(V, PF1, "upgrd.cast", CurBB); + } } return 0; @@ -2107,7 +2117,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1741 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -2150,7 +2160,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 2154 "UpgradeParser.tab.c" +#line 2164 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -2162,7 +2172,7 @@ /* Line 219 of yacc.c. */ -#line 2166 "UpgradeParser.tab.c" +#line 2176 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2522,38 +2532,38 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1871, 1871, 1872, 1880, 1881, 1891, 1891, 1891, 1891, - 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1895, 1895, 1895, - 1899, 1899, 1899, 1899, 1899, 1899, 1903, 1903, 1904, 1904, - 1905, 1905, 1906, 1906, 1907, 1907, 1911, 1911, 1912, 1912, - 1913, 1913, 1914, 1914, 1915, 1915, 1916, 1916, 1917, 1917, - 1918, 1919, 1922, 1922, 1922, 1922, 1926, 1926, 1926, 1926, - 1926, 1926, 1926, 1927, 1927, 1927, 1927, 1927, 1927, 1933, - 1933, 1933, 1933, 1937, 1937, 1937, 1937, 1941, 1941, 1945, - 1945, 1950, 1953, 1958, 1959, 1960, 1961, 1962, 1963, 1964, - 1965, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1986, - 1987, 1995, 1996, 2004, 2013, 2014, 2021, 2022, 2026, 2030, - 2046, 2047, 2054, 2055, 2062, 2070, 2070, 2070, 2070, 2070, - 2070, 2070, 2071, 2071, 2071, 2071, 2071, 2076, 2080, 2084, - 2089, 2098, 2116, 2122, 2135, 2146, 2150, 2163, 2167, 2181, - 2185, 2192, 2193, 2199, 2206, 2218, 2248, 2261, 2284, 2312, - 2334, 2345, 2367, 2378, 2387, 2392, 2451, 2458, 2466, 2473, - 2480, 2484, 2488, 2497, 2512, 2525, 2534, 2562, 2575, 2584, - 2590, 2596, 2607, 2613, 2619, 2630, 2631, 2640, 2641, 2653, - 2662, 2663, 2664, 2665, 2666, 2682, 2702, 2704, 2706, 2706, - 2713, 2713, 2721, 2721, 2729, 2729, 2738, 2740, 2742, 2747, - 2761, 2762, 2766, 2769, 2777, 2781, 2788, 2792, 2796, 2800, - 2808, 2808, 2812, 2813, 2817, 2825, 2830, 2838, 2839, 2846, - 2853, 2857, 3038, 3038, 3042, 3042, 3052, 3052, 3056, 3061, - 3062, 3063, 3067, 3068, 3067, 3080, 3081, 3086, 3087, 3088, - 3089, 3093, 3097, 3098, 3099, 3100, 3121, 3125, 3139, 3140, - 3145, 3145, 3153, 3163, 3166, 3175, 3186, 3191, 3200, 3211, - 3211, 3214, 3218, 3222, 3227, 3237, 3255, 3264, 3332, 3336, - 3343, 3355, 3370, 3400, 3410, 3420, 3424, 3431, 3432, 3436, - 3439, 3445, 3464, 3482, 3498, 3512, 3526, 3537, 3555, 3564, - 3573, 3580, 3601, 3625, 3631, 3637, 3643, 3659, 3746, 3754, - 3755, 3759, 3760, 3764, 3770, 3777, 3783, 3790, 3797, 3810, - 3836 + 0, 1881, 1881, 1882, 1890, 1891, 1901, 1901, 1901, 1901, + 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1905, 1905, 1905, + 1909, 1909, 1909, 1909, 1909, 1909, 1913, 1913, 1914, 1914, + 1915, 1915, 1916, 1916, 1917, 1917, 1921, 1921, 1922, 1922, + 1923, 1923, 1924, 1924, 1925, 1925, 1926, 1926, 1927, 1927, + 1928, 1929, 1932, 1932, 1932, 1932, 1936, 1936, 1936, 1936, + 1936, 1936, 1936, 1937, 1937, 1937, 1937, 1937, 1937, 1943, + 1943, 1943, 1943, 1947, 1947, 1947, 1947, 1951, 1951, 1955, + 1955, 1960, 1963, 1968, 1969, 1970, 1971, 1972, 1973, 1974, + 1975, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1996, + 1997, 2005, 2006, 2014, 2023, 2024, 2031, 2032, 2036, 2040, + 2056, 2057, 2064, 2065, 2072, 2080, 2080, 2080, 2080, 2080, + 2080, 2080, 2081, 2081, 2081, 2081, 2081, 2086, 2090, 2094, + 2099, 2108, 2126, 2132, 2145, 2156, 2160, 2173, 2177, 2191, + 2195, 2202, 2203, 2209, 2216, 2228, 2258, 2271, 2294, 2322, + 2344, 2355, 2377, 2388, 2397, 2402, 2461, 2468, 2476, 2483, + 2490, 2494, 2498, 2507, 2522, 2535, 2544, 2572, 2585, 2594, + 2600, 2606, 2617, 2623, 2629, 2640, 2641, 2650, 2651, 2663, + 2672, 2673, 2674, 2675, 2676, 2692, 2712, 2714, 2716, 2716, + 2723, 2723, 2731, 2731, 2739, 2739, 2748, 2750, 2752, 2757, + 2771, 2772, 2776, 2779, 2787, 2791, 2798, 2802, 2806, 2810, + 2818, 2818, 2822, 2823, 2827, 2835, 2840, 2848, 2849, 2856, + 2863, 2867, 3049, 3049, 3053, 3053, 3063, 3063, 3067, 3072, + 3073, 3074, 3078, 3079, 3078, 3091, 3092, 3097, 3098, 3099, + 3100, 3104, 3108, 3109, 3110, 3111, 3132, 3136, 3150, 3151, + 3156, 3156, 3164, 3174, 3177, 3186, 3197, 3202, 3211, 3222, + 3222, 3225, 3229, 3233, 3238, 3248, 3266, 3275, 3345, 3349, + 3356, 3368, 3383, 3413, 3423, 3433, 3437, 3444, 3445, 3449, + 3452, 3458, 3477, 3495, 3511, 3525, 3539, 3550, 3568, 3577, + 3586, 3593, 3614, 3638, 3644, 3650, 3656, 3672, 3762, 3770, + 3771, 3775, 3776, 3780, 3786, 3793, 3799, 3806, 3813, 3826, + 3852 }; #endif @@ -3943,7 +3953,7 @@ switch (yyn) { case 3: -#line 1872 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1882 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3952,7 +3962,7 @@ break; case 5: -#line 1881 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1891 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -3961,226 +3971,226 @@ break; case 26: -#line 1903 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1903 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1904 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1904 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1905 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1905 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1906 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1906 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1907 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1907 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1911 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1921 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1911 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1921 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1912 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1922 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1912 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1922 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1923 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1923 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1924 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1924 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1926 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1926 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1927 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1927 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1918 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1928 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1919 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1929 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1950 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1960 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1953 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1963 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1958 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1968 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1959 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1969 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1960 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1970 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 1961 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1971 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 1962 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1972 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 1963 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1973 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 1964 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1974 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1965 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1975 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1969 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1979 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 92: -#line 1970 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1980 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 93: -#line 1971 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1981 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 1972 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1982 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 1973 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1983 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 1974 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1984 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 1975 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1985 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 1976 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1986 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -4189,12 +4199,12 @@ break; case 99: -#line 1986 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1996 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 1987 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1997 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4203,12 +4213,12 @@ break; case 101: -#line 1995 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2005 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 1996 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2006 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4217,7 +4227,7 @@ break; case 103: -#line 2004 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -4227,27 +4237,27 @@ break; case 104: -#line 2013 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2023 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 2014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2024 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 2021 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2031 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 107: -#line 2022 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2032 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 108: -#line 2026 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2036 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4255,7 +4265,7 @@ break; case 109: -#line 2030 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2040 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -4265,7 +4275,7 @@ break; case 111: -#line 2047 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2057 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4273,7 +4283,7 @@ break; case 113: -#line 2055 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2065 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4281,7 +4291,7 @@ break; case 114: -#line 2062 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2072 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).PAT)->getDescription()); @@ -4290,7 +4300,7 @@ break; case 127: -#line 2076 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2086 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.copy((yyvsp[0].PrimType).S); @@ -4298,7 +4308,7 @@ break; case 128: -#line 2080 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2090 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S.makeSignless(); @@ -4306,7 +4316,7 @@ break; case 129: -#line 2084 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... (yyval.TypeVal).S.copy(getTypeSign((yyvsp[0].ValIDVal))); const Type* tmp = getType((yyvsp[0].ValIDVal)); @@ -4315,7 +4325,7 @@ break; case 130: -#line 2089 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); @@ -4328,7 +4338,7 @@ break; case 131: -#line 2098 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2108 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? (yyval.TypeVal).S.makeComposite((yyvsp[-3].TypeVal).S); std::vector Params; @@ -4337,20 +4347,20 @@ Params.push_back(I->PAT->get()); (yyval.TypeVal).S.add(I->S); } - FunctionType::ParamAttrsList ParamAttrs; bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - (yyval.TypeVal).PAT = new PATypeHolder( - HandleUpRefs(FunctionType::get((yyvsp[-3].TypeVal).PAT->get(), Params, isVarArg, - ParamAttrs), (yyval.TypeVal).S)); + const FunctionType *FTy = + FunctionType::get((yyvsp[-3].TypeVal).PAT->get(), Params, isVarArg, 0); + + (yyval.TypeVal).PAT = new PATypeHolder( HandleUpRefs(FTy, (yyval.TypeVal).S) ); delete (yyvsp[-3].TypeVal).PAT; // Delete the return type handle delete (yyvsp[-1].TypeList); // Delete the argument list ;} break; case 132: -#line 2116 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2126 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyval.TypeVal).S.makeComposite((yyvsp[-1].TypeVal).S); (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).PAT->get(), @@ -4360,7 +4370,7 @@ break; case 133: -#line 2122 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2132 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).PAT->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -4377,7 +4387,7 @@ break; case 134: -#line 2135 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2145 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector Elements; (yyval.TypeVal).S.makeComposite(); @@ -4392,7 +4402,7 @@ break; case 135: -#line 2146 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2156 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).S.makeComposite(); @@ -4400,7 +4410,7 @@ break; case 136: -#line 2150 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2160 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? (yyval.TypeVal).S.makeComposite(); std::vector Elements; @@ -4417,7 +4427,7 @@ break; case 137: -#line 2163 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2173 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector(),true)); (yyval.TypeVal).S.makeComposite(); @@ -4425,7 +4435,7 @@ break; case 138: -#line 2167 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2177 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); @@ -4437,7 +4447,7 @@ break; case 139: -#line 2181 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2191 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4445,14 +4455,14 @@ break; case 140: -#line 2185 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2195 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 2193 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2203 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); @@ -4462,7 +4472,7 @@ break; case 143: -#line 2199 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2209 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; @@ -4473,14 +4483,14 @@ break; case 144: -#line 2206 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2216 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); ;} break; case 145: -#line 2218 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2228 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (ATy == 0) @@ -4514,7 +4524,7 @@ break; case 146: -#line 2248 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2258 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4531,7 +4541,7 @@ break; case 147: -#line 2261 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2271 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4558,7 +4568,7 @@ break; case 148: -#line 2284 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2294 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (PTy == 0) @@ -4590,7 +4600,7 @@ break; case 149: -#line 2312 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (STy == 0) @@ -4616,7 +4626,7 @@ break; case 150: -#line 2334 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (STy == 0) @@ -4631,7 +4641,7 @@ break; case 151: -#line 2345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2355 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal).PAT->get()); if (STy == 0) @@ -4657,7 +4667,7 @@ break; case 152: -#line 2367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2377 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-4].TypeVal).PAT->get()); if (STy == 0) @@ -4672,7 +4682,7 @@ break; case 153: -#line 2378 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2388 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (PTy == 0) @@ -4685,7 +4695,7 @@ break; case 154: -#line 2387 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2397 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).PAT->get()); (yyval.ConstVal).S.copy((yyvsp[-1].TypeVal).S); @@ -4694,7 +4704,7 @@ break; case 155: -#line 2392 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2402 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (Ty == 0) @@ -4757,7 +4767,7 @@ break; case 156: -#line 2451 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2461 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); @@ -4768,7 +4778,7 @@ break; case 157: -#line 2458 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2468 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -4780,7 +4790,7 @@ break; case 158: -#line 2466 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2476 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4791,7 +4801,7 @@ break; case 159: -#line 2473 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2483 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4802,7 +4812,7 @@ break; case 160: -#line 2480 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2490 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S.makeUnsigned(); @@ -4810,7 +4820,7 @@ break; case 161: -#line 2484 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2494 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S.makeUnsigned(); @@ -4818,7 +4828,7 @@ break; case 162: -#line 2488 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2498 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4828,7 +4838,7 @@ break; case 163: -#line 2497 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2507 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); const Type* DstTy = (yyvsp[-1].TypeVal).PAT->get(); @@ -4847,7 +4857,7 @@ break; case 164: -#line 2512 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2522 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa(Ty)) @@ -4864,7 +4874,7 @@ break; case 165: -#line 2525 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2535 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4877,7 +4887,7 @@ break; case 166: -#line 2534 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2544 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4909,7 +4919,7 @@ break; case 167: -#line 2562 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2572 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4926,7 +4936,7 @@ break; case 168: -#line 2575 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4939,7 +4949,7 @@ break; case 169: -#line 2584 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2594 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4949,7 +4959,7 @@ break; case 170: -#line 2590 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2600 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4959,7 +4969,7 @@ break; case 171: -#line 2596 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2606 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) @@ -4974,7 +4984,7 @@ break; case 172: -#line 2607 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2617 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -4984,7 +4994,7 @@ break; case 173: -#line 2613 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -4994,7 +5004,7 @@ break; case 174: -#line 2619 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2629 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -5004,12 +5014,12 @@ break; case 175: -#line 2630 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2640 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2631 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2641 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -5017,17 +5027,17 @@ break; case 177: -#line 2640 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2641 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2651 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2653 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2663 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -5035,27 +5045,27 @@ break; case 180: -#line 2662 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2663 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2673 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2664 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2674 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2665 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2675 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2666 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2676 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -5071,7 +5081,7 @@ break; case 185: -#line 2682 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2692 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -5095,19 +5105,19 @@ break; case 186: -#line 2702 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2712 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2704 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2706 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2716 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -5116,14 +5126,14 @@ break; case 189: -#line 2710 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2720 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2713 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5133,14 +5143,14 @@ break; case 191: -#line 2718 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2728 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2721 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5150,14 +5160,14 @@ break; case 193: -#line 2726 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2736 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2729 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2739 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = @@ -5168,32 +5178,32 @@ break; case 195: -#line 2735 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2745 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2738 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2748 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2740 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2750 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2742 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2752 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2747 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2757 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -5208,24 +5218,24 @@ break; case 200: -#line 2761 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2762 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2772 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2766 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2776 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2769 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2779 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -5237,7 +5247,7 @@ break; case 204: -#line 2777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2787 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5245,7 +5255,7 @@ break; case 205: -#line 2781 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2791 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5253,7 +5263,7 @@ break; case 207: -#line 2792 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5261,7 +5271,7 @@ break; case 208: -#line 2796 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2806 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5269,17 +5279,17 @@ break; case 209: -#line 2800 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2810 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2813 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2823 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2817 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2827 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); @@ -5288,7 +5298,7 @@ break; case 215: -#line 2825 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2835 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5297,7 +5307,7 @@ break; case 216: -#line 2830 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5306,12 +5316,12 @@ break; case 217: -#line 2838 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2848 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2839 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2849 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; @@ -5322,7 +5332,7 @@ break; case 219: -#line 2846 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; @@ -5333,12 +5343,12 @@ break; case 220: -#line 2853 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2863 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2857 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2867 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -5376,14 +5386,15 @@ // Convert the CSRet calling convention into the corresponding parameter // attribute. - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ((yyvsp[-7].UIntVal) == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); // result - ParamAttrs.push_back(FunctionType::StructRetAttribute); // first arg + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // result + ParamAttrs->addAttributes(1, StructRetAttribute); // first arg } - const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, - ParamAttrs); + const FunctionType *FT = + FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); delete (yyvsp[-6].TypeVal).PAT; @@ -5520,12 +5531,12 @@ break; case 224: -#line 3042 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3053 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 225: -#line 3042 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3053 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5536,39 +5547,39 @@ break; case 228: -#line 3056 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3067 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 229: -#line 3061 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3072 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 230: -#line 3062 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3073 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 231: -#line 3063 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3074 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 232: -#line 3067 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3078 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 233: -#line 3068 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3079 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 234: -#line 3068 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3079 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5577,32 +5588,32 @@ break; case 235: -#line 3080 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3091 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 236: -#line 3081 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3092 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 237: -#line 3086 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3097 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; case 238: -#line 3087 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3098 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; case 239: -#line 3088 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; case 240: -#line 3089 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3100 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5610,7 +5621,7 @@ break; case 241: -#line 3093 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3104 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5618,22 +5629,22 @@ break; case 242: -#line 3097 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3108 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; case 243: -#line 3098 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3109 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; case 244: -#line 3099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3110 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; case 245: -#line 3100 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3111 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5658,7 +5669,7 @@ break; case 246: -#line 3121 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3132 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); (yyval.ValIDVal).S.copy((yyvsp[0].ConstVal).S); @@ -5666,7 +5677,7 @@ break; case 247: -#line 3125 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3136 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5679,17 +5690,17 @@ break; case 248: -#line 3139 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3150 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 249: -#line 3140 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 252: -#line 3153 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3164 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -5700,21 +5711,21 @@ break; case 253: -#line 3163 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3174 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 254: -#line 3166 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3177 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 255: -#line 3175 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { ValueInfo VI; VI.V = (yyvsp[0].TermInstVal).TI; VI.S.copy((yyvsp[0].TermInstVal).S); setValueName(VI, (yyvsp[-1].StrVal)); @@ -5726,7 +5737,7 @@ break; case 256: -#line 3186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3197 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5735,7 +5746,7 @@ break; case 257: -#line 3191 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3202 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++),true); // Make sure to move the basic block to the correct location in the @@ -5748,7 +5759,7 @@ break; case 258: -#line 3200 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3211 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5761,7 +5772,7 @@ break; case 261: -#line 3214 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3225 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal).TI = new ReturnInst((yyvsp[0].ValueVal).V); (yyval.TermInstVal).S.makeSignless(); @@ -5769,7 +5780,7 @@ break; case 262: -#line 3218 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3229 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal).TI = new ReturnInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5777,7 +5788,7 @@ break; case 263: -#line 3222 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3233 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal).TI = new BranchInst(tmpBB); @@ -5786,7 +5797,7 @@ break; case 264: -#line 3227 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3238 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-3].ValIDVal).S.makeSignless(); (yyvsp[0].ValIDVal).S.makeSignless(); @@ -5800,7 +5811,7 @@ break; case 265: -#line 3237 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3248 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-6].ValIDVal).S.copy((yyvsp[-7].PrimType).S); Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); @@ -5822,7 +5833,7 @@ break; case 266: -#line 3255 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3266 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-5].ValIDVal).S.copy((yyvsp[-6].PrimType).S); Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); @@ -5835,7 +5846,7 @@ break; case 267: -#line 3265 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3276 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -5853,10 +5864,11 @@ FTySign.add(I->S); } } - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ((yyvsp[-11].UIntVal) == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // Function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -5870,6 +5882,7 @@ // and then the 0th element again to get the result type. (yyval.TermInstVal).S.copy((yyvsp[-10].TypeVal).S.get(0).get(0)); } + (yyvsp[-9].ValIDVal).S.makeComposite(FTySign); Value *V = getVal(PFTy, (yyvsp[-9].ValIDVal)); // Get the function we're calling... BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); @@ -5906,7 +5919,7 @@ break; case 268: -#line 3332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnwindInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5914,7 +5927,7 @@ break; case 269: -#line 3336 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3349 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnreachableInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5922,7 +5935,7 @@ break; case 270: -#line 3343 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3356 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5938,7 +5951,7 @@ break; case 271: -#line 3355 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector >(); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5954,7 +5967,7 @@ break; case 272: -#line 3370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -5987,7 +6000,7 @@ break; case 273: -#line 3400 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3413 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list >(); (yyval.PHIList).S.copy((yyvsp[-5].TypeVal).S); @@ -6001,7 +6014,7 @@ break; case 274: -#line 3410 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3423 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-6].PHIList).S); @@ -6013,7 +6026,7 @@ break; case 275: -#line 3420 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3433 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6021,7 +6034,7 @@ break; case 276: -#line 3424 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3437 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6029,26 +6042,26 @@ break; case 278: -#line 3432 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3445 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; case 279: -#line 3436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3449 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 280: -#line 3439 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3452 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 281: -#line 3445 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3458 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6071,7 +6084,7 @@ break; case 282: -#line 3464 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3477 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6093,7 +6106,7 @@ break; case 283: -#line 3482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3495 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6113,7 +6126,7 @@ break; case 284: -#line 3498 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3511 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6131,7 +6144,7 @@ break; case 285: -#line 3512 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3525 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6149,7 +6162,7 @@ break; case 286: -#line 3526 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3539 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -6164,7 +6177,7 @@ break; case 287: -#line 3537 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3550 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) @@ -6186,7 +6199,7 @@ break; case 288: -#line 3555 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3568 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *DstTy = (yyvsp[0].TypeVal).PAT->get(); if (!DstTy->isFirstClassType()) @@ -6199,7 +6212,7 @@ break; case 289: -#line 3564 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -6212,7 +6225,7 @@ break; case 290: -#line 3573 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); NewVarArgs = true; @@ -6223,7 +6236,7 @@ break; case 291: -#line 3580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3593 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6248,7 +6261,7 @@ break; case 292: -#line 3601 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6276,7 +6289,7 @@ break; case 293: -#line 3625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3638 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -6286,7 +6299,7 @@ break; case 294: -#line 3631 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3644 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -6296,7 +6309,7 @@ break; case 295: -#line 3637 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -6306,7 +6319,7 @@ break; case 296: -#line 3643 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3656 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6326,7 +6339,7 @@ break; case 297: -#line 3659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax const PointerType *PFTy; @@ -6345,11 +6358,6 @@ } } - FunctionType::ParamAttrsList ParamAttrs; - if ((yyvsp[-5].UIntVal) == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); - } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -6357,6 +6365,14 @@ if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); + // Deal with CSRetCC + ParamAttrsList *ParamAttrs = 0; + if ((yyvsp[-5].UIntVal) == OldCallingConv::CSRet) { + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + } + FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(FTy); (yyval.InstVal).S.copy((yyvsp[-4].TypeVal).S); @@ -6417,34 +6433,34 @@ break; case 298: -#line 3746 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3762 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; case 299: -#line 3754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3770 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; case 300: -#line 3755 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 301: -#line 3759 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3775 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 302: -#line 3760 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3776 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 303: -#line 3764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3780 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6454,7 +6470,7 @@ break; case 304: -#line 3770 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3786 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6465,7 +6481,7 @@ break; case 305: -#line 3777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6475,7 +6491,7 @@ break; case 306: -#line 3783 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3799 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6486,7 +6502,7 @@ break; case 307: -#line 3790 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3806 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa(PTy)) @@ -6497,7 +6513,7 @@ break; case 308: -#line 3797 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3813 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -6514,7 +6530,7 @@ break; case 309: -#line 3810 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3826 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); @@ -6544,7 +6560,7 @@ break; case 310: -#line 3836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3852 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1].ValIDVal).S.copy((yyvsp[-2].TypeVal).S); const Type* Ty = (yyvsp[-2].TypeVal).PAT->get(); @@ -6568,7 +6584,7 @@ } /* Line 1126 of yacc.c. */ -#line 6572 "UpgradeParser.tab.c" +#line 6588 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6836,7 +6852,7 @@ } -#line 3854 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3870 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.53 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.54 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.53 Sun Apr 1 21:08:35 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Mon Apr 9 01:16:21 2007 @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1741 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.71 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.72 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.71 Sat Apr 7 11:14:01 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Mon Apr 9 01:16:21 2007 @@ -17,6 +17,7 @@ #include "llvm/InlineAsm.h" #include "llvm/Instructions.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/ADT/STLExtras.h" @@ -377,14 +378,21 @@ static bool FuncTysDifferOnlyBySRet(const FunctionType *F1, const FunctionType *F2) { if (F1->getReturnType() != F2->getReturnType() || - F1->getNumParams() != F2->getNumParams() || - F1->getParamAttrs(0) != F2->getParamAttrs(0)) + F1->getNumParams() != F2->getNumParams()) return false; - unsigned SRetMask = ~unsigned(FunctionType::StructRetAttribute); + ParamAttrsList PAL1; + if (F1->getParamAttrs()) + PAL1 = *F1->getParamAttrs(); + ParamAttrsList PAL2; + if (F2->getParamAttrs()) + PAL2 = *F2->getParamAttrs(); + if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) + return false; + unsigned SRetMask = ~unsigned(StructRetAttribute); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || - unsigned(F1->getParamAttrs(i+1)) & SRetMask != - unsigned(F2->getParamAttrs(i+1)) & SRetMask) + unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != + unsigned(PAL2.getParamAttrs(i+1)) & SRetMask) return false; } return true; @@ -423,13 +431,15 @@ if (PF1 && PF2) { const FunctionType *FT1 = dyn_cast(PF1->getElementType()); const FunctionType *FT2 = dyn_cast(PF2->getElementType()); - if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) - if (FT2->paramHasAttr(1, FunctionType::StructRetAttribute)) + if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { + const ParamAttrsList *PAL2 = FT2->getParamAttrs(); + if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); else return new BitCastInst(V, PF1, "upgrd.cast", CurBB); + } } return 0; @@ -2103,13 +2113,13 @@ Params.push_back(I->PAT->get()); $$.S.add(I->S); } - FunctionType::ParamAttrsList ParamAttrs; bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - $$.PAT = new PATypeHolder( - HandleUpRefs(FunctionType::get($1.PAT->get(), Params, isVarArg, - ParamAttrs), $$.S)); + const FunctionType *FTy = + FunctionType::get($1.PAT->get(), Params, isVarArg, 0); + + $$.PAT = new PATypeHolder( HandleUpRefs(FTy, $$.S) ); delete $1.PAT; // Delete the return type handle delete $3; // Delete the argument list } @@ -2891,14 +2901,15 @@ // Convert the CSRet calling convention into the corresponding parameter // attribute. - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ($1 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); // result - ParamAttrs.push_back(FunctionType::StructRetAttribute); // first arg + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // result + ParamAttrs->addAttributes(1, StructRetAttribute); // first arg } - const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, - ParamAttrs); + const FunctionType *FT = + FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); delete $2.PAT; @@ -3279,10 +3290,11 @@ FTySign.add(I->S); } } - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // Function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3296,6 +3308,7 @@ // and then the 0th element again to get the result type. $$.S.copy($3.S.get(0).get(0)); } + $4.S.makeComposite(FTySign); Value *V = getVal(PFTy, $4); // Get the function we're calling... BasicBlock *Normal = getBBVal($10); @@ -3656,7 +3669,7 @@ $$.S.copy($2.S); delete $2.P; // Free the list... } - | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { + | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; @@ -3674,11 +3687,6 @@ } } - FunctionType::ParamAttrsList ParamAttrs; - if ($2 == OldCallingConv::CSRet) { - ParamAttrs.push_back(FunctionType::NoAttributeSet); - ParamAttrs.push_back(FunctionType::StructRetAttribute); - } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3686,6 +3694,14 @@ if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); + // Deal with CSRetCC + ParamAttrsList *ParamAttrs = 0; + if ($2 == OldCallingConv::CSRet) { + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(0, NoAttributeSet); // function result + ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + } + FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(FTy); $$.S.copy($3.S); From reid at x10sys.com Mon Apr 9 01:17:41 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:17:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp Message-ID: <200704090617.l396Hf8c019613@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.1 -> 1.2 --- Log message: For PR1146: http://llvm.org/PR1146 : Adapt handling of parameter attributes to use the new ParamAttrsList class. --- Diffs of the changes: (+4 -2) MSILWriter.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.1 llvm/lib/Target/MSIL/MSILWriter.cpp:1.2 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.1 Wed Mar 21 16:38:25 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Mon Apr 9 01:17:21 2007 @@ -16,6 +16,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Intrinsics.h" #include "llvm/IntrinsicInst.h" +#include "llvm/ParameterAttributes.h" #include "llvm/TypeSymbolTable.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/Support/CallSite.h" @@ -1131,7 +1132,8 @@ void MSILWriter::printFunction(const Function& F) { const FunctionType* FTy = F.getFunctionType(); - bool isSigned = FTy->paramHasAttr(0,FunctionType::SExtAttribute); + const ParamAttrsList *Attrs = FTy->getParamAttrs(); + bool isSigned = Attrs && Attrs->paramHasAttr(0, SExtAttribute); Out << "\n.method static "; Out << (F.hasInternalLinkage() ? "private " : "public "); if (F.isVarArg()) Out << "vararg "; @@ -1142,7 +1144,7 @@ unsigned ArgIdx = 1; for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I!=E; ++I, ++ArgIdx) { - isSigned = FTy->paramHasAttr(ArgIdx,FunctionType::SExtAttribute); + isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, SExtAttribute); if (I!=F.arg_begin()) Out << ", "; Out << getTypeName(I->getType(),isSigned) << getValueName(I); } From reid at x10sys.com Mon Apr 9 01:17:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:17:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704090617.l396Hh4a019638@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.331 -> 1.332 --- Log message: For PR1146: http://llvm.org/PR1146 : Adapt handling of parameter attributes to use the new ParamAttrsList class. --- Diffs of the changes: (+13 -8) CBackend.cpp | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.331 llvm/lib/Target/CBackend/CBackend.cpp:1.332 --- llvm/lib/Target/CBackend/CBackend.cpp:1.331 Thu Mar 29 12:42:21 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Mon Apr 9 01:17:21 2007 @@ -18,6 +18,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/Instructions.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Pass.h" #include "llvm/PassManager.h" #include "llvm/TypeSymbolTable.h" @@ -350,11 +351,12 @@ FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end(); const Type *RetTy = cast(I->get())->getElementType(); unsigned Idx = 1; + const ParamAttrsList *Attrs = FTy->getParamAttrs(); for (++I; I != E; ++I) { if (PrintedType) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/FTy->paramHasAttr(Idx, FunctionType::SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); PrintedType = true; } if (FTy->isVarArg()) { @@ -366,7 +368,7 @@ FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, RetTy, - /*isSigned=*/FTy->paramHasAttr(0, FunctionType::SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); } std::ostream & @@ -421,13 +423,14 @@ const FunctionType *FTy = cast(Ty); std::stringstream FunctionInnards; FunctionInnards << " (" << NameSoFar << ") ("; + const ParamAttrsList *Attrs = FTy->getParamAttrs(); unsigned Idx = 1; for (FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/FTy->paramHasAttr(Idx, FunctionType::SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); ++Idx; } if (FTy->isVarArg()) { @@ -439,7 +442,7 @@ FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, FTy->getReturnType(), - /*isSigned=*/FTy->paramHasAttr(0, FunctionType::SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); return Out; } case Type::StructTyID: { @@ -1801,6 +1804,7 @@ // Loop over the arguments, printing them... const FunctionType *FT = cast(F->getFunctionType()); + const ParamAttrsList *Attrs = FT->getParamAttrs(); std::stringstream FunctionInnards; @@ -1828,7 +1832,7 @@ else ArgName = ""; printType(FunctionInnards, I->getType(), - /*isSigned=*/FT->paramHasAttr(Idx, FunctionType::SExtAttribute), + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ArgName); PrintedArg = true; ++Idx; @@ -1849,7 +1853,7 @@ for (; I != E; ++I) { if (PrintedArg) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/FT->paramHasAttr(Idx, FunctionType::SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); PrintedArg = true; ++Idx; } @@ -1877,7 +1881,7 @@ // Print out the return type and the signature built above. printType(Out, RetTy, - /*isSigned=*/FT->paramHasAttr(0, FunctionType::SExtAttribute), + /*isSigned=*/ Attrs && Attrs->paramHasAttr(0, SExtAttribute), FunctionInnards.str()); } @@ -2573,6 +2577,7 @@ ++ArgNo; } + const ParamAttrsList *Attrs = FTy->getParamAttrs(); bool PrintedArg = false; unsigned Idx = 1; for (; AI != AE; ++AI, ++ArgNo, ++Idx) { @@ -2581,7 +2586,7 @@ (*AI)->getType() != FTy->getParamType(ArgNo)) { Out << '('; printType(Out, FTy->getParamType(ArgNo), - /*isSigned=*/FTy->paramHasAttr(Idx, FunctionType::SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); Out << ')'; } writeOperand(*AI); From reid at x10sys.com Mon Apr 9 01:17:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 01:17:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704090617.l396HhjK019643@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.408 -> 1.409 --- Log message: For PR1146: http://llvm.org/PR1146 : Adapt handling of parameter attributes to use the new ParamAttrsList class. --- Diffs of the changes: (+17 -13) SelectionDAGISel.cpp | 30 +++++++++++++++++------------- 1 files changed, 17 insertions(+), 13 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.408 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.409 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.408 Mon Apr 9 00:31:20 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 01:17:21 2007 @@ -25,6 +25,7 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/IntrinsicInst.h" +#include "llvm/ParameterAttributes.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -802,10 +803,11 @@ else TmpVT = MVT::i32; const FunctionType *FTy = I.getParent()->getParent()->getFunctionType(); + const ParamAttrsList *Attrs = FTy->getParamAttrs(); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - if (FTy->paramHasAttr(0, FunctionType::SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, SExtAttribute)) ExtendKind = ISD::SIGN_EXTEND; - if (FTy->paramHasAttr(0, FunctionType::ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, ZExtAttribute)) ExtendKind = ISD::ZERO_EXTEND; RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp); } @@ -2508,6 +2510,7 @@ SDOperand Callee, unsigned OpIdx) { const PointerType *PT = cast(CalledValueTy); const FunctionType *FTy = cast(PT->getElementType()); + const ParamAttrsList *Attrs = FTy->getParamAttrs(); TargetLowering::ArgListTy Args; TargetLowering::ArgListEntry Entry; @@ -2516,16 +2519,16 @@ Value *Arg = I.getOperand(i); SDOperand ArgNode = getValue(Arg); Entry.Node = ArgNode; Entry.Ty = Arg->getType(); - Entry.isSExt = FTy->paramHasAttr(i, FunctionType::SExtAttribute); - Entry.isZExt = FTy->paramHasAttr(i, FunctionType::ZExtAttribute); - Entry.isInReg = FTy->paramHasAttr(i, FunctionType::InRegAttribute); - Entry.isSRet = FTy->paramHasAttr(i, FunctionType::StructRetAttribute); + Entry.isSExt = Attrs && Attrs->paramHasAttr(i, SExtAttribute); + Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ZExtAttribute); + Entry.isInReg = Attrs && Attrs->paramHasAttr(i, InRegAttribute); + Entry.isSRet = Attrs && Attrs->paramHasAttr(i, StructRetAttribute); Args.push_back(Entry); } std::pair Result = TLI.LowerCallTo(getRoot(), I.getType(), - FTy->paramHasAttr(0,FunctionType::SExtAttribute), + Attrs && Attrs->paramHasAttr(0, SExtAttribute), FTy->isVarArg(), CallingConv, IsTailCall, Callee, Args, DAG); if (I.getType() != Type::VoidTy) @@ -3346,6 +3349,7 @@ std::vector TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { const FunctionType *FTy = F.getFunctionType(); + const ParamAttrsList *Attrs = FTy->getParamAttrs(); // Add CC# and isVararg as operands to the FORMAL_ARGUMENTS node. std::vector Ops; Ops.push_back(DAG.getRoot()); @@ -3364,13 +3368,13 @@ // FIXME: Distinguish between a formal with no [sz]ext attribute from one // that is zero extended! - if (FTy->paramHasAttr(j, FunctionType::ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ZExtAttribute)) Flags &= ~(ISD::ParamFlags::SExt); - if (FTy->paramHasAttr(j, FunctionType::SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, SExtAttribute)) Flags |= ISD::ParamFlags::SExt; - if (FTy->paramHasAttr(j, FunctionType::InRegAttribute)) + if (Attrs && Attrs->paramHasAttr(j, InRegAttribute)) Flags |= ISD::ParamFlags::InReg; - if (FTy->paramHasAttr(j, FunctionType::StructRetAttribute)) + if (Attrs && Attrs->paramHasAttr(j, StructRetAttribute)) Flags |= ISD::ParamFlags::StructReturn; Flags |= (OriginalAlignment << ISD::ParamFlags::OrigAlignmentOffs); @@ -3444,10 +3448,10 @@ case Promote: { SDOperand Op(Result, i++); if (MVT::isInteger(VT)) { - if (FTy->paramHasAttr(Idx, FunctionType::SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)) Op = DAG.getNode(ISD::AssertSext, Op.getValueType(), Op, DAG.getValueType(VT)); - else if (FTy->paramHasAttr(Idx, FunctionType::ZExtAttribute)) + else if (Attrs && Attrs->paramHasAttr(Idx, ZExtAttribute)) Op = DAG.getNode(ISD::AssertZext, Op.getValueType(), Op, DAG.getValueType(VT)); Op = DAG.getNode(ISD::TRUNCATE, VT, Op); From clattner at apple.com Mon Apr 9 01:25:23 2007 From: clattner at apple.com (clattner at apple.com) Date: Sun, 8 Apr 2007 23:25:23 -0700 (PDT) Subject: [llvm-commits] [125902] Apply reid's patch for PR1146 Message-ID: <20070409062523.5E7B6DCFA313@src> Revision: 125902 Author: clattner Date: 2007-04-08 23:25:22 -0700 (Sun, 08 Apr 2007) Log Message: ----------- Apply reid's patch for PR1146 Modified Paths: -------------- apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h =================================================================== --- apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h 2007-04-09 01:28:18 UTC (rev 125901) +++ apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h 2007-04-09 06:25:22 UTC (rev 125902) @@ -54,7 +54,7 @@ int words = (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \ local_regparm -= words; \ if (local_regparm>=0) { \ - Attribute |= FunctionType::InRegAttribute; \ + Attribute |= InRegAttribute; \ } else \ local_regparm = 0; \ } \ Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-09 01:28:18 UTC (rev 125901) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-09 06:25:22 UTC (rev 125902) @@ -29,6 +29,7 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" +#include "llvm/ParameterAttributes.h" #include "llvm/TypeSymbolTable.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" @@ -706,14 +707,12 @@ for (; Args && TREE_TYPE(Args) != void_type_node; Args = TREE_CHAIN(Args)) ABIConverter.HandleArgument(TREE_TYPE(Args)); - FunctionType::ParamAttrsList ParamAttrs; + ParamAttrsList *ParamAttrs = 0; - // Something for the return type. - ParamAttrs.push_back(FunctionType::NoAttributeSet); - if (static_chain) { // Pass the static chain in a register. - ParamAttrs.push_back(FunctionType::InRegAttribute); + ParamAttrs = new ParamAttrsList(); + ParamAttrs->addAttributes(1, InRegAttribute); } return FunctionType::get(RetTy, ArgTys, false, ParamAttrs); @@ -768,23 +767,24 @@ // the parameter attribute in the FunctionType so any arguments passed to // the function will be correctly sign or zero extended to 32-bits by // the LLVM code gen. - FunctionType::ParamAttrsList ParamAttrs; - unsigned RAttributes = FunctionType::NoAttributeSet; + ParamAttrsList Attrs; + uint16_t RAttributes = NoAttributeSet; if (CallingConv == CallingConv::C) { tree ResultTy = TREE_TYPE(type); if (TREE_CODE(ResultTy) == BOOLEAN_TYPE) { if (TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) - RAttributes |= FunctionType::ZExtAttribute; + RAttributes |= ZExtAttribute; } else { if (TREE_CODE(ResultTy) == INTEGER_TYPE && TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) if (TYPE_UNSIGNED(ResultTy)) - RAttributes |= FunctionType::ZExtAttribute; + RAttributes |= ZExtAttribute; else - RAttributes |= FunctionType::SExtAttribute; + RAttributes |= SExtAttribute; } } - ParamAttrs.push_back(FunctionType::ParameterAttributes(RAttributes)); + if (RAttributes != NoAttributeSet) + Attrs.addAttributes(0, RAttributes); unsigned Idx = 1; bool isFirstArg = true; @@ -796,27 +796,30 @@ if (static_chain) // Pass the static chain in a register. - ParamAttrs.push_back(FunctionType::InRegAttribute); + Attrs.addAttributes(Idx++, InRegAttribute); - // Handle struct return + // The struct return attribute must be associated with the first + // parameter but that parameter may have other attributes too so we set up + // the first Attributes value here based on struct return. This only works + // Handle the structure return calling convention if (ABIConverter.isStructReturn()) - ParamAttrs.push_back(FunctionType::StructRetAttribute); + Attrs.addAttributes(Idx++, StructRetAttribute); for (tree Args = TYPE_ARG_TYPES(type); Args && TREE_VALUE(Args) != void_type_node; Args = TREE_CHAIN(Args)) { - unsigned Attributes = FunctionType::NoAttributeSet; tree Ty = TREE_VALUE(Args); + unsigned Attributes = NoAttributeSet; if (CallingConv == CallingConv::C) { if (TREE_CODE(Ty) == BOOLEAN_TYPE) { if (TREE_INT_CST_LOW(TYPE_SIZE(Ty)) < INT_TYPE_SIZE) - Attributes |= FunctionType::ZExtAttribute; + Attributes |= ZExtAttribute; } else if (TREE_CODE(Ty) == INTEGER_TYPE && TREE_INT_CST_LOW(TYPE_SIZE(Ty)) < INT_TYPE_SIZE) { if (TYPE_UNSIGNED(Ty)) - Attributes |= FunctionType::ZExtAttribute; + Attributes |= ZExtAttribute; else - Attributes |= FunctionType::SExtAttribute; + Attributes |= SExtAttribute; } } @@ -826,10 +829,17 @@ isVarArg, lparam); #endif // LLVM_TARGET_ENABLE_REGPARM + if (Attributes != NoAttributeSet) + Attrs.addAttributes(Idx, Attributes); Idx++; + } - ParamAttrs.push_back(FunctionType::ParameterAttributes(Attributes)); - } + // Only instantiate the parameter attributes if we got some + ParamAttrsList *ParamAttrs = 0; + if (!Attrs.empty()) + ParamAttrs = new ParamAttrsList(Attrs); + + // Finally, make the function type return FunctionType::get(RetTy, ArgTypes, isVarArg, ParamAttrs); } From sabre at nondot.org Mon Apr 9 01:44:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 01:44:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp Message-ID: <200704090644.l396ixB6020084@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.91 -> 1.92 --- Log message: Convert ImmediateDominators::DFSPass from being recursive to being iterative. --- Diffs of the changes: (+43 -1) Dominators.cpp | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 43 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.91 llvm/lib/VMCore/Dominators.cpp:1.92 --- llvm/lib/VMCore/Dominators.cpp:1.91 Mon Apr 9 01:10:06 2007 +++ llvm/lib/VMCore/Dominators.cpp Mon Apr 9 01:44:42 2007 @@ -50,12 +50,16 @@ unsigned ImmediateDominators::DFSPass(BasicBlock *V, InfoRec &VInfo, unsigned N) { + // This is more understandable as a recursive algorithm, but we can't use the + // recursive algorithm due to stack depth issues. Keep it here for + // documentation purposes. +#if 0 VInfo.Semi = ++N; VInfo.Label = V; Vertex.push_back(V); // Vertex[n] = V; //Info[V].Ancestor = 0; // Ancestor[n] = 0 - //Child[V] = 0; // Child[v] = 0 + //Info[V].Child = 0; // Child[v] = 0 VInfo.Size = 1; // Size[v] = 1 for (succ_iterator SI = succ_begin(V), E = succ_end(V); SI != E; ++SI) { @@ -65,6 +69,44 @@ N = DFSPass(*SI, SuccVInfo, N); } } +#else + std::vector > Worklist; + Worklist.push_back(std::make_pair(V, 0U)); + while (!Worklist.empty()) { + BasicBlock *BB = Worklist.back().first; + unsigned NextSucc = Worklist.back().second; + + // First time we visited this BB? + if (NextSucc == 0) { + InfoRec &BBInfo = Info[BB]; + BBInfo.Semi = ++N; + BBInfo.Label = BB; + + 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 we are done with this block, remove it from the worklist. + if (NextSucc == BB->getTerminator()->getNumSuccessors()) { + Worklist.pop_back(); + continue; + } + + // Otherwise, increment the successor number for the next time we get to it. + ++Worklist.back().second; + + // Visit the successor next, if it isn't already visited. + BasicBlock *Succ = BB->getTerminator()->getSuccessor(NextSucc); + + InfoRec &SuccVInfo = Info[Succ]; + if (SuccVInfo.Semi == 0) { + SuccVInfo.Parent = BB; + Worklist.push_back(std::make_pair(Succ, 0U)); + } + } +#endif return N; } From asl at math.spbu.ru Mon Apr 9 07:32:18 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 9 Apr 2007 07:32:18 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-02-16-BranchFold.ll switch-lower-feature.ll Message-ID: <200704091232.l39CWIJk002588@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-02-16-BranchFold.ll updated: 1.3 -> 1.4 switch-lower-feature.ll updated: 1.2 -> 1.3 --- Log message: Next stage into switch lowering refactoring 1. Fix some bugs in the jump table lowering threshold 2. Implement much better metric for optimal pivot selection 3. Tune thresholds for different lowering methods 4. Implement shift-and trick for lowering small ( [#uses=1] @str1 = external global [11 x i8] ; <[11 x i8]*> [#uses=1] - declare i32 @fprintf(%struct.FILE*, i8*, ...) define i16 @main_bb_2E_i9_2E_i_2E_i932_2E_ce(%struct.list* %l_addr.01.0.i2.i.i929, %struct.operator** %tmp66.i62.i.out) { newFuncRoot: br label %bb.i9.i.i932.ce -bb36.i.i.exitStub: ; preds = %bb.i9.i.i932.ce +NewDefault: ; preds = %LeafBlock, %LeafBlock1, %LeafBlock2, %LeafBlock3 + br label %bb36.i.i.exitStub + +bb36.i.i.exitStub: ; preds = %NewDefault store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out ret i16 0 -bb.i14.i.exitStub: ; preds = %bb.i9.i.i932.ce +bb.i14.i.exitStub: ; preds = %LeafBlock store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out ret i16 1 -bb12.i.i935.exitStub: ; preds = %bb.i9.i.i932.ce +bb12.i.i935.exitStub: ; preds = %LeafBlock1 store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out ret i16 2 -bb20.i.i937.exitStub: ; preds = %bb.i9.i.i932.ce +bb20.i.i937.exitStub: ; preds = %LeafBlock2 store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out ret i16 3 -bb28.i.i938.exitStub: ; preds = %bb.i9.i.i932.ce +bb28.i.i938.exitStub: ; preds = %LeafBlock3 store %struct.operator* %tmp66.i62.i, %struct.operator** %tmp66.i62.i.out ret i16 4 @@ -61,11 +63,34 @@ %tmp3.i8.i = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] %tmp5.i9.i = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp3.i8.i, i8* getelementptr ([11 x i8]* @str1, i32 0, i32 0), i32 %tmp2.i7.i ) ; [#uses=0] %tmp7.i10.i = getelementptr %struct.operator* %tmp66.i62.i, i32 0, i32 5 ; [#uses=1] - %tmp8.i11.i = load i32* %tmp7.i10.i ; [#uses=1] - switch i32 %tmp8.i11.i, label %bb36.i.i.exitStub [ - i32 -1, label %bb.i14.i.exitStub - i32 0, label %bb12.i.i935.exitStub - i32 1, label %bb20.i.i937.exitStub - i32 2, label %bb28.i.i938.exitStub - ] + %tmp8.i11.i = load i32* %tmp7.i10.i ; [#uses=7] + br label %NodeBlock5 + +NodeBlock5: ; preds = %bb.i9.i.i932.ce + icmp slt i32 %tmp8.i11.i, 1 ; :0 [#uses=1] + br i1 %0, label %NodeBlock, label %NodeBlock4 + +NodeBlock4: ; preds = %NodeBlock5 + icmp slt i32 %tmp8.i11.i, 2 ; :1 [#uses=1] + br i1 %1, label %LeafBlock2, label %LeafBlock3 + +LeafBlock3: ; preds = %NodeBlock4 + icmp eq i32 %tmp8.i11.i, 2 ; :2 [#uses=1] + br i1 %2, label %bb28.i.i938.exitStub, label %NewDefault + +LeafBlock2: ; preds = %NodeBlock4 + icmp eq i32 %tmp8.i11.i, 1 ; :3 [#uses=1] + br i1 %3, label %bb20.i.i937.exitStub, label %NewDefault + +NodeBlock: ; preds = %NodeBlock5 + icmp slt i32 %tmp8.i11.i, 0 ; :4 [#uses=1] + br i1 %4, label %LeafBlock, label %LeafBlock1 + +LeafBlock1: ; preds = %NodeBlock + icmp eq i32 %tmp8.i11.i, 0 ; :5 [#uses=1] + br i1 %5, label %bb12.i.i935.exitStub, label %NewDefault + +LeafBlock: ; preds = %NodeBlock + icmp eq i32 %tmp8.i11.i, -1 ; :6 [#uses=1] + br i1 %6, label %bb.i14.i.exitStub, label %NewDefault } Index: llvm/test/CodeGen/Generic/switch-lower-feature.ll diff -u llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.2 llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.3 --- llvm/test/CodeGen/Generic/switch-lower-feature.ll:1.2 Wed Apr 4 16:14:49 2007 +++ llvm/test/CodeGen/Generic/switch-lower-feature.ll Mon Apr 9 07:31:58 2007 @@ -1,10 +1,7 @@ ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$7 | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -march=x86 -o - | grep \$6 | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1024 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep 1023 | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jg | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 1 && -; RUN: llvm-as < %s | llc -march=x86 -o - | grep jae | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=x86 -o - | grep jb | wc -l | grep 2 && ; RUN: llvm-as < %s | llc -march=x86 -o - | grep je | wc -l | grep 1 define i32 @main(i32 %tmp158) { From asl at math.spbu.ru Mon Apr 9 07:32:20 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 9 Apr 2007 07:32:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGISel.h Message-ID: <200704091232.l39CWK0Y002593@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAGISel.h updated: 1.36 -> 1.37 --- Log message: Next stage into switch lowering refactoring 1. Fix some bugs in the jump table lowering threshold 2. Implement much better metric for optimal pivot selection 3. Tune thresholds for different lowering methods 4. Implement shift-and trick for lowering small ( JumpTableBlock; - + + struct BitTestCase { + BitTestCase(uint64_t M, MachineBasicBlock* T, MachineBasicBlock* Tr): + Mask(M), ThisBB(T), TargetBB(Tr) { }; + uint64_t Mask; + MachineBasicBlock* ThisBB; + MachineBasicBlock* TargetBB; + }; + + typedef SmallVector BitTestInfo; + + struct BitTestBlock { + BitTestBlock(uint64_t F, uint64_t R, Value* SV, + unsigned Rg, bool E, + MachineBasicBlock* P, MachineBasicBlock* D, + const BitTestInfo& C): + First(F), Range(R), SValue(SV), Reg(Rg), Emitted(E), + Parent(P), Default(D), Cases(C) { }; + uint64_t First; + uint64_t Range; + Value *SValue; + unsigned Reg; + bool Emitted; + MachineBasicBlock *Parent; + MachineBasicBlock *Default; + BitTestInfo Cases; + }; protected: /// Pick a safe ordering and emit instructions for each target node in the /// graph. @@ -157,6 +183,8 @@ /// JTCases - Vector of JumpTable structures which holds necessary information /// for emitting a jump tables during SwitchInst code generation. std::vector JTCases; + + std::vector BitTestCases; }; } From asl at math.spbu.ru Mon Apr 9 07:32:20 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 9 Apr 2007 07:32:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704091232.l39CWKJh002598@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.409 -> 1.410 --- Log message: Next stage into switch lowering refactoring 1. Fix some bugs in the jump table lowering threshold 2. Implement much better metric for optimal pivot selection 3. Tune thresholds for different lowering methods 4. Implement shift-and trick for lowering small ( CaseVector; + typedef std::vector CaseBitsVector; typedef CaseVector::iterator CaseItr; typedef std::pair CaseRange; @@ -404,9 +414,7 @@ /// The comparison function for sorting the switch case values in the vector. /// WARNING: Case ranges should be disjoint! struct CaseCmp { - bool operator () (const Case& C1, - const Case& C2) { - + bool operator () (const Case& C1, const Case& C2) { assert(isa(C1.Low) && isa(C2.High)); const ConstantInt* CI1 = cast(C1.Low); const ConstantInt* CI2 = cast(C2.High); @@ -414,6 +422,12 @@ } }; + struct CaseBitsCmp { + bool operator () (const CaseBits& C1, const CaseBits& C2) { + return C1.Bits > C2.Bits; + } + }; + unsigned Clusterify(CaseVector& Cases, const SwitchInst &SI); public: @@ -430,6 +444,7 @@ /// JTCases - Vector of JumpTable structures used to communicate /// SwitchInst code generation information. std::vector JTCases; + std::vector BitTestCases; /// FuncInfo - Information about the function as a whole. /// @@ -531,7 +546,15 @@ CaseRecVector& WorkList, Value* SV, MachineBasicBlock* Default); + bool handleBitTestsSwitchCase(CaseRec& CR, + CaseRecVector& WorkList, + Value* SV, + MachineBasicBlock* Default); void visitSwitchCase(SelectionDAGISel::CaseBlock &CB); + void visitBitTestHeader(SelectionDAGISel::BitTestBlock &B); + void visitBitTestCase(MachineBasicBlock* NextMBB, + unsigned Reg, + SelectionDAGISel::BitTestCase &B); void visitJumpTable(SelectionDAGISel::JumpTable &JT); void visitJumpTableHeader(SelectionDAGISel::JumpTable &JT, SelectionDAGISel::JumpTableHeader &JTH); @@ -1210,9 +1233,98 @@ DAG.setRoot(BrCond); else DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrCond, - DAG.getBasicBlock(JT.MBB))); + DAG.getBasicBlock(JT.MBB))); + + return; } +/// visitBitTestHeader - This function emits necessary code to produce value +/// suitable for "bit tests" +void SelectionDAGLowering::visitBitTestHeader(SelectionDAGISel::BitTestBlock &B) { + // Subtract the minimum value + SDOperand SwitchOp = getValue(B.SValue); + MVT::ValueType VT = SwitchOp.getValueType(); + SDOperand SUB = DAG.getNode(ISD::SUB, VT, SwitchOp, + DAG.getConstant(B.First, VT)); + + // Check range + SDOperand RangeCmp = DAG.getSetCC(TLI.getSetCCResultTy(), SUB, + DAG.getConstant(B.Range, VT), + ISD::SETUGT); + + SDOperand ShiftOp; + if (VT > TLI.getShiftAmountTy()) + ShiftOp = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), SUB); + else + ShiftOp = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), SUB); + + // Make desired shift + SDOperand SwitchVal = DAG.getNode(ISD::SHL, TLI.getPointerTy(), + DAG.getConstant(1, TLI.getPointerTy()), + ShiftOp); + + unsigned SwitchReg = FuncInfo.MakeReg(TLI.getPointerTy()); + SDOperand CopyTo = DAG.getCopyToReg(getRoot(), SwitchReg, SwitchVal); + B.Reg = SwitchReg; + + SDOperand BrRange = DAG.getNode(ISD::BRCOND, MVT::Other, CopyTo, RangeCmp, + DAG.getBasicBlock(B.Default)); + + // Set NextBlock to be the MBB immediately after the current one, if any. + // This is used to avoid emitting unnecessary branches to the next block. + MachineBasicBlock *NextBlock = 0; + MachineFunction::iterator BBI = CurMBB; + if (++BBI != CurMBB->getParent()->end()) + NextBlock = BBI; + + MachineBasicBlock* MBB = B.Cases[0].ThisBB; + if (MBB == NextBlock) + DAG.setRoot(BrRange); + else + DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, CopyTo, + DAG.getBasicBlock(MBB))); + + CurMBB->addSuccessor(B.Default); + CurMBB->addSuccessor(MBB); + + return; +} + +/// visitBitTestCase - this function produces one "bit test" +void SelectionDAGLowering::visitBitTestCase(MachineBasicBlock* NextMBB, + unsigned Reg, + SelectionDAGISel::BitTestCase &B) { + // Emit bit tests and jumps + SDOperand SwitchVal = DAG.getCopyFromReg(getRoot(), Reg, TLI.getPointerTy()); + + SDOperand AndOp = DAG.getNode(ISD::AND, TLI.getPointerTy(), + SwitchVal, + DAG.getConstant(B.Mask, + TLI.getPointerTy())); + SDOperand AndCmp = DAG.getSetCC(TLI.getSetCCResultTy(), AndOp, + DAG.getConstant(0, TLI.getPointerTy()), + ISD::SETNE); + SDOperand BrAnd = DAG.getNode(ISD::BRCOND, MVT::Other, getRoot(), + AndCmp, DAG.getBasicBlock(B.TargetBB)); + + // Set NextBlock to be the MBB immediately after the current one, if any. + // This is used to avoid emitting unnecessary branches to the next block. + MachineBasicBlock *NextBlock = 0; + MachineFunction::iterator BBI = CurMBB; + if (++BBI != CurMBB->getParent()->end()) + NextBlock = BBI; + + if (NextMBB == NextBlock) + DAG.setRoot(BrAnd); + else + DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, BrAnd, + DAG.getBasicBlock(NextMBB))); + + CurMBB->addSuccessor(B.TargetBB); + CurMBB->addSuccessor(NextMBB); + + return; +} void SelectionDAGLowering::visitInvoke(InvokeInst &I) { assert(0 && "Should never be visited directly"); @@ -1273,7 +1385,7 @@ // Size is the number of Cases represented by this range. unsigned Size = CR.Range.second - CR.Range.first; - if (Size >=3) + if (Size > 3) return false; // Get the MachineFunction which holds the current MBB. This is used when @@ -1354,9 +1466,6 @@ Case& FrontCase = *CR.Range.first; Case& BackCase = *(CR.Range.second-1); - // Size is the number of Cases represented by this range. - unsigned Size = CR.Range.second - CR.Range.first; - int64_t First = cast(FrontCase.Low)->getSExtValue(); int64_t Last = cast(BackCase.High)->getSExtValue(); @@ -1367,7 +1476,7 @@ if ((!TLI.isOperationLegal(ISD::BR_JT, MVT::Other) && !TLI.isOperationLegal(ISD::BRIND, MVT::Other)) || - Size <= 5) + TSize <= 3) return false; double Density = (double)TSize / (double)((Last - First) + 1ULL); @@ -1376,7 +1485,7 @@ DOUT << "Lowering jump table\n" << "First entry: " << First << ". Last entry: " << Last << "\n" - << "Size: " << TSize << ". Density: " << Density << "\n"; + << "Size: " << TSize << ". Density: " << Density << "\n\n"; // Get the MachineFunction which holds the current MBB. This is used when // inserting any additional MBBs necessary to represent the switch. @@ -1401,7 +1510,7 @@ CR.CaseBB->addSuccessor(JumpTableBB); // Build a vector of destination BBs, corresponding to each target - // of the jump table. If the value of the jump table slot corresponds to + // of the jump table. If the value of the jump table slot corresponds to // a case statement, push the case's BB onto the vector, otherwise, push // the default BB. std::vector DestBBs; @@ -1472,7 +1581,7 @@ int64_t First = cast(FrontCase.Low)->getSExtValue(); int64_t Last = cast(BackCase.High)->getSExtValue(); - double Density = 0; + double FMetric = 0; CaseItr Pivot = CR.Range.first + Size/2; // Select optimal pivot, maximizing sum density of LHS and RHS. This will @@ -1484,20 +1593,33 @@ uint64_t LSize = FrontCase.size(); uint64_t RSize = TSize-LSize; + DOUT << "Selecting best pivot: \n" + << "First: " << First << ", Last: " << Last <<"\n" + << "LSize: " << LSize << ", RSize: " << RSize << "\n"; for (CaseItr I = CR.Range.first, J=I+1, E = CR.Range.second; J!=E; ++I, ++J) { int64_t LEnd = cast(I->High)->getSExtValue(); int64_t RBegin = cast(J->Low)->getSExtValue(); + assert((RBegin-LEnd>=1) && "Invalid case distance"); double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL); double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL); - if (Density < (LDensity + RDensity)) { + double Metric = log(RBegin-LEnd)*(LDensity+RDensity); + // Should always split in some non-trivial place + DOUT <<"=>Step\n" + << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n" + << "LDensity: " << LDensity << ", RDensity: " << RDensity << "\n" + << "Metric: " << Metric << "\n"; + if (FMetric < Metric) { Pivot = J; - Density = LDensity + RDensity; + FMetric = Metric; + DOUT << "Current metric set to: " << FMetric << "\n"; } LSize += J->size(); RSize -= J->size(); } + // If our case is dense we *really* should handle it earlier! + assert((FMetric != 0) && "Should handle dense range earlier!"); CaseRange LHSR(CR.Range.first, Pivot); CaseRange RHSR(Pivot, CR.Range.second); @@ -1549,6 +1671,130 @@ return true; } +/// handleBitTestsSwitchCase - if current case range has few destination and +/// range span less, than machine word bitwidth, encode case range into series +/// of masks and emit bit tests with these masks. +bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR, + CaseRecVector& WorkList, + Value* SV, + MachineBasicBlock* Default) { + unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); + + Case& FrontCase = *CR.Range.first; + Case& BackCase = *(CR.Range.second-1); + + // Get the MachineFunction which holds the current MBB. This is used when + // inserting any additional MBBs necessary to represent the switch. + MachineFunction *CurMF = CurMBB->getParent(); + + unsigned numCmps = 0; + for (CaseItr I = CR.Range.first, E = CR.Range.second; + I!=E; ++I) { + // Single case counts one, case range - two. + if (I->Low == I->High) + numCmps +=1; + else + numCmps +=2; + } + + // Count unique destinations + SmallSet Dests; + for (CaseItr I = CR.Range.first, E = CR.Range.second; I!=E; ++I) { + Dests.insert(I->BB); + if (Dests.size() > 3) + // Don't bother the code below, if there are too much unique destinations + return false; + } + DOUT << "Total number of unique destinations: " << Dests.size() << "\n" + << "Total number of comparisons: " << numCmps << "\n"; + + // Compute span of values. + Constant* minValue = FrontCase.Low; + Constant* maxValue = BackCase.High; + uint64_t range = cast(maxValue)->getSExtValue() - + cast(minValue)->getSExtValue(); + DOUT << "Compare range: " << range << "\n" + << "Low bound: " << cast(minValue)->getSExtValue() << "\n" + << "High bound: " << cast(maxValue)->getSExtValue() << "\n"; + + if (range>IntPtrBits || + (!(Dests.size() == 1 && numCmps >= 3) && + !(Dests.size() == 2 && numCmps >= 5) && + !(Dests.size() >= 3 && numCmps >= 6))) + return false; + + DOUT << "Emitting bit tests\n"; + int64_t lowBound = 0; + + // Optimize the case where all the case values fit in a + // word without having to subtract minValue. In this case, + // we can optimize away the subtraction. + if (cast(minValue)->getSExtValue() >= 0 && + cast(maxValue)->getSExtValue() <= IntPtrBits) { + range = cast(maxValue)->getSExtValue(); + } else { + lowBound = cast(minValue)->getSExtValue(); + } + + CaseBitsVector CasesBits; + unsigned i, count = 0; + + for (CaseItr I = CR.Range.first, E = CR.Range.second; I!=E; ++I) { + MachineBasicBlock* Dest = I->BB; + for (i = 0; i < count; ++i) + if (Dest == CasesBits[i].BB) + break; + + if (i == count) { + assert((count < 3) && "Too much destinations to test!"); + CasesBits.push_back(CaseBits(0, Dest, 0)); + count++; + } + + uint64_t lo = cast(I->Low)->getSExtValue() - lowBound; + uint64_t hi = cast(I->High)->getSExtValue() - lowBound; + + for (uint64_t j = lo; j <= hi; j++) { + CasesBits[i].Mask |= 1 << j; + CasesBits[i].Bits++; + } + + } + std::sort(CasesBits.begin(), CasesBits.end(), CaseBitsCmp()); + + SelectionDAGISel::BitTestInfo BTC; + + // Figure out which block is immediately after the current one. + MachineFunction::iterator BBI = CR.CaseBB; + ++BBI; + + const BasicBlock *LLVMBB = CR.CaseBB->getBasicBlock(); + + DOUT << "Cases:\n"; + for (unsigned i = 0, e = CasesBits.size(); i!=e; ++i) { + DOUT << "Mask: " << CasesBits[i].Mask << ", Bits: " << CasesBits[i].Bits + << ", BB: " << CasesBits[i].BB << "\n"; + + MachineBasicBlock *CaseBB = new MachineBasicBlock(LLVMBB); + CurMF->getBasicBlockList().insert(BBI, CaseBB); + BTC.push_back(SelectionDAGISel::BitTestCase(CasesBits[i].Mask, + CaseBB, + CasesBits[i].BB)); + } + + SelectionDAGISel::BitTestBlock BTB(lowBound, range, SV, + -1ULL, (CR.CaseBB == CurMBB), + CR.CaseBB, Default, BTC); + + if (CR.CaseBB == CurMBB) + visitBitTestHeader(BTB); + + BitTestCases.push_back(BTB); + + return true; +} + + // Clusterify - Transform simple list of Cases into list of CaseRange's unsigned SelectionDAGLowering::Clusterify(CaseVector& Cases, const SwitchInst& SI) { @@ -1633,12 +1879,15 @@ CaseRec CR = WorkList.back(); WorkList.pop_back(); + if (handleBitTestsSwitchCase(CR, WorkList, SV, Default)) + continue; + // If the range has few cases (two or less) emit a series of specific // tests. if (handleSmallSwitchRange(CR, WorkList, SV, Default)) continue; - // If the switch has more than 5 blocks, and at least 31.25% dense, and the + // If the switch has more than 5 blocks, and at least 40% dense, and the // target supports indirect branches, then emit a jump table rather than // lowering the switch to a binary tree of conditional branches. if (handleJTSwitchCase(CR, WorkList, SV, Default)) @@ -4244,7 +4493,9 @@ SwitchCases = SDL.SwitchCases; JTCases.clear(); JTCases = SDL.JTCases; - + BitTestCases.clear(); + BitTestCases = SDL.BitTestCases; + // Make sure the root of the DAG is up-to-date. DAG.setRoot(SDL.getRoot()); } @@ -4293,10 +4544,16 @@ // Second step, emit the lowered DAG as machine code. CodeGenAndEmitDAG(DAG); } + + DOUT << "Total amount of phi nodes to update: " + << PHINodesToUpdate.size() << "\n"; + DEBUG(for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i) + DOUT << "Node " << i << " : (" << PHINodesToUpdate[i].first + << ", " << PHINodesToUpdate[i].second << ")\n";); // Next, now that we know what the last MBB the LLVM BB expanded is, update // PHI nodes in successors. - if (SwitchCases.empty() && JTCases.empty()) { + if (SwitchCases.empty() && JTCases.empty() && BitTestCases.empty()) { for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i) { MachineInstr *PHI = PHINodesToUpdate[i].first; assert(PHI->getOpcode() == TargetInstrInfo::PHI && @@ -4306,7 +4563,69 @@ } return; } - + + for (unsigned i = 0, e = BitTestCases.size(); i != e; ++i) { + // Lower header first, if it wasn't already lowered + if (!BitTestCases[i].Emitted) { + SelectionDAG HSDAG(TLI, MF, getAnalysisToUpdate()); + CurDAG = &HSDAG; + SelectionDAGLowering HSDL(HSDAG, TLI, FuncInfo); + // Set the current basic block to the mbb we wish to insert the code into + BB = BitTestCases[i].Parent; + HSDL.setCurrentBasicBlock(BB); + // Emit the code + HSDL.visitBitTestHeader(BitTestCases[i]); + HSDAG.setRoot(HSDL.getRoot()); + CodeGenAndEmitDAG(HSDAG); + } + + for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) { + SelectionDAG BSDAG(TLI, MF, getAnalysisToUpdate()); + CurDAG = &BSDAG; + SelectionDAGLowering BSDL(BSDAG, TLI, FuncInfo); + // Set the current basic block to the mbb we wish to insert the code into + BB = BitTestCases[i].Cases[j].ThisBB; + BSDL.setCurrentBasicBlock(BB); + // Emit the code + if (j+1 != ej) + BSDL.visitBitTestCase(BitTestCases[i].Cases[j+1].ThisBB, + BitTestCases[i].Reg, + BitTestCases[i].Cases[j]); + else + BSDL.visitBitTestCase(BitTestCases[i].Default, + BitTestCases[i].Reg, + BitTestCases[i].Cases[j]); + + + BSDAG.setRoot(BSDL.getRoot()); + CodeGenAndEmitDAG(BSDAG); + } + + // Update PHI Nodes + for (unsigned pi = 0, pe = PHINodesToUpdate.size(); pi != pe; ++pi) { + MachineInstr *PHI = PHINodesToUpdate[pi].first; + MachineBasicBlock *PHIBB = PHI->getParent(); + assert(PHI->getOpcode() == TargetInstrInfo::PHI && + "This is not a machine PHI node that we are updating!"); + // This is "default" BB. We have two jumps to it. From "header" BB and + // from last "case" BB. + if (PHIBB == BitTestCases[i].Default) { + PHI->addRegOperand(PHINodesToUpdate[pi].second, false); + PHI->addMachineBasicBlockOperand(BitTestCases[i].Parent); + PHI->addMachineBasicBlockOperand(BitTestCases[i].Cases.back().ThisBB); + } + // One of "cases" BB. + for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) { + MachineBasicBlock* cBB = BitTestCases[i].Cases[j].ThisBB; + if (cBB->succ_end() != + std::find(cBB->succ_begin(),cBB->succ_end(), PHIBB)) { + PHI->addRegOperand(PHINodesToUpdate[pi].second, false); + PHI->addMachineBasicBlockOperand(cBB); + } + } + } + } + // If the JumpTable record is filled in, then we need to emit a jump table. // Updating the PHI nodes is tricky in this case, since we need to determine // whether the PHI is a successor of the range check MBB or the jump table MBB @@ -4323,7 +4642,7 @@ HSDL.visitJumpTableHeader(JTCases[i].second, JTCases[i].first); HSDAG.setRoot(HSDL.getRoot()); CodeGenAndEmitDAG(HSDAG); - } + } SelectionDAG JSDAG(TLI, MF, getAnalysisToUpdate()); CurDAG = &JSDAG; @@ -4342,10 +4661,12 @@ MachineBasicBlock *PHIBB = PHI->getParent(); assert(PHI->getOpcode() == TargetInstrInfo::PHI && "This is not a machine PHI node that we are updating!"); + // "default" BB. We can go there only from header BB. if (PHIBB == JTCases[i].second.Default) { PHI->addRegOperand(PHINodesToUpdate[pi].second, false); PHI->addMachineBasicBlockOperand(JTCases[i].first.HeaderBB); } + // JT BB. Just iterate over successors here if (BB->succ_end() != std::find(BB->succ_begin(),BB->succ_end(), PHIBB)) { PHI->addRegOperand(PHINodesToUpdate[pi].second, false); PHI->addMachineBasicBlockOperand(BB); From jeffc at jolt-lang.org Mon Apr 9 09:33:16 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 9 Apr 2007 09:33:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704091433.l39EXGGX005276@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.410 -> 1.411 --- Log message: Unbreak VC++ build. --- Diffs of the changes: (+3 -2) SelectionDAGISel.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.410 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.410 Mon Apr 9 07:31:58 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 09:32:59 2007 @@ -45,6 +45,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" #include +#include using namespace llvm; #ifndef NDEBUG @@ -1603,7 +1604,7 @@ assert((RBegin-LEnd>=1) && "Invalid case distance"); double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL); double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL); - double Metric = log(RBegin-LEnd)*(LDensity+RDensity); + double Metric = log(double(RBegin-LEnd))*(LDensity+RDensity); // Should always split in some non-trivial place DOUT <<"=>Step\n" << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n" @@ -1783,7 +1784,7 @@ } SelectionDAGISel::BitTestBlock BTB(lowBound, range, SV, - -1ULL, (CR.CaseBB == CurMBB), + -1U, (CR.CaseBB == CurMBB), CR.CaseBB, Default, BTC); if (CR.CaseBB == CurMBB) From reid at x10sys.com Mon Apr 9 10:01:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 10:01:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Instructions.cpp Type.cpp Message-ID: <200704091501.l39F1VKw005703@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.116 -> 1.117 Instructions.cpp updated: 1.81 -> 1.82 Type.cpp updated: 1.179 -> 1.180 --- Log message: For PR1146: http://llvm.org/PR1146 : * Add ParamAttrList pointers to Function and CallInst. * Move the implementation of ParamAttrList from Type.cpp to Function.cpp --- Diffs of the changes: (+68 -59) Function.cpp | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Instructions.cpp | 4 +++ Type.cpp | 59 -------------------------------------------------- 3 files changed, 68 insertions(+), 59 deletions(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.116 llvm/lib/VMCore/Function.cpp:1.117 --- llvm/lib/VMCore/Function.cpp:1.116 Mon Apr 9 01:11:23 2007 +++ llvm/lib/VMCore/Function.cpp Mon Apr 9 10:01:12 2007 @@ -72,12 +72,76 @@ } //===----------------------------------------------------------------------===// +// ParamAttrsList Implementation +//===----------------------------------------------------------------------===// + +uint16_t +ParamAttrsList::getParamAttrs(uint16_t Index) const { + unsigned limit = attrs.size(); + for (unsigned i = 0; i < limit; ++i) + if (attrs[i].index == Index) + return attrs[i].attrs; + return NoAttributeSet; +} + + +std::string +ParamAttrsList::getParamAttrsText(uint16_t Attrs) { + std::string Result; + if (Attrs & ZExtAttribute) + Result += "zext "; + if (Attrs & SExtAttribute) + Result += "sext "; + if (Attrs & NoReturnAttribute) + Result += "noreturn "; + if (Attrs & NoUnwindAttribute) + Result += "nounwind "; + if (Attrs & InRegAttribute) + Result += "inreg "; + if (Attrs & StructRetAttribute) + Result += "sret "; + return Result; +} + +void +ParamAttrsList::addAttributes(uint16_t Index, uint16_t Attrs) { + // First, try to replace an existing one + for (unsigned i = 0; i < attrs.size(); ++i) + if (attrs[i].index == Index) { + attrs[i].attrs |= Attrs; + return; + } + + // If not found, add a new one + ParamAttrsWithIndex Val; + Val.attrs = Attrs; + Val.index = Index; + attrs.push_back(Val); +} + +void +ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) { + // Find the index from which to remove the attributes + for (unsigned i = 0; i < attrs.size(); ++i) + if (attrs[i].index == Index) { + attrs[i].attrs &= ~Attrs; + if (attrs[i].attrs == NoAttributeSet) + attrs.erase(&attrs[i]); + return; + } + + // The index wasn't found above + assert(0 && "Index not found for removeAttributes"); +} + +//===----------------------------------------------------------------------===// // Function Implementation //===----------------------------------------------------------------------===// Function::Function(const FunctionType *Ty, LinkageTypes Linkage, const std::string &name, Module *ParentModule) : GlobalValue(PointerType::get(Ty), Value::FunctionVal, 0, 0, Linkage, name) { + ParamAttrs = 0; CallingConvention = 0; BasicBlocks.setItemParent(this); BasicBlocks.setParent(this); Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.81 llvm/lib/VMCore/Instructions.cpp:1.82 --- llvm/lib/VMCore/Instructions.cpp:1.81 Thu Mar 22 11:38:57 2007 +++ llvm/lib/VMCore/Instructions.cpp Mon Apr 9 10:01:12 2007 @@ -188,6 +188,7 @@ } void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { + ParamAttrs = 0; NumOperands = NumParams+1; Use *OL = OperandList = new Use[NumParams+1]; OL[0].init(Func, this); @@ -208,6 +209,7 @@ } void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) { + ParamAttrs = 0; NumOperands = 3; Use *OL = OperandList = new Use[3]; OL[0].init(Func, this); @@ -230,6 +232,7 @@ } void CallInst::init(Value *Func, Value *Actual) { + ParamAttrs = 0; NumOperands = 2; Use *OL = OperandList = new Use[2]; OL[0].init(Func, this); @@ -248,6 +251,7 @@ } void CallInst::init(Value *Func) { + ParamAttrs = 0; NumOperands = 1; Use *OL = OperandList = new Use[1]; OL[0].init(Func, this); Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.179 llvm/lib/VMCore/Type.cpp:1.180 --- llvm/lib/VMCore/Type.cpp:1.179 Mon Apr 9 01:07:52 2007 +++ llvm/lib/VMCore/Type.cpp Mon Apr 9 10:01:12 2007 @@ -1121,65 +1121,6 @@ return false; } -uint16_t -ParamAttrsList::getParamAttrs(uint16_t Index) const { - unsigned limit = attrs.size(); - for (unsigned i = 0; i < limit; ++i) - if (attrs[i].index == Index) - return attrs[i].attrs; - return NoAttributeSet; -} - - -std::string -ParamAttrsList::getParamAttrsText(uint16_t Attrs) { - std::string Result; - if (Attrs & ZExtAttribute) - Result += "zext "; - if (Attrs & SExtAttribute) - Result += "sext "; - if (Attrs & NoReturnAttribute) - Result += "noreturn "; - if (Attrs & NoUnwindAttribute) - Result += "nounwind "; - if (Attrs & InRegAttribute) - Result += "inreg "; - if (Attrs & StructRetAttribute) - Result += "sret "; - return Result; -} - -void -ParamAttrsList::addAttributes(uint16_t Index, uint16_t Attrs) { - // First, try to replace an existing one - for (unsigned i = 0; i < attrs.size(); ++i) - if (attrs[i].index == Index) { - attrs[i].attrs |= Attrs; - return; - } - - // If not found, add a new one - ParamAttrsWithIndex Val; - Val.attrs = Attrs; - Val.index = Index; - attrs.push_back(Val); -} - -void -ParamAttrsList::removeAttributes(uint16_t Index, uint16_t Attrs) { - // Find the index from which to remove the attributes - for (unsigned i = 0; i < attrs.size(); ++i) - if (attrs[i].index == Index) { - attrs[i].attrs &= ~Attrs; - if (attrs[i].attrs == NoAttributeSet) - attrs.erase(&attrs[i]); - return; - } - - // The index wasn't found above - assert(0 && "Index not found for removeAttributes"); -} - //===----------------------------------------------------------------------===// // Array Type Factory... // From reid at x10sys.com Mon Apr 9 10:01:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 10:01:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h Instructions.h Message-ID: <200704091501.l39F1TjM005694@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Function.h updated: 1.72 -> 1.73 Instructions.h updated: 1.63 -> 1.64 --- Log message: For PR1146: http://llvm.org/PR1146 : * Add ParamAttrList pointers to Function and CallInst. * Move the implementation of ParamAttrList from Type.cpp to Function.cpp --- Diffs of the changes: (+29 -5) Function.h | 22 +++++++++++++++++----- Instructions.h | 12 ++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.72 llvm/include/llvm/Function.h:1.73 --- llvm/include/llvm/Function.h:1.72 Mon Feb 5 14:47:19 2007 +++ llvm/include/llvm/Function.h Mon Apr 9 10:01:12 2007 @@ -26,6 +26,7 @@ namespace llvm { class FunctionType; +class ParamAttrsList; // Traits for intrusive list of instructions... template<> struct ilist_traits @@ -60,11 +61,11 @@ private: // Important things that make up a function! - BasicBlockListType BasicBlocks; // The basic blocks - ArgumentListType ArgumentList; // The formal arguments - - ValueSymbolTable *SymTab; - unsigned CallingConvention; + BasicBlockListType BasicBlocks; ///< The basic blocks + ArgumentListType ArgumentList; ///< The formal arguments + ValueSymbolTable *SymTab; ///< Symbol table of args/instructions + ParamAttrsList *ParamAttrs; ///< Parameter attributes + unsigned CallingConvention; ///< Calling convention to use friend class SymbolTableListTraits; @@ -111,6 +112,17 @@ unsigned getCallingConv() const { return CallingConvention; } void setCallingConv(unsigned CC) { CallingConvention = CC; } + /// Obtains a constant pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @returns 0 if no parameter attributes have been set. + /// @brief Get the parameter attributes. + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + + /// Sets the parameter attributes for this Function. To construct a + /// ParamAttrsList, see ParameterAttributes.h + /// @brief Set the parameter attributes. + void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; } + /// deleteBody - This method deletes the body of the function, and converts /// the linkage to external. /// Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.63 llvm/include/llvm/Instructions.h:1.64 --- llvm/include/llvm/Instructions.h:1.63 Wed Feb 28 16:00:54 2007 +++ llvm/include/llvm/Instructions.h Mon Apr 9 10:01:12 2007 @@ -26,6 +26,7 @@ class VectorType; class ConstantRange; class APInt; +class ParamAttrsList; //===----------------------------------------------------------------------===// // AllocationInst Class @@ -694,6 +695,7 @@ /// hold the calling convention of the call. /// class CallInst : public Instruction { + ParamAttrsList *ParamAttrs; ///< parameter attributes for call CallInst(const CallInst &CI); void init(Value *Func, Value* const *Params, unsigned NumParams); void init(Value *Func, Value *Actual1, Value *Actual2); @@ -735,6 +737,16 @@ SubclassData = (SubclassData & 1) | (CC << 1); } + /// Obtains a constant pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @brief Get the parameter attributes. + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + + /// Sets the parameter attributes for this CallInst. To construct a + /// ParamAttrsList, see ParameterAttributes.h + /// @brief Set the parameter attributes. + void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; } + /// getCalledFunction - Return the function being called by this instruction /// if it is a direct call. If it is a call through a function pointer, /// return null. From dpatel at apple.com Mon Apr 9 11:12:05 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 11:12:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704091612.l39GC5UW006958@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.1 -> 1.2 --- Log message: Only cosmetic changes. Zero functionality Change. --- Diffs of the changes: (+100 -97) LoopRotation.cpp | 197 +++++++++++++++++++++++++++---------------------------- 1 files changed, 100 insertions(+), 97 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.1 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.1 Fri Apr 6 20:20:26 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 11:11:48 2007 @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "loop-rotation" +#define DEBUG_TYPE "loop-rotate" #include "llvm/Transforms/Scalar.h" #include "llvm/Function.h" @@ -23,7 +23,6 @@ #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/SmallVector.h" -#include using namespace llvm; @@ -32,29 +31,28 @@ STATISTIC(NumRotated, "Number of loops rotated"); namespace { - cl::opt - RotateThreshold("rotate-threshold", cl::init(200), cl::Hidden, - cl::desc("The cut-off point for loop rotating")); - - class VISIBILITY_HIDDEN InsnReplacementData { + class VISIBILITY_HIDDEN RenameData { public: - InsnReplacementData(Instruction *O, Instruction *P, Instruction *H) - : Original(O), PreHeader(P), Header(H) {} + RenameData(Instruction *O, Instruction *P, Instruction *H) + : Original(O), PreHeader(P), Header(H) { } public: Instruction *Original; // Original instruction Instruction *PreHeader; // New pre-header replacement Instruction *Header; // New header replacement }; - + class VISIBILITY_HIDDEN LoopRotate : public LoopPass { public: + + // Rotate Loop L as many times as possible. Return true if + // loop is rotated at least once. bool runOnLoop(Loop *L, LPPassManager &LPM); + + // LCSSA form makes instruction renaming easier. virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(LCSSAID); AU.addPreservedID(LCSSAID); - //AU.addRequired(); - //AU.addPreserved(); } // Helper functions @@ -75,7 +73,7 @@ /// Find Replacement information for instruction. Return NULL if it is /// not available. - InsnReplacementData *findReplacementData(Instruction *I); + RenameData *findReplacementData(Instruction *I); private: @@ -87,7 +85,7 @@ BasicBlock *NewPreHeader; BasicBlock *Exit; - SmallVector RD; + SmallVector LoopHeaderInfo; }; RegisterPass X ("loop-rotate", "Rotate Loops"); @@ -95,6 +93,8 @@ LoopPass *llvm::createLoopRotatePass() { return new LoopRotate(); } +/// Rotate Loop L as many times as possible. Return true if +/// loop is rotated at least once. bool LoopRotate::runOnLoop(Loop *Lp, LPPassManager &LPM) { bool RotatedOneLoop = false; @@ -109,18 +109,17 @@ return RotatedOneLoop; } +/// Rotate loop LP. Return true if it loop is rotated. bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) { L = Lp; - if ( NumRotated >= RotateThreshold) - return false; OrigHeader = L->getHeader(); OrigPreHeader = L->getLoopPreheader(); OrigLatch = L->getLoopLatch(); // If loop has only one block then there is not much to rotate. - if (L->getBlocks().size() <= 1) + if (L->getBlocks().size() == 1) return false; if (!OrigHeader || !OrigLatch || !OrigPreHeader) @@ -135,33 +134,27 @@ BranchInst *BI = dyn_cast(OrigHeader->getTerminator()); if (!BI) return false; + assert (BI->isConditional() && "Branch Instruction is not condiitional"); + // Updating PHInodes in loops with multiple exits adds complexity. + // Keep it simple, and restrict loop rotation to loops with one exit only. + // In future, lift this restriction and support for multiple exits if + // required. std::vector ExitBlocks; L->getExitBlocks(ExitBlocks); if (ExitBlocks.size() > 1) return false; // Find new Loop header. NewHeader is a Header's one and only successor - // that is inside loop. Header's all other successors are out side the + // that is inside loop. Header's other successor is out side the // loop. Otherwise loop is not suitable for rotation. - for (unsigned index = 0; index < BI->getNumSuccessors(); ++index) { - BasicBlock *S = BI->getSuccessor(index); - if (L->contains(S)) { - if (!NewHeader) - NewHeader = S; - else - // Loop Header has two successors inside loop. This loop is - // not suitable for rotation. - return false; - } else { - if (!Exit) - Exit = S; - else - // Loop has multiple exits. - return false; - } - } + Exit = BI->getSuccessor(0); + NewHeader = BI->getSuccessor(1); + if (L->contains(Exit)) + std::swap(Exit, NewHeader); assert (NewHeader && "Unable to determine new loop header"); + assert(L->contains(NewHeader) && !L->contains(Exit) && + "Unable to determine loop header and exit blocks"); // Check size of original header and reject // loop if it is very big. @@ -170,7 +163,7 @@ // Now, this loop is suitable for rotation. - // Copy Prepare PHI nodes and other instructions from original header + // Copy PHI nodes and other instructions from original header // into new pre-header. Unlike original header, new pre-header is // not a member of loop. New pre-header has only one predecessor, // that is original loop pre-header. @@ -185,59 +178,69 @@ // from new loop pre-header (which is a clone of original header definition). NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), OrigHeader); - for (BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end(); - I != E; ++I) { + BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end(); + for (; I != E; ++I) { Instruction *In = I; - if (PHINode *PN = dyn_cast(I)) { + PHINode *PN = dyn_cast(I); + if (!PN) + break; - // Create new PHI node with one value incoming from OrigPreHeader. - // NewPreHeader has only one predecessor, OrigPreHeader. - PHINode *NPH = new PHINode(In->getType(), In->getName()); - NPH->addIncoming(PN->getIncomingValueForBlock(OrigPreHeader), - OrigPreHeader); - NewPreHeader->getInstList().push_back(NPH); - - // Create new PHI node with two incoming values for NewHeader. - // One incoming value is from OrigLatch (through OrigHeader) and - // second incoming value is from NewPreHeader. - PHINode *NH = new PHINode(In->getType(), In->getName()); - NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader); - NH->addIncoming(NPH, NewPreHeader); - NewHeader->getInstList().push_front(NH); - - RD.push_back(InsnReplacementData(In, NPH, NH)); - } else { - // This is not a PHI instruction. Insert its clone into NewPreHeader. - // 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->setName(In->getName()); - NewPreHeader->getInstList().push_back(C); - - // If this instruction is used outside this basic block then - // create new PHINode for this instruction. - Instruction *NewHeaderReplacement = NULL; - if (usedOutsideOriginalHeader(In)) { - PHINode *PN = new PHINode(In->getType(), In->getName()); - PN->addIncoming(In, OrigHeader); - PN->addIncoming(C, NewPreHeader); - NewHeader->getInstList().push_front(PN); - NewHeaderReplacement = PN; - } - RD.push_back(InsnReplacementData(In, C, NewHeaderReplacement)); - } + // Create new PHI node with one value incoming from OrigPreHeader. + // NewPreHeader has only one predecessor, OrigPreHeader. + PHINode *NPH = new PHINode(In->getType(), In->getName()); + NPH->addIncoming(PN->getIncomingValueForBlock(OrigPreHeader), + OrigPreHeader); + NewPreHeader->getInstList().push_back(NPH); + + // Create new PHI node with two incoming values for NewHeader. + // One incoming value is from OrigLatch (through OrigHeader) and + // second incoming value is from NewPreHeader. + PHINode *NH = new PHINode(In->getType(), In->getName()); + NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader); + NH->addIncoming(NPH, NewPreHeader); + NewHeader->getInstList().push_front(NH); + + // "In" can be replaced by NPH or NH at various places. + LoopHeaderInfo.push_back(RenameData(In, NPH, NH)); + } + + // Now, handle non-phi instructions. + for (; I != E; ++I) { + Instruction *In = I; + + assert (!isa(In) && "PHINode is not expected here"); + // This is not a PHI instruction. Insert its clone into NewPreHeader. + // 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->setName(In->getName()); + NewPreHeader->getInstList().push_back(C); + + // If this instruction is used outside this basic block then + // create new PHINode for this instruction. + Instruction *NewHeaderReplacement = NULL; + if (usedOutsideOriginalHeader(In)) { + PHINode *PN = new PHINode(In->getType(), In->getName()); + PN->addIncoming(In, OrigHeader); + PN->addIncoming(C, NewPreHeader); + NewHeader->getInstList().push_front(PN); + NewHeaderReplacement = PN; + } + + // "In" can be replaced by NPH or NH at various places. + LoopHeaderInfo.push_back(RenameData(In, C, NewHeaderReplacement)); } // Update new pre-header. // Rename values that are defined in original header to reflects values // defined in new pre-header. - for (SmallVector::iterator - I = RD.begin(), E = RD.end(); I != E; ++I) { + for (SmallVector::iterator + I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { - InsnReplacementData IRD = (*I); - Instruction *In = IRD.Original; - Instruction *C = IRD.PreHeader; + RenameData ILoopHeaderInfo = (*I); + Instruction *In = ILoopHeaderInfo.Original; + Instruction *C = ILoopHeaderInfo.PreHeader; if (C->getParent() != NewPreHeader) continue; @@ -248,12 +251,12 @@ for (unsigned opi = 0; opi < In->getNumOperands(); ++opi) { if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) { - if (InsnReplacementData *D = findReplacementData(OpPhi)) + if (RenameData *D = findReplacementData(OpPhi)) C->setOperand(opi, D->PreHeader); } else if (Instruction *OpInsn = dyn_cast(In->getOperand(opi))) { - if (InsnReplacementData *D = findReplacementData(OpInsn)) + if (RenameData *D = findReplacementData(OpInsn)) C->setOperand(opi, D->PreHeader); } } @@ -277,15 +280,15 @@ // 2) Inside loop but not in original header // // Replace this use to reflect definition from new header. - for (SmallVector::iterator - I = RD.begin(), E = RD.end(); I != E; ++I) { + for (SmallVector::iterator + I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { - InsnReplacementData IRD = (*I); - if (!IRD.Header) + RenameData ILoopHeaderInfo = (*I); + if (!ILoopHeaderInfo.Header) continue; - Instruction *OldPhi = IRD.Original; - Instruction *NewPhi = IRD.Header; + Instruction *OldPhi = ILoopHeaderInfo.Original; + Instruction *NewPhi = ILoopHeaderInfo.Header; // Before replacing uses, collect them first, so that iterator is // not invalidated. @@ -333,7 +336,7 @@ // UPhi already has one incoming argument from original header. // Add second incoming argument from new Pre header. - UPhi->addIncoming(IRD.PreHeader, NewPreHeader); + UPhi->addIncoming(ILoopHeaderInfo.PreHeader, NewPreHeader); } } @@ -381,9 +384,9 @@ if (isa(V)) PN->addIncoming(V, NewPreHeader); else { - InsnReplacementData *IRD = findReplacementData(cast(V)); - assert (IRD && IRD->PreHeader && "Missing New Preheader Instruction"); - PN->addIncoming(IRD->PreHeader, NewPreHeader); + RenameData *ILoopHeaderInfo = findReplacementData(cast(V)); + assert (ILoopHeaderInfo && ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction"); + PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader); } } } @@ -399,7 +402,7 @@ NewPreHeader = NULL; Exit = NULL; - RD.clear(); + LoopHeaderInfo.clear(); } /// Return true if this instruction is used outside original header. @@ -419,11 +422,11 @@ /// Find Replacement information for instruction. Return NULL if it is /// not available. -InsnReplacementData *LoopRotate::findReplacementData(Instruction *In) { +RenameData *LoopRotate::findReplacementData(Instruction *In) { - // Since RD is small, linear walk is OK. - for (SmallVector::iterator - I = RD.begin(), E = RD.end(); I != E; ++I) + // Since LoopHeaderInfo is small, linear walk is OK. + for (SmallVector::iterator + I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) if ((*I).Original == In) return &(*I); From jeffc at jolt-lang.org Mon Apr 9 11:16:59 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 09 Apr 2007 09:16:59 -0700 Subject: [llvm-commits] New llvm-test regressions Message-ID: <461A66FB.1070204@jolt-lang.org> Changes in the last 24 hours have caused additional failures in llvm-tests: burg, spiff, lencode, espresso and cdecl. From dpatel at apple.com Mon Apr 9 11:21:46 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 11:21:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704091621.l39GLkUw007148@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.2 -> 1.3 --- Log message: More cosmetic changes. --- Diffs of the changes: (+18 -14) LoopRotation.cpp | 32 ++++++++++++++++++-------------- 1 files changed, 18 insertions(+), 14 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.2 Mon Apr 9 11:11:48 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 11:21:29 2007 @@ -238,10 +238,12 @@ for (SmallVector::iterator I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { - RenameData ILoopHeaderInfo = (*I); + const RenameData &ILoopHeaderInfo = *I; Instruction *In = ILoopHeaderInfo.Original; Instruction *C = ILoopHeaderInfo.PreHeader; - + + // If this instruction is not from new pre-header then is not new + // pre-header then this instruction is not handled here. if (C->getParent() != NewPreHeader) continue; @@ -249,7 +251,7 @@ if (isa(In)) continue; - for (unsigned opi = 0; opi < In->getNumOperands(); ++opi) { + for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) { if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) { if (RenameData *D = findReplacementData(OpPhi)) C->setOperand(opi, D->PreHeader); @@ -283,7 +285,7 @@ for (SmallVector::iterator I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { - RenameData ILoopHeaderInfo = (*I); + const RenameData &ILoopHeaderInfo = *I; if (!ILoopHeaderInfo.Header) continue; @@ -294,7 +296,7 @@ // not invalidated. SmallVector AllUses; for (Value::use_iterator UI = OldPhi->use_begin(), UE = OldPhi->use_end(); - UI != UE; ++UI ) { + UI != UE; ++UI) { Instruction *U = cast(UI); AllUses.push_back(U); } @@ -307,9 +309,10 @@ // Used inside original header if (Parent == OrigHeader) { // Do not rename uses inside original header non-phi instructions. - if (!isa(U)) - continue; PHINode *PU = dyn_cast(U); + if (!PU) + continue; + // Do not rename uses inside original header phi nodes, if the // incoming value is for new header. if (PU->getBasicBlockIndex(NewHeader) != -1 @@ -322,13 +325,14 @@ // Used inside loop, but not in original header. if (L->contains(U->getParent())) { - if (U != NewPhi ) + if (U != NewPhi) U->replaceUsesOfWith(OldPhi, NewPhi); continue; } // Used inside Exit Block. Since we are in LCSSA form, U must be PHINode. - assert ( U->getParent() == Exit && "Need to propagate new PHI into Exit blocks"); + assert (U->getParent() == Exit + && "Need to propagate new PHI into Exit blocks"); assert (isa(U) && "Use in Exit Block that is not PHINode"); PHINode *UPhi = cast(U); @@ -374,10 +378,9 @@ for (BasicBlock::iterator I = Exit->begin(), E = Exit->end(); I != E; ++I) { - if (!isa(I)) - break; - PHINode *PN = dyn_cast(I); + if (!PN) + break; if (PN->getBasicBlockIndex(NewPreHeader) == -1) { Value *V = PN->getIncomingValueForBlock(OrigHeader); @@ -405,7 +408,8 @@ LoopHeaderInfo.clear(); } -/// Return true if this instruction is used outside original header. +/// Return true if this instruction is used by any instructions in the loop that +/// aren't in original header. bool LoopRotate::usedOutsideOriginalHeader(Instruction *In) { for (Value::use_iterator UI = In->use_begin(), UE = In->use_end(); @@ -427,7 +431,7 @@ // Since LoopHeaderInfo is small, linear walk is OK. for (SmallVector::iterator I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) - if ((*I).Original == In) + if (I->Original == In) return &(*I); return NULL; From rspencer at reidspencer.com Mon Apr 9 11:27:08 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 09 Apr 2007 16:27:08 +0000 Subject: [llvm-commits] New llvm-test regressions In-Reply-To: <461A66FB.1070204@jolt-lang.org> References: <461A66FB.1070204@jolt-lang.org> Message-ID: <1176136028.9947.587.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 09:16 -0700, Jeff Cohen wrote: > Changes in the last 24 hours have caused additional failures in > llvm-tests: burg, spiff, lencode, espresso and cdecl. I have been assuming these are a result of the PR1146 changes which require llvm-gcc changes. Is that the issue or something else? > > > > _______________________________________________ > 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 9 11:42:04 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 11:42:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704091642.l39Gg49n007523@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.3 -> 1.4 --- Log message: Fix future bug. Of course, Chris spotted this. Handle Argument or Undef as an incoming PHI value. --- Diffs of the changes: (+12 -11) LoopRotation.cpp | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.3 Mon Apr 9 11:21:29 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 11:41:46 2007 @@ -369,7 +369,6 @@ return true; } - /// Make sure all Exit block PHINodes have required incoming values. /// If incoming value is constant or defined outside the loop then /// PHINode may not have an entry for new pre-header. @@ -382,20 +381,22 @@ if (!PN) break; - if (PN->getBasicBlockIndex(NewPreHeader) == -1) { - Value *V = PN->getIncomingValueForBlock(OrigHeader); - if (isa(V)) - PN->addIncoming(V, NewPreHeader); - else { - RenameData *ILoopHeaderInfo = findReplacementData(cast(V)); - assert (ILoopHeaderInfo && ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction"); - PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader); - } + // There is already one incoming value from new pre-header block. + if (PN->getBasicBlockIndex(NewPreHeader) != -1) + return; + + RenameData *ILoopHeaderInfo; + Value *V = PN->getIncomingValueForBlock(OrigHeader); + if (isa(V) && + (ILoopHeaderInfo = findReplacementData(cast(V)))) { + assert (ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction"); + PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader); + } else { + PN->addIncoming(V, NewPreHeader); } } } - /// Initialize local data void LoopRotate::initialize() { L = NULL; From clattner at apple.com Mon Apr 9 11:57:13 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 09:57:13 -0700 Subject: [llvm-commits] New llvm-test regressions In-Reply-To: <461A66FB.1070204@jolt-lang.org> References: <461A66FB.1070204@jolt-lang.org> Message-ID: <04BCC3E1-BCA6-47AC-BABC-D9D8F7D1C021@apple.com> On Apr 9, 2007, at 9:16 AM, Jeff Cohen wrote: > Changes in the last 24 hours have caused additional failures in > llvm-tests: burg, spiff, lencode, espresso and cdecl. These (and many others) all failed for my tester last night, but seem ok. Make sure to update your llvm-gcc tree. -Chris From dpatel at apple.com Mon Apr 9 12:09:33 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 12:09:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704091709.l39H9XNt008033@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.4 -> 1.5 --- Log message: Simpler for() loops. --- Diffs of the changes: (+17 -23) LoopRotation.cpp | 40 +++++++++++++++++----------------------- 1 files changed, 17 insertions(+), 23 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.4 Mon Apr 9 11:41:46 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 12:09:13 2007 @@ -73,7 +73,7 @@ /// Find Replacement information for instruction. Return NULL if it is /// not available. - RenameData *findReplacementData(Instruction *I); + const RenameData *findReplacementData(Instruction *I); private: @@ -179,13 +179,10 @@ NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), OrigHeader); BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end(); - for (; I != E; ++I) { + PHINode *PN = NULL; + for (; (PN = dyn_cast(I)); ++I) { Instruction *In = I; - PHINode *PN = dyn_cast(I); - if (!PN) - break; - // Create new PHI node with one value incoming from OrigPreHeader. // NewPreHeader has only one predecessor, OrigPreHeader. PHINode *NPH = new PHINode(In->getType(), In->getName()); @@ -235,10 +232,8 @@ // Update new pre-header. // Rename values that are defined in original header to reflects values // defined in new pre-header. - for (SmallVector::iterator - I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { - - const RenameData &ILoopHeaderInfo = *I; + for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) { + const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI]; Instruction *In = ILoopHeaderInfo.Original; Instruction *C = ILoopHeaderInfo.PreHeader; @@ -253,12 +248,12 @@ for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) { if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) { - if (RenameData *D = findReplacementData(OpPhi)) + if (const RenameData *D = findReplacementData(OpPhi)) C->setOperand(opi, D->PreHeader); } else if (Instruction *OpInsn = dyn_cast(In->getOperand(opi))) { - if (RenameData *D = findReplacementData(OpInsn)) + if (const RenameData *D = findReplacementData(OpInsn)) C->setOperand(opi, D->PreHeader); } } @@ -282,10 +277,9 @@ // 2) Inside loop but not in original header // // Replace this use to reflect definition from new header. - for (SmallVector::iterator - I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) { + for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) { + const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI]; - const RenameData &ILoopHeaderInfo = *I; if (!ILoopHeaderInfo.Header) continue; @@ -318,7 +312,7 @@ if (PU->getBasicBlockIndex(NewHeader) != -1 && PU->getIncomingValueForBlock(NewHeader) == U) continue; - + U->replaceUsesOfWith(OldPhi, NewPhi); continue; } @@ -385,7 +379,7 @@ if (PN->getBasicBlockIndex(NewPreHeader) != -1) return; - RenameData *ILoopHeaderInfo; + const RenameData *ILoopHeaderInfo; Value *V = PN->getIncomingValueForBlock(OrigHeader); if (isa(V) && (ILoopHeaderInfo = findReplacementData(cast(V)))) { @@ -427,13 +421,13 @@ /// Find Replacement information for instruction. Return NULL if it is /// not available. -RenameData *LoopRotate::findReplacementData(Instruction *In) { +const RenameData *LoopRotate::findReplacementData(Instruction *In) { // Since LoopHeaderInfo is small, linear walk is OK. - for (SmallVector::iterator - I = LoopHeaderInfo.begin(), E = LoopHeaderInfo.end(); I != E; ++I) - if (I->Original == In) - return &(*I); - + for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) { + const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI]; + if (ILoopHeaderInfo.Original == In) + return &ILoopHeaderInfo; + } return NULL; } From jeffc at jolt-lang.org Mon Apr 9 12:10:08 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 09 Apr 2007 10:10:08 -0700 Subject: [llvm-commits] New llvm-test regressions In-Reply-To: <1176136028.9947.587.camel@bashful.x10sys.com> References: <461A66FB.1070204@jolt-lang.org> <1176136028.9947.587.camel@bashful.x10sys.com> Message-ID: <461A7370.6020305@jolt-lang.org> Reid Spencer wrote: > On Mon, 2007-04-09 at 09:16 -0700, Jeff Cohen wrote: > >> Changes in the last 24 hours have caused additional failures in >> llvm-tests: burg, spiff, lencode, espresso and cdecl. >> > > I have been assuming these are a result of the PR1146 changes which > require llvm-gcc changes. Is that the issue or something else? I don't know. I didn't investigate. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070409/a13e07ee/attachment.html From jeffc at jolt-lang.org Mon Apr 9 12:10:30 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 09 Apr 2007 10:10:30 -0700 Subject: [llvm-commits] New llvm-test regressions In-Reply-To: <04BCC3E1-BCA6-47AC-BABC-D9D8F7D1C021@apple.com> References: <461A66FB.1070204@jolt-lang.org> <04BCC3E1-BCA6-47AC-BABC-D9D8F7D1C021@apple.com> Message-ID: <461A7386.1030402@jolt-lang.org> Chris Lattner wrote: > > On Apr 9, 2007, at 9:16 AM, Jeff Cohen wrote: > >> Changes in the last 24 hours have caused additional failures in >> llvm-tests: burg, spiff, lencode, espresso and cdecl. > > These (and many others) all failed for my tester last night, but seem > ok. Make sure to update your llvm-gcc tree. > > -Chris I did. From clattner at apple.com Mon Apr 9 12:14:15 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:14:15 -0700 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Instructions.cpp Type.cpp In-Reply-To: <200704091501.l39F1VKw005703@zion.cs.uiuc.edu> References: <200704091501.l39F1VKw005703@zion.cs.uiuc.edu> Message-ID: <6BDA543E-1CB8-4DD3-93C2-3E4F3C8458A3@apple.com> The function and callinst dtors need to delete their attributes. -Chris On Apr 9, 2007, at 8:01 AM, Reid Spencer wrote: > > > Changes in directory llvm/lib/VMCore: > > Function.cpp updated: 1.116 -> 1.117 > Instructions.cpp updated: 1.81 -> 1.82 > Type.cpp updated: 1.179 -> 1.180 > --- > Log message: > > For PR1146: http://llvm.org/PR1146 : > * Add ParamAttrList pointers to Function and CallInst. > * Move the implementation of ParamAttrList from Type.cpp to > Function.cpp From clattner at apple.com Mon Apr 9 12:14:39 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:14:39 -0700 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h Instructions.h In-Reply-To: <200704091501.l39F1TjM005694@zion.cs.uiuc.edu> References: <200704091501.l39F1TjM005694@zion.cs.uiuc.edu> Message-ID: > For PR1146: http://llvm.org/PR1146 : > * Add ParamAttrList pointers to Function and CallInst. > * Move the implementation of ParamAttrList from Type.cpp to > Function.cpp Don't forget InvokeInst. -Chris From reid at x10sys.com Mon Apr 9 12:20:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 12:20:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200704091720.l39HKZs7008257@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.180 -> 1.181 --- Log message: Remove a memory leak, until ParamAttrsList is uniqued. --- Diffs of the changes: (+5 -1) Type.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.180 llvm/lib/VMCore/Type.cpp:1.181 --- llvm/lib/VMCore/Type.cpp:1.180 Mon Apr 9 10:01:12 2007 +++ llvm/lib/VMCore/Type.cpp Mon Apr 9 12:20:18 2007 @@ -1098,7 +1098,11 @@ FunctionValType VT(ReturnType, Params, isVarArg, Attrs); FunctionType *MT = FunctionTypes->get(VT); - if (MT) return MT; + if (MT) { + delete Attrs; // not needed any more + return MT; + } + MT = (FunctionType*) new char[sizeof(FunctionType) + sizeof(PATypeHandle)*(Params.size()+1)]; From reid at x10sys.com Mon Apr 9 12:22:46 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Apr 2007 17:22:46 +0000 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Instructions.cpp Type.cpp In-Reply-To: <6BDA543E-1CB8-4DD3-93C2-3E4F3C8458A3@apple.com> References: <200704091501.l39F1VKw005703@zion.cs.uiuc.edu> <6BDA543E-1CB8-4DD3-93C2-3E4F3C8458A3@apple.com> Message-ID: <1176139366.9947.592.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote: > The function and callinst dtors need to delete their attributes. No one is setting these yet so there's no leaks. The next patch will unique the attributes in which case they should *not* be deleted. Use of ParamAttrsList in Function and CallInst won't begin until the uniquing is implemented. Speaking of which, do these need to be refcounted so they go away when the last use disappears? > > -Chris > > On Apr 9, 2007, at 8:01 AM, Reid Spencer wrote: > > > > > > > Changes in directory llvm/lib/VMCore: > > > > Function.cpp updated: 1.116 -> 1.117 > > Instructions.cpp updated: 1.81 -> 1.82 > > Type.cpp updated: 1.179 -> 1.180 > > --- > > Log message: > > > > For PR1146: http://llvm.org/PR1146 : > > * Add ParamAttrList pointers to Function and CallInst. > > * Move the implementation of ParamAttrList from Type.cpp to > > Function.cpp > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070409/3fd7e53c/attachment.bin From clattner at apple.com Mon Apr 9 12:24:52 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:24:52 -0700 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <200704091232.l39CWKJh002598@zion.cs.uiuc.edu> References: <200704091232.l39CWKJh002598@zion.cs.uiuc.edu> Message-ID: > Next stage into switch lowering refactoring > 1. Fix some bugs in the jump table lowering threshold > 2. Implement much better metric for optimal pivot selection > 3. Tune thresholds for different lowering methods > 4. Implement shift-and trick for lowering small ( length) cases with few destinations. Good testcase will follow. Oooh, very cool. > @@ -1484,20 +1593,33 @@ > > uint64_t LSize = FrontCase.size(); > uint64_t RSize = TSize-LSize; > + DOUT << "Selecting best pivot: \n" > + << "First: " << First << ", Last: " << Last <<"\n" > + << "LSize: " << LSize << ", RSize: " << RSize << "\n"; > for (CaseItr I = CR.Range.first, J=I+1, E = CR.Range.second; > J!=E; ++I, ++J) { > int64_t LEnd = cast(I->High)->getSExtValue(); > int64_t RBegin = cast(J->Low)->getSExtValue(); > + assert((RBegin-LEnd>=1) && "Invalid case distance"); > double LDensity = (double)LSize / (double)((LEnd - First) + > 1ULL); > double RDensity = (double)RSize / (double)((Last - RBegin) + > 1ULL); > - if (Density < (LDensity + RDensity)) { > + double Metric = log(RBegin-LEnd)*(LDensity+RDensity); Is there any metric you can use here other than something based on 'log'? Can you do this determination with integer arithmetic? > @@ -1549,6 +1671,130 @@ > return true; > } > > +/// handleBitTestsSwitchCase - if current case range has few > destination and > +/// range span less, than machine word bitwidth, encode case range > into series > +/// of masks and emit bit tests with these masks. > +bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR, > + CaseRecVector& > WorkList, > + Value* SV, > + > MachineBasicBlock* Default) { > + unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); ... > + if (range>IntPtrBits || Using intptr here is a good first step. However, some targets has GPR's wider than intptr_t that are efficient (e.g. a ppc64 chip running in ppc32 mode). Overall, very very nice Anton, -Chris From clattner at apple.com Mon Apr 9 12:27:02 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:27:02 -0700 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Instructions.cpp Type.cpp In-Reply-To: <1176139366.9947.592.camel@bashful.x10sys.com> References: <200704091501.l39F1VKw005703@zion.cs.uiuc.edu> <6BDA543E-1CB8-4DD3-93C2-3E4F3C8458A3@apple.com> <1176139366.9947.592.camel@bashful.x10sys.com> Message-ID: <34D1B076-1BA0-4BF7-AB36-4F8F4E94D513@apple.com> On Apr 9, 2007, at 10:22 AM, Reid Spencer wrote: > On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote: >> The function and callinst dtors need to delete their attributes. > > No one is setting these yet so there's no leaks. I understand. > The next patch will > unique the attributes in which case they should *not* be deleted. Use > of ParamAttrsList in Function and CallInst won't begin until the > uniquing is implemented. Uniquing is tricky in the face of mutation. I'd suggest doing an intermediate increment where you *just* move the attributes to call/ invoke/function without uniquing, then unique them as another step. > Speaking of which, do these need to be refcounted so they go away when > the last use disappears? Yep, that sounds good. -Chris From andrewl at lenharth.org Mon Apr 9 12:31:45 2007 From: andrewl at lenharth.org (Andrew Lenharth) Date: Mon, 9 Apr 2007 12:31:45 -0500 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html In-Reply-To: <200704070144.l371iBHA017663@zion.cs.uiuc.edu> References: <200704070144.l371iBHA017663@zion.cs.uiuc.edu> Message-ID: <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> On 4/6/07, Reid Spencer wrote: > + yet, but you can visit: > + ViewVC and > + Public SVN.

Would it make sense to have svn.llvm.org be an alias to subversion.cs.uiuc.edu and use that as the published host name on various web pages in llvm.org? Andrew From reid at x10sys.com Mon Apr 9 12:28:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Apr 2007 17:28:35 +0000 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h Instructions.h In-Reply-To: References: <200704091501.l39F1TjM005694@zion.cs.uiuc.edu> Message-ID: <1176139715.9947.595.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 10:14 -0700, Chris Lattner wrote: > > For PR1146: http://llvm.org/PR1146 : > > * Add ParamAttrList pointers to Function and CallInst. > > * Move the implementation of ParamAttrList from Type.cpp to > > Function.cpp > > Don't forget InvokeInst. That always bites me. I keep thinking Invoke is a subclass of Call but its a subclass of Terminator. Yet another reason for getting rid of invoke. > > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070409/20114178/attachment.bin From reid at x10sys.com Mon Apr 9 12:36:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 09 Apr 2007 17:36:38 +0000 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html In-Reply-To: <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> References: <200704070144.l371iBHA017663@zion.cs.uiuc.edu> <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> Message-ID: <1176140198.9947.598.camel@bashful.x10sys.com> Hi Andrew, On Mon, 2007-04-09 at 12:31 -0500, Andrew Lenharth wrote: > On 4/6/07, Reid Spencer wrote: > > + yet, but you can visit: > > + ViewVC and > > + Public SVN.

> > Would it make sense to have svn.llvm.org be an alias to > subversion.cs.uiuc.edu and use that as the published host name on > various web pages in llvm.org? Yes, that's the plan. David is looking into the UIUC policy for this. I don't expect a problem since llvm.org already points into uiuc. > > Andrew > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070409/85d56060/attachment.bin From clattner at apple.com Mon Apr 9 12:36:46 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:36:46 -0700 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html In-Reply-To: <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> References: <200704070144.l371iBHA017663@zion.cs.uiuc.edu> <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> Message-ID: On Apr 9, 2007, at 10:31 AM, Andrew Lenharth wrote: > On 4/6/07, Reid Spencer wrote: >> + yet, but you can visit: >> + ViewVC and >> + Public >> SVN.

> > Would it make sense to have svn.llvm.org be an alias to > subversion.cs.uiuc.edu and use that as the published host name on > various web pages in llvm.org? Yes it does, done! -Chris From clattner at apple.com Mon Apr 9 12:37:44 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 10:37:44 -0700 Subject: [llvm-commits] CVS: llvm-www/SVNMigration.html In-Reply-To: <1176140198.9947.598.camel@bashful.x10sys.com> References: <200704070144.l371iBHA017663@zion.cs.uiuc.edu> <85dfcd7f0704091031p13ad164bld88cb40c32f7dad4@mail.gmail.com> <1176140198.9947.598.camel@bashful.x10sys.com> Message-ID: <7D1705FD-D5CC-4080-BFAE-E051CAB9ED14@apple.com> On Apr 9, 2007, at 10:36 AM, Reid Spencer wrote: > Hi Andrew, > > On Mon, 2007-04-09 at 12:31 -0500, Andrew Lenharth wrote: >> On 4/6/07, Reid Spencer wrote: >>> + yet, but you can visit: >>> + ViewVC >>> and >>> + Public >>> SVN.

>> >> Would it make sense to have svn.llvm.org be an alias to >> subversion.cs.uiuc.edu and use that as the published host name on >> various web pages in llvm.org? > > Yes, that's the plan. David is looking into the UIUC policy for > this. I > don't expect a problem since llvm.org already points into uiuc. I already set up the DNS so that svn.llvm.org points to subversion.cs.uiuc.edu. -Chris From reid at x10sys.com Mon Apr 9 13:01:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 13:01:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200704091801.l39I1EIK009001@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.82 -> 1.83 --- Log message: For PR1146: http://llvm.org/PR1146 : * Add ParamAttrs to InvokeInst class too. * Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0 * Destruct the ParamAttrs in Call/Invoke destructors to avoid memory leaks. This will change when ParamAttrsList is uniquified but needs to be correct until then. --- Diffs of the changes: (+6 -0) Instructions.cpp | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.82 llvm/lib/VMCore/Instructions.cpp:1.83 --- llvm/lib/VMCore/Instructions.cpp:1.82 Mon Apr 9 10:01:12 2007 +++ llvm/lib/VMCore/Instructions.cpp Mon Apr 9 13:00:57 2007 @@ -17,6 +17,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/ConstantRange.h" using namespace llvm; @@ -185,6 +186,7 @@ CallInst::~CallInst() { delete [] OperandList; + delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued! } void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { @@ -337,6 +339,7 @@ CallInst::CallInst(const CallInst &CI) : Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()], CI.getNumOperands()) { + ParamAttrs = 0; SubclassData = CI.SubclassData; Use *OL = OperandList; Use *InOL = CI.OperandList; @@ -351,10 +354,12 @@ InvokeInst::~InvokeInst() { delete [] OperandList; + delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued! } void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, Value* const *Args, unsigned NumArgs) { + ParamAttrs = 0; NumOperands = 3+NumArgs; Use *OL = OperandList = new Use[3+NumArgs]; OL[0].init(Fn, this); @@ -402,6 +407,7 @@ InvokeInst::InvokeInst(const InvokeInst &II) : TerminatorInst(II.getType(), Instruction::Invoke, new Use[II.getNumOperands()], II.getNumOperands()) { + ParamAttrs = 0; SubclassData = II.SubclassData; Use *OL = OperandList, *InOL = II.OperandList; for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i) From reid at x10sys.com Mon Apr 9 13:01:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 13:01:17 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200704091801.l39I1Hig009006@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.64 -> 1.65 --- Log message: For PR1146: http://llvm.org/PR1146 : * Add ParamAttrs to InvokeInst class too. * Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0 * Destruct the ParamAttrs in Call/Invoke destructors to avoid memory leaks. This will change when ParamAttrsList is uniquified but needs to be correct until then. --- Diffs of the changes: (+16 -3) Instructions.h | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.64 llvm/include/llvm/Instructions.h:1.65 --- llvm/include/llvm/Instructions.h:1.64 Mon Apr 9 10:01:12 2007 +++ llvm/include/llvm/Instructions.h Mon Apr 9 13:00:57 2007 @@ -737,10 +737,11 @@ SubclassData = (SubclassData & 1) | (CC << 1); } - /// Obtains a constant pointer to the ParamAttrsList object which holds the - /// parameter attributes information, if any. + /// Obtains a pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @returns 0 if no attributes have been set. /// @brief Get the parameter attributes. - const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + ParamAttrsList *getParamAttrs() const { return ParamAttrs; } /// Sets the parameter attributes for this CallInst. To construct a /// ParamAttrsList, see ParameterAttributes.h @@ -1445,6 +1446,7 @@ /// calling convention of the call. /// class InvokeInst : public TerminatorInst { + ParamAttrsList *ParamAttrs; InvokeInst(const InvokeInst &BI); void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, Value* const *Args, unsigned NumArgs); @@ -1466,6 +1468,17 @@ SubclassData = CC; } + /// Obtains a pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @returns 0 if no attributes have been set. + /// @brief Get the parameter attributes. + ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + + /// Sets the parameter attributes for this InvokeInst. To construct a + /// ParamAttrsList, see ParameterAttributes.h + /// @brief Set the parameter attributes. + void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; } + /// getCalledFunction - Return the function called, or null if this is an /// indirect function invocation. /// From scottm at rushg.aero.org Mon Apr 9 13:57:10 2007 From: scottm at rushg.aero.org (Scott Michel) Date: Mon, 9 Apr 2007 11:57:10 -0700 Subject: [llvm-commits] Ignore .svn directories when installing include files Message-ID: <20070409185709.GA21898@rush.aero.org> Speeds up installation a bit... s/b ignoring them anyway, just like CVS directories. -scooter -------------- next part -------------- Index: Makefile.rules =================================================================== --- Makefile.rules (.../trunk) (revision 2452) +++ Makefile.rules (.../branches/llvm-spu) (revision 2452) @@ -1691,7 +1691,7 @@ $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \ cd $(PROJ_SRC_ROOT)/include && \ for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \ - -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \ + -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | grep -v .svn` ; do \ instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ From dpatel at apple.com Mon Apr 9 14:04:38 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 14:04:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704091904.l39J4c6n010332@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.5 -> 1.6 --- Log message: Do not create new pre-header. Reuse original pre-header. --- Diffs of the changes: (+57 -73) LoopRotation.cpp | 130 ++++++++++++++++++++++++------------------------------- 1 files changed, 57 insertions(+), 73 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.5 Mon Apr 9 12:09:13 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 14:04:21 2007 @@ -33,11 +33,11 @@ class VISIBILITY_HIDDEN RenameData { public: - RenameData(Instruction *O, Instruction *P, Instruction *H) + RenameData(Instruction *O, Value *P, Instruction *H) : Original(O), PreHeader(P), Header(H) { } public: Instruction *Original; // Original instruction - Instruction *PreHeader; // New pre-header replacement + Value *PreHeader; // Original pre-header replacement Instruction *Header; // New header replacement }; @@ -65,7 +65,7 @@ /// Make sure all Exit block PHINodes have required incoming values. /// If incoming value is constant or defined outside the loop then - /// PHINode may not have an entry for new pre-header. + /// PHINode may not have an entry for original pre-header. void updateExitBlock(); /// Return true if this instruction is used outside original header. @@ -82,7 +82,6 @@ BasicBlock *OrigPreHeader; BasicBlock *OrigLatch; BasicBlock *NewHeader; - BasicBlock *NewPreHeader; BasicBlock *Exit; SmallVector LoopHeaderInfo; @@ -125,6 +124,9 @@ if (!OrigHeader || !OrigLatch || !OrigPreHeader) return false; + if (!OrigHeader || !OrigLatch || !OrigPreHeader) + return false; + // If loop header is not one of the loop exit block then // either this loop is already rotated or it is not // suitable for loop rotation transformations. @@ -164,42 +166,40 @@ // Now, this loop is suitable for rotation. // Copy PHI nodes and other instructions from original header - // into new pre-header. Unlike original header, new pre-header is - // not a member of loop. New pre-header has only one predecessor, - // that is original loop pre-header. + // into original pre-header. Unlike original header, original pre-header is + // not a member of loop. // // New loop header is one and only successor of original header that // is inside the loop. All other original header successors are outside // the loop. Copy PHI Nodes from original header into new loop header. - // Add second incoming value, from new loop pre-header into these phi + // Add second incoming value, from original loop pre-header into these phi // nodes. If a value defined in original header is used outside original // header then new loop header will need new phi nodes with two incoming // values, one definition from original header and second definition is - // from new loop pre-header (which is a clone of original header definition). + // from original loop pre-header. - NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), OrigHeader); + // Remove terminator from Original pre-header. Original pre-header will + // receive a clone of original header terminator as a new terminator. + OrigPreHeader->getInstList().pop_back(); BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end(); PHINode *PN = NULL; for (; (PN = dyn_cast(I)); ++I) { Instruction *In = I; - // Create new PHI node with one value incoming from OrigPreHeader. - // NewPreHeader has only one predecessor, OrigPreHeader. - PHINode *NPH = new PHINode(In->getType(), In->getName()); - NPH->addIncoming(PN->getIncomingValueForBlock(OrigPreHeader), - OrigPreHeader); - NewPreHeader->getInstList().push_back(NPH); - + // PHI nodes are not copied into original pre-header. Instead their values + // are directly propagated. + Value * NPV = PN->getIncomingValueForBlock(OrigPreHeader); + // Create new PHI node with two incoming values for NewHeader. // One incoming value is from OrigLatch (through OrigHeader) and - // second incoming value is from NewPreHeader. + // second incoming value is from original pre-header. PHINode *NH = new PHINode(In->getType(), In->getName()); NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader); - NH->addIncoming(NPH, NewPreHeader); + NH->addIncoming(NPV, OrigPreHeader); NewHeader->getInstList().push_front(NH); - // "In" can be replaced by NPH or NH at various places. - LoopHeaderInfo.push_back(RenameData(In, NPH, NH)); + // "In" can be replaced by NH at various places. + LoopHeaderInfo.push_back(RenameData(In, NPV, NH)); } // Now, handle non-phi instructions. @@ -207,20 +207,36 @@ Instruction *In = I; assert (!isa(In) && "PHINode is not expected here"); - // This is not a PHI instruction. Insert its clone into NewPreHeader. + // This is not a PHI instruction. Insert its clone into original pre-header. // 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->setName(In->getName()); - NewPreHeader->getInstList().push_back(C); - + OrigPreHeader->getInstList().push_back(C); + + for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) { + if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) { + if (const RenameData *D = findReplacementData(OpPhi)) { + // This is using values from original header PHI node. + // Here, directly used incoming value from original pre-header. + C->setOperand(opi, D->PreHeader); + } + } + else if (Instruction *OpInsn = + dyn_cast(In->getOperand(opi))) { + if (const RenameData *D = findReplacementData(OpInsn)) + C->setOperand(opi, D->PreHeader); + } + } + + // If this instruction is used outside this basic block then // create new PHINode for this instruction. Instruction *NewHeaderReplacement = NULL; if (usedOutsideOriginalHeader(In)) { PHINode *PN = new PHINode(In->getType(), In->getName()); PN->addIncoming(In, OrigHeader); - PN->addIncoming(C, NewPreHeader); + PN->addIncoming(C, OrigPreHeader); NewHeader->getInstList().push_front(PN); NewHeaderReplacement = PN; } @@ -229,38 +245,8 @@ LoopHeaderInfo.push_back(RenameData(In, C, NewHeaderReplacement)); } - // Update new pre-header. - // Rename values that are defined in original header to reflects values - // defined in new pre-header. - for(unsigned LHI = 0, LHI_E = LoopHeaderInfo.size(); LHI != LHI_E; ++LHI) { - const RenameData &ILoopHeaderInfo = LoopHeaderInfo[LHI]; - Instruction *In = ILoopHeaderInfo.Original; - Instruction *C = ILoopHeaderInfo.PreHeader; - - // If this instruction is not from new pre-header then is not new - // pre-header then this instruction is not handled here. - if (C->getParent() != NewPreHeader) - continue; - - // PHINodes uses value from pre-header predecessors. - if (isa(In)) - continue; - - for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) { - if (Instruction *OpPhi = dyn_cast(In->getOperand(opi))) { - if (const RenameData *D = findReplacementData(OpPhi)) - C->setOperand(opi, D->PreHeader); - } - else if (Instruction *OpInsn = - dyn_cast(In->getOperand(opi))) { - if (const RenameData *D = findReplacementData(OpInsn)) - C->setOperand(opi, D->PreHeader); - } - } - } - // Rename uses of original header instructions to reflect their new - // definitions (either from new pre-header node or from newly created + // definitions (either from original pre-header node or from newly created // new header PHINodes. // // Original header instructions are used in @@ -268,7 +254,7 @@ // // If instruction is used in non-phi instructions then it is using // defintion from original heder iteself. Do not replace this use - // with definition from new header or new pre-header. + // with definition from new header or original pre-header. // // If instruction is used in phi node then it is an incoming // value. Rename its use to reflect new definition from new-preheader @@ -334,7 +320,7 @@ // UPhi already has one incoming argument from original header. // Add second incoming argument from new Pre header. - UPhi->addIncoming(ILoopHeaderInfo.PreHeader, NewPreHeader); + UPhi->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader); } } @@ -345,16 +331,15 @@ // Removing incoming branch from loop preheader to original header. // Now original header is inside the loop. - OrigHeader->removePredecessor(OrigPreHeader); + for (BasicBlock::iterator I = OrigHeader->begin(), E = OrigHeader->end(); + I != E; ++I) { + Instruction *In = I; + PHINode *PN = dyn_cast(In); + if (!PN) + break; - // Establish NewPreHeader as loop preheader. Add unconditional branch - // from original loop pre-header to new loop pre-header. Add NewPreHEader - // in loop nest. - BranchInst *PH_BI = cast(OrigPreHeader->getTerminator()); - PH_BI->setSuccessor(0, NewPreHeader); - LoopInfo &LI = LPM.getAnalysis(); - if (Loop *PL = LI.getLoopFor(OrigPreHeader)) - PL->addBasicBlockToLoop(NewPreHeader, LI); + PN->removeIncomingValue(OrigPreHeader); + } // Make NewHeader as the new header for the loop. L->moveToHeader(NewHeader); @@ -365,7 +350,7 @@ /// Make sure all Exit block PHINodes have required incoming values. /// If incoming value is constant or defined outside the loop then -/// PHINode may not have an entry for new pre-header. +/// PHINode may not have an entry for original pre-header. void LoopRotate::updateExitBlock() { for (BasicBlock::iterator I = Exit->begin(), E = Exit->end(); @@ -375,8 +360,8 @@ if (!PN) break; - // There is already one incoming value from new pre-header block. - if (PN->getBasicBlockIndex(NewPreHeader) != -1) + // There is already one incoming value from original pre-header block. + if (PN->getBasicBlockIndex(OrigPreHeader) != -1) return; const RenameData *ILoopHeaderInfo; @@ -384,9 +369,9 @@ if (isa(V) && (ILoopHeaderInfo = findReplacementData(cast(V)))) { assert (ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction"); - PN->addIncoming(ILoopHeaderInfo->PreHeader, NewPreHeader); + PN->addIncoming(ILoopHeaderInfo->PreHeader, OrigPreHeader); } else { - PN->addIncoming(V, NewPreHeader); + PN->addIncoming(V, OrigPreHeader); } } } @@ -397,7 +382,6 @@ OrigHeader = NULL; OrigPreHeader = NULL; NewHeader = NULL; - NewPreHeader = NULL; Exit = NULL; LoopHeaderInfo.clear(); From reid at x10sys.com Mon Apr 9 14:09:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 14:09:16 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200704091909.l39J9Ghx010442@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.429 -> 1.430 --- Log message: Speed up installation a bit by ignoring .svn directories. Patch by Scott Michel. --- Diffs of the changes: (+2 -1) Makefile.rules | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.429 llvm/Makefile.rules:1.430 --- llvm/Makefile.rules:1.429 Thu Mar 29 14:05:44 2007 +++ llvm/Makefile.rules Mon Apr 9 14:08:58 2007 @@ -1691,7 +1691,8 @@ $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \ cd $(PROJ_SRC_ROOT)/include && \ for hdr in `find . -type f '!' '(' -name '*~' -o -name '.cvsignore' \ - -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS ` ; do \ + -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \ + grep -v .svn` ; do \ instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ From rspencer at reidspencer.com Mon Apr 9 14:09:28 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 09 Apr 2007 19:09:28 +0000 Subject: [llvm-commits] Ignore .svn directories when installing include files In-Reply-To: <20070409185709.GA21898@rush.aero.org> References: <20070409185709.GA21898@rush.aero.org> Message-ID: <1176145768.9947.604.camel@bashful.x10sys.com> Committed. Thanks. Watch those line lengths :) Reid. On Mon, 2007-04-09 at 11:57 -0700, Scott Michel wrote: > Speeds up installation a bit... s/b ignoring them anyway, just like > CVS directories. > > > -scooter > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Mon Apr 9 14:18:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 14:18:04 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile Message-ID: <200704091918.l39JI4Ui010642@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.6 -> 1.7 --- Log message: Don't link against System or Support library. These things will already be in the opt tool. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.6 llvm/lib/Transforms/Hello/Makefile:1.7 --- llvm/lib/Transforms/Hello/Makefile:1.6 Mon Aug 7 18:12:15 2006 +++ llvm/lib/Transforms/Hello/Makefile Mon Apr 9 14:17:47 2007 @@ -10,7 +10,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMHello LOADABLE_MODULE = 1 -USEDLIBS = LLVMSupport.a LLVMSystem.a +USEDLIBS = include $(LEVEL)/Makefile.common From dpatel at apple.com Mon Apr 9 15:20:03 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 15:20:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704092020.l39KK3pW011749@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.6 -> 1.7 --- Log message: Preserve canonical loop form. --- Diffs of the changes: (+55 -5) LoopRotation.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 55 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.6 Mon Apr 9 14:04:21 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 15:19:46 2007 @@ -75,6 +75,11 @@ /// not available. const RenameData *findReplacementData(Instruction *I); + /// After loop rotation, loop pre-header has multiple sucessors. + /// Insert one forwarding basic block to ensure that loop pre-header + /// has only one successor. + void preserveCanonicalLoopForm(LPPassManager &LPM); + private: Loop *L; @@ -121,11 +126,8 @@ if (L->getBlocks().size() == 1) return false; - if (!OrigHeader || !OrigLatch || !OrigPreHeader) - return false; - - if (!OrigHeader || !OrigLatch || !OrigPreHeader) - return false; + assert (OrigHeader && OrigLatch && OrigPreHeader && + "Loop is not in cannocial form"); // If loop header is not one of the loop exit block then // either this loop is already rotated or it is not @@ -344,6 +346,8 @@ // Make NewHeader as the new header for the loop. L->moveToHeader(NewHeader); + preserveCanonicalLoopForm(LPM); + NumRotated++; return true; } @@ -415,3 +419,49 @@ } return NULL; } + +/// After loop rotation, loop pre-header has multiple sucessors. +/// Insert one forwarding basic block to ensure that loop pre-header +/// has only one successor. +void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) { + + // Right now original pre-header has two successors, new header and + // exit block. Insert new block between original pre-header and + // new header such that loop's new pre-header has only one successor. + BasicBlock *NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), + OrigPreHeader); + LoopInfo &LI = LPM.getAnalysis(); + if (Loop *PL = LI.getLoopFor(OrigPreHeader)) + PL->addBasicBlockToLoop(NewPreHeader, LI); + new BranchInst(NewHeader, NewPreHeader); + + BranchInst *OrigPH_BI = cast(OrigPreHeader->getTerminator()); + if (OrigPH_BI->getSuccessor(0) == NewHeader) + OrigPH_BI->setSuccessor(0, NewPreHeader); + else { + assert (OrigPH_BI->getSuccessor(1) == NewPreHeader && + "Unexpected original pre-header terminator"); + OrigPH_BI->setSuccessor(1, NewPreHeader); + } + + for (BasicBlock::iterator I = NewHeader->begin(), E = NewHeader->end(); + I != E; ++I) { + Instruction *In = I; + PHINode *PN = dyn_cast(In); + if (!PN) + break; + + int index = PN->getBasicBlockIndex(OrigPreHeader); + assert (index != -1 && "Expected incoming value from Original PreHeader"); + PN->setIncomingBlock(index, NewPreHeader); + assert (PN->getBasicBlockIndex(OrigPreHeader) == -1 && + "Expected only one incoming value from Original PreHeader"); + } + + assert (NewHeader && L->getHeader() == NewHeader + && "Invalid loop header after loop rotation"); + assert (NewPreHeader && L->getLoopPreheader() == NewPreHeader + && "Invalid loop preheader after loop rotation"); + assert (L->getLoopLatch() + && "Invalid loop latch after loop rotation"); +} From criswell at cs.uiuc.edu Mon Apr 9 15:20:25 2007 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 9 Apr 2007 15:20:25 -0500 Subject: [llvm-commits] [see] CVS: llvm-poolalloc/lib/DSA/Local.cpp Message-ID: <200704092020.l39KKP0E011765@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: Local.cpp updated: 1.158.2.4.2.8 -> 1.158.2.4.2.9 --- Log message: Reversed the order of metapools when merging. This ensures that the object on which we call the merge() method is never NULL. --- Diffs of the changes: (+1 -1) Local.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.8 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.9 --- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.8 Tue Mar 13 20:24:01 2007 +++ llvm-poolalloc/lib/DSA/Local.cpp Mon Apr 9 15:20:07 2007 @@ -1466,7 +1466,7 @@ if (L.getPool() != N.getPool()) { std::cerr << "kmem_cache_alloc recovered merge\n"; MetaPoolHandle L(locs[V]), N(DSH.getNode()->getMP()); - locs[V]->merge(DSH.getNode()->getMP()); + DSH.getNode()->getMP()->merge(locs[V]); } locs[V] = DSH.getNode()->getMP(); } From sabre at nondot.org Mon Apr 9 15:28:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 15:28:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200704092028.l39KSwJf011917@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.246 -> 1.247 --- Log message: Fix a bug where calling materializeModule could corrupt the module, reading multiple copies of the function into the Function*. --- Diffs of the changes: (+8 -9) Reader.cpp | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.246 llvm/lib/Bytecode/Reader/Reader.cpp:1.247 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.246 Mon Apr 9 01:14:31 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Apr 9 15:28:40 2007 @@ -1672,15 +1672,14 @@ return true; } - LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.begin(); - LazyFunctionMap::iterator Fe = LazyFunctionLoadMap.end(); - - while (Fi != Fe) { - Function* Func = Fi->first; - BlockStart = At = Fi->second.Buf; - BlockEnd = Fi->second.EndBuf; - ParseFunctionBody(Func); - ++Fi; + for (LazyFunctionMap::iterator I = LazyFunctionLoadMap.begin(), + E = LazyFunctionLoadMap.end(); I != E; ++I) { + Function *Func = I->first; + if (Func->hasNotBeenReadFromBytecode()) { + BlockStart = At = I->second.Buf; + BlockEnd = I->second.EndBuf; + ParseFunctionBody(Func); + } } return false; } From sabre at nondot.org Mon Apr 9 16:18:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 16:18:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200704092118.l39LIpf1013244@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.119 -> 1.120 --- Log message: add a default ctor for AddrMode. --- Diffs of the changes: (+1 -0) TargetLowering.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.119 llvm/include/llvm/Target/TargetLowering.h:1.120 --- llvm/include/llvm/Target/TargetLowering.h:1.119 Fri Mar 30 23:05:24 2007 +++ llvm/include/llvm/Target/TargetLowering.h Mon Apr 9 16:18:34 2007 @@ -872,6 +872,7 @@ int64_t BaseOffs; bool HasBaseReg; int64_t Scale; + AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {} }; /// isLegalAddressingMode - Return true if the addressing mode represented by From dpatel at apple.com Mon Apr 9 16:41:00 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 16:41:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704092141.l39Lf0gh013846@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.7 -> 1.8 --- Log message: Insert new pre-header before new header. Original pre-header may happen to be an entry, in such case, it is not a good idea to insert new block before entry. Also fix typo in assertion check. --- Diffs of the changes: (+2 -2) LoopRotation.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.7 Mon Apr 9 15:19:46 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 16:40:43 2007 @@ -429,7 +429,7 @@ // exit block. Insert new block between original pre-header and // new header such that loop's new pre-header has only one successor. BasicBlock *NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(), - OrigPreHeader); + NewHeader); LoopInfo &LI = LPM.getAnalysis(); if (Loop *PL = LI.getLoopFor(OrigPreHeader)) PL->addBasicBlockToLoop(NewPreHeader, LI); @@ -439,7 +439,7 @@ if (OrigPH_BI->getSuccessor(0) == NewHeader) OrigPH_BI->setSuccessor(0, NewPreHeader); else { - assert (OrigPH_BI->getSuccessor(1) == NewPreHeader && + assert (OrigPH_BI->getSuccessor(1) == NewHeader && "Unexpected original pre-header terminator"); OrigPH_BI->setSuccessor(1, NewPreHeader); } From asl at math.spbu.ru Mon Apr 9 16:57:21 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Mon, 9 Apr 2007 16:57:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704092157.l39LvLaS014229@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.411 -> 1.412 --- Log message: Use integer log for metric calculation --- Diffs of the changes: (+2 -2) SelectionDAGISel.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.411 Mon Apr 9 09:32:59 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 16:57:03 2007 @@ -1604,7 +1604,7 @@ assert((RBegin-LEnd>=1) && "Invalid case distance"); double LDensity = (double)LSize / (double)((LEnd - First) + 1ULL); double RDensity = (double)RSize / (double)((Last - RBegin) + 1ULL); - double Metric = log(double(RBegin-LEnd))*(LDensity+RDensity); + double Metric = Log2_64(RBegin-LEnd)*(LDensity+RDensity); // Should always split in some non-trivial place DOUT <<"=>Step\n" << "LEnd: " << LEnd << ", RBegin: " << RBegin << "\n" @@ -1620,7 +1620,7 @@ RSize -= J->size(); } // If our case is dense we *really* should handle it earlier! - assert((FMetric != 0) && "Should handle dense range earlier!"); + assert((FMetric > 0) && "Should handle dense range earlier!"); CaseRange LHSR(CR.Range.first, Pivot); CaseRange RHSR(Pivot, CR.Range.second); From sabre at nondot.org Mon Apr 9 17:10:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:10:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200704092210.l39MAMMM014511@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.268 -> 1.269 --- Log message: Fix a bug in PPCTargetLowering::isLegalAddressingMode, scales other than 0/1/2 are always unsupported. --- Diffs of the changes: (+3 -0) PPCISelLowering.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.268 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.268 Tue Apr 3 08:59:52 2007 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Apr 9 17:10:05 2007 @@ -3389,6 +3389,9 @@ return false; // Allow 2*r as r+r. break; + default: + // No other scales are supported. + return false; } return true; From dpatel at apple.com Mon Apr 9 17:20:32 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 17:20:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopRotation.cpp Message-ID: <200704092220.l39MKWKj014802@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopRotation.cpp updated: 1.8 -> 1.9 --- Log message: Check _all_ PHINodes. --- Diffs of the changes: (+1 -1) LoopRotation.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopRotation.cpp diff -u llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8 llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.9 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp:1.8 Mon Apr 9 16:40:43 2007 +++ llvm/lib/Transforms/Scalar/LoopRotation.cpp Mon Apr 9 17:20:10 2007 @@ -366,7 +366,7 @@ // There is already one incoming value from original pre-header block. if (PN->getBasicBlockIndex(OrigPreHeader) != -1) - return; + continue; const RenameData *ILoopHeaderInfo; Value *V = PN->getIncomingValueForBlock(OrigHeader); From sabre at nondot.org Mon Apr 9 17:20:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:20:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200704092220.l39MKZOC014807@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.127 -> 1.128 --- Log message: switch LSR to use isLegalAddressingMode instead of other simpler hooks --- Diffs of the changes: (+21 -18) LoopStrengthReduce.cpp | 39 +++++++++++++++++++++------------------ 1 files changed, 21 insertions(+), 18 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.127 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.127 Sat Apr 7 02:17:27 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Apr 9 17:20:14 2007 @@ -143,8 +143,7 @@ const TargetLowering *TLI; public: - LoopStrengthReduce(const TargetLowering *tli = NULL) - : TLI(tli) { + LoopStrengthReduce(const TargetLowering *tli = NULL) : TLI(tli) { } bool runOnLoop(Loop *L, LPPassManager &LPM); @@ -631,20 +630,25 @@ const TargetLowering *TLI) { if (SCEVConstant *SC = dyn_cast(V)) { int64_t VC = SC->getValue()->getSExtValue(); - if (TLI) - return TLI->isLegalAddressImmediate(VC, UseTy); - else + if (TLI) { + TargetLowering::AddrMode AM; + AM.BaseOffs = VC; + return TLI->isLegalAddressingMode(AM, UseTy); + } else { // Defaults to PPC. PPC allows a sign-extended 16-bit immediate field. return (VC > -(1 << 16) && VC < (1 << 16)-1); + } } if (SCEVUnknown *SU = dyn_cast(V)) if (ConstantExpr *CE = dyn_cast(SU->getValue())) - if (CE->getOpcode() == Instruction::PtrToInt) { + if (TLI && CE->getOpcode() == Instruction::PtrToInt) { Constant *Op0 = CE->getOperand(0); - if (isa(Op0) && TLI && - TLI->isLegalAddressImmediate(cast(Op0))) - return true; + if (GlobalValue *GV = dyn_cast(Op0)) { + TargetLowering::AddrMode AM; + AM.BaseGV = GV; + return TLI->isLegalAddressingMode(AM, UseTy); + } } return false; } @@ -889,18 +893,11 @@ } /// ValidStride - Check whether the given Scale is valid for all loads and -/// stores in UsersToProcess. Pulled into a function to avoid disturbing the -/// sensibilities of those who dislike goto's. +/// stores in UsersToProcess. /// bool LoopStrengthReduce::ValidStride(int64_t Scale, const std::vector& UsersToProcess) { - int64_t Imm; for (unsigned i=0, e = UsersToProcess.size(); i!=e; ++i) { - if (SCEVConstant *SC = dyn_cast(UsersToProcess[i].Imm)) - Imm = SC->getValue()->getSExtValue(); - else - Imm = 0; - // If this is a load or other access, pass the type of the access in. const Type *AccessTy = Type::VoidTy; if (StoreInst *SI = dyn_cast(UsersToProcess[i].Inst)) @@ -908,7 +905,13 @@ else if (LoadInst *LI = dyn_cast(UsersToProcess[i].Inst)) AccessTy = LI->getType(); - if (!TLI->isLegalAddressScaleAndImm(Scale, Imm, AccessTy)) + TargetLowering::AddrMode AM; + if (SCEVConstant *SC = dyn_cast(UsersToProcess[i].Imm)) + AM.BaseOffs = SC->getValue()->getSExtValue(); + AM.Scale = Scale; + + // If load[imm+r*scale] is illegal, bail out. + if (!TLI->isLegalAddressingMode(AM, AccessTy)) return false; } return true; From dpatel at apple.com Mon Apr 9 17:22:59 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 17:22:59 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/LRCrash-1.ll LRCrash-2.ll LRCrash-3.ll LRCrash-4.ll PhiRename-1.ll PhiSelfRefernce-1.ll dg.exp Message-ID: <200704092222.l39MMxMe014884@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopRotate: LRCrash-1.ll added (r1.1) LRCrash-2.ll added (r1.1) LRCrash-3.ll added (r1.1) LRCrash-4.ll added (r1.1) PhiRename-1.ll added (r1.1) PhiSelfRefernce-1.ll added (r1.1) dg.exp added (r1.1) --- Log message: Add Loop Rotate test cases. --- Diffs of the changes: (+256 -0) LRCrash-1.ll | 27 ++++++++++++++ LRCrash-2.ll | 30 ++++++++++++++++ LRCrash-3.ll | 41 ++++++++++++++++++++++ LRCrash-4.ll | 20 ++++++++++ PhiRename-1.ll | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ PhiSelfRefernce-1.ll | 41 ++++++++++++++++++++++ dg.exp | 3 + 7 files changed, 256 insertions(+) Index: llvm/test/Transforms/LoopRotate/LRCrash-1.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-1.ll:1.1 *** /dev/null Mon Apr 9 17:22:52 2007 --- llvm/test/Transforms/LoopRotate/LRCrash-1.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,27 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output + + + %struct.relation = type { [4 x i16], i32, [4 x i16], i32, i32 } + + + + + + + void @findAllPairs() { + entry: + br i1 false, label %bb139, label %bb10.i44 + + bb10.i44: ; preds = %entry + ret void + + bb127: ; preds = %bb139 + br label %bb139 + + bb139: ; preds = %bb127, %entry + br i1 false, label %bb127, label %bb142 + + bb142: ; preds = %bb139 + %r91.0.lcssa = phi %struct.relation* [ null, %bb139 ] ; <%struct.relation*> [#uses=0] + ret void + } Index: llvm/test/Transforms/LoopRotate/LRCrash-2.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-2.ll:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/LRCrash-2.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,30 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output + + void @findAllPairs() { + entry: + br i1 false, label %bb139, label %cond_true + + cond_true: ; preds = %entry + ret void + + bb90: ; preds = %bb139 + br i1 false, label %bb136, label %cond_next121 + + cond_next121: ; preds = %bb90 + br i1 false, label %bb136, label %bb127 + + bb127: ; preds = %cond_next121 + br label %bb136 + + bb136: ; preds = %bb127, %cond_next121, %bb90 + %changes.1 = phi i32 [ %changes.2, %bb90 ], [ %changes.2, %cond_next121 ], [ 1, %bb127 ] ; [#uses=1] + br label %bb139 + + bb139: ; preds = %bb136, %entry + %changes.2 = phi i32 [ %changes.1, %bb136 ], [ 0, %entry ] ; [#uses=3] + br i1 false, label %bb90, label %bb142 + + bb142: ; preds = %bb139 + %changes.2.lcssa = phi i32 [ %changes.2, %bb139 ] ; [#uses=0] + ret void + } Index: llvm/test/Transforms/LoopRotate/LRCrash-3.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-3.ll:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/LRCrash-3.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,41 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output + + + + + void @_ZN9Classfile4readEv() { + entry: + br i1 false, label %cond_false485, label %bb405 + + bb405: ; preds = %entry + ret void + + cond_false485: ; preds = %entry + br label %bb830 + + bb511: ; preds = %bb830 + br i1 false, label %bb816, label %bb830 + + cond_next667: ; preds = %bb816 + br i1 false, label %cond_next695, label %bb680 + + bb676: ; preds = %bb680 + br label %bb680 + + bb680: ; preds = %bb676, %cond_next667 + %iftmp.68.0 = zext i1 false to i8 ; [#uses=1] + br i1 false, label %bb676, label %cond_next695 + + cond_next695: ; preds = %bb680, %cond_next667 + %iftmp.68.2 = phi i8 [ %iftmp.68.0, %bb680 ], [ undef, %cond_next667 ] ; [#uses=0] + ret void + + bb816: ; preds = %bb816, %bb511 + br i1 false, label %cond_next667, label %bb816 + + bb830: ; preds = %bb511, %cond_false485 + br i1 false, label %bb511, label %bb835 + + bb835: ; preds = %bb830 + ret void + } Index: llvm/test/Transforms/LoopRotate/LRCrash-4.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/LRCrash-4.ll:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/LRCrash-4.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,20 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-rotate -disable-output + + + void @InterpretSEIMessage(i8* %msg) { + entry: + br label %bb15 + + bb6: ; preds = %bb15 + %tmp11 = getelementptr i8* %msg, i32 %offset.1 ; [#uses=0] + br label %bb15 + + bb15: ; preds = %bb6, %entry + %offset.1 = add i32 0, 1 ; [#uses=2] + br i1 false, label %bb6, label %bb17 + + bb17: ; preds = %bb15 + %offset.1.lcssa = phi i32 [ %offset.1, %bb15 ] ; [#uses=0] + %payload_type.1.lcssa = phi i32 [ 0, %bb15 ] ; [#uses=0] + ret void + } Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/PhiRename-1.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,94 ---- + ; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" + 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" + + %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } + %struct.Index_Map = type { i32, %struct.item_set** } + %struct.Item = type { [4 x i16], %struct.rule* } + %struct.__sFILEX = type opaque + %struct.__sbuf = type { i8*, i32 } + %struct.dimension = type { i16*, %struct.Index_Map, %struct.mapping*, i32, %struct.plankMap* } + %struct.item_set = type { i32, i32, %struct.operator*, [2 x %struct.item_set*], %struct.item_set*, i16*, %struct.Item*, %struct.Item* } + %struct.list = type { i8*, %struct.list* } + %struct.mapping = type { %struct.list**, i32, i32, i32, %struct.item_set** } + %struct.nonterminal = type { i8*, i32, i32, i32, %struct.plankMap*, %struct.rule* } + %struct.operator = type { i8*, i8, i32, i32, i32, i32, %struct.table* } + %struct.pattern = type { %struct.nonterminal*, %struct.operator*, [2 x %struct.nonterminal*] } + %struct.plank = type { i8*, %struct.list*, i32 } + %struct.plankMap = type { %struct.list*, i32, %struct.stateMap* } + %struct.rule = type { [4 x i16], i32, i32, i32, %struct.nonterminal*, %struct.pattern*, i8 } + %struct.stateMap = type { i8*, %struct.plank*, i32, i16* } + %struct.table = type { %struct.operator*, %struct.list*, i16*, [2 x %struct.dimension*], %struct.item_set** } + @outfile = external global %struct.FILE* ; <%struct.FILE**> [#uses=1] + @str1 = external constant [11 x i8] ; <[11 x i8]*> [#uses=1] + @operators = weak global %struct.list* null ; <%struct.list**> [#uses=1] + + + + define i32 @opsOfArity(i32 %arity) { + entry: + %arity_addr = alloca i32 ; [#uses=2] + %retval = alloca i32, align 4 ; [#uses=2] + %tmp = alloca i32, align 4 ; [#uses=2] + %c = alloca i32, align 4 ; [#uses=4] + %l = alloca %struct.list*, align 4 ; <%struct.list**> [#uses=5] + %op = alloca %struct.operator*, align 4 ; <%struct.operator**> [#uses=3] + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %arity, i32* %arity_addr + store i32 0, i32* %c + %tmp1 = load %struct.list** @operators ; <%struct.list*> [#uses=1] + store %struct.list* %tmp1, %struct.list** %l + br label %bb21 + + bb: ; preds = %bb21 + %tmp3 = getelementptr %struct.list* %tmp22, i32 0, i32 0 ; [#uses=1] + %tmp4 = load i8** %tmp3 ; [#uses=1] + %tmp45 = bitcast i8* %tmp4 to %struct.operator* ; <%struct.operator*> [#uses=1] + store %struct.operator* %tmp45, %struct.operator** %op + %tmp6 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp7 = getelementptr %struct.operator* %tmp6, i32 0, i32 5 ; [#uses=1] + %tmp8 = load i32* %tmp7 ; [#uses=1] + %tmp9 = load i32* %arity_addr ; [#uses=1] + icmp eq i32 %tmp8, %tmp9 ; :0 [#uses=1] + zext i1 %0 to i8 ; :1 [#uses=1] + icmp ne i8 %1, 0 ; :2 [#uses=1] + br i1 %2, label %cond_true, label %cond_next + + cond_true: ; preds = %bb + %tmp10 = load %struct.operator** %op ; <%struct.operator*> [#uses=1] + %tmp11 = getelementptr %struct.operator* %tmp10, i32 0, i32 2 ; [#uses=1] + %tmp12 = load i32* %tmp11 ; [#uses=1] + %tmp13 = load %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1] + %tmp14 = getelementptr [11 x i8]* @str1, i32 0, i32 0 ; [#uses=1] + %tmp15 = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; [#uses=0] + %tmp16 = load i32* %c ; [#uses=1] + %tmp17 = add i32 %tmp16, 1 ; [#uses=1] + store i32 %tmp17, i32* %c + br label %cond_next + + cond_next: ; preds = %cond_true, %bb + %tmp19 = getelementptr %struct.list* %tmp22, i32 0, i32 1 ; <%struct.list**> [#uses=1] + %tmp20 = load %struct.list** %tmp19 ; <%struct.list*> [#uses=1] + store %struct.list* %tmp20, %struct.list** %l + br label %bb21 + + bb21: ; preds = %cond_next, %entry + %l.in = phi %struct.list** [ @operators, %entry ], [ %tmp19, %cond_next ] ; + %tmp22 = load %struct.list** %l.in ; <%struct.list*> [#uses=1] + icmp ne %struct.list* %tmp22, null ; :3 [#uses=1] + zext i1 %3 to i8 ; :4 [#uses=1] + icmp ne i8 %4, 0 ; :5 [#uses=1] + br i1 %5, label %bb, label %bb23 + + bb23: ; preds = %bb21 + %tmp24 = load i32* %c ; [#uses=1] + store i32 %tmp24, i32* %tmp + %tmp25 = load i32* %tmp ; [#uses=1] + store i32 %tmp25, i32* %retval + br label %return + + return: ; preds = %bb23 + %retval26 = load i32* %retval ; [#uses=1] + ret i32 %retval26 + } + + declare i32 @fprintf(%struct.FILE*, i8*, ...) Index: llvm/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/PhiSelfRefernce-1.ll Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,41 ---- + ; RUN: llvm-as < %s | opt -loop-rotate -disable-output + ; ModuleID = 'PhiSelfRefernce-1.bc' + + implementation ; Functions: + + define void @snrm2(i32 %incx) { + entry: + br i1 false, label %START, label %return + + START: ; preds = %entry + br i1 false, label %bb85, label %cond_false93 + + bb52: ; preds = %bb85 + br i1 false, label %bb307, label %cond_next71 + + cond_next71: ; preds = %bb52 + ret void + + bb85: ; preds = %START + br i1 false, label %bb52, label %bb88 + + bb88: ; preds = %bb85 + ret void + + cond_false93: ; preds = %START + ret void + + bb243: ; preds = %bb307 + br label %bb307 + + bb307: ; preds = %bb243, %bb52 + %sx_addr.2.pn = phi float* [ %sx_addr.5, %bb243 ], [ null, %bb52 ] ; [#uses=1] + %sx_addr.5 = getelementptr float* %sx_addr.2.pn, i32 %incx ; [#uses=1] + br i1 false, label %bb243, label %bb310 + + bb310: ; preds = %bb307 + ret void + + return: ; preds = %entry + ret void + } Index: llvm/test/Transforms/LoopRotate/dg.exp diff -c /dev/null llvm/test/Transforms/LoopRotate/dg.exp:1.1 *** /dev/null Mon Apr 9 17:22:59 2007 --- llvm/test/Transforms/LoopRotate/dg.exp Mon Apr 9 17:22:42 2007 *************** *** 0 **** --- 1,3 ---- + load_lib llvm-dg.exp + + llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] $objdir $srcdir $subdir $target_triplet $llvmgcc $llvmgxx $prcontext $llvmgcc_version From resistor at mac.com Mon Apr 9 17:25:26 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 9 Apr 2007 17:25:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704092225.l39MPQq3015003@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.85 -> 1.86 --- Log message: Improve some _slow_ behavior introduced in my patches the last few days. --- Diffs of the changes: (+42 -42) LoopSimplify.cpp | 84 +++++++++++++++++++++++++++---------------------------- 1 files changed, 42 insertions(+), 42 deletions(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.85 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.85 Sun Apr 8 19:52:49 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Mon Apr 9 17:25:09 2007 @@ -673,6 +673,16 @@ UpdateDomInfoForRevectoredPreds(BEBlock, BackedgeBlocks); } +// Returns true if BasicBlock A dominates at least one block in vector B +// Helper function for UpdateDomInfoForRevectoredPreds +static bool BlockDominatesAny(BasicBlock* A, std::vector& B, ETForest& ETF) { + for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { + if (ETF.dominates(A, *BI)) + return true; + } + return false; +} + /// UpdateDomInfoForRevectoredPreds - This method is used to update the four /// different kinds of dominator information (immediate dominators, /// dominator trees, et-forest and dominance frontiers) after a new block has @@ -841,47 +851,37 @@ // blocks that dominate a block in PredBlocks and contained NewBBSucc in // their dominance frontier must be updated to contain NewBB instead. // - for (unsigned i = 0, e = PredBlocks.size(); i != e; ++i) { - BasicBlock *Pred = PredBlocks[i]; - // Get all of the dominators of the predecessor... - // FIXME: There's probably a better way to do this... - std::vector PredDoms; - for (Function::iterator I = Pred->getParent()->begin(), - E = Pred->getParent()->end(); I != E; ++I) - if (ETF.dominates(&(*I), Pred)) - PredDoms.push_back(I); - - for (std::vector::const_iterator PDI = PredDoms.begin(), - PDE = PredDoms.end(); PDI != PDE; ++PDI) { - BasicBlock *PredDom = *PDI; - - // If the NewBBSucc node is in DF(PredDom), then PredDom didn't - // dominate NewBBSucc but did dominate a predecessor of it. Now we - // change this entry to include NewBB in the DF instead of NewBBSucc. - DominanceFrontier::iterator DFI = DF->find(PredDom); - assert(DFI != DF->end() && "No dominance frontier for node?"); - if (DFI->second.count(NewBBSucc)) { - // If NewBBSucc should not stay in our dominator frontier, remove it. - // We remove it unless there is a predecessor of NewBBSucc that we - // dominate, but we don't strictly dominate NewBBSucc. - bool ShouldRemove = true; - if (PredDom == NewBBSucc || !ETF.dominates(PredDom, NewBBSucc)) { - // Okay, we know that PredDom does not strictly dominate NewBBSucc. - // Check to see if it dominates any predecessors of NewBBSucc. - for (pred_iterator PI = pred_begin(NewBBSucc), - E = pred_end(NewBBSucc); PI != E; ++PI) - if (ETF.dominates(PredDom, *PI)) { - ShouldRemove = false; - break; - } - } - - if (ShouldRemove) - DF->removeFromFrontier(DFI, NewBBSucc); - DF->addToFrontier(DFI, NewBB); - } - } - } - } + for (Function::iterator FI = NewBB->getParent()->begin(), + FE = NewBB->getParent()->end(); FI != FE; ++FI) { + DominanceFrontier::iterator DFI = DF->find(FI); + if (DFI == DF->end()) continue; // unreachable block. + + // Only consider dominators of NewBBSucc + if (!DFI->second.count(NewBBSucc)) continue; + if (BlockDominatesAny(FI, PredBlocks, ETF)) { + // If NewBBSucc should not stay in our dominator frontier, remove it. + // We remove it unless there is a predecessor of NewBBSucc that we + // dominate, but we don't strictly dominate NewBBSucc. + bool ShouldRemove = true; + if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) { + // Okay, we know that PredDom does not strictly dominate NewBBSucc. + // Check to see if it dominates any predecessors of NewBBSucc. + for (pred_iterator PI = pred_begin(NewBBSucc), + E = pred_end(NewBBSucc); PI != E; ++PI) + if (ETF.dominates(FI, *PI)) { + ShouldRemove = false; + break; + } + + if (ShouldRemove) + DF->removeFromFrontier(DFI, NewBBSucc); + DF->addToFrontier(DFI, NewBB); + + break; + } + } + } + } } + From sabre at nondot.org Mon Apr 9 17:25:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:25:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMISelLowering.h Message-ID: <200704092225.l39MPx5s015044@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.39 -> 1.40 ARMISelLowering.h updated: 1.11 -> 1.12 --- Log message: remove some dead target hooks, subsumed by isLegalAddressingMode --- Diffs of the changes: (+0 -30) ARMISelLowering.cpp | 18 ------------------ ARMISelLowering.h | 12 ------------ 2 files changed, 30 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.39 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.39 Tue Apr 3 19:06:07 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr 9 17:25:41 2007 @@ -1441,24 +1441,6 @@ } } -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and V works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type* Ty) const { - if (V == 0) - return isLegalAddressScale(S, Ty); - return false; -} - -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and GV works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool ARMTargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type* Ty) const { - return false; -} - static bool getIndexedAddressParts(SDNode *Ptr, MVT::ValueType VT, bool isSEXTLoad, SDOperand &Base, SDOperand &Offset, bool &isInc, Index: llvm/lib/Target/ARM/ARMISelLowering.h diff -u llvm/lib/Target/ARM/ARMISelLowering.h:1.11 llvm/lib/Target/ARM/ARMISelLowering.h:1.12 --- llvm/lib/Target/ARM/ARMISelLowering.h:1.11 Sun Apr 1 20:30:03 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.h Mon Apr 9 17:25:41 2007 @@ -99,18 +99,6 @@ /// type. virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; - /// isLegalAddressScaleAndImm - Return true if S works for - /// IsLegalAddressScale and V works for isLegalAddressImmediate _and_ - /// both can be applied simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type *Ty) const; - - /// isLegalAddressScaleAndImm - Return true if S works for - /// IsLegalAddressScale and GV works for isLegalAddressImmediate _and_ - /// both can be applied simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type *Ty) const; - /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. From sabre at nondot.org Mon Apr 9 17:26:48 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:26:48 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h Message-ID: <200704092226.l39MQmf5015124@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.386 -> 1.387 X86ISelLowering.h updated: 1.95 -> 1.96 --- Log message: remove some dead target hooks, subsumed by isLegalAddressingMode --- Diffs of the changes: (+0 -28) X86ISelLowering.cpp | 16 ---------------- X86ISelLowering.h | 12 ------------ 2 files changed, 28 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.386 llvm/lib/Target/X86/X86ISelLowering.cpp:1.387 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.386 Mon Apr 9 00:49:22 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 9 17:26:30 2007 @@ -4127,22 +4127,6 @@ } } -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and V works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool X86TargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type* Ty) const { - return isLegalAddressScale(S, Ty) && isLegalAddressImmediate(V, Ty); -} - -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and GV works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool X86TargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type* Ty) const { - return isLegalAddressScale(S, Ty) && isLegalAddressImmediate(GV); -} - /// isShuffleMaskLegal - Targets can use this to indicate that they only /// support *some* VECTOR_SHUFFLE operations, those with specific masks. /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.95 llvm/lib/Target/X86/X86ISelLowering.h:1.96 --- llvm/lib/Target/X86/X86ISelLowering.h:1.95 Fri Mar 30 18:15:24 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Mon Apr 9 17:26:30 2007 @@ -353,18 +353,6 @@ /// type. virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; - /// isLegalAddressScaleAndImm - Return true if S works for - /// IsLegalAddressScale and V works for isLegalAddressImmediate _and_ - /// both can be applied simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type *Ty) const; - - /// isLegalAddressScaleAndImm - Return true if S works for - /// IsLegalAddressScale and GV works for isLegalAddressImmediate _and_ - /// both can be applied simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type *Ty) const; - /// isShuffleMaskLegal - Targets can use this to indicate that they only /// support *some* VECTOR_SHUFFLE operations, those with specific masks. /// By default, if a target supports the VECTOR_SHUFFLE node, all mask From sabre at nondot.org Mon Apr 9 17:27:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:27:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704092227.l39MRPCO015192@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.105 -> 1.106 --- Log message: remove some dead target hooks, subsumed by isLegalAddressingMode --- Diffs of the changes: (+0 -17) TargetLowering.cpp | 17 ----------------- 1 files changed, 17 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.105 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.105 Fri Mar 30 23:05:24 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Apr 9 17:27:04 2007 @@ -1993,23 +1993,6 @@ return false; } -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and V works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool TargetLowering::isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type* Ty) const { - return false; -} - -/// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale -/// and GV works for isLegalAddressImmediate _and_ both can be applied -/// simultaneously to the same instruction. -bool TargetLowering::isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type* Ty) const { - - return false; -} - // Magic for divide replacement struct ms { From sabre at nondot.org Mon Apr 9 17:27:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 17:27:26 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200704092227.l39MRQAV015197@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.120 -> 1.121 --- Log message: remove some dead target hooks, subsumed by isLegalAddressingMode --- Diffs of the changes: (+0 -11) TargetLowering.h | 11 ----------- 1 files changed, 11 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.120 llvm/include/llvm/Target/TargetLowering.h:1.121 --- llvm/include/llvm/Target/TargetLowering.h:1.120 Mon Apr 9 16:18:34 2007 +++ llvm/include/llvm/Target/TargetLowering.h Mon Apr 9 17:27:04 2007 @@ -893,17 +893,6 @@ /// scale of the target addressing mode for load / store of the given type. virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; - /// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale - /// and V works for isLegalAddressImmediate _and_ both can be applied - /// simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, int64_t V, - const Type* Ty) const; - /// isLegalAddressScaleAndImm - Return true if S works for IsLegalAddressScale - /// and GV works for isLegalAddressImmediate _and_ both can be applied - /// simultaneously to the same instruction. - virtual bool isLegalAddressScaleAndImm(int64_t S, GlobalValue *GV, - const Type* Ty) const; - //===--------------------------------------------------------------------===// // Div utility functions // From resistor at mac.com Mon Apr 9 17:32:00 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 9 Apr 2007 17:32:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704092232.l39MW0Qv015291@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.86 -> 1.87 --- Log message: Tabs -> Spaces --- Diffs of the changes: (+36 -36) LoopSimplify.cpp | 72 +++++++++++++++++++++++++++---------------------------- 1 files changed, 36 insertions(+), 36 deletions(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.86 Mon Apr 9 17:25:09 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Mon Apr 9 17:31:43 2007 @@ -420,7 +420,7 @@ /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a /// PHI node that tells us how to partition the loops. static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, - AliasAnalysis *AA) { + AliasAnalysis *AA) { for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ) { PHINode *PN = cast(I); ++I; @@ -676,11 +676,11 @@ // Returns true if BasicBlock A dominates at least one block in vector B // Helper function for UpdateDomInfoForRevectoredPreds static bool BlockDominatesAny(BasicBlock* A, std::vector& B, ETForest& ETF) { - for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { - if (ETF.dominates(A, *BI)) - return true; - } - return false; + for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { + if (ETF.dominates(A, *BI)) + return true; + } + return false; } /// UpdateDomInfoForRevectoredPreds - This method is used to update the four @@ -852,36 +852,36 @@ // their dominance frontier must be updated to contain NewBB instead. // for (Function::iterator FI = NewBB->getParent()->begin(), - FE = NewBB->getParent()->end(); FI != FE; ++FI) { - DominanceFrontier::iterator DFI = DF->find(FI); - if (DFI == DF->end()) continue; // unreachable block. - - // Only consider dominators of NewBBSucc - if (!DFI->second.count(NewBBSucc)) continue; - if (BlockDominatesAny(FI, PredBlocks, ETF)) { - // If NewBBSucc should not stay in our dominator frontier, remove it. - // We remove it unless there is a predecessor of NewBBSucc that we - // dominate, but we don't strictly dominate NewBBSucc. - bool ShouldRemove = true; - if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) { - // Okay, we know that PredDom does not strictly dominate NewBBSucc. - // Check to see if it dominates any predecessors of NewBBSucc. - for (pred_iterator PI = pred_begin(NewBBSucc), - E = pred_end(NewBBSucc); PI != E; ++PI) - if (ETF.dominates(FI, *PI)) { - ShouldRemove = false; - break; - } - - if (ShouldRemove) - DF->removeFromFrontier(DFI, NewBBSucc); - DF->addToFrontier(DFI, NewBB); - - break; - } - } - } - } + FE = NewBB->getParent()->end(); FI != FE; ++FI) { + DominanceFrontier::iterator DFI = DF->find(FI); + if (DFI == DF->end()) continue; // unreachable block. + + // Only consider dominators of NewBBSucc + if (!DFI->second.count(NewBBSucc)) continue; + if (BlockDominatesAny(FI, PredBlocks, ETF)) { + // If NewBBSucc should not stay in our dominator frontier, remove it. + // We remove it unless there is a predecessor of NewBBSucc that we + // dominate, but we don't strictly dominate NewBBSucc. + bool ShouldRemove = true; + if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) { + // Okay, we know that PredDom does not strictly dominate NewBBSucc. + // Check to see if it dominates any predecessors of NewBBSucc. + for (pred_iterator PI = pred_begin(NewBBSucc), + E = pred_end(NewBBSucc); PI != E; ++PI) + if (ETF.dominates(FI, *PI)) { + ShouldRemove = false; + break; + } + + if (ShouldRemove) + DF->removeFromFrontier(DFI, NewBBSucc); + DF->addToFrontier(DFI, NewBB); + + break; + } + } + } + } } From clattner at apple.com Mon Apr 9 17:42:14 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 15:42:14 -0700 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp In-Reply-To: <200704092232.l39MW0Qv015291@zion.cs.uiuc.edu> References: <200704092232.l39MW0Qv015291@zion.cs.uiuc.edu> Message-ID: > /// FindPHIToPartitionLoops - The first part of loop-nestification > is to find a > /// PHI node that tells us how to partition the loops. > static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, > - AliasAnalysis *AA) { > + AliasAnalysis *AA) { This is still indented funkily :) > @@ -676,11 +676,11 @@ > // Returns true if BasicBlock A dominates at least one block in > vector B > // Helper function for UpdateDomInfoForRevectoredPreds > static bool BlockDominatesAny(BasicBlock* A, > std::vector& B, ETForest& ETF) { The vector and ETF should be const. > @@ -852,36 +852,36 @@ > // their dominance frontier must be updated to contain NewBB > instead. > // > for (Function::iterator FI = NewBB->getParent()->begin(), > + FE = NewBB->getParent()->end(); FI != FE; ++FI) { > + DominanceFrontier::iterator DFI = DF->find(FI); > + if (DFI == DF->end()) continue; // unreachable block. > + > + // Only consider dominators of NewBBSucc > + if (!DFI->second.count(NewBBSucc)) continue; > + if (BlockDominatesAny(FI, PredBlocks, ETF)) { Please add a blank line between these two. :) Thanks Owen! nice work, -Chris From resistor at mac.com Mon Apr 9 17:55:07 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 9 Apr 2007 17:55:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704092255.l39Mt7iL015760@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.87 -> 1.88 --- Log message: Const-ify some parameters, and some cosmetic cleanups. No functionality change. --- Diffs of the changes: (+4 -3) LoopSimplify.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.87 Mon Apr 9 17:31:43 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Mon Apr 9 17:54:50 2007 @@ -419,8 +419,8 @@ /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a /// PHI node that tells us how to partition the loops. -static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, - AliasAnalysis *AA) { +static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, + AliasAnalysis *AA) { for (BasicBlock::iterator I = L->getHeader()->begin(); isa(I); ) { PHINode *PN = cast(I); ++I; @@ -675,7 +675,7 @@ // Returns true if BasicBlock A dominates at least one block in vector B // Helper function for UpdateDomInfoForRevectoredPreds -static bool BlockDominatesAny(BasicBlock* A, std::vector& B, ETForest& ETF) { +static bool BlockDominatesAny(BasicBlock* A, const std::vector& B, const ETForest& ETF) { for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { if (ETF.dominates(A, *BI)) return true; @@ -858,6 +858,7 @@ // Only consider dominators of NewBBSucc if (!DFI->second.count(NewBBSucc)) continue; + if (BlockDominatesAny(FI, PredBlocks, ETF)) { // If NewBBSucc should not stay in our dominator frontier, remove it. // We remove it unless there is a predecessor of NewBBSucc that we From resistor at mac.com Mon Apr 9 18:08:43 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 9 Apr 2007 18:08:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704092308.l39N8hcA015977@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.88 -> 1.89 --- Log message: Unconst-ify stuff that broke the build. --- Diffs of the changes: (+1 -1) LoopSimplify.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.88 Mon Apr 9 17:54:50 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Mon Apr 9 18:08:26 2007 @@ -675,7 +675,7 @@ // Returns true if BasicBlock A dominates at least one block in vector B // Helper function for UpdateDomInfoForRevectoredPreds -static bool BlockDominatesAny(BasicBlock* A, const std::vector& B, const ETForest& ETF) { +static bool BlockDominatesAny(BasicBlock* A, std::vector& B, ETForest& ETF) { for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { if (ETF.dominates(A, *BI)) return true; From sabre at nondot.org Mon Apr 9 18:29:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:29:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200704092329.l39NTOfk016327@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: CodeGenPrepare.cpp updated: 1.2 -> 1.3 --- Log message: eliminate the last uses of some TLI methods. --- Diffs of the changes: (+7 -3) CodeGenPrepare.cpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.2 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.2 Sun Apr 1 20:35:34 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon Apr 9 18:29:07 2007 @@ -536,11 +536,15 @@ // Check if it is possible to fold the expression to address mode. if (UseTy && isa(BinOp->getOperand(1))) { - uint64_t Scale = TLI.getTargetData()->getTypeSize(UseTy); int64_t Cst = cast(BinOp->getOperand(1))->getSExtValue(); // e.g. load (gep i32 * %P, (X+42)) => load (%P + X*4 + 168). - if (TLI.isLegalAddressImmediate(Cst*Scale, UseTy) && - (Scale == 1 || TLI.isLegalAddressScale(Scale, UseTy))) { + TargetLowering::AddrMode AM; + // FIXME: This computation isn't right, scale is incorrect. + AM.Scale = TLI.getTargetData()->getTypeSize(UseTy); + // FIXME: Should should also include other fixed offsets. + AM.BaseOffs = Cst*AM.Scale; + + if (TLI.isLegalAddressingMode(AM, UseTy)) { DestBBs.insert(GEPIBB); MadeChange = true; break; From sabre at nondot.org Mon Apr 9 18:31:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:31:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86ISelLowering.h Message-ID: <200704092331.l39NVbsp016419@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.387 -> 1.388 X86ISelLowering.h updated: 1.96 -> 1.97 --- Log message: remove some dead hooks --- Diffs of the changes: (+0 -49) X86ISelLowering.cpp | 35 ----------------------------------- X86ISelLowering.h | 14 -------------- 2 files changed, 49 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.387 llvm/lib/Target/X86/X86ISelLowering.cpp:1.388 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.387 Mon Apr 9 17:26:30 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Apr 9 18:31:19 2007 @@ -4092,41 +4092,6 @@ } -/// isLegalAddressImmediate - Return true if the integer value can be used -/// as the offset of the target addressing mode for load / store of the -/// given type. -bool X86TargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) const{ - // X86 allows a sign-extended 32-bit immediate field. - return (V > -(1LL << 32) && V < (1LL << 32)-1); -} - -/// isLegalAddressImmediate - Return true if the GlobalValue can be used as -/// the offset of the target addressing mode. -bool X86TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const { - // In 64-bit mode, GV is 64-bit so it won't fit in the 32-bit displacement - // field unless we are in small code model. - if (Subtarget->is64Bit() && - getTargetMachine().getCodeModel() != CodeModel::Small) - return false; - - return (!Subtarget->GVRequiresExtraLoad(GV, getTargetMachine(), false)); -} - -/// isLegalAddressScale - Return true if the integer value can be used as the -/// scale of the target addressing mode for load / store of the given type. -bool X86TargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const { - switch (S) { - default: - return false; - case 2: case 4: case 8: - return true; - // FIXME: These require both scale + index last and thus more expensive. - // How to tell LSR to try for 2, 4, 8 first? - case 3: case 5: case 9: - return true; - } -} - /// isShuffleMaskLegal - Targets can use this to indicate that they only /// support *some* VECTOR_SHUFFLE operations, those with specific masks. /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values Index: llvm/lib/Target/X86/X86ISelLowering.h diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.96 llvm/lib/Target/X86/X86ISelLowering.h:1.97 --- llvm/lib/Target/X86/X86ISelLowering.h:1.96 Mon Apr 9 17:26:30 2007 +++ llvm/lib/Target/X86/X86ISelLowering.h Mon Apr 9 18:31:19 2007 @@ -339,20 +339,6 @@ /// by AM is legal for this target, for a load/store of the specified type. virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const; - /// isLegalAddressImmediate - Return true if the integer value can be used - /// as the offset of the target addressing mode for load / store of the - /// given type. - virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const; - - /// isLegalAddressImmediate - Return true if the GlobalValue can be used as - /// the offset of the target addressing mode. - virtual bool isLegalAddressImmediate(GlobalValue *GV) const; - - /// isLegalAddressScale - Return true if the integer value can be used as - /// the scale of the target addressing mode for load / store of the given - /// type. - virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; - /// isShuffleMaskLegal - Targets can use this to indicate that they only /// support *some* VECTOR_SHUFFLE operations, those with specific masks. /// By default, if a target supports the VECTOR_SHUFFLE node, all mask From sabre at nondot.org Mon Apr 9 18:33:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:33:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMISelLowering.h Message-ID: <200704092333.l39NXwxq016508@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.40 -> 1.41 ARMISelLowering.h updated: 1.12 -> 1.13 --- Log message: remove dead target hooks --- Diffs of the changes: (+49 -98) ARMISelLowering.cpp | 133 +++++++++++++++++++--------------------------------- ARMISelLowering.h | 14 ----- 2 files changed, 49 insertions(+), 98 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.40 Mon Apr 9 17:25:41 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr 9 18:33:39 2007 @@ -1295,66 +1295,14 @@ // ARM Optimization Hooks //===----------------------------------------------------------------------===// -/// isLegalAddressingMode - Return true if the addressing mode represented -/// by AM is legal for this target, for a load/store of the specified type. -bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, - const Type *Ty) const { - if (!isLegalAddressImmediate(AM.BaseOffs, Ty)) - return false; - - // Can never fold addr of global into load/store. - if (AM.BaseGV) - return false; - - switch (AM.Scale) { - case 0: // no scale reg, must be "r+i" or "r", or "i". - break; - case 1: - if (Subtarget->isThumb()) - return false; - - default: - switch (getValueType(Ty)) { - default: return false; - case MVT::i1: - case MVT::i8: - case MVT::i32: - case MVT::i64: - // This assumes i64 is legalized to a pair of i32. If not (i.e. - // ldrd / strd are used, then its address mode is same as i16. - // r + r - if (AM.Scale == 1) - return true; - // r + r << imm - if (!isPowerOf2_32(AM.Scale & ~1)) - return false; - case MVT::i16: - // r + r - if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2) - return true; - - case MVT::isVoid: - // Note, we allow "void" uses (basically, uses that aren't loads or - // stores), because arm allows folding a scale into many arithmetic - // operations. This should be made more precise and revisited later. - - // Allow r << imm, but the imm has to be a multiple of two. - if (AM.Scale & 1) return false; - return isPowerOf2_32(AM.Scale); - } - break; - } - return true; -} - /// isLegalAddressImmediate - Return true if the integer value can be used /// as the offset of the target addressing mode for load / store of the /// given type. -bool ARMTargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) const{ +static bool isLegalAddressImmediate(int64_t V, MVT::ValueType VT, + const ARMSubtarget *Subtarget) { if (V == 0) return true; - MVT::ValueType VT = getValueType(Ty); if (Subtarget->isThumb()) { if (V < 0) return false; @@ -1405,42 +1353,59 @@ } } -bool ARMTargetLowering::isLegalAddressImmediate(GlobalValue *GV) const { - return false; -} - -/// isLegalAddressScale - Return true if the integer value can be used as -/// the scale of the target addressing mode for load / store of the given -/// type. -bool ARMTargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const { - if (Subtarget->isThumb()) +/// isLegalAddressingMode - Return true if the addressing mode represented +/// by AM is legal for this target, for a load/store of the specified type. +bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, + const Type *Ty) const { + if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty), Subtarget)) + return false; + + // Can never fold addr of global into load/store. + if (AM.BaseGV) return false; + + switch (AM.Scale) { + case 0: // no scale reg, must be "r+i" or "r", or "i". + break; + case 1: + if (Subtarget->isThumb()) + return false; - MVT::ValueType VT = getValueType(Ty); - switch (VT) { - default: return false; - case MVT::i1: - case MVT::i8: - case MVT::i32: - if (S < 0) S = -S; - if (S == 1) return true; // Allow: r + r + default: + switch (getValueType(Ty)) { + default: return false; + case MVT::i1: + case MVT::i8: + case MVT::i32: + case MVT::i64: + // This assumes i64 is legalized to a pair of i32. If not (i.e. + // ldrd / strd are used, then its address mode is same as i16. + // r + r + if (AM.Scale == 1) + return true; + // r + r << imm + if (!isPowerOf2_32(AM.Scale & ~1)) + return false; + case MVT::i16: + // r + r + if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2) + return true; + + case MVT::isVoid: + // Note, we allow "void" uses (basically, uses that aren't loads or + // stores), because arm allows folding a scale into many arithmetic + // operations. This should be made more precise and revisited later. - // Allow: r << imm - // Allow: r + r << imm - S &= ~1; - return isPowerOf2_32(S); - case MVT::isVoid: - // Note, we allow "void" uses (basically, uses that aren't loads or - // stores), because arm allows folding a scale into many arithmetic - // operations. This should be made more precise and revisited later. - if (S == 1) return true; // Allow: r + r - - // Allow r << imm, but the imm has to be a multiple of two. - if (S & 1) return false; - return isPowerOf2_32(S); + // Allow r << imm, but the imm has to be a multiple of two. + if (AM.Scale & 1) return false; + return isPowerOf2_32(AM.Scale); + } + break; } + return true; } + static bool getIndexedAddressParts(SDNode *Ptr, MVT::ValueType VT, bool isSEXTLoad, SDOperand &Base, SDOperand &Offset, bool &isInc, Index: llvm/lib/Target/ARM/ARMISelLowering.h diff -u llvm/lib/Target/ARM/ARMISelLowering.h:1.12 llvm/lib/Target/ARM/ARMISelLowering.h:1.13 --- llvm/lib/Target/ARM/ARMISelLowering.h:1.12 Mon Apr 9 17:25:41 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.h Mon Apr 9 18:33:39 2007 @@ -85,20 +85,6 @@ /// by AM is legal for this target, for a load/store of the specified type. virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const; - /// isLegalAddressImmediate - Return true if the integer value can be used - /// as the offset of the target addressing mode for load / store of the - /// given type. - virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const; - - /// isLegalAddressImmediate - Return true if the GlobalValue can be used as - /// the offset of the target addressing mode. - virtual bool isLegalAddressImmediate(GlobalValue *GV) const; - - /// isLegalAddressScale - Return true if the integer value can be used as - /// the scale of the target addressing mode for load / store of the given - /// type. - virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; - /// getPreIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if the node's address /// can be legally represented as pre-indexed load / store address. From sabre at nondot.org Mon Apr 9 18:34:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:34:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704092334.l39NYVde016558@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.106 -> 1.107 --- Log message: remove dead target hooks. --- Diffs of the changes: (+0 -19) TargetLowering.cpp | 19 ------------------- 1 files changed, 19 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.107 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.106 Mon Apr 9 17:27:04 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Apr 9 18:34:08 2007 @@ -1974,25 +1974,6 @@ return true; } -/// isLegalAddressImmediate - Return true if the integer value can be used as -/// the offset of the target addressing mode for load / store of the given -/// type. -bool TargetLowering::isLegalAddressImmediate(int64_t V, const Type *Ty) const { - return false; -} - -/// isLegalAddressImmediate - Return true if the GlobalValue can be used as -/// the offset of the target addressing mode. -bool TargetLowering::isLegalAddressImmediate(GlobalValue *GV) const { - return false; -} - -/// isLegalAddressScale - Return true if the integer value can be used as the -/// scale of the target addressing mode for load / store of the given type. -bool TargetLowering::isLegalAddressScale(int64_t S, const Type *Ty) const { - return false; -} - // Magic for divide replacement struct ms { From sabre at nondot.org Mon Apr 9 18:34:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:34:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h Message-ID: <200704092334.l39NYUSa016552@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetLowering.h updated: 1.121 -> 1.122 --- Log message: remove dead target hooks. --- Diffs of the changes: (+0 -13) TargetLowering.h | 13 ------------- 1 files changed, 13 deletions(-) Index: llvm/include/llvm/Target/TargetLowering.h diff -u llvm/include/llvm/Target/TargetLowering.h:1.121 llvm/include/llvm/Target/TargetLowering.h:1.122 --- llvm/include/llvm/Target/TargetLowering.h:1.121 Mon Apr 9 17:27:04 2007 +++ llvm/include/llvm/Target/TargetLowering.h Mon Apr 9 18:34:08 2007 @@ -879,19 +879,6 @@ /// AM is legal for this target, for a load/store of the specified type. /// TODO: Handle pre/postinc as well. virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const; - - /// isLegalAddressImmediate - Return true if the integer value can be used as - /// the offset of the target addressing mode for load / store of the given - /// type. - virtual bool isLegalAddressImmediate(int64_t V, const Type *Ty) const; - - /// isLegalAddressImmediate - Return true if the GlobalValue can be used as - /// the offset of the target addressing mode. - virtual bool isLegalAddressImmediate(GlobalValue *GV) const; - - /// isLegalAddressScale - Return true if the integer value can be used as the - /// scale of the target addressing mode for load / store of the given type. - virtual bool isLegalAddressScale(int64_t S, const Type *Ty) const; //===--------------------------------------------------------------------===// // Div utility functions From resistor at mac.com Mon Apr 9 18:38:36 2007 From: resistor at mac.com (Owen Anderson) Date: Mon, 9 Apr 2007 18:38:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LoopSimplify.cpp Message-ID: <200704092338.l39NcaEM016634@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LoopSimplify.cpp updated: 1.89 -> 1.90 --- Log message: Re-constify things that don't break the build. Last patch in this series, I promise. --- Diffs of the changes: (+4 -2) LoopSimplify.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Utils/LoopSimplify.cpp diff -u llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89 llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.90 --- llvm/lib/Transforms/Utils/LoopSimplify.cpp:1.89 Mon Apr 9 18:08:26 2007 +++ llvm/lib/Transforms/Utils/LoopSimplify.cpp Mon Apr 9 18:38:18 2007 @@ -675,8 +675,10 @@ // Returns true if BasicBlock A dominates at least one block in vector B // Helper function for UpdateDomInfoForRevectoredPreds -static bool BlockDominatesAny(BasicBlock* A, std::vector& B, ETForest& ETF) { - for (std::vector::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { +static bool BlockDominatesAny(BasicBlock* A, const std::vector& B, + ETForest& ETF) { + for (std::vector::const_iterator BI = B.begin(), BE = B.end(); + BI != BE; ++BI) { if (ETF.dominates(A, *BI)) return true; } From dpatel at apple.com Mon Apr 9 18:40:32 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 9 Apr 2007 18:40:32 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll Message-ID: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopRotate: PhiRename-1.ll updated: 1.1 -> 1.2 --- Log message: Add check for opt crash. --- Diffs of the changes: (+1 -0) PhiRename-1.ll | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll diff -u llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2 --- llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 Mon Apr 9 17:22:42 2007 +++ llvm/test/Transforms/LoopRotate/PhiRename-1.ll Mon Apr 9 18:40:15 2007 @@ -1,3 +1,4 @@ +; RUN: llvm-as < %s | opt -loop-rotate -disable-output && ; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" 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" From jeffc at jolt-lang.org Mon Apr 9 18:42:49 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 9 Apr 2007 18:42:49 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704092342.l39NgnlY016730@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.412 -> 1.413 --- Log message: No longer needed. --- Diffs of the changes: (+0 -1) SelectionDAGISel.cpp | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.412 Mon Apr 9 16:57:03 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 18:42:32 2007 @@ -45,7 +45,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" #include -#include using namespace llvm; #ifndef NDEBUG From rspencer at reidspencer.com Mon Apr 9 18:47:56 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 09 Apr 2007 23:47:56 +0000 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll In-Reply-To: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> References: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> Message-ID: <1176162476.9947.628.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote: > > Changes in directory llvm/test/Transforms/LoopRotate: > > PhiRename-1.ll updated: 1.1 -> 1.2 > --- > Log message: > > Add check for opt crash. This idiom is becoming more and more prevalent. While it works, its also doubling the runtime of each test its used in. I'm wondering if we could invest in a "notgrep" script (since we're invoking "not" anyway) that would fail on empty input. Is this sufficient to avoid having to do things twice? > > > --- > Diffs of the changes: (+1 -0) > > PhiRename-1.ll | 1 + > 1 files changed, 1 insertion(+) > > > Index: llvm/test/Transforms/LoopRotate/PhiRename-1.ll > diff -u llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.2 > --- llvm/test/Transforms/LoopRotate/PhiRename-1.ll:1.1 Mon Apr 9 17:22:42 2007 > +++ llvm/test/Transforms/LoopRotate/PhiRename-1.ll Mon Apr 9 18:40:15 2007 > @@ -1,3 +1,4 @@ > +; RUN: llvm-as < %s | opt -loop-rotate -disable-output && > ; RUN: llvm-as < %s | opt -loop-rotate | llvm-dis | not grep "\[ .tmp224" > 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" > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Mon Apr 9 18:52:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:52:06 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/set.ll Message-ID: <200704092352.l39Nq6KW016995@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: set.ll updated: 1.21 -> 1.22 --- Log message: new testcase --- Diffs of the changes: (+5 -0) set.ll | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/test/Transforms/InstCombine/set.ll diff -u llvm/test/Transforms/InstCombine/set.ll:1.21 llvm/test/Transforms/InstCombine/set.ll:1.22 --- llvm/test/Transforms/InstCombine/set.ll:1.21 Sat Dec 23 00:05:41 2006 +++ llvm/test/Transforms/InstCombine/set.ll Mon Apr 9 18:51:49 2007 @@ -145,3 +145,8 @@ ret int %tmp.3 } +bool %test25(uint %A) { + %B = and uint %A, 2 + %C = setgt uint %B, 2 + ret bool %C +} From sabre at nondot.org Mon Apr 9 18:52:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 18:52:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704092352.l39NqUcX017011@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.737 -> 1.738 --- Log message: Strengthen the boundary conditions of this fold, implementing InstCombine/set.ll:test25 --- Diffs of the changes: (+3 -3) InstructionCombining.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.737 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.738 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.737 Sun Apr 8 20:37:55 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Apr 9 18:52:13 2007 @@ -4741,13 +4741,13 @@ case ICmpInst::ICMP_ULT: if (Max.ult(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getTrue()); - if (Min.ugt(RHSVal)) + if (Min.uge(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getFalse()); break; case ICmpInst::ICMP_UGT: if (Min.ugt(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getTrue()); - if (Max.ult(RHSVal)) + if (Max.ule(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getFalse()); break; case ICmpInst::ICMP_SLT: @@ -4759,7 +4759,7 @@ case ICmpInst::ICMP_SGT: if (Min.sgt(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getTrue()); - if (Max.slt(RHSVal)) + if (Max.sle(RHSVal)) return ReplaceInstUsesWith(I, ConstantInt::getFalse()); break; } From clattner at apple.com Mon Apr 9 18:57:05 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 9 Apr 2007 16:57:05 -0700 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll In-Reply-To: <1176162476.9947.628.camel@bashful.x10sys.com> References: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> <1176162476.9947.628.camel@bashful.x10sys.com> Message-ID: On Apr 9, 2007, at 4:47 PM, Reid Spencer wrote: > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote: >> >> Changes in directory llvm/test/Transforms/LoopRotate: >> >> PhiRename-1.ll updated: 1.1 -> 1.2 >> --- >> Log message: >> >> Add check for opt crash. > > This idiom is becoming more and more prevalent. While it works, its > also > doubling the runtime of each test its used in. I'm wondering if we > could > invest in a "notgrep" script (since we're invoking "not" anyway) that > would fail on empty input. Is this sufficient to avoid having to do > things twice? I'm not worried about it. If you're worried about testing time, I'd suggest changing tests like CodeGen/ARM/vfp.ll to use %t to only invoke llc once :) -Chris From rspencer at reidspencer.com Mon Apr 9 19:02:44 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Apr 2007 00:02:44 +0000 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll In-Reply-To: References: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> <1176162476.9947.628.camel@bashful.x10sys.com> Message-ID: <1176163364.9947.631.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 16:57 -0700, Chris Lattner wrote: > On Apr 9, 2007, at 4:47 PM, Reid Spencer wrote: > > > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote: > >> > >> Changes in directory llvm/test/Transforms/LoopRotate: > >> > >> PhiRename-1.ll updated: 1.1 -> 1.2 > >> --- > >> Log message: > >> > >> Add check for opt crash. > > > > This idiom is becoming more and more prevalent. While it works, its > > also > > doubling the runtime of each test its used in. I'm wondering if we > > could > > invest in a "notgrep" script (since we're invoking "not" anyway) that > > would fail on empty input. Is this sufficient to avoid having to do > > things twice? > > I'm not worried about it. If you're worried about testing time, I'd > suggest changing tests like CodeGen/ARM/vfp.ll to use %t to only > invoke llc once :) Well, those need to be done anyway. I'm not overly concerned about it but in the last year time to run the regressions has gone from about 45 seconds to > 3 minutes. Obviously, a lot of that is due to nearly 1000 new test cases, but I can imagine the number will only grow in the future. When we get to 5000 and its taking 15 minutes, perhaps then it becomes important? > > -Chris > From jeffc at jolt-lang.org Mon Apr 9 19:03:00 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 09 Apr 2007 17:03:00 -0700 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll In-Reply-To: <1176162476.9947.628.camel@bashful.x10sys.com> References: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> <1176162476.9947.628.camel@bashful.x10sys.com> Message-ID: <461AD434.9030109@jolt-lang.org> Reid Spencer wrote: > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote: > >> Changes in directory llvm/test/Transforms/LoopRotate: >> >> PhiRename-1.ll updated: 1.1 -> 1.2 >> --- >> Log message: >> >> Add check for opt crash. >> > > This idiom is becoming more and more prevalent. While it works, its also > doubling the runtime of each test its used in. I'm wondering if we could > invest in a "notgrep" script (since we're invoking "not" anyway) that > would fail on empty input. Is this sufficient to avoid having to do > things twice? It won't work. The command can crash after producing some output, but still not producing a line being grepped for. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070409/0aa1690e/attachment.html From rspencer at reidspencer.com Mon Apr 9 19:07:57 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Apr 2007 00:07:57 +0000 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/PhiRename-1.ll In-Reply-To: <461AD434.9030109@jolt-lang.org> References: <200704092340.l39NeWFf016679@zion.cs.uiuc.edu> <1176162476.9947.628.camel@bashful.x10sys.com> <461AD434.9030109@jolt-lang.org> Message-ID: <1176163677.9947.635.camel@bashful.x10sys.com> On Mon, 2007-04-09 at 17:03 -0700, Jeff Cohen wrote: > Reid Spencer wrote: > > On Mon, 2007-04-09 at 18:40 -0500, Devang Patel wrote: > > > > > Changes in directory llvm/test/Transforms/LoopRotate: > > > > > > PhiRename-1.ll updated: 1.1 -> 1.2 > > > --- > > > Log message: > > > > > > Add check for opt crash. > > > > > > > This idiom is becoming more and more prevalent. While it works, its also > > doubling the runtime of each test its used in. I'm wondering if we could > > invest in a "notgrep" script (since we're invoking "not" anyway) that > > would fail on empty input. Is this sufficient to avoid having to do > > things twice? > > It won't work. The command can crash after producing some output, but > still not producing a line being grepped for. Okay, I wasn't so much suggesting that as the ultimate solution but wondering more if the problem is one we should/can fix. Perhaps dejagnu can interpret/watch the pipeline or something and check exit statuses of each component to ensure they all return 0, not just the last one. I'll file this as a "fix someday nice to have" Reid. From reid at x10sys.com Mon Apr 9 21:34:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 21:34:27 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704100234.l3A2YRl9019592@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.52 -> 1.53 --- Log message: Add John Criswell. --- Diffs of the changes: (+4 -2) DevMtgMay2007.html | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.52 llvm-www/DevMtgMay2007.html:1.53 --- llvm-www/DevMtgMay2007.html:1.52 Fri Apr 6 15:19:07 2007 +++ llvm-www/DevMtgMay2007.html Mon Apr 9 21:34:10 2007 @@ -131,6 +131,7 @@ Scott MichelBuilding The Cell BE Symbiotic Processor Element Backend: Practice and Experience + John CriswellUIUC Research, TBA @@ -240,6 +241,7 @@ Ryan BrownGoogle Evan ChengApple Inc. Jeff CohenIndependent + John CriswellUIUC Han GaoAdobe Systems Incorporated. Dan Gohman + 1Cray Inc. Stuart HastingsApple Inc. @@ -272,7 +274,7 @@ -

Total confirmed: 29

+

Total confirmed: 30

@@ -290,6 +292,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
Last modified: $Date: 2007/04/06 20:19:07 $ +
Last modified: $Date: 2007/04/10 02:34:10 $ From reid at x10sys.com Mon Apr 9 21:51:48 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 21:51:48 -0500 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200704100251.l3A2pmWm019916@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.227 -> 1.228 --- Log message: Fix name of an intrinsic: bit.part_select -> part.select --- Diffs of the changes: (+11 -11) LangRef.html | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.227 llvm/docs/LangRef.html:1.228 --- llvm/docs/LangRef.html:1.227 Wed Apr 4 14:15:59 2007 +++ llvm/docs/LangRef.html Mon Apr 9 21:51:31 2007 @@ -184,7 +184,7 @@
  • 'llvm.ctpop.*' Intrinsic
  • 'llvm.ctlz.*' Intrinsic
  • 'llvm.cttz.*' Intrinsic
  • -
  • 'llvm.bit.part_select.*' Intrinsic
  • +
  • 'llvm.part_select.*' Intrinsic
  • Debugger intrinsics
  • @@ -4590,21 +4590,21 @@
    Syntax:
    -

    This is an overloaded intrinsic. You can use llvm.bit.part_select +

    This is an overloaded intrinsic. You can use llvm.part.select on any integer bit width.

    -  declare i17 @llvm.bit.part_select.i17.i17 (i17 %val, i32 %loBit, i32 %hiBit)
    -  declare i29 @llvm.bit.part_select.i29.i29 (i29 %val, i32 %loBit, i32 %hiBit)
    +  declare i17 @llvm.part.select.i17.i17 (i17 %val, i32 %loBit, i32 %hiBit)
    +  declare i29 @llvm.part.select.i29.i29 (i29 %val, i32 %loBit, i32 %hiBit)
     
    Overview:
    -

    The 'llvm.bit.part_select' family of intrinsic functions selects a +

    The 'llvm.part.select' family of intrinsic functions selects a range of bits from an integer value and returns them in the same bit width as the original value.

    @@ -4614,7 +4614,7 @@ arguments must be i32 type since they specify only a bit index.

    Semantics:
    -

    The operation of the 'llvm.bit.part_select' intrinsic has two modes +

    The operation of the 'llvm.part.select' intrinsic has two modes of operation: forwards and reverse. If %loBit is greater than %hiBits then the intrinsic operates in reverse mode. Otherwise it operates in forward mode.

    @@ -4632,11 +4632,11 @@

    In reverse mode, a similar computation is made except that:

    1. The bits selected wrap around to include both the highest and lowest bits. - For example, part_select(i16 X, 4, 7) selects bits from X with a mask of - 0x00F0 (forwards case) while part_select(i16 X, 8, 3) selects bits from X + For example, part.select(i16 X, 4, 7) selects bits from X with a mask of + 0x00F0 (forwards case) while part.select(i16 X, 8, 3) selects bits from X with a mask of 0xFF0F.
    2. The bits returned in the reverse case are reversed. So, if X has the value - 0x6ACF and we apply part_select(i16 X, 8, 3) to it, we get back the value + 0x6ACF and we apply part.select(i16 X, 8, 3) to it, we get back the value 0x0A6F.
    @@ -4679,7 +4679,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/04 19:15:59 $ + Last modified: $Date: 2007/04/10 02:51:31 $ From reid at x10sys.com Mon Apr 9 21:53:03 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 9 Apr 2007 21:53:03 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.td Message-ID: <200704100253.l3A2r3kH019954@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.td updated: 1.53 -> 1.54 --- Log message: Drop the "bit" prefix for the part.select intrinsic. --- Diffs of the changes: (+1 -1) Intrinsics.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.53 llvm/include/llvm/Intrinsics.td:1.54 --- llvm/include/llvm/Intrinsics.td:1.53 Wed Apr 4 18:48:25 2007 +++ llvm/include/llvm/Intrinsics.td Mon Apr 9 21:52:46 2007 @@ -203,7 +203,7 @@ // None of these intrinsics accesses memory at all. let Properties = [IntrNoMem] in { - def int_bit_part_select : + def int_part_select : Intrinsic<[llvm_int_ty, llvm_int_ty, llvm_i32_ty, llvm_i32_ty]>; def int_bswap: Intrinsic<[llvm_int_ty, llvm_int_ty]>; def int_ctpop: Intrinsic<[llvm_i32_ty, llvm_int_ty]>; From jeffc at jolt-lang.org Mon Apr 9 21:59:48 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 9 Apr 2007 21:59:48 -0500 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h Message-ID: <200704100259.l3A2xmP1020090@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/MiBench/office-ispell: config.h updated: 1.2 -> 1.3 --- Log message: Use correct dirent.h header file. --- Diffs of the changes: (+5 -2) config.h | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h diff -u llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.2 llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.3 --- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.2 Thu Mar 29 12:00:52 2007 +++ llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h Mon Apr 9 21:59:31 2007 @@ -52,9 +52,12 @@ */ /* - * $Id: config.h,v 1.2 2007/03/29 17:00:52 jeffc Exp $ + * $Id: config.h,v 1.3 2007/04/10 02:59:31 jeffc Exp $ * * $Log: config.h,v $ + * Revision 1.3 2007/04/10 02:59:31 jeffc + * Use correct dirent.h header file. + * * Revision 1.2 2007/03/29 17:00:52 jeffc * Fix for src != obj. * Don't use obsolete header file. @@ -118,7 +121,7 @@ #include #include #ifndef USG -#include +#include #endif /* USG */ /* From jeffc at jolt-lang.org Mon Apr 9 22:11:03 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 9 Apr 2007 22:11:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704100311.l3A3B3G9020285@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.199 -> 1.200 --- Log message: Fix build problem. --- Diffs of the changes: (+1 -1) Verifier.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.199 llvm/lib/VMCore/Verifier.cpp:1.200 --- llvm/lib/VMCore/Verifier.cpp:1.199 Wed Apr 4 18:48:25 2007 +++ llvm/lib/VMCore/Verifier.cpp Mon Apr 9 22:10:46 2007 @@ -1028,7 +1028,7 @@ if (GotBits < 16 || GotBits % 16 != 0) CheckFailed("Intrinsic requires even byte width argument", F); /* FALL THROUGH */ - case Intrinsic::bit_part_select: + case Intrinsic::int_part_select: if (ArgNo == 1) { unsigned ResultBits = cast(FTy->getReturnType())->getBitWidth(); From sabre at nondot.org Mon Apr 9 22:18:36 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 22:18:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704100318.l3A3Iagw020475@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.200 -> 1.201 --- Log message: unbreak the build :( --- Diffs of the changes: (+1 -1) Verifier.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.200 llvm/lib/VMCore/Verifier.cpp:1.201 --- llvm/lib/VMCore/Verifier.cpp:1.200 Mon Apr 9 22:10:46 2007 +++ llvm/lib/VMCore/Verifier.cpp Mon Apr 9 22:18:19 2007 @@ -1028,7 +1028,7 @@ if (GotBits < 16 || GotBits % 16 != 0) CheckFailed("Intrinsic requires even byte width argument", F); /* FALL THROUGH */ - case Intrinsic::int_part_select: + case Intrinsic::part_select: if (ArgNo == 1) { unsigned ResultBits = cast(FTy->getReturnType())->getBitWidth(); From sabre at nondot.org Mon Apr 9 22:20:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 22:20:57 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704100320.l3A3KvLc020562@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.75 -> 1.76 --- Log message: apparently some people commit without building the tree, or they forget to commit a LOT of files. --- Diffs of the changes: (+1 -1) IntrinsicLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.75 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.76 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.75 Wed Apr 4 18:48:25 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon Apr 9 22:20:39 2007 @@ -475,7 +475,7 @@ break; } - case Intrinsic::bit_part_select: + case Intrinsic::part_select: CI->replaceAllUsesWith(LowerBitPartSelect(CI)); break; From sabre at nondot.org Mon Apr 9 22:20:58 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 22:20:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704100320.l3A3KwGT020567@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.413 -> 1.414 --- Log message: apparently some people commit without building the tree, or they forget to commit a LOT of files. --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.414 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.413 Mon Apr 9 18:42:32 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Apr 9 22:20:39 2007 @@ -2689,7 +2689,7 @@ DAG.setRoot(Tmp.getValue(1)); return 0; } - case Intrinsic::bit_part_select: { + case Intrinsic::part_select: { // Currently not implemented: just abort assert(0 && "bit_part_select intrinsic not implemented"); abort(); From sabre at nondot.org Mon Apr 9 22:48:46 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 9 Apr 2007 22:48:46 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200704100348.l3A3mkWD021006@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.41 -> 1.42 --- Log message: restore support for negative strides --- Diffs of the changes: (+5 -3) ARMISelLowering.cpp | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.42 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.41 Mon Apr 9 18:33:39 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Apr 9 22:48:29 2007 @@ -1372,6 +1372,7 @@ return false; default: + int Scale = AM.Scale; switch (getValueType(Ty)) { default: return false; case MVT::i1: @@ -1381,14 +1382,15 @@ // This assumes i64 is legalized to a pair of i32. If not (i.e. // ldrd / strd are used, then its address mode is same as i16. // r + r - if (AM.Scale == 1) + if (Scale < 0) Scale = -Scale; + if (Scale == 1) return true; // r + r << imm - if (!isPowerOf2_32(AM.Scale & ~1)) + if (!isPowerOf2_32(Scale & ~1)) return false; case MVT::i16: // r + r - if (((unsigned)AM.HasBaseReg + AM.Scale) <= 2) + if (((unsigned)AM.HasBaseReg + Scale) <= 2) return true; case MVT::isVoid: From sabre at nondot.org Tue Apr 10 01:43:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 01:43:35 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200704100643.l3A6hZL3023903@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.63 -> 1.64 --- Log message: add a method --- Diffs of the changes: (+7 -0) APInt.h | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.63 llvm/include/llvm/ADT/APInt.h:1.64 --- llvm/include/llvm/ADT/APInt.h:1.63 Wed Apr 4 01:18:21 2007 +++ llvm/include/llvm/ADT/APInt.h Tue Apr 10 01:43:18 2007 @@ -281,6 +281,13 @@ return *this != 0; } + /// getLimitedValue - Return this value, or return all ones if it is too large + /// to return. + uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const { + return (getActiveBits() > 64 || getZExtValue() > Limit) ? + Limit : getZExtValue(); + } + /// @} /// @name Value Generators /// @{ From sabre at nondot.org Tue Apr 10 01:44:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 01:44:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200704100644.l3A6iTad023974@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.144 -> 1.145 --- Log message: getLimitedValue now just forward to APInt's getLimitedValue. Mark it const. --- Diffs of the changes: (+2 -3) Constants.h | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.144 llvm/include/llvm/Constants.h:1.145 --- llvm/include/llvm/Constants.h:1.144 Mon Apr 2 20:41:34 2007 +++ llvm/include/llvm/Constants.h Tue Apr 10 01:44:12 2007 @@ -189,9 +189,8 @@ /// @returns the 64-bit value of this constant if its active bits number is /// not greater than 64, otherwise, just return the given uint64_t number. /// @brief Get the constant's value if possible. - uint64_t getLimitedValue(uint64_t Limit) { - return (Val.getActiveBits() > 64 || Val.getZExtValue() > Limit) ? - Limit : Val.getZExtValue(); + uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const { + return Val.getLimitedValue(Limit); } /// @returns the value for an integer constant of the given type that has all From sabre at nondot.org Tue Apr 10 02:06:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 02:06:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APSInt.h Message-ID: <200704100706.l3A76eq8024589@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APSInt.h updated: 1.1 -> 1.2 --- Log message: add missing methods, mark stuff const --- Diffs of the changes: (+9 -1) APSInt.h | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm/include/llvm/ADT/APSInt.h diff -u llvm/include/llvm/ADT/APSInt.h:1.1 llvm/include/llvm/ADT/APSInt.h:1.2 --- llvm/include/llvm/ADT/APSInt.h:1.1 Thu Apr 5 00:20:11 2007 +++ llvm/include/llvm/ADT/APSInt.h Tue Apr 10 02:06:21 2007 @@ -68,13 +68,21 @@ *this = sdiv(RHS); return *this; } + APSInt operator%(const APSInt &RHS) const { + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); + return IsUnsigned ? urem(RHS) : srem(RHS); + } + APSInt operator/(const APSInt &RHS) const { + assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!"); + return IsUnsigned ? udiv(RHS) : sdiv(RHS); + } const APSInt &operator>>=(unsigned Amt) { *this = *this >> Amt; return *this; } - APSInt operator>>(unsigned Amt) { + APSInt operator>>(unsigned Amt) const { return IsUnsigned ? lshr(Amt) : ashr(Amt); } From rspencer at reidspencer.com Tue Apr 10 08:36:20 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Apr 2007 13:36:20 +0000 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h In-Reply-To: <200704100643.l3A6hZL3023903@zion.cs.uiuc.edu> References: <200704100643.l3A6hZL3023903@zion.cs.uiuc.edu> Message-ID: <1176212180.9947.729.camel@bashful.x10sys.com> Chris, On Tue, 2007-04-10 at 01:43 -0500, Chris Lattner wrote: > > Changes in directory llvm/include/llvm/ADT: > > APInt.h updated: 1.63 -> 1.64 > --- > Log message: > > add a method > > > --- > Diffs of the changes: (+7 -0) > > APInt.h | 7 +++++++ > 1 files changed, 7 insertions(+) > > > Index: llvm/include/llvm/ADT/APInt.h > diff -u llvm/include/llvm/ADT/APInt.h:1.63 llvm/include/llvm/ADT/APInt.h:1.64 > --- llvm/include/llvm/ADT/APInt.h:1.63 Wed Apr 4 01:18:21 2007 > +++ llvm/include/llvm/ADT/APInt.h Tue Apr 10 01:43:18 2007 > @@ -281,6 +281,13 @@ > return *this != 0; > } > > + /// getLimitedValue - Return this value, or return all ones if it is too large > + /// to return. The comment here doesn't match the action of the function. The Limit parameter is returned not "all ones". All ones is only the default Limit. Reid. > + uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const { > + return (getActiveBits() > 64 || getZExtValue() > Limit) ? > + Limit : getZExtValue(); > + } > + > /// @} > /// @name Value Generators > /// @{ > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Tue Apr 10 08:59:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 08:59:13 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704101359.l3ADxDTS009382@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.53 -> 1.54 --- Log message: Add a discussion topic for maintenance of a road map. --- Diffs of the changes: (+8 -2) DevMtgMay2007.html | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.53 llvm-www/DevMtgMay2007.html:1.54 --- llvm-www/DevMtgMay2007.html:1.53 Mon Apr 9 21:34:10 2007 +++ llvm-www/DevMtgMay2007.html Tue Apr 10 08:58:56 2007 @@ -148,11 +148,17 @@ - +
    Unconfirmed Attendees
    NameOrganization
    Owen AndersonIntegration of HLVM into LLVM - its future as an LLVM subproject, and plans for making LLVM more accessible to scripting and higher level language front ends.
    Christopher LambConcurrency Primitives: for multi-threaded +
    Christopher LambConcurrency Primitives - for multi-threaded shared memory models. Though I don't claim to be any sort of expert myself, I've spent some time looking over the Java Memory Model revision and discussions and I think it would be worth discussing similar issues with regards to LLVM.
    Reid SpencerDo we want an LLVM road map? - does the + development community care to disclose and maintain advance informationa + bout what is being worked on? A page listing Bugzilla #, Title, Owner, + and Expected Release would give new users an idea of what is being worked + on. The details of each new feature could be tracked in + Bugzilla.
    @@ -292,6 +298,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/10 02:34:10 $ +
    Last modified: $Date: 2007/04/10 13:58:56 $ From dpatel at apple.com Tue Apr 10 10:43:53 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 10 Apr 2007 10:43:53 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200704101543.l3AFhrnF012137@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.132 -> 1.133 --- Log message: Enable loop rotate pass. --- Diffs of the changes: (+1 -0) opt.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.132 llvm/tools/opt/opt.cpp:1.133 --- llvm/tools/opt/opt.cpp:1.132 Tue Mar 6 18:26:10 2007 +++ llvm/tools/opt/opt.cpp Tue Apr 10 10:43:36 2007 @@ -212,6 +212,7 @@ addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, createReassociatePass()); // Reassociate expressions + addPass(PM, createLoopRotatePass()); addPass(PM, createLICMPass()); // Hoist loop invariants addPass(PM, createLoopUnswitchPass()); // Unswitch loops. addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc From sabre at nondot.org Tue Apr 10 11:33:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 11:33:24 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200704101633.l3AGXOwm013319@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.64 -> 1.65 --- Log message: fix a comment bug Reid noticed --- Diffs of the changes: (+3 -2) APInt.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.64 llvm/include/llvm/ADT/APInt.h:1.65 --- llvm/include/llvm/ADT/APInt.h:1.64 Tue Apr 10 01:43:18 2007 +++ llvm/include/llvm/ADT/APInt.h Tue Apr 10 11:33:06 2007 @@ -281,8 +281,9 @@ return *this != 0; } - /// getLimitedValue - Return this value, or return all ones if it is too large - /// to return. + /// getLimitedValue - If this value is smaller than the specified limit, + /// return it, otherwise return the limit value. This causes the value + /// to saturate to the limit. uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const { return (getActiveBits() > 64 || getZExtValue() > Limit) ? Limit : getZExtValue(); From dpatel at apple.com Tue Apr 10 11:57:26 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 10 Apr 2007 11:57:26 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/LoopRotate/pr1154.ll Message-ID: <200704101657.l3AGvQbe013797@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/LoopRotate: pr1154.ll added (r1.1) --- Log message: Add test case for PR 1154: http://llvm.org/PR1154 . --- Diffs of the changes: (+125 -0) pr1154.ll | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 125 insertions(+) Index: llvm/test/Transforms/LoopRotate/pr1154.ll diff -c /dev/null llvm/test/Transforms/LoopRotate/pr1154.ll:1.1 *** /dev/null Tue Apr 10 11:57:18 2007 --- llvm/test/Transforms/LoopRotate/pr1154.ll Tue Apr 10 11:57:08 2007 *************** *** 0 **** --- 1,125 ---- + ; RUN: llvm-upgrade < %s | llvm-as | opt -std-compile-opts | llvm-dis | %prcontext strstr 2 | grep -v declare |grep "bb36.outer:" + @str = internal constant [68 x i8] c"Dot. date. datum. 123. Some more doubtful demonstration dummy data.\00" ; <[68 x i8]*> [#uses=1] + @str1 = internal constant [5 x i8] c"ummy\00" ; <[5 x i8]*> [#uses=1] + @str2 = internal constant [6 x i8] c" data\00" ; <[6 x i8]*> [#uses=1] + @str3 = internal constant [3 x i8] c"by\00" ; <[3 x i8]*> [#uses=1] + + i32 @stringSearch_Clib(i32 %count) { + entry: + %count_addr = alloca i32 ; [#uses=2] + %retval = alloca i32, align 4 ; [#uses=2] + %tmp = alloca i32, align 4 ; [#uses=2] + %i = alloca i32, align 4 ; [#uses=5] + %c = alloca i32, align 4 ; [#uses=9] + %j = alloca i32, align 4 ; [#uses=4] + %p = alloca i8*, align 4 ; [#uses=6] + %b = alloca [68 x i8], align 16 ; <[68 x i8]*> [#uses=6] + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %count, i32* %count_addr + store i32 0, i32* %c + %b1 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %tmp2 = getelementptr [68 x i8]* @str, i32 0, i32 0 ; [#uses=1] + call void @llvm.memcpy.i32( i8* %b1, i8* %tmp2, i32 68, i32 1 ) + store i32 0, i32* %j + br label %bb41 + + bb: ; preds = %bb41 + store i32 0, i32* %i + %tmp3 = load i32* %i ; [#uses=1] + store i32 %tmp3, i32* %c + br label %bb36 + + bb4: ; preds = %bb36 + %b5 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %tmp6 = getelementptr [5 x i8]* @str1, i32 0, i32 0 ; [#uses=1] + %tmp7 = call i8* @strstr( i8* %b5, i8* %tmp6 ) ; [#uses=1] + store i8* %tmp7, i8** %p + %tmp8 = load i8** %p ; [#uses=1] + %ttmp8 = icmp ne i8* %tmp8, null ; :0 [#uses=1] + %ttmp10 = zext i1 %ttmp8 to i8 ; :1 [#uses=1] + %ttmp7 = icmp ne i8 %ttmp10, 0 ; :2 [#uses=1] + br i1 %ttmp7, label %cond_true, label %cond_next + + cond_true: ; preds = %bb4 + %tmp9 = load i8** %p ; [#uses=1] + %tmp910 = ptrtoint i8* %tmp9 to i32 ; [#uses=1] + %b11 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %b1112 = ptrtoint i8* %b11 to i32 ; [#uses=1] + %tmp13 = sub i32 %tmp910, %b1112 ; [#uses=1] + %tmp14 = load i32* %c ; [#uses=1] + %tmp15 = add i32 %tmp13, %tmp14 ; [#uses=1] + store i32 %tmp15, i32* %c + br label %cond_next + + cond_next: ; preds = %cond_true, %bb4 + %b16 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %tmp17 = getelementptr [6 x i8]* @str2, i32 0, i32 0 ; [#uses=1] + %tmp18 = call i8* @strstr( i8* %b16, i8* %tmp17 ) ; [#uses=1] + store i8* %tmp18, i8** %p + %tmp19 = load i8** %p ; [#uses=1] + %ttmp6 = icmp ne i8* %tmp19, null ; :3 [#uses=1] + %ttmp9 = zext i1 %ttmp6 to i8 ; :4 [#uses=1] + %ttmp4 = icmp ne i8 %ttmp9, 0 ; :5 [#uses=1] + br i1 %ttmp4, label %cond_true20, label %cond_next28 + + cond_true20: ; preds = %cond_next + %tmp21 = load i8** %p ; [#uses=1] + %tmp2122 = ptrtoint i8* %tmp21 to i32 ; [#uses=1] + %b23 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %b2324 = ptrtoint i8* %b23 to i32 ; [#uses=1] + %tmp25 = sub i32 %tmp2122, %b2324 ; [#uses=1] + %tmp26 = load i32* %c ; [#uses=1] + %tmp27 = add i32 %tmp25, %tmp26 ; [#uses=1] + store i32 %tmp27, i32* %c + br label %cond_next28 + + cond_next28: ; preds = %cond_true20, %cond_next + %b29 = bitcast [68 x i8]* %b to i8* ; [#uses=1] + %tmp30 = getelementptr [3 x i8]* @str3, i32 0, i32 0 ; [#uses=1] + %tmp31 = call i32 @strcspn( i8* %b29, i8* %tmp30 ) ; [#uses=1] + %tmp32 = load i32* %c ; [#uses=1] + %tmp33 = add i32 %tmp31, %tmp32 ; [#uses=1] + store i32 %tmp33, i32* %c + %tmp34 = load i32* %i ; [#uses=1] + %tmp35 = add i32 %tmp34, 1 ; [#uses=1] + store i32 %tmp35, i32* %i + br label %bb36 + + bb36: ; preds = %cond_next28, %bb + %tmp37 = load i32* %i ; [#uses=1] + %ttmp3= icmp sle i32 %tmp37, 249 ; :6 [#uses=1] + %ttmp12 = zext i1 %ttmp3 to i8 ; :7 [#uses=1] + %ttmp1 = icmp ne i8 %ttmp12, 0 ; :8 [#uses=1] + br i1 %ttmp1, label %bb4, label %bb38 + + bb38: ; preds = %bb36 + %tmp39 = load i32* %j ; [#uses=1] + %tmp40 = add i32 %tmp39, 1 ; [#uses=1] + store i32 %tmp40, i32* %j + br label %bb41 + + bb41: ; preds = %bb38, %entry + %tmp42 = load i32* %j ; [#uses=1] + %tmp43 = load i32* %count_addr ; [#uses=1] + %ttmp2 = icmp slt i32 %tmp42, %tmp43 ; :9 [#uses=1] + %ttmp11 = zext i1 %ttmp2 to i8 ; :10 [#uses=1] + %ttmp5 = icmp ne i8 %ttmp11, 0 ; :11 [#uses=1] + br i1 %ttmp5, label %bb, label %bb44 + + bb44: ; preds = %bb41 + %tmp45 = load i32* %c ; [#uses=1] + store i32 %tmp45, i32* %tmp + %tmp46 = load i32* %tmp ; [#uses=1] + store i32 %tmp46, i32* %retval + br label %return + + return: ; preds = %bb44 + %retval47 = load i32* %retval ; [#uses=1] + ret i32 %retval47 + } + + declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) + + declare i8* @strstr(i8*, i8*) + + declare i32 @strcspn(i8*, i8*) From jeffc at jolt-lang.org Tue Apr 10 14:14:00 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 10 Apr 2007 14:14:00 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200704101914.l3AJE0h5016700@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.69 -> 1.70 --- Log message: Correctly report version of GCC used. --- Diffs of the changes: (+2 -0) NewNightlyTest.pl | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.69 llvm/utils/NewNightlyTest.pl:1.70 --- llvm/utils/NewNightlyTest.pl:1.69 Sat Apr 7 00:20:07 2007 +++ llvm/utils/NewNightlyTest.pl Tue Apr 10 14:13:43 2007 @@ -1050,6 +1050,8 @@ $gcc_version_long=""; if ($GCCPATH ne "") { $gcc_version_long = `$GCCPATH/gcc --version`; +} elsif ($ENV{"CC"}) { + $gcc_version_long = `$ENV{"CC"} --version`; } else { $gcc_version_long = `gcc --version`; } From sabre at nondot.org Tue Apr 10 16:14:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 16:14:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200704102114.l3ALETRh018912@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.162 -> 1.163 --- Log message: new micro optzn --- Diffs of the changes: (+30 -0) README.txt | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.162 llvm/lib/Target/X86/README.txt:1.163 --- llvm/lib/Target/X86/README.txt:1.162 Tue Apr 3 18:41:34 2007 +++ llvm/lib/Target/X86/README.txt Tue Apr 10 16:14:01 2007 @@ -1047,3 +1047,33 @@ } +//===---------------------------------------------------------------------===// + +Consider: + +int isnegative(unsigned int X) { + return !(X < 2147483648U); +} + +We current compile this to: + +define i32 @isnegative(i32 %X) { + icmp slt i32 %X, 0 ; :0 [#uses=1] + %retval = zext i1 %0 to i32 ; [#uses=1] + ret i32 %retval +} + +and: + +_isnegative: + cmpl $0, 4(%esp) + sets %al + movzbl %al, %eax + ret + +We should produce: + + movl 4(%esp), %eax + shrl $31, %eax + ret + From asl at math.spbu.ru Tue Apr 10 16:16:26 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 10 Apr 2007 16:16:26 -0500 Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html Message-ID: <200704102116.l3ALGQqX019007@zion.cs.uiuc.edu> Changes in directory llvm-www: OpenProjects.html updated: 1.25 -> 1.26 --- Log message: Add new idea --- Diffs of the changes: (+11 -6) OpenProjects.html | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.25 llvm-www/OpenProjects.html:1.26 --- llvm-www/OpenProjects.html:1.25 Wed Apr 4 22:55:22 2007 +++ llvm-www/OpenProjects.html Tue Apr 10 16:16:08 2007 @@ -319,11 +319,16 @@
      -
    1. Implement GVN-PRE, a powerful and simple Partial Redundancy Elimination -algorithm for SSA form (in progress, ask on llvmdev)
    2. -
    3. Implement a Dependence Analysis Infrastructure
      - - Design some way to represent and query dep analysis
    4. -
    5. Value range propagation pass
    6. +
    7. Implement GVN-PRE, a powerful and simple Partial Redundancy Elimination + algorithm for SSA form (in progress, ask on llvmdev)
    8. +
    9. Implement a Dependence Analysis Infrastructure
      + - Design some way to represent and query dep analysis
    10. +
    11. Value range propagation pass
    12. +
    13. More fun with loops: + + Predictive Commoning + +
    @@ -406,7 +411,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/05 03:55:22 $ + Last modified: $Date: 2007/04/10 21:16:08 $ From dpatel at apple.com Tue Apr 10 16:43:24 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 10 Apr 2007 16:43:24 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2007-04-10-PackedUnion.cpp Message-ID: <200704102143.l3ALhOPx019591@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2007-04-10-PackedUnion.cpp added (r1.1) --- Log message: New test case. --- Diffs of the changes: (+41 -0) 2007-04-10-PackedUnion.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+) Index: llvm/test/C++Frontend/2007-04-10-PackedUnion.cpp diff -c /dev/null llvm/test/C++Frontend/2007-04-10-PackedUnion.cpp:1.1 *** /dev/null Tue Apr 10 16:43:11 2007 --- llvm/test/C++Frontend/2007-04-10-PackedUnion.cpp Tue Apr 10 16:43:01 2007 *************** *** 0 **** --- 1,41 ---- + // RUN: %llvmgxx -S %s -o /dev/null + extern "C" { + + #pragma pack(push, 2) + typedef struct ABC* abc; + + struct ABCS { + float red; + float green; + float blue; + float alpha; + }; + + typedef void (*XYZ)(); + #pragma pack(pop) + } + + + union ABCU { + ABCS color; + XYZ bg; + }; + + struct AData { + ABCU data; + }; + + class L { + public: + L() {} + L(const L& other); + + private: + AData fdata; + }; + + + L::L(const L& other) + { + fdata = other.fdata; + } From dpatel at apple.com Tue Apr 10 16:43:40 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Tue, 10 Apr 2007 14:43:40 -0700 (PDT) Subject: [llvm-commits] [125951] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070409/047164.html Message-ID: <20070410214340.4936EE182629@src> Revision: 125951 Author: dpatel Date: 2007-04-10 14:43:39 -0700 (Tue, 10 Apr 2007) Log Message: ----------- Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070409/047164.html Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-10 18:47:54 UTC (rev 125950) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-10 21:43:39 UTC (rev 125951) @@ -1226,11 +1226,10 @@ // ordering. Therefore convert to a packed struct and try again. Info.convertToPacked(); DecodeStructFields(Field, Info); - } - - // At this point, we know that adding the element will happen at the right - // offset. Add it. - Info.addElement(Ty, StartOffsetInBytes, Info.getTypeSize(Ty)); + } else + // At this point, we know that adding the element will happen at the right + // offset. Add it. + Info.addElement(Ty, StartOffsetInBytes, Info.getTypeSize(Ty)); } /// DecodeStructBitField - This method decodes the specified bit-field, adding From isanbard at gmail.com Tue Apr 10 17:10:43 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 10 Apr 2007 17:10:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86.td X86CodeEmitter.cpp X86InstrInfo.h X86InstrInfo.td X86InstrSSE.td X86Subtarget.cpp X86Subtarget.h Message-ID: <200704102210.l3AMAhPD020171@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86.td updated: 1.29 -> 1.30 X86CodeEmitter.cpp updated: 1.131 -> 1.132 X86InstrInfo.h updated: 1.62 -> 1.63 X86InstrInfo.td updated: 1.300 -> 1.301 X86InstrSSE.td updated: 1.179 -> 1.180 X86Subtarget.cpp updated: 1.53 -> 1.54 X86Subtarget.h updated: 1.28 -> 1.29 --- Log message: Add support for our first SSSE3 instruction "pmulhrsw". --- Diffs of the changes: (+54 -10) X86.td | 2 ++ X86CodeEmitter.cpp | 8 ++++++++ X86InstrInfo.h | 5 ++++- X86InstrInfo.td | 3 +++ X86InstrSSE.td | 40 +++++++++++++++++++++++++++++++++------- X86Subtarget.cpp | 1 + X86Subtarget.h | 5 +++-- 7 files changed, 54 insertions(+), 10 deletions(-) Index: llvm/lib/Target/X86/X86.td diff -u llvm/lib/Target/X86/X86.td:1.29 llvm/lib/Target/X86/X86.td:1.30 --- llvm/lib/Target/X86/X86.td:1.29 Mon Feb 26 12:17:14 2007 +++ llvm/lib/Target/X86/X86.td Tue Apr 10 17:10:25 2007 @@ -30,6 +30,8 @@ "Enable SSE2 instructions">; def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", "Enable SSE3 instructions">; +def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", + "Enable SSSE3 instructions">; def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", "Enable 3DNow! instructions">; def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.131 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.132 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.131 Wed Mar 14 15:20:19 2007 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue Apr 10 17:10:25 2007 @@ -584,6 +584,14 @@ case X86II::TB: Need0FPrefix = true; // Two-byte opcode prefix break; + case X86II::T8: + MCE.emitByte(0x0F); + MCE.emitByte(0x38); + break; + case X86II::TA: + MCE.emitByte(0x0F); + MCE.emitByte(0x3A); + break; case X86II::REP: break; // already handled. case X86II::XS: // F3 0F MCE.emitByte(0xF3); Index: llvm/lib/Target/X86/X86InstrInfo.h diff -u llvm/lib/Target/X86/X86InstrInfo.h:1.62 llvm/lib/Target/X86/X86InstrInfo.h:1.63 --- llvm/lib/Target/X86/X86InstrInfo.h:1.62 Fri Jan 26 08:34:52 2007 +++ llvm/lib/Target/X86/X86InstrInfo.h Tue Apr 10 17:10:25 2007 @@ -154,7 +154,10 @@ // XS, XD - These prefix codes are for single and double precision scalar // floating point operations performed in the SSE registers. - XD = 11 << Op0Shift, XS = 12 << Op0Shift, + XD = 11 << Op0Shift, XS = 12 << Op0Shift, + + // T8, TA - Prefix after the 0x0F prefix. + T8 = 13 << Op0Shift, TA = 14 << Op0Shift, //===------------------------------------------------------------------===// // REX_W - REX prefixes are instruction prefixes used in 64-bit mode. Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.300 llvm/lib/Target/X86/X86InstrInfo.td:1.301 --- llvm/lib/Target/X86/X86InstrInfo.td:1.300 Tue Mar 20 19:16:56 2007 +++ llvm/lib/Target/X86/X86InstrInfo.td Tue Apr 10 17:10:25 2007 @@ -167,6 +167,7 @@ def HasSSE1 : Predicate<"Subtarget->hasSSE1()">; def HasSSE2 : Predicate<"Subtarget->hasSSE2()">; def HasSSE3 : Predicate<"Subtarget->hasSSE3()">; +def HasSSSE3 : Predicate<"Subtarget->hasSSSE3()">; def FPStack : Predicate<"!Subtarget->hasSSE2()">; def In32BitMode : Predicate<"!Subtarget->is64Bit()">; def In64BitMode : Predicate<"Subtarget->is64Bit()">; @@ -248,6 +249,8 @@ class DF { bits<4> Prefix = 10; } class XD { bits<4> Prefix = 11; } class XS { bits<4> Prefix = 12; } +class T8 { bits<4> Prefix = 13; } +class TA { bits<4> Prefix = 14; } //===----------------------------------------------------------------------===// Index: llvm/lib/Target/X86/X86InstrSSE.td diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.179 llvm/lib/Target/X86/X86InstrSSE.td:1.180 --- llvm/lib/Target/X86/X86InstrSSE.td:1.179 Tue Mar 20 19:16:56 2007 +++ llvm/lib/Target/X86/X86InstrSSE.td Tue Apr 10 17:10:25 2007 @@ -183,15 +183,17 @@ //===----------------------------------------------------------------------===// // Instruction templates -// SSI - SSE1 instructions with XS prefix. -// SDI - SSE2 instructions with XD prefix. -// PSI - SSE1 instructions with TB prefix. -// PDI - SSE2 instructions with TB and OpSize prefixes. +// SSI - SSE1 instructions with XS prefix. +// SDI - SSE2 instructions with XD prefix. +// PSI - SSE1 instructions with TB prefix. +// PDI - SSE2 instructions with TB and OpSize prefixes. // PSIi8 - SSE1 instructions with ImmT == Imm8 and TB prefix. // PDIi8 - SSE2 instructions with ImmT == Imm8 and TB and OpSize prefixes. -// S3I - SSE3 instructions with TB and OpSize prefixes. -// S3SI - SSE3 instructions with XS prefix. -// S3DI - SSE3 instructions with XD prefix. +// S3I - SSE3 instructions with TB and OpSize prefixes. +// S3SI - SSE3 instructions with XS prefix. +// S3DI - SSE3 instructions with XD prefix. +// SS38I - SSSE3 instructions with T8 and OpSize prefixes. +// SS3AI - SSSE3 instructions with TA and OpSize prefixes. class SSI o, Format F, dag ops, string asm, list pattern> : I, XS, Requires<[HasSSE1]>; class SDI o, Format F, dag ops, string asm, list pattern> @@ -212,6 +214,11 @@ class S3I o, Format F, dag ops, string asm, list pattern> : I, TB, OpSize, Requires<[HasSSE3]>; +class SS38I o, Format F, dag ops, string asm, list pattern> + : I, T8, OpSize, Requires<[HasSSSE3]>; +class SS3AI o, Format F, dag ops, string asm, list pattern> + : I, TA, OpSize, Requires<[HasSSSE3]>; + //===----------------------------------------------------------------------===// // Helpers for defining instructions that directly correspond to intrinsics. @@ -1311,6 +1318,22 @@ } } +/// SS3I_binop_rm_int - Simple SSSE3 binary operatr whose type is v2i64. +let isTwoAddress = 1 in { + multiclass SS3I_binop_rm_int opc, string OpcodeStr, Intrinsic IntId, + bit Commutable = 0> { + def rr : SS38I { + let isCommutable = Commutable; + } + def rm : SS38I; + } +} // 128-bit Integer Arithmetic @@ -1340,6 +1363,9 @@ defm PMULHW : PDI_binop_rm_int<0xE5, "pmulhw" , int_x86_sse2_pmulh_w , 1>; defm PMULUDQ : PDI_binop_rm_int<0xF4, "pmuludq", int_x86_sse2_pmulu_dq, 1>; +defm PMULHRSW128 : SS3I_binop_rm_int<0x0B, "pmulhrsw", + int_x86_ssse3_pmulhrsw_128, 1>; + defm PMADDWD : PDI_binop_rm_int<0xF5, "pmaddwd", int_x86_sse2_pmadd_wd, 1>; defm PAVGB : PDI_binop_rm_int<0xE0, "pavgb", int_x86_sse2_pavg_b, 1>; Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.53 llvm/lib/Target/X86/X86Subtarget.cpp:1.54 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.53 Fri Mar 23 18:46:48 2007 +++ llvm/lib/Target/X86/X86Subtarget.cpp Tue Apr 10 17:10:25 2007 @@ -113,6 +113,7 @@ if ((EDX >> 25) & 0x1) X86SSELevel = SSE1; if ((EDX >> 26) & 0x1) X86SSELevel = SSE2; if (ECX & 0x1) X86SSELevel = SSE3; + if ((ECX >> 9) & 0x1) X86SSELevel = SSSE3; if (memcmp(text.c, "GenuineIntel", 12) == 0) { X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); Index: llvm/lib/Target/X86/X86Subtarget.h diff -u llvm/lib/Target/X86/X86Subtarget.h:1.28 llvm/lib/Target/X86/X86Subtarget.h:1.29 --- llvm/lib/Target/X86/X86Subtarget.h:1.28 Tue Jan 16 11:51:40 2007 +++ llvm/lib/Target/X86/X86Subtarget.h Tue Apr 10 17:10:25 2007 @@ -38,7 +38,7 @@ }; protected: enum X86SSEEnum { - NoMMXSSE, MMX, SSE1, SSE2, SSE3 + NoMMXSSE, MMX, SSE1, SSE2, SSE3, SSSE3 }; enum X863DNowEnum { @@ -51,7 +51,7 @@ /// PICStyle - Which PIC style to use PICStyle::Style PICStyle; - /// X86SSELevel - MMX, SSE1, SSE2, SSE3, or none supported. + /// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, or none supported. X86SSEEnum X86SSELevel; /// X863DNowLevel - 3DNow or 3DNow Athlon, or none supported. @@ -110,6 +110,7 @@ bool hasSSE1() const { return X86SSELevel >= SSE1; } bool hasSSE2() const { return X86SSELevel >= SSE2; } bool hasSSE3() const { return X86SSELevel >= SSE3; } + bool hasSSSE3() const { return X86SSELevel >= SSSE3; } bool has3DNow() const { return X863DNowLevel >= ThreeDNow; } bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; } From isanbard at gmail.com Tue Apr 10 17:10:44 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 10 Apr 2007 17:10:44 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicsX86.td Message-ID: <200704102210.l3AMAiea020176@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicsX86.td updated: 1.42 -> 1.43 --- Log message: Add support for our first SSSE3 instruction "pmulhrsw". --- Diffs of the changes: (+10 -0) IntrinsicsX86.td | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/include/llvm/IntrinsicsX86.td diff -u llvm/include/llvm/IntrinsicsX86.td:1.42 llvm/include/llvm/IntrinsicsX86.td:1.43 --- llvm/include/llvm/IntrinsicsX86.td:1.42 Tue Apr 3 18:48:32 2007 +++ llvm/include/llvm/IntrinsicsX86.td Tue Apr 10 17:10:25 2007 @@ -537,6 +537,16 @@ } //===----------------------------------------------------------------------===// +// SSSE3 + +// FP arithmetic ops +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_ssse3_pmulhrsw_128 : GCCBuiltin<"__builtin_ia32_pmulhrsw128">, + Intrinsic<[llvm_v8i16_ty, llvm_v8i16_ty, + llvm_v8i16_ty], [IntrNoMem]>; +} + +//===----------------------------------------------------------------------===// // MMX // Empty MMX state op. From bwendlin at apple.com Tue Apr 10 17:10:29 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Tue, 10 Apr 2007 15:10:29 -0700 (PDT) Subject: [llvm-commits] [125952] Add SSSSE3 support as a feature. Message-ID: <20070410221029.D8A58E1A76A5@src> Revision: 125952 Author: bwendlin Date: 2007-04-10 15:10:29 -0700 (Tue, 10 Apr 2007) Log Message: ----------- Add SSSSE3 support as a feature. Modified Paths: -------------- apple-local/branches/llvm/gcc/config/i386/i386.h Modified: apple-local/branches/llvm/gcc/config/i386/i386.h =================================================================== --- apple-local/branches/llvm/gcc/config/i386/i386.h 2007-04-10 21:43:39 UTC (rev 125951) +++ apple-local/branches/llvm/gcc/config/i386/i386.h 2007-04-10 22:10:29 UTC (rev 125952) @@ -4038,6 +4038,7 @@ if (TARGET_SSE) F.AddFeature("sse"); \ if (TARGET_SSE2) F.AddFeature("sse2"); \ if (TARGET_SSE3) F.AddFeature("sse3"); \ + if (TARGET_SSSE3) F.AddFeature("ssse3"); \ if (TARGET_3DNOW) F.AddFeature("3dnow"); \ if (TARGET_3DNOW_A) F.AddFeature("3dnowa"); \ } From sabre at nondot.org Tue Apr 10 18:51:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 18:51:43 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2007-04-10-BitfieldTest.c Makefile Message-ID: <200704102351.l3ANphBK021991@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: 2007-04-10-BitfieldTest.c added (r1.1) Makefile updated: 1.12 -> 1.13 --- Log message: new testcase --- Diffs of the changes: (+32 -1) 2007-04-10-BitfieldTest.c | 31 +++++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/2007-04-10-BitfieldTest.c diff -c /dev/null llvm-test/SingleSource/UnitTests/2007-04-10-BitfieldTest.c:1.1 *** /dev/null Tue Apr 10 18:51:35 2007 --- llvm-test/SingleSource/UnitTests/2007-04-10-BitfieldTest.c Tue Apr 10 18:51:25 2007 *************** *** 0 **** --- 1,31 ---- + #include + #include + + union u { + struct { + unsigned int a : 8; + unsigned int b : 3; + unsigned int c : 3; + unsigned int d : 3; + unsigned int e : 3; + unsigned int f : 3; + unsigned int g : 3; + unsigned int h : 3; + unsigned int i : 3; + + unsigned int n : 8; + unsigned int o : 8; + unsigned int p : 8; + unsigned int q : 8; + } s; + unsigned long long token; + }; + + int main(int argc, char *argv[]) + { + union u uu; + uu.token = 0x012492490000FFFFULL; + printf("p = 0x%02X\n", uu.s.p); + return 0; + } + Index: llvm-test/SingleSource/UnitTests/Makefile diff -u llvm-test/SingleSource/UnitTests/Makefile:1.12 llvm-test/SingleSource/UnitTests/Makefile:1.13 --- llvm-test/SingleSource/UnitTests/Makefile:1.12 Thu Jan 18 20:36:58 2007 +++ llvm-test/SingleSource/UnitTests/Makefile Tue Apr 10 18:51:25 2007 @@ -2,7 +2,7 @@ LEVEL = ../.. include $(LEVEL)/Makefile.config -DIRS := SetjmpLongjmp +DIRS := # llvm-gcc3 does not support any vector tests. ifneq ($(LLVMGCC_MAJVERS),3) From sabre at nondot.org Tue Apr 10 18:51:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 18:51:45 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c Message-ID: <200704102351.l3ANpjBa021996@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Vector/Altivec: alti.stepfft.c updated: 1.3 -> 1.4 --- Log message: new testcase --- Diffs of the changes: (+0 -1) alti.stepfft.c | 1 - 1 files changed, 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c diff -u llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c:1.3 llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c:1.4 --- llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c:1.3 Tue Apr 4 13:56:15 2006 +++ llvm-test/SingleSource/UnitTests/Vector/Altivec/alti.stepfft.c Tue Apr 10 18:51:25 2007 @@ -76,7 +76,6 @@ float x[][2],y[][2],w[][2],sign; { int jb, m, j, mj, tgle; - void ccopy(),step(); m = (int) (log((float) n)/log(1.99)); mj = 1; tgle = 1; /* toggling switch for work array */ From sabre at nondot.org Tue Apr 10 18:53:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 18:53:04 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Makefile Message-ID: <200704102353.l3ANr4Is022047@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: Makefile updated: 1.13 -> 1.14 --- Log message: revert accidental commit --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Makefile diff -u llvm-test/SingleSource/UnitTests/Makefile:1.13 llvm-test/SingleSource/UnitTests/Makefile:1.14 --- llvm-test/SingleSource/UnitTests/Makefile:1.13 Tue Apr 10 18:51:25 2007 +++ llvm-test/SingleSource/UnitTests/Makefile Tue Apr 10 18:52:47 2007 @@ -2,7 +2,7 @@ LEVEL = ../.. include $(LEVEL)/Makefile.config -DIRS := +DIRS := SetjmpLongjmp # llvm-gcc3 does not support any vector tests. ifneq ($(LLVMGCC_MAJVERS),3) From reid at x10sys.com Tue Apr 10 19:27:57 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 19:27:57 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200704110027.l3B0RvqW022581@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.273 -> 1.274 --- Log message: Hopefully fix LTDL_SHLIB_EXT on Darwin --- Diffs of the changes: (+5 -5) configure | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/configure diff -u llvm/configure:1.273 llvm/configure:1.274 --- llvm/configure:1.273 Mon Apr 2 10:41:39 2007 +++ llvm/configure Tue Apr 10 19:27:39 2007 @@ -8765,7 +8765,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -15862,7 +15862,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -19925,7 +19925,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -22540,7 +22540,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -25167,7 +25167,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` From reid at x10sys.com Tue Apr 10 19:34:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 19:34:00 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/libtool.m4 Message-ID: <200704110034.l3B0Y0H7022695@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: libtool.m4 updated: 1.8 -> 1.9 --- Log message: Hack the shared library extension for dylib. The existing code just looks plain wrong since $module was never defined so we always get .so which is broken on Darwin. Just force it to .dylib. --- Diffs of the changes: (+1 -1) libtool.m4 | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/autoconf/m4/libtool.m4 diff -u llvm/autoconf/m4/libtool.m4:1.8 llvm/autoconf/m4/libtool.m4:1.9 --- llvm/autoconf/m4/libtool.m4:1.8 Wed Aug 9 00:38:51 2006 +++ llvm/autoconf/m4/libtool.m4 Tue Apr 10 19:33:43 2007 @@ -1365,7 +1365,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + shrext_cmds='.dylib' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` From reid at x10sys.com Tue Apr 10 19:49:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 19:49:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200704110049.l3B0nuab022989@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.22 -> 1.23 --- Log message: Make isDynamicLibrary detect more than just an ELF file. --- Diffs of the changes: (+10 -2) Path.cpp | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.22 llvm/lib/System/Path.cpp:1.23 --- llvm/lib/System/Path.cpp:1.22 Wed Apr 4 01:30:26 2007 +++ llvm/lib/System/Path.cpp Tue Apr 10 19:49:39 2007 @@ -103,8 +103,16 @@ bool Path::isDynamicLibrary() const { - if (canRead()) - return hasMagicNumber("\177ELF"); + if (canRead()) { + std::string Magic; + if (getMagicNumber(Magic, 64)) + switch (IdentifyFileType(Magic.c_str(), Magic.length())) { + default: return false; + case ELF_FileType: + case Mach_O_FileType: + case COFF_FileType: return true; + } + } return false; } From sabre at nondot.org Tue Apr 10 19:58:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 19:58:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200704110058.l3B0wC1c023175@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ScalarReplAggregates.cpp updated: 1.81 -> 1.82 --- Log message: Simplify SROA conversion to integer in some ways, make it more general in others. We now tolerate small amounts of undefined behavior, better emulating what would happen if the transaction actually occurred in memory. This fixes SingleSource/UnitTests/2007-04-10-BitfieldTest.c on PPC, at least until Devang gets a chance to fix the CFE from doing undefined things with bitfields :) --- Diffs of the changes: (+138 -131) ScalarReplAggregates.cpp | 269 ++++++++++++++++++++++++----------------------- 1 files changed, 138 insertions(+), 131 deletions(-) Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.81 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.82 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.81 Thu Mar 22 11:38:57 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Apr 10 19:57:54 2007 @@ -911,7 +911,6 @@ /// Offset is an offset from the original alloca, in bits that need to be /// shifted to the right. By the end of this, there should be no uses of Ptr. void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) { - bool isVectorInsert = isa(NewAI->getType()->getElementType()); const TargetData &TD = getAnalysis(); while (!Ptr->use_empty()) { Instruction *User = cast(Ptr->use_back()); @@ -919,56 +918,76 @@ if (LoadInst *LI = dyn_cast(User)) { // The load is a bit extract from NewAI shifted right by Offset bits. Value *NV = new LoadInst(NewAI, LI->getName(), LI); - if (NV->getType() != LI->getType()) { - if (const VectorType *PTy = dyn_cast(NV->getType())) { - // If the result alloca is a vector type, this is either an element - // access or a bitcast to another vector type. - if (isa(LI->getType())) { - NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); - } else { - // Must be an element access. - unsigned Elt = Offset/(TD.getTypeSize(PTy->getElementType())*8); - NV = new ExtractElementInst( - NV, ConstantInt::get(Type::Int32Ty, Elt), "tmp", LI); - } - } else if (isa(NV->getType())) { - assert(isa(LI->getType())); - // Must be ptr->ptr cast. Anything else would result in NV being - // an integer. + if (NV->getType() == LI->getType()) { + // We win, no conversion needed. + } else if (const VectorType *PTy = dyn_cast(NV->getType())) { + // If the result alloca is a vector type, this is either an element + // access or a bitcast to another vector type. + if (isa(LI->getType())) { NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); } else { - assert(NV->getType()->isInteger() && "Unknown promotion!"); - if (Offset && Offset < TD.getTypeSize(NV->getType())*8) { - NV = BinaryOperator::createLShr(NV, - ConstantInt::get(NV->getType(), Offset), - LI->getName(), LI); - } - - // If the result is an integer, this is a trunc or bitcast. - if (LI->getType()->isInteger()) { - NV = CastInst::createTruncOrBitCast(NV, LI->getType(), - LI->getName(), LI); - } else if (LI->getType()->isFloatingPoint()) { - // If needed, truncate the integer to the appropriate size. - if (NV->getType()->getPrimitiveSizeInBits() > - LI->getType()->getPrimitiveSizeInBits()) { - switch (LI->getType()->getTypeID()) { - default: assert(0 && "Unknown FP type!"); - case Type::FloatTyID: - NV = new TruncInst(NV, Type::Int32Ty, LI->getName(), LI); - break; - case Type::DoubleTyID: - NV = new TruncInst(NV, Type::Int64Ty, LI->getName(), LI); - break; - } + // Must be an element access. + unsigned Elt = Offset/(TD.getTypeSize(PTy->getElementType())*8); + NV = new ExtractElementInst( + NV, ConstantInt::get(Type::Int32Ty, Elt), "tmp", LI); + } + } else if (isa(NV->getType())) { + assert(isa(LI->getType())); + // Must be ptr->ptr cast. Anything else would result in NV being + // an integer. + NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); + } else { + const IntegerType *NTy = cast(NV->getType()); + unsigned LIBitWidth = TD.getTypeSizeInBits(LI->getType()); + + // If this is a big-endian system and the load is narrower than the + // full alloca type, we need to do a shift to get the right bits. + int ShAmt = 0; + if (TD.isBigEndian()) { + ShAmt = NTy->getBitWidth()-LIBitWidth-Offset; + } else { + ShAmt = Offset; + } + + // Note: we support negative bitwidths (with shl) which are not defined. + // We do this to support (f.e.) loads off the end of a structure where + // only some bits are used. + if (ShAmt > 0 && (unsigned)ShAmt < NTy->getBitWidth()) + NV = BinaryOperator::createLShr(NV, + ConstantInt::get(NV->getType(),ShAmt), + LI->getName(), LI); + else if (ShAmt < 0 && (unsigned)-ShAmt < NTy->getBitWidth()) + NV = BinaryOperator::createShl(NV, + ConstantInt::get(NV->getType(),-ShAmt), + LI->getName(), LI); + + // Finally, unconditionally truncate the integer to the right width. + if (LIBitWidth < NTy->getBitWidth()) + NV = new TruncInst(NV, IntegerType::get(LIBitWidth), + LI->getName(), LI); + + // If the result is an integer, this is a trunc or bitcast. + if (isa(LI->getType())) { + assert(NV->getType() == LI->getType() && "Truncate wasn't enough?"); + } else if (LI->getType()->isFloatingPoint()) { + // If needed, truncate the integer to the appropriate size. + if (NTy->getBitWidth() > LIBitWidth) { + switch (LI->getType()->getTypeID()) { + default: assert(0 && "Unknown FP type!"); + case Type::FloatTyID: + NV = new TruncInst(NV, Type::Int32Ty, LI->getName(), LI); + break; + case Type::DoubleTyID: + NV = new TruncInst(NV, Type::Int64Ty, LI->getName(), LI); + break; } - - // Then do a bitcast. - NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); - } else { - // Otherwise must be a pointer. - NV = new IntToPtrInst(NV, LI->getType(), LI->getName(), LI); } + + // Then do a bitcast. + NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); + } else { + // Otherwise must be a pointer. + NV = new IntToPtrInst(NV, LI->getType(), LI->getName(), LI); } } LI->replaceAllUsesWith(NV); @@ -980,81 +999,83 @@ // then 'or' into place. Value *SV = SI->getOperand(0); const Type *AllocaType = NewAI->getType()->getElementType(); - if (SV->getType() != AllocaType) { + if (SV->getType() == AllocaType) { + // All is well. + } else if (const VectorType *PTy = dyn_cast(AllocaType)) { Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI); - - if (const VectorType *PTy = dyn_cast(AllocaType)) { - // If the result alloca is a vector type, this is either an element - // access or a bitcast to another vector type. - if (isa(SV->getType())) { - SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); - } else { - // Must be an element insertion. - unsigned Elt = Offset/(TD.getTypeSize(PTy->getElementType())*8); - SV = new InsertElementInst(Old, SV, - ConstantInt::get(Type::Int32Ty, Elt), - "tmp", SI); - } - } else { - // If SV is a float, convert it to the appropriate integer type. - // If it is a pointer, do the same, and also handle ptr->ptr casts - // here. - switch (SV->getType()->getTypeID()) { - default: - assert(!SV->getType()->isFloatingPoint() && "Unknown FP type!"); - break; - case Type::FloatTyID: - SV = new BitCastInst(SV, Type::Int32Ty, SV->getName(), SI); - break; - case Type::DoubleTyID: - SV = new BitCastInst(SV, Type::Int64Ty, SV->getName(), SI); - break; - case Type::PointerTyID: - if (isa(AllocaType)) - SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); - else - SV = new PtrToIntInst(SV, TD.getIntPtrType(), SV->getName(), SI); - break; - } - unsigned SrcSize = TD.getTypeSize(SV->getType())*8; + // If the result alloca is a vector type, this is either an element + // access or a bitcast to another vector type. + if (isa(SV->getType())) { + SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); + } else { + // Must be an element insertion. + unsigned Elt = Offset/(TD.getTypeSize(PTy->getElementType())*8); + SV = new InsertElementInst(Old, SV, + ConstantInt::get(Type::Int32Ty, Elt), + "tmp", SI); + } + } else { + Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI); - // Always zero extend the value if needed. - if (SV->getType() != AllocaType) - SV = CastInst::createZExtOrBitCast(SV, AllocaType, - SV->getName(), SI); - if (Offset && Offset < AllocaType->getPrimitiveSizeInBits()) - SV = BinaryOperator::createShl(SV, - ConstantInt::get(SV->getType(), Offset), - SV->getName()+".adj", SI); - // Mask out the bits we are about to insert from the old value. - unsigned TotalBits = TD.getTypeSize(SV->getType())*8; - if (TotalBits != SrcSize) { - assert(TotalBits > SrcSize); - uint64_t Mask = ~(((1ULL << SrcSize)-1) << Offset); - Mask = Mask & cast(SV->getType())->getBitMask(); - Old = BinaryOperator::createAnd(Old, - ConstantInt::get(Old->getType(), Mask), - Old->getName()+".mask", SI); - SV = BinaryOperator::createOr(Old, SV, SV->getName()+".ins", SI); - } + // If SV is a float, convert it to the appropriate integer type. + // If it is a pointer, do the same, and also handle ptr->ptr casts + // here. + unsigned SrcWidth = TD.getTypeSizeInBits(SV->getType()); + unsigned DestWidth = AllocaType->getPrimitiveSizeInBits(); + if (SV->getType()->isFloatingPoint()) + SV = new BitCastInst(SV, IntegerType::get(SrcWidth), + SV->getName(), SI); + else if (isa(SV->getType())) { + if (isa(AllocaType)) + SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); + else + SV = new PtrToIntInst(SV, TD.getIntPtrType(), SV->getName(), SI); + } + + // Always zero extend the value if needed. + if (SV->getType() != AllocaType) + SV = new ZExtInst(SV, AllocaType, SV->getName(), SI); + + // If this is a big-endian system and the store is narrower than the + // full alloca type, we need to do a shift to get the right bits. + int ShAmt = 0; + if (TD.isBigEndian()) { + ShAmt = DestWidth-SrcWidth-Offset; + } else { + ShAmt = Offset; + } + + // Note: we support negative bitwidths (with shr) which are not defined. + // We do this to support (f.e.) stores off the end of a structure where + // only some bits in the structure are set. + APInt Mask(APInt::getLowBitsSet(DestWidth, SrcWidth)); + if (ShAmt > 0 && (unsigned)ShAmt < DestWidth) { + SV = BinaryOperator::createShl(SV, + ConstantInt::get(SV->getType(), ShAmt), + SV->getName(), SI); + Mask <<= ShAmt; + } else if (ShAmt < 0 && (unsigned)-ShAmt < DestWidth) { + SV = BinaryOperator::createLShr(SV, + ConstantInt::get(SV->getType(),-ShAmt), + SV->getName(), SI); + Mask = Mask.lshr(ShAmt); + } + + // Mask out the bits we are about to insert from the old value, and or + // in the new bits. + if (SrcWidth != DestWidth) { + assert(DestWidth > SrcWidth); + Old = BinaryOperator::createAnd(Old, ConstantInt::get(~Mask), + Old->getName()+".mask", SI); + SV = BinaryOperator::createOr(Old, SV, SV->getName()+".ins", SI); } } new StoreInst(SV, NewAI, SI); SI->eraseFromParent(); - } else if (CastInst *CI = dyn_cast(User)) { - unsigned NewOff = Offset; - const TargetData &TD = getAnalysis(); - if (TD.isBigEndian() && !isVectorInsert) { - // Adjust the pointer. For example, storing 16-bits into a 32-bit - // alloca with just a cast makes it modify the top 16-bits. - const Type *SrcTy = cast(Ptr->getType())->getElementType(); - const Type *DstTy = cast(CI->getType())->getElementType(); - int PtrDiffBits = TD.getTypeSize(SrcTy)*8-TD.getTypeSize(DstTy)*8; - NewOff += PtrDiffBits; - } - ConvertUsesToScalar(CI, NewAI, NewOff); + } else if (BitCastInst *CI = dyn_cast(User)) { + ConvertUsesToScalar(CI, NewAI, Offset); CI->eraseFromParent(); } else if (GetElementPtrInst *GEP = dyn_cast(User)) { const PointerType *AggPtrTy = @@ -1068,11 +1089,7 @@ unsigned Idx = cast(GEP->getOperand(1))->getZExtValue(); unsigned BitOffset = Idx*AggSizeInBits; - if (TD.isLittleEndian() || isVectorInsert) - NewOffset += BitOffset; - else - NewOffset -= BitOffset; - + NewOffset += BitOffset; } else if (GEP->getNumOperands() == 3) { // We know that operand #2 is zero. unsigned Idx = cast(GEP->getOperand(2))->getZExtValue(); @@ -1080,22 +1097,12 @@ if (const SequentialType *SeqTy = dyn_cast(AggTy)) { unsigned ElSizeBits = TD.getTypeSize(SeqTy->getElementType())*8; - if (TD.isLittleEndian() || isVectorInsert) - NewOffset += ElSizeBits*Idx; - else - NewOffset += AggSizeInBits-ElSizeBits*(Idx+1); + NewOffset += ElSizeBits*Idx; } else if (const StructType *STy = dyn_cast(AggTy)) { unsigned EltBitOffset = TD.getStructLayout(STy)->getElementOffset(Idx)*8; - if (TD.isLittleEndian() || isVectorInsert) - NewOffset += EltBitOffset; - else { - const PointerType *ElPtrTy = cast(GEP->getType()); - unsigned ElSizeBits = TD.getTypeSize(ElPtrTy->getElementType())*8; - NewOffset += AggSizeInBits-(EltBitOffset+ElSizeBits); - } - + NewOffset += EltBitOffset; } else { assert(0 && "Unsupported operation!"); abort(); From reid at x10sys.com Tue Apr 10 21:02:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:02:26 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200704110202.l3B22QN4024238@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.23 -> 1.24 --- Log message: Teach sys::Path how to recognize different kinds of object files for ELF and Mach-O systems. Additionally, correct the Mach-O logic code to look at byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin. --- Diffs of the changes: (+25 -7) Path.cpp | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.23 llvm/lib/System/Path.cpp:1.24 --- llvm/lib/System/Path.cpp:1.23 Tue Apr 10 19:49:39 2007 +++ llvm/lib/System/Path.cpp Tue Apr 10 21:02:09 2007 @@ -58,7 +58,14 @@ case '\177': if (magic[1] == 'E' && magic[2] == 'L' && magic[3] == 'F') - return ELF_FileType; + if (length >= 18 && magic[17] == 0) + switch (magic[16]) { + default: break; + case 1: return ELF_Relocatable_FileType; + case 2: return ELF_Executable_FileType; + case 3: return ELF_SharedObject_FileType; + case 4: return ELF_Core_FileType; + } break; case 0xCE: @@ -67,10 +74,19 @@ // See the Mach-O section in /usr/share/file/magic for details. if (magic[1] == char(0xFA) && magic[2] == char(0xED) && magic[3] == char(0xFE)) - if (length >= 15) - if (magic[15] == 1 || magic[15] == 3 || magic[15] == 6 || - magic[15] == 9) - return Mach_O_FileType; + if (length >= 14 && magic[13] == 0) + switch (magic[12]) { + default: break; + case 1: return Mach_O_Object_FileType; + case 2: return Mach_O_Executable_FileType; + case 3: return Mach_O_FixedVirtualMemorySharedLib_FileType; + case 4: return Mach_O_Core_FileType; + case 5: return Mach_O_PreloadExectuable_FileType; + case 6: return Mach_O_DynamicallyLinkedSharedLib_FileType; + case 7: return Mach_O_DynamicLinker_FileType; + case 8: return Mach_O_Bundle_FileType; + case 9: return Mach_O_DynamicallyLinkedSharedLibStub_FileType; + } break; case 0xF0: // PowerPC Windows @@ -108,8 +124,10 @@ if (getMagicNumber(Magic, 64)) switch (IdentifyFileType(Magic.c_str(), Magic.length())) { default: return false; - case ELF_FileType: - case Mach_O_FileType: + case Mach_O_FixedVirtualMemorySharedLib_FileType: + case Mach_O_DynamicallyLinkedSharedLib_FileType: + case Mach_O_DynamicallyLinkedSharedLibStub_FileType: + case ELF_SharedObject_FileType: case COFF_FileType: return true; } } From reid at x10sys.com Tue Apr 10 21:02:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:02:28 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200704110202.l3B22S71024243@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.51 -> 1.52 --- Log message: Teach sys::Path how to recognize different kinds of object files for ELF and Mach-O systems. Additionally, correct the Mach-O logic code to look at byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin. --- Diffs of the changes: (+18 -7) Path.h | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 deletions(-) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.51 llvm/include/llvm/System/Path.h:1.52 --- llvm/include/llvm/System/Path.h:1.51 Sun Apr 8 15:05:10 2007 +++ llvm/include/llvm/System/Path.h Tue Apr 10 21:02:09 2007 @@ -597,13 +597,24 @@ /// This enumeration delineates the kinds of files that LLVM knows about. enum LLVMFileType { - Unknown_FileType = 0, ///< Unrecognized file - Bytecode_FileType = 1, ///< Uncompressed bytecode file - CompressedBytecode_FileType = 2, ///< Compressed bytecode file - Archive_FileType = 3, ///< ar style archive file - ELF_FileType = 4, ///< Native ELF object file or lib - Mach_O_FileType = 5, ///< Native Mach-O object file or lib - COFF_FileType = 6 ///< COFF object file or lib + Unknown_FileType = 0, ///< Unrecognized file + Bytecode_FileType, ///< Uncompressed bytecode file + CompressedBytecode_FileType, ///< Compressed bytecode file + Archive_FileType, ///< ar style archive file + ELF_Relocatable_FileType, ///< ELF Relocatable object file + ELF_Executable_FileType, ///< ELF Executable image + ELF_SharedObject_FileType, ///< ELF dynamically linked shared lib + ELF_Core_FileType, ///< ELF core image + Mach_O_Object_FileType, ///< Mach-O Object file + Mach_O_Executable_FileType, ///< Mach-O Executable + Mach_O_FixedVirtualMemorySharedLib_FileType, ///< Mach-O Shared Lib, FVM + Mach_O_Core_FileType, ///< Mach-O Core File + Mach_O_PreloadExectuable_FileType, ///< Mach-O Preloaded Executable + Mach_O_DynamicallyLinkedSharedLib_FileType, ///< Mach-O dynlinked shared lib + Mach_O_DynamicLinker_FileType, ///< The Mach-O dynamic linker + Mach_O_Bundle_FileType, ///< Mach-O Bundle file + Mach_O_DynamicallyLinkedSharedLibStub_FileType, ///< Mach-O Shared lib stub + COFF_FileType ///< COFF object file or lib }; /// This utility function allows any memory block to be examined in order From reid at x10sys.com Tue Apr 10 21:44:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704110244.l3B2irhN024968@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.414 -> 1.415 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+13 -13) SelectionDAGISel.cpp | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.414 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.415 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.414 Mon Apr 9 22:20:39 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Apr 10 21:44:19 2007 @@ -828,9 +828,9 @@ const FunctionType *FTy = I.getParent()->getParent()->getFunctionType(); const ParamAttrsList *Attrs = FTy->getParamAttrs(); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - if (Attrs && Attrs->paramHasAttr(0, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt)) ExtendKind = ISD::SIGN_EXTEND; - if (Attrs && Attrs->paramHasAttr(0, ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(0, ParamAttr::ZExt)) ExtendKind = ISD::ZERO_EXTEND; RetOp = DAG.getNode(ExtendKind, TmpVT, RetOp); } @@ -2768,16 +2768,16 @@ Value *Arg = I.getOperand(i); SDOperand ArgNode = getValue(Arg); Entry.Node = ArgNode; Entry.Ty = Arg->getType(); - Entry.isSExt = Attrs && Attrs->paramHasAttr(i, SExtAttribute); - Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ZExtAttribute); - Entry.isInReg = Attrs && Attrs->paramHasAttr(i, InRegAttribute); - Entry.isSRet = Attrs && Attrs->paramHasAttr(i, StructRetAttribute); + Entry.isSExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::SExt); + Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::ZExt); + Entry.isInReg = Attrs && Attrs->paramHasAttr(i, ParamAttr::InReg); + Entry.isSRet = Attrs && Attrs->paramHasAttr(i, ParamAttr::StructRet); Args.push_back(Entry); } std::pair Result = TLI.LowerCallTo(getRoot(), I.getType(), - Attrs && Attrs->paramHasAttr(0, SExtAttribute), + Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), FTy->isVarArg(), CallingConv, IsTailCall, Callee, Args, DAG); if (I.getType() != Type::VoidTy) @@ -3617,13 +3617,13 @@ // FIXME: Distinguish between a formal with no [sz]ext attribute from one // that is zero extended! - if (Attrs && Attrs->paramHasAttr(j, ZExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::ZExt)) Flags &= ~(ISD::ParamFlags::SExt); - if (Attrs && Attrs->paramHasAttr(j, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::SExt)) Flags |= ISD::ParamFlags::SExt; - if (Attrs && Attrs->paramHasAttr(j, InRegAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::InReg)) Flags |= ISD::ParamFlags::InReg; - if (Attrs && Attrs->paramHasAttr(j, StructRetAttribute)) + if (Attrs && Attrs->paramHasAttr(j, ParamAttr::StructRet)) Flags |= ISD::ParamFlags::StructReturn; Flags |= (OriginalAlignment << ISD::ParamFlags::OrigAlignmentOffs); @@ -3697,10 +3697,10 @@ case Promote: { SDOperand Op(Result, i++); if (MVT::isInteger(VT)) { - if (Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)) + if (Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)) Op = DAG.getNode(ISD::AssertSext, Op.getValueType(), Op, DAG.getValueType(VT)); - else if (Attrs && Attrs->paramHasAttr(Idx, ZExtAttribute)) + else if (Attrs && Attrs->paramHasAttr(Idx, ParamAttr::ZExt)) Op = DAG.getNode(ISD::AssertZext, Op.getValueType(), Op, DAG.getValueType(VT)); Op = DAG.getNode(ISD::TRUNCATE, VT, Op); From reid at x10sys.com Tue Apr 10 21:44:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:53 -0500 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkItems.cpp Message-ID: <200704110244.l3B2irIE024973@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkItems.cpp updated: 1.11 -> 1.12 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+12 -4) LinkItems.cpp | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) Index: llvm/lib/Linker/LinkItems.cpp diff -u llvm/lib/Linker/LinkItems.cpp:1.11 llvm/lib/Linker/LinkItems.cpp:1.12 --- llvm/lib/Linker/LinkItems.cpp:1.11 Wed Apr 4 01:44:18 2007 +++ llvm/lib/Linker/LinkItems.cpp Tue Apr 10 21:44:19 2007 @@ -91,8 +91,12 @@ return error("Cannot link archive '" + Pathname.toString() + "'"); break; - case sys::ELF_FileType: - case sys::Mach_O_FileType: + case sys::ELF_Relocatable_FileType: + case sys::ELF_SharedObject_FileType: + case sys::Mach_O_Object_FileType: + case sys::Mach_O_FixedVirtualMemorySharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType: case sys::COFF_FileType: is_native = true; break; @@ -181,8 +185,12 @@ break; } - case sys::ELF_FileType: - case sys::Mach_O_FileType: + case sys::ELF_Relocatable_FileType: + case sys::ELF_SharedObject_FileType: + case sys::Mach_O_Object_FileType: + case sys::Mach_O_FixedVirtualMemorySharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLib_FileType: + case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType: case sys::COFF_FileType: is_native = true; break; From reid at x10sys.com Tue Apr 10 21:44:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:53 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.y UpgradeParser.y.cvs Message-ID: <200704110244.l3B2irb4024982@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.73 -> 1.74 UpgradeParser.y updated: 1.79 -> 1.80 UpgradeParser.y.cvs updated: 1.72 -> 1.73 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+24 -24) UpgradeParser.cpp.cvs | 16 ++++++++-------- UpgradeParser.y | 16 ++++++++-------- UpgradeParser.y.cvs | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.73 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.74 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.73 Mon Apr 9 01:16:21 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Tue Apr 10 21:44:19 2007 @@ -748,7 +748,7 @@ PAL2 = *F2->getParamAttrs(); if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) return false; - unsigned SRetMask = ~unsigned(StructRetAttribute); + unsigned SRetMask = ~unsigned(ParamAttr::StructRet); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != @@ -793,7 +793,7 @@ const FunctionType *FT2 = dyn_cast(PF2->getElementType()); if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { const ParamAttrsList *PAL2 = FT2->getParamAttrs(); - if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) + if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); @@ -5389,8 +5389,8 @@ ParamAttrsList *ParamAttrs = 0; if ((yyvsp[-7].UIntVal) == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // result - ParamAttrs->addAttributes(1, StructRetAttribute); // first arg + ParamAttrs->addAttributes(0, ParamAttr::None); // result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg } const FunctionType *FT = @@ -5867,8 +5867,8 @@ ParamAttrsList *ParamAttrs = 0; if ((yyvsp[-11].UIntVal) == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // Function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first param + ParamAttrs->addAttributes(0, ParamAttr::None); // Function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -6369,8 +6369,8 @@ ParamAttrsList *ParamAttrs = 0; if ((yyvsp[-5].UIntVal) == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + ParamAttrs->addAttributes(0, ParamAttr::None); // function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter } FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.79 llvm/tools/llvm-upgrade/UpgradeParser.y:1.80 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.79 Mon Apr 9 01:15:59 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Tue Apr 10 21:44:20 2007 @@ -388,7 +388,7 @@ PAL2 = *F2->getParamAttrs(); if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) return false; - unsigned SRetMask = ~unsigned(StructRetAttribute); + unsigned SRetMask = ~unsigned(ParamAttr::StructRet); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != @@ -433,7 +433,7 @@ const FunctionType *FT2 = dyn_cast(PF2->getElementType()); if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { const ParamAttrsList *PAL2 = FT2->getParamAttrs(); - if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) + if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); @@ -2904,8 +2904,8 @@ ParamAttrsList *ParamAttrs = 0; if ($1 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // result - ParamAttrs->addAttributes(1, StructRetAttribute); // first arg + ParamAttrs->addAttributes(0, ParamAttr::None); // result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg } const FunctionType *FT = @@ -3293,8 +3293,8 @@ ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // Function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first param + ParamAttrs->addAttributes(0, ParamAttr::None); // Function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3698,8 +3698,8 @@ ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + ParamAttrs->addAttributes(0, ParamAttr::None); // function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter } FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.72 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.73 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.72 Mon Apr 9 01:16:21 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Tue Apr 10 21:44:20 2007 @@ -388,7 +388,7 @@ PAL2 = *F2->getParamAttrs(); if (PAL1.getParamAttrs(0) != PAL2.getParamAttrs(0)) return false; - unsigned SRetMask = ~unsigned(StructRetAttribute); + unsigned SRetMask = ~unsigned(ParamAttr::StructRet); for (unsigned i = 0; i < F1->getNumParams(); ++i) { if (F1->getParamType(i) != F2->getParamType(i) || unsigned(PAL1.getParamAttrs(i+1)) & SRetMask != @@ -433,7 +433,7 @@ const FunctionType *FT2 = dyn_cast(PF2->getElementType()); if (FT1 && FT2 && FuncTysDifferOnlyBySRet(FT1, FT2)) { const ParamAttrsList *PAL2 = FT2->getParamAttrs(); - if (PAL2 && PAL2->paramHasAttr(1, StructRetAttribute)) + if (PAL2 && PAL2->paramHasAttr(1, ParamAttr::StructRet)) return V; else if (Constant *C = dyn_cast(V)) return ConstantExpr::getBitCast(C, PF1); @@ -2904,8 +2904,8 @@ ParamAttrsList *ParamAttrs = 0; if ($1 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // result - ParamAttrs->addAttributes(1, StructRetAttribute); // first arg + ParamAttrs->addAttributes(0, ParamAttr::None); // result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first arg } const FunctionType *FT = @@ -3293,8 +3293,8 @@ ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // Function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first param + ParamAttrs->addAttributes(0, ParamAttr::None); // Function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first param } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); @@ -3698,8 +3698,8 @@ ParamAttrsList *ParamAttrs = 0; if ($2 == OldCallingConv::CSRet) { ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(0, NoAttributeSet); // function result - ParamAttrs->addAttributes(1, StructRetAttribute); // first parameter + ParamAttrs->addAttributes(0, ParamAttr::None); // function result + ParamAttrs->addAttributes(1, ParamAttr::StructRet); // first parameter } FTy = FunctionType::get(RetTy, ParamTypes, isVarArg, ParamAttrs); From reid at x10sys.com Tue Apr 10 21:44:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp Message-ID: <200704110244.l3B2is61024987@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/MSIL: MSILWriter.cpp updated: 1.2 -> 1.3 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+2 -2) MSILWriter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/MSIL/MSILWriter.cpp diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.2 llvm/lib/Target/MSIL/MSILWriter.cpp:1.3 --- llvm/lib/Target/MSIL/MSILWriter.cpp:1.2 Mon Apr 9 01:17:21 2007 +++ llvm/lib/Target/MSIL/MSILWriter.cpp Tue Apr 10 21:44:19 2007 @@ -1133,7 +1133,7 @@ void MSILWriter::printFunction(const Function& F) { const FunctionType* FTy = F.getFunctionType(); const ParamAttrsList *Attrs = FTy->getParamAttrs(); - bool isSigned = Attrs && Attrs->paramHasAttr(0, SExtAttribute); + bool isSigned = Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt); Out << "\n.method static "; Out << (F.hasInternalLinkage() ? "private " : "public "); if (F.isVarArg()) Out << "vararg "; @@ -1144,7 +1144,7 @@ unsigned ArgIdx = 1; for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I!=E; ++I, ++ArgIdx) { - isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, SExtAttribute); + isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, ParamAttr::SExt); if (I!=F.arg_begin()) Out << ", "; Out << getTypeName(I->getType(),isSigned) << getValueName(I); } From reid at x10sys.com Tue Apr 10 21:44:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:54 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ParameterAttributes.h Message-ID: <200704110244.l3B2issH024992@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: ParameterAttributes.h updated: 1.6 -> 1.7 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+49 -18) ParameterAttributes.h | 67 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 49 insertions(+), 18 deletions(-) Index: llvm/include/llvm/ParameterAttributes.h diff -u llvm/include/llvm/ParameterAttributes.h:1.6 llvm/include/llvm/ParameterAttributes.h:1.7 --- llvm/include/llvm/ParameterAttributes.h:1.6 Sun Apr 8 20:53:54 2007 +++ llvm/include/llvm/ParameterAttributes.h Tue Apr 10 21:44:19 2007 @@ -1,4 +1,4 @@ -//===-- llvm/ParameterAttributes.h - Container for Param Attrs --*- C++ -*-===// +//===-- llvm/ParameterAttributes.h - Container for ParamAttrs ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -25,16 +25,22 @@ /// treated by optimizations and code generation. This enumeration lists the /// attributes that can be associated with parameters or function results. /// @brief Function parameter attributes. -enum ParameterAttributes { - NoAttributeSet = 0, ///< No attributes have been set - ZExtAttribute = 1 << 0, ///< zero extended before/after call - SExtAttribute = 1 << 1, ///< sign extended before/after call - NoReturnAttribute = 1 << 2, ///< mark the function as not returning - InRegAttribute = 1 << 3, ///< force argument to be passed in register - StructRetAttribute = 1 << 4, ///< hidden pointer to structure to return - NoUnwindAttribute = 1 << 5 ///< Function doesn't unwind stack +namespace ParamAttr { + +enum Attributes { + None = 0, ///< No attributes have been set + ZExt = 1 << 0, ///< zero extended before/after call + SExt = 1 << 1, ///< sign extended before/after call + NoReturn = 1 << 2, ///< mark the function as not returning + InReg = 1 << 3, ///< force argument to be passed in register + StructRet = 1 << 4, ///< hidden pointer to structure to return + NoUnwind = 1 << 5 ///< Function doesn't unwind stack }; +} + +typedef ParamAttr::Attributes ParameterAttributes; + /// This class is used by Function and CallInst to represent the set of /// parameter attributes used. It represents a list of pairs of uint16_t, one /// for the parameter index, and one a set of ParameterAttributes bits. @@ -45,6 +51,39 @@ /// are provided to obtain information about the attributes. /// @brief A List of ParameterAttributes. class ParamAttrsList { + //void operator=(const ParamAttrsList &); // Do not implement + //ParamAttrsList(const ParamAttrsList &); // Do not implement + + /// @name Types + /// @{ + public: + /// This is an internal structure used to associate the ParameterAttributes + /// with a parameter index. + /// @brief ParameterAttributes with a parameter index. + struct ParamAttrsWithIndex { + uint16_t attrs; ///< The attributes that are set, |'d together + uint16_t index; ///< Index of the parameter for which the attributes apply + }; + + /// @brief A vector of attribute/index pairs. + typedef SmallVector ParamAttrsVector; + + /// @} + /// @name Construction + /// @{ + public: + /// @brief Construct an empty ParamAttrsList + ParamAttrsList() {} + + /// This method ensures the uniqueness of ParamAttrsList instances. The + /// argument is a vector of attribute/index pairs as represented by the + /// ParamAttrsWithIndex structure. The vector is used in the construction of + /// the ParamAttrsList instance. If an instance with identical vector pairs + /// exists, it will be returned instead of creating a new instance. + /// @brief Get a ParamAttrsList instance. + ParamAttrsList *get(const ParamAttrsVector &attrVec); + + /// @} /// @name Accessors /// @{ public: @@ -148,15 +187,7 @@ /// @name Data /// @{ private: - /// This is an internal structure used to associate the ParameterAttributes - /// with a parameter index. - /// @brief ParameterAttributes with a parameter index. - struct ParamAttrsWithIndex { - uint16_t attrs; ///< The attributes that are set, |'d together - uint16_t index; ///< Index of the parameter for which the attributes apply - }; - - SmallVector attrs; ///< The list of attributes + ParamAttrsVector attrs; ///< The list of attributes /// @} }; From reid at x10sys.com Tue Apr 10 21:44:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200704110244.l3B2iteS025001@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.82 -> 1.83 llvmAsmParser.y updated: 1.337 -> 1.338 llvmAsmParser.y.cvs updated: 1.83 -> 1.84 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+66 -66) llvmAsmParser.cpp.cvs | 44 ++++++++++++++++++++++---------------------- llvmAsmParser.y | 44 ++++++++++++++++++++++---------------------- llvmAsmParser.y.cvs | 44 ++++++++++++++++++++++---------------------- 3 files changed, 66 insertions(+), 66 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.82 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.83 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.82 Mon Apr 9 01:13:29 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Apr 10 21:44:19 2007 @@ -3337,27 +3337,27 @@ case 93: #line 1192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ZExtAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 94: #line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = SExtAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 95: #line 1194 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = InRegAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 96: #line 1195 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = StructRetAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 97: #line 1198 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoAttributeSet; ;} + { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 98: @@ -3369,17 +3369,17 @@ case 99: #line 1204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoReturnAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 100: #line 1205 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoUnwindAttribute; ;} + { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 102: #line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = NoAttributeSet; ;} + { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 103: @@ -3522,7 +3522,7 @@ { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); @@ -3530,7 +3530,7 @@ const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -3552,7 +3552,7 @@ { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); unsigned index = 1; @@ -3560,7 +3560,7 @@ const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -3693,7 +3693,7 @@ #line 1431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -3704,7 +3704,7 @@ #line 1438 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR @@ -4578,7 +4578,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} @@ -4591,7 +4591,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR ;} @@ -4619,7 +4619,7 @@ std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ((yyvsp[-2].ParamAttrs) != NoAttributeSet) + if ((yyvsp[-2].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); if ((yyvsp[-4].ArgList)) { // If there are arguments... unsigned index = 1; @@ -4629,7 +4629,7 @@ GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -5075,7 +5075,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[-6].ParamAttrs) != NoAttributeSet) + if ((yyvsp[-6].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); unsigned index = 1; @@ -5084,7 +5084,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -5471,7 +5471,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ((yyvsp[0].ParamAttrs) != NoAttributeSet) + if ((yyvsp[0].ParamAttrs) != ParamAttr::None) ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); unsigned index = 1; ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); @@ -5480,7 +5480,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.337 llvm/lib/AsmParser/llvmAsmParser.y:1.338 --- llvm/lib/AsmParser/llvmAsmParser.y:1.337 Mon Apr 9 01:13:07 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Apr 10 21:44:19 2007 @@ -1189,24 +1189,24 @@ CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = ZExtAttribute; } - | SEXT { $$ = SExtAttribute; } - | INREG { $$ = InRegAttribute; } - | SRET { $$ = StructRetAttribute; } +ParamAttr : ZEXT { $$ = ParamAttr::ZExt; } + | SEXT { $$ = ParamAttr::SExt; } + | INREG { $$ = ParamAttr::InReg; } + | SRET { $$ = ParamAttr::StructRet; } ; -OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = ParamAttr::None; } | OptParamAttrs ParamAttr { $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = NoReturnAttribute; } - | NOUNWIND { $$ = NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; } + | NOUNWIND { $$ = ParamAttr::NoUnwind; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; } | OptFuncAttrs FuncAttr { $$ = $1 | $2; } @@ -1298,7 +1298,7 @@ | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); unsigned index = 1; TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); @@ -1306,7 +1306,7 @@ const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1324,7 +1324,7 @@ | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); unsigned index = 1; @@ -1332,7 +1332,7 @@ const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1430,14 +1430,14 @@ : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2100,7 +2100,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2109,7 +2109,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2131,7 +2131,7 @@ std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ($7 != NoAttributeSet) + if ($7 != ParamAttr::None) ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... unsigned index = 1; @@ -2141,7 +2141,7 @@ GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -2486,7 +2486,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); ValueRefList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; @@ -2495,7 +2495,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -2792,7 +2792,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); unsigned index = 1; ValueRefList::iterator I = $6->begin(), E = $6->end(); @@ -2801,7 +2801,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.83 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.84 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.83 Mon Apr 9 01:13:29 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Tue Apr 10 21:44:19 2007 @@ -1189,24 +1189,24 @@ CHECK_FOR_ERROR }; -ParamAttr : ZEXT { $$ = ZExtAttribute; } - | SEXT { $$ = SExtAttribute; } - | INREG { $$ = InRegAttribute; } - | SRET { $$ = StructRetAttribute; } +ParamAttr : ZEXT { $$ = ParamAttr::ZExt; } + | SEXT { $$ = ParamAttr::SExt; } + | INREG { $$ = ParamAttr::InReg; } + | SRET { $$ = ParamAttr::StructRet; } ; -OptParamAttrs : /* empty */ { $$ = NoAttributeSet; } +OptParamAttrs : /* empty */ { $$ = ParamAttr::None; } | OptParamAttrs ParamAttr { $$ = $1 | $2; } ; -FuncAttr : NORETURN { $$ = NoReturnAttribute; } - | NOUNWIND { $$ = NoUnwindAttribute; } +FuncAttr : NORETURN { $$ = ParamAttr::NoReturn; } + | NOUNWIND { $$ = ParamAttr::NoUnwind; } | ParamAttr ; -OptFuncAttrs : /* empty */ { $$ = NoAttributeSet; } +OptFuncAttrs : /* empty */ { $$ = ParamAttr::None; } | OptFuncAttrs FuncAttr { $$ = $1 | $2; } @@ -1298,7 +1298,7 @@ | Types '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); unsigned index = 1; TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); @@ -1306,7 +1306,7 @@ const Type *Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1324,7 +1324,7 @@ | VOID '(' ArgTypeListI ')' OptFuncAttrs { std::vector Params; ParamAttrsList Attrs; - if ($5 != NoAttributeSet) + if ($5 != ParamAttr::None) Attrs.addAttributes(0, $5); TypeWithAttrsList::iterator I = $3->begin(), E = $3->end(); unsigned index = 1; @@ -1332,7 +1332,7 @@ const Type* Ty = I->Ty->get(); Params.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) Attrs.addAttributes(index, I->Attrs); } bool isVarArg = Params.size() && Params.back() == Type::VoidTy; @@ -1430,14 +1430,14 @@ : ArgTypeList | ArgTypeList ',' DOTDOTDOT { $$=$1; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new TypeWithAttrsList; - TypeWithAttrs TWA; TWA.Attrs = NoAttributeSet; + TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); $$->push_back(TWA); CHECK_FOR_ERROR @@ -2100,7 +2100,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2109,7 +2109,7 @@ struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; - E.Attrs = NoAttributeSet; + E.Attrs = ParamAttr::None; $$->push_back(E); CHECK_FOR_ERROR } @@ -2131,7 +2131,7 @@ std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ($7 != NoAttributeSet) + if ($7 != ParamAttr::None) ParamAttrs.addAttributes(0, $7); if ($5) { // If there are arguments... unsigned index = 1; @@ -2141,7 +2141,7 @@ GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); ParamTypeList.push_back(Ty); if (Ty != Type::VoidTy) - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } } @@ -2486,7 +2486,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); ValueRefList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; @@ -2495,7 +2495,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } @@ -2792,7 +2792,7 @@ // Pull out the types of all of the arguments... std::vector ParamTypes; ParamAttrsList ParamAttrs; - if ($8 != NoAttributeSet) + if ($8 != ParamAttr::None) ParamAttrs.addAttributes(0, $8); unsigned index = 1; ValueRefList::iterator I = $6->begin(), E = $6->end(); @@ -2801,7 +2801,7 @@ if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); - if (I->Attrs != NoAttributeSet) + if (I->Attrs != ParamAttr::None) ParamAttrs.addAttributes(index, I->Attrs); } From reid at x10sys.com Tue Apr 10 21:44:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Function.cpp Type.cpp Message-ID: <200704110244.l3B2iw2H025010@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.267 -> 1.268 Function.cpp updated: 1.117 -> 1.118 Type.cpp updated: 1.181 -> 1.182 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+22 -22) AsmWriter.cpp | 22 +++++++++++----------- Function.cpp | 16 ++++++++-------- Type.cpp | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.267 llvm/lib/VMCore/AsmWriter.cpp:1.268 --- llvm/lib/VMCore/AsmWriter.cpp:1.267 Mon Apr 9 01:10:42 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Tue Apr 10 21:44:19 2007 @@ -291,7 +291,7 @@ if (I != FTy->param_begin()) Result += ", "; calcTypeName(*I, TypeStack, TypeNames, Result); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Result += + " "; Result += Attrs->getParamAttrsTextByIndex(Idx); } @@ -302,7 +302,7 @@ Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " "; Result += Attrs->getParamAttrsTextByIndex(0); } @@ -737,7 +737,7 @@ if (I != FTy->param_begin()) Out << ", "; printType(*I); - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) { Out << " " << Attrs->getParamAttrsTextByIndex(Idx); } Idx++; @@ -747,7 +747,7 @@ Out << "..."; } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); } else if (const StructType *STy = dyn_cast(Ty)) { if (STy->isPacked()) @@ -974,7 +974,7 @@ // Insert commas as we go... the first arg doesn't get a comma if (I != F->arg_begin()) Out << ", "; printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx) - : uint16_t(NoAttributeSet))); + : uint16_t(ParamAttr::None))); Idx++; } @@ -984,7 +984,7 @@ Out << "..."; // Output varargs portion of signature! } Out << ')'; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) Out << ' ' << Attrs->getParamAttrsTextByIndex(0); if (F->hasSection()) Out << " section \"" << F->getSection() << '"'; @@ -1013,7 +1013,7 @@ // Output type... printType(Arg->getType()); - if (Attrs != NoAttributeSet) + if (Attrs != ParamAttr::None) Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs); // Output name, if available... @@ -1188,11 +1188,11 @@ if (op > 1) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << ' ' << PAL->getParamAttrsTextByIndex(0); } else if (const InvokeInst *II = dyn_cast(&I)) { const PointerType *PTy = cast(Operand->getType()); @@ -1228,12 +1228,12 @@ if (op > 3) Out << ','; writeOperand(I.getOperand(op), true); - if (PAL && PAL->getParamAttrs(op-2) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(op-2) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(op-2); } Out << " )"; - if (PAL && PAL->getParamAttrs(0) != NoAttributeSet) + if (PAL && PAL->getParamAttrs(0) != ParamAttr::None) Out << " " << PAL->getParamAttrsTextByIndex(0); Out << "\n\t\t\tto"; writeOperand(II->getNormalDest(), true); Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.117 llvm/lib/VMCore/Function.cpp:1.118 --- llvm/lib/VMCore/Function.cpp:1.117 Mon Apr 9 10:01:12 2007 +++ llvm/lib/VMCore/Function.cpp Tue Apr 10 21:44:19 2007 @@ -81,24 +81,24 @@ for (unsigned i = 0; i < limit; ++i) if (attrs[i].index == Index) return attrs[i].attrs; - return NoAttributeSet; + return ParamAttr::None; } std::string ParamAttrsList::getParamAttrsText(uint16_t Attrs) { std::string Result; - if (Attrs & ZExtAttribute) + if (Attrs & ParamAttr::ZExt) Result += "zext "; - if (Attrs & SExtAttribute) + if (Attrs & ParamAttr::SExt) Result += "sext "; - if (Attrs & NoReturnAttribute) + if (Attrs & ParamAttr::NoReturn) Result += "noreturn "; - if (Attrs & NoUnwindAttribute) + if (Attrs & ParamAttr::NoUnwind) Result += "nounwind "; - if (Attrs & InRegAttribute) + if (Attrs & ParamAttr::InReg) Result += "inreg "; - if (Attrs & StructRetAttribute) + if (Attrs & ParamAttr::StructRet) Result += "sret "; return Result; } @@ -125,7 +125,7 @@ for (unsigned i = 0; i < attrs.size(); ++i) if (attrs[i].index == Index) { attrs[i].attrs &= ~Attrs; - if (attrs[i].attrs == NoAttributeSet) + if (attrs[i].attrs == ParamAttr::None) attrs.erase(&attrs[i]); return; } Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.181 llvm/lib/VMCore/Type.cpp:1.182 --- llvm/lib/VMCore/Type.cpp:1.181 Mon Apr 9 12:20:18 2007 +++ llvm/lib/VMCore/Type.cpp Tue Apr 10 21:44:19 2007 @@ -285,7 +285,7 @@ E = FTy->param_end(); I != E; ++I) { if (I != FTy->param_begin()) Result += ", "; - if (Attrs && Attrs->getParamAttrs(Idx) != NoAttributeSet) + if (Attrs && Attrs->getParamAttrs(Idx) != ParamAttr::None) Result += Attrs->getParamAttrsTextByIndex(Idx); Idx++; Result += getTypeDescription(*I, TypeStack); @@ -295,7 +295,7 @@ Result += "..."; } Result += ")"; - if (Attrs && Attrs->getParamAttrs(0) != NoAttributeSet) { + if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None) { Result += " " + Attrs->getParamAttrsTextByIndex(0); } break; @@ -1121,7 +1121,7 @@ bool FunctionType::isStructReturn() const { if (ParamAttrs) - return ParamAttrs->paramHasAttr(1, StructRetAttribute); + return ParamAttrs->paramHasAttr(1, ParamAttr::StructRet); return false; } From reid at x10sys.com Tue Apr 10 21:44:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 10 Apr 2007 21:44:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704110244.l3B2iw16025013@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.332 -> 1.333 --- Log message: For PR1146: http://llvm.org/PR1146 : Put the parameter attributes in their own ParamAttr name space. Adjust the rest of llvm as a result. --- Diffs of the changes: (+8 -8) CBackend.cpp | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.332 llvm/lib/Target/CBackend/CBackend.cpp:1.333 --- llvm/lib/Target/CBackend/CBackend.cpp:1.332 Mon Apr 9 01:17:21 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Tue Apr 10 21:44:19 2007 @@ -356,7 +356,7 @@ if (PrintedType) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ""); PrintedType = true; } if (FTy->isVarArg()) { @@ -368,7 +368,7 @@ FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, RetTy, - /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), tstr); } std::ostream & @@ -430,7 +430,7 @@ if (I != FTy->param_begin()) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), ""); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ""); ++Idx; } if (FTy->isVarArg()) { @@ -442,7 +442,7 @@ FunctionInnards << ')'; std::string tstr = FunctionInnards.str(); printType(Out, FTy->getReturnType(), - /*isSigned=*/Attrs && Attrs->paramHasAttr(0, SExtAttribute), tstr); + /*isSigned=*/Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), tstr); return Out; } case Type::StructTyID: { @@ -1832,7 +1832,7 @@ else ArgName = ""; printType(FunctionInnards, I->getType(), - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute), + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt), ArgName); PrintedArg = true; ++Idx; @@ -1853,7 +1853,7 @@ for (; I != E; ++I) { if (PrintedArg) FunctionInnards << ", "; printType(FunctionInnards, *I, - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)); PrintedArg = true; ++Idx; } @@ -1881,7 +1881,7 @@ // Print out the return type and the signature built above. printType(Out, RetTy, - /*isSigned=*/ Attrs && Attrs->paramHasAttr(0, SExtAttribute), + /*isSigned=*/ Attrs && Attrs->paramHasAttr(0, ParamAttr::SExt), FunctionInnards.str()); } @@ -2586,7 +2586,7 @@ (*AI)->getType() != FTy->getParamType(ArgNo)) { Out << '('; printType(Out, FTy->getParamType(ArgNo), - /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, SExtAttribute)); + /*isSigned=*/Attrs && Attrs->paramHasAttr(Idx, ParamAttr::SExt)); Out << ')'; } writeOperand(*AI); From rspencer at reidspencer.com Tue Apr 10 21:50:20 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Tue, 10 Apr 2007 19:50:20 -0700 Subject: [llvm-commits] [llvm-gcc] ParamAttrs change PLEASE APPLY Message-ID: <1176259820.9947.834.camel@bashful.x10sys.com> Hi, Attached is a small patch to fix the names of the names of the parameter attributes. They were put into a namespace. Please apply as soon as possible. Thanks, Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: ParamAttrs.patch Type: text/x-patch Size: 3960 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070410/5a17bc7d/attachment.bin From sabre at nondot.org Tue Apr 10 22:15:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 22:15:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200704110315.l3B3Fqor025526@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.24 -> 1.25 --- Log message: Hack to get sys::Path to recognize macho dylibs. --- Diffs of the changes: (+7 -4) Path.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.24 llvm/lib/System/Path.cpp:1.25 --- llvm/lib/System/Path.cpp:1.24 Tue Apr 10 21:02:09 2007 +++ llvm/lib/System/Path.cpp Tue Apr 10 22:15:35 2007 @@ -68,12 +68,14 @@ } break; - case 0xCE: - case 0xCF: + case 0xCA: // This is complicated by an overlap with Java class files. // See the Mach-O section in /usr/share/file/magic for details. - if (magic[1] == char(0xFA) && magic[2] == char(0xED) && - magic[3] == char(0xFE)) + if (magic[1] == char(0xFE) && magic[2] == char(0xBA) && + magic[3] == char(0xBE)) { + return Mach_O_DynamicallyLinkedSharedLib_FileType; + + // FIXME: How does this work? if (length >= 14 && magic[13] == 0) switch (magic[12]) { default: break; @@ -87,6 +89,7 @@ case 8: return Mach_O_Bundle_FileType; case 9: return Mach_O_DynamicallyLinkedSharedLibStub_FileType; } + } break; case 0xF0: // PowerPC Windows From clattner at apple.com Tue Apr 10 22:18:44 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 10 Apr 2007 20:18:44 -0700 (PDT) Subject: [llvm-commits] [125963] Apply Reid's parameter attr patch. Message-ID: <20070411031844.29C37E2A323D@src> Revision: 125963 Author: clattner Date: 2007-04-10 20:18:43 -0700 (Tue, 10 Apr 2007) Log Message: ----------- Apply Reid's parameter attr patch. Modified Paths: -------------- apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h =================================================================== --- apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h 2007-04-10 22:30:30 UTC (rev 125962) +++ apple-local/branches/llvm/gcc/config/i386/llvm-i386-target.h 2007-04-11 03:18:43 UTC (rev 125963) @@ -54,7 +54,7 @@ int words = (Size + BITS_PER_WORD - 1) / BITS_PER_WORD; \ local_regparm -= words; \ if (local_regparm>=0) { \ - Attribute |= InRegAttribute; \ + Attribute |= ParamAttr::InReg; \ } else \ local_regparm = 0; \ } \ Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-10 22:30:30 UTC (rev 125962) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-11 03:18:43 UTC (rev 125963) @@ -712,7 +712,7 @@ if (static_chain) { // Pass the static chain in a register. ParamAttrs = new ParamAttrsList(); - ParamAttrs->addAttributes(1, InRegAttribute); + ParamAttrs->addAttributes(1, ParamAttr::InReg); } return FunctionType::get(RetTy, ArgTys, false, ParamAttrs); @@ -768,22 +768,22 @@ // the function will be correctly sign or zero extended to 32-bits by // the LLVM code gen. ParamAttrsList Attrs; - uint16_t RAttributes = NoAttributeSet; + uint16_t RAttributes = ParamAttr::None; if (CallingConv == CallingConv::C) { tree ResultTy = TREE_TYPE(type); if (TREE_CODE(ResultTy) == BOOLEAN_TYPE) { if (TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) - RAttributes |= ZExtAttribute; + RAttributes |= ParamAttr::ZExt; } else { if (TREE_CODE(ResultTy) == INTEGER_TYPE && TREE_INT_CST_LOW(TYPE_SIZE(ResultTy)) < INT_TYPE_SIZE) if (TYPE_UNSIGNED(ResultTy)) - RAttributes |= ZExtAttribute; + RAttributes |= ParamAttr::ZExt; else - RAttributes |= SExtAttribute; + RAttributes |= ParamAttr::SExt; } } - if (RAttributes != NoAttributeSet) + if (RAttributes != ParamAttr::None) Attrs.addAttributes(0, RAttributes); unsigned Idx = 1; @@ -796,30 +796,30 @@ if (static_chain) // Pass the static chain in a register. - Attrs.addAttributes(Idx++, InRegAttribute); + Attrs.addAttributes(Idx++, ParamAttr::InReg); // The struct return attribute must be associated with the first // parameter but that parameter may have other attributes too so we set up // the first Attributes value here based on struct return. This only works // Handle the structure return calling convention if (ABIConverter.isStructReturn()) - Attrs.addAttributes(Idx++, StructRetAttribute); + Attrs.addAttributes(Idx++, ParamAttr::StructRet); for (tree Args = TYPE_ARG_TYPES(type); Args && TREE_VALUE(Args) != void_type_node; Args = TREE_CHAIN(Args)) { tree Ty = TREE_VALUE(Args); - unsigned Attributes = NoAttributeSet; + unsigned Attributes = ParamAttr::None; if (CallingConv == CallingConv::C) { if (TREE_CODE(Ty) == BOOLEAN_TYPE) { if (TREE_INT_CST_LOW(TYPE_SIZE(Ty)) < INT_TYPE_SIZE) - Attributes |= ZExtAttribute; + Attributes |= ParamAttr::ZExt; } else if (TREE_CODE(Ty) == INTEGER_TYPE && TREE_INT_CST_LOW(TYPE_SIZE(Ty)) < INT_TYPE_SIZE) { if (TYPE_UNSIGNED(Ty)) - Attributes |= ZExtAttribute; + Attributes |= ParamAttr::ZExt; else - Attributes |= SExtAttribute; + Attributes |= ParamAttr::SExt; } } @@ -829,7 +829,7 @@ isVarArg, lparam); #endif // LLVM_TARGET_ENABLE_REGPARM - if (Attributes != NoAttributeSet) + if (Attributes != ParamAttr::None) Attrs.addAttributes(Idx, Attributes); Idx++; } From sabre at nondot.org Tue Apr 10 22:27:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 10 Apr 2007 22:27:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200704110327.l3B3RfWT025730@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ScalarReplAggregates.cpp updated: 1.82 -> 1.83 --- Log message: fix a regression introduced by my last patch. --- Diffs of the changes: (+1 -14) ScalarReplAggregates.cpp | 15 +-------------- 1 files changed, 1 insertion(+), 14 deletions(-) Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.82 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.83 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.82 Tue Apr 10 19:57:54 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Apr 10 22:27:24 2007 @@ -970,20 +970,7 @@ if (isa(LI->getType())) { assert(NV->getType() == LI->getType() && "Truncate wasn't enough?"); } else if (LI->getType()->isFloatingPoint()) { - // If needed, truncate the integer to the appropriate size. - if (NTy->getBitWidth() > LIBitWidth) { - switch (LI->getType()->getTypeID()) { - default: assert(0 && "Unknown FP type!"); - case Type::FloatTyID: - NV = new TruncInst(NV, Type::Int32Ty, LI->getName(), LI); - break; - case Type::DoubleTyID: - NV = new TruncInst(NV, Type::Int64Ty, LI->getName(), LI); - break; - } - } - - // Then do a bitcast. + // Just do a bitcast, we know the sizes match up. NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); } else { // Otherwise must be a pointer. From sabre at nondot.org Wed Apr 11 00:03:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:03:17 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/iabs.ll Message-ID: <200704110503.l3B53HG0027610@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: iabs.ll added (r1.1) --- Log message: new testcases for integer abs function --- Diffs of the changes: (+14 -0) iabs.ll | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/test/CodeGen/PowerPC/iabs.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/iabs.ll:1.1 *** /dev/null Wed Apr 11 00:03:07 2007 --- llvm/test/CodeGen/PowerPC/iabs.ll Wed Apr 11 00:02:57 2007 *************** *** 0 **** --- 1,14 ---- + ; RUN: llvm-as < %s | llc -march=ppc32 -stats 2>&1 | grep '4 .*Number of machine instrs printed' + + ;; Integer absolute value, should produce something as good as: + ;; srawi r2, r3, 31 + ;; add r3, r3, r2 + ;; xor r3, r3, r2 + ;; blr + define i32 @test(i32 %a) { + %tmp1neg = sub i32 0, %a + %b = icmp sgt i32 %a, -1 + %abs = select i1 %b, i32 %a, i32 %tmp1neg + ret i32 %abs + } + From sabre at nondot.org Wed Apr 11 00:03:19 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:03:19 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/iabs.ll Message-ID: <200704110503.l3B53Jrf027616@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: iabs.ll added (r1.1) --- Log message: new testcases for integer abs function --- Diffs of the changes: (+20 -0) iabs.ll | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: llvm/test/CodeGen/ARM/iabs.ll diff -c /dev/null llvm/test/CodeGen/ARM/iabs.ll:1.1 *** /dev/null Wed Apr 11 00:03:07 2007 --- llvm/test/CodeGen/ARM/iabs.ll Wed Apr 11 00:02:57 2007 *************** *** 0 **** --- 1,20 ---- + ; RUN: llvm-as < %s | llc -march=arm -stats 2>&1 | grep '3 .*Number of machine instrs printed' && + ; RUN: llvm-as < %s | llc -march=thumb -stats 2>&1 | grep '4 .*Number of machine instrs printed' + + ;; Integer absolute value, should produce something as good as: ARM: + ;; add r3, r0, r0, asr #31 + ;; eor r0, r3, r0, asr #31 + ;; bx lr + ;; Thumb: + ;; asr r2, r0, #31 + ;; add r0, r0, r2 + ;; eor r0, r2 + ;; bx lr + + define i32 @test(i32 %a) { + %tmp1neg = sub i32 0, %a + %b = icmp sgt i32 %a, -1 + %abs = select i1 %b, i32 %a, i32 %tmp1neg + ret i32 %abs + } + From sabre at nondot.org Wed Apr 11 00:03:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:03:20 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/iabs.ll Message-ID: <200704110503.l3B53K9t027621@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: iabs.ll added (r1.1) --- Log message: new testcases for integer abs function --- Diffs of the changes: (+16 -0) iabs.ll | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/test/CodeGen/X86/iabs.ll diff -c /dev/null llvm/test/CodeGen/X86/iabs.ll:1.1 *** /dev/null Wed Apr 11 00:03:07 2007 --- llvm/test/CodeGen/X86/iabs.ll Wed Apr 11 00:02:57 2007 *************** *** 0 **** --- 1,16 ---- + ; RUN: llvm-as < %s | llc -march=x86-64 -stats 2>&1 | grep '6 .*Number of machine instrs printed' + + ;; Integer absolute value, should produce something at least as good as: + ;; movl %edi, %eax + ;; sarl $31, %eax + ;; addl %eax, %edi + ;; xorl %eax, %edi + ;; movl %edi, %eax + ;; ret + define i32 @test(i32 %a) { + %tmp1neg = sub i32 0, %a + %b = icmp sgt i32 %a, -1 + %abs = select i1 %b, i32 %a, i32 %tmp1neg + ret i32 %abs + } + From sabre at nondot.org Wed Apr 11 00:11:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:11:55 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704110511.l3B5BtoA027775@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.285 -> 1.286 --- Log message: Codegen integer abs more efficiently using the trick from the PPC CWG. This improves codegen on many architectures. Tests committed as CodeGen/*/iabs.ll X86 Old: X86 New: _test: _test: movl 4(%esp), %ecx movl 4(%esp), %eax movl %ecx, %eax movl %eax, %ecx negl %eax sarl $31, %ecx testl %ecx, %ecx addl %ecx, %eax cmovns %ecx, %eax xorl %ecx, %eax ret ret PPC Old: PPC New: _test: _test: cmpwi cr0, r3, -1 srawi r2, r3, 31 neg r2, r3 add r3, r3, r2 bgt cr0, LBB1_2 ; xor r3, r3, r2 LBB1_1: ; blr mr r3, r2 LBB1_2: ; blr ARM Old: ARM New: _test: _test: rsb r3, r0, #0 add r3, r0, r0, asr #31 cmp r0, #0 eor r0, r3, r0, asr #31 movge r3, r0 bx lr mov r0, r3 bx lr Thumb Old: Thumb New: _test: _test: neg r2, r0 asr r2, r0, #31 cmp r0, #0 add r0, r0, r2 bge LBB1_2 eor r0, r2 LBB1_1: @ bx lr cpy r0, r2 LBB1_2: @ bx lr Sparc Old: Sparc New: test: test: save -96, %o6, %o6 save -96, %o6, %o6 sethi 0, %l0 sra %i0, 31, %l0 sub %l0, %i0, %l0 add %i0, %l0, %l1 subcc %i0, -1, %l1 xor %l1, %l0, %i0 bg .BB1_2 restore %g0, %g0, %g0 nop retl .BB1_1: nop or %g0, %l0, %i0 .BB1_2: restore %g0, %g0, %g0 retl nop It also helps alpha/ia64 :) --- Diffs of the changes: (+18 -4) DAGCombiner.cpp | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.285 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.286 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.285 Mon Apr 2 16:36:32 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 11 00:11:38 2007 @@ -4159,13 +4159,27 @@ // Check to see if this is an integer abs. select_cc setl[te] X, 0, -X, X -> // Y = sra (X, size(X)-1); xor (add (X, Y), Y) if (N1C && N1C->isNullValue() && (CC == ISD::SETLT || CC == ISD::SETLE) && - N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1)) { - if (ConstantSDNode *SubC = dyn_cast(N2.getOperand(0))) { + N0 == N3 && N2.getOpcode() == ISD::SUB && N0 == N2.getOperand(1) && + N2.getOperand(0) == N1 && MVT::isInteger(N0.getValueType())) { + MVT::ValueType XType = N0.getValueType(); + SDOperand Shift = DAG.getNode(ISD::SRA, XType, N0, + DAG.getConstant(MVT::getSizeInBits(XType)-1, + TLI.getShiftAmountTy())); + SDOperand Add = DAG.getNode(ISD::ADD, XType, N0, Shift); + AddToWorkList(Shift.Val); + AddToWorkList(Add.Val); + return DAG.getNode(ISD::XOR, XType, Add, Shift); + } + // Check to see if this is an integer abs. select_cc setgt X, -1, X, -X -> + // Y = sra (X, size(X)-1); xor (add (X, Y), Y) + if (N1C && N1C->isAllOnesValue() && CC == ISD::SETGT && + N0 == N2 && N3.getOpcode() == ISD::SUB && N0 == N3.getOperand(1)) { + if (ConstantSDNode *SubC = dyn_cast(N3.getOperand(0))) { MVT::ValueType XType = N0.getValueType(); if (SubC->isNullValue() && MVT::isInteger(XType)) { SDOperand Shift = DAG.getNode(ISD::SRA, XType, N0, DAG.getConstant(MVT::getSizeInBits(XType)-1, - TLI.getShiftAmountTy())); + TLI.getShiftAmountTy())); SDOperand Add = DAG.getNode(ISD::ADD, XType, N0, Shift); AddToWorkList(Shift.Val); AddToWorkList(Add.Val); @@ -4173,7 +4187,7 @@ } } } - + return SDOperand(); } From sabre at nondot.org Wed Apr 11 00:32:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:32:31 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/ispositive.ll Message-ID: <200704110532.l3B5WVph028206@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: ispositive.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+12 -0) ispositive.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/Generic/ispositive.ll diff -c /dev/null llvm/test/CodeGen/Generic/ispositive.ll:1.1 *** /dev/null Wed Apr 11 00:32:23 2007 --- llvm/test/CodeGen/Generic/ispositive.ll Wed Apr 11 00:32:13 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc -march=x86 | grep shrl.*31 && + ; RUN: llvm-as < %s | llc -march=ppc32 | grep 'srwi r3, r3, 31' && + ; RUN: llvm-as < %s | llc -march=arm | grep 'mov r0, r0, lsr #31' && + ; RUN: llvm-as < %s | llc -march=thumb | grep 'lsr r0, r0, #31' + + define i32 @isnegative(i32 %X) { + entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + From sabre at nondot.org Wed Apr 11 00:32:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:32:44 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704110532.l3B5WiOo028217@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.286 -> 1.287 --- Log message: Teach the codegen to turn [aez]ext (setcc) -> selectcc of 1/0, which often allows other simplifications. For example, this compiles: int isnegative(unsigned int X) { return !(X < 2147483648U); } Into this code: x86: movl 4(%esp), %eax shrl $31, %eax ret arm: mov r0, r0, lsr #31 bx lr thumb: lsr r0, r0, #31 bx lr instead of: x86: cmpl $0, 4(%esp) sets %al movzbl %al, %eax ret arm: mov r3, #0 cmp r0, #0 movlt r3, #1 mov r0, r3 bx lr thumb: mov r2, #1 mov r1, #0 cmp r0, #0 blt LBB1_2 @entry LBB1_1: @entry cpy r2, r1 LBB1_2: @entry cpy r0, r2 bx lr Testcase here: test/CodeGen/Generic/ispositive.ll --- Diffs of the changes: (+29 -0) DAGCombiner.cpp | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.286 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.287 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.286 Wed Apr 11 00:11:38 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 11 00:32:27 2007 @@ -2130,6 +2130,15 @@ } } + // sext(setcc x,y,cc) -> select_cc x, y, -1, 0, cc + if (N0.getOpcode() == ISD::SETCC) { + SDOperand SCC = + SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), + DAG.getConstant(~0ULL, VT), DAG.getConstant(0, VT), + cast(N0.getOperand(2))->get()); + if (SCC.Val) return SCC; + } + return SDOperand(); } @@ -2210,6 +2219,16 @@ ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! } + + // zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc + if (N0.getOpcode() == ISD::SETCC) { + SDOperand SCC = + SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), + DAG.getConstant(1, VT), DAG.getConstant(0, VT), + cast(N0.getOperand(2))->get()); + if (SCC.Val) return SCC; + } + return SDOperand(); } @@ -2294,6 +2313,16 @@ ExtLoad.getValue(1)); return SDOperand(N, 0); // Return N so it doesn't get rechecked! } + + // aext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc + if (N0.getOpcode() == ISD::SETCC) { + SDOperand SCC = + SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), + DAG.getConstant(1, VT), DAG.getConstant(0, VT), + cast(N0.getOperand(2))->get()); + if (SCC.Val) return SCC; + } + return SDOperand(); } From sabre at nondot.org Wed Apr 11 00:34:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:34:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200704110534.l3B5YHUB028268@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.163 -> 1.164 --- Log message: done --- Diffs of the changes: (+0 -28) README.txt | 28 ---------------------------- 1 files changed, 28 deletions(-) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.163 llvm/lib/Target/X86/README.txt:1.164 --- llvm/lib/Target/X86/README.txt:1.163 Tue Apr 10 16:14:01 2007 +++ llvm/lib/Target/X86/README.txt Wed Apr 11 00:34:00 2007 @@ -1049,31 +1049,3 @@ //===---------------------------------------------------------------------===// -Consider: - -int isnegative(unsigned int X) { - return !(X < 2147483648U); -} - -We current compile this to: - -define i32 @isnegative(i32 %X) { - icmp slt i32 %X, 0 ; :0 [#uses=1] - %retval = zext i1 %0 to i32 ; [#uses=1] - ret i32 %retval -} - -and: - -_isnegative: - cmpl $0, 4(%esp) - sets %al - movzbl %al, %eax - ret - -We should produce: - - movl 4(%esp), %eax - shrl $31, %eax - ret - From sabre at nondot.org Wed Apr 11 00:45:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 00:45:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704110545.l3B5juG0028493@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.738 -> 1.739 --- Log message: fix a miscompilation of: define i32 @test(i32 %X) { entry: %Y = and i32 %X, 4 ; [#uses=1] icmp eq i32 %Y, 0 ; :0 [#uses=1] sext i1 %0 to i32 ; :1 [#uses=1] ret i32 %1 } by moving code out of commonIntCastTransforms into visitZExt. Simplify the APInt gymnastics in it etc. --- Diffs of the changes: (+59 -63) InstructionCombining.cpp | 122 ++++++++++++++++++++++------------------------- 1 files changed, 59 insertions(+), 63 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.738 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.739 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.738 Mon Apr 9 18:52:13 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Apr 11 00:45:39 2007 @@ -6457,69 +6457,6 @@ } } break; - - case Instruction::ICmp: - // If we are just checking for a icmp eq of a single bit and casting it - // to an integer, then shift the bit to the appropriate place and then - // cast to integer to avoid the comparison. - if (ConstantInt *Op1C = dyn_cast(Op1)) { - const APInt& Op1CV = Op1C->getValue(); - // cast (X == 0) to int --> X^1 iff X has only the low bit set. - // cast (X == 0) to int --> (X>>1)^1 iff X has only the 2nd bit set. - // cast (X == 1) to int --> X iff X has only the low bit set. - // cast (X == 2) to int --> X>>1 iff X has only the 2nd bit set. - // cast (X != 0) to int --> X iff X has only the low bit set. - // cast (X != 0) to int --> X>>1 iff X has only the 2nd bit set. - // cast (X != 1) to int --> X^1 iff X has only the low bit set. - // cast (X != 2) to int --> (X>>1)^1 iff X has only the 2nd bit set. - if (Op1CV == 0 || Op1CV.isPowerOf2()) { - // If Op1C some other power of two, convert: - uint32_t BitWidth = Op1C->getType()->getBitWidth(); - APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0); - APInt TypeMask(APInt::getAllOnesValue(BitWidth)); - ComputeMaskedBits(Op0, TypeMask, KnownZero, KnownOne); - - // This only works for EQ and NE - ICmpInst::Predicate pred = cast(SrcI)->getPredicate(); - if (pred != ICmpInst::ICMP_NE && pred != ICmpInst::ICMP_EQ) - break; - - APInt KnownZeroMask(KnownZero ^ TypeMask); - if (KnownZeroMask.isPowerOf2()) { // Exactly 1 possible 1? - bool isNE = pred == ICmpInst::ICMP_NE; - if (Op1CV != 0 && (Op1CV != KnownZeroMask)) { - // (X&4) == 2 --> false - // (X&4) != 2 --> true - Constant *Res = ConstantInt::get(Type::Int1Ty, isNE); - Res = ConstantExpr::getZExt(Res, CI.getType()); - return ReplaceInstUsesWith(CI, Res); - } - - uint32_t ShiftAmt = KnownZeroMask.logBase2(); - Value *In = Op0; - if (ShiftAmt) { - // Perform a logical shr by shiftamt. - // Insert the shift to put the result in the low bit. - In = InsertNewInstBefore( - BinaryOperator::createLShr(In, - ConstantInt::get(In->getType(), ShiftAmt), - In->getName()+".lobit"), CI); - } - - if ((Op1CV != 0) == isNE) { // Toggle the low bit. - Constant *One = ConstantInt::get(In->getType(), 1); - In = BinaryOperator::createXor(In, One, "tmp"); - InsertNewInstBefore(cast(In), CI); - } - - if (CI.getType() == In->getType()) - return ReplaceInstUsesWith(CI, In); - else - return CastInst::createIntegerCast(In, CI.getType(), false/*ZExt*/); - } - } - } - break; } return 0; } @@ -6617,6 +6554,65 @@ } } + if (ICmpInst *ICI = dyn_cast(Src)) { + // If we are just checking for a icmp eq of a single bit and zext'ing it + // to an integer, then shift the bit to the appropriate place and then + // cast to integer to avoid the comparison. + if (ConstantInt *Op1C = dyn_cast(ICI->getOperand(1))) { + const APInt& Op1CV = Op1C->getValue(); + // cast (X == 0) to int --> X^1 iff X has only the low bit set. + // cast (X == 0) to int --> (X>>1)^1 iff X has only the 2nd bit set. + // cast (X == 1) to int --> X iff X has only the low bit set. + // cast (X == 2) to int --> X>>1 iff X has only the 2nd bit set. + // cast (X != 0) to int --> X iff X has only the low bit set. + // cast (X != 0) to int --> X>>1 iff X has only the 2nd bit set. + // cast (X != 1) to int --> X^1 iff X has only the low bit set. + // cast (X != 2) to int --> (X>>1)^1 iff X has only the 2nd bit set. + if ((Op1CV == 0 || Op1CV.isPowerOf2()) && + // This only works for EQ and NE + ICI->isEquality()) { + // If Op1C some other power of two, convert: + uint32_t BitWidth = Op1C->getType()->getBitWidth(); + APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0); + APInt TypeMask(APInt::getAllOnesValue(BitWidth)); + ComputeMaskedBits(ICI->getOperand(0), TypeMask, KnownZero, KnownOne); + + APInt KnownZeroMask(~KnownZero); + if (KnownZeroMask.isPowerOf2()) { // Exactly 1 possible 1? + bool isNE = ICI->getPredicate() == ICmpInst::ICMP_NE; + if (Op1CV != 0 && (Op1CV != KnownZeroMask)) { + // (X&4) == 2 --> false + // (X&4) != 2 --> true + Constant *Res = ConstantInt::get(Type::Int1Ty, isNE); + Res = ConstantExpr::getZExt(Res, CI.getType()); + return ReplaceInstUsesWith(CI, Res); + } + + uint32_t ShiftAmt = KnownZeroMask.logBase2(); + Value *In = ICI->getOperand(0); + if (ShiftAmt) { + // Perform a logical shr by shiftamt. + // Insert the shift to put the result in the low bit. + In = InsertNewInstBefore( + BinaryOperator::createLShr(In, + ConstantInt::get(In->getType(), ShiftAmt), + In->getName()+".lobit"), CI); + } + + if ((Op1CV != 0) == isNE) { // Toggle the low bit. + Constant *One = ConstantInt::get(In->getType(), 1); + In = BinaryOperator::createXor(In, One, "tmp"); + InsertNewInstBefore(cast(In), CI); + } + + if (CI.getType() == In->getType()) + return ReplaceInstUsesWith(CI, In); + else + return CastInst::createIntegerCast(In, CI.getType(), false/*ZExt*/); + } + } + } + } return 0; } From sabre at nondot.org Wed Apr 11 01:13:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:13:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704110613.l3B6DFEp029142@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.739 -> 1.740 --- Log message: canonicalize (x (x >s -1) and (x >u 2147483647) -> (x A == MIN return new ICmpInst(ICmpInst::ICMP_EQ, Op0, SubOne(CI)); + // (x (x >s -1) -> true if sign bit clear + if (CI->isMinValue(true)) + return new ICmpInst(ICmpInst::ICMP_SGT, Op0, + ConstantInt::getAllOnesValue(Op0->getType())); + break; case ICmpInst::ICMP_SLT: @@ -4642,6 +4647,11 @@ return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); if (isMaxValueMinusOne(CI, false)) // A >u MAX-1 -> A == MAX return new ICmpInst(ICmpInst::ICMP_EQ, Op0, AddOne(CI)); + + // (x >u 2147483647) -> (x true if sign bit set + if (CI->isMaxValue(true)) + return new ICmpInst(ICmpInst::ICMP_SLT, Op0, + ConstantInt::getNullValue(Op0->getType())); break; case ICmpInst::ICMP_SGT: @@ -6559,15 +6569,15 @@ // to an integer, then shift the bit to the appropriate place and then // cast to integer to avoid the comparison. if (ConstantInt *Op1C = dyn_cast(ICI->getOperand(1))) { - const APInt& Op1CV = Op1C->getValue(); - // cast (X == 0) to int --> X^1 iff X has only the low bit set. - // cast (X == 0) to int --> (X>>1)^1 iff X has only the 2nd bit set. - // cast (X == 1) to int --> X iff X has only the low bit set. - // cast (X == 2) to int --> X>>1 iff X has only the 2nd bit set. - // cast (X != 0) to int --> X iff X has only the low bit set. - // cast (X != 0) to int --> X>>1 iff X has only the 2nd bit set. - // cast (X != 1) to int --> X^1 iff X has only the low bit set. - // cast (X != 2) to int --> (X>>1)^1 iff X has only the 2nd bit set. + const APInt &Op1CV = Op1C->getValue(); + // zext (X == 0) to i32 --> X^1 iff X has only the low bit set. + // zext (X == 0) to i32 --> (X>>1)^1 iff X has only the 2nd bit set. + // zext (X == 1) to i32 --> X iff X has only the low bit set. + // zext (X == 2) to i32 --> X>>1 iff X has only the 2nd bit set. + // zext (X != 0) to i32 --> X iff X has only the low bit set. + // zext (X != 0) to i32 --> X>>1 iff X has only the 2nd bit set. + // zext (X != 1) to i32 --> X^1 iff X has only the low bit set. + // zext (X != 2) to i32 --> (X>>1)^1 iff X has only the 2nd bit set. if ((Op1CV == 0 || Op1CV.isPowerOf2()) && // This only works for EQ and NE ICI->isEquality()) { @@ -6617,7 +6627,13 @@ } Instruction *InstCombiner::visitSExt(CastInst &CI) { - return commonIntCastTransforms(CI); + if (Instruction *I = commonIntCastTransforms(CI)) + return I; + + // (x ashr x, 31 + // (x >u 2147483647) ? -1 : 0 -> ashr x, 31 + + return 0; } Instruction *InstCombiner::visitFPTrunc(CastInst &CI) { @@ -6901,34 +6917,25 @@ // Selecting between two integer constants? if (ConstantInt *TrueValC = dyn_cast(TrueVal)) if (ConstantInt *FalseValC = dyn_cast(FalseVal)) { - // select C, 1, 0 -> cast C to int + // select C, 1, 0 -> zext C to int if (FalseValC->isZero() && TrueValC->getValue() == 1) { return CastInst::create(Instruction::ZExt, CondVal, SI.getType()); } else if (TrueValC->isZero() && FalseValC->getValue() == 1) { - // select C, 0, 1 -> cast !C to int + // select C, 0, 1 -> zext !C to int Value *NotCond = InsertNewInstBefore(BinaryOperator::createNot(CondVal, "not."+CondVal->getName()), SI); return CastInst::create(Instruction::ZExt, NotCond, SI.getType()); } + + // FIXME: Turn select 0/-1 and -1/0 into sext from condition! if (ICmpInst *IC = dyn_cast(SI.getCondition())) { // (x ashr x, 31 - // (x >u 2147483647) ? -1 : 0 -> ashr x, 31 if (TrueValC->isAllOnesValue() && FalseValC->isZero()) if (ConstantInt *CmpCst = dyn_cast(IC->getOperand(1))) { - bool CanXForm = false; - if (IC->isSignedPredicate()) - CanXForm = CmpCst->isZero() && - IC->getPredicate() == ICmpInst::ICMP_SLT; - else { - uint32_t Bits = CmpCst->getType()->getPrimitiveSizeInBits(); - CanXForm = CmpCst->getValue() == APInt::getSignedMaxValue(Bits) && - IC->getPredicate() == ICmpInst::ICMP_UGT; - } - - if (CanXForm) { + if (IC->getPredicate() == ICmpInst::ICMP_SLT && CmpCst->isZero()) { // The comparison constant and the result are not neccessarily the // same width. Make an all-ones value by inserting a AShr. Value *X = IC->getOperand(0); @@ -6953,7 +6960,7 @@ // If one of the constants is zero (we know they can't both be) and we - // have a fcmp instruction with zero, and we have an 'and' with the + // have an icmp instruction with zero, and we have an 'and' with the // non-constant value, eliminate this whole mess. This corresponds to // cases like this: ((X & 27) ? 27 : 0) if (TrueValC->isZero() || FalseValC->isZero()) From sabre at nondot.org Wed Apr 11 01:43:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:43:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704110643.l3B6hggB029789@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.287 -> 1.288 --- Log message: don't create shifts by zero, fix some problems with my previous patch --- Diffs of the changes: (+7 -3) DAGCombiner.cpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.287 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.288 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.287 Wed Apr 11 00:32:27 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 11 01:43:25 2007 @@ -2136,7 +2136,7 @@ SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), DAG.getConstant(~0ULL, VT), DAG.getConstant(0, VT), cast(N0.getOperand(2))->get()); - if (SCC.Val) return SCC; + if (SCC.Val && SCC.Val != N) return SCC; } return SDOperand(); @@ -2226,7 +2226,7 @@ SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, VT), DAG.getConstant(0, VT), cast(N0.getOperand(2))->get()); - if (SCC.Val) return SCC; + if (SCC.Val && SCC.Val != N) return SCC; } return SDOperand(); @@ -2320,7 +2320,8 @@ SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, VT), DAG.getConstant(0, VT), cast(N0.getOperand(2))->get()); - if (SCC.Val) return SCC; + if (SCC.Val && SCC.Val != N && SCC.getOpcode() != ISD::ZERO_EXTEND) + return SCC; } return SDOperand(); @@ -4139,6 +4140,9 @@ } AddToWorkList(SCC.Val); AddToWorkList(Temp.Val); + + if (N2C->getValue() == 1) + return Temp; // shl setcc result by log2 n2c return DAG.getNode(ISD::SHL, N2.getValueType(), Temp, DAG.getConstant(Log2_64(N2C->getValue()), From sabre at nondot.org Wed Apr 11 01:51:09 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:51:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704110651.l3B6p9rs029937@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.288 -> 1.289 --- Log message: Fix this harder. --- Diffs of the changes: (+19 -12) DAGCombiner.cpp | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.288 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.289 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.288 Wed Apr 11 01:43:25 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 11 01:50:51 2007 @@ -266,7 +266,8 @@ SDOperand SimplifyBinOpWithSameOpcodeHands(SDNode *N); SDOperand SimplifySelect(SDOperand N0, SDOperand N1, SDOperand N2); SDOperand SimplifySelectCC(SDOperand N0, SDOperand N1, SDOperand N2, - SDOperand N3, ISD::CondCode CC); + SDOperand N3, ISD::CondCode CC, + bool NotExtCompare = false); SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N0, SDOperand N1, ISD::CondCode Cond, bool foldBooleans = true); SDOperand ConstantFoldVBIT_CONVERTofVBUILD_VECTOR(SDNode *, MVT::ValueType); @@ -2133,10 +2134,10 @@ // sext(setcc x,y,cc) -> select_cc x, y, -1, 0, cc if (N0.getOpcode() == ISD::SETCC) { SDOperand SCC = - SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), - DAG.getConstant(~0ULL, VT), DAG.getConstant(0, VT), - cast(N0.getOperand(2))->get()); - if (SCC.Val && SCC.Val != N) return SCC; + SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), + DAG.getConstant(~0ULL, VT), DAG.getConstant(0, VT), + cast(N0.getOperand(2))->get(), true); + if (SCC.Val) return SCC; } return SDOperand(); @@ -2225,8 +2226,8 @@ SDOperand SCC = SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, VT), DAG.getConstant(0, VT), - cast(N0.getOperand(2))->get()); - if (SCC.Val && SCC.Val != N) return SCC; + cast(N0.getOperand(2))->get(), true); + if (SCC.Val) return SCC; } return SDOperand(); @@ -2317,10 +2318,10 @@ // aext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc if (N0.getOpcode() == ISD::SETCC) { SDOperand SCC = - SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), - DAG.getConstant(1, VT), DAG.getConstant(0, VT), - cast(N0.getOperand(2))->get()); - if (SCC.Val && SCC.Val != N && SCC.getOpcode() != ISD::ZERO_EXTEND) + SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), + DAG.getConstant(1, VT), DAG.getConstant(0, VT), + cast(N0.getOperand(2))->get()); + if (SCC.Val) return SCC; } @@ -4047,7 +4048,7 @@ SDOperand DAGCombiner::SimplifySelectCC(SDOperand N0, SDOperand N1, SDOperand N2, SDOperand N3, - ISD::CondCode CC) { + ISD::CondCode CC, bool NotExtCompare) { MVT::ValueType VT = N2.getValueType(); ConstantSDNode *N1C = dyn_cast(N1.Val); @@ -4123,6 +4124,12 @@ // fold select C, 16, 0 -> shl C, 4 if (N2C && N3C && N3C->isNullValue() && isPowerOf2_64(N2C->getValue()) && TLI.getSetCCResultContents() == TargetLowering::ZeroOrOneSetCCResult) { + + // If the caller doesn't want us to simplify this into a zext of a compare, + // don't do it. + if (NotExtCompare && N2C->getValue() == 1) + return SDOperand(); + // Get a SetCC of the condition // FIXME: Should probably make sure that setcc is legal if we ever have a // target where it isn't. From sabre at nondot.org Wed Apr 11 01:52:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:52:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/icmp.ll Message-ID: <200704110652.l3B6qgqF030045@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: icmp.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+17 -0) icmp.ll | 17 +++++++++++++++++ 1 files changed, 17 insertions(+) Index: llvm/test/Transforms/InstCombine/icmp.ll diff -c /dev/null llvm/test/Transforms/InstCombine/icmp.ll:1.1 *** /dev/null Wed Apr 11 01:52:34 2007 --- llvm/test/Transforms/InstCombine/icmp.ll Wed Apr 11 01:52:24 2007 *************** *** 0 **** --- 1,17 ---- + ; RUN: llvm-as < %s | opt -instcombine -disable-output && + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp + + define i32 @test1(i32 %X) { + entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + + define i32 @test2(i32 %X) { + entry: + icmp ult i32 %X, -2147483648 ; :0 [#uses=1] + zext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 + } + From sabre at nondot.org Wed Apr 11 01:53:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:53:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704110653.l3B6rLDB030065@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.740 -> 1.741 --- Log message: Simplify some comparisons to arithmetic, this implements: Transforms/InstCombine/icmp.ll --- Diffs of the changes: (+27 -0) InstructionCombining.cpp | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.740 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.741 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.740 Wed Apr 11 01:12:58 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Apr 11 01:53:04 2007 @@ -6570,6 +6570,33 @@ // cast to integer to avoid the comparison. if (ConstantInt *Op1C = dyn_cast(ICI->getOperand(1))) { const APInt &Op1CV = Op1C->getValue(); + + // zext (x x>>u31 true if signbit set. + // zext (x >s -1) to i32 --> (x>>u31)^1 true if signbit clear. + if ((ICI->getPredicate() == ICmpInst::ICMP_SLT && Op1CV == 0) || + (ICI->getPredicate() == ICmpInst::ICMP_SGT &&Op1CV.isAllOnesValue())){ + Value *In = ICI->getOperand(0); + Value *Sh = ConstantInt::get(In->getType(), + In->getType()->getPrimitiveSizeInBits()-1); + In = InsertNewInstBefore(BinaryOperator::createLShr(In, Sh, + In->getName()+".lobit"), + CI); + if (In->getType() != CI.getType()) + In = CastInst::createIntegerCast(In, CI.getType(), + false/*ZExt*/, "tmp", &CI); + + if (ICI->getPredicate() == ICmpInst::ICMP_SGT) { + Constant *One = ConstantInt::get(In->getType(), 1); + In = InsertNewInstBefore(BinaryOperator::createXor(In, One, + In->getName()+".not"), + CI); + } + + return ReplaceInstUsesWith(CI, In); + } + + + // zext (X == 0) to i32 --> X^1 iff X has only the low bit set. // zext (X == 0) to i32 --> (X>>1)^1 iff X has only the 2nd bit set. // zext (X == 1) to i32 --> X iff X has only the low bit set. From sabre at nondot.org Wed Apr 11 01:58:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:58:06 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704110658.l3B6w5lp030207@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.741 -> 1.742 --- Log message: Turn stuff like: icmp slt i32 %X, 0 ; :0 [#uses=1] sext i1 %0 to i32 ; :1 [#uses=1] into: %X.lobit = ashr i32 %X, 31 ; [#uses=1] This implements InstCombine/icmp.ll:test[34] --- Diffs of the changes: (+40 -9) InstructionCombining.cpp | 49 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 40 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.741 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.742 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.741 Wed Apr 11 01:53:04 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Apr 11 01:57:46 2007 @@ -193,9 +193,9 @@ BinaryOperator &I); Instruction *commonCastTransforms(CastInst &CI); Instruction *commonIntCastTransforms(CastInst &CI); - Instruction *visitTrunc(CastInst &CI); - Instruction *visitZExt(CastInst &CI); - Instruction *visitSExt(CastInst &CI); + Instruction *visitTrunc(TruncInst &CI); + Instruction *visitZExt(ZExtInst &CI); + Instruction *visitSExt(SExtInst &CI); Instruction *visitFPTrunc(CastInst &CI); Instruction *visitFPExt(CastInst &CI); Instruction *visitFPToUI(CastInst &CI); @@ -6471,7 +6471,7 @@ return 0; } -Instruction *InstCombiner::visitTrunc(CastInst &CI) { +Instruction *InstCombiner::visitTrunc(TruncInst &CI) { if (Instruction *Result = commonIntCastTransforms(CI)) return Result; @@ -6528,7 +6528,7 @@ return 0; } -Instruction *InstCombiner::visitZExt(CastInst &CI) { +Instruction *InstCombiner::visitZExt(ZExtInst &CI) { // If one of the common conversion will work .. if (Instruction *Result = commonIntCastTransforms(CI)) return Result; @@ -6653,13 +6653,44 @@ return 0; } -Instruction *InstCombiner::visitSExt(CastInst &CI) { +Instruction *InstCombiner::visitSExt(SExtInst &CI) { if (Instruction *I = commonIntCastTransforms(CI)) return I; - // (x ashr x, 31 - // (x >u 2147483647) ? -1 : 0 -> ashr x, 31 - + Value *Src = CI.getOperand(0); + + // sext (x ashr x, 31 -> all ones if signed + // sext (x >s -1) -> ashr x, 31 -> all ones if not signed + if (ICmpInst *ICI = dyn_cast(Src)) { + // If we are just checking for a icmp eq of a single bit and zext'ing it + // to an integer, then shift the bit to the appropriate place and then + // cast to integer to avoid the comparison. + if (ConstantInt *Op1C = dyn_cast(ICI->getOperand(1))) { + const APInt &Op1CV = Op1C->getValue(); + + // sext (x x>>s31 true if signbit set. + // sext (x >s -1) to i32 --> (x>>s31)^-1 true if signbit clear. + if ((ICI->getPredicate() == ICmpInst::ICMP_SLT && Op1CV == 0) || + (ICI->getPredicate() == ICmpInst::ICMP_SGT &&Op1CV.isAllOnesValue())){ + Value *In = ICI->getOperand(0); + Value *Sh = ConstantInt::get(In->getType(), + In->getType()->getPrimitiveSizeInBits()-1); + In = InsertNewInstBefore(BinaryOperator::createAShr(In, Sh, + In->getName()+".lobit"), + CI); + if (In->getType() != CI.getType()) + In = CastInst::createIntegerCast(In, CI.getType(), + true/*SExt*/, "tmp", &CI); + + if (ICI->getPredicate() == ICmpInst::ICMP_SGT) + In = InsertNewInstBefore(BinaryOperator::createNot(In, + In->getName()+".not"), CI); + + return ReplaceInstUsesWith(CI, In); + } + } + } + return 0; } From sabre at nondot.org Wed Apr 11 01:58:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 01:58:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/icmp.ll Message-ID: <200704110658.l3B6wCOw030214@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: icmp.ll updated: 1.1 -> 1.2 --- Log message: sext of compares. --- Diffs of the changes: (+14 -0) icmp.ll | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/test/Transforms/InstCombine/icmp.ll diff -u llvm/test/Transforms/InstCombine/icmp.ll:1.1 llvm/test/Transforms/InstCombine/icmp.ll:1.2 --- llvm/test/Transforms/InstCombine/icmp.ll:1.1 Wed Apr 11 01:52:24 2007 +++ llvm/test/Transforms/InstCombine/icmp.ll Wed Apr 11 01:57:54 2007 @@ -15,3 +15,17 @@ ret i32 %1 } +define i32 @test3(i32 %X) { +entry: + icmp slt i32 %X, 0 ; :0 [#uses=1] + sext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 +} + +define i32 @test4(i32 %X) { +entry: + icmp ult i32 %X, -2147483648 ; :0 [#uses=1] + sext i1 %0 to i32 ; :1 [#uses=1] + ret i32 %1 +} + From baldrick at free.fr Wed Apr 11 03:02:27 2007 From: baldrick at free.fr (Duncan Sands) Date: Wed, 11 Apr 2007 10:02:27 +0200 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/ispositive.ll In-Reply-To: <200704110532.l3B5WVph028206@zion.cs.uiuc.edu> References: <200704110532.l3B5WVph028206@zion.cs.uiuc.edu> Message-ID: <200704111002.28111.baldrick@free.fr> Hi Chris, > ispositive.ll added (r1.1) > + define i32 @isnegative(i32 %X) { the names are inconsistent. Ciao, Duncan. From reid at x10sys.com Wed Apr 11 04:54:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 04:54:25 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200704110954.l3B9sPdA014266@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.42 -> 1.43 --- Log message: Add support for parameter attributes. --- Diffs of the changes: (+26 -1) CppWriter.cpp | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletion(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.42 llvm/tools/llvm2cpp/CppWriter.cpp:1.43 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.42 Thu Mar 1 14:55:43 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 04:54:08 2007 @@ -18,6 +18,7 @@ #include "llvm/InlineAsm.h" #include "llvm/Instruction.h" #include "llvm/Instructions.h" +#include "llvm/ParameterAttributes.h" #include "llvm/Module.h" #include "llvm/TypeSymbolTable.h" #include "llvm/ADT/StringExtras.h" @@ -457,6 +458,29 @@ Out << ");"; nl(Out); } + const ParamAttrsList *PAL = FT->getParamAttrs(); + Out << "ParamAttrsList *" << typeName << "_PAL = 0;"; + if (PAL && !PAL->empty()) { + Out << typeName << "_PAL = new ParamAttrsList();"; + for (unsigned i = 0; i < PAL->size(); ++i) { + uint16_t index = PAL->getParamIndex(i); + uint16_t attrs = PAL->getParamAttrs(index); + Out << typeName << "_PAL->addAttribute(" << index << ", 0"; + if (attrs & ParamAttr::SExt) + Out << " | ParamAttr::SExt"; + if (attrs & ParamAttr::ZExt) + Out << " | ParamAttr::ZExt"; + if (attrs & ParamAttr::StructRet) + Out << " | ParamAttr::StructRet"; + if (attrs & ParamAttr::InReg) + Out << " | ParamAttr::InReg"; + if (attrs & ParamAttr::NoReturn) + Out << " | ParamAttr::NoReturn"; + if (attrs & ParamAttr::NoUnwind) + Out << " | ParamAttr::NoUnwind"; + Out << ");"; + } + } bool isForward = printTypeInternal(FT->getReturnType()); std::string retTypeName(getCppName(FT->getReturnType())); Out << "FunctionType* " << typeName << " = FunctionType::get("; @@ -465,7 +489,8 @@ Out << "_fwd"; Out << ","; nl(Out) << "/*Params=*/" << typeName << "_args,"; - nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") << ");"; + nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") ; + nl(Out) << "/*ParamAttrs=/" << typeName << "_PAL" << ");"; out(); nl(Out); break; From reid at x10sys.com Wed Apr 11 05:01:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 05:01:50 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200704111001.l3BA1oKg014392@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.43 -> 1.44 --- Log message: Fix some issues with param attrs. --- Diffs of the changes: (+4 -1) CppWriter.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.43 llvm/tools/llvm2cpp/CppWriter.cpp:1.44 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.43 Wed Apr 11 04:54:08 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 05:01:32 2007 @@ -460,8 +460,10 @@ } const ParamAttrsList *PAL = FT->getParamAttrs(); Out << "ParamAttrsList *" << typeName << "_PAL = 0;"; + nl(Out); if (PAL && !PAL->empty()) { Out << typeName << "_PAL = new ParamAttrsList();"; + nl(Out); for (unsigned i = 0; i < PAL->size(); ++i) { uint16_t index = PAL->getParamIndex(i); uint16_t attrs = PAL->getParamAttrs(index); @@ -479,6 +481,7 @@ if (attrs & ParamAttr::NoUnwind) Out << " | ParamAttr::NoUnwind"; Out << ");"; + nl(Out); } } bool isForward = printTypeInternal(FT->getReturnType()); @@ -490,7 +493,7 @@ Out << ","; nl(Out) << "/*Params=*/" << typeName << "_args,"; nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") ; - nl(Out) << "/*ParamAttrs=/" << typeName << "_PAL" << ");"; + nl(Out) << "/*ParamAttrs=*/" << typeName << "_PAL" << ");"; out(); nl(Out); break; From reid at x10sys.com Wed Apr 11 07:04:51 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:04:51 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/fold-fpcast.ll Message-ID: <200704111204.l3BC4pPp017490@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: fold-fpcast.ll updated: 1.1 -> 1.2 --- Log message: Fix to not give false positives. --- Diffs of the changes: (+2 -1) fold-fpcast.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Feature/fold-fpcast.ll diff -u llvm/test/Feature/fold-fpcast.ll:1.1 llvm/test/Feature/fold-fpcast.ll:1.2 --- llvm/test/Feature/fold-fpcast.ll:1.1 Mon Dec 11 15:25:10 2006 +++ llvm/test/Feature/fold-fpcast.ll Wed Apr 11 07:04:33 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | llvm-dis | not grep bitcast +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null && +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast int %test1() { ret int bitcast(float 3.7 to int) From reid at x10sys.com Wed Apr 11 07:10:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:10:26 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y Message-ID: <200704111210.l3BCAQ95017609@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.y updated: 1.80 -> 1.81 --- Log message: Fix a crash-by-unknown-exception caused by attempting to use a null pointer as the key for a map insertion. --- Diffs of the changes: (+2 -1) UpgradeParser.y | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.80 llvm/tools/llvm-upgrade/UpgradeParser.y:1.81 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.80 Tue Apr 10 21:44:20 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Wed Apr 11 07:10:08 2007 @@ -774,7 +774,8 @@ D = ValID::create((int)CurModule.Types.size()); D.S.copy(Sign); - CurModule.NamedTypeSigns[Name] = Sign; + if (Name) + CurModule.NamedTypeSigns[Name] = Sign; std::map::iterator I = CurModule.LateResolveTypes.find(D); From reid at x10sys.com Wed Apr 11 07:11:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:11:15 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y.cvs Message-ID: <200704111211.l3BCBFow017635@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.74 -> 1.75 UpgradeParser.h.cvs updated: 1.54 -> 1.55 UpgradeParser.y.cvs updated: 1.73 -> 1.74 --- Log message: Regenerate. --- Diffs of the changes: (+273 -271) UpgradeParser.cpp.cvs | 539 +++++++++++++++++++++++++------------------------- UpgradeParser.h.cvs | 2 UpgradeParser.y.cvs | 3 3 files changed, 273 insertions(+), 271 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.74 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.75 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.74 Tue Apr 10 21:44:19 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Wed Apr 11 07:10:58 2007 @@ -370,7 +370,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 14 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" #include "UpgradeInternals.h" #include "llvm/CallingConv.h" @@ -1134,7 +1134,8 @@ D = ValID::create((int)CurModule.Types.size()); D.S.copy(Sign); - CurModule.NamedTypeSigns[Name] = Sign; + if (Name) + CurModule.NamedTypeSigns[Name] = Sign; std::map::iterator I = CurModule.LateResolveTypes.find(D); @@ -2117,7 +2118,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1741 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1742 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -2160,7 +2161,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 2164 "UpgradeParser.tab.c" +#line 2165 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -2172,7 +2173,7 @@ /* Line 219 of yacc.c. */ -#line 2176 "UpgradeParser.tab.c" +#line 2177 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2532,38 +2533,38 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1881, 1881, 1882, 1890, 1891, 1901, 1901, 1901, 1901, - 1901, 1901, 1901, 1901, 1901, 1901, 1901, 1905, 1905, 1905, - 1909, 1909, 1909, 1909, 1909, 1909, 1913, 1913, 1914, 1914, - 1915, 1915, 1916, 1916, 1917, 1917, 1921, 1921, 1922, 1922, - 1923, 1923, 1924, 1924, 1925, 1925, 1926, 1926, 1927, 1927, - 1928, 1929, 1932, 1932, 1932, 1932, 1936, 1936, 1936, 1936, - 1936, 1936, 1936, 1937, 1937, 1937, 1937, 1937, 1937, 1943, - 1943, 1943, 1943, 1947, 1947, 1947, 1947, 1951, 1951, 1955, - 1955, 1960, 1963, 1968, 1969, 1970, 1971, 1972, 1973, 1974, - 1975, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1996, - 1997, 2005, 2006, 2014, 2023, 2024, 2031, 2032, 2036, 2040, - 2056, 2057, 2064, 2065, 2072, 2080, 2080, 2080, 2080, 2080, - 2080, 2080, 2081, 2081, 2081, 2081, 2081, 2086, 2090, 2094, - 2099, 2108, 2126, 2132, 2145, 2156, 2160, 2173, 2177, 2191, - 2195, 2202, 2203, 2209, 2216, 2228, 2258, 2271, 2294, 2322, - 2344, 2355, 2377, 2388, 2397, 2402, 2461, 2468, 2476, 2483, - 2490, 2494, 2498, 2507, 2522, 2535, 2544, 2572, 2585, 2594, - 2600, 2606, 2617, 2623, 2629, 2640, 2641, 2650, 2651, 2663, - 2672, 2673, 2674, 2675, 2676, 2692, 2712, 2714, 2716, 2716, - 2723, 2723, 2731, 2731, 2739, 2739, 2748, 2750, 2752, 2757, - 2771, 2772, 2776, 2779, 2787, 2791, 2798, 2802, 2806, 2810, - 2818, 2818, 2822, 2823, 2827, 2835, 2840, 2848, 2849, 2856, - 2863, 2867, 3049, 3049, 3053, 3053, 3063, 3063, 3067, 3072, - 3073, 3074, 3078, 3079, 3078, 3091, 3092, 3097, 3098, 3099, - 3100, 3104, 3108, 3109, 3110, 3111, 3132, 3136, 3150, 3151, - 3156, 3156, 3164, 3174, 3177, 3186, 3197, 3202, 3211, 3222, - 3222, 3225, 3229, 3233, 3238, 3248, 3266, 3275, 3345, 3349, - 3356, 3368, 3383, 3413, 3423, 3433, 3437, 3444, 3445, 3449, - 3452, 3458, 3477, 3495, 3511, 3525, 3539, 3550, 3568, 3577, - 3586, 3593, 3614, 3638, 3644, 3650, 3656, 3672, 3762, 3770, - 3771, 3775, 3776, 3780, 3786, 3793, 3799, 3806, 3813, 3826, - 3852 + 0, 1882, 1882, 1883, 1891, 1892, 1902, 1902, 1902, 1902, + 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1906, 1906, 1906, + 1910, 1910, 1910, 1910, 1910, 1910, 1914, 1914, 1915, 1915, + 1916, 1916, 1917, 1917, 1918, 1918, 1922, 1922, 1923, 1923, + 1924, 1924, 1925, 1925, 1926, 1926, 1927, 1927, 1928, 1928, + 1929, 1930, 1933, 1933, 1933, 1933, 1937, 1937, 1937, 1937, + 1937, 1937, 1937, 1938, 1938, 1938, 1938, 1938, 1938, 1944, + 1944, 1944, 1944, 1948, 1948, 1948, 1948, 1952, 1952, 1956, + 1956, 1961, 1964, 1969, 1970, 1971, 1972, 1973, 1974, 1975, + 1976, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1997, + 1998, 2006, 2007, 2015, 2024, 2025, 2032, 2033, 2037, 2041, + 2057, 2058, 2065, 2066, 2073, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2082, 2082, 2082, 2082, 2082, 2087, 2091, 2095, + 2100, 2109, 2127, 2133, 2146, 2157, 2161, 2174, 2178, 2192, + 2196, 2203, 2204, 2210, 2217, 2229, 2259, 2272, 2295, 2323, + 2345, 2356, 2378, 2389, 2398, 2403, 2462, 2469, 2477, 2484, + 2491, 2495, 2499, 2508, 2523, 2536, 2545, 2573, 2586, 2595, + 2601, 2607, 2618, 2624, 2630, 2641, 2642, 2651, 2652, 2664, + 2673, 2674, 2675, 2676, 2677, 2693, 2713, 2715, 2717, 2717, + 2724, 2724, 2732, 2732, 2740, 2740, 2749, 2751, 2753, 2758, + 2772, 2773, 2777, 2780, 2788, 2792, 2799, 2803, 2807, 2811, + 2819, 2819, 2823, 2824, 2828, 2836, 2841, 2849, 2850, 2857, + 2864, 2868, 3050, 3050, 3054, 3054, 3064, 3064, 3068, 3073, + 3074, 3075, 3079, 3080, 3079, 3092, 3093, 3098, 3099, 3100, + 3101, 3105, 3109, 3110, 3111, 3112, 3133, 3137, 3151, 3152, + 3157, 3157, 3165, 3175, 3178, 3187, 3198, 3203, 3212, 3223, + 3223, 3226, 3230, 3234, 3239, 3249, 3267, 3276, 3346, 3350, + 3357, 3369, 3384, 3414, 3424, 3434, 3438, 3445, 3446, 3450, + 3453, 3459, 3478, 3496, 3512, 3526, 3540, 3551, 3569, 3578, + 3587, 3594, 3615, 3639, 3645, 3651, 3657, 3673, 3763, 3771, + 3772, 3776, 3777, 3781, 3787, 3794, 3800, 3807, 3814, 3827, + 3853 }; #endif @@ -3953,7 +3954,7 @@ switch (yyn) { case 3: -#line 1882 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1883 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3962,7 +3963,7 @@ break; case 5: -#line 1891 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1892 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -3971,226 +3972,226 @@ break; case 26: -#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1914 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1913 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1914 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1915 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1914 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1915 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1916 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1915 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1916 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1917 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1916 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1917 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1918 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1917 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1918 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1921 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1922 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1921 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1922 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1922 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1923 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1922 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1923 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1923 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1924 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1923 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1924 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1924 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1925 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1924 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1925 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1926 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1925 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1926 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1926 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1927 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1926 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1927 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1927 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1928 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1927 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1928 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1928 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1929 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1929 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1930 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1960 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1961 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1963 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1964 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1968 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1969 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1969 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1970 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1970 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1971 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 1971 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1972 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 1972 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1973 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 1973 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1974 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 1974 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1975 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 1975 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1976 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 1979 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1980 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 92: -#line 1980 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1981 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::C; ;} break; case 93: -#line 1981 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1982 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 1982 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1983 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 1983 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1984 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 1984 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1985 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 1985 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1986 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 1986 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1987 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -4199,12 +4200,12 @@ break; case 99: -#line 1996 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1997 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 1997 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1998 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4213,12 +4214,12 @@ break; case 101: -#line 2005 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2006 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 2006 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2007 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4227,7 +4228,7 @@ break; case 103: -#line 2014 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2015 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -4237,27 +4238,27 @@ break; case 104: -#line 2023 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2024 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 2024 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2025 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 2031 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2032 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 107: -#line 2032 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2033 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" {;} break; case 108: -#line 2036 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2037 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4265,7 +4266,7 @@ break; case 109: -#line 2040 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2041 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -4275,7 +4276,7 @@ break; case 111: -#line 2057 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2058 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4283,7 +4284,7 @@ break; case 113: -#line 2065 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2066 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4291,7 +4292,7 @@ break; case 114: -#line 2072 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2073 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).PAT)->getDescription()); @@ -4300,7 +4301,7 @@ break; case 127: -#line 2086 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.copy((yyvsp[0].PrimType).S); @@ -4308,7 +4309,7 @@ break; case 128: -#line 2090 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2091 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S.makeSignless(); @@ -4316,7 +4317,7 @@ break; case 129: -#line 2094 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2095 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... (yyval.TypeVal).S.copy(getTypeSign((yyvsp[0].ValIDVal))); const Type* tmp = getType((yyvsp[0].ValIDVal)); @@ -4325,7 +4326,7 @@ break; case 130: -#line 2099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2100 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); @@ -4338,7 +4339,7 @@ break; case 131: -#line 2108 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2109 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? (yyval.TypeVal).S.makeComposite((yyvsp[-3].TypeVal).S); std::vector Params; @@ -4360,7 +4361,7 @@ break; case 132: -#line 2126 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2127 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyval.TypeVal).S.makeComposite((yyvsp[-1].TypeVal).S); (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).PAT->get(), @@ -4370,7 +4371,7 @@ break; case 133: -#line 2132 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2133 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).PAT->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -4387,7 +4388,7 @@ break; case 134: -#line 2145 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2146 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector Elements; (yyval.TypeVal).S.makeComposite(); @@ -4402,7 +4403,7 @@ break; case 135: -#line 2156 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2157 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).S.makeComposite(); @@ -4410,7 +4411,7 @@ break; case 136: -#line 2160 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2161 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? (yyval.TypeVal).S.makeComposite(); std::vector Elements; @@ -4427,7 +4428,7 @@ break; case 137: -#line 2173 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2174 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector(),true)); (yyval.TypeVal).S.makeComposite(); @@ -4435,7 +4436,7 @@ break; case 138: -#line 2177 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2178 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); @@ -4447,7 +4448,7 @@ break; case 139: -#line 2191 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2192 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4455,14 +4456,14 @@ break; case 140: -#line 2195 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2196 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 2203 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2204 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); @@ -4472,7 +4473,7 @@ break; case 143: -#line 2209 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2210 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; @@ -4483,14 +4484,14 @@ break; case 144: -#line 2216 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2217 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); ;} break; case 145: -#line 2228 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2229 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (ATy == 0) @@ -4524,7 +4525,7 @@ break; case 146: -#line 2258 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2259 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4541,7 +4542,7 @@ break; case 147: -#line 2271 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2272 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4568,7 +4569,7 @@ break; case 148: -#line 2294 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2295 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (PTy == 0) @@ -4600,7 +4601,7 @@ break; case 149: -#line 2322 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2323 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (STy == 0) @@ -4626,7 +4627,7 @@ break; case 150: -#line 2344 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2345 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (STy == 0) @@ -4641,7 +4642,7 @@ break; case 151: -#line 2355 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2356 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal).PAT->get()); if (STy == 0) @@ -4667,7 +4668,7 @@ break; case 152: -#line 2377 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2378 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-4].TypeVal).PAT->get()); if (STy == 0) @@ -4682,7 +4683,7 @@ break; case 153: -#line 2388 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2389 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (PTy == 0) @@ -4695,7 +4696,7 @@ break; case 154: -#line 2397 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2398 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).PAT->get()); (yyval.ConstVal).S.copy((yyvsp[-1].TypeVal).S); @@ -4704,7 +4705,7 @@ break; case 155: -#line 2402 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2403 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (Ty == 0) @@ -4767,7 +4768,7 @@ break; case 156: -#line 2461 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2462 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); @@ -4778,7 +4779,7 @@ break; case 157: -#line 2468 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2469 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -4790,7 +4791,7 @@ break; case 158: -#line 2476 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2477 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4801,7 +4802,7 @@ break; case 159: -#line 2483 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2484 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4812,7 +4813,7 @@ break; case 160: -#line 2490 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2491 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S.makeUnsigned(); @@ -4820,7 +4821,7 @@ break; case 161: -#line 2494 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2495 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S.makeUnsigned(); @@ -4828,7 +4829,7 @@ break; case 162: -#line 2498 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2499 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4838,7 +4839,7 @@ break; case 163: -#line 2507 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2508 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); const Type* DstTy = (yyvsp[-1].TypeVal).PAT->get(); @@ -4857,7 +4858,7 @@ break; case 164: -#line 2522 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2523 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa(Ty)) @@ -4874,7 +4875,7 @@ break; case 165: -#line 2535 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2536 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4887,7 +4888,7 @@ break; case 166: -#line 2544 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2545 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4919,7 +4920,7 @@ break; case 167: -#line 2572 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2573 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4936,7 +4937,7 @@ break; case 168: -#line 2585 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2586 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4949,7 +4950,7 @@ break; case 169: -#line 2594 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2595 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4959,7 +4960,7 @@ break; case 170: -#line 2600 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2601 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4969,7 +4970,7 @@ break; case 171: -#line 2606 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2607 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) @@ -4984,7 +4985,7 @@ break; case 172: -#line 2617 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2618 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -4994,7 +4995,7 @@ break; case 173: -#line 2623 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2624 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -5004,7 +5005,7 @@ break; case 174: -#line 2629 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2630 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -5014,12 +5015,12 @@ break; case 175: -#line 2640 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2641 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2641 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2642 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -5027,17 +5028,17 @@ break; case 177: -#line 2650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2651 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2651 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2652 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2663 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2664 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -5045,27 +5046,27 @@ break; case 180: -#line 2672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2673 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2673 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2674 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2674 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2675 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2675 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2676 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2676 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2677 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -5081,7 +5082,7 @@ break; case 185: -#line 2692 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2693 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -5105,19 +5106,19 @@ break; case 186: -#line 2712 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2713 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2714 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2715 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2716 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2717 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -5126,14 +5127,14 @@ break; case 189: -#line 2720 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2721 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2723 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2724 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5143,14 +5144,14 @@ break; case 191: -#line 2728 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2729 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2731 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2732 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5160,14 +5161,14 @@ break; case 193: -#line 2736 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2737 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2739 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2740 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = @@ -5178,32 +5179,32 @@ break; case 195: -#line 2745 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2746 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2748 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2749 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2750 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2751 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2752 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2753 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2757 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2758 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -5218,24 +5219,24 @@ break; case 200: -#line 2771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2772 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2772 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2773 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2776 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2777 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2779 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2780 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -5247,7 +5248,7 @@ break; case 204: -#line 2787 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2788 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5255,7 +5256,7 @@ break; case 205: -#line 2791 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2792 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5263,7 +5264,7 @@ break; case 207: -#line 2802 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2803 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5271,7 +5272,7 @@ break; case 208: -#line 2806 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2807 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5279,17 +5280,17 @@ break; case 209: -#line 2810 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2811 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2823 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2824 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2827 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2828 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); @@ -5298,7 +5299,7 @@ break; case 215: -#line 2835 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2836 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5307,7 +5308,7 @@ break; case 216: -#line 2840 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2841 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5316,12 +5317,12 @@ break; case 217: -#line 2848 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2849 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2849 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2850 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; @@ -5332,7 +5333,7 @@ break; case 219: -#line 2856 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2857 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; @@ -5343,12 +5344,12 @@ break; case 220: -#line 2863 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2864 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2867 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 2868 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -5531,12 +5532,12 @@ break; case 224: -#line 3053 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3054 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 225: -#line 3053 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3054 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5547,39 +5548,39 @@ break; case 228: -#line 3067 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3068 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 229: -#line 3072 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3073 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 230: -#line 3073 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3074 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 231: -#line 3074 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3075 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 232: -#line 3078 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3079 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 233: -#line 3079 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3080 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 234: -#line 3079 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3080 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5588,32 +5589,32 @@ break; case 235: -#line 3091 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3092 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 236: -#line 3092 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3093 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 237: -#line 3097 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3098 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; case 238: -#line 3098 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3099 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; case 239: -#line 3099 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3100 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; case 240: -#line 3100 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3101 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5621,7 +5622,7 @@ break; case 241: -#line 3104 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3105 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5629,22 +5630,22 @@ break; case 242: -#line 3108 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3109 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; case 243: -#line 3109 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3110 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; case 244: -#line 3110 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3111 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; case 245: -#line 3111 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3112 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5669,7 +5670,7 @@ break; case 246: -#line 3132 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3133 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); (yyval.ValIDVal).S.copy((yyvsp[0].ConstVal).S); @@ -5677,7 +5678,7 @@ break; case 247: -#line 3136 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3137 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5690,17 +5691,17 @@ break; case 248: -#line 3150 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3151 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 249: -#line 3151 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3152 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 252: -#line 3164 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3165 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -5711,21 +5712,21 @@ break; case 253: -#line 3174 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3175 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 254: -#line 3177 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3178 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 255: -#line 3186 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3187 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ValueInfo VI; VI.V = (yyvsp[0].TermInstVal).TI; VI.S.copy((yyvsp[0].TermInstVal).S); setValueName(VI, (yyvsp[-1].StrVal)); @@ -5737,7 +5738,7 @@ break; case 256: -#line 3197 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3198 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5746,7 +5747,7 @@ break; case 257: -#line 3202 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3203 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++),true); // Make sure to move the basic block to the correct location in the @@ -5759,7 +5760,7 @@ break; case 258: -#line 3211 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3212 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5772,7 +5773,7 @@ break; case 261: -#line 3225 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3226 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal).TI = new ReturnInst((yyvsp[0].ValueVal).V); (yyval.TermInstVal).S.makeSignless(); @@ -5780,7 +5781,7 @@ break; case 262: -#line 3229 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3230 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal).TI = new ReturnInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5788,7 +5789,7 @@ break; case 263: -#line 3233 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3234 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal).TI = new BranchInst(tmpBB); @@ -5797,7 +5798,7 @@ break; case 264: -#line 3238 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3239 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-3].ValIDVal).S.makeSignless(); (yyvsp[0].ValIDVal).S.makeSignless(); @@ -5811,7 +5812,7 @@ break; case 265: -#line 3248 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3249 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-6].ValIDVal).S.copy((yyvsp[-7].PrimType).S); Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); @@ -5833,7 +5834,7 @@ break; case 266: -#line 3266 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3267 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-5].ValIDVal).S.copy((yyvsp[-6].PrimType).S); Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); @@ -5846,7 +5847,7 @@ break; case 267: -#line 3276 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3277 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -5919,7 +5920,7 @@ break; case 268: -#line 3345 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3346 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnwindInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5927,7 +5928,7 @@ break; case 269: -#line 3349 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3350 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnreachableInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5935,7 +5936,7 @@ break; case 270: -#line 3356 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3357 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5951,7 +5952,7 @@ break; case 271: -#line 3368 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3369 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector >(); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5967,7 +5968,7 @@ break; case 272: -#line 3383 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3384 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -6000,7 +6001,7 @@ break; case 273: -#line 3413 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3414 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list >(); (yyval.PHIList).S.copy((yyvsp[-5].TypeVal).S); @@ -6014,7 +6015,7 @@ break; case 274: -#line 3423 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3424 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-6].PHIList).S); @@ -6026,7 +6027,7 @@ break; case 275: -#line 3433 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3434 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6034,7 +6035,7 @@ break; case 276: -#line 3437 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3438 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6042,26 +6043,26 @@ break; case 278: -#line 3445 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3446 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; case 279: -#line 3449 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3450 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 280: -#line 3452 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3453 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 281: -#line 3458 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3459 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6084,7 +6085,7 @@ break; case 282: -#line 3477 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3478 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6106,7 +6107,7 @@ break; case 283: -#line 3495 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3496 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6126,7 +6127,7 @@ break; case 284: -#line 3511 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3512 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6144,7 +6145,7 @@ break; case 285: -#line 3525 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3526 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6162,7 +6163,7 @@ break; case 286: -#line 3539 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3540 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -6177,7 +6178,7 @@ break; case 287: -#line 3550 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3551 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) @@ -6199,7 +6200,7 @@ break; case 288: -#line 3568 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3569 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *DstTy = (yyvsp[0].TypeVal).PAT->get(); if (!DstTy->isFirstClassType()) @@ -6212,7 +6213,7 @@ break; case 289: -#line 3577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3578 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -6225,7 +6226,7 @@ break; case 290: -#line 3586 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3587 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); NewVarArgs = true; @@ -6236,7 +6237,7 @@ break; case 291: -#line 3593 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3594 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6261,7 +6262,7 @@ break; case 292: -#line 3614 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3615 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6289,7 +6290,7 @@ break; case 293: -#line 3638 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3639 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -6299,7 +6300,7 @@ break; case 294: -#line 3644 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3645 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -6309,7 +6310,7 @@ break; case 295: -#line 3650 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3651 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -6319,7 +6320,7 @@ break; case 296: -#line 3656 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3657 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6339,7 +6340,7 @@ break; case 297: -#line 3672 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3673 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax const PointerType *PFTy; @@ -6433,34 +6434,34 @@ break; case 298: -#line 3762 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3763 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; case 299: -#line 3770 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3771 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; case 300: -#line 3771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3772 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 301: -#line 3775 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3776 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 302: -#line 3776 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3777 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 303: -#line 3780 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3781 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6470,7 +6471,7 @@ break; case 304: -#line 3786 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3787 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6481,7 +6482,7 @@ break; case 305: -#line 3793 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3794 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6491,7 +6492,7 @@ break; case 306: -#line 3799 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3800 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6502,7 +6503,7 @@ break; case 307: -#line 3806 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3807 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa(PTy)) @@ -6513,7 +6514,7 @@ break; case 308: -#line 3813 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3814 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -6530,7 +6531,7 @@ break; case 309: -#line 3826 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3827 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); @@ -6560,7 +6561,7 @@ break; case 310: -#line 3852 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3853 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1].ValIDVal).S.copy((yyvsp[-2].TypeVal).S); const Type* Ty = (yyvsp[-2].TypeVal).PAT->get(); @@ -6584,7 +6585,7 @@ } /* Line 1126 of yacc.c. */ -#line 6588 "UpgradeParser.tab.c" +#line 6589 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6852,7 +6853,7 @@ } -#line 3870 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 3871 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.54 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.55 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.54 Mon Apr 9 01:16:21 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Wed Apr 11 07:10:58 2007 @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1741 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y" +#line 1742 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.73 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.74 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.73 Tue Apr 10 21:44:20 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Wed Apr 11 07:10:58 2007 @@ -774,7 +774,8 @@ D = ValID::create((int)CurModule.Types.size()); D.S.copy(Sign); - CurModule.NamedTypeSigns[Name] = Sign; + if (Name) + CurModule.NamedTypeSigns[Name] = Sign; std::map::iterator I = CurModule.LateResolveTypes.find(D); From reid at x10sys.com Wed Apr 11 07:29:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:29:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200704111229.l3BCTD7a018093@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.44 -> 1.45 --- Log message: Fix several bugs relating to changes in the LLVM IR API or just outright typos in the output. This is sufficient to get most of the llvm2cpp tests working again. --- Diffs of the changes: (+27 -32) CppWriter.cpp | 59 ++++++++++++++++++++++++++-------------------------------- 1 files changed, 27 insertions(+), 32 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.44 llvm/tools/llvm2cpp/CppWriter.cpp:1.45 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.44 Wed Apr 11 05:01:32 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 07:28:56 2007 @@ -467,7 +467,7 @@ for (unsigned i = 0; i < PAL->size(); ++i) { uint16_t index = PAL->getParamIndex(i); uint16_t attrs = PAL->getParamAttrs(index); - Out << typeName << "_PAL->addAttribute(" << index << ", 0"; + Out << typeName << "_PAL->addAttributes(" << index << ", 0"; if (attrs & ParamAttr::SExt) Out << " | ParamAttr::SExt"; if (attrs & ParamAttr::ZExt) @@ -492,7 +492,7 @@ Out << "_fwd"; Out << ","; nl(Out) << "/*Params=*/" << typeName << "_args,"; - nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") ; + nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true," : "false,") ; nl(Out) << "/*ParamAttrs=*/" << typeName << "_PAL" << ");"; out(); nl(Out); @@ -563,10 +563,11 @@ // If the type had a name, make sure we recreate it. const std::string* progTypeName = findTypeName(TheModule->getTypeSymbolTable(),Ty); - if (progTypeName) + if (progTypeName) { Out << "mod->addTypeName(\"" << *progTypeName << "\", " << typeName << ");"; nl(Out); + } // Pop us off the type stack TypeStack.pop_back(); @@ -693,7 +694,7 @@ } if (const ConstantInt *CI = dyn_cast(CV)) { Out << "ConstantInt* " << constName << " = ConstantInt::get(" - << "APInt(cast(" << typeName << ")->getBitWidth()," + << "APInt(cast(" << typeName << ")->getBitWidth()," << " \"" << CI->getValue().toStringSigned(10) << "\", 10));"; } else if (isa(CV)) { Out << "ConstantAggregateZero* " << constName @@ -769,7 +770,8 @@ Out << "Constant* " << constName << " = ConstantExpr::getGetElementPtr(" << getCppName(CE->getOperand(0)) << ", " - << constName << "_indices);"; + << "&" << constName << "_indices[0], " << CE->getNumOperands() - 1 + << " );"; } else if (CE->isCast()) { printConstant(CE->getOperand(0)); Out << "Constant* " << constName << " = ConstantExpr::getCast("; @@ -1016,13 +1018,13 @@ switch (I->getOpcode()) { case Instruction::Ret: { const ReturnInst* ret = cast(I); - Out << "ReturnInst* " << iName << " = new ReturnInst(" + Out << "new ReturnInst(" << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");"; break; } case Instruction::Br: { const BranchInst* br = cast(I); - Out << "BranchInst* " << iName << " = new BranchInst(" ; + Out << "new BranchInst(" ; if (br->getNumOperands() == 3 ) { Out << opNames[0] << ", " << opNames[1] << ", " @@ -1060,11 +1062,12 @@ << opNames[i] << ");"; nl(Out); } - Out << "InvokeInst* " << iName << " = new InvokeInst(" + Out << "InvokeInst *" << iName << " = new InvokeInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", " - << iName << "_params, \""; + << "&" << iName << "_params[0], " << inv->getNumOperands() - 3 + << ", \""; printEscapedString(inv->getName()); Out << "\", " << bbname << ");"; nl(Out) << iName << "->setCallingConv("; @@ -1073,12 +1076,12 @@ break; } case Instruction::Unwind: { - Out << "UnwindInst* " << iName << " = new UnwindInst(" + Out << "new UnwindInst(" << bbname << ");"; break; } case Instruction::Unreachable:{ - Out << "UnreachableInst* " << iName << " = new UnreachableInst(" + Out << "new UnreachableInst(" << bbname << ");"; break; } @@ -1234,7 +1237,8 @@ nl(Out); } Out << "Instruction* " << iName << " = new GetElementPtrInst(" - << opNames[0] << ", " << iName << "_indices"; + << opNames[0] << ", &" << iName << "_indices[0], " + << gep->getNumOperands() - 1; } Out << ", \""; printEscapedString(gep->getName()); @@ -1283,7 +1287,7 @@ case Instruction::FPToSI: Out << "FPToSIInst"; break; case Instruction::UIToFP: Out << "UIToFPInst"; break; case Instruction::SIToFP: Out << "SIToFPInst"; break; - case Instruction::PtrToInt: Out << "PtrToInst"; break; + case Instruction::PtrToInt: Out << "PtrToIntInst"; break; case Instruction::IntToPtr: Out << "IntToPtrInst"; break; case Instruction::BitCast: Out << "BitCastInst"; break; default: assert(!"Unreachable"); break; @@ -1312,7 +1316,8 @@ nl(Out); } Out << "CallInst* " << iName << " = new CallInst(" - << opNames[0] << ", " << iName << "_params, \""; + << opNames[0] << ", &" << iName << "_params[0], " + << call->getNumOperands() - 1 << ", \""; } else if (call->getNumOperands() == 3) { Out << "CallInst* " << iName << " = new CallInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; @@ -1664,6 +1669,7 @@ Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; + Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; Out << "#include \n"; @@ -1679,7 +1685,7 @@ Out << " std::cerr.flush();\n"; Out << " std::cout.flush();\n"; Out << " PassManager PM;\n"; - Out << " PM.add(new PrintModulePass(&std::cout));\n"; + Out << " PM.add(new PrintModulePass(&llvm::cout));\n"; Out << " PM.run(*Mod);\n"; Out << " return 0;\n"; Out << "}\n\n"; @@ -1693,31 +1699,20 @@ nl(Out) << "Module* " << fname << "() {"; nl(Out,1) << "// Module Construction"; nl(Out) << "Module* mod = new Module(\"" << mName << "\");"; - nl(Out) << "mod->setEndianness("; - switch (TheModule->getEndianness()) { - case Module::LittleEndian: Out << "Module::LittleEndian);"; break; - case Module::BigEndian: Out << "Module::BigEndian);"; break; - case Module::AnyEndianness:Out << "Module::AnyEndianness);"; break; - } - nl(Out) << "mod->setPointerSize("; - switch (TheModule->getPointerSize()) { - case Module::Pointer32: Out << "Module::Pointer32);"; break; - case Module::Pointer64: Out << "Module::Pointer64);"; break; - case Module::AnyPointerSize: Out << "Module::AnyPointerSize);"; break; + if (!TheModule->getTargetTriple().empty()) { + nl(Out) << "mod->setDataLayout(\"" << TheModule->getDataLayout() << "\");"; } - nl(Out); if (!TheModule->getTargetTriple().empty()) { - Out << "mod->setTargetTriple(\"" << TheModule->getTargetTriple() - << "\");"; - nl(Out); + nl(Out) << "mod->setTargetTriple(\"" << TheModule->getTargetTriple() + << "\");"; } if (!TheModule->getModuleInlineAsm().empty()) { - Out << "mod->setModuleInlineAsm(\""; + nl(Out) << "mod->setModuleInlineAsm(\""; printEscapedString(TheModule->getModuleInlineAsm()); Out << "\");"; - nl(Out); } + nl(Out); // Loop over the dependent libraries and emit them. Module::lib_iterator LI = TheModule->lib_begin(); From reid at x10sys.com Wed Apr 11 07:42:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:42:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200704111242.l3BCg6OJ018329@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.45 -> 1.46 --- Log message: Teach llvm2cpp about packed structure types. --- Diffs of the changes: (+2 -1) CppWriter.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.45 llvm/tools/llvm2cpp/CppWriter.cpp:1.46 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.45 Wed Apr 11 07:28:56 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 07:41:49 2007 @@ -515,7 +515,8 @@ nl(Out); } Out << "StructType* " << typeName << " = StructType::get(" - << typeName << "_fields);"; + << typeName << "_fields, /*isPacked=*/" + << (ST->isPacked() ? "true" : "false") << ");"; nl(Out); break; } From reid at x10sys.com Wed Apr 11 07:46:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 07:46:24 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/packed_cmp.ll Message-ID: <200704111246.l3BCkOF3018407@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: packed_cmp.ll updated: 1.3 -> 1.4 --- Log message: Make sure this test uses llvm-upgrade. Don't allow false positives. --- Diffs of the changes: (+2 -1) packed_cmp.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Feature/packed_cmp.ll diff -u llvm/test/Feature/packed_cmp.ll:1.3 llvm/test/Feature/packed_cmp.ll:1.4 --- llvm/test/Feature/packed_cmp.ll:1.3 Tue Mar 27 21:38:26 2007 +++ llvm/test/Feature/packed_cmp.ll Wed Apr 11 07:46:06 2007 @@ -1,6 +1,7 @@ ; This test checks to make sure that NE and EQ comparisons of ; vector types work. -; RUN: llvm-as < %s | llvm-dis > %t1.ll +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > /dev/null -f && +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; XFAIL: * From reid at x10sys.com Wed Apr 11 08:00:21 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 08:00:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200704111300.l3BD0LWR018615@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.75 -> 1.76 --- Log message: Fix an approximate calculation in an assertion not to give false negatives. --- Diffs of the changes: (+1 -1) APInt.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.75 llvm/lib/Support/APInt.cpp:1.76 --- llvm/lib/Support/APInt.cpp:1.75 Tue Mar 20 23:34:37 2007 +++ llvm/lib/Support/APInt.cpp Wed Apr 11 08:00:04 2007 @@ -1726,7 +1726,7 @@ assert(slen <= numbits || radix != 2 && "Insufficient bit width"); assert(slen*3 <= numbits || radix != 8 && "Insufficient bit width"); assert(slen*4 <= numbits || radix != 16 && "Insufficient bit width"); - assert((slen*64)/20 <= numbits || radix != 10 && "Insufficient bit width"); + assert((slen*64)/22 <= numbits || radix != 10 && "Insufficient bit width"); // Allocate memory if (!isSingleWord()) From reid at x10sys.com Wed Apr 11 08:03:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 08:03:13 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200704111303.l3BD3DCr018673@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.46 -> 1.47 --- Log message: Make the generated code for ConstantInt nicer. --- Diffs of the changes: (+2 -2) CppWriter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.46 llvm/tools/llvm2cpp/CppWriter.cpp:1.47 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.46 Wed Apr 11 07:41:49 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Apr 11 08:02:56 2007 @@ -694,8 +694,8 @@ return; } if (const ConstantInt *CI = dyn_cast(CV)) { - Out << "ConstantInt* " << constName << " = ConstantInt::get(" - << "APInt(cast(" << typeName << ")->getBitWidth()," + Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt(" + << cast(CI->getType())->getBitWidth() << ", " << " \"" << CI->getValue().toStringSigned(10) << "\", 10));"; } else if (isa(CV)) { Out << "ConstantAggregateZero* " << constName From reid at x10sys.com Wed Apr 11 08:05:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 08:05:05 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200704111305.l3BD55uo018712@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.83 -> 1.84 --- Log message: Fix a bug where ICmpInst objects instantiated directly with a name would not retain that name. Not noticed because AsmParser always sets name after construction. However, llvm2cpp noticed. --- Diffs of the changes: (+2 -2) Instructions.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.83 llvm/lib/VMCore/Instructions.cpp:1.84 --- llvm/lib/VMCore/Instructions.cpp:1.83 Mon Apr 9 13:00:57 2007 +++ llvm/lib/VMCore/Instructions.cpp Wed Apr 11 08:04:48 2007 @@ -2070,6 +2070,7 @@ Ops[0].init(LHS, this); Ops[1].init(RHS, this); SubclassData = predicate; + setName(Name); if (op == Instruction::ICmp) { assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && predicate <= ICmpInst::LAST_ICMP_PREDICATE && @@ -2093,7 +2094,6 @@ // Check that the operands are the right type assert(Op0Ty->isFloatingPoint() && "Invalid operand types for FCmp instruction"); - setName(Name); } CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS, @@ -2102,6 +2102,7 @@ Ops[0].init(LHS, this); Ops[1].init(RHS, this); SubclassData = predicate; + setName(Name); if (op == Instruction::ICmp) { assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE && predicate <= ICmpInst::LAST_ICMP_PREDICATE && @@ -2126,7 +2127,6 @@ // Check that the operands are the right type assert(Op0Ty->isFloatingPoint() && "Invalid operand types for FCmp instruction"); - setName(Name); } CmpInst * From sabre at nondot.org Wed Apr 11 10:24:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 10:24:21 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/ispositive.ll Message-ID: <200704111524.l3BFOLCH021345@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: ispositive.ll updated: 1.1 -> 1.2 --- Log message: change test name. --- Diffs of the changes: (+1 -1) ispositive.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Generic/ispositive.ll diff -u llvm/test/CodeGen/Generic/ispositive.ll:1.1 llvm/test/CodeGen/Generic/ispositive.ll:1.2 --- llvm/test/CodeGen/Generic/ispositive.ll:1.1 Wed Apr 11 00:32:13 2007 +++ llvm/test/CodeGen/Generic/ispositive.ll Wed Apr 11 10:24:04 2007 @@ -3,7 +3,7 @@ ; RUN: llvm-as < %s | llc -march=arm | grep 'mov r0, r0, lsr #31' && ; RUN: llvm-as < %s | llc -march=thumb | grep 'lsr r0, r0, #31' -define i32 @isnegative(i32 %X) { +define i32 @test1(i32 %X) { entry: icmp slt i32 %X, 0 ; :0 [#uses=1] zext i1 %0 to i32 ; :1 [#uses=1] From clattner at apple.com Wed Apr 11 10:25:35 2007 From: clattner at apple.com (Chris Lattner) Date: Wed, 11 Apr 2007 08:25:35 -0700 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp In-Reply-To: <200704111305.l3BD55uo018712@zion.cs.uiuc.edu> References: <200704111305.l3BD55uo018712@zion.cs.uiuc.edu> Message-ID: <790315AB-9F39-4D86-8F25-412DF8514823@apple.com> On Apr 11, 2007, at 6:05 AM, Reid Spencer wrote: > Instructions.cpp updated: 1.83 -> 1.84 > --- > Log message: > > Fix a bug where ICmpInst objects instantiated directly with a name > would > not retain that name. Not noticed because AsmParser always sets > name after > construction. However, llvm2cpp noticed. > Nice, I was wondering why so many compares were missing names :) -Chris From sabre at nondot.org Wed Apr 11 10:35:36 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 10:35:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200704111535.l3BFZanO021608@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.85 -> 1.86 --- Log message: Fix PR1318: http://llvm.org/PR1318 by reacting appropriately to a mutating option list. --- Diffs of the changes: (+14 -0) CommandLine.cpp | 14 ++++++++++++++ 1 files changed, 14 insertions(+) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.85 llvm/lib/Support/CommandLine.cpp:1.86 --- llvm/lib/Support/CommandLine.cpp:1.85 Sat Apr 7 00:38:53 2007 +++ llvm/lib/Support/CommandLine.cpp Wed Apr 11 10:35:18 2007 @@ -394,6 +394,10 @@ // the positional args into the PositionalVals list... Option *ActivePositionalArg = 0; + // Keep track of the option list so far so that we can tell if it is ever + // extended. + Option *CurOptionList = RegisteredOptionList; + // Loop over all of the arguments... processing them. bool DashDashFound = false; // Have we read '--'? for (int i = 1; i < argc; ++i) { @@ -401,6 +405,16 @@ const char *Value = 0; const char *ArgName = ""; + // If the head of the option list changed, this means that some command line + // option has just been registered or deregistered. This can occur in + // response to things like -load, etc. If this happens, rescan the options. + if (CurOptionList != RegisteredOptionList) { + PositionalOpts.clear(); + Opts.clear(); + GetOptionInfo(PositionalOpts, Opts); + CurOptionList = RegisteredOptionList; + } + // Check to see if this is a positional argument. This argument is // considered to be positional if it doesn't start with '-', if it is "-" // itself, or if we have seen "--" already. From sabre at nondot.org Wed Apr 11 10:45:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 10:45:43 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <200704111545.l3BFjhkB021858@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ScalarReplAggregates.cpp updated: 1.83 -> 1.84 --- Log message: Fix Transforms/ScalarRepl/union-pointer.ll --- Diffs of the changes: (+7 -6) ScalarReplAggregates.cpp | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.83 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.84 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.83 Tue Apr 10 22:27:24 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Apr 11 10:45:25 2007 @@ -1002,6 +1002,11 @@ ConstantInt::get(Type::Int32Ty, Elt), "tmp", SI); } + } else if (isa(AllocaType)) { + // If the alloca type is a pointer, then all the elements must be + // pointers. + if (SV->getType() != AllocaType) + SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); } else { Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI); @@ -1013,12 +1018,8 @@ if (SV->getType()->isFloatingPoint()) SV = new BitCastInst(SV, IntegerType::get(SrcWidth), SV->getName(), SI); - else if (isa(SV->getType())) { - if (isa(AllocaType)) - SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); - else - SV = new PtrToIntInst(SV, TD.getIntPtrType(), SV->getName(), SI); - } + else if (isa(SV->getType())) + SV = new PtrToIntInst(SV, TD.getIntPtrType(), SV->getName(), SI); // Always zero extend the value if needed. if (SV->getType() != AllocaType) From sabre at nondot.org Wed Apr 11 11:04:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 11:04:21 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll Message-ID: <200704111604.l3BG4Lop022339@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: 2006-12-08-Phi-ICmp-Op-Fold.ll updated: 1.2 -> 1.3 --- Log message: adjust test --- Diffs of the changes: (+1 -1) 2006-12-08-Phi-ICmp-Op-Fold.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll diff -u llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.2 llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.2 Sat Dec 23 00:05:41 2006 +++ llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll Wed Apr 11 11:04:04 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis|grep 'icmp slt' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis|grep 'icmp sgt' ; ModuleID = 'visible.bc' target datalayout = "e-p:32:32" target endian = little From sabre at nondot.org Wed Apr 11 11:11:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 11:11:06 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/long-setcc.ll Message-ID: <200704111611.l3BGB6Su022507@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: long-setcc.ll updated: 1.1 -> 1.2 --- Log message: this got better --- Diffs of the changes: (+2 -1) long-setcc.ll | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/X86/long-setcc.ll diff -u llvm/test/CodeGen/X86/long-setcc.ll:1.1 llvm/test/CodeGen/X86/long-setcc.ll:1.2 --- llvm/test/CodeGen/X86/long-setcc.ll:1.1 Thu Feb 8 16:25:37 2007 +++ llvm/test/CodeGen/X86/long-setcc.ll Wed Apr 11 11:10:48 2007 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=x86 | grep shr | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -march=x86 | grep xor | wc -l | grep 1 define i1 @t1(i64 %x) { From sabre at nondot.org Wed Apr 11 11:12:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 11:12:44 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/long-setcc.ll Message-ID: <200704111612.l3BGCiP0022562@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: long-setcc.ll updated: 1.2 -> 1.3 --- Log message: this got better --- Diffs of the changes: (+2 -2) long-setcc.ll | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/ARM/long-setcc.ll diff -u llvm/test/CodeGen/ARM/long-setcc.ll:1.2 llvm/test/CodeGen/ARM/long-setcc.ll:1.3 --- llvm/test/CodeGen/ARM/long-setcc.ll:1.2 Thu Feb 22 21:15:39 2007 +++ llvm/test/CodeGen/ARM/long-setcc.ll Wed Apr 11 11:12:27 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=arm | grep cmp | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -march=thumb && -; RUN: llvm-as < %s | llc -march=thumb | grep cmp | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=thumb | grep cmp | wc -l | grep 1 define i1 @t1(i64 %x) { From sabre at nondot.org Wed Apr 11 11:17:30 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 11:17:30 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200704111617.l3BGHUwo022691@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.42 -> 1.43 --- Log message: Fix incorrect fall-throughs in addr mode code. This fixes CodeGen/ARM/arm-negative-stride.ll --- Diffs of the changes: (+3 -3) ARMISelLowering.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.42 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.43 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.42 Mon Apr 9 22:48:29 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Wed Apr 11 11:17:12 2007 @@ -1386,13 +1386,13 @@ if (Scale == 1) return true; // r + r << imm - if (!isPowerOf2_32(Scale & ~1)) - return false; + return isPowerOf2_32(Scale & ~1); case MVT::i16: // r + r if (((unsigned)AM.HasBaseReg + Scale) <= 2) return true; - + return false; + case MVT::isVoid: // Note, we allow "void" uses (basically, uses that aren't loads or // stores), because arm allows folding a scale into many arithmetic From sabre at nondot.org Wed Apr 11 11:52:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 11:52:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Message-ID: <200704111652.l3BGqB5R023496@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.289 -> 1.290 --- Log message: fix an infinite loop compiling ldecod, notice by JeffC. --- Diffs of the changes: (+1 -1) DAGCombiner.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.289 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.290 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.289 Wed Apr 11 01:50:51 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Apr 11 11:51:53 2007 @@ -2320,7 +2320,7 @@ SDOperand SCC = SimplifySelectCC(N0.getOperand(0), N0.getOperand(1), DAG.getConstant(1, VT), DAG.getConstant(0, VT), - cast(N0.getOperand(2))->get()); + cast(N0.getOperand(2))->get(), true); if (SCC.Val) return SCC; } From dpatel at apple.com Wed Apr 11 12:17:12 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 11 Apr 2007 10:17:12 -0700 (PDT) Subject: [llvm-commits] [125983] No need to map llvm values with GCC trees using names. Message-ID: <20070411171712.0F607E3FB493@src> Revision: 125983 Author: dpatel Date: 2007-04-11 10:17:11 -0700 (Wed, 11 Apr 2007) Log Message: ----------- No need to map llvm values with GCC trees using names. llvm.pch.values table can directly hold values. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 11:13:54 UTC (rev 125982) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:17:11 UTC (rev 125983) @@ -198,18 +198,10 @@ for (std::vector::iterator I = LLVMValues.begin(), E = LLVMValues.end(); I != E; ++I) { - Value *V = *I; - - if (!V) { - LLVMValuesNames.push_back(ConstantArray::get("", false)); - continue; - } - - // Give names to nameless values. - if (!V->hasName()) - V->setName("llvm.fe.val"); - - LLVMValuesNames.push_back(ConstantArray::get(V->getName(), false)); + if (Constant *C = dyn_cast(*I)) + LLVMValuesNames.push_back(C); + else + LLVMValuesNames.push_back(NULL); } // Create string table. From alenhar2 at cs.uiuc.edu Wed Apr 11 12:28:11 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 11 Apr 2007 12:28:11 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Heuristic.cpp PointerCompress.cpp PoolAllocate.cpp PoolOptimize.cpp TransformFunctionBody.cpp Message-ID: <200704111728.l3BHSBOb024631@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: AccessTrace.cpp updated: 1.9 -> 1.10 Heuristic.cpp updated: 1.17 -> 1.18 PointerCompress.cpp updated: 1.76 -> 1.77 PoolAllocate.cpp updated: 1.133 -> 1.134 PoolOptimize.cpp updated: 1.11 -> 1.12 TransformFunctionBody.cpp updated: 1.61 -> 1.62 --- Log message: unbitrot this, it might even still work, who knows --- Diffs of the changes: (+68 -99) AccessTrace.cpp | 6 ++-- Heuristic.cpp | 4 +- PointerCompress.cpp | 64 ++++++++++++++++------------------------------ PoolAllocate.cpp | 29 ++++++++++---------- PoolOptimize.cpp | 29 +++++++------------- TransformFunctionBody.cpp | 35 +++++++++++-------------- 6 files changed, 68 insertions(+), 99 deletions(-) Index: llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp diff -u llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.9 llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.10 --- llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp:1.9 Wed Jan 10 14:44:31 2007 +++ llvm-poolalloc/lib/PoolAllocate/AccessTrace.cpp Wed Apr 11 12:27:53 2007 @@ -100,14 +100,14 @@ // Create the function prototypes for runtime library. InitializeLibraryFunctions(M); - Function *MainFunc = M.getMainFunction(); - if (MainFunc && !MainFunc->isExternal()) + Function *MainFunc = M.getFunction("main"); + if (MainFunc && !MainFunc->isDeclaration()) // Insert a call to the library init function into the beginning of main. new CallInst(AccessTraceInitFn, "", MainFunc->begin()->begin()); // Look at all of the loads in the program. for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { - if (F->isExternal()) continue; + if (F->isDeclaration()) continue; PA::FuncInfo *FI = PoolAlloc->getFuncInfoOrClone(*F); assert(FI && "DIDN'T FIND POOL INFO!"); Index: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp diff -u llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.17 llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.18 --- llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.17 Wed Jan 10 14:44:31 2007 +++ llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp Wed Apr 11 12:27:53 2007 @@ -74,7 +74,7 @@ // If we are on a 64-bit system, we want to align 8-byte integers and // pointers. - if (TD.getTypeAlignment(Ty) == 8) + if (TD.getPrefTypeAlignment(Ty) == 8) return true; } @@ -85,7 +85,7 @@ const StructLayout *SL = TD.getStructLayout(STy); for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) { if (Wants8ByteAlignment(STy->getElementType(i), - Offs+SL->MemberOffsets[i], TD)) + Offs+SL->getElementOffset(i), TD)) return true; } } else if (const SequentialType *STy = dyn_cast(Ty)) { Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.76 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.77 --- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.76 Wed Jan 10 14:44:31 2007 +++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Wed Apr 11 12:27:53 2007 @@ -263,7 +263,7 @@ for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) Elements.push_back(ComputeCompressedType(STy->getElementType(i), - NodeOffset+SL->MemberOffsets[i], + NodeOffset+SL->getElementOffset(i), Nodes)); return StructType::get(Elements); } else if (const ArrayType *ATy = dyn_cast(OrigTy)) { @@ -707,7 +707,7 @@ uint64_t Field = (unsigned)cast(Idx)->getZExtValue(); if (Field) { uint64_t FieldOffs = TD.getStructLayout(cast(NTy)) - ->MemberOffsets[Field]; + ->getElementOffset(Field); Constant *FieldOffsCst = ConstantInt::get(SCALARUINTTYPE, FieldOffs); Val = BinaryOperator::createAdd(Val, FieldOffsCst, GEPI.getName(), &GEPI); @@ -765,10 +765,9 @@ Value *BasePtr = SrcPI->EmitPoolBaseLoad(LI); // Get the pointer to load from. - std::vector Ops; - Ops.push_back(getTransformedValue(LI.getOperand(0))); - if (Ops[0]->getType() == Type::Int16Ty) - Ops[0] = CastInst::createZExtOrBitCast(Ops[0], Type::Int32Ty, "extend_idx", &LI); + Value* Ops = getTransformedValue(LI.getOperand(0)); + if (Ops->getType() == Type::Int16Ty) + Ops = CastInst::createZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &LI); Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, LI.getOperand(0)->getName()+".pp", &LI); const Type *DestTy = LoadingCompressedPtr ? MEMUINTTYPE : LI.getType(); @@ -831,10 +830,9 @@ Value *BasePtr = DestPI->EmitPoolBaseLoad(SI); // Get the pointer to store to. - std::vector Ops; - Ops.push_back(getTransformedValue(SI.getOperand(1))); - if (Ops[0]->getType() == Type::Int16Ty) - Ops[0] = CastInst::createZExtOrBitCast(Ops[0], Type::Int32Ty, "extend_idx", &SI); + Value* Ops = getTransformedValue(SI.getOperand(1)); + if (Ops->getType() == Type::Int16Ty) + Ops = CastInst::createZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &SI); Value *DestPtr = new GetElementPtrInst(BasePtr, Ops, SI.getOperand(1)->getName()+".pp", @@ -866,7 +864,7 @@ Ops.push_back(ConstantInt::get(Type::Int32Ty, PA::Heuristic::getRecommendedAlignment(PI->getNewType(), TD))); // TODO: Compression could reduce the alignment restriction for the pool! - Value *PB = new CallInst(PtrComp.PoolInitPC, Ops, "", &CI); + Value *PB = new CallInst(PtrComp.PoolInitPC, &Ops[0], Ops.size(), "", &CI); if (!DisablePoolBaseASR) { // Load the pool base immediately. PB->setName(CI.getOperand(1)->getName()+".poolbase"); @@ -883,9 +881,7 @@ const CompressedPoolInfo *PI = getPoolInfoForPoolDesc(CI.getOperand(1)); if (PI == 0) return; // Pool isn't compressed. - std::vector Ops; - Ops.push_back(CI.getOperand(1)); - new CallInst(PtrComp.PoolDestroyPC, Ops, "", &CI); + new CallInst(PtrComp.PoolDestroyPC, CI.getOperand(1), "", &CI); CI.eraseFromParent(); } @@ -893,9 +889,6 @@ const CompressedPoolInfo *PI = getPoolInfo(&CI); if (PI == 0) return; // Pool isn't compressed. - std::vector Ops; - Ops.push_back(CI.getOperand(1)); // PD - Value *Size = CI.getOperand(2); // If there was a recommended size, shrink it down now. @@ -913,8 +906,7 @@ Size = BinaryOperator::createMul(Size, NewSize, "newbytes", &CI); } - Ops.push_back(Size); - Value *NC = new CallInst(PtrComp.PoolAllocPC, Ops, CI.getName(), &CI); + Value *NC = new CallInst(PtrComp.PoolAllocPC, CI.getOperand(1), Size, CI.getName(), &CI); setTransformedValue(CI, NC); } @@ -953,7 +945,7 @@ // Indirect call: you CAN'T passed compress pointers in. Don't even think // about it. return; - } else if (Callee->isExternal()) { + } else if (Callee->isDeclaration()) { // We don't have a DSG for the callee in this case. Assume that things will // work out if we pass compressed pointers. std::vector Operands; @@ -969,10 +961,8 @@ return; } else if (Callee->getName() == "read") { if (const CompressedPoolInfo *DestPI = getPoolInfo(CI.getOperand(2))) { - std::vector Ops; - Ops.push_back(getTransformedValue(CI.getOperand(2))); Value *BasePtr = DestPI->EmitPoolBaseLoad(CI); - Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, + Value *SrcPtr = new GetElementPtrInst(BasePtr, getTransformedValue(CI.getOperand(2)), CI.getOperand(2)->getName()+".pp", &CI); SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI); CI.setOperand(2, SrcPtr); @@ -980,10 +970,8 @@ } } else if (Callee->getName() == "fwrite") { if (const CompressedPoolInfo *DestPI = getPoolInfo(CI.getOperand(1))) { - std::vector Ops; - Ops.push_back(getTransformedValue(CI.getOperand(1))); Value *BasePtr = DestPI->EmitPoolBaseLoad(CI); - Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, + Value *SrcPtr = new GetElementPtrInst(BasePtr, getTransformedValue(CI.getOperand(1)), CI.getOperand(1)->getName()+".pp", &CI); SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI); CI.setOperand(1, SrcPtr); @@ -993,10 +981,8 @@ Callee->getName() == "llvm.memset.i32" || Callee->getName() == "llvm.memset.i64") { if (const CompressedPoolInfo *DestPI = getPoolInfo(CI.getOperand(1))) { - std::vector Ops; - Ops.push_back(getTransformedValue(CI.getOperand(1))); Value *BasePtr = DestPI->EmitPoolBaseLoad(CI); - Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, + Value *SrcPtr = new GetElementPtrInst(BasePtr, getTransformedValue(CI.getOperand(1)), CI.getOperand(1)->getName()+".pp", &CI); SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI); CI.setOperand(1, SrcPtr); @@ -1007,20 +993,16 @@ Callee->getName() == "llvm.memcpy.i64") { bool doret = false; if (const CompressedPoolInfo *DestPI = getPoolInfo(CI.getOperand(1))) { - std::vector Ops; - Ops.push_back(getTransformedValue(CI.getOperand(1))); Value *BasePtr = DestPI->EmitPoolBaseLoad(CI); - Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, + Value *SrcPtr = new GetElementPtrInst(BasePtr, getTransformedValue(CI.getOperand(1)), CI.getOperand(1)->getName()+".pp", &CI); SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI); CI.setOperand(1, SrcPtr); doret = true; } if (const CompressedPoolInfo *DestPI = getPoolInfo(CI.getOperand(2))) { - std::vector Ops; - Ops.push_back(getTransformedValue(CI.getOperand(2))); Value *BasePtr = DestPI->EmitPoolBaseLoad(CI); - Value *SrcPtr = new GetElementPtrInst(BasePtr, Ops, + Value *SrcPtr = new GetElementPtrInst(BasePtr, getTransformedValue(CI.getOperand(2)), CI.getOperand(2)->getName()+".pp", &CI); SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI); CI.setOperand(2, SrcPtr); @@ -1049,7 +1031,7 @@ } Function *Clone = PtrComp.GetExtFunctionClone(Callee, CompressedArgs); - Value *NC = new CallInst(Clone, Operands, CI.getName(), &CI); + Value *NC = new CallInst(Clone, &Operands[0], Operands.size(), CI.getName(), &CI); if (NC->getType() != CI.getType()) // Compressing return value? setTransformedValue(CI, NC); else { @@ -1126,7 +1108,7 @@ else Operands.push_back(CI.getOperand(i)); - Value *NC = new CallInst(Clone, Operands, CI.getName(), &CI); + Value *NC = new CallInst(Clone, &Operands[0], Operands.size(), CI.getName(), &CI); if (NC->getType() != CI.getType()) // Compressing return value? setTransformedValue(CI, NC); else { @@ -1245,7 +1227,7 @@ CompressPoolsInFunction(Function &F, std::vector > *PremappedVals, std::set *ExternalPoolsToCompress){ - if (F.isExternal()) return false; + if (F.isDeclaration()) return false; // If this is a pointer compressed clone of a pool allocated function, get the // the pool allocated function. Rewriting a clone means that there are @@ -1423,12 +1405,12 @@ std::cerr << " CLONING FUNCTION: " << F->getName() << " -> " << Clone->getName() << "\n"; - if (F->isExternal()) { + if (F->isDeclaration()) { Clone->setLinkage(GlobalValue::ExternalLinkage); return Clone; } - std::map ValueMap; + DenseMap ValueMap; // Create dummy Value*'s of pointer type for any arguments that are // compressed. These are needed to satisfy typing constraints before the @@ -1462,7 +1444,7 @@ // Invert the ValueMap into the NewToOldValueMap std::map &NewToOldValueMap = CFI.NewToOldValueMap; - for (std::map::iterator I = ValueMap.begin(), + for (DenseMap::iterator I = ValueMap.begin(), E = ValueMap.end(); I != E; ++I) NewToOldValueMap.insert(std::make_pair(I->second, I->first)); Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.133 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.134 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.133 Mon Jan 22 10:41:10 2007 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Wed Apr 11 12:27:53 2007 @@ -128,7 +128,7 @@ // Loop over the functions in the original program finding the pool desc. // arguments necessary for each function that is indirectly callable. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal() && ECGraphs->ContainsDSGraphFor(*I)) + if (!I->isDeclaration() && ECGraphs->ContainsDSGraphFor(*I)) FindFunctionPoolArgs(*I); std::map FuncMap; @@ -140,7 +140,7 @@ std::set ClonedFunctions; {TIME_REGION(X, "MakeFunctionClone"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal() && !ClonedFunctions.count(I) && + if (!I->isDeclaration() && !ClonedFunctions.count(I) && ECGraphs->ContainsDSGraphFor(*I)) if (Function *Clone = MakeFunctionClone(*I)) { FuncMap[I] = Clone; @@ -152,7 +152,7 @@ // clones. {TIME_REGION(X, "ProcessFunctionBody"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isExternal() && !ClonedFunctions.count(I) && + if (!I->isDeclaration() && !ClonedFunctions.count(I) && ECGraphs->ContainsDSGraphFor(*I)) { std::map::iterator FI = FuncMap.find(I); ProcessFunctionBody(*I, FI != FuncMap.end() ? *FI->second : *I); @@ -409,9 +409,9 @@ // Map the existing arguments of the old function to the corresponding // arguments of the new function, and copy over the names. #ifdef SAFECODE - std::map &ValueMap = FI.ValueMap; + DenseMap &ValueMap = FI.ValueMap; #else - std::map ValueMap; + DenseMap ValueMap; #endif for (Function::arg_iterator I = F.arg_begin(); NI != New->arg_end(); ++I, ++NI) { @@ -427,7 +427,7 @@ // Invert the ValueMap into the NewToOldValueMap std::map &NewToOldValueMap = FI.NewToOldValueMap; - for (std::map::iterator I = ValueMap.begin(), + for (DenseMap::iterator I = ValueMap.begin(), E = ValueMap.end(); I != E; ++I) NewToOldValueMap.insert(std::make_pair(I->second, I->first)); return FI.Clone = New; @@ -469,8 +469,8 @@ } // Otherwise get the main function to insert the poolinit calls. - Function *MainFunc = M.getMainFunction(); - if (MainFunc == 0 || MainFunc->isExternal()) { + Function *MainFunc = M.getFunction("main"); + if (MainFunc == 0 || MainFunc->isDeclaration()) { std::cerr << "Cannot pool allocate this program: it has global " << "pools but no 'main' function yet!\n"; return true; @@ -532,7 +532,7 @@ DSNode *GNode = ECGraphs->getGlobalsGraph().addObjectToGraph(GV); GNode->setModifiedMarker()->setReadMarker(); - Function *MainFunc = CurModule->getMainFunction(); + Function *MainFunc = CurModule->getFunction("main"); assert(MainFunc && "No main in program??"); BasicBlock::iterator InsertPt; @@ -545,8 +545,8 @@ Value *ElSize = ConstantInt::get(Type::Int32Ty, RecSize); Value *AlignV = ConstantInt::get(Type::Int32Ty, Align); - new CallInst(PoolInit, make_vector((Value*)GV, ElSize, AlignV, 0), - "", InsertPt); + Value* Opts[3] = {GV, ElSize, AlignV}; + new CallInst(PoolInit, &Opts[0], 3, "", InsertPt); ++NumPools; return GV; } @@ -886,8 +886,8 @@ Value *Align = ConstantInt::get(Type::Int32Ty, AlignV); for (unsigned i = 0, e = PoolInitPoints.size(); i != e; ++i) { - new CallInst(PoolInit, make_vector((Value*)PD, ElSize, Align, 0), - "", PoolInitPoints[i]); + Value* Opts[3] = {PD, ElSize, Align}; + new CallInst(PoolInit, &Opts[0], 3, "", PoolInitPoints[i]); DEBUG(std::cerr << PoolInitPoints[i]->getParent()->getName() << " "); } @@ -896,8 +896,7 @@ // Loop over all of the places to insert pooldestroy's... for (unsigned i = 0, e = PoolDestroyPoints.size(); i != e; ++i) { // Insert the pooldestroy call for this pool. - new CallInst(PoolDestroy, make_vector((Value*)PD, 0), "", - PoolDestroyPoints[i]); + new CallInst(PoolDestroy, PD, "", PoolDestroyPoints[i]); DEBUG(std::cerr << PoolDestroyPoints[i]->getParent()->getName()<<" "); } DEBUG(std::cerr << "\n\n"); Index: llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.11 llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.12 --- llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp:1.11 Wed Jan 10 14:44:32 2007 +++ llvm-poolalloc/lib/PoolAllocate/PoolOptimize.cpp Wed Apr 11 12:27:53 2007 @@ -18,6 +18,7 @@ #include "llvm/Module.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Debug.h" +#include using namespace llvm; namespace { @@ -108,27 +109,20 @@ CallInst *CI = Calls[i]; // poolrealloc(PD, null, X) -> poolalloc(PD, X) if (isa(CI->getOperand(2))) { - std::vector Ops; - Ops.push_back(CI->getOperand(1)); - Ops.push_back(CI->getOperand(3)); - Value *New = new CallInst(PoolAlloc, Ops, CI->getName(), CI); + Value *New = new CallInst(PoolAlloc, CI->getOperand(1), CI->getOperand(3), + CI->getName(), CI); CI->replaceAllUsesWith(New); CI->eraseFromParent(); } else if (isa(CI->getOperand(3)) && cast(CI->getOperand(3))->isNullValue()) { // poolrealloc(PD, X, 0) -> poolfree(PD, X) - std::vector Ops; - Ops.push_back(CI->getOperand(1)); - Ops.push_back(CI->getOperand(2)); - new CallInst(PoolFree, Ops, "", CI); + new CallInst(PoolFree, CI->getOperand(1), CI->getOperand(2), "", CI); CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); CI->eraseFromParent(); } else if (isa(CI->getOperand(1))) { // poolrealloc(null, X, Y) -> realloc(X, Y) - std::vector Ops; - Ops.push_back(CI->getOperand(2)); - Ops.push_back(CI->getOperand(3)); - Value *New = new CallInst(Realloc, Ops, CI->getName(), CI); + Value *New = new CallInst(Realloc, CI->getOperand(2), CI->getOperand(3), + CI->getName(), CI); CI->replaceAllUsesWith(New); CI->eraseFromParent(); } @@ -154,10 +148,7 @@ CallInst *CI = Calls[i]; // poolmemalign(null, X, Y) -> memalign(X, Y) if (isa(CI->getOperand(1))) { - std::vector Ops; - Ops.push_back(CI->getOperand(2)); - Ops.push_back(CI->getOperand(3)); - Value *New = new CallInst(MemAlign, Ops, CI->getName(), CI); + Value *New = new CallInst(MemAlign, CI->getOperand(2), CI->getOperand(3), CI->getName(), CI); CI->replaceAllUsesWith(New); CI->eraseFromParent(); } @@ -228,18 +219,18 @@ std::vector Args; if (CI->getCalledFunction() == PoolAlloc) { Args.assign(CI->op_begin()+1, CI->op_end()); - Value *New = new CallInst(PoolAllocBP, Args, CI->getName(), CI); + Value *New = new CallInst(PoolAllocBP, &Args[0], Args.size(), CI->getName(), CI); CI->replaceAllUsesWith(New); CI->eraseFromParent(); } else if (CI->getCalledFunction() == PoolInit) { Args.assign(CI->op_begin()+1, CI->op_end()); Args.erase(Args.begin()+1); // Drop the size argument. - new CallInst(PoolInitBP, Args, "", CI); + new CallInst(PoolInitBP, &Args[0], Args.size(), "", CI); CI->eraseFromParent(); } else { assert(CI->getCalledFunction() == PoolDestroy); Args.assign(CI->op_begin()+1, CI->op_end()); - new CallInst(PoolDestroyBP, Args, "", CI); + new CallInst(PoolDestroyBP, &Args[0], Args.size(), "", CI); CI->eraseFromParent(); } } Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.61 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.62 --- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.61 Wed Jan 10 14:44:32 2007 +++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Wed Apr 11 12:27:53 2007 @@ -155,8 +155,7 @@ // Insert a call to poolalloc Value *PH = getPoolHandle(I); - Instruction *V = new CallInst(PAInfo.PoolAlloc, make_vector(PH, Size, 0), - Name, I); + Instruction *V = new CallInst(PAInfo.PoolAlloc, PH, Size, Name, I); AddPoolUse(*V, PH, PoolUses); @@ -269,8 +268,7 @@ G.getScalarMap()[Casted] = G.getScalarMap()[Arg]; } - CallInst *FreeI = new CallInst(PAInfo.PoolFree, make_vector(PH, Casted, 0), - "", Where); + CallInst *FreeI = new CallInst(PAInfo.PoolFree, PH, Casted, "", Where); AddPoolUse(*FreeI, PH, PoolFrees); return FreeI; } @@ -329,9 +327,9 @@ BBI); // We know that the memory returned by poolalloc is at least 4 byte aligned. - new CallInst(MemSet, make_vector(Ptr, ConstantInt::get(Type::Int8Ty, 0), - V2, ConstantInt::get(Type::Int32Ty, 4), 0), - "", BBI); + Value* Opts[4] = {Ptr, ConstantInt::get(Type::Int8Ty, 0), + V2, ConstantInt::get(Type::Int32Ty, 4)}; + new CallInst(MemSet, Opts, 4, "", BBI); } @@ -350,9 +348,8 @@ OldPtr = CastInst::createPointerCast(OldPtr, VoidPtrTy, OldPtr->getName(), I); std::string Name = I->getName(); I->setName(""); - Instruction *V = new CallInst(PAInfo.PoolRealloc, make_vector(PH, OldPtr, - Size, 0), - Name, I); + Value* Opts[3] = {PH, OldPtr, Size}; + Instruction *V = new CallInst(PAInfo.PoolRealloc, Opts, 3, Name, I); Instruction *Casted = V; if (V->getType() != I->getType()) Casted = CastInst::createPointerCast(V, I->getType(), V->getName(), I); @@ -419,8 +416,8 @@ Size = CastInst::createZExtOrBitCast(Size, Type::Int32Ty, Size->getName(), I); std::string Name = I->getName(); I->setName(""); - Instruction *V = new CallInst(PAInfo.PoolMemAlign, - make_vector(PH, Align, Size, 0), Name, I); + Value* Opts[3] = {PH, Align, Size}; + Instruction *V = new CallInst(PAInfo.PoolMemAlign, Opts, 3, Name, I); Instruction *Casted = V; if (V->getType() != I->getType()) @@ -471,7 +468,7 @@ // If this function is one of the memory manipulating functions built into // libc, emulate it with pool calls as appropriate. - if (CF && CF->isExternal()) + if (CF && CF->isDeclaration()) if (CF->getName() == "calloc") { visitCallocCall(CS); return; @@ -581,7 +578,7 @@ EquivClassGraphs::callee_iterator I = ECGraphs.callee_begin(OrigInst), E = ECGraphs.callee_end(OrigInst); for (; I != E; ++I) - if (!I->second->isExternal()) + if (!I->second->isDeclaration()) assert(CalleeGraph == &ECGraphs.getDSGraph(*I->second) && "Callees at call site do not have a common graph!"); #endif @@ -655,9 +652,9 @@ ArgVal = new AllocaInst(ArrayType::get(VoidPtrTy, 16), 0, "PD", InsertPt); Value *ElSize = ConstantInt::get(Type::Int32Ty,0); Value *Align = ConstantInt::get(Type::Int32Ty,0); - new CallInst(PAInfo.PoolInit, make_vector(ArgVal, ElSize, Align, 0),"", TheCall); - new CallInst(PAInfo.PoolDestroy, make_vector(ArgVal, 0), "", - TheCall->getNext()); + Value* Opts[3] = {ArgVal, ElSize, Align}; + new CallInst(PAInfo.PoolInit, Opts, 3,"", TheCall); + new CallInst(PAInfo.PoolDestroy, ArgVal, "", TheCall->getNext()); } //probably need to update DSG // std::cerr << "WARNING: NULL POOL ARGUMENTS ARE PASSED IN!\n"; @@ -675,9 +672,9 @@ if (InvokeInst *II = dyn_cast(TheCall)) { NewCall = new InvokeInst(NewCallee, II->getNormalDest(), - II->getUnwindDest(), Args, Name, TheCall); + II->getUnwindDest(), &Args[0], Args.size(), Name, TheCall); } else { - NewCall = new CallInst(NewCallee, Args, Name, TheCall); + NewCall = new CallInst(NewCallee, &Args[0], Args.size(), Name, TheCall); } // Add all of the uses of the pool descriptor From dpatel at apple.com Wed Apr 11 12:29:14 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 11 Apr 2007 10:29:14 -0700 (PDT) Subject: [llvm-commits] [125984] Cosmetic changes. Message-ID: <20070411172914.A9AE5E3FE84E@src> Revision: 125984 Author: dpatel Date: 2007-04-11 10:29:14 -0700 (Wed, 11 Apr 2007) Log Message: ----------- Cosmetic changes. Rename fns/variales, add comment. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-internal.h Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-11 17:29:14 UTC (rev 125984) @@ -210,7 +210,7 @@ // Read LLVM Types string table readLLVMTypesStringTable(); - readLLVMValuesStringTable(); + readLLVMValues(); flag_llvm_pch_read = 1; } @@ -432,7 +432,7 @@ if (flag_pch_file) { writeLLVMTypesStringTable(); - writeLLVMValuesStringTable(); + writeLLVMValues(); } // Add an llvm.global_ctors global if needed. Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:29:14 UTC (rev 125984) @@ -157,17 +157,17 @@ } // Read LLVM Types string table -void readLLVMValuesStringTable() { +void readLLVMValues() { GlobalValue *V = TheModule->getNamedGlobal("llvm.pch.values"); if (!V) return; GlobalVariable *GV = cast(V); - ConstantStruct *LValueNames = cast(GV->getOperand(0)); + ConstantStruct *ValuesFromPCH = cast(GV->getOperand(0)); - for (unsigned i = 0; i < LValueNames->getNumOperands(); ++i) { - Value *Va = LValueNames->getOperand(i); + for (unsigned i = 0; i < ValuesFromPCH->getNumOperands(); ++i) { + Value *Va = ValuesFromPCH->getOperand(i); if (!Va) { // If V is empty then nsert NULL to represent empty entries. @@ -189,23 +189,25 @@ // GCC tree's uses LLVMValues vector's index to reach LLVM Values. // Create a string table to hold these LLVM Values' names. This string // table will be used to recreate LTypes vector after loading PCH. -void writeLLVMValuesStringTable() { +void writeLLVMValues() { if (LLVMValues.empty()) return; - std::vector LLVMValuesNames; + std::vector ValuesForPCH; for (std::vector::iterator I = LLVMValues.begin(), E = LLVMValues.end(); I != E; ++I) { if (Constant *C = dyn_cast(*I)) - LLVMValuesNames.push_back(C); + ValuesForPCH.push_back(C); else - LLVMValuesNames.push_back(NULL); + // Non constant values, e.g. arguments, are not at global scope. + // When PCH is read, only global scope values are used. + ValuesForPCH.push_back(NULL); } // Create string table. - Constant *LLVMValuesNameTable = ConstantStruct::get(LLVMValuesNames, false); + Constant *LLVMValuesNameTable = ConstantStruct::get(ValuesForPCH, false); // Create variable to hold this string table. new GlobalVariable(LLVMValuesNameTable->getType(), true, Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-11 17:17:11 UTC (rev 125983) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-11 17:29:14 UTC (rev 125984) @@ -90,8 +90,8 @@ void changeLLVMValue(Value *Old, Value *New); void readLLVMTypesStringTable(); void writeLLVMTypesStringTable(); -void readLLVMValuesStringTable(); -void writeLLVMValuesStringTable(); +void readLLVMValues(); +void writeLLVMValues(); void clearTargetBuiltinCache(); struct StructTypeConversionInfo; From alenhar2 at cs.uiuc.edu Wed Apr 11 12:38:04 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 11 Apr 2007 12:38:04 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/include/dsa/DSGraph.h DataStructure.h Message-ID: <200704111738.l3BHc41U024851@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/include/dsa: DSGraph.h updated: 1.113 -> 1.114 DataStructure.h updated: 1.99 -> 1.100 --- Log message: Minor refactoring, and cutting out stuff that should be (and is) in another branch --- Diffs of the changes: (+77 -184) DSGraph.h | 113 ++++++------------------------------------ DataStructure.h | 148 ++++++++++++++++++++++---------------------------------- 2 files changed, 77 insertions(+), 184 deletions(-) Index: llvm-poolalloc/include/dsa/DSGraph.h diff -u llvm-poolalloc/include/dsa/DSGraph.h:1.113 llvm-poolalloc/include/dsa/DSGraph.h:1.114 --- llvm-poolalloc/include/dsa/DSGraph.h:1.113 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/include/dsa/DSGraph.h Wed Apr 11 12:37:43 2007 @@ -18,14 +18,12 @@ #include "dsa/DSNode.h" #include "llvm/ADT/hash_map" #include "llvm/ADT/EquivalenceClasses.h" -#include "poolalloc/Config/config.h" #include #include #include namespace llvm { - //typedef map PoolDescriptorMapType; class GlobalValue; @@ -174,63 +172,6 @@ DSNodeHandle &AddGlobal(GlobalValue *GV); }; - -#ifdef LLVA_KERNEL -class MetaPool; -class MetaPoolHandle { - MetaPool *Rep; - Instruction * Creator; -public: - MetaPoolHandle(MetaPool *mp, Instruction * Maker = 0); - - MetaPool *getMetaPool() { - return Rep; - } - void setMetaPool(MetaPool *v) { - Rep = v; - } - ~MetaPoolHandle() { - //do nothing for now - } - const std::string &getName(); - Value *getMetaPoolValue(); - void merge(MetaPoolHandle *other); -}; - - class MetaPool { - Value *MPD; - hash_set HandleSet; - - public: - MetaPool(Value *mpd) : MPD(mpd) { - } - void addMetaPoolHandles(hash_set & mpHS) { - HandleSet.insert(mpHS.begin(), mpHS.end()); - } - hash_set& getHandleSet() { - return HandleSet; - } - Value * getMetaPoolValue() { - return MPD; - } - void setMetaPoolValue(Value *V) { - MPD = V; - } - void insert(MetaPoolHandle *mph) { - HandleSet.insert(mph); - } - const std::string& getName() { - return MPD->getName(); - } - ~MetaPool() { - HandleSet.clear(); - } - }; - -#endif - - - //===----------------------------------------------------------------------===// /// DSGraph - The graph that represents a function. /// @@ -280,21 +221,15 @@ /// constructed for. const TargetData &TD; -#ifdef LLVA_KERNEL - hash_map PoolDescriptors; -#endif - - - void operator=(const DSGraph &); // DO NOT IMPLEMENT DSGraph(const DSGraph&); // DO NOT IMPLEMENT public: // Create a new, empty, DSGraph. - DSGraph(EquivalenceClasses &ECs, const TargetData &td) - : GlobalsGraph(0), PrintAuxCalls(false), ScalarMap(ECs), TD(td) { } - // Compute the local DSGraph - DSGraph(EquivalenceClasses &ECs, const TargetData &TD, - Function &F, DSGraph *GlobalsGraph); + DSGraph(EquivalenceClasses &ECs, const TargetData &td, + DSGraph *GG = 0) + :GlobalsGraph(GG), PrintAuxCalls(false), + ScalarMap(ECs), TD(td) + { } // Copy ctor - If you want to capture the node mapping between the source and // destination graph, you may optionally do this by specifying a map to record @@ -311,31 +246,6 @@ DSGraph *getGlobalsGraph() const { return GlobalsGraph; } void setGlobalsGraph(DSGraph *G) { GlobalsGraph = G; } -#ifdef LLVA_KERNEL -#if 1 - hash_map& getPoolDescriptorsMap() { - return PoolDescriptors; - } - MetaPoolHandle *getPoolForNode(const DSNode *N) { - if (PoolDescriptors.count(N) > 0) { - return PoolDescriptors[N]; - } - return 0; - } -#else - hash_map& getPoolDescriptorsMap() { - return PoolDescriptors; - } - MetaPoolHandle *getPoolForNode(const DSNodeHandle *N) { - if (PoolDescriptors.count(N) > 0) { - return PoolDescriptors[N]; - } - return 0; - } -#endif - -#endif - /// getGlobalECs - Return the set of equivalence classes that the global /// variables in the program form. EquivalenceClasses &getGlobalECs() const { @@ -418,6 +328,15 @@ return I->second; } + bool hasNodeForValue(Value* V) const { + ScalarMapTy::const_iterator I = ScalarMap.find(V); + return I != ScalarMap.end(); + } + + void eraseNodeForValue(Value* V) { + ScalarMap.erase(V); + } + /// retnodes_* iterator methods: expose iteration over return nodes in the /// graph, which are also the set of functions incorporated in this graph. typedef ReturnNodesTy::const_iterator retnodes_iterator; @@ -445,6 +364,10 @@ return I->second; } + DSNodeHandle& getOrCreateReturnNodeFor(Function& F) { + return ReturnNodes[&F]; + } + /// containsFunction - Return true if this DSGraph contains information for /// the specified function. bool containsFunction(Function *F) const { Index: llvm-poolalloc/include/dsa/DataStructure.h diff -u llvm-poolalloc/include/dsa/DataStructure.h:1.99 llvm-poolalloc/include/dsa/DataStructure.h:1.100 --- llvm-poolalloc/include/dsa/DataStructure.h:1.99 Wed Dec 13 23:51:06 2006 +++ llvm-poolalloc/include/dsa/DataStructure.h Wed Apr 11 12:37:43 2007 @@ -20,7 +20,6 @@ #include "llvm/ADT/hash_map" #include "llvm/ADT/hash_set" #include "llvm/ADT/EquivalenceClasses.h" -#include "poolalloc/Config/config.h" namespace llvm { @@ -31,41 +30,53 @@ class DSCallSite; class DSNode; class DSNodeHandle; -typedef std::map PoolDescriptorMapType; FunctionPass *createDataStructureStatsPass(); FunctionPass *createDataStructureGraphCheckerPass(); -// FIXME: move this stuff to a private header -namespace DataStructureAnalysis { - /// isPointerType - Return true if this first class type is big enough to hold - /// a pointer. - /// - bool isPointerType(const Type *Ty); -} +class DataStructures : public ModulePass { -// LocalDataStructures - The analysis that computes the local data structure -// graphs for all of the functions in the program. -// -// FIXME: This should be a Function pass that can be USED by a Pass, and would -// be automatically preserved. Until we can do that, this is a Pass. -// -class LocalDataStructures : public ModulePass { + /// TargetData, comes in handy + TargetData* TD; + + /// Pass to get Graphs from + DataStructures* GraphSource; + + /// Do we clone Graphs or steal them? + bool Clone; + + void buildGlobalECs(std::set& ECGlobals); + + void eliminateUsesOfECGlobals(DSGraph& G, const std::set &ECGlobals); + +protected: // DSInfo, one graph for each function hash_map DSInfo; - DSGraph *GlobalsGraph; -#ifdef LLVA_KERNEL - Function *AddPoolDescToMetaPool; -#endif + /// The Globals Graph contains all information on the globals + DSGraph *GlobalsGraph; /// GlobalECs - The equivalence classes for each global value that is merged /// with other global values in the DSGraphs. EquivalenceClasses GlobalECs; -public: - ~LocalDataStructures() { releaseMemory(); } - virtual bool runOnModule(Module &M); + + void setGraphSource(DataStructures* D) { + assert(!GraphSource && "Already have a Graph"); + GraphSource = D; + } + + void setGraphClone(bool clone) { + Clone = clone; + } + + void setTargetData(TargetData& T) { + TD = &T; + } + + void formGlobalECs(); + +public: bool hasGraph(const Function &F) const { return DSInfo.find(const_cast(&F)) != DSInfo.end(); @@ -80,10 +91,33 @@ return *I->second; } + DSGraph& getOrCreateGraph(Function* F); + DSGraph &getGlobalsGraph() const { return *GlobalsGraph; } EquivalenceClasses &getGlobalECs() { return GlobalECs; } + TargetData& getTargetData() const { return *TD; } + + /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. + /// These correspond to the interfaces defined in the AliasAnalysis class. + void deleteValue(Value *V); + void copyValue(Value *From, Value *To); +}; + + +// LocalDataStructures - The analysis that computes the local data structure +// graphs for all of the functions in the program. +// +// FIXME: This should be a Function pass that can be USED by a Pass, and would +// be automatically preserved. Until we can do that, this is a Pass. +// +class LocalDataStructures : public DataStructures { +public: + ~LocalDataStructures() { releaseMemory(); } + + virtual bool runOnModule(Module &M); + /// print - Print out the analysis results... /// void print(std::ostream &O, const Module *M) const; @@ -106,53 +140,19 @@ /// data structure graphs for all of the functions in the program. This pass /// only performs a "Bottom Up" propagation (hence the name). /// -class BUDataStructures : public ModulePass { +class BUDataStructures : public DataStructures { protected: - // DSInfo, one graph for each function - hash_map DSInfo; - DSGraph *GlobalsGraph; std::set > ActualCallees; // This map is only maintained during construction of BU Graphs std::map, std::pair > > *IndCallGraphMap; - /// GlobalECs - The equivalence classes for each global value that is merged - /// with other global values in the DSGraphs. - EquivalenceClasses GlobalECs; - - std::map > AlreadyInlined; - public: ~BUDataStructures() { releaseMyMemory(); } virtual bool runOnModule(Module &M); - bool hasGraph(const Function &F) const { - return DSInfo.find(const_cast(&F)) != DSInfo.end(); - } - - /// getDSGraph - Return the data structure graph for the specified function. - /// - DSGraph &getDSGraph(const Function &F) const { - hash_map::const_iterator I = - DSInfo.find(const_cast(&F)); - if (I != DSInfo.end()) - return *I->second; - return const_cast(this)-> - CreateGraphForExternalFunction(F); - } - - /// DSGraphExists - Is the DSGraph computed for this function? - /// - bool doneDSGraph(const Function *F) const { - return (DSInfo.find(const_cast(F)) != DSInfo.end()); - } - - DSGraph &getGlobalsGraph() const { return *GlobalsGraph; } - - EquivalenceClasses &getGlobalECs() { return GlobalECs; } - DSGraph &CreateGraphForExternalFunction(const Function &F); /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. @@ -191,8 +191,6 @@ private: void calculateGraph(DSGraph &G); - DSGraph &getOrCreateGraph(Function *F); - unsigned calculateGraphs(Function *F, std::vector &Stack, unsigned &NextID, hash_map &ValMap); @@ -203,17 +201,10 @@ /// for each function using the closed graphs for the callers computed /// by the bottom-up pass. /// -class TDDataStructures : public ModulePass { - // DSInfo, one graph for each function - hash_map DSInfo; +class TDDataStructures : public DataStructures { hash_set ArgsRemainIncomplete; - DSGraph *GlobalsGraph; BUDataStructures *BUInfo; - /// GlobalECs - The equivalence classes for each global value that is merged - /// with other global values in the DSGraphs. - EquivalenceClasses GlobalECs; - /// CallerCallEdges - For a particular graph, we keep a list of these records /// which indicates which graphs call this function and from where. struct CallerCallEdge { @@ -245,10 +236,6 @@ virtual bool runOnModule(Module &M); - bool hasGraph(const Function &F) const { - return DSInfo.find(const_cast(&F)) != DSInfo.end(); - } - /// getDSGraph - Return the data structure graph for the specified function. /// DSGraph &getDSGraph(const Function &F) const { @@ -259,10 +246,6 @@ getOrCreateDSGraph(const_cast(F)); } - DSGraph &getGlobalsGraph() const { return *GlobalsGraph; } - EquivalenceClasses &getGlobalECs() { return GlobalECs; } - - /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. /// These correspond to the interfaces defined in the AliasAnalysis class. void deleteValue(Value *V); @@ -302,19 +285,6 @@ struct CompleteBUDataStructures : public BUDataStructures { virtual bool runOnModule(Module &M); - bool hasGraph(const Function &F) const { - return DSInfo.find(const_cast(&F)) != DSInfo.end(); - } - - /// getDSGraph - Return the data structure graph for the specified function. - /// - DSGraph &getDSGraph(const Function &F) const { - hash_map::const_iterator I = - DSInfo.find(const_cast(&F)); - assert(I != DSInfo.end() && "Function not in module!"); - return *I->second; - } - virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired(); From alenhar2 at cs.uiuc.edu Wed Apr 11 12:38:05 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 11 Apr 2007 12:38:05 -0500 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp DataStructure.cpp Local.cpp Steensgaard.cpp TopDownClosure.cpp Message-ID: <200704111738.l3BHc5m2024864@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: BottomUpClosure.cpp updated: 1.130 -> 1.131 DataStructure.cpp updated: 1.259 -> 1.260 Local.cpp updated: 1.168 -> 1.169 Steensgaard.cpp updated: 1.69 -> 1.70 TopDownClosure.cpp updated: 1.98 -> 1.99 --- Log message: Minor refactoring, and cutting out stuff that should be (and is) in another branch --- Diffs of the changes: (+396 -821) BottomUpClosure.cpp | 198 ------------ DataStructure.cpp | 219 ++++++++++++-- Local.cpp | 797 ++++++++++++---------------------------------------- Steensgaard.cpp | 1 TopDownClosure.cpp | 2 5 files changed, 396 insertions(+), 821 deletions(-) Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.130 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.131 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.130 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Wed Apr 11 12:37:43 2007 @@ -30,120 +30,8 @@ STATISTIC (NumBUInlines, "Number of graphs inlined"); STATISTIC (NumCallEdges, "Number of 'actual' call edges"); - cl::opt - AddGlobals("budatastructures-annotate-calls", cl::Hidden, - cl::desc("Annotate call sites with functions as they are resolved")); - cl::opt - UpdateGlobals("budatastructures-update-from-globals", cl::Hidden, - cl::desc("Update local graph from global graph when processing function")); - RegisterPass - X("budatastructure", "Bottom-up Data Structure Analysis"); -} - -static bool GetAllCalleesN(const DSCallSite &CS, - std::vector &Callees); - -/// BuildGlobalECs - Look at all of the nodes in the globals graph. If any node -/// contains multiple globals, DSA will never, ever, be able to tell the globals -/// apart. Instead of maintaining this information in all of the graphs -/// throughout the entire program, store only a single global (the "leader") in -/// the graphs, and build equivalence classes for the rest of the globals. -static void BuildGlobalECs(DSGraph &GG, std::set &ECGlobals) { - DSScalarMap &SM = GG.getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); - for (DSGraph::node_iterator I = GG.node_begin(), E = GG.node_end(); - I != E; ++I) { - if (I->getGlobalsList().size() <= 1) continue; - - // First, build up the equivalence set for this block of globals. - const std::vector &GVs = I->getGlobalsList(); - GlobalValue *First = GVs[0]; - for (unsigned i = 1, e = GVs.size(); i != e; ++i) - GlobalECs.unionSets(First, GVs[i]); - - // Next, get the leader element. - assert(First == GlobalECs.getLeaderValue(First) && - "First did not end up being the leader?"); - - // Next, remove all globals from the scalar map that are not the leader. - assert(GVs[0] == First && "First had to be at the front!"); - for (unsigned i = 1, e = GVs.size(); i != e; ++i) { - ECGlobals.insert(GVs[i]); - SM.erase(SM.find(GVs[i])); - } - - // Finally, change the global node to only contain the leader. - I->clearGlobals(); - I->addGlobal(First); - } - - DEBUG(GG.AssertGraphOK()); -} - -/// EliminateUsesOfECGlobals - Once we have determined that some globals are in -/// really just equivalent to some other globals, remove the globals from the -/// specified DSGraph (if present), and merge any nodes with their leader nodes. -static void EliminateUsesOfECGlobals(DSGraph &G, - const std::set &ECGlobals) { - DSScalarMap &SM = G.getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); - - bool MadeChange = false; - for (DSScalarMap::global_iterator GI = SM.global_begin(), E = SM.global_end(); - GI != E; ) { - GlobalValue *GV = *GI++; - if (!ECGlobals.count(GV)) continue; - - const DSNodeHandle &GVNH = SM[GV]; - assert(!GVNH.isNull() && "Global has null NH!?"); - - // Okay, this global is in some equivalence class. Start by finding the - // leader of the class. - GlobalValue *Leader = GlobalECs.getLeaderValue(GV); - - // If the leader isn't already in the graph, insert it into the node - // corresponding to GV. - if (!SM.global_count(Leader)) { - GVNH.getNode()->addGlobal(Leader); - SM[Leader] = GVNH; - } else { - // Otherwise, the leader is in the graph, make sure the nodes are the - // merged in the specified graph. - const DSNodeHandle &LNH = SM[Leader]; - if (LNH.getNode() != GVNH.getNode()) - LNH.mergeWith(GVNH); - } - - // Next step, remove the global from the DSNode. - GVNH.getNode()->removeGlobal(GV); - - // Finally, remove the global from the ScalarMap. - SM.erase(GV); - MadeChange = true; - } - - DEBUG(if(MadeChange) G.AssertGraphOK()); -} - -static void AddGlobalToNode(BUDataStructures* B, DSCallSite D, Function* F) { - if(!AddGlobals) - return; - if(D.isIndirectCall()) { - DSGraph* GI = &B->getDSGraph(D.getCaller()); - DSNodeHandle& NHF = GI->getNodeForValue(F); - DSCallSite DL = GI->getDSCallSiteForCallSite(D.getCallSite()); - if (DL.getCalleeNode() != NHF.getNode() || NHF.isNull()) { - if (NHF.isNull()) { - DSNode *N = new DSNode(F->getType()->getElementType(), GI); // Create the node - N->addGlobal(F); - NHF.setTo(N,0); - DOUT << "Adding " << F->getName() << " to a call node in " - << D.getCaller().getName() << "\n"; - } - DL.getCalleeNode()->mergeWith(NHF, 0); - } - } + X("dsa-bu", "Bottom-up Data Structure Analysis"); } // run - Calculate the bottom up data structure graphs for each function in the @@ -151,6 +39,9 @@ // bool BUDataStructures::runOnModule(Module &M) { LocalDataStructures &LocalDSA = getAnalysis(); + setGraphSource(&LocalDSA); + setTargetData(LocalDSA.getTargetData()); + setGraphClone(false); GlobalECs = LocalDSA.getGlobalECs(); GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph(), GlobalECs); @@ -197,17 +88,7 @@ // Mark external globals incomplete. GlobalsGraph->markIncompleteNodes(DSGraph::IgnoreGlobals); - // Grow the equivalence classes for the globals to include anything that we - // now know to be aliased. - std::set ECGlobals; - BuildGlobalECs(*GlobalsGraph, ECGlobals); - if (!ECGlobals.empty()) { - NamedRegionTimer X("Bottom-UP EC Cleanup"); - DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) - EliminateUsesOfECGlobals(*I->second, ECGlobals); - } + formGlobalECs(); // Merge the globals variables (not the calls) from the globals graph back // into the main function's graph so that the main function contains all of @@ -228,23 +109,6 @@ MainGraph.maskIncompleteMarkers(); MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs | DSGraph::IgnoreGlobals); - - //Debug messages if along the way we didn't resolve a call site - //also update the call graph and callsites we did find. - for(DSGraph::afc_iterator ii = MainGraph.afc_begin(), - ee = MainGraph.afc_end(); ii != ee; ++ii) { - std::vector Funcs; - GetAllCalleesN(*ii, Funcs); - DOUT << "Lost site\n"; - DEBUG(ii->getCallSite().getInstruction()->dump()); - for (std::vector::iterator iif = Funcs.begin(), eef = Funcs.end(); - iif != eef; ++iif) { - AddGlobalToNode(this, *ii, *iif); - DOUT << "Adding\n"; - ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif)); - } - } - } NumCallEdges += ActualCallees.size(); @@ -252,25 +116,6 @@ return false; } -DSGraph &BUDataStructures::getOrCreateGraph(Function *F) { - // Has the graph already been created? - DSGraph *&Graph = DSInfo[F]; - if (Graph) return *Graph; - - DSGraph &LocGraph = getAnalysis().getDSGraph(*F); - - // Steal the local graph. - Graph = new DSGraph(GlobalECs, LocGraph.getTargetData()); - Graph->spliceFrom(LocGraph); - - Graph->setGlobalsGraph(GlobalsGraph); - Graph->setPrintAuxCalls(); - - // Start with a copy of the original call sites... - Graph->getAuxFunctionCalls() = Graph->getFunctionCalls(); - return *Graph; -} - static bool isVAHackFn(const Function *F) { return F->getName() == "printf" || F->getName() == "sscanf" || F->getName() == "fprintf" || F->getName() == "open" || @@ -302,33 +147,6 @@ } } -//returns true if all callees were resolved -static bool GetAllCalleesN(const DSCallSite &CS, - std::vector &Callees) { - if (CS.isDirectCall()) { - if (isResolvableFunc(CS.getCalleeFunc())) { - Callees.push_back(CS.getCalleeFunc()); - return true; - } else - return false; - } else { - // Get all callees. - bool retval = CS.getCalleeNode()->isComplete(); - unsigned OldSize = Callees.size(); - CS.getCalleeNode()->addFullFunctionList(Callees); - - // If any of the callees are unresolvable, remove that one - for (unsigned i = OldSize; i != Callees.size(); ++i) - if (!isResolvableFunc(Callees[i])) { - Callees.erase(Callees.begin()+i); - --i; - retval = false; - } - return retval; - //return false; - } -} - /// GetAllAuxCallees - Return a list containing all of the resolvable callees in /// the aux list for the specified graph in the Callees vector. static void GetAllAuxCallees(DSGraph &G, std::vector &Callees) { @@ -357,8 +175,6 @@ } DSGraph &Graph = getOrCreateGraph(F); - if (UpdateGlobals) - Graph.updateFromGlobalGraph(); // Find all callee functions. std::vector CalleeFunctions; @@ -496,8 +312,8 @@ if (F->getName() == "free") { // Taking the address of free. // Free should take a single pointer argument, mark it as heap memory. - DSNode *N = new DSNode(0, DSG); - N->setHeapNodeMarker(); + DSNodeHandle N(new DSNode(0, DSG)); + N.getNode()->setHeapNodeMarker(); DSG->getNodeForValue(F->arg_begin()).mergeWith(N); } else { Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.259 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.260 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.259 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructure.cpp Wed Apr 11 12:37:43 2007 @@ -1,4 +1,3 @@ -#define JTC 0 //===- DataStructure.cpp - Implement the core data structure analysis -----===// // // The LLVM Compiler Infrastructure @@ -30,7 +29,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Support/Timer.h" #include "llvm/ADT/hash_map" -#include "poolalloc/Config/config.h" #include #include @@ -1471,9 +1469,7 @@ AuxFunctionCalls.clear(); ScalarMap.clear(); ReturnNodes.clear(); -#ifdef LLVA_KERNEL - PoolDescriptors.clear(); -#endif + // Drop all intra-node references, so that assertions don't fail... for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI) NI->dropAllReferences(); @@ -1514,7 +1510,7 @@ if (GlobalValue *GV = dyn_cast(Ptr)) { N->addGlobal(GV); } else if (isa(Ptr)) { - N->setHeapNodeMarker(); + N->setHeapNodeMarker(); } else if (isa(Ptr)) { N->setAllocaNodeMarker(); } else { @@ -1630,17 +1626,6 @@ // Merge the scalar map in. ScalarMap.spliceFrom(RHS.ScalarMap); - -#ifdef LLVA_KERNEL - //Take all from the pooldescriptor map -#if 0 - PoolDescriptors.swap(RHS.getPoolDescriptorsMap()); -#else - hash_map& rhsmap = RHS.getPoolDescriptorsMap(); - PoolDescriptors.insert(rhsmap.begin(), rhsmap.end()); -#endif - RHS.getPoolDescriptorsMap().clear(); -#endif } /// spliceFrom - Copy all entries from RHS, then clear RHS. @@ -1670,7 +1655,7 @@ Args.push_back(getReturnNodeFor(*F)); for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI) - if (isPointerType(AI->getType())) { + if (isa(AI->getType())) { Args.push_back(getNodeForValue(AI)); assert(!Args.back().isNull() && "Pointer argument w/o scalarmap entry!?"); } @@ -1897,7 +1882,7 @@ std::vector Args; for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) - if (isPointerType(I->getType())) + if (isa(I->getType())) Args.push_back(getNodeForValue(I)); return DSCallSite(CallSite(), getReturnNodeFor(F), &F, Args); @@ -1908,7 +1893,7 @@ DSCallSite DSGraph::getDSCallSiteForCallSite(CallSite CS) const { DSNodeHandle RetVal; Instruction *I = CS.getInstruction(); - if (isPointerType(I->getType())) + if (isa(I->getType())) RetVal = getNodeForValue(I); std::vector Args; @@ -1916,7 +1901,7 @@ // Calculate the arguments vector... for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) - if (isPointerType((*I)->getType())) + if (isa((*I)->getType())) if (isa(*I)) Args.push_back(DSNodeHandle()); else @@ -1978,7 +1963,7 @@ Function &F = *FI->first; for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) - if (isPointerType(I->getType())) + if (isa(I->getType())) markIncompleteNode(getNodeForValue(I).getNode()); markIncompleteNode(FI->second.getNode()); } @@ -2548,7 +2533,7 @@ RI != E; ++RI) { Function &F = *RI->first; for (Function::arg_iterator AI = F.arg_begin(); AI != F.arg_end(); ++AI) - if (isPointerType(AI->getType())) + if (isa(AI->getType())) assert(!getNodeForValue(AI).isNull() && "Pointer argument must be in the scalar map!"); } @@ -2678,3 +2663,191 @@ RC.merge(getNodeForValue(*I), It->second); } } + + +//////////////////////////////////////////////////////////////////////////////// +//Base DataStructures impl: +//////////////////////////////////////////////////////////////////////////////// + +static const Function *getFnForValue(const Value *V) { + if (const Instruction *I = dyn_cast(V)) + return I->getParent()->getParent(); + else if (const Argument *A = dyn_cast(V)) + return A->getParent(); + else if (const BasicBlock *BB = dyn_cast(V)) + return BB->getParent(); + return 0; +} + +/// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. +/// These correspond to the interfaces defined in the AliasAnalysis class. +void DataStructures::deleteValue(Value *V) { + if (const Function *F = getFnForValue(V)) { // Function local value? + // If this is a function local value, just delete it from the scalar map! + getDSGraph(*F).getScalarMap().eraseIfExists(V); + return; + } + + if (Function *F = dyn_cast(V)) { + assert(getDSGraph(*F).getReturnNodes().size() == 1 && + "cannot handle scc's"); + delete DSInfo[F]; + DSInfo.erase(F); + return; + } + + assert(!isa(V) && "Do not know how to delete GV's yet!"); +} + +void DataStructures::copyValue(Value *From, Value *To) { + if (From == To) return; + if (const Function *F = getFnForValue(From)) { // Function local value? + // If this is a function local value, just delete it from the scalar map! + getDSGraph(*F).getScalarMap().copyScalarIfExists(From, To); + return; + } + + if (Function *FromF = dyn_cast(From)) { + Function *ToF = cast(To); + assert(!DSInfo.count(ToF) && "New Function already exists!"); + DSGraph *NG = new DSGraph(getDSGraph(*FromF), GlobalECs); + DSInfo[ToF] = NG; + assert(NG->getReturnNodes().size() == 1 && "Cannot copy SCC's yet!"); + + // Change the Function* is the returnnodes map to the ToF. + DSNodeHandle Ret = NG->retnodes_begin()->second; + NG->getReturnNodes().clear(); + NG->getReturnNodes()[ToF] = Ret; + return; + } + + if (const Function *F = getFnForValue(To)) { + DSGraph &G = getDSGraph(*F); + G.getScalarMap().copyScalarIfExists(From, To); + return; + } + + cerr << *From; + cerr << *To; + assert(0 && "Do not know how to copy this yet!"); + abort(); +} + +DSGraph& DataStructures::getOrCreateGraph(Function* F) { + assert(F && "No function"); + DSGraph *&G = DSInfo[F]; + if (!G) { + //Clone or Steal the Source Graph + DSGraph &BaseGraph = GraphSource->getDSGraph(*F); + if (Clone) { + G = new DSGraph(BaseGraph, GlobalECs, DSGraph::DontCloneAuxCallNodes); + } else { + G = new DSGraph(GlobalECs, GraphSource->getTargetData()); + G->spliceFrom(BaseGraph); + G->getAuxFunctionCalls() = G->getFunctionCalls(); + } + G->setPrintAuxCalls(); + G->setGlobalsGraph(GlobalsGraph); + + // Note that this graph is the graph for ALL of the function in the SCC, not + // just F. + for (DSGraph::retnodes_iterator RI = G->retnodes_begin(), + E = G->retnodes_end(); RI != E; ++RI) + if (RI->first != F) + DSInfo[RI->first] = G; + } + return *G; +} + + +void DataStructures::formGlobalECs() { + // Grow the equivalence classes for the globals to include anything that we + // now know to be aliased. + std::set ECGlobals; + buildGlobalECs(ECGlobals); + if (!ECGlobals.empty()) { + DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; + for (hash_map::iterator I = DSInfo.begin(), + E = DSInfo.end(); I != E; ++I) + eliminateUsesOfECGlobals(*I->second, ECGlobals); + } +} + +/// BuildGlobalECs - Look at all of the nodes in the globals graph. If any node +/// contains multiple globals, DSA will never, ever, be able to tell the globals +/// apart. Instead of maintaining this information in all of the graphs +/// throughout the entire program, store only a single global (the "leader") in +/// the graphs, and build equivalence classes for the rest of the globals. +void DataStructures::buildGlobalECs(std::set &ECGlobals) { + DSScalarMap &SM = GlobalsGraph->getScalarMap(); + EquivalenceClasses &GlobalECs = SM.getGlobalECs(); + for (DSGraph::node_iterator I = GlobalsGraph->node_begin(), + E = GlobalsGraph->node_end(); + I != E; ++I) { + if (I->getGlobalsList().size() <= 1) continue; + + // First, build up the equivalence set for this block of globals. + DSNode::globals_iterator i = I->globals_begin(); + GlobalValue *First = *i++; + for( ; i != I->globals_end(); ++i) { + GlobalECs.unionSets(First, *i); + ECGlobals.insert(*i); + SM.erase(SM.find(*i)); + } + + // Next, get the leader element. + assert(First == GlobalECs.getLeaderValue(First) && + "First did not end up being the leader?"); + + // Finally, change the global node to only contain the leader. + I->clearGlobals(); + I->addGlobal(First); + } + + DEBUG(GlobalsGraph->AssertGraphOK()); +} + +/// EliminateUsesOfECGlobals - Once we have determined that some globals are in +/// really just equivalent to some other globals, remove the globals from the +/// specified DSGraph (if present), and merge any nodes with their leader nodes. +void DataStructures::eliminateUsesOfECGlobals(DSGraph &G, + const std::set &ECGlobals) { + DSScalarMap &SM = G.getScalarMap(); + EquivalenceClasses &GlobalECs = SM.getGlobalECs(); + + bool MadeChange = false; + for (DSScalarMap::global_iterator GI = SM.global_begin(), E = SM.global_end(); + GI != E; ) { + GlobalValue *GV = *GI++; + if (!ECGlobals.count(GV)) continue; + + const DSNodeHandle &GVNH = SM[GV]; + assert(!GVNH.isNull() && "Global has null NH!?"); + + // Okay, this global is in some equivalence class. Start by finding the + // leader of the class. + GlobalValue *Leader = GlobalECs.getLeaderValue(GV); + + // If the leader isn't already in the graph, insert it into the node + // corresponding to GV. + if (!SM.global_count(Leader)) { + GVNH.getNode()->addGlobal(Leader); + SM[Leader] = GVNH; + } else { + // Otherwise, the leader is in the graph, make sure the nodes are the + // merged in the specified graph. + const DSNodeHandle &LNH = SM[Leader]; + if (LNH.getNode() != GVNH.getNode()) + LNH.mergeWith(GVNH); + } + + // Next step, remove the global from the DSNode. + GVNH.getNode()->removeGlobal(GV); + + // Finally, remove the global from the ScalarMap. + SM.erase(GV); + MadeChange = true; + } + + DEBUG(if(MadeChange) G.AssertGraphOK()); +} Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.168 llvm-poolalloc/lib/DSA/Local.cpp:1.169 --- llvm-poolalloc/lib/DSA/Local.cpp:1.168 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/Local.cpp Wed Apr 11 12:37:43 2007 @@ -1,4 +1,3 @@ -#define JTC 0 //===- Local.cpp - Compute a local data structure graph for a function ----===// // // The LLVM Compiler Infrastructure @@ -26,7 +25,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" -#include "poolalloc/Config/config.h" #include // FIXME: This should eventually be a FunctionPass that is automatically @@ -36,18 +34,8 @@ using namespace llvm; -#ifdef LLVA_KERNEL -static STATISTIC (CacheAllocs , "Number of kmem_cache_alloc calls"); -static STATISTIC (KMallocs , "Number of kmalloc calls"); -static STATISTIC (GlobalPools , "Number of global pools"); -#endif - static RegisterPass -X("datastructure", "Local Data Structure Analysis"); - -static cl::opt -TrackIntegersAsPointers("dsa-track-integers", cl::Hidden, - cl::desc("If this is set, track integers as potential pointers")); +X("dsa-local", "Local Data Structure Analysis"); static cl::opt IgnoreSetCC("dsa-ignore-setcc", cl::Hidden, @@ -65,29 +53,7 @@ cl::desc("List of functions that free memory from the heap"), cl::CommaSeparated, cl::Hidden); -namespace llvm { -namespace DS { - // isPointerType - Return true if this type is big enough to hold a pointer. - bool isPointerType(const Type *Ty) { - if (isa(Ty)) - return true; - else if (TrackIntegersAsPointers && Ty->isPrimitiveType() &&Ty->isInteger()) - return Ty->getPrimitiveSizeInBits() >= PointerSize; - return false; - } -}} - -using namespace DS; - namespace { - cl::opt - DisableDirectCallOpt("disable-direct-call-dsopt", cl::Hidden, - cl::desc("Disable direct call optimization in " - "DSGraph construction")); - cl::opt - DisableFieldSensitivity("disable-ds-field-sensitivity", cl::Hidden, - cl::desc("Disable field sensitivity in DSGraphs")); - //===--------------------------------------------------------------------===// // GraphBuilder Class //===--------------------------------------------------------------------===// @@ -97,109 +63,21 @@ /// class GraphBuilder : InstVisitor { DSGraph &G; - DSNodeHandle *RetNode; // Node that gets returned... - DSScalarMap &ScalarMap; - std::list *FunctionCalls; - Value * KMallocPool; - public: - GraphBuilder(Function &f, DSGraph &g, DSNodeHandle &retNode, - std::list &fc) - : G(g), RetNode(&retNode), ScalarMap(G.getScalarMap()), - FunctionCalls(&fc) { - // Find the type unsafe pool in the program - KMallocPool = f.getParent()->getNamedGlobal ("KmallocPool"); - -#if 1 - // - // Determine if the function somehow escapes - // - bool escapes = false; - if (!(f.hasInternalLinkage())) { - escapes = true; - } - Value::use_iterator U; - for (U=f.use_begin(); U != f.use_end(); ++U) { - if (isa(U)) { - std::cerr << "LLVA: isa: " << f.getName() << " " << *U << std::endl; - escapes = true; - break; - } - } -#endif - // Create scalar nodes for all pointer arguments... - for (Function::arg_iterator I = f.arg_begin(), E = f.arg_end(); - I != E; ++I) { - if (isPointerType(I->getType())) { - DSNode * Node = getValueDest(*I).getNode(); - if (!(f.hasInternalLinkage())) { - Node->setExternalMarker(); - } - } - } - - visit(f); // Single pass over the function -#if JTC -std::cerr << "LLVA: Function " << f.getName() << "\n"; - for (DSScalarMap::iterator I = ScalarMap.begin(), E=ScalarMap.end(); - I != E; - ++I) - { - std::cerr << "LLVA:\t" << I->first->getName() << ": " << (void *)(I->second.getNode()) << "\n"; - } -#endif - } - - // GraphBuilder ctor for working on the globals graph - GraphBuilder(DSGraph &g) - : G(g), RetNode(0), ScalarMap(G.getScalarMap()), FunctionCalls(0) { - } - void mergeInGlobalInitializer(GlobalVariable *GV); + Function* FB; - private: - // Visitor functions, used to handle each instruction type we encounter... - friend class InstVisitor; - void visitMallocInst(MallocInst &MI) { handleAlloc(MI, true); } - void visitAllocaInst(AllocaInst &AI) { handleAlloc(AI, false); } - void handleAlloc(AllocationInst &AI, bool isHeap); - - void visitPHINode(PHINode &PN); - void visitSelectInst(SelectInst &SI); - - void visitGetElementPtrInst(User &GEP); - void visitReturnInst(ReturnInst &RI); - void visitLoadInst(LoadInst &LI); - void visitStoreInst(StoreInst &SI); - void visitCallInst(CallInst &CI); - void visitInvokeInst(InvokeInst &II); - void visitICmpInst(ICmpInst &I); - void visitFCmpInst(FCmpInst &I); - void visitFreeInst(FreeInst &FI); - void visitCastInst(CastInst &CI); - void visitInstruction(Instruction &I); - - bool visitIntrinsic(CallSite CS, Function* F); - bool visitExternal(CallSite CS, Function* F); - void visitCallSite(CallSite CS); - void visitVAArgInst(VAArgInst &I); + //////////////////////////////////////////////////////////////////////////// + // Helper functions used to implement the visitation functions... void MergeConstantInitIntoNode(DSNodeHandle &NH, Constant *C); - private: - // Helper functions used to implement the visitation functions... /// createNode - Create a new DSNode, ensuring that it is properly added to /// the graph. /// - DSNode *createNode(const Type *Ty = 0) { - DSNode *N = new DSNode(Ty, &G); // Create the node - if (DisableFieldSensitivity) { - // Create node handle referring to the old node so that it is - // immediately removed from the graph when the node handle is destroyed. - DSNodeHandle OldNNH = N; - N->foldNodeCompletely(); - if (DSNode *FN = N->getForwardNode()) - N = FN; - } - return N; + DSNode *createNode(const Type *Ty = 0) + { + DSNode* ret = new DSNode(Ty, &G); + assert(ret->getParentGraph() && "No parent?"); + return ret; } /// setDestTo - Set the ScalarMap entry for the specified value to point to @@ -217,45 +95,89 @@ /// null), then we create a new node, link it, then return it. /// DSNodeHandle &getLink(const DSNodeHandle &Node, unsigned Link = 0); - }; -} -using namespace DS; + //////////////////////////////////////////////////////////////////////////// + // Visitor functions, used to handle each instruction type we encounter... + friend class InstVisitor; -//===----------------------------------------------------------------------===// -// DSGraph constructor - Simply use the GraphBuilder to construct the local -// graph. -DSGraph::DSGraph(EquivalenceClasses &ECs, const TargetData &td, - Function &F, DSGraph *GG) - : GlobalsGraph(GG), ScalarMap(ECs), TD(td) { - PrintAuxCalls = false; - - DOUT << " [Loc] Calculating graph for: " << F.getName() << "\n"; - - // Use the graph builder to construct the local version of the graph - GraphBuilder B(F, *this, ReturnNodes[&F], FunctionCalls); -#ifndef NDEBUG - Timer::addPeakMemoryMeasurement(); -#endif + void visitMallocInst(MallocInst &MI) + { setDestTo(MI, createNode()->setHeapNodeMarker()); } - // If there are any constant globals referenced in this function, merge their - // initializers into the local graph from the globals graph. - if (ScalarMap.global_begin() != ScalarMap.global_end()) { - ReachabilityCloner RC(*this, *GG, 0); - - for (DSScalarMap::global_iterator I = ScalarMap.global_begin(); - I != ScalarMap.global_end(); ++I) - if (GlobalVariable *GV = dyn_cast(*I)) - if (!GV->isDeclaration() && GV->isConstant()) - RC.merge(ScalarMap[GV], GG->ScalarMap[GV]); - } + void visitAllocaInst(AllocaInst &AI) + { setDestTo(AI, createNode()->setAllocaNodeMarker()); } - markIncompleteNodes(DSGraph::MarkFormalArgs); + void visitFreeInst(FreeInst &FI) + { if (DSNode *N = getValueDest(*FI.getOperand(0)).getNode()) + N->setHeapNodeMarker(); + } - // Remove any nodes made dead due to merging... - removeDeadNodes(DSGraph::KeepUnreachableGlobals); -} + //the simple ones + void visitPHINode(PHINode &PN); + void visitSelectInst(SelectInst &SI); + void visitLoadInst(LoadInst &LI); + void visitStoreInst(StoreInst &SI); + void visitReturnInst(ReturnInst &RI); + void visitVAArgInst(VAArgInst &I); + void visitIntToPtrInst(IntToPtrInst &I); + void visitPtrToIntInst(PtrToIntInst &I); + void visitBitCastInst(BitCastInst &I); + //the nasty ones + void visitGetElementPtrInst(User &GEP); + void visitCallInst(CallInst &CI); + void visitInvokeInst(InvokeInst &II); + void visitInstruction(Instruction &I); + + bool visitIntrinsic(CallSite CS, Function* F); + bool visitExternal(llvm::CallSite, llvm::Function*); + void visitCallSite(CallSite CS); + + public: + GraphBuilder(Function &f, DSGraph &g) + : G(g), FB(&f) { + // Create scalar nodes for all pointer arguments... + for (Function::arg_iterator I = f.arg_begin(), E = f.arg_end(); + I != E; ++I) { + if (isa(I->getType())) { + DSNode * Node = getValueDest(*I).getNode(); + + if (!(f.hasInternalLinkage())) { + Node->setExternalMarker(); + } + } + } + + // Create an entry for the return, which tracks which functions are in the graph + g.getOrCreateReturnNodeFor(f); + + visit(f); // Single pass over the function + + // If there are any constant globals referenced in this function, merge their + // initializers into the local graph from the globals graph. + if (g.getScalarMap().global_begin() != g.getScalarMap().global_end()) { + ReachabilityCloner RC(g, *g.getGlobalsGraph(), 0); + + for (DSScalarMap::global_iterator I = g.getScalarMap().global_begin(); + I != g.getScalarMap().global_end(); ++I) + if (GlobalVariable *GV = dyn_cast(*I)) + if (!GV->isDeclaration() && GV->isConstant()) + RC.merge(g.getNodeForValue(GV), g.getGlobalsGraph()->getNodeForValue(GV)); + } + + g.markIncompleteNodes(DSGraph::MarkFormalArgs); + + // Remove any nodes made dead due to merging... + g.removeDeadNodes(DSGraph::KeepUnreachableGlobals); + } + + // GraphBuilder ctor for working on the globals graph + explicit GraphBuilder(DSGraph& g) + :G(g), FB(0) + {} + + void mergeInGlobalInitializer(GlobalVariable *GV); + }; +} //===----------------------------------------------------------------------===// // Helper method implementations... @@ -265,10 +187,10 @@ /// DSNodeHandle GraphBuilder::getValueDest(Value &Val) { Value *V = &Val; - if (isa(V) && cast(V)->isNullValue()) + if (isa(V) && cast(V)->isNullValue()) return 0; // Null doesn't point to anything, don't add to ScalarMap! - DSNodeHandle &NH = ScalarMap[V]; + DSNodeHandle &NH = G.getNodeForValue(V); if (!NH.isNull()) return NH; // Already have a node? Just return it... @@ -289,20 +211,19 @@ NH = createNode()->setUnknownNodeMarker(); } else if (CE->getOpcode() == Instruction::GetElementPtr) { visitGetElementPtrInst(*CE); - DSScalarMap::iterator I = ScalarMap.find(CE); - assert(I != ScalarMap.end() && "GEP didn't get processed right?"); - NH = I->second; + assert(G.hasNodeForValue(CE) && "GEP didn't get processed right?"); + NH = G.getNodeForValue(CE); } else { // This returns a conservative unknown node for any unhandled ConstExpr return NH = createNode()->setUnknownNodeMarker(); } if (NH.isNull()) { // (getelementptr null, X) returns null - ScalarMap.erase(V); + G.eraseNodeForValue(V); return 0; } return NH; } else if (isa(C)) { - ScalarMap.erase(V); + G.eraseNodeForValue(V); return 0; } else { assert(0 && "Unknown constant type!"); @@ -340,7 +261,7 @@ /// merge the two destinations together. /// void GraphBuilder::setDestTo(Value &V, const DSNodeHandle &NH) { - ScalarMap[&V].mergeWith(NH); + G.getNodeForValue(&V).mergeWith(NH); } @@ -348,73 +269,93 @@ // Specific instruction type handler implementations... // -/// Alloca & Malloc instruction implementation - Simply create a new memory -/// object, pointing the scalar to it. -/// -void GraphBuilder::handleAlloc(AllocationInst &AI, bool isHeap) { - DSNode *N = createNode(); - if (isHeap) - N->setHeapNodeMarker(); - else - N->setAllocaNodeMarker(); - setDestTo(AI, N); -} - // PHINode - Make the scalar for the PHI node point to all of the things the // incoming values point to... which effectively causes them to be merged. // void GraphBuilder::visitPHINode(PHINode &PN) { - if (!isPointerType(PN.getType())) return; // Only pointer PHIs + if (!isa(PN.getType())) return; // Only pointer PHIs - DSNodeHandle &PNDest = ScalarMap[&PN]; + DSNodeHandle &PNDest = G.getNodeForValue(&PN); for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) PNDest.mergeWith(getValueDest(*PN.getIncomingValue(i))); } void GraphBuilder::visitSelectInst(SelectInst &SI) { - if (!isPointerType(SI.getType())) return; // Only pointer Selects + if (!isa(SI.getType())) return; // Only pointer Selects - DSNodeHandle &Dest = ScalarMap[&SI]; + DSNodeHandle &Dest = G.getNodeForValue(&SI); Dest.mergeWith(getValueDest(*SI.getOperand(1))); Dest.mergeWith(getValueDest(*SI.getOperand(2))); } -void GraphBuilder::visitICmpInst(ICmpInst &SCI) { - if (!isPointerType(SCI.getOperand(0)->getType()) || - isa(SCI.getOperand(1))) return; // Only pointers - if(!IgnoreSetCC) - ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1))); +void GraphBuilder::visitLoadInst(LoadInst &LI) { + DSNodeHandle Ptr = getValueDest(*LI.getOperand(0)); + + // Make that the node is read from... + Ptr.getNode()->setReadMarker(); + + // Ensure a typerecord exists... + Ptr.getNode()->mergeTypeInfo(LI.getType(), Ptr.getOffset(), false); + + if (isa(LI.getType())) + setDestTo(LI, getLink(Ptr)); } -void GraphBuilder::visitFCmpInst(FCmpInst &SCI) { - if (!isPointerType(SCI.getOperand(0)->getType()) || - isa(SCI.getOperand(1))) return; // Only pointers - if(!IgnoreSetCC) - ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1))); +void GraphBuilder::visitStoreInst(StoreInst &SI) { + const Type *StoredTy = SI.getOperand(0)->getType(); + DSNodeHandle Dest = getValueDest(*SI.getOperand(1)); + if (Dest.isNull()) return; + + // Mark that the node is written to... + Dest.getNode()->setModifiedMarker(); + + // Ensure a type-record exists... + Dest.getNode()->mergeTypeInfo(StoredTy, Dest.getOffset()); + + // Avoid adding edges from null, or processing non-"pointer" stores + if (isa(StoredTy)) + Dest.addEdgeTo(getValueDest(*SI.getOperand(0))); } +void GraphBuilder::visitReturnInst(ReturnInst &RI) { + if (RI.getNumOperands() && isa(RI.getOperand(0)->getType())) + G.getOrCreateReturnNodeFor(*FB).mergeWith(getValueDest(*RI.getOperand(0))); +} -void GraphBuilder::visitGetElementPtrInst(User &GEP) { +void GraphBuilder::visitVAArgInst(VAArgInst &I) { + //FIXME: also updates the argument + DSNodeHandle Ptr = getValueDest(*I.getOperand(0)); + if (Ptr.isNull()) return; -#ifdef LLVA_KERNEL -#if 1 - int debug = 0; - if (isa(GEP)) { - Instruction * IGEP = (Instruction *)(&GEP); - if (IGEP->getParent()->getParent()->getName() == "alloc_vfsmnt") - { -#if 0 - if (G.getPoolDescriptorsMap().count(N) != 0) - if (G.getPoolDescriptorsMap()[N]) - std::cerr << "LLVA: GEP[" << count << "]: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[N]->getMetaPoolValue()->getName() << "\n"; -#else - debug = 1; -#endif - } - } -#endif -#endif + // Make that the node is read and written + Ptr.getNode()->setReadMarker()->setModifiedMarker(); + + // Ensure a type record exists. + DSNode *PtrN = Ptr.getNode(); + PtrN->mergeTypeInfo(I.getType(), Ptr.getOffset(), false); + + if (isa(I.getType())) + setDestTo(I, getLink(Ptr)); +} +void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) { + setDestTo(I, createNode()->setUnknownNodeMarker()); //->setIntToPtrMarker()); +} + +void GraphBuilder::visitPtrToIntInst(PtrToIntInst& I) { +// if (DSNode* N = getValueDest(*I.getOperand(0)).getNode()) +// N->setPtrToIntMarker(); +} + + +void GraphBuilder::visitBitCastInst(BitCastInst &I) { + if (!isa(I.getType())) return; // Only pointers + DSNodeHandle Ptr = getValueDest(*I.getOperand(0)); + if (Ptr.isNull()) return; + setDestTo(I, Ptr); +} + +void GraphBuilder::visitGetElementPtrInst(User &GEP) { DSNodeHandle Value = getValueDest(*GEP.getOperand(0)); if (Value.isNull()) Value = createNode(); @@ -434,11 +375,6 @@ if (AllZeros || (!Value.isNull() && Value.getNode()->isNodeCompletelyFolded())) { setDestTo(GEP, Value); -#if 0 -if (debug) std::cerr << "LLVA: GEP: All Zeros\n"; - if (G.getPoolDescriptorsMap()[Value.getNode()]) - std::cerr << "LLVA: GEP: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[Value.getNode()]->getName() << "\n"; -#endif return; } @@ -570,74 +506,6 @@ } -void GraphBuilder::visitLoadInst(LoadInst &LI) { - DSNodeHandle Ptr = getValueDest(*LI.getOperand(0)); - if (Ptr.isNull()) - Ptr = createNode(); - - // Make that the node is read from... - Ptr.getNode()->setReadMarker(); - - // Ensure a typerecord exists... - Ptr.getNode()->mergeTypeInfo(LI.getType(), Ptr.getOffset(), false); - - if (isPointerType(LI.getType())) - setDestTo(LI, getLink(Ptr)); -#if 0 - if (G.getPoolDescriptorsMap()[getLink(Ptr).getNode()]) - std::cerr << "LLVA: Load: Pool for " << LI.getName() << " is " << G.getPoolDescriptorsMap()[getLink(Ptr).getNode()]->getName() << "\n"; -#endif -} - -void GraphBuilder::visitStoreInst(StoreInst &SI) { - const Type *StoredTy = SI.getOperand(0)->getType(); - DSNodeHandle Dest = getValueDest(*SI.getOperand(1)); - if (Dest.isNull()) return; - - // Mark that the node is written to... - Dest.getNode()->setModifiedMarker(); - - // Ensure a type-record exists... - Dest.getNode()->mergeTypeInfo(StoredTy, Dest.getOffset()); - - // Avoid adding edges from null, or processing non-"pointer" stores - if (isPointerType(StoredTy)) - Dest.addEdgeTo(getValueDest(*SI.getOperand(0))); -#ifdef LLVA_KERNEL -#if 1 - { - if (SI.getParent()->getParent()->getName() == "alloc_vfsmnt") { - DSNode * N = getValueDest(*SI.getOperand(1)).getNode(); - if (G.getPoolDescriptorsMap().count(N) != 0) - if (G.getPoolDescriptorsMap()[N]) - std::cerr << "LLVA: Store: Pool for " << SI.getName() << " is " << G.getPoolDescriptorsMap()[N]->getName() << "\n"; - } - } -#endif -#endif -} - -void GraphBuilder::visitReturnInst(ReturnInst &RI) { - if (RI.getNumOperands() && isPointerType(RI.getOperand(0)->getType())) - RetNode->mergeWith(getValueDest(*RI.getOperand(0))); -} - -void GraphBuilder::visitVAArgInst(VAArgInst &I) { - //FIXME: also updates the argument - DSNodeHandle Ptr = getValueDest(*I.getOperand(0)); - if (Ptr.isNull()) return; - - // Make that the node is read from. - Ptr.getNode()->setReadMarker(); - - // Ensure a type record exists. - DSNode *PtrN = Ptr.getNode(); - PtrN->mergeTypeInfo(I.getType(), Ptr.getOffset(), false); - - if (isPointerType(I.getType())) - setDestTo(I, getLink(Ptr)); -} - void GraphBuilder::visitCallInst(CallInst &CI) { visitCallSite(&CI); @@ -730,7 +598,7 @@ // These functions read all of their pointer operands. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); } @@ -748,7 +616,7 @@ // These functions write all of their pointer operands. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setModifiedMarker(); } @@ -757,7 +625,7 @@ F->getName() == "lstat") { // These functions read their first operand if its a pointer. CallSite::arg_iterator AI = CS.arg_begin(); - if (isPointerType((*AI)->getType())) { + if (isa((*AI)->getType())) { DSNodeHandle Path = getValueDest(**AI); if (DSNode *N = Path.getNode()) N->setReadMarker(); } @@ -793,7 +661,7 @@ // These functions read all of their pointer operands. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); @@ -903,7 +771,7 @@ // Any pointer arguments are read. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); return true; @@ -922,7 +790,7 @@ // Any pointer arguments are read. for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker()->setModifiedMarker(); return true; @@ -953,7 +821,7 @@ for (; AI != E; ++AI) { // printf reads all pointer arguments. - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); } @@ -986,14 +854,14 @@ // Read the format if (AI != E) { - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); ++AI; } // Read the valist, and the pointed-to objects. - if (AI != E && isPointerType((*AI)->getType())) { + if (AI != E && isa((*AI)->getType())) { const DSNodeHandle &VAList = getValueDest(**AI); if (DSNode *N = VAList.getNode()) { N->setReadMarker(); @@ -1033,7 +901,7 @@ for (; AI != E; ++AI) { // scanf writes all pointer arguments. - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setModifiedMarker(); } @@ -1068,7 +936,7 @@ for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); @@ -1078,7 +946,7 @@ } else if (F->getName() == "__assert_fail") { for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) - if (isPointerType((*AI)->getType())) + if (isa((*AI)->getType())) if (DSNode *N = getValueDest(**AI).getNode()) N->setReadMarker(); return true; @@ -1269,167 +1137,7 @@ Value *Callee = CS.getCalledValue(); // Special case handling of certain libc allocation functions here. - if (Function *F = dyn_cast(Callee)) { -#ifdef LLVA_KERNEL - if (F->getName() == "kmem_cache_alloc") { - DEBUG(std::cerr << "LLVA: kmem_cache_alloc" << std::endl); - // Update the statistics count - ++CacheAllocs; - - // Create a new DSNode for this memory allocation - DSNode *N = createNode(); - N->setHeapNodeMarker(); - setDestTo(*CS.getInstruction(), N); - - // Get the pool handle - if (CS.arg_begin() == CS.arg_end()) { - abort(); //Handle this later - // Treat it as a kmalloc - N->foldNodeCompletely(); - //This becomes a kmalloc pool - MetaPoolHandle* mpvh = new MetaPoolHandle(new MetaPool(KMallocPool)); - G.getPoolDescriptorsMap()[N] = mpvh; - } else { - Value *actualPD = *(CS.arg_begin()); - if (!isa(actualPD)) { - std::cerr << "WARNING: Pool is not global. Function = " << CS.getCaller()->getName() << "\n"; - } else { - ++GlobalPools; - } - Value *TheMetaPool = actualPD; - //Get the Module first - Module * M = F->getParent(); - if (G.getPoolDescriptorsMap().count(N)== 0) { - //Here we insert a global meta pool - //Now create a meta pool for this value, DSN Node - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - TheMetaPool = new GlobalVariable( - /*type=*/ VoidPtrType, - /*isConstant=*/ false, - /*Linkage=*/ GlobalValue::InternalLinkage, - /*initializer=*/ Constant::getNullValue(VoidPtrType), - /*name=*/ "_metaPool_", - /*parent=*/ M ); - //Inserted a global meta pool - } -#if 1 - else { - // Lookup the meta pool - TheMetaPool = G.getPoolForNode(N)->getMetaPoolValue(); - } -#endif - //Now insert a function call that takes care of adding this pool to the global pool - - //First get the Insert point - Instruction *InsertPoint = CS.getInstruction(); - - //Assumes AddPoolDescToMetaPool is in the module - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - const Type * VoidPtrPtrType = PointerType::get(VoidPtrType); - CastInst *CastMetaPool = - CastInst::createPointerCast (TheMetaPool, - VoidPtrPtrType, "metapool.casted", InsertPoint); - CastInst *CastActualPD = - CastInst::createPointerCast (actualPD, - PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint); - - // Create the call to AddPoolDescToMetaPool - std::vector args(1,CastMetaPool); - args.push_back(CastActualPD); - - //Get the AddPoolDescToMetaPool function from the module - //FIXME optimize it by getting it once per module - std::vector Arg(1, VoidPtrPtrType); - Arg.push_back(VoidPtrType); - FunctionType *AddPoolDescToMetaPoolTy = - FunctionType::get(Type::VoidTy,Arg, false); - Function *AddPoolDescToMetaPool = M->getOrInsertFunction("AddPoolDescToMetaPool", AddPoolDescToMetaPoolTy); - - - new CallInst(AddPoolDescToMetaPool,args,"", InsertPoint); -#if 0 - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(TheMetaPool)); -#else - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(TheMetaPool), CS.getInstruction()); -#endif - G.getPoolDescriptorsMap()[N] = tmpvh; - } - return; - } else if (F->getName() == "poolalloc") { - if (CS.getCaller()->getName() == "kmem_cache_alloc") - return; - // Update the statistics - ++KMallocs; - - // Create a DSNode for the memory allocated by this function call - DSNode *N = createNode(); - N->setHeapNodeMarker(); - setDestTo(*CS.getInstruction(), N); - - // Get the pool handle, if possible - if (CS.arg_begin() == CS.arg_end()) { - abort() ; //Handle this later - // Treat it as kmalloc - N->foldNodeCompletely(); - //This becomes a kmalloc pool - //So get the kmalloc pool - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(KMallocPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } else { - Value *actualPD = *(CS.arg_begin()); - if (!isa(actualPD)) { - std::cerr << "WARNING: Pool is not global. Function = " << CS.getCaller()->getName() << "\n"; - } else { - ++GlobalPools; - } - Value *TheMetaPool = actualPD; - Module * M = F->getParent(); - if (G.getPoolDescriptorsMap().count(N)== 0) { - //Here we insert a global meta pool - //Get the Module first - //Now create a meta pool for this value, DSN Node - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - TheMetaPool = new GlobalVariable( - /*type=*/ VoidPtrType, - /*isConstant=*/ false, - /*Linkage=*/ GlobalValue::InternalLinkage, - /*initializer=*/ Constant::getNullValue(VoidPtrType), - /*name=*/ "_metaPool_", - /*parent=*/ M ); - //Inserted a global meta pool - } - //Now insert a function call that takes care of adding this pool to the global pool - //First get the Insert point - Instruction *InsertPoint = CS.getInstruction(); - - //Assumes AddPoolDescToMetaPool is in the module - const Type * VoidPtrType = PointerType::get(Type::Int8Ty); - const Type * VoidPtrPtrType = PointerType::get(VoidPtrType); - CastInst *CastMetaPool = - CastInst::createPointerCast (TheMetaPool, - VoidPtrPtrType, "metapool.casted", InsertPoint); - CastInst *CastActualPD = - CastInst::createPointerCast (actualPD, - PointerType::get(Type::Int8Ty), "poolhandle.lscasted", InsertPoint); - - // Create the call to AddPoolDescToMetaPool - std::vector args(1,CastMetaPool); - args.push_back(CastActualPD); - - //FIXME optimize it by getting it once per module - std::vector Arg(1, VoidPtrPtrType); - Arg.push_back(VoidPtrType); - FunctionType *AddPoolDescToMetaPoolTy = - FunctionType::get(Type::VoidTy,Arg, false); - Function *AddPoolDescToMetaPool = M->getOrInsertFunction("AddPoolDescToMetaPool", AddPoolDescToMetaPoolTy); - - new CallInst(AddPoolDescToMetaPool,args,"", InsertPoint); - MetaPoolHandle* tmpvh = new MetaPoolHandle(new MetaPool(TheMetaPool)); - G.getPoolDescriptorsMap()[N] = tmpvh; - } - return; - } -#endif + if (Function *F = dyn_cast(Callee)) if (F->isDeclaration()) if (F->isIntrinsic() && visitIntrinsic(CS, F)) return; @@ -1457,11 +1165,11 @@ // Unknown function, warn if it returns a pointer type or takes a // pointer argument. - bool Warn = isPointerType(CS.getInstruction()->getType()); + bool Warn = isa(CS.getInstruction()->getType()); if (!Warn) for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) - if (isPointerType((*I)->getType())) { + if (isa((*I)->getType())) { Warn = true; break; } @@ -1470,16 +1178,15 @@ << F->getName() << "' will cause pessimistic results!\n"; } } - } // Set up the return value... DSNodeHandle RetVal; Instruction *I = CS.getInstruction(); - if (isPointerType(I->getType())) + if (isa(I->getType())) RetVal = getValueDest(*I); DSNode *CalleeNode = 0; - if (DisableDirectCallOpt || !isa(Callee)) { + if (!isa(Callee)) { CalleeNode = getValueDest(*Callee).getNode(); if (CalleeNode == 0) { cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; @@ -1492,58 +1199,26 @@ // Calculate the arguments vector... for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) - if (isPointerType((*I)->getType())) + if (isa((*I)->getType())) Args.push_back(getValueDest(**I)); // Add a new function call entry... if (CalleeNode) - FunctionCalls->push_back(DSCallSite(CS, RetVal, CalleeNode, Args)); + G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, CalleeNode, Args)); else - FunctionCalls->push_back(DSCallSite(CS, RetVal, cast(Callee), - Args)); + G.getFunctionCalls().push_back(DSCallSite(CS, RetVal, cast(Callee), + Args)); } -void GraphBuilder::visitFreeInst(FreeInst &FI) { - // Mark that the node is written to... - if (DSNode *N = getValueDest(*FI.getOperand(0)).getNode()) - N->setModifiedMarker()->setHeapNodeMarker(); -} - -/// Handle casts... -void GraphBuilder::visitCastInst(CastInst &CI) { - // Pointers can only be cast with BitCast so check that the instruction - // is a BitConvert. If not, its guaranteed not to involve any pointers so - // we don't do anything. - switch (CI.getOpcode()) { - default: break; - case Instruction::BitCast: - case Instruction::IntToPtr: - if (isPointerType(CI.getType())) - if (isPointerType(CI.getOperand(0)->getType())) { - DSNodeHandle Ptr = getValueDest(*CI.getOperand(0)); - if (Ptr.getNode() == 0) return; - // Cast one pointer to the other, just act like a copy instruction - setDestTo(CI, Ptr); - } else { - // Cast something (floating point, small integer) to a pointer. We - // need to track the fact that the node points to SOMETHING, just - // something we don't know about. Make an "Unknown" node. - setDestTo(CI, createNode()->setUnknownNodeMarker()); - } - break; - } -} - - // visitInstruction - For all other instruction types, if we have any arguments // that are of pointer type, make them have unknown composition bits, and merge // the nodes together. void GraphBuilder::visitInstruction(Instruction &Inst) { DSNodeHandle CurNode; - if (isPointerType(Inst.getType())) + if (isa(Inst.getType())) CurNode = getValueDest(Inst); for (User::op_iterator I = Inst.op_begin(), E = Inst.op_end(); I != E; ++I) - if (isPointerType((*I)->getType())) + if (isa((*I)->getType())) CurNode.mergeWith(getValueDest(**I)); if (DSNode *N = CurNode.getNode()) @@ -1564,7 +1239,7 @@ NHN->mergeTypeInfo(C->getType(), NH.getOffset()); if (C->getType()->isFirstClassType()) { - if (isPointerType(C->getType())) + if (isa(C->getType())) // Avoid adding edges from null, or processing non-"pointer" stores NH.addEdgeTo(getValueDest(*C)); return; @@ -1606,93 +1281,11 @@ } -/// BuildGlobalECs - Look at all of the nodes in the globals graph. If any node -/// contains multiple globals, DSA will never, ever, be able to tell the globals -/// apart. Instead of maintaining this information in all of the graphs -/// throughout the entire program, store only a single global (the "leader") in -/// the graphs, and build equivalence classes for the rest of the globals. -static void BuildGlobalECs(DSGraph &GG, std::set &ECGlobals) { - DSScalarMap &SM = GG.getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); - for (DSGraph::node_iterator I = GG.node_begin(), E = GG.node_end(); - I != E; ++I) { - if (I->getGlobalsList().size() <= 1) continue; - - // First, build up the equivalence set for this block of globals. - const std::vector &GVs = I->getGlobalsList(); - GlobalValue *First = GVs[0]; - for (unsigned i = 1, e = GVs.size(); i != e; ++i) - GlobalECs.unionSets(First, GVs[i]); - - // Next, get the leader element. - assert(First == GlobalECs.getLeaderValue(First) && - "First did not end up being the leader?"); - - // Next, remove all globals from the scalar map that are not the leader. - assert(GVs[0] == First && "First had to be at the front!"); - for (unsigned i = 1, e = GVs.size(); i != e; ++i) { - ECGlobals.insert(GVs[i]); - SM.erase(SM.find(GVs[i])); - } - - // Finally, change the global node to only contain the leader. - I->clearGlobals(); - I->addGlobal(First); - } - - DEBUG(GG.AssertGraphOK()); -} - -/// EliminateUsesOfECGlobals - Once we have determined that some globals are in -/// really just equivalent to some other globals, remove the globals from the -/// specified DSGraph (if present), and merge any nodes with their leader nodes. -static void EliminateUsesOfECGlobals(DSGraph &G, - const std::set &ECGlobals) { - DSScalarMap &SM = G.getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); - - bool MadeChange = false; - for (DSScalarMap::global_iterator GI = SM.global_begin(), E = SM.global_end(); - GI != E; ) { - GlobalValue *GV = *GI++; - if (!ECGlobals.count(GV)) continue; - - const DSNodeHandle &GVNH = SM[GV]; - assert(!GVNH.isNull() && "Global has null NH!?"); - - // Okay, this global is in some equivalence class. Start by finding the - // leader of the class. - GlobalValue *Leader = GlobalECs.getLeaderValue(GV); - - // If the leader isn't already in the graph, insert it into the node - // corresponding to GV. - if (!SM.global_count(Leader)) { - GVNH.getNode()->addGlobal(Leader); - SM[Leader] = GVNH; - } else { - // Otherwise, the leader is in the graph, make sure the nodes are the - // merged in the specified graph. - const DSNodeHandle &LNH = SM[Leader]; - if (LNH.getNode() != GVNH.getNode()) - LNH.mergeWith(GVNH); - } - - // Next step, remove the global from the DSNode. - GVNH.getNode()->removeGlobal(GV); - - // Finally, remove the global from the ScalarMap. - SM.erase(GV); - MadeChange = true; - } - - DEBUG(if(MadeChange) G.AssertGraphOK()); -} - bool LocalDataStructures::runOnModule(Module &M) { - const TargetData &TD = getAnalysis(); + setTargetData(getAnalysis()); // First step, build the globals graph. - GlobalsGraph = new DSGraph(GlobalECs, TD); + GlobalsGraph = new DSGraph(GlobalECs, getTargetData()); { GraphBuilder GGB(*GlobalsGraph); @@ -1705,16 +1298,16 @@ // Next step, iterate through the nodes in the globals graph, unioning // together the globals into equivalence classes. - std::set ECGlobals; - BuildGlobalECs(*GlobalsGraph, ECGlobals); - DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; - ECGlobals.clear(); + formGlobalECs(); // Calculate all of the graphs... for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration()) - DSInfo.insert(std::make_pair(I, new DSGraph(GlobalECs, TD, *I, - GlobalsGraph))); + if (!I->isDeclaration()) { + DSGraph* G = new DSGraph(GlobalECs, getTargetData(), GlobalsGraph); + GraphBuilder GGB(*I, *G); + DSInfo.insert(std::make_pair(I, G)); + } + GlobalsGraph->removeTriviallyDeadNodes(); GlobalsGraph->markIncompleteNodes(DSGraph::MarkFormalArgs); @@ -1722,13 +1315,7 @@ // the globals graph, see if we have further constrained the globals in the // program if so, update GlobalECs and remove the extraneous globals from the // program. - BuildGlobalECs(*GlobalsGraph, ECGlobals); - if (!ECGlobals.empty()) { - DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) - EliminateUsesOfECGlobals(*I->second, ECGlobals); - } + formGlobalECs(); return false; } Index: llvm-poolalloc/lib/DSA/Steensgaard.cpp diff -u llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.69 llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.70 --- llvm-poolalloc/lib/DSA/Steensgaard.cpp:1.69 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/Steensgaard.cpp Wed Apr 11 12:37:43 2007 @@ -28,7 +28,6 @@ DSGraph *ResultGraph; EquivalenceClasses GlobalECs; // Always empty - PoolDescriptorMapType PoolDescriptors; public: Steens() : ResultGraph(0) {} ~Steens() { Index: llvm-poolalloc/lib/DSA/TopDownClosure.cpp diff -u llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.98 llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.99 --- llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.98 Fri Feb 23 16:49:32 2007 +++ llvm-poolalloc/lib/DSA/TopDownClosure.cpp Wed Apr 11 12:37:43 2007 @@ -33,7 +33,7 @@ namespace { RegisterPass // Register the pass - Y("tddatastructure", "Top-down Data Structure Analysis"); + Y("dsa-td", "Top-down Data Structure Analysis"); STATISTIC (NumTDInlines, "Number of graphs inlined"); } From reid at x10sys.com Wed Apr 11 12:38:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 12:38:36 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704111738.l3BHcaVL024934@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.54 -> 1.55 --- Log message: Add Efrem Lipkin and Mike Mengler. --- Diffs of the changes: (+4 -2) DevMtgMay2007.html | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.54 llvm-www/DevMtgMay2007.html:1.55 --- llvm-www/DevMtgMay2007.html:1.54 Tue Apr 10 08:58:56 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 12:38:19 2007 @@ -248,6 +248,7 @@ Evan ChengApple Inc. Jeff CohenIndependent John CriswellUIUC + Mike EnglerAdobe Systems Incorporated. Han GaoAdobe Systems Incorporated. Dan Gohman + 1Cray Inc. Stuart HastingsApple Inc. @@ -264,6 +265,7 @@ NameOrganization Julien LerougeApple Inc. Nick LewyckyIndependent + Efrem LipkinCoDesign Gabe McArthurIndependent Paul McJonesAdobe Systems Incorporated. Scott MichelAerospace @@ -280,7 +282,7 @@ -

    Total confirmed: 30

    +

    Total confirmed: 32

    @@ -298,6 +300,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/10 13:58:56 $ +
    Last modified: $Date: 2007/04/11 17:38:19 $ From dpatel at apple.com Wed Apr 11 12:41:39 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 11 Apr 2007 10:41:39 -0700 (PDT) Subject: [llvm-commits] [125985] cosmetic. Message-ID: <20070411174139.5B211E40ADAB@src> Revision: 125985 Author: dpatel Date: 2007-04-11 10:41:38 -0700 (Wed, 11 Apr 2007) Log Message: ----------- cosmetic. s/LLVMValuesNameTable/LLVMValuesTable/g Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:29:14 UTC (rev 125984) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-11 17:41:38 UTC (rev 125985) @@ -207,12 +207,12 @@ } // Create string table. - Constant *LLVMValuesNameTable = ConstantStruct::get(ValuesForPCH, false); + Constant *LLVMValuesTable = ConstantStruct::get(ValuesForPCH, false); // Create variable to hold this string table. - new GlobalVariable(LLVMValuesNameTable->getType(), true, + new GlobalVariable(LLVMValuesTable->getType(), true, GlobalValue::ExternalLinkage, - LLVMValuesNameTable, + LLVMValuesTable, "llvm.pch.values", TheModule); } From reid at x10sys.com Wed Apr 11 12:51:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 12:51:20 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/packed_cmp.ll Message-ID: <200704111751.l3BHpKpK025439@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: packed_cmp.ll updated: 1.4 -> 1.5 --- Log message: Upgrade this file completely instead of downgrading it. Make sure that false positives aren't made. --- Diffs of the changes: (+30 -31) packed_cmp.ll | 61 ++++++++++++++++++++++++++++------------------------------ 1 files changed, 30 insertions(+), 31 deletions(-) Index: llvm/test/Feature/packed_cmp.ll diff -u llvm/test/Feature/packed_cmp.ll:1.4 llvm/test/Feature/packed_cmp.ll:1.5 --- llvm/test/Feature/packed_cmp.ll:1.4 Wed Apr 11 07:46:06 2007 +++ llvm/test/Feature/packed_cmp.ll Wed Apr 11 12:51:03 2007 @@ -1,58 +1,57 @@ ; This test checks to make sure that NE and EQ comparisons of ; vector types work. -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > /dev/null -f && -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll +; RUN: llvm-as | llvm-dis > /dev/null -f && +; RUN: llvm-as | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll ; XFAIL: * %ivec_type = type <4 x i8> -%ivec1 = constant %ivec_type < i8 1, i8 1, i8 1, i8 1 > -%ivec2 = constant %ivec_type < i8 0, i8 0, i8 0, i8 0 > + at ivec1 = constant %ivec_type < i8 1, i8 1, i8 1, i8 1 > + at ivec2 = constant %ivec_type < i8 0, i8 0, i8 0, i8 0 > %fvec_type = type <4 x float> -%fvec1 = constant %fvec_type -%fvec2 = constant %fvec_type + at fvec1 = constant %fvec_type + at fvec2 = constant %fvec_type - -define bool %ivectest1() { - %v1 = load %ivec_type* getelementptr(%ivec_type* %ivec1, i32 0) - %v2 = load %ivec_type* getelementptr(%ivec_type* %ivec2, i32 0) +define i1 @ivectest1() { + %v1 = load %ivec_type* getelementptr(%ivec_type* @ivec1, i32 0) + %v2 = load %ivec_type* getelementptr(%ivec_type* @ivec2, i32 0) %res = icmp ne %ivec_type %v1, %v2 - ret bool %res + ret i1 %res } -define bool %ivectest2() { - %v1 = load %ivec_type* getelementptr(%ivec_type* %ivec1, i32 0) - %v2 = load %ivec_type* getelementptr(%ivec_type* %ivec2, i32 0) +define i1 @ivectest2() { + %v1 = load %ivec_type* getelementptr(%ivec_type* @ivec1, i32 0) + %v2 = load %ivec_type* getelementptr(%ivec_type* @ivec2, i32 0) %res = icmp eq %ivec_type %v1, %v2 - ret bool %res + ret i1 %res } -define bool %fvectest1() { - %v1 = load %fvec_type* %fvec1 - %v2 = load %fvec_type* %fvec2 +define i1 @fvectest1() { + %v1 = load %fvec_type* @fvec1 + %v2 = load %fvec_type* @fvec2 %res = fcmp one %fvec_type %v1, %v2 - ret bool %res + ret i1 %res } -define bool %fvectest2() { - %v1 = load %fvec_type* %fvec1 - %v2 = load %fvec_type* %fvec2 +define i1 @fvectest2() { + %v1 = load %fvec_type* @fvec1 + %v2 = load %fvec_type* @fvec2 %res = fcmp oeq %fvec_type %v1, %v2 - ret bool %res + ret i1 %res } -define bool %fvectest3() { - %v1 = load %fvec_type* %fvec1 - %v2 = load %fvec_type* %fvec2 +define i1 @fvectest3() { + %v1 = load %fvec_type* @fvec1 + %v2 = load %fvec_type* @fvec2 %res = fcmp une %fvec_type %v1, %v2 - ret bool %res + ret i1 %res } -define bool %fvectest4() { - %v1 = load %fvec_type* %fvec1 - %v2 = load %fvec_type* %fvec2 +define i1 @fvectest4() { + %v1 = load %fvec_type* @fvec1 + %v2 = load %fvec_type* @fvec2 %res = fcmp ueq %fvec_type %v1, %v2 - ret bool %res + ret i1 %res } From reid at x10sys.com Wed Apr 11 12:56:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 12:56:40 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm2cpp.exp Message-ID: <200704111756.l3BHuewh026040@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm2cpp.exp updated: 1.6 -> 1.7 --- Log message: Update the way llvm2cpp tests are done: 1. Make sure bytecode/assembly inputs are always redirected stdin so that the module name is . This helps not get false negatives when the diff is done. 2. Scan the test file to determine if llvm-upgrade needs to be run. 3. Avoid running testings that are XFAIL'd because they'll cause a failure when run for llvm2cpp. 4. Get some better error message output. --- Diffs of the changes: (+39 -7) llvm2cpp.exp | 46 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 39 insertions(+), 7 deletions(-) Index: llvm/test/lib/llvm2cpp.exp diff -u llvm/test/lib/llvm2cpp.exp:1.6 llvm/test/lib/llvm2cpp.exp:1.7 --- llvm/test/lib/llvm2cpp.exp:1.6 Thu Jun 1 02:23:32 2006 +++ llvm/test/lib/llvm2cpp.exp Wed Apr 11 12:56:23 2007 @@ -12,6 +12,7 @@ set llvm2cpp [file join $llvmtoolsdir llvm2cpp ] set llvmas [file join $llvmtoolsdir llvm-as ] set llvmdis [file join $llvmtoolsdir llvm-dis ] + set llvmupgrade [ file join $llvmtoolsdir llvm-upgrade ] #Make Output Directory if it does not exist already if { [file exists path] } { @@ -33,20 +34,51 @@ set testname [file rootname $filename] set bytecode [file join Output $filename.bc] - # Note that the stderr for llvm-as must be redirected to /dev/null because - # otherwise exec will see the msgs and return 1 even though they are only - # warnings. If real errors are generated on stderr then llvm-as will return - # a non-zero retval anyway so we're good. + # Note that the stderr for llvm-as, etc. must be redirected to /dev/null + # because otherwise exec will see the msgs and return 1 even though they + # are only warnings. If real errors are generated on stderr then llvm-as + # will return a non-zero retval anyway so we're good. + + # Scan the test file to see if there's an XFAIL file. If so, don't run it + set retval [ catch { + exec -keepnewline grep XFAIL $test 2>/dev/null } msg ] + if { $retval == 0 } { + continue; + } + + # Scan the test file to see if there's a line with "lvm-upgrade" in it. + # If so, run llvm-upgrade first or else llvm-as will fail on it. + set retval [ catch { + exec -keepnewline grep llvm-upgrade $test 2>/dev/null } msg ] + + if { $retval == 0 } { + # In this case we must run llvm-upgrade before llvm-as + set pipeline llvm-upgrade|llvm-as|llvm-dis + set retval [ catch { + exec -keepnewline $llvmupgrade < $test -o - | $llvmas | $llvmdis -f -o $assembly 2>/dev/null } msg ] + } else { + # llvm-upgrade not necessary, just llvm-as/llvm-dis + set pipeline llvm-as|llvm-dis + set retval [ catch { + exec -keepnewline $llvmas < $test -o - | $llvmdis -f -o $assembly 2>/dev/null } msg ] + } + + if { $retval != 0 } { + fail "$test: $pipeline returned $retval\n$msg" + continue + } + + # Build bytecode for llvm2cpp input set retval [ catch { - exec -keepnewline $llvmas $test -o - | $llvmdis -f -o $assembly 2>/dev/null } msg ] + exec -keepnewline $llvmas < $assembly > $bytecode 2>/dev/null } msg ] if { $retval != 0 } { - fail "$test: llvm-as/llvm-dis returned $retval\n$msg" + fail "$test: llvm-as returned $retval\n$msg" continue } set retval [ catch { - exec -keepnewline $llvm2cpp -f -o $generated < $test 2>/dev/null } msg] + exec -keepnewline $llvm2cpp -f -o $generated < $bytecode 2>/dev/null } msg] if { $retval != 0 } { fail "$test: llvm2cpp returned $retval\n$msg" From lauro.venancio at gmail.com Wed Apr 11 13:57:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 11 Apr 2007 13:57:03 -0500 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/tls.c Makefile Message-ID: <200704111857.l3BIv36r028008@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests: tls.c added (r1.1) Makefile updated: 1.14 -> 1.15 --- Log message: Add a TLS test. --- Diffs of the changes: (+21 -0) Makefile | 1 + tls.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) Index: llvm-test/SingleSource/UnitTests/tls.c diff -c /dev/null llvm-test/SingleSource/UnitTests/tls.c:1.1 *** /dev/null Wed Apr 11 13:56:56 2007 --- llvm-test/SingleSource/UnitTests/tls.c Wed Apr 11 13:56:46 2007 *************** *** 0 **** --- 1,20 ---- + #include + #include + + void *f(void *a){ + static __thread int i = 1; + i++; + return (void *)i; + } + + int main() { + pthread_t t; + int ret; + pthread_create(&t, NULL, f, NULL); + pthread_join(t, (void **) &ret); + printf("Thread 1: %d\n",ret); + pthread_create(&t, NULL, f, NULL); + pthread_join(t, (void **) &ret); + printf("Thread 2: %d\n",ret); + return 0; + } Index: llvm-test/SingleSource/UnitTests/Makefile diff -u llvm-test/SingleSource/UnitTests/Makefile:1.14 llvm-test/SingleSource/UnitTests/Makefile:1.15 --- llvm-test/SingleSource/UnitTests/Makefile:1.14 Tue Apr 10 18:52:47 2007 +++ llvm-test/SingleSource/UnitTests/Makefile Wed Apr 11 13:56:46 2007 @@ -15,5 +15,6 @@ DIRS += SignlessTypes +LDFLAGS += -lpthread PROGRAM_REQUIRED_TO_EXIT_OK := 1 include $(LEVEL)/SingleSource/Makefile.singlesrc From reid at x10sys.com Wed Apr 11 14:36:45 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 14:36:45 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/forwardreftest.ll Message-ID: <200704111936.l3BJajjk028734@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: forwardreftest.ll updated: 1.8 -> 1.9 --- Log message: Make sure upgrade doesn't fail on this. --- Diffs of the changes: (+1 -0) forwardreftest.ll | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Feature/forwardreftest.ll diff -u llvm/test/Feature/forwardreftest.ll:1.8 llvm/test/Feature/forwardreftest.ll:1.9 --- llvm/test/Feature/forwardreftest.ll:1.8 Fri Dec 1 22:23:07 2006 +++ llvm/test/Feature/forwardreftest.ll Wed Apr 11 14:36:27 2007 @@ -1,3 +1,4 @@ +; RUN: llvm-upgrade < %s | llvm-as | llvm-ds -o /dev/null -f && ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll From reid at x10sys.com Wed Apr 11 14:54:54 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 14:54:54 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/llvm2cpp.ll Message-ID: <200704111954.l3BJssAT029125@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: llvm2cpp.ll added (r1.1) --- Log message: Add a test case for testing basic IR features via llvm2cpp. This helps find bit rot in llvm2cpp and also tests the LLVM C++ IR in ways that llvm-as doesn't. --- Diffs of the changes: (+795 -0) llvm2cpp.ll | 795 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 795 insertions(+) Index: llvm/test/Feature/llvm2cpp.ll diff -c /dev/null llvm/test/Feature/llvm2cpp.ll:1.1 *** /dev/null Wed Apr 11 14:54:47 2007 --- llvm/test/Feature/llvm2cpp.ll Wed Apr 11 14:54:37 2007 *************** *** 0 **** --- 1,795 ---- + ; RUN: llvm-as < %s | llvm-dis > %t1.ll + ; RUN: llvm-as < %s | llvm2cpp -gen-program -o %t2.cpp - + ; RUN: gcc -g -D__STDC_LIMIT_MACROS -o %t2.exe %t2.cpp -I%I -L%L -lLLVMCore -lLLVMSupport -lLLVMbzip2 -lLLVMSystem -lstdc++ + ; RUN: %t2.exe > %t2.ll + ; RUN: diff %t1.ll %t2.ll + + @X = global i32 4, align 16 ; [#uses=0] + + define i32* @test1012() align 32 { + %X = alloca i32, align 4 ; [#uses=1] + %Y = alloca i32, i32 42, align 16 ; [#uses=0] + %Z = alloca i32 ; [#uses=0] + ret i32* %X + } + + define i32* @test1013() { + %X = malloc i32, align 4 ; [#uses=1] + %Y = malloc i32, i32 42, align 16 ; [#uses=0] + %Z = malloc i32 ; [#uses=0] + ret i32* %X + } + + define void @void(i32, i32) { + add i32 0, 0 ; :3 [#uses=2] + sub i32 0, 4 ; :4 [#uses=2] + br label %5 + + ; + @@ -282,7 +283,7 @@
    Unconfirmed Attendees
    NameOrganization
    Scott MichelAerospace
    Steve NaroffApple Inc.
    Devang PatelApple Inc.
    Ron PriceApple Inc.
    Fernando Magno Quintao PereiraUCLA
    Chuck RoseAdobe Systems Incorporated.
    Mark SchimmelWind River
    -

    Total confirmed: 32

    +

    Total confirmed: 33

    @@ -300,6 +301,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/11 17:38:19 $ +
    Last modified: $Date: 2007/04/12 00:03:52 $ From reid at x10sys.com Wed Apr 11 19:08:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 19:08:00 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120008.l3C080Cv002752@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.56 -> 1.57 --- Log message: No response from Dan about Cray's 2nd attendee .. move to unconfirmed. --- Diffs of the changes: (+5 -4) DevMtgMay2007.html | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.56 llvm-www/DevMtgMay2007.html:1.57 --- llvm-www/DevMtgMay2007.html:1.56 Wed Apr 11 19:03:52 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 19:07:42 2007 @@ -250,7 +250,7 @@ - + @@ -283,15 +283,16 @@
    Unconfirmed Attendees
    NameOrganization
    John CriswellUIUC
    Mike EnglerAdobe Systems Incorporated.
    Han GaoAdobe Systems Incorporated.
    Dan Gohman + 1Cray Inc.
    Dan GohmanCray Inc.
    Stuart HastingsApple Inc.
    Robert HundtGoogle
    Dale JohannesenApple Inc.
    -

    Total confirmed: 33

    +

    Total confirmed: 32

    +
    Unconfirmed Attendees
    NameOrganization
    Unconfirmed 2Aerospace
    Unconfirmed 1Wind River
    Unconfirmed 1NASA, Ames
    Unconfirmed 1Cray, Inc.
    -

    Total unconfirmed: 4

    +

    Total unconfirmed: 5

    @@ -301,6 +302,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 00:03:52 $ +
    Last modified: $Date: 2007/04/12 00:07:42 $ From reid at x10sys.com Wed Apr 11 19:26:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 19:26:16 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120026.l3C0QGIU003145@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.57 -> 1.58 --- Log message: Mention the group rate at Cupertino Inn Learn the alphabet all over. --- Diffs of the changes: (+21 -2) DevMtgMay2007.html | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.57 llvm-www/DevMtgMay2007.html:1.58 --- llvm-www/DevMtgMay2007.html:1.57 Wed Apr 11 19:07:42 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 19:25:59 2007 @@ -222,6 +222,25 @@ is very close to the Apple campus. It's pretty swank, so I'm not sure how pricey it is.

    + +
    +

    We have gotten approval to use the Apple discount rate at the + Cupertino Inn. Here's how to get + the best rates with them: +

    +
    CheckOut: Before Friday May 25th
    +
    For weekdays, the negotiated rate is $123.00/night ($185.00 regular). + Tell the reservations people that you want the Apple discount as you are + attending an Apple meeting (which is true, it was originally set for Apple + Campus).
    +
    CheckOut: Saturday May 26th-28th
    +
    If you are flying in Friday morning and want to stay the weekend then + don't mention Apple! Their discount rate of $123.00 applies to any day. + However the regular weekend rate is $99.00 so its cheaper to just not + mention Apple if you don't have to stay over on a week night.
    +
    +
    +
    @@ -271,8 +290,8 @@ Scott MichelAerospace Steve NaroffApple Inc. Devang PatelApple Inc. - Ron PriceApple Inc. Fernando Magno Quintao PereiraUCLA + Ron PriceApple Inc. Chuck RoseAdobe Systems Incorporated. Mark SchimmelWind River Reid SpencerIndependent @@ -302,6 +321,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 00:07:42 $ +
    Last modified: $Date: 2007/04/12 00:25:59 $ From reid at x10sys.com Wed Apr 11 19:30:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 19:30:07 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120030.l3C0U7hO003270@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.58 -> 1.59 --- Log message: Make the group rate section stand out a bit more. --- Diffs of the changes: (+3 -2) DevMtgMay2007.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.58 llvm-www/DevMtgMay2007.html:1.59 --- llvm-www/DevMtgMay2007.html:1.58 Wed Apr 11 19:25:59 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 19:29:49 2007 @@ -15,6 +15,7 @@
    1. Airports
    2. Hotels +
    3. Group Rate at Cupertino Inn
    4. Driving Directions
    5. Meals
    @@ -222,7 +223,7 @@ is very close to the Apple campus. It's pretty swank, so I'm not sure how pricey it is.

    - +

    We have gotten approval to use the Apple discount rate at the Cupertino Inn. Here's how to get @@ -321,6 +322,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 00:25:59 $ +
    Last modified: $Date: 2007/04/12 00:29:49 $ From dpatel at apple.com Wed Apr 11 19:33:00 2007 From: dpatel at apple.com (Devang Patel) Date: Wed, 11 Apr 2007 19:33:00 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-11-PR1321.c Message-ID: <200704120033.l3C0X0dB003355@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-11-PR1321.c added (r1.1) --- Log message: New test case for PR 1321: http://llvm.org/PR1321 . --- Diffs of the changes: (+12 -0) 2007-04-11-PR1321.c | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CFrontend/2007-04-11-PR1321.c diff -c /dev/null llvm/test/CFrontend/2007-04-11-PR1321.c:1.1 *** /dev/null Wed Apr 11 19:32:53 2007 --- llvm/test/CFrontend/2007-04-11-PR1321.c Wed Apr 11 19:32:43 2007 *************** *** 0 **** --- 1,12 ---- + // RUN: %llvmgcc %s -S -o /dev/null + + struct X { + unsigned int e0 : 17; + unsigned int e1 : 17; + unsigned int e2 : 17; + unsigned int e3 : 17; + unsigned int e4 : 17; + unsigned int e5 : 17; + unsigned int e6 : 17; + unsigned int e7 : 17; + } __attribute__((packed)) x; From reid at x10sys.com Wed Apr 11 19:34:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 19:34:00 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120034.l3C0Y0b7003436@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.59 -> 1.60 --- Log message: Requested deletion. --- Diffs of the changes: (+2 -3) DevMtgMay2007.html | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.59 llvm-www/DevMtgMay2007.html:1.60 --- llvm-www/DevMtgMay2007.html:1.59 Wed Apr 11 19:29:49 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 19:33:43 2007 @@ -232,8 +232,7 @@

    CheckOut: Before Friday May 25th
    For weekdays, the negotiated rate is $123.00/night ($185.00 regular). Tell the reservations people that you want the Apple discount as you are - attending an Apple meeting (which is true, it was originally set for Apple - Campus).
    + attending an Apple meeting.
    CheckOut: Saturday May 26th-28th
    If you are flying in Friday morning and want to stay the weekend then don't mention Apple! Their discount rate of $123.00 applies to any day. @@ -322,6 +321,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 00:29:49 $ +
    Last modified: $Date: 2007/04/12 00:33:43 $ From dpatel at apple.com Wed Apr 11 19:33:44 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 11 Apr 2007 17:33:44 -0700 (PDT) Subject: [llvm-commits] [125991] Fix num of bits required calculation for bitfields that Message-ID: <20070412003344.B6BF5E579D30@src> Revision: 125991 Author: dpatel Date: 2007-04-11 17:33:44 -0700 (Wed, 11 Apr 2007) Log Message: ----------- Fix num of bits required calculation for bitfields that do not start at byte boundary. Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070409/047340.html Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-11 23:44:56 UTC (rev 125990) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-04-12 00:33:44 UTC (rev 125991) @@ -1287,11 +1287,11 @@ if (StartOffsetInBits < FirstUnallocatedByte*8) { + unsigned AvailableBits = FirstUnallocatedByte * 8 - StartOffsetInBits; // This field's starting point is already allocated. if (StartOffsetFromByteBoundry == 0) { // This field starts at byte boundry. Need to allocate space // for additional bytes not yet allocated. - unsigned AvailableBits = FirstUnallocatedByte * 8 - StartOffsetInBits; unsigned NumBitsToAdd = FieldSizeInBits - AvailableBits; Info.addNewBitField(NumBitsToAdd, FirstUnallocatedByte); return; @@ -1300,15 +1300,15 @@ // Otherwise, this field's starting point is inside previously used byte. // This happens with Packed bit fields. In this case one LLVM Field is // used to access previous field and current field. - unsigned prevFieldTypeSizeInBits = - Info.Elements.back()->getPrimitiveSizeInBits(); - unsigned NumBitsRequired = FieldSizeInBits + - (prevFieldTypeSizeInBits/8 - 1)*8 + StartOffsetFromByteBoundry; + Info.ElementSizeInBytes[Info.Elements.size() - 1] * 8; + unsigned NumBitsRequired = prevFieldTypeSizeInBits + + (FieldSizeInBits - AvailableBits); + if (NumBitsRequired > 64) { // Use bits from previous field. - NumBitsRequired = NumBitsRequired - FirstUnallocatedByte*8; + NumBitsRequired = FieldSizeInBits - AvailableBits; } else { // If type used to access previous field is not large enough then // remove previous field and insert new field that is large enough to From sabre at nondot.org Wed Apr 11 19:36:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 19:36:52 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp Message-ID: <200704120036.l3C0aqLg003552@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: CommandLine.cpp updated: 1.86 -> 1.87 --- Log message: improve the patch for PR1318: http://llvm.org/PR1318 to also support grouped options with custom handlers (like the pass list). My previous fix only supported *new* command line options, not additions to old ones. This fixes test/Feature/load_module.ll --- Diffs of the changes: (+12 -7) CommandLine.cpp | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) Index: llvm/lib/Support/CommandLine.cpp diff -u llvm/lib/Support/CommandLine.cpp:1.86 llvm/lib/Support/CommandLine.cpp:1.87 --- llvm/lib/Support/CommandLine.cpp:1.86 Wed Apr 11 10:35:18 2007 +++ llvm/lib/Support/CommandLine.cpp Wed Apr 11 19:36:29 2007 @@ -71,6 +71,13 @@ MoreHelp->push_back(Help); } +static bool OptionListChanged = false; + +// MarkOptionsChanged - Internal helper function. +void cl::MarkOptionsChanged() { + OptionListChanged = true; +} + /// RegisteredOptionList - This is the list of the command line options that /// have statically constructed themselves. static Option *RegisteredOptionList = 0; @@ -80,8 +87,10 @@ NextRegistered = RegisteredOptionList; RegisteredOptionList = this; + MarkOptionsChanged(); } + //===----------------------------------------------------------------------===// // Basic, shared command line option processing machinery. // @@ -394,10 +403,6 @@ // the positional args into the PositionalVals list... Option *ActivePositionalArg = 0; - // Keep track of the option list so far so that we can tell if it is ever - // extended. - Option *CurOptionList = RegisteredOptionList; - // Loop over all of the arguments... processing them. bool DashDashFound = false; // Have we read '--'? for (int i = 1; i < argc; ++i) { @@ -405,14 +410,14 @@ const char *Value = 0; const char *ArgName = ""; - // If the head of the option list changed, this means that some command line + // If the option list changed, this means that some command line // option has just been registered or deregistered. This can occur in // response to things like -load, etc. If this happens, rescan the options. - if (CurOptionList != RegisteredOptionList) { + if (OptionListChanged) { PositionalOpts.clear(); Opts.clear(); GetOptionInfo(PositionalOpts, Opts); - CurOptionList = RegisteredOptionList; + OptionListChanged = false; } // Check to see if this is a positional argument. This argument is From sabre at nondot.org Wed Apr 11 19:36:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 19:36:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h Message-ID: <200704120036.l3C0apT8003547@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.63 -> 1.64 --- Log message: improve the patch for PR1318: http://llvm.org/PR1318 to also support grouped options with custom handlers (like the pass list). My previous fix only supported *new* command line options, not additions to old ones. This fixes test/Feature/load_module.ll --- Diffs of the changes: (+5 -0) CommandLine.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.63 llvm/include/llvm/Support/CommandLine.h:1.64 --- llvm/include/llvm/Support/CommandLine.h:1.63 Fri Apr 6 16:06:55 2007 +++ llvm/include/llvm/Support/CommandLine.h Wed Apr 11 19:36:29 2007 @@ -57,6 +57,10 @@ /// CommandLine utilities to print their own version string. void SetVersionPrinter(void (*func)()); + +// MarkOptionsChanged - Internal helper function. +void MarkOptionsChanged(); + //===----------------------------------------------------------------------===// // Flags permitted to be passed to command line arguments // @@ -469,6 +473,7 @@ assert(findOption(Name) == Values.size() && "Option already exists!"); Values.push_back(std::make_pair(Name, std::make_pair(static_cast(V),HelpStr))); + MarkOptionsChanged(); } /// removeLiteralOption - Remove the specified option. From reid at x10sys.com Wed Apr 11 20:03:21 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 20:03:21 -0500 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200704120103.l3C13Lgt004198@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.232 -> 1.233 --- Log message: Fix extra argument in part_set examples. Thanks Zhiru. --- Diffs of the changes: (+5 -5) LangRef.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.232 llvm/docs/LangRef.html:1.233 --- llvm/docs/LangRef.html:1.232 Wed Apr 11 18:49:50 2007 +++ llvm/docs/LangRef.html Wed Apr 11 20:03:03 2007 @@ -4685,10 +4685,10 @@ cause these bits to be set: 0xFF1F.

    Examples:
    -  llvm.part.set(0xFFFF, 0, Y, 4, 7) -> 0xFF0F
    -  llvm.part.set(0xFFFF, 0, Y, 7, 4) -> 0x0060
    -  llvm.part.set(0xFFFF, 0, Y, 8, 3) -> 0x00F0
    -  llvm.part.set(0xFFFF, 0, Y, 3, 8) -> 0xFE07
    +  llvm.part.set(0xFFFF, 0, 4, 7) -> 0xFF0F
    +  llvm.part.set(0xFFFF, 0, 7, 4) -> 0x0060
    +  llvm.part.set(0xFFFF, 0, 8, 3) -> 0x00F0
    +  llvm.part.set(0xFFFF, 0, 3, 8) -> 0xFE07
     
    @@ -4730,7 +4730,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/11 23:49:50 $ + Last modified: $Date: 2007/04/12 01:03:03 $ From reid at x10sys.com Wed Apr 11 20:13:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 20:13:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/load_module.ll Message-ID: <200704120113.l3C1DBfv004369@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: load_module.ll updated: 1.2 -> 1.3 --- Log message: The hello pass actually requires a function to chew on! --- Diffs of the changes: (+5 -0) load_module.ll | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/test/Feature/load_module.ll diff -u llvm/test/Feature/load_module.ll:1.2 llvm/test/Feature/load_module.ll:1.3 --- llvm/test/Feature/load_module.ll:1.2 Wed Apr 11 16:30:05 2007 +++ llvm/test/Feature/load_module.ll Wed Apr 11 20:12:54 2007 @@ -4,3 +4,8 @@ ; RUN: -disable-output %t.bc 2>&1 | grep Hello @junk = global i32 0 + +define i32* @somefunk() { + ret i32* @junk +} + From reid at x10sys.com Wed Apr 11 20:21:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 20:21:13 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120121.l3C1LDVo004557@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.60 -> 1.61 --- Log message: Add Lang Hames. --- Diffs of the changes: (+3 -2) DevMtgMay2007.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.60 llvm-www/DevMtgMay2007.html:1.61 --- llvm-www/DevMtgMay2007.html:1.60 Wed Apr 11 19:33:43 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 20:20:56 2007 @@ -306,12 +306,13 @@ +
    Unconfirmed Attendees
    NameOrganization
    Lang HamesUniversity of Sydney
    Unconfirmed 2Aerospace
    Unconfirmed 1Wind River
    Unconfirmed 1NASA, Ames
    Unconfirmed 1Cray, Inc.
    -

    Total unconfirmed: 5

    +

    Total unconfirmed: 6

    @@ -321,6 +322,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 00:33:43 $ +
    Last modified: $Date: 2007/04/12 01:20:56 $ From reid at x10sys.com Wed Apr 11 21:19:33 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:19:33 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120219.l3C2JX3s005528@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.61 -> 1.62 --- Log message: Add T-Shirts notice. --- Diffs of the changes: (+10 -5) DevMtgMay2007.html | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.61 llvm-www/DevMtgMay2007.html:1.62 --- llvm-www/DevMtgMay2007.html:1.61 Wed Apr 11 20:20:56 2007 +++ llvm-www/DevMtgMay2007.html Wed Apr 11 21:19:16 2007 @@ -42,14 +42,19 @@ LLVM Developers Mail List indicating that you'd like to attend. Your name will be added below. -

    CALL FOR PARTICIPATION: Please don't be bashful or just lurk! - Anyone with even a mild curiosity about LLVM is welcome to attend. But, - please do send an email if you plan to attend so we can ensure there is space - for you.

    CALL FOR PRESENTATIONS: This meeting is for you and by you. If you have an LLVM related topic idea (even if you don't plan to present it), please send it in. We need work group topics as well as people who would like to present something. No idea is a bad one!

    +

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you + pre-order your size. Send your size (S,M,L,XL) to + Reid Spencer so they can be + ordered in time for the meeting. The T-shirts will be good quality (heavy + cotton) and have a small LLVM related phrase on the front. There is no cost + for these T-Shirts as their cost is being donated to LLVM. But we will ask + you to make a donation to LLVM. 100% of those donations will be used to + further sponsor LLVM progress. If you want a T-Shirt but can't make it to the + meeting, please let Reid know. You will have to pay for shipping.

    @@ -322,6 +327,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 01:20:56 $ +
    Last modified: $Date: 2007/04/12 02:19:16 $ From reid at x10sys.com Wed Apr 11 21:49:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.td Message-ID: <200704120249.l3C2n7Y2005976@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.td updated: 1.54 -> 1.55 --- Log message: For PR1284: http://llvm.org/PR1284 : Implement the "part_set" intrinsic. --- Diffs of the changes: (+5 -2) Intrinsics.td | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.54 llvm/include/llvm/Intrinsics.td:1.55 --- llvm/include/llvm/Intrinsics.td:1.54 Mon Apr 9 21:52:46 2007 +++ llvm/include/llvm/Intrinsics.td Wed Apr 11 21:48:45 2007 @@ -203,12 +203,15 @@ // None of these intrinsics accesses memory at all. let Properties = [IntrNoMem] in { - def int_part_select : - Intrinsic<[llvm_int_ty, llvm_int_ty, llvm_i32_ty, llvm_i32_ty]>; def int_bswap: Intrinsic<[llvm_int_ty, llvm_int_ty]>; def int_ctpop: Intrinsic<[llvm_i32_ty, llvm_int_ty]>; def int_ctlz : Intrinsic<[llvm_i32_ty, llvm_int_ty]>; def int_cttz : Intrinsic<[llvm_i32_ty, llvm_int_ty]>; + def int_part_select : + Intrinsic<[llvm_int_ty, llvm_int_ty, llvm_i32_ty, llvm_i32_ty]>; + def int_part_set : + Intrinsic<[llvm_int_ty, llvm_int_ty, llvm_int_ty, llvm_i32_ty, + llvm_i32_ty]>; } //===------------------------ Debugger Intrinsics -------------------------===// From reid at x10sys.com Wed Apr 11 21:49:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200704120249.l3C2n8Nl005981@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.201 -> 1.202 --- Log message: For PR1284: http://llvm.org/PR1284 : Implement the "part_set" intrinsic. --- Diffs of the changes: (+3 -2) Verifier.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.201 llvm/lib/VMCore/Verifier.cpp:1.202 --- llvm/lib/VMCore/Verifier.cpp:1.201 Mon Apr 9 22:18:19 2007 +++ llvm/lib/VMCore/Verifier.cpp Wed Apr 11 21:48:46 2007 @@ -1028,13 +1028,14 @@ if (GotBits < 16 || GotBits % 16 != 0) CheckFailed("Intrinsic requires even byte width argument", F); /* FALL THROUGH */ + case Intrinsic::part_set: case Intrinsic::part_select: if (ArgNo == 1) { unsigned ResultBits = cast(FTy->getReturnType())->getBitWidth(); if (GotBits != ResultBits) - CheckFailed("Intrinsic requires parameter and result bit " - "widths to match", F); + CheckFailed("Intrinsic requires the bit widths of the first " + "parameter and the result to match", F); } break; } From reid at x10sys.com Wed Apr 11 21:49:08 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704120249.l3C2n84T005984@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.76 -> 1.77 --- Log message: For PR1284: http://llvm.org/PR1284 : Implement the "part_set" intrinsic. --- Diffs of the changes: (+193 -11) IntrinsicLowering.cpp | 204 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 193 insertions(+), 11 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.76 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.77 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.76 Mon Apr 9 22:20:39 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Wed Apr 11 21:48:46 2007 @@ -236,14 +236,17 @@ return LowerCTPOP(V, IP); } -/// Convert the llvm.bit.part_select.iX.iY.iZ intrinsic. This intrinsic takes -/// three integer operands of arbitrary bit width. The first operand is the -/// value from which to select the bits. The second and third operands define a -/// range of bits to select. The result is the bits selected and has a -/// corresponding width of Left-Right (second operand - third operand). -/// @see IEEE 1666-2005, System C, Section 7.2.6, pg 175. -/// @brief Lowering of llvm.bit.part_select intrinsic. -static Instruction *LowerBitPartSelect(CallInst *CI) { +/// Convert the llvm.part.select.iX.iY intrinsic. This intrinsic takes +/// three integer arguments. The first argument is the Value from which the +/// bits will be selected. It may be of any bit width. The second and third +/// arguments specify a range of bits to select with the second argument +/// specifying the low bit and the third argument specifying the high bit. Both +/// must be type i32. The result is the corresponding selected bits from the +/// Value in the same width as the Value (first argument). If the low bit index +/// is higher than the high bit index then the inverse selection is done and +/// the bits are returned in inverse order. +/// @brief Lowering of llvm.part.select intrinsic. +static Instruction *LowerPartSelect(CallInst *CI) { // Make sure we're dealing with a part select intrinsic here Function *F = CI->getCalledFunction(); const FunctionType *FT = F->getFunctionType(); @@ -268,8 +271,8 @@ // Get the arguments to the function Value* Val = F->getOperand(0); - Value* Left = F->getOperand(1); - Value* Right = F->getOperand(2); + Value* Right = F->getOperand(1); + Value* Left = F->getOperand(2); // We want to select a range of bits here such that [Left, Right] is shifted // down to the low bits. However, it is quite possible that Left is smaller @@ -406,6 +409,181 @@ return new CallInst(F, Args, 3, CI->getName(), CI); } +/// Convert the llvm.part.set.iX.iY.iZ intrinsic. This intrinsic takes +/// four integer arguments (iAny %Value, iAny %Replacement, i32 %Low, i32 %High) +/// The first two arguments can be any bit width. The result is the same width +/// as %Value. The operation replaces bits between %Low and %High with the value +/// in %Replacement. If %Replacement is not the same width, it is truncated or +/// zero extended as appropriate to fit the bits being replaced. If %Low is +/// greater than %High then the inverse set of bits are replaced. +/// @brief Lowering of llvm.bit.part.set intrinsic. +static Instruction *LowerPartSet(CallInst *CI) { + // Make sure we're dealing with a part select intrinsic here + Function *F = CI->getCalledFunction(); + const FunctionType *FT = F->getFunctionType(); + if (!F->isDeclaration() || !FT->getReturnType()->isInteger() || + FT->getNumParams() != 4 || !FT->getParamType(0)->isInteger() || + !FT->getParamType(1)->isInteger() || !FT->getParamType(2)->isInteger() || + !FT->getParamType(3)->isInteger()) + return CI; + + // Get the intrinsic implementation function by converting all the . to _ + // in the intrinsic's function name and then reconstructing the function + // declaration. + std::string Name(F->getName()); + for (unsigned i = 4; i < Name.length(); ++i) + if (Name[i] == '.') + Name[i] = '_'; + Module* M = F->getParent(); + F = cast(M->getOrInsertFunction(Name, FT)); + F->setLinkage(GlobalValue::InternalLinkage); + + // If we haven't defined the impl function yet, do so now + if (F->isDeclaration()) { + // Note: the following code is based on code generated by llvm2cpp with + // the following input. This is just *one* example of a generated function. + // The functions vary by bit width of result and first two arguments. + // The generated code has been changed to deal with any bit width not just + // the 32/64 bitwidths used in the above sample. + // + // define i64 @part_set(i64 %Val, i32 %Rep, i32 %Lo, i32 %Hi) { + // entry: + // %is_forward = icmp ult i32 %Lo, %Hi + // %Lo.pn = select i1 %is_forward, i32 %Hi, i32 %Lo + // %Hi.pn = select i1 %is_forward, i32 %Lo, i32 %Hi + // %iftmp.16.0 = sub i32 %Lo.pn, %Hi.pn + // icmp ult i32 %iftmp.16.0, 32 + // br i1 %1, label %cond_true11, label %cond_next19 + // cond_true11: + // %tmp13 = sub i32 32, %iftmp.16.0 + // %tmp14 = lshr i32 -1, %tmp13 + // %tmp16 = and i32 %tmp14, %Rep + // br label %cond_next19 + // cond_next19: + // %iftmp.17.0 = phi i32 [ %tmp16, %cond_true11 ], [ %Rep, %entry ] + // %tmp2021 = zext i32 %iftmp.17.0 to i64 + // icmp ugt i32 %Lo, %Hi + // br i1 %2, label %cond_next60, label %cond_true24 + // cond_true24: + // %tmp25.cast = zext i32 %Hi to i64 + // %tmp26 = lshr i64 -1, %tmp25.cast + // %tmp27.cast = zext i32 %Lo to i64 + // %tmp28 = shl i64 %tmp26, %tmp27.cast + // %tmp28not = xor i64 %tmp28, -1 + // %tmp31 = shl i64 %tmp2021, %tmp27.cast + // %tmp34 = and i64 %tmp28not, %Val + // %Val_addr.064 = or i64 %tmp31, %tmp34 + // ret i64 %Val_addr.064 + // cond_next60: + // %tmp39.cast = zext i32 %Lo to i64 + // %tmp40 = shl i64 -1, %tmp39.cast + // %tmp41.cast = zext i32 %Hi to i64 + // %tmp42 = shl i64 -1, %tmp41.cast + // %tmp45.demorgan = or i64 %tmp42, %tmp40 + // %tmp45 = xor i64 %tmp45.demorgan, -1 + // %tmp47 = and i64 %tmp45, %Val + // %tmp50 = shl i64 %tmp2021, %tmp39.cast + // %tmp52 = sub i32 32, %Hi + // %tmp52.cast = zext i32 %tmp52 to i64 + // %tmp54 = lshr i64 %tmp2021, %tmp52.cast + // %tmp57 = or i64 %tmp50, %tmp47 + // %Val_addr.0 = or i64 %tmp57, %tmp54 + // ret i64 %Val_addr.0 + // } + + // Get the arguments for the function. + Function::arg_iterator args = F->arg_begin(); + Value* Val = args++; Val->setName("Val"); + Value* Rep = args++; Rep->setName("Rep"); + Value* Lo = args++; Lo->setName("Lo"); + Value* Hi = args++; Hi->setName("Hi"); + + // Get some types we need + const IntegerType* ValTy = cast(Val->getType()); + const IntegerType* RepTy = cast(Rep->getType()); + uint32_t ValBits = ValTy->getBitWidth(); + uint32_t RepBits = RepTy->getBitWidth(); + + // Constant Definitions + ConstantInt* RepBitWidth = ConstantInt::get(Type::Int32Ty, RepBits); + ConstantInt* RepMask = ConstantInt::getAllOnesValue(RepTy); + ConstantInt* ValMask = ConstantInt::getAllOnesValue(ValTy); + + BasicBlock* entry = new BasicBlock("entry",F,0); + BasicBlock* large = new BasicBlock("large",F,0); + BasicBlock* small = new BasicBlock("small",F,0); + BasicBlock* forward = new BasicBlock("cond_true24",F,0); + BasicBlock* reverse = new BasicBlock("cond_next60",F,0); + + // Block entry (entry) + // First, convert Lo and Hi to ValTy bit width + if (ValBits > 32) { + Hi = new ZExtInst(Hi, ValTy, "", entry); + Lo = new ZExtInst(Lo, ValTy, "", entry); + } else if (ValBits < 32) { + Hi = new TruncInst(Hi, ValTy, "", entry); + Lo = new TruncInst(Lo, ValTy, "", entry); + } + ICmpInst* is_forward = + new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry); + SelectInst* Lo_pn = new SelectInst(is_forward, Hi, Lo, "", entry); + SelectInst* Hi_pn = new SelectInst(is_forward, Lo, Hi, "", entry); + BinaryOperator* NumBits = BinaryOperator::createSub(Lo_pn, Hi_pn, "",entry); + ICmpInst* is_large = + new ICmpInst(ICmpInst::ICMP_ULT, NumBits, RepBitWidth, "", entry); + new BranchInst(large, small, is_large, entry); + + // Block "large" + BinaryOperator* MaskBits = + BinaryOperator::createSub(RepBitWidth, NumBits, "", large); + BinaryOperator* Mask1 = + BinaryOperator::createLShr(RepMask, MaskBits, "", large); + BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large); + new BranchInst(small, large); + + // Block "small" + PHINode* Rep3 = new PHINode(RepTy, "", small); + Rep3->reserveOperandSpace(2); + Rep3->addIncoming(Rep2, small); + Rep3->addIncoming(Rep, entry); + CastInst* Rep4 = new ZExtInst(Rep3, ValTy, "", small); + ICmpInst* is_reverse = + new ICmpInst(ICmpInst::ICMP_UGT, Lo, Hi, "", small); + new BranchInst(reverse, forward, is_reverse, small); + + // Block "forward" + Value* t1 = BinaryOperator::createLShr(ValMask, Hi, "", forward); + Value* t2 = BinaryOperator::createShl(t1, Lo, "", forward); + Value* nott2 = BinaryOperator::createXor(t2, ValMask, "", forward); + Value* t3 = BinaryOperator::createShl(Rep4, Lo, "", forward); + Value* t4 = BinaryOperator::createAnd(nott2, Val, "", forward); + Value* FRslt = BinaryOperator::createOr(t3, t4, "", forward); + new ReturnInst(FRslt, forward); + + // Block "reverse" + Value* t5 = BinaryOperator::createShl(ValMask, Lo, "", reverse); + Value* t6 = BinaryOperator::createShl(ValMask, Hi, "", reverse); + Value* t7 = BinaryOperator::createOr(t6, t5, "", reverse); + Value* t8 = BinaryOperator::createXor(t7, ValMask, "", reverse); + Value* t9 = BinaryOperator::createAnd(t8, Val, "", reverse); + Value* t10 = BinaryOperator::createShl(Rep4, Lo, "", reverse); + Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse); + Value* t12 = new ZExtInst(t11, ValTy, "", reverse); + Value* t13 = BinaryOperator::createLShr(Rep4, t12, "",reverse); + Value* t14 = BinaryOperator::createOr(t10, t9, "", reverse); + Value* RRslt = BinaryOperator::createOr(t14, t13, "", reverse); + new ReturnInst(RRslt, reverse); + } + + // Return a call to the implementation function + Value *Args[3]; + Args[0] = CI->getOperand(0); + Args[1] = CI->getOperand(1); + Args[2] = CI->getOperand(2); + Args[3] = CI->getOperand(3); + return new CallInst(F, Args, 4, CI->getName(), CI); +} + void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { Function *Callee = CI->getCalledFunction(); @@ -476,7 +654,11 @@ } case Intrinsic::part_select: - CI->replaceAllUsesWith(LowerBitPartSelect(CI)); + CI->replaceAllUsesWith(LowerPartSelect(CI)); + break; + + case Intrinsic::part_set: + CI->replaceAllUsesWith(LowerPartSet(CI)); break; case Intrinsic::stacksave: From reid at x10sys.com Wed Apr 11 21:49:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704120249.l3C2nBi4005993@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.415 -> 1.416 --- Log message: For PR1284: http://llvm.org/PR1284 : Implement the "part_set" intrinsic. --- Diffs of the changes: (+6 -1) SelectionDAGISel.cpp | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.415 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.416 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.415 Tue Apr 10 21:44:19 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Apr 11 21:48:46 2007 @@ -2691,7 +2691,12 @@ } case Intrinsic::part_select: { // Currently not implemented: just abort - assert(0 && "bit_part_select intrinsic not implemented"); + assert(0 && "part_select intrinsic not implemented"); + abort(); + } + case Intrinsic::part_set: { + // Currently not implemented: just abort + assert(0 && "part_set intrinsic not implemented"); abort(); } case Intrinsic::bswap: From reid at x10sys.com Wed Apr 11 21:49:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:53 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm-dg.exp Message-ID: <200704120249.l3C2nrg8006018@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm-dg.exp updated: 1.16 -> 1.17 --- Log message: Make the shlibext and llvmlibsdir variables accessible. --- Diffs of the changes: (+5 -1) llvm-dg.exp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/test/lib/llvm-dg.exp diff -u llvm/test/lib/llvm-dg.exp:1.16 llvm/test/lib/llvm-dg.exp:1.17 --- llvm/test/lib/llvm-dg.exp:1.16 Wed Apr 11 15:57:39 2007 +++ llvm/test/lib/llvm-dg.exp Wed Apr 11 21:49:30 2007 @@ -1,7 +1,7 @@ proc llvm-runtest { programs } { global srcroot objroot srcdir objdir subdir target_triplet prcontext global llvmgcc llvmgxx global llvmgcc_version llvmgccmajvers - global gccpath gxxpath compile_c compile_cxx link + global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir set timeout 60 @@ -60,6 +60,10 @@ regsub -all {%compile_cxx} $new_runline "$compile_cxx" new_runline #replace %link with C++ link command regsub -all {%link} $new_runline "$link" new_runline + #replace %shlibext with shared library extension + regsub -all {%shlibext} $new_runline "$shlibext" new_runline + #replace %llvmlibsdir with configure library directory + regsub -all {%llvmlibsdir} $new_runline "$llvmlibsdir" new_runline #replace %p with path to source, regsub -all {%p} $new_runline [file join $srcdir $subdir] new_runline #replace %s with filename From reid at x10sys.com Wed Apr 11 21:49:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 11 Apr 2007 21:49:53 -0500 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200704120249.l3C2nrrn006023@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.95 -> 1.96 --- Log message: Make the shlibext and llvmlibsdir variables accessible. --- Diffs of the changes: (+1 -0) Makefile | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.95 llvm/test/Makefile:1.96 --- llvm/test/Makefile:1.95 Wed Apr 11 15:57:39 2007 +++ llvm/test/Makefile Wed Apr 11 21:49:30 2007 @@ -67,6 +67,7 @@ @echo 'set llvmgcc "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp @echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp + @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp From sabre at nondot.org Wed Apr 11 23:15:07 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 23:15:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200704120415.l3C4F7Dx007517@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.388 -> 1.389 --- Log message: Fix mmx paddq, add support for the 'y' register class, though it isn't tested. --- Diffs of the changes: (+5 -1) X86ISelLowering.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.388 llvm/lib/Target/X86/X86ISelLowering.cpp:1.389 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.388 Mon Apr 9 18:31:19 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Wed Apr 11 23:14:49 2007 @@ -321,6 +321,7 @@ setOperationAction(ISD::ADD, MVT::v8i8, Legal); setOperationAction(ISD::ADD, MVT::v4i16, Legal); setOperationAction(ISD::ADD, MVT::v2i32, Legal); + setOperationAction(ISD::ADD, MVT::v1i64, Legal); setOperationAction(ISD::SUB, MVT::v8i8, Legal); setOperationAction(ISD::SUB, MVT::v4i16, Legal); @@ -4636,7 +4637,10 @@ else if (VT == MVT::i8) return std::make_pair(0U, X86::GR8RegisterClass); break; - // FIXME: not handling MMX registers yet ('y' constraint). + case 'y': // MMX_REGS if MMX allowed. + if (!Subtarget->hasMMX()) break; + return std::make_pair(0U, X86::VR64RegisterClass); + break; case 'Y': // SSE_REGS if SSE2 allowed if (!Subtarget->hasSSE2()) break; // FALL THROUGH. From sabre at nondot.org Wed Apr 11 23:44:45 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 11 Apr 2007 23:44:45 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200704120444.l3C4ijkU008098@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.107 -> 1.108 --- Log message: Fix weirdness handling single element vectors. --- Diffs of the changes: (+2 -5) TargetLowering.cpp | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.107 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.108 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.107 Mon Apr 9 18:34:08 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Apr 11 23:44:28 2007 @@ -303,12 +303,9 @@ NumVectorRegs <<= 1; } - MVT::ValueType VT; - if (NumElts == 1) { + MVT::ValueType VT = getVectorType(EltTy, NumElts); + if (!isTypeLegal(VT)) VT = EltTy; - } else { - VT = getVectorType(EltTy, NumElts); - } PTyElementVT = VT; MVT::ValueType DestVT = getTypeToTransformTo(VT); From reid at x10sys.com Thu Apr 12 00:17:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:17:26 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120517.l3C5HQv5008692@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.62 -> 1.63 --- Log message: Add link to Chris' "Name That Compiler" email. --- Diffs of the changes: (+13 -5) DevMtgMay2007.html | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.62 llvm-www/DevMtgMay2007.html:1.63 --- llvm-www/DevMtgMay2007.html:1.62 Wed Apr 11 21:19:16 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:17:09 2007 @@ -42,10 +42,14 @@ LLVM Developers Mail List indicating that you'd like to attend. Your name will be added below. -

    CALL FOR PRESENTATIONS: This meeting is for you and by you. If you - have an LLVM related topic idea (even if you don't plan to present it), - please send it in. We need work group topics as well as people who would - like to present something. No idea is a bad one!

    +

    NAME THAT COMPILER!: As mentioned in Chris Lattner's + email, + we are looking for an umbrella name for the collection of compiler and virtual + machine related things that we call LLVM today. Here's your chance to win a + prize! See Chris' + email + for details.

    +

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you pre-order your size. Send your size (S,M,L,XL) to Reid Spencer so they can be @@ -55,6 +59,10 @@ you to make a donation to LLVM. 100% of those donations will be used to further sponsor LLVM progress. If you want a T-Shirt but can't make it to the meeting, please let Reid know. You will have to pay for shipping.

    +

    CALL FOR PRESENTATIONS: This meeting is for you and by you. If you + have an LLVM related topic idea (even if you don't plan to present it), + please send it in. We need work group topics as well as people who would + like to present something. No idea is a bad one!

    @@ -327,6 +335,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 02:19:16 $ +
    Last modified: $Date: 2007/04/12 05:17:09 $ From reid at x10sys.com Thu Apr 12 00:29:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:29:05 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120529.l3C5T57Z008919@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.63 -> 1.64 --- Log message: Add more for naming content. --- Diffs of the changes: (+26 -2) DevMtgMay2007.html | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.63 llvm-www/DevMtgMay2007.html:1.64 --- llvm-www/DevMtgMay2007.html:1.63 Thu Apr 12 00:17:09 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:28:48 2007 @@ -21,6 +21,7 @@
  • Attendees
  • +
  • Name That Compiler!
  • @@ -48,7 +49,7 @@ machine related things that we call LLVM today. Here's your chance to win a prize! See Chris' email - for details.

    + for details. We'll keep track of the proposed names here.

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you pre-order your size. Send your size (S,M,L,XL) to @@ -173,6 +174,10 @@ and Expected Release would give new users an idea of what is being worked on. The details of each new feature could be tracked in Bugzilla. + Reid SpencerPick a name for LLVM + - We would like to resolve this. If there's a clear winner (show of hands) + then we'll adopt it, otherwise we'll keep waiting for the perfect + name @@ -329,12 +334,31 @@ +

    +
    +

    To help with the naming, we'll keep track of all ideas here. This goes + along with the brain-storming rule: there are no bad ideas. So, send + your entries to llvmdev and I'll add + them here. We'll use this list to discuss the name at the meeting.

    + + + + + + +
    Proposed New Names For LLVM
    WhoNameDescription
    Jeff CohenIlluviumMeaningless word that retains + LLVM letters. We already own the domain. Also connotes "illumination".
    Reid Spencer + AlluviumThe layers of sediment deposited by a river. Also retains the LLVM + letters but is a word and connotes "bed rock" and fluidity
    +
    + +
    Valid CSS! Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:17:09 $ +
    Last modified: $Date: 2007/04/12 05:28:48 $
    From reid at x10sys.com Thu Apr 12 00:37:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:37:42 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120537.l3C5bgMH009098@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.64 -> 1.65 --- Log message: Add a spot for the logo. --- Diffs of the changes: (+7 -4) DevMtgMay2007.html | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.64 llvm-www/DevMtgMay2007.html:1.65 --- llvm-www/DevMtgMay2007.html:1.64 Thu Apr 12 00:28:48 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:37:24 2007 @@ -341,14 +341,17 @@ your entries to llvmdev and I'll add them here. We'll use this list to discuss the name at the meeting.

    - - + + + + letters but is a word and connotes "bed rock" and fluidity + +
    Proposed New Names For LLVM
    WhoNameDescription
    Proposed New Names For LLVM
    WhoNameDescriptionLogo
    Jeff CohenIlluviumMeaningless word that retains LLVM letters. We already own the domain. Also connotes "illumination".
    Reid Spencer AlluviumNone Proposed The layers of sediment deposited by a river. Also retains the LLVM - letters but is a word and connotes "bed rock" and fluidity
    None Proposed
    @@ -359,6 +362,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:28:48 $ +
    Last modified: $Date: 2007/04/12 05:37:24 $ From reid at x10sys.com Thu Apr 12 00:39:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:39:09 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120539.l3C5d9mQ009181@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.65 -> 1.66 --- Log message: Unbreak the name table. --- Diffs of the changes: (+3 -3) DevMtgMay2007.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.65 llvm-www/DevMtgMay2007.html:1.66 --- llvm-www/DevMtgMay2007.html:1.65 Thu Apr 12 00:37:24 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:38:52 2007 @@ -344,10 +344,10 @@ Proposed New Names For LLVM WhoNameDescriptionLogo Jeff CohenIlluviumMeaningless word that retains - LLVM letters. We already own the domain. Also connotes "illumination". + LLVM letters. We already own the domain. Also connotes "illumination". + None Proposed Reid Spencer Alluvium - None Proposed The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity None Proposed @@ -362,6 +362,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:37:24 $ +
    Last modified: $Date: 2007/04/12 05:38:52 $ From reid at x10sys.com Thu Apr 12 00:49:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:49:16 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120549.l3C5nG0d009384@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.66 -> 1.67 --- Log message: Put in some naming rules. --- Diffs of the changes: (+20 -2) DevMtgMay2007.html | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.66 llvm-www/DevMtgMay2007.html:1.67 --- llvm-www/DevMtgMay2007.html:1.66 Thu Apr 12 00:38:52 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:48:58 2007 @@ -339,7 +339,25 @@

    To help with the naming, we'll keep track of all ideas here. This goes along with the brain-storming rule: there are no bad ideas. So, send your entries to llvmdev and I'll add - them here. We'll use this list to discuss the name at the meeting.

    + them here (or add them yourself). We'll use this list to discuss the name + at the meeting.

    +

    We have a few objectives and rules we've already decided upon for the + name: +

      +
    • /LLVM suffix. We need to keep /LLVM at the end of the name for + some time (years) so that we do not lose the brand association we've + developed with LLVM.
    • +
    • Avoid VM. We would like to avoid "VM" in the name. Because of the + /LLVM suffix it would be redundant for some period of time. Also, while the + project will retain components that allow you to make a VM, it isn't really + "just" a VM, its much more. In other words, labelling the project VM is + too limiting. The projects scope has outstripped being just a VM.
    • +
    • Figurative. We would like to stay away from acronyms unless a + really good one comes along. We don't want to replace LLVM with another + acronym that outdates itself in a few years. Instead a name that is + metaphorical or figurative or otherwise conjures up the notion of LLVM would + be best.
    • +

    @@ -362,6 +380,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:38:52 $ +
    Last modified: $Date: 2007/04/12 05:48:58 $ From reid at x10sys.com Thu Apr 12 00:55:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 00:55:50 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120555.l3C5toWU009553@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.67 -> 1.68 --- Log message: Link to Illuvium wikipedia page. --- Diffs of the changes: (+6 -4) DevMtgMay2007.html | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.67 llvm-www/DevMtgMay2007.html:1.68 --- llvm-www/DevMtgMay2007.html:1.67 Thu Apr 12 00:48:58 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 00:55:31 2007 @@ -361,9 +361,11 @@
    Proposed New Names For LLVM
    WhoNameDescriptionLogo
    - - + + - - A portmanteau from + +
    Proposed New Names For LLVM
    WhoNameDescriptionLogo
    Jeff CohenIlluviumMeaningless word that retains - LLVM letters. We already own the domain. Also connotes "illumination".None Proposed
    Jeff Cohen + IlluviumMaterial displaced across a soil profile, from one layer to another + one, by the action of rainwater. Retains the LLVM letters. We already + own the domain. Also connotes "illumination".None Proposed
    Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM @@ -380,6 +382,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:48:58 $ +
    Last modified: $Date: 2007/04/12 05:55:31 $ From sabre at nondot.org Thu Apr 12 00:58:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Apr 2007 00:58:38 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll Message-ID: <200704120558.l3C5wcCv009696@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: 2007-04-11-InlineAsmVectorResult.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+21 -0) 2007-04-11-InlineAsmVectorResult.ll | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+) Index: llvm/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll diff -c /dev/null llvm/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll:1.1 *** /dev/null Thu Apr 12 00:58:31 2007 --- llvm/test/CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll Thu Apr 12 00:58:21 2007 *************** *** 0 **** --- 1,21 ---- + ; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah + 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" + target triple = "i686-apple-darwin8" + + define void @test(<4 x float> %tmp42i) { + %tmp42 = call <4 x float> asm "movss $1, $0", "=x,m,~{dirflag},~{fpsr},~{flags}"( float* null ) ; <<4 x float>> [#uses=1] + %tmp49 = shufflevector <4 x float> %tmp42, <4 x float> undef, <4 x i32> zeroinitializer ; <<4 x float>> [#uses=1] + br label %bb + + bb: ; preds = %bb, %cond_true10 + %tmp52 = bitcast <4 x float> %tmp49 to <4 x i32> ; <<4 x i32>> [#uses=1] + %tmp53 = call <4 x i32> @llvm.x86.sse2.psll.d( <4 x i32> %tmp52, <4 x i32> < i32 8, i32 undef, i32 undef, i32 undef > ) ; <<4 x i32>> [#uses=1] + %tmp105 = bitcast <4 x i32> %tmp53 to <4 x float> ; <<4 x float>> [#uses=1] + %tmp108 = sub <4 x float> zeroinitializer, %tmp105 ; <<4 x float>> [#uses=0] + br label %bb + + return: ; preds = %entry + ret void + } + + declare <4 x i32> @llvm.x86.sse2.psll.d(<4 x i32>, <4 x i32>) From sabre at nondot.org Thu Apr 12 00:59:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Apr 2007 00:59:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200704120559.l3C5x0xG009712@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.396 -> 1.397 --- Log message: fold noop vbitconvert instructions --- Diffs of the changes: (+9 -0) SelectionDAG.cpp | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.396 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.397 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.396 Mon Apr 9 00:23:13 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Apr 12 00:58:43 2007 @@ -1484,6 +1484,15 @@ MVT::getVectorNumElements(VT) == N3.getNumOperands() && "Illegal VECTOR_SHUFFLE node!"); break; + case ISD::VBIT_CONVERT: + // Fold vbit_convert nodes from a type to themselves. + if (N1.getValueType() == MVT::Vector) { + assert(isa(*(N1.Val->op_end()-2)) && + isa(*(N1.Val->op_end()-1)) && "Malformed vector input!"); + if (*(N1.Val->op_end()-2) == N2 && *(N1.Val->op_end()-1) == N3) + return N1; + } + break; } // Memoize node if it doesn't produce a flag. From sabre at nondot.org Thu Apr 12 01:00:37 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Apr 2007 01:00:37 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704120600.l3C60b4P009792@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.416 -> 1.417 --- Log message: the result of an inline asm copy can be an arbitrary VT that the register class supports. In the case of vectors, this means we often get the wrong type (e.g. we get v4f32 instead of v8i16). Make sure to convert the vector result to the right type. This fixes CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll --- Diffs of the changes: (+21 -4) SelectionDAGISel.cpp | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.416 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.417 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.416 Wed Apr 11 21:48:46 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Apr 12 01:00:20 2007 @@ -3055,9 +3055,10 @@ // how to maintain the constraint. If it isn't, go ahead and create vreg // and let the regalloc do the right thing. if (!isOutReg || !isInReg) { - if (VT == MVT::Other) - ValueVT = *PhysReg.second->vt_begin(); RegVT = *PhysReg.second->vt_begin(); + + if (VT == MVT::Other) + ValueVT = RegVT; // Create the appropriate number of virtual registers. SSARegMap *RegMap = DAG.getMachineFunction().getSSARegMap(); @@ -3459,8 +3460,24 @@ // If this asm returns a register value, copy the result from that register // and set it as the value of the call. - if (!RetValRegs.Regs.empty()) - setValue(&I, RetValRegs.getCopyFromRegs(DAG, Chain, Flag)); + if (!RetValRegs.Regs.empty()) { + SDOperand Val = RetValRegs.getCopyFromRegs(DAG, Chain, Flag); + + // If the result of the inline asm is a vector, it may have the wrong + // width/num elts. Make sure to convert it to the right type with + // vbit_convert. + if (Val.getValueType() == MVT::Vector) { + const VectorType *VTy = cast(I.getType()); + unsigned DesiredNumElts = VTy->getNumElements(); + MVT::ValueType DesiredEltVT = TLI.getValueType(VTy->getElementType()); + + Val = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, Val, + DAG.getConstant(DesiredNumElts, MVT::i32), + DAG.getValueType(DesiredEltVT)); + } + + setValue(&I, Val); + } std::vector > StoresToEmit; From reid at x10sys.com Thu Apr 12 01:11:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 01:11:34 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120611.l3C6BYhh010104@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.68 -> 1.69 --- Log message: Made up names and portmanteaux. --- Diffs of the changes: (+9 -1) DevMtgMay2007.html | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.68 llvm-www/DevMtgMay2007.html:1.69 --- llvm-www/DevMtgMay2007.html:1.68 Thu Apr 12 00:55:31 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 01:11:17 2007 @@ -357,6 +357,14 @@ acronym that outdates itself in a few years. Instead a name that is metaphorical or figurative or otherwise conjures up the notion of LLVM would be best. +
  • Made Up Names. You can also just make up a name. Some of the best + brands have been + portmanteau words + (combining two or more words or phonemes to produce a new word). For + example, a combination spoon/fork leads to spork. Infomercial is another + example. So can you find the perfect portmanteau words that describe this + project? You can find a big list of examlpes + here
  • @@ -382,6 +390,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 05:55:31 $ +
    Last modified: $Date: 2007/04/12 06:11:17 $ From reid at x10sys.com Thu Apr 12 01:18:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 01:18:43 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120618.l3C6IhGp010269@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.69 -> 1.70 --- Log message: Add a portmanteau --- Diffs of the changes: (+4 -2) DevMtgMay2007.html | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.69 llvm-www/DevMtgMay2007.html:1.70 --- llvm-www/DevMtgMay2007.html:1.69 Thu Apr 12 01:11:17 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 01:18:26 2007 @@ -379,7 +379,9 @@ - + A portmanteau from + optimization and utopia +
    Proposed New Names For LLVM
    The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity None Proposed
    Reid SpencerOptopiaNone Proposed
    @@ -390,6 +392,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 06:11:17 $ +
    Last modified: $Date: 2007/04/12 06:18:26 $ From reid at x10sys.com Thu Apr 12 01:19:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 01:19:53 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704120619.l3C6JrO7010375@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.70 -> 1.71 --- Log message: Add missing tag. --- Diffs of the changes: (+3 -3) DevMtgMay2007.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.70 llvm-www/DevMtgMay2007.html:1.71 --- llvm-www/DevMtgMay2007.html:1.70 Thu Apr 12 01:18:26 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 01:19:36 2007 @@ -378,8 +378,8 @@ Alluvium
    The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidityNone Proposed
    Reid SpencerOptopiaNone Proposed
    Reid SpencerOptopiaA portmanteau from optimization and utopia None Proposed
    @@ -392,6 +392,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 06:18:26 $ +
    Last modified: $Date: 2007/04/12 06:19:36 $ From baldrick at free.fr Thu Apr 12 04:19:42 2007 From: baldrick at free.fr (Duncan Sands) Date: Thu, 12 Apr 2007 11:19:42 +0200 Subject: [llvm-commits] llvm-gcc: don't crash when emitting debug info for a field at a variable offset In-Reply-To: <200704112322.26133.baldrick@free.fr> References: <200704112322.26133.baldrick@free.fr> Message-ID: <200704121119.43089.baldrick@free.fr> > If a field in a record is at a variable offset from > the start of the record, then DebugInfo::getOrCreateType > crashes at this line > MemberDesc->setOffset(int_bit_position(Member)); > since the bit-offset is not an integer constant. Fixed > by using 0 for the offset in this case - which is a cop > out, but doing anything else seems hard. This is what > gcc does too. After thinking about this some more, I reckon it's better not to emit debug info for such fields at all. What's the point of be able to access a field if it's accessing the wrong memory (which is what you get by using offset 0)? My experience with gcc is that it's just confusing when, in gdb, you print the contents of a struct and see a bunch of fields with bogus values. The attached patch simply skips over fields at a variable offset. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: var_debug.diff Type: text/x-diff Size: 729 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070412/c118d372/attachment.bin From reid at x10sys.com Thu Apr 12 06:16:23 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:16:23 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121116.l3CBGNXv024575@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.71 -> 1.72 --- Log message: Add several new naming entries. --- Diffs of the changes: (+32 -7) DevMtgMay2007.html | 39 ++++++++++++++++++++++++++++++++------- 1 files changed, 32 insertions(+), 7 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.71 llvm-www/DevMtgMay2007.html:1.72 --- llvm-www/DevMtgMay2007.html:1.71 Thu Apr 12 01:19:36 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:16:06 2007 @@ -368,21 +368,46 @@

    - + + own the domain. Also connotes "illumination". - + letters but is a word and connotes "bed rock" and fluidity - + optimization and utopia + + + + + + + +
    Proposed New Names For LLVM
    WhoNameDescriptionLogo
    WhoNameDescription
    Jeff Cohen Illuvium Material displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already - own the domain. Also connotes "illumination".None Proposed
    Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM - letters but is a word and connotes "bed rock" and fluidityNone Proposed
    Reid SpencerOptopiaA portmanteau from - optimization and utopiaNone Proposed
    Bill WndingZemblaIt's a fictional northern European + country in "Pale Fire" by Nabokov.
    Bill WndingPalaThe island utopia in Aldos + Huxley's "Island".
    Bill WndingThraThe world of The Dark + Crystal.
    Patrick MeredithInvictusunconquerable, and + Invictus.org doesn't appear to exist.
    Gabor GriefOtimoIt is a portuguese word, + meaning optimal, perfect. It is also different enough from plain english words + to give a distinguished feel :-) and catch the eyes. The domains + otimo.org and otimo.info are both available. Last, but not least + it is a boon to the several LLVM developers of portuguese + tongue.
    Owen AndersonWarloc or WarlockIt can be thought + of as standing for "We aren't like other compilers," but that doesn't + have to be pointed out, as it's also a word on its own. It has a + sense of being something powerful and/or magical, and should be + feasible to make a logo to go along with.
    Erick TryzelaarlcsFor language compiling system. + It's suggestive of an old name, easy to remember, easy to say, and seems + to be easy to google. "Advanced" could be prepended to it to make it + ALCS to make it even more unique.
    OmniC or Omnipiler or OmnicomStands for + "Omnipotent Compiler". I prefer the first.
    +

    NOTE: Logos will need to be developed as well. If you have that + talent, please send a JPEG/GIF to go with your name idea.

    @@ -392,6 +417,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 06:19:36 $ +
    Last modified: $Date: 2007/04/12 11:16:06 $ From reid at x10sys.com Thu Apr 12 06:18:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:18:20 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121118.l3CBIKpn024662@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.72 -> 1.73 --- Log message: Try out some highlighting --- Diffs of the changes: (+6 -6) DevMtgMay2007.html | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.72 llvm-www/DevMtgMay2007.html:1.73 --- llvm-www/DevMtgMay2007.html:1.72 Thu Apr 12 06:16:06 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:18:02 2007 @@ -386,24 +386,24 @@ Huxley's "Island". Bill WndingThraThe world of The Dark Crystal. - Patrick MeredithInvictusunconquerable, and + Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist. - Gabor GriefOtimoIt is a portuguese word, + Gabor GriefOtimoIt is a portuguese word, meaning optimal, perfect. It is also different enough from plain english words to give a distinguished feel :-) and catch the eyes. The domains otimo.org and otimo.info are both available. Last, but not least it is a boon to the several LLVM developers of portuguese tongue. - Owen AndersonWarloc or WarlockIt can be thought + Owen AndersonWarloc
    WarlockIt can be thought of as standing for "We aren't like other compilers," but that doesn't have to be pointed out, as it's also a word on its own. It has a sense of being something powerful and/or magical, and should be feasible to make a logo to go along with. - Erick TryzelaarlcsFor language compiling system. + Erick TryzelaarLCSFor language compiling system. It's suggestive of an old name, easy to remember, easy to say, and seems to be easy to google. "Advanced" could be prepended to it to make it ALCS to make it even more unique. - OmniC or Omnipiler or OmnicomStands for + OmniC or Omnipiler or OmnicomStands for "Omnipotent Compiler". I prefer the first.

    NOTE: Logos will need to be developed as well. If you have that @@ -417,6 +417,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:16:06 $ +
    Last modified: $Date: 2007/04/12 11:18:02 $ From reid at x10sys.com Thu Apr 12 06:20:30 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:20:30 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121120.l3CBKUqQ024802@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.73 -> 1.74 --- Log message: Finish highlighting. --- Diffs of the changes: (+10 -10) DevMtgMay2007.html | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.73 llvm-www/DevMtgMay2007.html:1.74 --- llvm-www/DevMtgMay2007.html:1.73 Thu Apr 12 06:18:02 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:20:13 2007 @@ -369,22 +369,22 @@ - + - + + Alluvium - - - - @@ -403,7 +403,7 @@ It's suggestive of an old name, easy to remember, easy to say, and seems to be easy to google. "Advanced" could be prepended to it to make it ALCS to make it even more unique. - Zhongxing Xu
    Proposed New Names For LLVM
    WhoNameDescription
    Jeff Cohen - Illuvium
    Jeff Cohen + Illuvium Material displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already own the domain. Also connotes "illumination".
    Reid Spencer - Alluvium
    Reid SpencerThe layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity
    Reid SpencerOptopiaA portmanteau from +
    Reid SpencerOptopiaA portmanteau from optimization and utopia
    Bill WndingZemblaIt's a fictional northern European +
    Bill WndingZemblaIt's a fictional northern European country in "Pale Fire" by Nabokov.
    Bill WndingPalaThe island utopia in Aldos +
    Bill WndingPalaThe island utopia in Aldos Huxley's "Island".
    Bill WndingThraThe world of The Dark +
    Bill WndingThraThe world of The Dark Crystal.
    Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist.
    OmniC or Omnipiler or OmnicomStands for +
    OmniC
    Omnipiler
    Omnicom
    Stands for "Omnipotent Compiler". I prefer the first.

    NOTE: Logos will need to be developed as well. If you have that @@ -417,6 +417,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:18:02 $ +
    Last modified: $Date: 2007/04/12 11:20:13 $ From reid at x10sys.com Thu Apr 12 06:21:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:21:40 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121121.l3CBLeOx024885@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.74 -> 1.75 --- Log message: Fix table botch. --- Diffs of the changes: (+3 -3) DevMtgMay2007.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.74 llvm-www/DevMtgMay2007.html:1.75 --- llvm-www/DevMtgMay2007.html:1.74 Thu Apr 12 06:20:13 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:21:22 2007 @@ -374,7 +374,7 @@ Material displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already own the domain. Also connotes "illumination". - Reid Spencer + Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity @@ -403,7 +403,7 @@ It's suggestive of an old name, easy to remember, easy to say, and seems to be easy to google. "Advanced" could be prepended to it to make it ALCS to make it even more unique. - Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for + Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for "Omnipotent Compiler". I prefer the first.

    NOTE: Logos will need to be developed as well. If you have that @@ -417,6 +417,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:20:13 $ +
    Last modified: $Date: 2007/04/12 11:21:22 $ From reid at x10sys.com Thu Apr 12 06:32:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:32:20 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121132.l3CBWKBM025115@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.75 -> 1.76 --- Log message: Add NYAC --- Diffs of the changes: (+5 -1) DevMtgMay2007.html | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.75 llvm-www/DevMtgMay2007.html:1.76 --- llvm-www/DevMtgMay2007.html:1.75 Thu Apr 12 06:21:22 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:32:02 2007 @@ -405,6 +405,10 @@ ALCS to make it even more unique. Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for "Omnipotent Compiler". I prefer the first. + Reid SpencerNYACAlong Owen's idea: "Not Your + Average Compiler" (BooBoo!). An acronym that you can pronounce. + Unfortunately, the New York Athletic Club wouldn't like us stealing + their domain. :)

    NOTE: Logos will need to be developed as well. If you have that talent, please send a JPEG/GIF to go with your name idea.

    @@ -417,6 +421,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:21:22 $ +
    Last modified: $Date: 2007/04/12 11:32:02 $ From reid at x10sys.com Thu Apr 12 06:53:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:53:25 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121153.l3CBrPJS025476@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.76 -> 1.77 --- Log message: Add a note about connotations of the name. --- Diffs of the changes: (+6 -1) DevMtgMay2007.html | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.76 llvm-www/DevMtgMay2007.html:1.77 --- llvm-www/DevMtgMay2007.html:1.76 Thu Apr 12 06:32:02 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:53:08 2007 @@ -365,6 +365,11 @@ example. So can you find the perfect portmanteau words that describe this project? You can find a big list of examlpes here +
  • Connotations. The name should have a connotation that is + descriptive of the project as a whole. Some connotations that would be + appropriate are: components, fast, toolkit, optimizing, languages, building + blocks, etc. Many other characteristics could apply, these are just a + few.
  • @@ -421,6 +426,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:32:02 $ +
    Last modified: $Date: 2007/04/12 11:53:08 $ From reid at x10sys.com Thu Apr 12 06:57:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:57:17 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121157.l3CBvH4t025596@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.77 -> 1.78 --- Log message: Add Duncan's ideas. --- Diffs of the changes: (+5 -1) DevMtgMay2007.html | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.77 llvm-www/DevMtgMay2007.html:1.78 --- llvm-www/DevMtgMay2007.html:1.77 Thu Apr 12 06:53:08 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:57:00 2007 @@ -414,6 +414,10 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) + Portmanteau of optimizing and + library + As in the vrooming of a motorcycle + engine.
    Proposed New Names For LLVM
    Duncan SandsOptLib
    Duncan Sandsllvroom

    NOTE: Logos will need to be developed as well. If you have that talent, please send a JPEG/GIF to go with your name idea.

    @@ -426,6 +430,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:53:08 $ +
    Last modified: $Date: 2007/04/12 11:57:00 $ From reid at x10sys.com Thu Apr 12 06:58:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 06:58:31 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121158.l3CBwVxw025676@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.78 -> 1.79 --- Log message: Use the right tags! --- Diffs of the changes: (+4 -4) DevMtgMay2007.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.78 llvm-www/DevMtgMay2007.html:1.79 --- llvm-www/DevMtgMay2007.html:1.78 Thu Apr 12 06:57:00 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:58:14 2007 @@ -410,13 +410,13 @@ ALCS to make it even more unique. Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for "Omnipotent Compiler". I prefer the first. - Reid SpencerNYACAlong Owen's idea: "Not Your + Reid SpencerNYACAlong Owen's idea: "Not Your Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) - Duncan SandsOptLibPortmanteau of optimizing and + Duncan SandsOptLibPortmanteau of optimizing and library - Duncan SandsllvroomAs in the vrooming of a motorcycle + Duncan SandsllvroomAs in the vrooming of a motorcycle engine.

    NOTE: Logos will need to be developed as well. If you have that @@ -430,6 +430,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:57:00 $ +
    Last modified: $Date: 2007/04/12 11:58:14 $ From reid at x10sys.com Thu Apr 12 07:00:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:00:06 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121200.l3CC06NI025766@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.79 -> 1.80 --- Log message: Okay, there's a reason I'm not a web developer. --- Diffs of the changes: (+4 -4) DevMtgMay2007.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.79 llvm-www/DevMtgMay2007.html:1.80 --- llvm-www/DevMtgMay2007.html:1.79 Thu Apr 12 06:58:14 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 06:59:49 2007 @@ -414,9 +414,9 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) - Duncan SandsOptLibPortmanteau of optimizing and - library - Duncan SandsllvroomAs in the vrooming of a motorcycle + Duncan SandsOptLibPortmanteau of optimizing and + library. + Duncan SandsllvroomAs in the vrooming of a motorcycle engine.

    NOTE: Logos will need to be developed as well. If you have that @@ -430,6 +430,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:58:14 $ +
    Last modified: $Date: 2007/04/12 11:59:49 $ From reid at x10sys.com Thu Apr 12 07:25:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:25:44 -0500 Subject: [llvm-commits] CVS: llvm-www/Funding.html Message-ID: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> Changes in directory llvm-www: Funding.html added (r1.1) --- Log message: Initial content for funding page. --- Diffs of the changes: (+63 -0) Funding.html | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+) Index: llvm-www/Funding.html diff -c /dev/null llvm-www/Funding.html:1.1 *** /dev/null Thu Apr 12 07:25:37 2007 --- llvm-www/Funding.html Thu Apr 12 07:25:27 2007 *************** *** 0 **** --- 1,63 ---- + +

    LLVM Funding
    + + + + + +
    +

    The LLVM project is now accepting donations. Here are some notes about + donating to the LLVM project.

    +

    Funds Usage. Donations are used only to promote the project and + its community. The Oversight Group is responsible + for making decisions on how the funds are utilized. For example, as we start + holding regular meetings the funds could be used to cover expenses of these + meetings.

    +

    Funds Account. Although your donation is sent to UIUC, it is + allocated to a special account just for LLVM. The funds will not be used for + any other purpose.

    +

    Overhead. There is no or very little overhead for the project. This + means that virtually 100% of your donated funds will be used to advance the + project. We are using the facilities of UIUC for managing the funds, doing + the accounting, etc.

    +

    Tax Exempt. Your donations are tax exempt in the United States (and + probably other countries). UIUC is a recognized non-profit organization. + Reciepts are available upon request.

    +

    +

    + + + + +
    +

    By Check

    +

    Right now the only way to donate is by sending a check to:

    +
    +     LLVM Project, c/o Vikram Adve, MS 4235 SC
    +     Department of Computer Science
    +     Thomas M. Siebel Center for Computer Science
    +     201 N Goodwin Ave
    +     Urbana, IL 61801-2302
    +     USA
    +     +1-217-244-2016
    +   
    +

    In the near future we will also accept PayPal donations.

    +
    + +
    +
    + Valid CSS! + Valid HTML 4.01! + + LLVM Compiler Infrastructure
    + Last modified: $Date: 2007/04/12 12:25:27 $ +
    + + From reid at x10sys.com Thu Apr 12 07:30:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:30:12 -0500 Subject: [llvm-commits] CVS: llvm-www/Funding.html Message-ID: <200704121230.l3CCUCke026496@zion.cs.uiuc.edu> Changes in directory llvm-www: Funding.html updated: 1.1 -> 1.2 --- Log message: Fix spellos --- Diffs of the changes: (+2 -2) Funding.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/Funding.html diff -u llvm-www/Funding.html:1.1 llvm-www/Funding.html:1.2 --- llvm-www/Funding.html:1.1 Thu Apr 12 07:25:27 2007 +++ llvm-www/Funding.html Thu Apr 12 07:29:54 2007 @@ -27,7 +27,7 @@ the accounting, etc.

    Tax Exempt. Your donations are tax exempt in the United States (and probably other countries). UIUC is a recognized non-profit organization. - Reciepts are available upon request.

    + Receipts are available upon request.

    @@ -57,7 +57,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/12 12:25:27 $ + Last modified: $Date: 2007/04/12 12:29:54 $ From reid at x10sys.com Thu Apr 12 07:36:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:36:25 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121236.l3CCaPd7026647@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.80 -> 1.81 --- Log message: Fix many spello/typo. --- Diffs of the changes: (+16 -16) DevMtgMay2007.html | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.80 llvm-www/DevMtgMay2007.html:1.81 --- llvm-www/DevMtgMay2007.html:1.80 Thu Apr 12 06:59:49 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 07:36:07 2007 @@ -161,7 +161,7 @@ + tool to identify misoptimizations and bad code gen bugs.
    Suggested ByIssue Description
    Owen AndersonIntegration of HLVM into LLVM - its - future as an LLVM subproject, and plans for making LLVM more accessible + future as an LLVM sub-project, and plans for making LLVM more accessible to scripting and higher level language front ends.
    Christopher LambConcurrency Primitives - for multi-threaded shared memory models. Though I don't claim to be any sort of expert @@ -169,7 +169,7 @@ and discussions and I think it would be worth discussing similar issues with regards to LLVM.
    Reid SpencerDo we want an LLVM road map? - does the - development community care to disclose and maintain advance informationa + development community care to disclose and maintain advance information bout what is being worked on? A page listing Bugzilla #, Title, Owner, and Expected Release would give new users an idea of what is being worked on. The details of each new feature could be tracked in @@ -199,7 +199,7 @@ difficult for those not involved; should there be an LLVM Foundation in our (distant?) future?
    Devang PatelUsing Bugpoint: How to use the bugpoint - tool to identifiy misoptimizations and bad code gen bugs.
    @@ -247,11 +247,11 @@ Cupertino Inn. Here's how to get the best rates with them:

    -
    CheckOut: Before Friday May 25th
    +
    Check Out: Before Friday May 25th
    For weekdays, the negotiated rate is $123.00/night ($185.00 regular). Tell the reservations people that you want the Apple discount as you are attending an Apple meeting.
    -
    CheckOut: Saturday May 26th-28th
    +
    Check Out: Saturday May 26th-28th
    If you are flying in Friday morning and want to stay the weekend then don't mention Apple! Their discount rate of $123.00 applies to any day. However the regular weekend rate is $99.00 so its cheaper to just not @@ -350,11 +350,11 @@
  • Avoid VM. We would like to avoid "VM" in the name. Because of the /LLVM suffix it would be redundant for some period of time. Also, while the project will retain components that allow you to make a VM, it isn't really - "just" a VM, its much more. In other words, labelling the project VM is + "just" a VM, its much more. In other words, labeling the project VM is too limiting. The projects scope has outstripped being just a VM.
  • Figurative. We would like to stay away from acronyms unless a really good one comes along. We don't want to replace LLVM with another - acronym that outdates itself in a few years. Instead a name that is + acronym that out-dates itself in a few years. Instead a name that is metaphorical or figurative or otherwise conjures up the notion of LLVM would be best.
  • Made Up Names. You can also just make up a name. Some of the best @@ -363,7 +363,7 @@ (combining two or more words or phonemes to produce a new word). For example, a combination spoon/fork leads to spork. Infomercial is another example. So can you find the perfect portmanteau words that describe this - project? You can find a big list of examlpes + project? You can find a big list of examples here
  • Connotations. The name should have a connotation that is descriptive of the project as a whole. Some connotations that would be @@ -385,19 +385,19 @@ letters but is a word and connotes "bed rock" and fluidity Reid SpencerOptopiaA portmanteau from optimization and utopia - Bill WndingZemblaIt's a fictional northern European + Bill WendlingZemblaIt's a fictional northern European country in "Pale Fire" by Nabokov. - Bill WndingPalaThe island utopia in Aldos + Bill WendlingPalaThe island utopia in Aldos Huxley's "Island". - Bill WndingThraThe world of The Dark + Bill WendlingThraThe world of The Dark Crystal. Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist. - Gabor GriefOtimoIt is a portuguese word, - meaning optimal, perfect. It is also different enough from plain english words + Gabor GriefOtimoIt is a Portuguese word, + meaning optimal, perfect. It is also different enough from plain English words to give a distinguished feel :-) and catch the eyes. The domains otimo.org and otimo.info are both available. Last, but not least - it is a boon to the several LLVM developers of portuguese + it is a boon to the several LLVM developers of Portuguese tongue. Owen AndersonWarloc
    WarlockIt can be thought of as standing for "We aren't like other compilers," but that doesn't @@ -406,7 +406,7 @@ feasible to make a logo to go along with. Erick TryzelaarLCSFor language compiling system. It's suggestive of an old name, easy to remember, easy to say, and seems - to be easy to google. "Advanced" could be prepended to it to make it + to be easy to Google. "Advanced" could be pre-pended to it to make it ALCS to make it even more unique. Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for "Omnipotent Compiler". I prefer the first. @@ -430,6 +430,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 11:59:49 $ +
    Last modified: $Date: 2007/04/12 12:36:07 $ From reid at x10sys.com Thu Apr 12 07:41:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:41:44 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121241.l3CCfiF3026849@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.81 -> 1.82 --- Log message: Link to funding page. --- Diffs of the changes: (+4 -4) DevMtgMay2007.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.81 llvm-www/DevMtgMay2007.html:1.82 --- llvm-www/DevMtgMay2007.html:1.81 Thu Apr 12 07:36:07 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 07:41:27 2007 @@ -57,9 +57,9 @@ ordered in time for the meeting. The T-shirts will be good quality (heavy cotton) and have a small LLVM related phrase on the front. There is no cost for these T-Shirts as their cost is being donated to LLVM. But we will ask - you to make a donation to LLVM. 100% of those donations will be used to - further sponsor LLVM progress. If you want a T-Shirt but can't make it to the - meeting, please let Reid know. You will have to pay for shipping.

    + you to make a donation to LLVM. If you want + a T-Shirt but can't make it to the meeting, please let Reid know. You will + have to pay for shipping only.

    CALL FOR PRESENTATIONS: This meeting is for you and by you. If you have an LLVM related topic idea (even if you don't plan to present it), please send it in. We need work group topics as well as people who would @@ -430,6 +430,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 12:36:07 $ +
    Last modified: $Date: 2007/04/12 12:41:27 $ From reid at x10sys.com Thu Apr 12 07:46:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:46:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704121246.l3CCko8x026981@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.77 -> 1.78 --- Log message: Fix a bug in PartSet. The replacement value needs to be zext or trunc to the size of the value, not just zext. Also, give better names to two BBs. --- Diffs of the changes: (+7 -3) IntrinsicLowering.cpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.77 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.78 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.77 Wed Apr 11 21:48:46 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Thu Apr 12 07:46:33 2007 @@ -512,8 +512,8 @@ BasicBlock* entry = new BasicBlock("entry",F,0); BasicBlock* large = new BasicBlock("large",F,0); BasicBlock* small = new BasicBlock("small",F,0); - BasicBlock* forward = new BasicBlock("cond_true24",F,0); - BasicBlock* reverse = new BasicBlock("cond_next60",F,0); + BasicBlock* forward = new BasicBlock("forward",F,0); + BasicBlock* reverse = new BasicBlock("reverse",F,0); // Block entry (entry) // First, convert Lo and Hi to ValTy bit width @@ -546,7 +546,11 @@ Rep3->reserveOperandSpace(2); Rep3->addIncoming(Rep2, small); Rep3->addIncoming(Rep, entry); - CastInst* Rep4 = new ZExtInst(Rep3, ValTy, "", small); + Value* Rep4 = Rep3; + if (ValBits > RepBits) + Rep4 = new ZExtInst(Rep3, ValTy, "", small); + else if (ValBits < RepBits) + Rep4 = new TruncInst(Rep3, ValTy, "", small); ICmpInst* is_reverse = new ICmpInst(ICmpInst::ICMP_UGT, Lo, Hi, "", small); new BranchInst(reverse, forward, is_reverse, small); From reid at x10sys.com Thu Apr 12 07:53:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 07:53:02 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121253.l3CCr28t027158@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.82 -> 1.83 --- Log message: Add Mithril. --- Diffs of the changes: (+10 -5) DevMtgMay2007.html | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.82 llvm-www/DevMtgMay2007.html:1.83 --- llvm-www/DevMtgMay2007.html:1.82 Thu Apr 12 07:41:27 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 07:52:45 2007 @@ -414,10 +414,15 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) - Duncan SandsOptLibPortmanteau of optimizing and - library. - Duncan SandsllvroomAs in the vrooming of a motorcycle - engine. + Duncan SandsOptLibPortmanteau of optimizing and library. + Duncan SandsllvroomAs in the vrooming of a motorcycle engine. + + Paolo InvernizziMithrilThe fictional metal from + JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. + It could be beaten like copper, and polished like glass; and the Dwarves could + make of it a metal, light and yet harder than tempered steel. Its beauty was like + to that of common silver, but the beauty of mithril did not tarnish or + grow dim."

    NOTE: Logos will need to be developed as well. If you have that talent, please send a JPEG/GIF to go with your name idea.

    @@ -430,6 +435,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 12:41:27 $ +
    Last modified: $Date: 2007/04/12 12:52:45 $ From reid at x10sys.com Thu Apr 12 08:30:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 08:30:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704121330.l3CDUVTA027930@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.78 -> 1.79 --- Log message: Fix bugs in generated code for part_select and part_set so that llc doesn't barf when CBE is run with a program that contains these intrinsics. --- Diffs of the changes: (+45 -36) IntrinsicLowering.cpp | 81 +++++++++++++++++++++++++++----------------------- 1 files changed, 45 insertions(+), 36 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.78 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.79 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.78 Thu Apr 12 07:46:33 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Thu Apr 12 08:30:14 2007 @@ -270,13 +270,14 @@ if (F->isDeclaration()) { // Get the arguments to the function - Value* Val = F->getOperand(0); - Value* Right = F->getOperand(1); - Value* Left = F->getOperand(2); - - // We want to select a range of bits here such that [Left, Right] is shifted - // down to the low bits. However, it is quite possible that Left is smaller - // than Right in which case the bits have to be reversed. + Function::arg_iterator args = F->arg_begin(); + Value* Val = args++; Val->setName("Val"); + Value* Lo = args++; Lo->setName("Lo"); + Value* Hi = args++; Hi->setName("High"); + + // We want to select a range of bits here such that [Hi, Lo] is shifted + // down to the low bits. However, it is quite possible that Hi is smaller + // than Lo in which case the bits have to be reversed. // Create the blocks we will need for the two cases (forward, reverse) BasicBlock* CurBB = new BasicBlock("entry", F); @@ -286,12 +287,12 @@ BasicBlock *Reverse = new BasicBlock("reverse", CurBB->getParent()); BasicBlock *RsltBlk = new BasicBlock("result", CurBB->getParent()); - // Cast Left and Right to the size of Val so the widths are all the same - if (Left->getType() != Val->getType()) - Left = CastInst::createIntegerCast(Left, Val->getType(), false, + // Cast Hi and Lo to the size of Val so the widths are all the same + if (Hi->getType() != Val->getType()) + Hi = CastInst::createIntegerCast(Hi, Val->getType(), false, "tmp", CurBB); - if (Right->getType() != Val->getType()) - Right = CastInst::createIntegerCast(Right, Val->getType(), false, + if (Lo->getType() != Val->getType()) + Lo = CastInst::createIntegerCast(Lo, Val->getType(), false, "tmp", CurBB); // Compute a few things that both cases will need, up front. @@ -299,23 +300,23 @@ Constant* One = ConstantInt::get(Val->getType(), 1); Constant* AllOnes = ConstantInt::getAllOnesValue(Val->getType()); - // Compare the Left and Right bit positions. This is used to determine + // Compare the Hi and Lo bit positions. This is used to determine // which case we have (forward or reverse) - ICmpInst *Cmp = new ICmpInst(ICmpInst::ICMP_ULT, Left, Right, "less",CurBB); + ICmpInst *Cmp = new ICmpInst(ICmpInst::ICMP_ULT, Hi, Lo, "less",CurBB); new BranchInst(RevSize, FwdSize, Cmp, CurBB); // First, copmute the number of bits in the forward case. Instruction* FBitSize = - BinaryOperator::createSub(Left, Right,"fbits", FwdSize); + BinaryOperator::createSub(Hi, Lo,"fbits", FwdSize); new BranchInst(Compute, FwdSize); // Second, compute the number of bits in the reverse case. Instruction* RBitSize = - BinaryOperator::createSub(Right, Left, "rbits", RevSize); + BinaryOperator::createSub(Lo, Hi, "rbits", RevSize); new BranchInst(Compute, RevSize); // Now, compute the bit range. Start by getting the bitsize and the shift - // amount (either Left or Right) from PHI nodes. Then we compute a mask for + // amount (either Hi or Lo) from PHI nodes. Then we compute a mask for // the number of bits we want in the range. We shift the bits down to the // least significant bits, apply the mask to zero out unwanted high bits, // and we have computed the "forward" result. It may still need to be @@ -327,11 +328,11 @@ BitSize->addIncoming(FBitSize, FwdSize); BitSize->addIncoming(RBitSize, RevSize); - // Get the ShiftAmount as the smaller of Left/Right + // Get the ShiftAmount as the smaller of Hi/Lo PHINode *ShiftAmt = new PHINode(Val->getType(), "shiftamt", Compute); ShiftAmt->reserveOperandSpace(2); - ShiftAmt->addIncoming(Right, FwdSize); - ShiftAmt->addIncoming(Left, RevSize); + ShiftAmt->addIncoming(Lo, FwdSize); + ShiftAmt->addIncoming(Hi, RevSize); // Increment the bit size Instruction *BitSizePlusOne = @@ -403,9 +404,9 @@ // Return a call to the implementation function Value *Args[3]; - Args[0] = CI->getOperand(0); - Args[1] = CI->getOperand(1); - Args[2] = CI->getOperand(2); + Args[0] = CI->getOperand(1); + Args[1] = CI->getOperand(2); + Args[2] = CI->getOperand(3); return new CallInst(F, Args, 3, CI->getName(), CI); } @@ -516,7 +517,13 @@ BasicBlock* reverse = new BasicBlock("reverse",F,0); // Block entry (entry) - // First, convert Lo and Hi to ValTy bit width + // First, get the number of bits that we're placing as an i32 + ICmpInst* is_forward = + new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry); + SelectInst* Lo_pn = new SelectInst(is_forward, Hi, Lo, "", entry); + SelectInst* Hi_pn = new SelectInst(is_forward, Lo, Hi, "", entry); + BinaryOperator* NumBits = BinaryOperator::createSub(Lo_pn, Hi_pn, "",entry); + // Now, convert Lo and Hi to ValTy bit width if (ValBits > 32) { Hi = new ZExtInst(Hi, ValTy, "", entry); Lo = new ZExtInst(Lo, ValTy, "", entry); @@ -524,11 +531,8 @@ Hi = new TruncInst(Hi, ValTy, "", entry); Lo = new TruncInst(Lo, ValTy, "", entry); } - ICmpInst* is_forward = - new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry); - SelectInst* Lo_pn = new SelectInst(is_forward, Hi, Lo, "", entry); - SelectInst* Hi_pn = new SelectInst(is_forward, Lo, Hi, "", entry); - BinaryOperator* NumBits = BinaryOperator::createSub(Lo_pn, Hi_pn, "",entry); + // Determine if the replacement bits are larger than the number of bits we + // are replacing and deal with it. ICmpInst* is_large = new ICmpInst(ICmpInst::ICMP_ULT, NumBits, RepBitWidth, "", entry); new BranchInst(large, small, is_large, entry); @@ -544,7 +548,7 @@ // Block "small" PHINode* Rep3 = new PHINode(RepTy, "", small); Rep3->reserveOperandSpace(2); - Rep3->addIncoming(Rep2, small); + Rep3->addIncoming(Rep2, large); Rep3->addIncoming(Rep, entry); Value* Rep4 = Rep3; if (ValBits > RepBits) @@ -571,9 +575,14 @@ Value* t8 = BinaryOperator::createXor(t7, ValMask, "", reverse); Value* t9 = BinaryOperator::createAnd(t8, Val, "", reverse); Value* t10 = BinaryOperator::createShl(Rep4, Lo, "", reverse); + if (RepBits < ValBits) + RepBitWidth = + cast(ConstantExpr::getZExt(RepBitWidth, ValTy)); + else if (RepBits > ValBits) + RepBitWidth = + cast(ConstantExpr::getTrunc(RepBitWidth, ValTy)); Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse); - Value* t12 = new ZExtInst(t11, ValTy, "", reverse); - Value* t13 = BinaryOperator::createLShr(Rep4, t12, "",reverse); + Value* t13 = BinaryOperator::createLShr(Rep4, t11, "",reverse); Value* t14 = BinaryOperator::createOr(t10, t9, "", reverse); Value* RRslt = BinaryOperator::createOr(t14, t13, "", reverse); new ReturnInst(RRslt, reverse); @@ -581,10 +590,10 @@ // Return a call to the implementation function Value *Args[3]; - Args[0] = CI->getOperand(0); - Args[1] = CI->getOperand(1); - Args[2] = CI->getOperand(2); - Args[3] = CI->getOperand(3); + Args[0] = CI->getOperand(1); + Args[1] = CI->getOperand(2); + Args[2] = CI->getOperand(3); + Args[3] = CI->getOperand(4); return new CallInst(F, Args, 4, CI->getName(), CI); } From reid at x10sys.com Thu Apr 12 09:06:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 09:06:44 -0500 Subject: [llvm-commits] CVS: llvm-www/GSoCProjects.html Message-ID: <200704121406.l3CE6iME028609@zion.cs.uiuc.edu> Changes in directory llvm-www: GSoCProjects.html added (r1.1) --- Log message: Add page for our GSoC projects. --- Diffs of the changes: (+84 -0) GSoCProjects.html | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+) Index: llvm-www/GSoCProjects.html diff -c /dev/null llvm-www/GSoCProjects.html:1.1 *** /dev/null Thu Apr 12 09:06:37 2007 --- llvm-www/GSoCProjects.html Thu Apr 12 09:06:27 2007 *************** *** 0 **** --- 1,84 ---- + + +
    Google Summer of Code Projects
    + + + + + + +
    +

    This year the LLVM project was awarded 4 + Summer of Code (SoC) projects by + Google. In these projects, Google pays the students to work on open source + projects. Thank you, Google!

    +

    This page provides information on the SoC projects that is not availble from + the google site. Additionally, the students will track their progress on this + page.

    +
    + + + + + + +
    + + + + +
    ProjectLLVM Mips Backend
    StudentBruno Cardoso Lopes
    MentorChris Lattner
    +
    + + +
    + + + + +
    ProjectDevelopment of a Parallel Framework for LLVM
    StudentChandler Carruth
    MentorReid Spencer
    +
    + + +
    + + + + +
    ProjectPython Front End To HLVM
    StudentRooslan Khayrov
    MentorReid Spencer
    +
    + + +
    + + + + +
    ProjectUsing LLVM as a back end for QEMU's dynamic binary + translator
    StudentTilmann Scheller
    MentorPaul Brook
    +
    + + + +
    +
    + Valid CSS! + Valid HTML 4.01! + + LLVM Compiler Infrastructure
    + Last modified: $Date: 2007/04/12 14:06:27 $ +
    + + From reid at x10sys.com Thu Apr 12 09:44:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 09:44:55 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121444.l3CEitXu029433@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.83 -> 1.84 --- Log message: Clean up validation errors in links that were changed. Fix Gabor's name (sorry Gabor!). --- Diffs of the changes: (+10 -6) DevMtgMay2007.html | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.83 llvm-www/DevMtgMay2007.html:1.84 --- llvm-www/DevMtgMay2007.html:1.83 Thu Apr 12 07:52:45 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 09:44:38 2007 @@ -33,7 +33,8 @@
  • Why: To get acquainted, learn how LLVM is used, and exchange ideas.
  • Where: Cupertino Inn - - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
  • + - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
  • When: May 25, 2007, 8:00am to 6:00pm
  • Who: Everyone is invited to participate and present. If you would like to present, please send your ideas to @@ -216,11 +217,14 @@ @@ -393,7 +397,7 @@ Crystal. Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist. - Gabor GriefOtimoIt is a Portuguese word, + Gabor GreifOtimoIt is a Portuguese word, meaning optimal, perfect. It is also different enough from plain English words to give a distinguished feel :-) and catch the eyes. The domains otimo.org and otimo.info are both available. Last, but not least @@ -435,6 +439,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 12:52:45 $ +
    Last modified: $Date: 2007/04/12 14:44:38 $ From reid at x10sys.com Thu Apr 12 09:46:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 09:46:17 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121446.l3CEkHar029519@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.84 -> 1.85 --- Log message: Remove spurious end tag. Close an element. --- Diffs of the changes: (+3 -3) DevMtgMay2007.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.84 llvm-www/DevMtgMay2007.html:1.85 --- llvm-www/DevMtgMay2007.html:1.84 Thu Apr 12 09:44:38 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 09:46:00 2007 @@ -346,7 +346,7 @@ them here (or add them yourself). We'll use this list to discuss the name at the meeting.

    We have a few objectives and rules we've already decided upon for the - name: + name:

    • /LLVM suffix. We need to keep /LLVM at the end of the name for some time (years) so that we do not lose the brand association we've @@ -374,7 +374,7 @@ appropriate are: components, fast, toolkit, optimizing, languages, building blocks, etc. Many other characteristics could apply, these are just a few.
    • -

    + @@ -439,6 +439,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 14:44:38 $ +
    Last modified: $Date: 2007/04/12 14:46:00 $ From sabre at nondot.org Thu Apr 12 13:09:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Apr 2007 13:09:26 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/ispositive.ll Message-ID: <200704121809.l3CI9Q4V005701@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: ispositive.ll updated: 1.2 -> 1.3 --- Log message: make this happier on linux hosts --- Diffs of the changes: (+1 -1) ispositive.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Generic/ispositive.ll diff -u llvm/test/CodeGen/Generic/ispositive.ll:1.2 llvm/test/CodeGen/Generic/ispositive.ll:1.3 --- llvm/test/CodeGen/Generic/ispositive.ll:1.2 Wed Apr 11 10:24:04 2007 +++ llvm/test/CodeGen/Generic/ispositive.ll Thu Apr 12 13:09:06 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep shrl.*31 && -; RUN: llvm-as < %s | llc -march=ppc32 | grep 'srwi r3, r3, 31' && +; RUN: llvm-as < %s | llc -march=ppc32 | grep 'srwi r?3, r?3, 31' && ; RUN: llvm-as < %s | llc -march=arm | grep 'mov r0, r0, lsr #31' && ; RUN: llvm-as < %s | llc -march=thumb | grep 'lsr r0, r0, #31' From sabre at nondot.org Thu Apr 12 13:10:33 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 12 Apr 2007 13:10:33 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/ispositive.ll Message-ID: <200704121810.l3CIAXVv005901@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: ispositive.ll updated: 1.3 -> 1.4 --- Log message: make this really work on linux :) --- Diffs of the changes: (+1 -1) ispositive.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/Generic/ispositive.ll diff -u llvm/test/CodeGen/Generic/ispositive.ll:1.3 llvm/test/CodeGen/Generic/ispositive.ll:1.4 --- llvm/test/CodeGen/Generic/ispositive.ll:1.3 Thu Apr 12 13:09:06 2007 +++ llvm/test/CodeGen/Generic/ispositive.ll Thu Apr 12 13:10:16 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep shrl.*31 && -; RUN: llvm-as < %s | llc -march=ppc32 | grep 'srwi r?3, r?3, 31' && +; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep 'srwi r3, r3, 31' && ; RUN: llvm-as < %s | llc -march=arm | grep 'mov r0, r0, lsr #31' && ; RUN: llvm-as < %s | llc -march=thumb | grep 'lsr r0, r0, #31' From baldrick at free.fr Thu Apr 12 13:14:49 2007 From: baldrick at free.fr (Duncan Sands) Date: Thu, 12 Apr 2007 20:14:49 +0200 Subject: [llvm-commits] llvm-gcc: fix bitfield-after-zero-width-struct crash Message-ID: <200704122014.49871.baldrick@free.fr> The assertion was off by one. I tweaked some comments while I was there. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: zero_struct.diff Type: text/x-diff Size: 1145 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070412/22659420/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: testcase.diff Type: text/x-diff Size: 420 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070412/22659420/attachment-0001.bin From reid at x10sys.com Thu Apr 12 13:20:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 13:20:56 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121820.l3CIKuli007486@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.85 -> 1.86 --- Log message: Add Mark Thomas and Jeff Poznanovic. --- Diffs of the changes: (+8 -8) DevMtgMay2007.html | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.85 llvm-www/DevMtgMay2007.html:1.86 --- llvm-www/DevMtgMay2007.html:1.85 Thu Apr 12 09:46:00 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 13:20:39 2007 @@ -280,7 +280,7 @@ +
    Proposed New Names For LLVM
    WhoNameDescription
    - + @@ -298,13 +298,13 @@ +
    Confirmed Attendees (A-Len)
    Confirmed Attendees (A-Ler)
    NameOrganization
    Vikram AdveUIUC
    Bob ArcherAdobe Systems Incorporated.
    Christopher LambAgeia Technologies, Inc.
    Chris LattnerApple Inc.
    Andrew LenharthUIUC
    Julien LerougeApple Inc.
    - + - @@ -313,10 +313,12 @@ + + @@ -324,17 +326,15 @@
    Confirmed Attendees (Ler-Z)
    Confirmed Attendees (Lew-Z)
    NameOrganization
    Julien LerougeApple Inc.
    Nick LewyckyIndependent
    Efrem LipkinCoDesign
    Gabe McArthurIndependent
    Steve NaroffApple Inc.
    Devang PatelApple Inc.
    Fernando Magno Quintao PereiraUCLA
    Jeff PoznanovicCray Inc.
    Ron PriceApple Inc.
    Chuck RoseAdobe Systems Incorporated.
    Mark SchimmelWind River
    Reid SpencerIndependent
    Mark ThomasAerospace
    Sarah ThompsonNASA, Ames Research Center
    Bill WendlingApple Inc.
    Marcel WeiherMetaObject
    -

    Total confirmed: 32

    +

    Total confirmed: 34

    - -
    Unconfirmed Attendees
    NameOrganization
    Lang HamesUniversity of Sydney
    Unconfirmed 2Aerospace
    Unconfirmed 1Wind River
    Unconfirmed 1NASA, Ames
    Unconfirmed 1Cray, Inc.
    -

    Total unconfirmed: 6

    +

    Total unconfirmed: 3

    @@ -439,6 +439,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 14:46:00 $ +
    Last modified: $Date: 2007/04/12 18:20:39 $ From lattner at cs.uiuc.edu Thu Apr 12 13:22:11 2007 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 12 Apr 2007 13:22:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/packed_cmp.ll Message-ID: <200704121822.l3CIMBAw007716@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: packed_cmp.ll (r1.5) removed --- Log message: vector compares aren't allowed. It doesn't make sense to have an xfailed test to remind us of this. --- Diffs of the changes: (+0 -0) 0 files changed From lauro.venancio at gmail.com Thu Apr 12 13:33:24 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200704121833.l3CIXOa4009395@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.100 -> 1.101 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+19 -7) GlobalOpt.cpp | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.100 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.101 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.100 Thu Apr 5 16:09:42 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Thu Apr 12 13:32:50 2007 @@ -390,7 +390,9 @@ assert(In && "Couldn't get element of initializer?"); GlobalVariable *NGV = new GlobalVariable(STy->getElementType(i), false, GlobalVariable::InternalLinkage, - In, GV->getName()+"."+utostr(i)); + In, GV->getName()+"."+utostr(i), + (Module *)NULL, + GV->isThreadLocal()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); } @@ -413,7 +415,9 @@ GlobalVariable *NGV = new GlobalVariable(STy->getElementType(), false, GlobalVariable::InternalLinkage, - In, GV->getName()+"."+utostr(i)); + In, GV->getName()+"."+utostr(i), + (Module *)NULL, + GV->isThreadLocal()); Globals.insert(GV, NGV); NewGlobals.push_back(NGV); } @@ -699,7 +703,9 @@ Constant *Init = UndefValue::get(MI->getAllocatedType()); GlobalVariable *NewGV = new GlobalVariable(MI->getAllocatedType(), false, GlobalValue::InternalLinkage, Init, - GV->getName()+".body"); + GV->getName()+".body", + (Module *)NULL, + GV->isThreadLocal()); GV->getParent()->getGlobalList().insert(GV, NewGV); // Anything that used the malloc now uses the global directly. @@ -714,7 +720,8 @@ // keep track of whether the global was initialized yet or not. GlobalVariable *InitBool = new GlobalVariable(Type::Int1Ty, false, GlobalValue::InternalLinkage, - ConstantInt::getFalse(), GV->getName()+".init"); + ConstantInt::getFalse(), GV->getName()+".init", + (Module *)NULL, GV->isThreadLocal()); bool InitBoolUsed = false; // Loop over all uses of GV, processing them in turn. @@ -943,7 +950,8 @@ GlobalVariable *NGV = new GlobalVariable(PFieldTy, false, GlobalValue::InternalLinkage, Constant::getNullValue(PFieldTy), - GV->getName() + ".f" + utostr(FieldNo), GV); + GV->getName() + ".f" + utostr(FieldNo), GV, + GV->isThreadLocal()); FieldGlobals.push_back(NGV); MallocInst *NMI = new MallocInst(FieldTy, MI->getArraySize(), @@ -1145,7 +1153,9 @@ // Create the new global, initializing it to false. GlobalVariable *NewGV = new GlobalVariable(Type::Int1Ty, false, GlobalValue::InternalLinkage, ConstantInt::getFalse(), - GV->getName()+".b"); + GV->getName()+".b", + (Module *)NULL, + GV->isThreadLocal()); GV->getParent()->getGlobalList().insert(GV, NewGV); Constant *InitVal = GV->getInitializer(); @@ -1519,7 +1529,9 @@ // Create the new global and insert it next to the existing list. GlobalVariable *NGV = new GlobalVariable(CA->getType(), GCL->isConstant(), - GCL->getLinkage(), CA); + GCL->getLinkage(), CA, "", + (Module *)NULL, + GCL->isThreadLocal()); GCL->getParent()->getGlobalList().insert(GCL, NGV); NGV->takeName(GCL); From lauro.venancio at gmail.com Thu Apr 12 13:33:27 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Globals.cpp Message-ID: <200704121833.l3CIXR27009410@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.268 -> 1.269 Globals.cpp updated: 1.18 -> 1.19 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+8 -7) AsmWriter.cpp | 3 ++- Globals.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.268 llvm/lib/VMCore/AsmWriter.cpp:1.269 --- llvm/lib/VMCore/AsmWriter.cpp:1.268 Tue Apr 10 21:44:19 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Thu Apr 12 13:32:50 2007 @@ -878,7 +878,8 @@ case GlobalValue::HiddenVisibility: Out << "hidden "; break; } } - + + if (GV->isThreadLocal()) Out << "thread_local "; Out << (GV->isConstant() ? "constant " : "global "); printType(GV->getType()->getElementType()); Index: llvm/lib/VMCore/Globals.cpp diff -u llvm/lib/VMCore/Globals.cpp:1.18 llvm/lib/VMCore/Globals.cpp:1.19 --- llvm/lib/VMCore/Globals.cpp:1.18 Sun Feb 25 23:02:39 2007 +++ llvm/lib/VMCore/Globals.cpp Thu Apr 12 13:32:50 2007 @@ -81,11 +81,11 @@ //===----------------------------------------------------------------------===// GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link, - Constant *InitVal, - const std::string &Name, Module *ParentModule) + Constant *InitVal, const std::string &Name, + Module *ParentModule, bool ThreadLocal) : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, &Initializer, InitVal != 0, Link, Name), - isConstantGlobal(constant) { + isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { if (InitVal) { assert(InitVal->getType() == Ty && "Initializer should be the same type as the GlobalVariable!"); @@ -101,11 +101,11 @@ } GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link, - Constant *InitVal, - const std::string &Name, GlobalVariable *Before) + Constant *InitVal, const std::string &Name, + GlobalVariable *Before, bool ThreadLocal) : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal, &Initializer, InitVal != 0, Link, Name), - isConstantGlobal(constant) { + isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) { if (InitVal) { assert(InitVal->getType() == Ty && "Initializer should be the same type as the GlobalVariable!"); From lauro.venancio at gmail.com Thu Apr 12 13:33:27 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Message-ID: <200704121833.l3CIXRZ7009414@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.39 -> 1.40 Reader.cpp updated: 1.247 -> 1.248 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+8 -5) Analyzer.cpp | 4 +++- Reader.cpp | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.39 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.40 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.39 Wed Feb 14 21:39:18 2007 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Thu Apr 12 13:32:50 2007 @@ -154,12 +154,14 @@ GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, unsigned SlotNum, - unsigned initSlot + unsigned initSlot, + bool isThreadLocal ) { if (os) { *os << " GV: " << ( initSlot == 0 ? "Uni" : "I" ) << "nitialized, " << ( isConstant? "Constant, " : "Variable, ") + << " Thread Local = " << ( isThreadLocal? "yes, " : "no, ") << " Linkage=" << Linkage << " Visibility="<< Visibility << " Type="; Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.247 llvm/lib/Bytecode/Reader/Reader.cpp:1.248 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.247 Mon Apr 9 15:28:40 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Thu Apr 12 13:32:50 2007 @@ -1704,11 +1704,12 @@ unsigned VarType = read_vbr_uint(); while (VarType != Type::VoidTyID) { // List is terminated by Void // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, bit2,3,4 = - // Linkage, bit4+ = slot# - unsigned SlotNo = VarType >> 5; + // Linkage, bit5 = isThreadLocal, bit6+ = slot# + unsigned SlotNo = VarType >> 6; unsigned LinkageID = (VarType >> 2) & 7; unsigned VisibilityID = 0; bool isConstant = VarType & 1; + bool isThreadLocal = (VarType >> 5) & 1; bool hasInitializer = (VarType & 2) != 0; unsigned Alignment = 0; unsigned GlobalSectionID = 0; @@ -1764,7 +1765,7 @@ // Create the global variable... GlobalVariable *GV = new GlobalVariable(ElTy, isConstant, Linkage, - 0, "", TheModule); + 0, "", TheModule, isThreadLocal); GV->setAlignment(Alignment); GV->setVisibility(Visibility); insertValue(GV, SlotNo, ModuleValues); @@ -1781,7 +1782,7 @@ // Notify handler about the global value. if (Handler) Handler->handleGlobalVariable(ElTy, isConstant, Linkage, Visibility, - SlotNo, initSlot); + SlotNo, initSlot, isThreadLocal); // Get next item VarType = read_vbr_uint(); From lauro.venancio at gmail.com Thu Apr 12 13:33:32 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:32 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/BytecodeHandler.h Message-ID: <200704121833.l3CIXWws009434@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: BytecodeHandler.h updated: 1.17 -> 1.18 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+2 -1) BytecodeHandler.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Bytecode/BytecodeHandler.h diff -u llvm/include/llvm/Bytecode/BytecodeHandler.h:1.17 llvm/include/llvm/Bytecode/BytecodeHandler.h:1.18 --- llvm/include/llvm/Bytecode/BytecodeHandler.h:1.17 Wed Feb 14 20:26:09 2007 +++ llvm/include/llvm/Bytecode/BytecodeHandler.h Thu Apr 12 13:32:50 2007 @@ -112,7 +112,8 @@ GlobalValue::LinkageTypes,///< The linkage type of the GV GlobalValue::VisibilityTypes,///< The visibility style of the GV unsigned SlotNum, ///< Slot number of GV - unsigned initSlot ///< Slot number of GV's initializer (0 if none) + unsigned initSlot, ///< Slot number of GV's initializer (0 if none) + bool isThreadLocal ///< Whether the GV is thread local or not ) {} /// This method is called when a type list is recognized. It simply From lauro.venancio at gmail.com Thu Apr 12 13:33:32 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:32 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/GlobalVariable.h Message-ID: <200704121833.l3CIXWT3009437@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: GlobalVariable.h updated: 1.39 -> 1.40 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+7 -2) GlobalVariable.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.39 llvm/include/llvm/GlobalVariable.h:1.40 --- llvm/include/llvm/GlobalVariable.h:1.39 Tue Jan 30 14:08:38 2007 +++ llvm/include/llvm/GlobalVariable.h Thu Apr 12 13:32:50 2007 @@ -44,6 +44,7 @@ void setPrev(GlobalVariable *N) { Prev = N; } bool isConstantGlobal; // Is this a global constant? + bool isThreadLocalSymbol; // Is this symbol "Thread Local"? Use Initializer; public: @@ -51,12 +52,12 @@ /// automatically inserted into the end of the specified modules global list. GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer = 0, const std::string &Name = "", - Module *Parent = 0); + Module *Parent = 0, bool ThreadLocal = false); /// GlobalVariable ctor - This creates a global and inserts it before the /// specified other global. GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer, const std::string &Name, - GlobalVariable *InsertBefore); + GlobalVariable *InsertBefore, bool ThreadLocal = false); /// isDeclaration - Is this global variable lacking an initializer? If so, /// the global variable is defined in some other translation unit, and is thus @@ -107,6 +108,10 @@ bool isConstant() const { return isConstantGlobal; } void setConstant(bool Value) { isConstantGlobal = Value; } + /// If the value is "Thread Local", its value isn't shared by the threads. + bool isThreadLocal() const { return isThreadLocalSymbol; } + void setThreadLocal(bool Value) { isThreadLocalSymbol = Value; } + /// removeFromParent - This method unlinks 'this' from the containing module, /// but does not delete it. /// From lauro.venancio at gmail.com Thu Apr 12 13:33:33 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200704121833.l3CIXXlc009451@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.171 -> 1.172 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+6 -5) Writer.cpp | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.171 llvm/lib/Bytecode/Writer/Writer.cpp:1.172 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.171 Mon Apr 9 01:14:31 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Thu Apr 12 13:32:50 2007 @@ -950,7 +950,7 @@ "Global must have an initializer or have external linkage!"); // Fields: bit0 = isConstant, bit1 = hasInitializer, bit2-4=Linkage, - // bit5+ = Slot # for type. + // bit5 = isThreadLocal, bit6+ = Slot # for type. bool HasExtensionWord = (I->getAlignment() != 0) || I->hasSection() || (I->getVisibility() != GlobalValue::DefaultVisibility); @@ -958,12 +958,13 @@ // If we need to use the extension byte, set linkage=3(internal) and // initializer = 0 (impossible!). if (!HasExtensionWord) { - unsigned oSlot = (Slot << 5) | (getEncodedLinkage(I) << 2) | - (I->hasInitializer() << 1) | (unsigned)I->isConstant(); + unsigned oSlot = (Slot << 6)| (((unsigned)I->isThreadLocal()) << 5) | + (getEncodedLinkage(I) << 2) | (I->hasInitializer() << 1) + | (unsigned)I->isConstant(); output_vbr(oSlot); } else { - unsigned oSlot = (Slot << 5) | (3 << 2) | - (0 << 1) | (unsigned)I->isConstant(); + unsigned oSlot = (Slot << 6) | (((unsigned)I->isThreadLocal()) << 5) | + (3 << 2) | (0 << 1) | (unsigned)I->isConstant(); output_vbr(oSlot); // The extension word has this format: bit 0 = has initializer, bit 1-3 = From lauro.venancio at gmail.com Thu Apr 12 13:33:33 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200704121833.l3CIXXJC009474@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.138 -> 1.139 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+4 -3) LinkModules.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.138 llvm/lib/Linker/LinkModules.cpp:1.139 --- llvm/lib/Linker/LinkModules.cpp:1.138 Wed Feb 14 20:26:10 2007 +++ llvm/lib/Linker/LinkModules.cpp Thu Apr 12 13:32:50 2007 @@ -477,7 +477,7 @@ GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, - SGV->getName(), Dest); + SGV->getName(), Dest, SGV->isThreadLocal()); // Propagate alignment, visibility and section info. CopyGVAttributes(NewDGV, SGV); @@ -500,7 +500,7 @@ GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, - "", Dest); + "", Dest, SGV->isThreadLocal()); // Propagate alignment, section and visibility info. NewDGV->setAlignment(DGV->getAlignment()); @@ -522,6 +522,7 @@ GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), DGV->isConstant(), DGV->getLinkage()); + NewDGV->setThreadLocal(DGV->isThreadLocal()); CopyGVAttributes(NewDGV, DGV); Dest->getGlobalList().insert(DGV, NewDGV); DGV->replaceAllUsesWith( @@ -821,7 +822,7 @@ // Create the new global variable... GlobalVariable *NG = new GlobalVariable(NewType, G1->isConstant(), G1->getLinkage(), - /*init*/0, First->first, M); + /*init*/0, First->first, M, G1->isThreadLocal()); // Merge the initializer... Inits.reserve(NewSize); From lauro.venancio at gmail.com Thu Apr 12 13:33:33 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp Message-ID: <200704121833.l3CIXXks009469@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CloneModule.cpp updated: 1.23 -> 1.24 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+2 -0) CloneModule.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/Utils/CloneModule.cpp diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.23 llvm/lib/Transforms/Utils/CloneModule.cpp:1.24 --- llvm/lib/Transforms/Utils/CloneModule.cpp:1.23 Mon Feb 5 14:47:20 2007 +++ llvm/lib/Transforms/Utils/CloneModule.cpp Thu Apr 12 13:32:50 2007 @@ -80,6 +80,8 @@ GV->setInitializer(cast(MapValue(I->getInitializer(), ValueMap))); GV->setLinkage(I->getLinkage()); + GV->setThreadLocal(I->isThreadLocal()); + GV->setConstant(I->isConstant()); } // Similarly, copy over function bodies now... From lauro.venancio at gmail.com Thu Apr 12 13:33:33 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:33:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l Lexer.l.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200704121833.l3CIXXVX009460@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.38 -> 1.39 Lexer.l updated: 1.104 -> 1.105 Lexer.l.cvs updated: 1.31 -> 1.32 llvmAsmParser.cpp.cvs updated: 1.83 -> 1.84 llvmAsmParser.h.cvs updated: 1.64 -> 1.65 llvmAsmParser.y updated: 1.338 -> 1.339 llvmAsmParser.y.cvs updated: 1.84 -> 1.85 --- Log message: Implement the "thread_local" keyword. --- Diffs of the changes: (+4001 -3636) Lexer.cpp.cvs | 2990 +++++++++++++++++++----------------- Lexer.l | 1 Lexer.l.cvs | 1 llvmAsmParser.cpp.cvs | 4125 +++++++++++++++++++++++++------------------------- llvmAsmParser.h.cvs | 458 ++--- llvmAsmParser.y | 31 llvmAsmParser.y.cvs | 31 7 files changed, 4001 insertions(+), 3636 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.38 llvm/lib/AsmParser/Lexer.cpp.cvs:1.39 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.38 Mon Apr 9 01:13:29 2007 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Thu Apr 12 13:32:50 2007 @@ -1,50 +1,93 @@ -#define yy_create_buffer llvmAsm_create_buffer -#define yy_delete_buffer llvmAsm_delete_buffer -#define yy_scan_buffer llvmAsm_scan_buffer -#define yy_scan_string llvmAsm_scan_string -#define yy_scan_bytes llvmAsm_scan_bytes -#define yy_flex_debug llvmAsm_flex_debug -#define yy_init_buffer llvmAsm_init_buffer -#define yy_flush_buffer llvmAsm_flush_buffer -#define yy_load_buffer_state llvmAsm_load_buffer_state -#define yy_switch_to_buffer llvmAsm_switch_to_buffer -#define yyin llvmAsmin -#define yyleng llvmAsmleng -#define yylex llvmAsmlex -#define yyout llvmAsmout -#define yyrestart llvmAsmrestart -#define yytext llvmAsmtext -#define yylineno llvmAsmlineno +#line 2 "Lexer.cpp" -#line 20 "Lexer.cpp" -/* A lexical scanner generated by flex*/ +#line 4 "Lexer.cpp" -/* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.38 2007/04/09 06:13:29 reid Exp $ - */ +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 33 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ +/* begin standard C headers. */ #include -#include +#include +#include +#include +/* end standard C headers. */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 #endif +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ -#ifdef __cplusplus +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif -#include +#endif /* ! FLEXINT_H */ -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS +#ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -53,34 +96,17 @@ #if __STDC__ -#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -95,80 +121,88 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE llvmAsmrestart(llvmAsmin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE #define YY_BUF_SIZE (16384*64) +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int llvmAsmleng; -extern int yyleng; -extern FILE *yyin, *yyout; +extern FILE *llvmAsmin, *llvmAsmout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE llvmAsmlex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-llvmAsmlineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < llvmAsmleng; ++yyl )\ + if ( llvmAsmtext[yyl] == '\n' )\ + --llvmAsmlineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ + /* Undo effects of setting up llvmAsmtext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up llvmAsmtext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) - -/* Some routines like yy_flex_realloc() are emitted as static but are - not called by all lexers. This generates warnings in some compilers, - notably GCC. Arrange to suppress these. */ -#ifdef __GNUC__ -#define YY_MAY_BE_UNUSED __attribute__((unused)) -#else -#define YY_MAY_BE_UNUSED -#endif +#define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ -typedef unsigned int yy_size_t; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef unsigned int yy_size_t; +#endif +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -205,12 +239,16 @@ */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -220,197 +258,202 @@ * possible backing-up. * * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. + * (via llvmAsmrestart()), so that the user can continue scanning by + * just pointing llvmAsmin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -static YY_BUFFER_STATE yy_current_buffer = 0; +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] -/* yy_hold_char holds the character lost when yytext is formed. */ +/* yy_hold_char holds the character lost when llvmAsmtext is formed. */ static char yy_hold_char; - static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; +int llvmAsmleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... +/* Flag which is used to allow llvmAsmwrap()'s to do buffer switches + * instead of setting up a fresh llvmAsmin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void llvmAsmrestart (FILE *input_file ); +void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE llvmAsm_create_buffer (FILE *file,int size ); +void llvmAsm_delete_buffer (YY_BUFFER_STATE b ); +void llvmAsm_flush_buffer (YY_BUFFER_STATE b ); +void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void llvmAsmpop_buffer_state (void ); + +static void llvmAsmensure_buffer_stack (void ); +static void llvmAsm_load_buffer_state (void ); +static void llvmAsm_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER llvmAsm_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE llvmAsm_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE llvmAsm_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char *bytes,int len ); + +void *llvmAsmalloc (yy_size_t ); +void *llvmAsmrealloc (void *,yy_size_t ); +void llvmAsmfree (void * ); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer +#define yy_new_buffer llvmAsm_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + llvmAsmensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + llvmAsmensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -#define YY_USES_REJECT +/* Begin user sect3 */ -#define yywrap() 1 +#define llvmAsmwrap() 1 #define YY_SKIP_YYWRAP + typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +FILE *llvmAsmin = (FILE *) 0, *llvmAsmout = (FILE *) 0; + typedef int yy_state_type; -extern int yylineno; -int yylineno = 1; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +extern int llvmAsmlineno; + +int llvmAsmlineno = 1; + +extern char *llvmAsmtext; +#define yytext_ptr llvmAsmtext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. + * corresponding action - sets up llvmAsmtext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + llvmAsmleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 135 -#define YY_END_OF_BUFFER 136 -static yyconst short int yy_acclist[216] = - { 0, - 136, 134, 135, 133, 134, 135, 133, 135, 134, 135, - 134, 135, 134, 135, 134, 135, 134, 135, 134, 135, - 126, 134, 135, 126, 134, 135, 1, 134, 135, 134, - 135, 134, 135, 134, 135, 134, 135, 134, 135, 134, - 135, 134, 135, 134, 135, 134, 135, 134, 135, 134, - 135, 134, 135, 134, 135, 134, 135, 134, 135, 134, - 135, 134, 135, 134, 135, 134, 135, 134, 135, 134, - 135, 134, 135, 134, 135, 124, 122, 120, 129, 127, - 131, 126, 1, 121, 130, 106, 35, 69, 51, 70, - 65, 23, 124, 120, 131, 20, 131, 132, 125, 121, - - 52, 64, 33, 36, 3, 54, 79, 84, 82, 83, - 81, 80, 85, 89, 105, 74, 72, 61, 73, 71, - 53, 87, 78, 76, 77, 75, 88, 86, 66, 123, - 131, 131, 63, 90, 68, 57, 113, 60, 67, 114, - 62, 22, 128, 56, 93, 59, 42, 24, 4, 49, - 55, 58, 45, 12, 92, 131, 30, 2, 5, 46, - 95, 41, 48, 115, 91, 21, 112, 38, 7, 47, - 37, 99, 98, 8, 16, 108, 111, 32, 50, 103, - 97, 107, 25, 26, 96, 109, 104, 102, 6, 27, - 94, 31, 9, 18, 10, 100, 11, 44, 43, 101, - - 29, 13, 15, 14, 28, 34, 17, 110, 116, 118, - 119, 39, 117, 40, 19 - } ; + (yy_c_buf_p) = yy_cp; -static yyconst short int yy_accept[540] = +#define YY_NUM_RULES 136 +#define YY_END_OF_BUFFER 137 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[550] = { 0, - 1, 1, 1, 2, 4, 7, 9, 11, 13, 15, - 17, 19, 21, 24, 27, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 76, - 77, 77, 78, 79, 80, 80, 81, 81, 82, 83, - 83, 84, 84, 85, 86, 86, 86, 86, 86, 86, - 86, 86, 87, 87, 88, 88, 88, 88, 88, 88, - 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, - - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 94, 95, 96, 97, 98, 98, 99, 99, - 100, 101, 102, 102, 102, 103, 103, 103, 104, 104, - 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 107, 107, 107, 107, 108, - 109, 110, 111, 112, 113, 113, 114, 115, 115, 116, - - 116, 116, 116, 116, 116, 117, 118, 119, 119, 119, - 119, 120, 121, 121, 121, 122, 122, 122, 122, 122, - 122, 122, 122, 123, 124, 125, 125, 126, 127, 127, - 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 130, 130, 130, 131, 132, 132, 132, 132, 133, 133, - 133, 133, 134, 134, 134, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, - 137, 137, 137, 137, 137, 138, 139, 139, 139, 139, - 140, 140, 140, 140, 140, 140, 140, 140, 141, 142, - 142, 142, 142, 142, 143, 143, 143, 144, 145, 145, - - 145, 146, 146, 146, 146, 147, 148, 148, 148, 149, - 149, 149, 150, 150, 151, 152, 152, 152, 152, 152, - 153, 153, 154, 154, 155, 155, 155, 156, 157, 158, - 158, 158, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 160, 160, 161, 162, 162, - 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 165, 165, 165, 165, 166, 166, 167, - 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, - 169, 169, 169, 169, 170, 170, 170, 170, 171, 171, - - 171, 172, 173, 174, 174, 174, 175, 176, 176, 176, - 176, 177, 177, 178, 179, 179, 179, 180, 180, 180, - 181, 181, 181, 182, 183, 184, 185, 186, 186, 187, - 188, 188, 188, 188, 188, 188, 189, 189, 189, 190, - 191, 191, 191, 191, 191, 191, 192, 192, 192, 192, - 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 194, 194, 194, 194, 194, 195, - 195, 195, 195, 196, 197, 198, 199, 200, 201, 201, - 201, 201, 202, 202, 202, 202, 203, 203, 204, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, - - 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, - 207, 208, 208, 208, 208, 208, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 210, 211, - 212, 212, 213, 213, 214, 215, 215, 216, 216 + 0, 0, 137, 135, 134, 134, 135, 135, 135, 135, + 135, 135, 127, 127, 1, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 0, 125, + 0, 123, 121, 130, 0, 128, 0, 132, 127, 0, + 1, 0, 122, 131, 0, 0, 0, 0, 0, 0, + 0, 107, 0, 36, 0, 0, 0, 0, 0, 0, + 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 71, 0, 0, 0, 0, 0, 0, 0, 66, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 125, 121, 132, 21, 132, 0, 133, 0, + 126, 122, 53, 0, 0, 65, 0, 0, 34, 0, + 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 55, 0, 0, 0, 80, + 85, 83, 84, 82, 81, 0, 86, 90, 0, 106, + + 0, 0, 0, 0, 0, 75, 73, 62, 0, 0, + 0, 74, 72, 0, 0, 54, 0, 0, 0, 0, + 0, 0, 0, 0, 88, 79, 77, 0, 78, 76, + 0, 89, 87, 0, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 124, 132, 0, 0, 0, 132, + 0, 0, 0, 64, 0, 0, 91, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 69, 58, 0, 0, 0, 0, 114, 61, 0, 0, + 0, 68, 0, 0, 0, 0, 0, 0, 0, 115, + 63, 0, 0, 0, 0, 23, 0, 0, 129, 57, + + 0, 0, 94, 0, 0, 0, 60, 43, 0, 0, + 25, 0, 0, 0, 4, 0, 50, 56, 0, 0, + 0, 0, 59, 0, 46, 0, 12, 0, 0, 93, + 132, 31, 0, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 0, 47, + 96, 0, 0, 0, 0, 0, 0, 42, 0, 0, + 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, + 92, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 113, 0, 0, 39, 0, 0, 0, 7, 0, 0, + + 0, 48, 0, 0, 38, 100, 99, 0, 0, 8, + 16, 0, 0, 0, 109, 0, 112, 33, 0, 0, + 51, 0, 0, 104, 0, 0, 98, 108, 26, 0, + 27, 97, 0, 110, 105, 0, 0, 0, 0, 0, + 103, 0, 0, 6, 28, 0, 0, 0, 0, 0, + 95, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, + 0, 0, 0, 0, 18, 0, 0, 0, 10, 101, + 11, 45, 44, 102, 0, 0, 0, 0, 30, 0, + 0, 0, 13, 0, 15, 14, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, + 0, 0, 0, 35, 0, 0, 0, 0, 0, 17, + 0, 0, 0, 0, 0, 111, 0, 0, 0, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 117, 119, + 120, 0, 40, 0, 118, 41, 0, 20, 0 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, @@ -442,7 +485,7 @@ 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[45] = +static yyconst flex_int32_t yy_meta[45] = { 0, 1, 1, 2, 3, 4, 1, 1, 4, 4, 4, 4, 4, 4, 5, 1, 1, 4, 4, 4, 4, @@ -451,135 +494,137 @@ 4, 4, 4, 4 } ; -static yyconst short int yy_base[547] = +static yyconst flex_int16_t yy_base[558] = { 0, - 0, 0, 1175, 1176, 1176, 1176, 1170, 1159, 35, 39, + 0, 0, 1197, 1198, 1198, 1198, 1192, 1181, 35, 39, 43, 49, 55, 61, 0, 72, 64, 67, 66, 86, 76, 106, 91, 65, 133, 121, 117, 99, 152, 95, - 78, 179, 137, 211, 139, 90, 148, 93, 1168, 1176, - 1157, 1176, 0, 49, 185, 217, 116, 238, 254, 259, - 0, 1166, 0, 200, 125, 149, 146, 153, 177, 63, - 154, 1155, 160, 161, 208, 185, 264, 171, 113, 210, - 1154, 222, 260, 228, 186, 261, 271, 110, 273, 274, - 230, 289, 277, 278, 150, 290, 241, 205, 282, 231, - 291, 1153, 292, 296, 299, 303, 305, 306, 318, 310, - - 309, 311, 321, 322, 325, 326, 328, 330, 332, 337, - 343, 340, 344, 335, 348, 1152, 357, 358, 360, 363, - 365, 364, 366, 377, 369, 331, 367, 385, 394, 373, - 380, 1151, 0, 413, 1150, 428, 446, 0, 1159, 1176, - 0, 1148, 232, 397, 1147, 393, 398, 1146, 400, 405, - 406, 1145, 421, 418, 401, 415, 419, 434, 437, 429, - 1144, 448, 449, 435, 453, 452, 454, 455, 457, 464, - 456, 461, 462, 465, 467, 480, 482, 469, 484, 486, - 487, 475, 489, 491, 1143, 493, 495, 498, 1142, 1141, - 1140, 1139, 1138, 1137, 499, 1136, 1135, 500, 1134, 529, - - 504, 507, 502, 510, 1133, 1132, 1131, 508, 511, 522, - 1130, 1129, 529, 523, 1128, 518, 543, 544, 547, 548, - 550, 549, 1127, 1126, 1125, 551, 1124, 1123, 552, 1122, - 1121, 554, 555, 557, 509, 563, 565, 561, 568, 1120, - 577, 578, 1176, 583, 592, 601, 607, 612, 583, 584, - 595, 1119, 614, 615, 1118, 616, 594, 617, 619, 620, - 622, 623, 626, 628, 627, 629, 630, 631, 1117, 1116, - 634, 637, 641, 642, 1115, 1114, 646, 647, 645, 1113, - 648, 650, 652, 654, 656, 659, 657, 1112, 1111, 663, - 665, 668, 669, 1110, 670, 678, 0, 1109, 677, 679, - - 1108, 683, 680, 688, 1107, 1106, 693, 698, 1105, 700, - 685, 1104, 704, 1103, 1102, 702, 705, 708, 689, 1101, - 709, 1100, 711, 1099, 715, 718, 1098, 723, 1097, 717, - 724, 1096, 725, 728, 734, 737, 727, 729, 744, 730, - 741, 742, 745, 746, 1095, 747, 1094, 1093, 753, 756, - 757, 758, 760, 759, 1092, 762, 764, 765, 769, 1091, - 766, 772, 771, 773, 774, 783, 778, 787, 789, 791, - 790, 794, 1090, 795, 796, 799, 1089, 797, 1088, 802, - 803, 804, 805, 815, 800, 811, 1087, 818, 822, 1086, - 823, 825, 826, 1085, 827, 828, 830, 1084, 833, 831, - - 1083, 1082, 1081, 834, 835, 1080, 1079, 843, 845, 837, - 1078, 840, 1077, 1076, 844, 856, 1075, 857, 858, 1074, - 859, 860, 1073, 1072, 1071, 1070, 1069, 864, 1068, 1067, - 862, 863, 870, 867, 865, 1066, 868, 872, 1065, 1064, - 873, 880, 882, 884, 887, 1063, 888, 885, 889, 890, - 893, 896, 899, 894, 1062, 904, 906, 907, 910, 911, - 915, 917, 919, 1061, 921, 924, 925, 922, 1050, 926, - 927, 928, 1039, 1037, 1036, 1035, 1034, 1033, 929, 936, - 933, 1032, 943, 947, 950, 1031, 934, 1030, 1029, 954, - 952, 937, 955, 957, 956, 959, 963, 966, 967, 1024, - - 968, 970, 971, 974, 976, 1022, 978, 977, 979, 981, - 1021, 986, 985, 989, 992, 1018, 990, 994, 998, 999, - 1001, 1003, 1004, 1005, 1008, 1010, 1014, 686, 684, 517, - 1020, 463, 1015, 372, 368, 1019, 279, 1176, 1055, 1057, - 253, 1062, 1065, 212, 1069, 108 + 78, 179, 137, 211, 139, 90, 148, 93, 1190, 1198, + 1179, 1198, 0, 49, 185, 217, 116, 238, 254, 259, + 0, 1188, 0, 200, 125, 149, 146, 153, 177, 63, + 154, 1177, 160, 161, 208, 185, 264, 171, 113, 210, + 1176, 222, 260, 228, 186, 261, 271, 110, 273, 274, + 230, 289, 277, 278, 240, 290, 292, 205, 291, 232, + 296, 1175, 299, 303, 305, 306, 310, 313, 309, 318, + + 311, 314, 317, 322, 328, 329, 338, 331, 335, 339, + 333, 332, 346, 340, 352, 355, 1174, 358, 360, 361, + 364, 368, 365, 369, 381, 376, 382, 388, 367, 396, + 384, 395, 1173, 0, 414, 1172, 429, 447, 0, 1181, + 1198, 0, 1170, 231, 397, 1169, 399, 398, 1168, 401, + 414, 405, 1167, 442, 407, 431, 419, 434, 436, 449, + 450, 1166, 454, 432, 438, 453, 456, 460, 458, 461, + 467, 465, 471, 470, 468, 481, 485, 487, 474, 489, + 490, 492, 472, 496, 498, 1165, 500, 502, 503, 1164, + 1163, 1162, 1161, 1160, 1159, 504, 1158, 1157, 506, 1156, + + 535, 509, 513, 507, 516, 1155, 1154, 1153, 515, 508, + 528, 1152, 1151, 536, 527, 1150, 524, 550, 551, 552, + 554, 555, 557, 556, 1149, 1148, 1147, 558, 1146, 1145, + 559, 1144, 1143, 561, 564, 568, 570, 572, 580, 514, + 579, 1142, 575, 583, 1198, 591, 606, 612, 616, 621, + 606, 622, 623, 1141, 625, 591, 1140, 626, 627, 628, + 592, 629, 631, 632, 633, 636, 635, 640, 638, 653, + 1139, 1138, 639, 642, 649, 637, 1137, 1136, 654, 658, + 655, 1135, 656, 659, 667, 669, 671, 675, 673, 1134, + 1133, 676, 677, 678, 679, 1132, 680, 682, 0, 1131, + + 683, 690, 1130, 685, 684, 699, 1129, 1128, 703, 700, + 1127, 704, 709, 707, 1126, 711, 1125, 1124, 716, 717, + 712, 720, 1123, 721, 1122, 722, 1121, 724, 725, 1120, + 733, 1119, 734, 733, 1118, 726, 736, 745, 748, 737, + 750, 755, 741, 752, 753, 756, 757, 1117, 758, 1116, + 1115, 764, 767, 768, 769, 771, 770, 1114, 773, 775, + 776, 780, 1113, 777, 783, 782, 784, 785, 794, 789, + 798, 800, 802, 801, 805, 1112, 806, 807, 811, 813, + 1111, 808, 1110, 814, 821, 815, 826, 810, 829, 832, + 1109, 833, 834, 1108, 836, 835, 838, 1107, 837, 842, + + 843, 1106, 839, 841, 1105, 1104, 1103, 849, 846, 1102, + 1101, 856, 867, 851, 1100, 868, 1099, 1098, 852, 859, + 1097, 869, 870, 1096, 871, 872, 1095, 1094, 1093, 879, + 1092, 1091, 878, 1090, 1089, 880, 882, 885, 886, 889, + 1088, 890, 892, 1087, 1076, 893, 895, 897, 902, 898, + 1066, 899, 903, 904, 901, 906, 910, 912, 913, 1065, + 922, 925, 926, 927, 929, 930, 932, 931, 934, 1064, + 936, 938, 941, 943, 1061, 944, 945, 947, 1060, 1059, + 1058, 1057, 1056, 1055, 949, 950, 951, 964, 1054, 966, + 967, 968, 1048, 952, 1047, 1046, 969, 977, 956, 972, + + 978, 979, 983, 981, 984, 985, 988, 855, 992, 993, + 995, 996, 998, 687, 999, 1002, 1000, 1004, 1008, 596, + 1009, 1011, 1013, 1014, 1018, 593, 1021, 1017, 1026, 1023, + 1027, 1028, 1029, 522, 1030, 1036, 1032, 1039, 521, 469, + 371, 1042, 370, 1043, 282, 279, 1045, 244, 1198, 1081, + 1083, 212, 1088, 1091, 167, 1095, 108 } ; -static yyconst short int yy_def[547] = +static yyconst flex_int16_t yy_def[558] = { 0, - 538, 1, 538, 538, 538, 538, 539, 540, 541, 538, - 540, 540, 540, 540, 542, 543, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 539, 538, - 540, 538, 544, 538, 538, 540, 540, 540, 540, 540, - 542, 545, 546, 538, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 538, 544, 538, 540, 540, 540, 50, 545, 538, - 546, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 50, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 538, 538, 538, 538, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 200, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 538, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 540, 540, 540, 540, 540, 0, 538, 538, - 538, 538, 538, 538, 538, 538 + 549, 1, 549, 549, 549, 549, 550, 551, 552, 549, + 551, 551, 551, 551, 553, 554, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 550, 549, + 551, 549, 555, 549, 549, 551, 551, 551, 551, 551, + 553, 556, 557, 549, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 549, 555, 549, 551, 551, 551, 50, 556, + 549, 557, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + + 50, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 549, 549, 549, 549, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 201, 551, + + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 549, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551, 0, 549, + 549, 549, 549, 549, 549, 549, 549 } ; -static yyconst short int yy_nxt[1221] = +static yyconst flex_int16_t yy_nxt[1243] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 4, 15, 16, 8, 8, 8, 17, @@ -589,135 +634,138 @@ 45, 45, 46, 46, 46, 46, 42, 47, 44, 44, 44, 44, 42, 48, 49, 49, 49, 49, 42, 48, 49, 49, 49, 49, 42, 52, 42, 42, 42, 42, - 42, 54, 54, 54, 54, 63, 55, 64, 149, 42, + 42, 54, 54, 54, 54, 63, 55, 64, 150, 42, 60, 42, 81, 56, 61, 57, 50, 58, 65, 42, 59, 103, 62, 42, 42, 66, 42, 70, 42, 67, - 71, 141, 42, 128, 79, 68, 131, 72, 69, 42, - 80, 101, 92, 42, 135, 73, 42, 74, 75, 42, - 42, 93, 102, 170, 42, 76, 89, 94, 42, 77, - 85, 78, 82, 82, 82, 82, 42, 142, 86, 90, - 42, 160, 42, 87, 83, 91, 115, 88, 126, 42, - 129, 42, 42, 42, 84, 42, 42, 42, 145, 116, - 179, 127, 117, 42, 42, 95, 143, 96, 144, 118, - 130, 97, 152, 98, 42, 99, 146, 100, 104, 151, - 42, 150, 42, 134, 45, 45, 45, 45, 42, 42, - - 159, 105, 106, 147, 107, 108, 109, 148, 110, 54, - 54, 54, 54, 166, 111, 133, 112, 113, 42, 114, - 104, 42, 155, 42, 42, 48, 46, 46, 46, 46, - 42, 182, 161, 119, 120, 42, 121, 153, 122, 154, - 123, 42, 124, 42, 42, 42, 125, 136, 136, 136, - 136, 42, 173, 184, 42, 137, 43, 249, 165, 162, - 181, 137, 48, 49, 49, 49, 49, 42, 138, 138, - 138, 138, 42, 42, 42, 138, 138, 42, 138, 138, - 138, 138, 138, 138, 42, 156, 42, 42, 157, 163, - 42, 42, 42, 167, 168, 42, 164, 158, 82, 82, - - 82, 82, 42, 42, 42, 42, 172, 174, 169, 42, - 171, 183, 42, 175, 176, 177, 42, 178, 42, 42, - 185, 180, 42, 42, 42, 188, 190, 186, 192, 194, - 187, 42, 196, 189, 42, 42, 197, 195, 42, 42, - 191, 42, 193, 42, 42, 42, 198, 202, 42, 235, - 42, 205, 201, 42, 209, 203, 42, 42, 199, 207, - 211, 42, 216, 200, 215, 206, 213, 204, 208, 210, - 42, 42, 214, 42, 212, 217, 42, 42, 42, 42, - 42, 42, 42, 218, 219, 42, 42, 222, 224, 227, - 42, 221, 234, 42, 236, 220, 237, 223, 42, 229, - - 230, 226, 225, 228, 238, 239, 42, 42, 240, 231, - 42, 42, 232, 42, 42, 241, 251, 233, 42, 42, - 258, 242, 244, 244, 244, 244, 254, 253, 42, 250, - 245, 42, 42, 252, 42, 255, 245, 136, 136, 136, - 136, 42, 42, 256, 259, 137, 260, 42, 42, 264, - 42, 137, 246, 247, 257, 248, 248, 248, 248, 42, - 262, 42, 42, 261, 263, 42, 42, 42, 42, 42, - 42, 265, 268, 271, 42, 42, 42, 42, 42, 277, - 42, 278, 42, 266, 279, 267, 269, 275, 42, 273, - 281, 270, 274, 42, 276, 42, 272, 42, 280, 42, - - 42, 285, 42, 282, 42, 283, 42, 286, 42, 288, - 289, 42, 42, 42, 287, 42, 292, 42, 290, 284, - 42, 42, 42, 42, 42, 300, 293, 294, 321, 291, - 42, 42, 302, 295, 303, 42, 42, 296, 297, 297, - 297, 297, 42, 298, 299, 297, 297, 301, 297, 297, - 297, 297, 297, 297, 304, 308, 42, 42, 307, 305, - 42, 42, 42, 42, 42, 42, 306, 42, 42, 310, - 42, 312, 309, 314, 42, 317, 42, 318, 42, 313, - 311, 42, 319, 316, 323, 322, 325, 320, 315, 324, - 42, 42, 244, 244, 244, 244, 42, 42, 246, 246, - - 245, 328, 328, 328, 328, 330, 245, 42, 42, 326, - 328, 328, 328, 328, 329, 327, 248, 248, 248, 248, - 42, 248, 248, 248, 248, 42, 331, 42, 42, 42, - 42, 335, 42, 42, 333, 42, 42, 334, 337, 42, - 42, 42, 42, 42, 42, 332, 336, 42, 344, 339, - 42, 338, 346, 345, 42, 42, 341, 342, 42, 42, - 42, 42, 343, 42, 340, 42, 353, 42, 354, 42, - 42, 347, 42, 355, 348, 352, 42, 349, 42, 350, - 351, 42, 42, 42, 359, 356, 358, 357, 360, 361, - 42, 42, 42, 42, 363, 362, 42, 42, 42, 42, - - 369, 42, 42, 371, 368, 364, 42, 370, 366, 365, - 367, 42, 372, 42, 376, 42, 373, 42, 42, 374, - 381, 42, 42, 375, 42, 377, 378, 380, 42, 379, - 42, 42, 328, 328, 328, 328, 387, 42, 42, 384, - 42, 42, 42, 42, 382, 386, 388, 42, 383, 390, - 42, 385, 394, 391, 42, 42, 392, 42, 42, 42, - 42, 389, 393, 396, 395, 398, 42, 400, 401, 42, - 42, 42, 42, 42, 397, 42, 399, 42, 42, 42, - 402, 405, 42, 403, 42, 42, 42, 42, 404, 406, - 407, 42, 411, 413, 414, 409, 42, 412, 410, 408, - - 42, 416, 42, 42, 42, 418, 417, 42, 42, 42, - 42, 415, 42, 42, 422, 42, 42, 42, 42, 419, - 421, 424, 426, 428, 42, 429, 420, 423, 42, 430, - 427, 42, 431, 425, 432, 42, 42, 433, 42, 42, - 42, 42, 434, 42, 42, 435, 42, 42, 42, 439, - 42, 443, 444, 42, 437, 446, 42, 42, 42, 436, - 441, 451, 442, 440, 449, 447, 448, 438, 445, 42, - 42, 42, 42, 42, 450, 42, 42, 42, 42, 452, - 42, 42, 456, 42, 457, 42, 42, 453, 454, 455, - 458, 459, 461, 42, 462, 42, 463, 42, 42, 460, - - 42, 42, 42, 42, 465, 464, 42, 42, 466, 42, - 470, 471, 42, 469, 472, 467, 475, 42, 473, 42, - 42, 477, 468, 42, 42, 474, 481, 476, 42, 480, - 42, 478, 42, 482, 42, 42, 484, 42, 42, 42, - 42, 42, 42, 479, 486, 490, 42, 42, 483, 42, - 42, 493, 494, 496, 485, 491, 42, 495, 492, 487, - 42, 488, 489, 42, 497, 42, 498, 42, 42, 42, - 42, 500, 42, 501, 503, 502, 42, 499, 505, 42, - 42, 42, 508, 42, 42, 504, 510, 42, 507, 42, - 42, 42, 42, 506, 42, 509, 511, 514, 42, 42, - - 512, 516, 42, 42, 513, 42, 517, 42, 518, 520, - 519, 42, 42, 515, 42, 525, 42, 42, 42, 524, - 522, 42, 521, 42, 523, 526, 531, 42, 42, 532, - 527, 42, 42, 42, 42, 42, 528, 42, 536, 530, - 529, 535, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 534, 42, 533, 537, 39, 39, 39, 39, 39, - 41, 41, 51, 42, 51, 51, 51, 53, 53, 139, - 139, 139, 139, 139, 42, 42, 42, 42, 42, 42, + 71, 142, 42, 129, 79, 68, 132, 72, 69, 42, + 80, 101, 92, 42, 136, 73, 42, 74, 75, 42, + 42, 93, 102, 171, 42, 76, 89, 94, 42, 77, + 85, 78, 82, 82, 82, 82, 42, 143, 86, 90, + 42, 161, 42, 87, 83, 91, 115, 88, 127, 42, + 130, 42, 42, 116, 84, 42, 42, 42, 146, 117, + 134, 128, 118, 42, 42, 95, 144, 96, 145, 119, + 131, 97, 153, 98, 42, 99, 147, 100, 104, 152, + 42, 151, 42, 135, 45, 45, 45, 45, 42, 42, + + 160, 105, 106, 148, 107, 108, 109, 149, 110, 54, + 54, 54, 54, 167, 111, 43, 112, 113, 42, 114, + 104, 42, 156, 42, 42, 48, 46, 46, 46, 46, + 42, 183, 162, 120, 121, 42, 122, 154, 123, 155, + 124, 42, 125, 42, 42, 42, 126, 137, 137, 137, + 137, 42, 174, 42, 185, 138, 251, 42, 166, 163, + 180, 138, 48, 49, 49, 49, 49, 42, 139, 139, + 139, 139, 42, 42, 42, 139, 139, 42, 139, 139, + 139, 139, 139, 139, 42, 157, 42, 42, 158, 164, + 42, 42, 42, 168, 169, 42, 165, 159, 82, 82, + + 82, 82, 42, 42, 42, 42, 173, 175, 170, 42, + 172, 182, 42, 176, 177, 178, 42, 179, 42, 42, + 184, 181, 42, 42, 42, 186, 42, 42, 196, 191, + 42, 42, 189, 193, 187, 42, 195, 188, 198, 190, + 197, 42, 42, 192, 42, 42, 42, 194, 42, 199, + 203, 42, 42, 42, 200, 202, 214, 210, 204, 42, + 208, 206, 212, 201, 215, 42, 216, 217, 42, 209, + 205, 42, 211, 42, 42, 207, 213, 42, 42, 218, + 42, 42, 42, 42, 42, 221, 240, 219, 224, 42, + 220, 226, 229, 223, 42, 42, 222, 42, 225, 236, + + 237, 42, 228, 231, 232, 227, 230, 241, 42, 42, + 42, 42, 42, 233, 42, 238, 234, 239, 42, 242, + 42, 235, 253, 246, 246, 246, 246, 42, 255, 252, + 243, 247, 42, 254, 257, 256, 244, 247, 137, 137, + 137, 137, 42, 259, 42, 42, 138, 42, 261, 42, + 260, 42, 138, 248, 249, 42, 250, 250, 250, 250, + 42, 262, 42, 42, 258, 263, 42, 42, 269, 42, + 266, 42, 264, 42, 42, 270, 265, 267, 42, 273, + 42, 42, 42, 42, 42, 42, 271, 42, 279, 268, + 277, 280, 281, 275, 42, 272, 276, 278, 42, 274, + + 42, 282, 42, 42, 283, 42, 287, 291, 284, 42, + 285, 42, 288, 42, 290, 42, 42, 42, 289, 42, + 42, 42, 42, 294, 286, 292, 42, 42, 42, 42, + 302, 305, 296, 295, 42, 42, 293, 42, 297, 304, + 42, 42, 327, 298, 299, 299, 299, 299, 300, 42, + 301, 299, 299, 303, 299, 299, 299, 299, 299, 299, + 306, 310, 309, 42, 42, 42, 307, 42, 42, 42, + 42, 42, 42, 308, 42, 313, 312, 42, 315, 311, + 317, 42, 320, 42, 321, 42, 316, 314, 42, 324, + 319, 322, 42, 42, 325, 318, 42, 328, 323, 326, + + 246, 246, 246, 246, 42, 42, 42, 329, 247, 42, + 336, 340, 248, 248, 247, 331, 331, 331, 331, 42, + 330, 331, 331, 331, 331, 250, 250, 250, 250, 42, + 250, 250, 250, 250, 42, 42, 42, 332, 42, 42, + 42, 42, 42, 333, 42, 42, 42, 337, 42, 42, + 42, 42, 42, 42, 334, 42, 335, 339, 342, 347, + 341, 348, 42, 344, 338, 345, 42, 42, 42, 42, + 346, 42, 42, 343, 349, 354, 350, 356, 357, 351, + 42, 358, 42, 355, 42, 352, 42, 353, 42, 42, + 42, 42, 42, 42, 359, 42, 42, 42, 42, 362, + + 42, 361, 360, 42, 363, 364, 366, 374, 365, 373, + 371, 372, 42, 42, 370, 367, 42, 42, 369, 368, + 42, 377, 42, 375, 42, 42, 376, 378, 379, 42, + 42, 384, 381, 42, 42, 42, 380, 42, 42, 42, + 382, 383, 331, 331, 331, 331, 42, 42, 388, 42, + 42, 385, 390, 391, 42, 392, 386, 394, 42, 387, + 389, 42, 393, 42, 395, 42, 42, 396, 42, 42, + 42, 42, 397, 398, 400, 399, 402, 42, 404, 405, + 42, 42, 42, 42, 42, 401, 42, 403, 42, 42, + 42, 406, 409, 42, 407, 42, 42, 42, 42, 408, + + 410, 411, 42, 415, 417, 418, 413, 42, 416, 414, + 412, 42, 420, 42, 42, 42, 422, 421, 42, 42, + 42, 42, 419, 42, 42, 426, 42, 42, 42, 437, + 423, 425, 428, 430, 42, 433, 431, 424, 427, 42, + 435, 432, 42, 434, 429, 42, 42, 42, 42, 42, + 42, 42, 42, 436, 42, 42, 42, 448, 449, 42, + 440, 444, 42, 439, 42, 42, 438, 442, 42, 42, + 451, 441, 42, 445, 446, 447, 452, 443, 450, 453, + 42, 42, 42, 42, 42, 42, 454, 457, 455, 456, + 458, 42, 42, 42, 461, 42, 462, 463, 42, 42, + + 459, 460, 42, 42, 464, 42, 42, 467, 42, 465, + 42, 42, 42, 468, 42, 42, 42, 42, 466, 42, + 469, 476, 477, 42, 471, 42, 42, 470, 472, 481, + 473, 475, 478, 479, 483, 42, 480, 474, 42, 42, + 42, 482, 42, 42, 42, 42, 488, 42, 486, 42, + 484, 42, 489, 491, 42, 487, 42, 42, 42, 493, + 42, 485, 42, 42, 42, 42, 497, 490, 492, 42, + 500, 502, 501, 498, 494, 495, 499, 42, 496, 42, + 42, 42, 42, 503, 504, 42, 506, 505, 509, 508, + 42, 42, 42, 511, 42, 507, 42, 42, 42, 513, + + 510, 42, 512, 517, 515, 42, 42, 519, 42, 42, + 516, 42, 42, 42, 518, 42, 514, 42, 525, 523, + 520, 42, 42, 521, 42, 526, 42, 42, 522, 527, + 42, 42, 530, 528, 42, 524, 42, 529, 536, 42, + 42, 42, 42, 42, 532, 42, 533, 534, 531, 42, + 535, 542, 42, 537, 538, 42, 42, 543, 42, 42, + 42, 42, 539, 546, 541, 540, 547, 42, 42, 42, + 42, 42, 42, 42, 42, 544, 545, 42, 42, 42, + 548, 39, 39, 39, 39, 39, 41, 41, 51, 42, + 51, 51, 51, 53, 53, 140, 140, 140, 140, 140, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 140, 42, 243, 42, 42, 42, 42, 140, - 42, 132, 42, 40, 538, 3, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, + 42, 42, 42, 42, 141, 42, 245, 42, 42, 42, + 42, 141, 42, 133, 42, 40, 549, 3, 549, 549, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538 + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549 } ; -static yyconst short int yy_chk[1221] = +static yyconst flex_int16_t yy_chk[1243] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -731,146 +779,159 @@ 18, 31, 24, 17, 18, 17, 13, 17, 19, 20, 17, 31, 18, 36, 23, 20, 38, 21, 30, 20, - 21, 546, 28, 36, 23, 20, 38, 21, 20, 22, + 21, 557, 28, 36, 23, 20, 38, 21, 20, 22, 23, 30, 28, 78, 47, 22, 69, 22, 22, 47, 27, 28, 30, 78, 26, 22, 27, 28, 55, 22, 26, 22, 25, 25, 25, 25, 25, 55, 26, 27, 33, 69, 35, 26, 25, 27, 33, 26, 35, 57, - 37, 37, 56, 85, 25, 29, 58, 61, 57, 33, - 85, 35, 33, 63, 64, 29, 56, 29, 56, 33, + 37, 37, 56, 33, 25, 29, 58, 61, 57, 33, + 555, 35, 33, 63, 64, 29, 56, 29, 56, 33, 37, 29, 64, 29, 68, 29, 58, 29, 32, 63, 59, 61, 32, 45, 45, 45, 45, 45, 66, 75, 68, 32, 32, 59, 32, 32, 32, 59, 32, 54, - 54, 54, 54, 75, 32, 544, 32, 32, 88, 32, + 54, 54, 54, 75, 32, 552, 32, 32, 88, 32, 34, 65, 66, 70, 34, 46, 46, 46, 46, 46, 46, 88, 70, 34, 34, 72, 34, 65, 34, 65, - 34, 74, 34, 81, 90, 143, 34, 48, 48, 48, - 48, 48, 81, 90, 87, 48, 541, 143, 74, 72, - 87, 48, 49, 49, 49, 49, 49, 49, 50, 50, + 34, 74, 34, 81, 144, 90, 34, 48, 48, 48, + 48, 48, 81, 85, 90, 48, 144, 548, 74, 72, + 85, 48, 49, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 73, 76, 50, 50, 67, 50, 50, 50, 50, 50, 50, 77, 67, 79, 80, 67, 73, - 83, 84, 537, 76, 77, 89, 73, 67, 82, 82, - - 82, 82, 82, 86, 91, 93, 80, 83, 77, 94, - 79, 89, 95, 84, 84, 84, 96, 84, 97, 98, - 91, 86, 101, 100, 102, 94, 96, 93, 97, 98, - 93, 99, 100, 95, 103, 104, 101, 99, 105, 106, - 96, 107, 97, 108, 126, 109, 102, 106, 114, 126, - 110, 107, 105, 112, 109, 106, 111, 113, 103, 108, - 110, 115, 114, 104, 113, 107, 111, 106, 108, 109, - 117, 118, 112, 119, 110, 115, 120, 122, 121, 123, - 127, 535, 125, 115, 117, 534, 130, 119, 121, 123, - 124, 118, 125, 131, 127, 117, 127, 120, 128, 124, - - 124, 122, 121, 123, 128, 129, 146, 129, 130, 124, - 144, 147, 124, 149, 155, 131, 146, 124, 150, 151, - 155, 131, 134, 134, 134, 134, 150, 149, 156, 144, - 134, 154, 157, 147, 153, 151, 134, 136, 136, 136, - 136, 136, 160, 153, 156, 136, 157, 158, 164, 160, - 159, 136, 137, 137, 154, 137, 137, 137, 137, 137, - 159, 162, 163, 158, 159, 166, 165, 167, 168, 171, - 169, 162, 164, 167, 172, 173, 532, 170, 174, 171, - 175, 172, 178, 162, 173, 163, 165, 170, 182, 169, - 175, 166, 169, 176, 170, 177, 168, 179, 174, 180, - - 181, 178, 183, 176, 184, 177, 186, 179, 187, 181, - 182, 188, 195, 198, 180, 203, 186, 201, 183, 177, - 202, 208, 235, 204, 209, 203, 187, 188, 235, 184, - 530, 216, 208, 195, 209, 210, 214, 198, 200, 200, - 200, 200, 213, 201, 202, 200, 200, 204, 200, 200, - 200, 200, 200, 200, 210, 216, 217, 218, 214, 213, - 219, 220, 222, 221, 226, 229, 213, 232, 233, 218, - 234, 220, 217, 221, 238, 229, 236, 232, 237, 220, - 219, 239, 233, 226, 237, 236, 239, 234, 222, 238, - 241, 242, 244, 244, 244, 244, 249, 250, 245, 245, - - 244, 245, 245, 245, 245, 250, 244, 257, 251, 241, - 246, 246, 246, 246, 249, 242, 247, 247, 247, 247, - 247, 248, 248, 248, 248, 248, 251, 253, 254, 256, - 258, 257, 259, 260, 254, 261, 262, 256, 259, 263, - 265, 264, 266, 267, 268, 253, 258, 271, 266, 261, - 272, 260, 268, 267, 273, 274, 263, 264, 279, 277, - 278, 281, 265, 282, 262, 283, 278, 284, 279, 285, - 287, 271, 286, 281, 272, 277, 290, 273, 291, 273, - 274, 292, 293, 295, 285, 282, 284, 283, 286, 287, - 299, 296, 300, 303, 291, 290, 302, 529, 311, 528, - - 300, 304, 319, 303, 299, 292, 307, 302, 295, 293, - 296, 308, 304, 310, 311, 316, 307, 313, 317, 308, - 319, 318, 321, 310, 323, 313, 316, 318, 325, 317, - 330, 326, 328, 328, 328, 328, 330, 331, 333, 325, - 337, 334, 338, 340, 321, 326, 331, 335, 323, 334, - 336, 325, 338, 335, 341, 342, 336, 339, 343, 344, - 346, 333, 337, 340, 339, 342, 349, 344, 346, 350, - 351, 352, 354, 353, 341, 356, 343, 357, 358, 361, - 349, 352, 359, 350, 363, 362, 364, 365, 351, 353, - 354, 367, 359, 362, 363, 357, 366, 361, 358, 356, - - 368, 365, 369, 371, 370, 367, 366, 372, 374, 375, - 378, 364, 376, 385, 371, 380, 381, 382, 383, 368, - 370, 374, 376, 380, 386, 381, 369, 372, 384, 382, - 378, 388, 383, 375, 384, 389, 391, 385, 392, 393, - 395, 396, 386, 397, 400, 388, 399, 404, 405, 393, - 410, 399, 399, 412, 391, 404, 408, 415, 409, 389, - 396, 412, 397, 395, 409, 405, 408, 392, 400, 416, - 418, 419, 421, 422, 410, 431, 432, 428, 435, 415, - 434, 437, 421, 433, 422, 438, 441, 416, 418, 419, - 428, 431, 433, 442, 434, 443, 435, 444, 448, 432, - - 445, 447, 449, 450, 438, 437, 451, 454, 441, 452, - 445, 447, 453, 444, 448, 442, 451, 456, 449, 457, - 458, 453, 443, 459, 460, 450, 458, 452, 461, 457, - 462, 454, 463, 459, 465, 468, 461, 466, 467, 470, - 471, 472, 479, 456, 463, 468, 481, 487, 460, 480, - 492, 472, 479, 481, 462, 470, 483, 480, 471, 465, - 484, 466, 467, 485, 483, 491, 484, 490, 493, 495, - 494, 487, 496, 490, 492, 491, 497, 485, 494, 498, - 499, 501, 497, 502, 503, 493, 499, 504, 496, 505, - 508, 507, 509, 495, 510, 498, 501, 504, 513, 512, - - 502, 507, 514, 517, 503, 515, 508, 518, 509, 512, - 510, 519, 520, 505, 521, 518, 522, 523, 524, 517, - 514, 525, 513, 526, 515, 519, 524, 527, 533, 525, - 520, 516, 536, 531, 511, 506, 521, 500, 533, 523, - 522, 531, 489, 488, 486, 482, 478, 477, 476, 475, - 474, 527, 473, 526, 536, 539, 539, 539, 539, 539, - 540, 540, 542, 469, 542, 542, 542, 543, 543, 545, - 545, 545, 545, 545, 464, 455, 446, 440, 439, 436, - 430, 429, 427, 426, 425, 424, 423, 420, 417, 414, - 413, 411, 407, 406, 403, 402, 401, 398, 394, 390, - - 387, 379, 377, 373, 360, 355, 348, 347, 345, 332, - 329, 327, 324, 322, 320, 315, 314, 312, 309, 306, - 305, 301, 298, 294, 289, 288, 280, 276, 275, 270, - 269, 255, 252, 240, 231, 230, 228, 227, 225, 224, - 223, 215, 212, 211, 207, 206, 205, 199, 197, 196, - 194, 193, 192, 191, 190, 189, 185, 161, 152, 148, - 145, 142, 139, 135, 132, 116, 92, 71, 62, 52, - 41, 39, 8, 7, 3, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, + 83, 84, 546, 76, 77, 545, 73, 67, 82, 82, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 538, 538 + 82, 82, 82, 86, 89, 87, 80, 83, 77, 91, + 79, 87, 93, 84, 84, 84, 94, 84, 95, 96, + 89, 86, 99, 97, 101, 91, 98, 102, 99, 96, + 103, 100, 94, 97, 93, 104, 98, 93, 101, 95, + 100, 105, 106, 96, 108, 112, 111, 97, 109, 102, + 106, 107, 110, 114, 103, 105, 111, 109, 106, 113, + 108, 107, 110, 104, 112, 115, 113, 114, 116, 108, + 106, 118, 109, 119, 120, 107, 110, 121, 123, 115, + 129, 122, 124, 543, 541, 118, 129, 115, 120, 126, + 116, 122, 124, 119, 125, 127, 118, 131, 121, 126, + + 127, 128, 123, 125, 125, 122, 124, 130, 132, 130, + 145, 148, 147, 125, 150, 128, 125, 128, 152, 131, + 155, 125, 147, 135, 135, 135, 135, 151, 150, 145, + 132, 135, 157, 148, 152, 151, 132, 135, 137, 137, + 137, 137, 137, 155, 156, 164, 137, 158, 157, 159, + 156, 165, 137, 138, 138, 154, 138, 138, 138, 138, + 138, 158, 160, 161, 154, 159, 166, 163, 164, 167, + 161, 169, 160, 168, 170, 165, 160, 163, 172, 168, + 171, 175, 540, 174, 173, 183, 166, 179, 172, 163, + 171, 173, 174, 170, 176, 167, 170, 171, 177, 169, + + 178, 175, 180, 181, 176, 182, 179, 183, 177, 184, + 178, 185, 180, 187, 182, 188, 189, 196, 181, 199, + 204, 210, 202, 187, 178, 184, 203, 240, 209, 205, + 204, 210, 189, 188, 539, 534, 185, 217, 196, 209, + 215, 211, 240, 199, 201, 201, 201, 201, 202, 214, + 203, 201, 201, 205, 201, 201, 201, 201, 201, 201, + 211, 217, 215, 218, 219, 220, 214, 221, 222, 224, + 223, 228, 231, 214, 234, 220, 219, 235, 222, 218, + 223, 236, 231, 237, 234, 238, 222, 221, 243, 237, + 228, 235, 241, 239, 238, 224, 244, 241, 236, 239, + + 246, 246, 246, 246, 256, 261, 526, 243, 246, 520, + 256, 261, 247, 247, 246, 247, 247, 247, 247, 251, + 244, 248, 248, 248, 248, 249, 249, 249, 249, 249, + 250, 250, 250, 250, 250, 252, 253, 251, 255, 258, + 259, 260, 262, 252, 263, 264, 265, 258, 267, 266, + 276, 269, 273, 268, 253, 274, 255, 260, 263, 268, + 262, 269, 275, 265, 259, 266, 270, 279, 281, 283, + 267, 280, 284, 264, 270, 276, 273, 280, 281, 274, + 285, 283, 286, 279, 287, 275, 289, 275, 288, 292, + 293, 294, 295, 297, 284, 298, 301, 305, 304, 287, + + 514, 286, 285, 302, 288, 289, 293, 305, 292, 304, + 301, 302, 306, 310, 298, 294, 309, 312, 297, 295, + 314, 310, 313, 306, 316, 321, 309, 312, 313, 319, + 320, 321, 316, 322, 324, 326, 314, 328, 329, 336, + 319, 320, 331, 331, 331, 331, 334, 333, 328, 337, + 340, 322, 329, 333, 343, 334, 324, 337, 338, 326, + 328, 339, 336, 341, 338, 344, 345, 339, 342, 346, + 347, 349, 340, 341, 343, 342, 345, 352, 347, 349, + 353, 354, 355, 357, 356, 344, 359, 346, 360, 361, + 364, 352, 355, 362, 353, 366, 365, 367, 368, 354, + + 356, 357, 370, 362, 365, 366, 360, 369, 364, 361, + 359, 371, 368, 372, 374, 373, 370, 369, 375, 377, + 378, 382, 367, 388, 379, 374, 380, 384, 386, 388, + 371, 373, 377, 379, 385, 384, 380, 372, 375, 387, + 386, 382, 389, 385, 378, 390, 392, 393, 396, 395, + 399, 397, 403, 387, 404, 400, 401, 403, 403, 409, + 392, 397, 408, 390, 414, 419, 389, 395, 508, 412, + 408, 393, 420, 399, 400, 401, 409, 396, 404, 412, + 413, 416, 422, 423, 425, 426, 413, 419, 414, 416, + 420, 433, 430, 436, 425, 437, 426, 430, 438, 439, + + 422, 423, 440, 442, 433, 443, 446, 438, 447, 436, + 448, 450, 452, 439, 455, 449, 453, 454, 437, 456, + 440, 450, 452, 457, 443, 458, 459, 442, 446, 456, + 447, 449, 453, 454, 458, 461, 455, 448, 462, 463, + 464, 457, 465, 466, 468, 467, 464, 469, 462, 471, + 459, 472, 465, 467, 473, 463, 474, 476, 477, 469, + 478, 461, 485, 486, 487, 494, 474, 466, 468, 499, + 478, 486, 485, 476, 471, 472, 477, 488, 473, 490, + 491, 492, 497, 487, 488, 500, 491, 490, 497, 494, + 498, 501, 502, 499, 504, 492, 503, 505, 506, 501, + + 498, 507, 500, 505, 503, 509, 510, 507, 511, 512, + 504, 513, 515, 517, 506, 516, 502, 518, 515, 512, + 509, 519, 521, 510, 522, 516, 523, 524, 511, 517, + 528, 525, 521, 518, 527, 513, 530, 519, 528, 529, + 531, 532, 533, 535, 523, 537, 524, 525, 522, 536, + 527, 535, 538, 529, 530, 542, 544, 536, 547, 496, + 495, 493, 531, 542, 533, 532, 544, 489, 484, 483, + 482, 481, 480, 479, 475, 537, 538, 470, 460, 451, + 547, 550, 550, 550, 550, 550, 551, 551, 553, 445, + 553, 553, 553, 554, 554, 556, 556, 556, 556, 556, + + 444, 441, 435, 434, 432, 431, 429, 428, 427, 424, + 421, 418, 417, 415, 411, 410, 407, 406, 405, 402, + 398, 394, 391, 383, 381, 376, 363, 358, 351, 350, + 348, 335, 332, 330, 327, 325, 323, 318, 317, 315, + 311, 308, 307, 303, 300, 296, 291, 290, 282, 278, + 277, 272, 271, 257, 254, 242, 233, 232, 230, 229, + 227, 226, 225, 216, 213, 212, 208, 207, 206, 200, + 198, 197, 195, 194, 193, 192, 191, 190, 186, 162, + 153, 149, 146, 143, 140, 136, 133, 117, 92, 71, + 62, 52, 41, 39, 8, 7, 3, 549, 549, 549, + + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549 } ; -static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; -static char *yy_full_match; -static int yy_lp; -#define REJECT \ -{ \ -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ -yy_cp = yy_full_match; /* restore poss. backed-over text */ \ -++yy_lp; \ -goto find_rule; \ -} +/* Table of booleans, true if rule could match eol. */ +static yyconst flex_int32_t yy_rule_can_match_eol[137] = + { 0, +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int llvmAsm_flex_debug; +int llvmAsm_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -#define INITIAL 0 +char *llvmAsmtext; +#line 1 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // // The LLVM Compiler Infrastructure @@ -883,8 +944,7 @@ // This file implements the flex scanner for LLVM assembly languages files. // //===----------------------------------------------------------------------===*/ -#define YY_NEVER_INTERACTIVE 1 -#line 28 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 28 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -893,10 +953,10 @@ #include void set_scan_file(FILE * F){ - yy_switch_to_buffer(yy_create_buffer( F, YY_BUF_SIZE ) ); + llvmAsm_switch_to_buffer(llvmAsm_create_buffer(F,YY_BUF_SIZE ) ); } void set_scan_string (const char * str) { - yy_scan_string (str); + llvmAsm_scan_string (str); } // Construct a token value for a non-obsolete token @@ -1017,7 +1077,23 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 1021 "Lexer.cpp" +#line 1081 "Lexer.cpp" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1025,65 +1101,30 @@ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int llvmAsmwrap (void ); #else -extern int yywrap YY_PROTO(( void )); +extern int llvmAsmwrap (void ); #endif #endif -#ifndef YY_NO_UNPUT -static inline void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - + static inline void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif +#ifdef __cplusplus +static int yyinput (void ); #else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 +static int input (void ); #endif -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -1092,12 +1133,11 @@ #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#define ECHO (void) fwrite( llvmAsmtext, llvmAsmleng, 1, llvmAsmout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1105,21 +1145,35 @@ */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( llvmAsmin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ + if ( c == EOF && ferror( llvmAsmin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, llvmAsmin))==0 && ferror(llvmAsmin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(llvmAsmin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1140,14 +1194,20 @@ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif +#define YY_DECL_IS_OURS 1 + +extern int llvmAsmlex (void); -/* Code executed at the beginning of each rule, after yytext and yyleng +#define YY_DECL int llvmAsmlex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after llvmAsmtext and llvmAsmleng * have been set up. */ #ifndef YY_USER_ACTION @@ -1162,360 +1222,365 @@ #define YY_RULE_SETUP \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; + +#line 190 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" -#line 190 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 1237 "Lexer.cpp" -#line 1175 "Lexer.cpp" - - if ( yy_init ) + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! yyin ) - yyin = stdin; + if ( ! llvmAsmin ) + llvmAsmin = stdin; - if ( ! yyout ) - yyout = stdout; + if ( ! llvmAsmout ) + llvmAsmout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); + if ( ! YY_CURRENT_BUFFER ) { + llvmAsmensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); + } - yy_load_buffer_state(); + llvmAsm_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); - /* Support of yytext. */ - *yy_cp = yy_hold_char; + /* Support of llvmAsmtext. */ + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; + yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 539 ) + if ( yy_current_state >= 550 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 538 ); + while ( yy_current_state != 549 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_find_action: - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; -find_rule: /* we branch to this label when backing up */ - for ( ; ; ) /* until we find what rule we matched */ - { - if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) - { - yy_act = yy_acclist[yy_lp]; - { - yy_full_match = yy_cp; - break; - } - } - --yy_cp; - yy_current_state = *--yy_state_ptr; - yy_lp = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; - if ( yy_act != YY_END_OF_BUFFER ) + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - ++yylineno; + for ( yyl = 0; yyl < llvmAsmleng; ++yyl ) + if ( llvmAsmtext[yyl] == '\n' ) + + llvmAsmlineno++; +; } do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + case 1: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 192 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 194 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 194 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 195 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 196 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 197 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 198 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 199 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return DEFINE; } YY_BREAK case 8: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 200 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 9: YY_RULE_SETUP -#line 201 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 201 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 10: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 202 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 11: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 203 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 12: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 204 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 13: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 205 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 14: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 206 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return DLLIMPORT; } YY_BREAK case 15: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 207 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return DLLEXPORT; } YY_BREAK case 16: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 208 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return HIDDEN; } YY_BREAK case 17: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 209 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return EXTERN_WEAK; } YY_BREAK case 18: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 210 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 19: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return ZEROINITIALIZER; } +#line 211 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return THREAD_LOCAL; } YY_BREAK case 20: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return DOTDOTDOT; } +#line 212 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return ZEROINITIALIZER; } YY_BREAK case 21: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return UNDEF; } +#line 213 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return DOTDOTDOT; } YY_BREAK case 22: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return NULL_TOK; } +#line 214 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return UNDEF; } YY_BREAK case 23: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return TO; } +#line 215 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return NULL_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return TAIL; } +#line 216 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return TO; } YY_BREAK case 25: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return TARGET; } +#line 217 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return TAIL; } YY_BREAK case 26: YY_RULE_SETUP -#line 218 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return TRIPLE; } +#line 218 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return TARGET; } YY_BREAK case 27: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return DEPLIBS; } +#line 219 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return TRIPLE; } YY_BREAK case 28: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return DATALAYOUT; } +#line 220 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return DEPLIBS; } YY_BREAK case 29: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return VOLATILE; } +#line 221 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return DATALAYOUT; } YY_BREAK case 30: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return ALIGN; } +#line 222 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return VOLATILE; } YY_BREAK case 31: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return SECTION; } +#line 223 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return ALIGN; } YY_BREAK case 32: YY_RULE_SETUP -#line 224 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return MODULE; } +#line 224 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return SECTION; } YY_BREAK case 33: YY_RULE_SETUP -#line 225 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return ASM_TOK; } +#line 225 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return MODULE; } YY_BREAK case 34: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return SIDEEFFECT; } +#line 226 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return ASM_TOK; } YY_BREAK case 35: YY_RULE_SETUP -#line 228 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return CC_TOK; } +#line 227 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return SIDEEFFECT; } YY_BREAK case 36: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return CCC_TOK; } +#line 229 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return CC_TOK; } YY_BREAK case 37: YY_RULE_SETUP -#line 230 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return FASTCC_TOK; } +#line 230 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return CCC_TOK; } YY_BREAK case 38: YY_RULE_SETUP -#line 231 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return COLDCC_TOK; } +#line 231 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return FASTCC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 232 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return X86_STDCALLCC_TOK; } +#line 232 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return COLDCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return X86_FASTCALLCC_TOK; } +#line 233 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return X86_STDCALLCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 235 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return INREG; } +#line 234 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return X86_FASTCALLCC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return SRET; } +#line 236 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return INREG; } YY_BREAK case 43: YY_RULE_SETUP -#line 237 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return NOUNWIND; } +#line 237 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return SRET; } YY_BREAK case 44: YY_RULE_SETUP -#line 238 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return NORETURN; } +#line 238 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return NOUNWIND; } YY_BREAK case 45: YY_RULE_SETUP -#line 240 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::VoidTy, VOID); } +#line 239 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return NORETURN; } YY_BREAK case 46: YY_RULE_SETUP -#line 241 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::FloatTy, FLOAT); } +#line 241 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ RET_TY(Type::VoidTy, VOID); } YY_BREAK case 47: YY_RULE_SETUP -#line 242 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::DoubleTy,DOUBLE);} +#line 242 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ RET_TY(Type::FloatTy, FLOAT); } YY_BREAK case 48: YY_RULE_SETUP -#line 243 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ RET_TY(Type::LabelTy, LABEL); } +#line 243 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ RET_TY(Type::DoubleTy,DOUBLE);} YY_BREAK case 49: YY_RULE_SETUP -#line 244 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return TYPE; } +#line 244 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ RET_TY(Type::LabelTy, LABEL); } YY_BREAK case 50: YY_RULE_SETUP -#line 245 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return OPAQUE; } +#line 245 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return TYPE; } YY_BREAK case 51: YY_RULE_SETUP -#line 246 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ uint64_t NumBits = atoull(yytext+1); +#line 246 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return OPAQUE; } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 247 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ uint64_t NumBits = atoull(llvmAsmtext+1); if (NumBits < IntegerType::MIN_INT_BITS || NumBits > IntegerType::MAX_INT_BITS) GenerateError("Bitwidth for integer type out of range!"); @@ -1523,412 +1588,415 @@ RET_TY(Ty, INTTYPE); } YY_BREAK -case 52: +case 53: YY_RULE_SETUP -#line 254 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 255 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK -case 53: +case 54: YY_RULE_SETUP -#line 255 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 256 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK -case 54: +case 55: YY_RULE_SETUP -#line 256 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 257 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK -case 55: +case 56: YY_RULE_SETUP -#line 257 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 258 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, UDiv, UDIV); } YY_BREAK -case 56: +case 57: YY_RULE_SETUP -#line 258 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 259 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SDiv, SDIV); } YY_BREAK -case 57: +case 58: YY_RULE_SETUP -#line 259 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 260 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FDiv, FDIV); } YY_BREAK -case 58: +case 59: YY_RULE_SETUP -#line 260 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 261 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, URem, UREM); } YY_BREAK -case 59: +case 60: YY_RULE_SETUP -#line 261 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 262 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SRem, SREM); } YY_BREAK -case 60: +case 61: YY_RULE_SETUP -#line 262 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 263 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, FRem, FREM); } YY_BREAK -case 61: +case 62: YY_RULE_SETUP -#line 263 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 264 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Shl, SHL); } YY_BREAK -case 62: +case 63: YY_RULE_SETUP -#line 264 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 265 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, LShr, LSHR); } YY_BREAK -case 63: +case 64: YY_RULE_SETUP -#line 265 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 266 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, AShr, ASHR); } YY_BREAK -case 64: +case 65: YY_RULE_SETUP -#line 266 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 267 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, And, AND); } YY_BREAK -case 65: +case 66: YY_RULE_SETUP -#line 267 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 268 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK -case 66: +case 67: YY_RULE_SETUP -#line 268 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 269 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK -case 67: +case 68: YY_RULE_SETUP -#line 269 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 270 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ICmp, ICMP); } YY_BREAK -case 68: +case 69: YY_RULE_SETUP -#line 270 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 271 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, FCmp, FCMP); } YY_BREAK -case 69: +case 70: YY_RULE_SETUP -#line 272 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 273 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return EQ; } YY_BREAK -case 70: +case 71: YY_RULE_SETUP -#line 273 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 274 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return NE; } YY_BREAK -case 71: +case 72: YY_RULE_SETUP -#line 274 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 275 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return SLT; } YY_BREAK -case 72: +case 73: YY_RULE_SETUP -#line 275 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 276 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return SGT; } YY_BREAK -case 73: +case 74: YY_RULE_SETUP -#line 276 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 277 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return SLE; } YY_BREAK -case 74: +case 75: YY_RULE_SETUP -#line 277 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 278 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return SGE; } YY_BREAK -case 75: +case 76: YY_RULE_SETUP -#line 278 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 279 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return ULT; } YY_BREAK -case 76: +case 77: YY_RULE_SETUP -#line 279 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 280 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return UGT; } YY_BREAK -case 77: +case 78: YY_RULE_SETUP -#line 280 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 281 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return ULE; } YY_BREAK -case 78: +case 79: YY_RULE_SETUP -#line 281 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 282 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return UGE; } YY_BREAK -case 79: +case 80: YY_RULE_SETUP -#line 282 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 283 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return OEQ; } YY_BREAK -case 80: +case 81: YY_RULE_SETUP -#line 283 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 284 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return ONE; } YY_BREAK -case 81: +case 82: YY_RULE_SETUP -#line 284 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 285 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return OLT; } YY_BREAK -case 82: +case 83: YY_RULE_SETUP -#line 285 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 286 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return OGT; } YY_BREAK -case 83: +case 84: YY_RULE_SETUP -#line 286 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 287 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return OLE; } YY_BREAK -case 84: +case 85: YY_RULE_SETUP -#line 287 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 288 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return OGE; } YY_BREAK -case 85: +case 86: YY_RULE_SETUP -#line 288 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 289 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return ORD; } YY_BREAK -case 86: +case 87: YY_RULE_SETUP -#line 289 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 290 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return UNO; } YY_BREAK -case 87: +case 88: YY_RULE_SETUP -#line 290 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 291 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return UEQ; } YY_BREAK -case 88: +case 89: YY_RULE_SETUP -#line 291 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 292 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { return UNE; } YY_BREAK -case 89: +case 90: YY_RULE_SETUP -#line 293 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 294 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK -case 90: +case 91: YY_RULE_SETUP -#line 294 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 295 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK -case 91: +case 92: YY_RULE_SETUP -#line 295 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 296 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, Trunc, TRUNC); } YY_BREAK -case 92: +case 93: YY_RULE_SETUP -#line 296 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 297 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, ZExt, ZEXT); } YY_BREAK -case 93: +case 94: YY_RULE_SETUP -#line 297 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 298 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SExt, SEXT); } YY_BREAK -case 94: +case 95: YY_RULE_SETUP -#line 298 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 299 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPTrunc, FPTRUNC); } YY_BREAK -case 95: +case 96: YY_RULE_SETUP -#line 299 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 300 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPExt, FPEXT); } YY_BREAK -case 96: +case 97: YY_RULE_SETUP -#line 300 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 301 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, UIToFP, UITOFP); } YY_BREAK -case 97: +case 98: YY_RULE_SETUP -#line 301 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 302 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, SIToFP, SITOFP); } YY_BREAK -case 98: +case 99: YY_RULE_SETUP -#line 302 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 303 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToUI, FPTOUI); } YY_BREAK -case 99: +case 100: YY_RULE_SETUP -#line 303 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 304 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, FPToSI, FPTOSI); } YY_BREAK -case 100: +case 101: YY_RULE_SETUP -#line 304 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 305 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, IntToPtr, INTTOPTR); } YY_BREAK -case 101: +case 102: YY_RULE_SETUP -#line 305 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 306 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, PtrToInt, PTRTOINT); } YY_BREAK -case 102: +case 103: YY_RULE_SETUP -#line 306 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 307 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(CastOpVal, BitCast, BITCAST); } YY_BREAK -case 103: +case 104: YY_RULE_SETUP -#line 307 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 308 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK -case 104: +case 105: YY_RULE_SETUP -#line 308 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 309 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK -case 105: +case 106: YY_RULE_SETUP -#line 309 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 310 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK -case 106: +case 107: YY_RULE_SETUP -#line 310 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 311 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK -case 107: +case 108: YY_RULE_SETUP -#line 311 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 312 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK -case 108: +case 109: YY_RULE_SETUP -#line 312 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 313 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK -case 109: +case 110: YY_RULE_SETUP -#line 313 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 314 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK -case 110: +case 111: YY_RULE_SETUP -#line 314 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 315 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK -case 111: +case 112: YY_RULE_SETUP -#line 316 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 317 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK -case 112: +case 113: YY_RULE_SETUP -#line 317 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 318 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK -case 113: +case 114: YY_RULE_SETUP -#line 318 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 319 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK -case 114: +case 115: YY_RULE_SETUP -#line 319 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 320 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK -case 115: +case 116: YY_RULE_SETUP -#line 320 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 321 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK -case 116: +case 117: YY_RULE_SETUP -#line 321 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 322 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK -case 117: +case 118: YY_RULE_SETUP -#line 323 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 324 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK -case 118: +case 119: YY_RULE_SETUP -#line 324 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 325 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK -case 119: +case 120: YY_RULE_SETUP -#line 325 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 326 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK -case 120: +case 121: YY_RULE_SETUP -#line 328 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 329 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - UnEscapeLexed(yytext+1); - llvmAsmlval.StrVal = strdup(yytext+1); // Skip % + UnEscapeLexed(llvmAsmtext+1); + llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Skip % return LOCALVAR; } YY_BREAK -case 121: +case 122: YY_RULE_SETUP -#line 333 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 334 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - UnEscapeLexed(yytext+1); - llvmAsmlval.StrVal = strdup(yytext+1); // Skip @ + UnEscapeLexed(llvmAsmtext+1); + llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Skip @ return GLOBALVAR; } YY_BREAK -case 122: +case 123: YY_RULE_SETUP -#line 338 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 339 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - yytext[strlen(yytext)-1] = 0; // nuke colon - UnEscapeLexed(yytext); - llvmAsmlval.StrVal = strdup(yytext); + llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke colon + UnEscapeLexed(llvmAsmtext); + llvmAsmlval.StrVal = strdup(llvmAsmtext); return LABELSTR; } YY_BREAK -case 123: +case 124: +/* rule 124 can match eol */ YY_RULE_SETUP -#line 344 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 345 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - yytext[strlen(yytext)-2] = 0; // nuke colon, end quote - UnEscapeLexed(yytext+1); - llvmAsmlval.StrVal = strdup(yytext+1); + llvmAsmtext[strlen(llvmAsmtext)-2] = 0; // nuke colon, end quote + UnEscapeLexed(llvmAsmtext+1); + llvmAsmlval.StrVal = strdup(llvmAsmtext+1); return LABELSTR; } YY_BREAK -case 124: +case 125: +/* rule 125 can match eol */ YY_RULE_SETUP -#line 351 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 352 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a // [sbyte] c"Hello World\00" constant, for example. // - yytext[strlen(yytext)-1] = 0; // nuke end quote - llvmAsmlval.StrVal = strdup(yytext+1); // Nuke start quote + llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke end quote + llvmAsmlval.StrVal = strdup(llvmAsmtext+1); // Nuke start quote return STRINGCONSTANT; } YY_BREAK -case 125: +case 126: +/* rule 126 can match eol */ YY_RULE_SETUP -#line 360 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 361 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - yytext[strlen(yytext)-1] = 0; // nuke end quote - llvmAsmlval.StrVal = strdup(yytext+2); // Nuke @, quote + llvmAsmtext[strlen(llvmAsmtext)-1] = 0; // nuke end quote + llvmAsmlval.StrVal = strdup(llvmAsmtext+2); // Nuke @, quote return ATSTRINGCONSTANT; } YY_BREAK -case 126: +case 127: YY_RULE_SETUP -#line 366 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ int len = strlen(yytext); +#line 367 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ int len = strlen(llvmAsmtext); uint32_t numBits = ((len * 64) / 19) + 1; - APInt Tmp(numBits, yytext, len, 10); + APInt Tmp(numBits, llvmAsmtext, len, 10); uint32_t activeBits = Tmp.getActiveBits(); if (activeBits > 0 && activeBits < numBits) Tmp.trunc(activeBits); @@ -1941,12 +2009,12 @@ } } YY_BREAK -case 127: +case 128: YY_RULE_SETUP -#line 380 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ int len = strlen(yytext); +#line 381 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ int len = strlen(llvmAsmtext); uint32_t numBits = (((len-1) * 64) / 19) + 2; - APInt Tmp(numBits, yytext, len, 10); + APInt Tmp(numBits, llvmAsmtext, len, 10); uint32_t minBits = Tmp.getMinSignedBits(); if (minBits > 0 && minBits < numBits) Tmp.trunc(minBits); @@ -1959,19 +2027,19 @@ } } YY_BREAK -case 128: +case 129: YY_RULE_SETUP -#line 395 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ int len = strlen(yytext+3) - 3; +#line 396 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ int len = strlen(llvmAsmtext+3) - 3; uint32_t bits = len * 4; - APInt Tmp(bits, yytext+3, len, 16); + APInt Tmp(bits, llvmAsmtext+3, len, 16); uint32_t activeBits = Tmp.getActiveBits(); if (activeBits > 0 && activeBits < bits) Tmp.trunc(activeBits); if (Tmp.getBitWidth() > 64) { llvmAsmlval.APIntVal = new APInt(Tmp); - return yytext[0] == 's' ? ESAPINTVAL : EUAPINTVAL; - } else if (yytext[0] == 's') { + return llvmAsmtext[0] == 's' ? ESAPINTVAL : EUAPINTVAL; + } else if (llvmAsmtext[0] == 's') { llvmAsmlval.SInt64Val = Tmp.getSExtValue(); return ESINT64VAL; } else { @@ -1980,88 +2048,89 @@ } } YY_BREAK -case 129: +case 130: YY_RULE_SETUP -#line 413 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 414 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - uint64_t Val = atoull(yytext+1); + uint64_t Val = atoull(llvmAsmtext+1); if ((unsigned)Val != Val) GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); return LOCALVAL_ID; } YY_BREAK -case 130: +case 131: YY_RULE_SETUP -#line 420 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 421 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { - uint64_t Val = atoull(yytext+1); + uint64_t Val = atoull(llvmAsmtext+1); if ((unsigned)Val != Val) GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); return GLOBALVAL_ID; } YY_BREAK -case 131: +case 132: YY_RULE_SETUP -#line 428 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ llvmAsmlval.FPVal = atof(yytext); return FPVAL; } +#line 429 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ llvmAsmlval.FPVal = atof(llvmAsmtext); return FPVAL; } YY_BREAK -case 132: +case 133: YY_RULE_SETUP -#line 429 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } +#line 430 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ llvmAsmlval.FPVal = HexToFP(llvmAsmtext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 431 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 432 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! */ - yy_delete_buffer(YY_CURRENT_BUFFER); + llvmAsm_delete_buffer(YY_CURRENT_BUFFER); return EOF; } YY_BREAK -case 133: +case 134: +/* rule 134 can match eol */ YY_RULE_SETUP -#line 439 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 440 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK -case 134: +case 135: YY_RULE_SETUP -#line 440 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" -{ return yytext[0]; } +#line 441 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" +{ return llvmAsmtext[0]; } YY_BREAK -case 135: +case 136: YY_RULE_SETUP -#line 442 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" +#line 443 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2041 "Lexer.cpp" +#line 2110 "Lexer.cpp" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * just pointed llvmAsmin at a new source and called + * llvmAsmlex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = llvmAsmin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -2071,13 +2140,13 @@ * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -2090,41 +2159,42 @@ yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( llvmAsmwrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up - * yytext, we can now set up + * llvmAsmtext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2132,30 +2202,30 @@ else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2166,8 +2236,7 @@ "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - +} /* end of llvmAsmlex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -2176,21 +2245,20 @@ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2210,34 +2278,30 @@ /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -2250,8 +2314,7 @@ b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + llvmAsmrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2261,35 +2324,35 @@ YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + llvmAsmrestart(llvmAsmin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2297,149 +2360,141 @@ else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; - } - +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; + + yy_current_state = (yy_start); - yy_current_state = yy_start; - yy_state_ptr = yy_state_buf; - *yy_state_ptr++ = yy_current_state; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 539 ) + if ( yy_current_state >= 550 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - *yy_state_ptr++ = yy_current_state; } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 539 ) + if ( yy_current_state >= 550 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 538); - if ( ! yy_is_jam ) - *yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 549); return yy_is_jam ? 0 : yy_current_state; - } - +} -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static inline void yyunput( int c, register char *yy_bp ) -#else -static inline void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static inline void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + /* undo effects of setting up llvmAsmtext */ + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; - if ( c == '\n' ) - --yylineno; - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ + if ( c == '\n' ){ + --llvmAsmlineno; + } + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { - int c; - *yy_c_buf_p = yy_hold_char; +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2453,16 +2508,16 @@ */ /* Reset buffer status. */ - yyrestart( yyin ); + llvmAsmrestart(llvmAsmin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( llvmAsmwrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2472,169 +2527,170 @@ } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve llvmAsmtext */ + (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) - ++yylineno; + + llvmAsmlineno++; +; return c; - } -#endif /* YY_NO_INPUT */ - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); +} +#endif /* ifndef YY_NO_INPUT */ - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void llvmAsmrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + llvmAsmensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + llvmAsm_create_buffer(llvmAsmin,YY_BUF_SIZE ); } + llvmAsm_init_buffer(YY_CURRENT_BUFFER,input_file ); + llvmAsm_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void llvmAsm_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * llvmAsmpop_buffer_state(); + * llvmAsmpush_buffer_state(new_buffer); + */ + llvmAsmensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + llvmAsm_load_buffer_state( ); /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe + * EOF (llvmAsmwrap()) processing, but the only time this flag + * is looked at is after llvmAsmwrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void llvmAsm_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + llvmAsmin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE llvmAsm_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) llvmAsmalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + llvmAsm_init_buffer(b,file ); return b; - } - +} -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with llvmAsm_create_buffer() + * + */ + void llvmAsm_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } + llvmAsmfree((void *) b->yy_ch_buf ); + llvmAsmfree((void *) b ); +} +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a llvmAsmrestart() or at EOF. + */ + static void llvmAsm_init_buffer (YY_BUFFER_STATE b, FILE * file ) -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + llvmAsm_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - + /* If b is the current buffer, then llvmAsm_init_buffer was _probably_ + * called from llvmAsmrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif + b->yy_is_interactive = 0; + + errno = oerrno; +} - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void llvmAsm_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -2651,31 +2707,123 @@ b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + llvmAsm_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void llvmAsmpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + llvmAsmensure_buffer_stack(); + + /* This block is copied from llvmAsm_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from llvmAsm_switch_to_buffer. */ + llvmAsm_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void llvmAsmpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + llvmAsm_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } +} +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void llvmAsmensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)llvmAsmrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE llvmAsm_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) llvmAsmalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; @@ -2687,58 +2835,53 @@ b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + llvmAsm_switch_to_buffer(b ); return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to llvmAsmlex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * llvmAsm_scan_bytes() instead. + */ +YY_BUFFER_STATE llvmAsm_scan_string (yyconst char * yystr ) +{ + + return llvmAsm_scan_bytes(yystr,strlen(yystr) ); +} -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to llvmAsmlex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE llvmAsm_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); + n = _yybytes_len + 2; + buf = (char *) llvmAsmalloc(n ); if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + YY_FATAL_ERROR( "out of dynamic memory in llvmAsm_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = llvmAsm_scan_buffer(buf,n ); if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + YY_FATAL_ERROR( "bad buffer in llvmAsm_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. @@ -2746,148 +2889,199 @@ b->yy_is_our_buffer = 1; return b; - } -#endif - +} -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 #endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); +/* Redefine yyless() so it works in section 3 code. */ - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up llvmAsmtext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + llvmAsmtext[llvmAsmleng] = (yy_hold_char); \ + (yy_c_buf_p) = llvmAsmtext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + llvmAsmleng = yyless_macro_arg; \ + } \ + while ( 0 ) - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } +/* Accessor methods (get/set functions) to struct members. */ - yy_start_stack[yy_start_stack_ptr++] = YY_START; +/** Get the current line number. + * + */ +int llvmAsmget_lineno (void) +{ + + return llvmAsmlineno; +} - BEGIN(new_state); - } -#endif +/** Get the input stream. + * + */ +FILE *llvmAsmget_in (void) +{ + return llvmAsmin; +} +/** Get the output stream. + * + */ +FILE *llvmAsmget_out (void) +{ + return llvmAsmout; +} -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); +/** Get the length of the current token. + * + */ +int llvmAsmget_leng (void) +{ + return llvmAsmleng; +} - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif +/** Get the current token. + * + */ +char *llvmAsmget_text (void) +{ + return llvmAsmtext; +} -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif +/** Set the current line number. + * @param line_number + * + */ +void llvmAsmset_lineno (int line_number ) +{ + + llvmAsmlineno = line_number; +} -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see llvmAsm_switch_to_buffer + */ +void llvmAsmset_in (FILE * in_str ) +{ + llvmAsmin = in_str ; +} -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } +void llvmAsmset_out (FILE * out_str ) +{ + llvmAsmout = out_str ; +} +int llvmAsmget_debug (void) +{ + return llvmAsm_flex_debug; +} +void llvmAsmset_debug (int bdebug ) +{ + llvmAsm_flex_debug = bdebug ; +} -/* Redefine yyless() so it works in section 3 code. */ +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from llvmAsmlex_destroy(), so don't allocate here. + */ + + /* We do not touch llvmAsmlineno unless the option is enabled. */ + llvmAsmlineno = 1; + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + llvmAsmin = stdin; + llvmAsmout = stdout; +#else + llvmAsmin = (FILE *) 0; + llvmAsmout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * llvmAsmlex_init() + */ + return 0; +} -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) +/* llvmAsmlex_destroy is for both reentrant and non-reentrant scanners. */ +int llvmAsmlex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + llvmAsm_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + llvmAsmpop_buffer_state(); + } + + /* Destroy the stack itself. */ + llvmAsmfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * llvmAsmlex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; +} -/* Internal utility routines. */ +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *llvmAsmalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static inline void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static inline void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *llvmAsmrealloc (void * ptr, yy_size_t size ) +{ /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2896,24 +3090,16 @@ * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} + +void llvmAsmfree (void * ptr ) +{ + free( (char *) ptr ); /* see llvmAsmrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 443 "/home/laurov/llvm/llvm/lib/AsmParser/Lexer.l" -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 442 "/proj/llvm/llvm-1/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.104 llvm/lib/AsmParser/Lexer.l:1.105 --- llvm/lib/AsmParser/Lexer.l:1.104 Sun Apr 8 20:55:42 2007 +++ llvm/lib/AsmParser/Lexer.l Thu Apr 12 13:32:50 2007 @@ -208,6 +208,7 @@ hidden { return HIDDEN; } extern_weak { return EXTERN_WEAK; } external { return EXTERNAL; } +thread_local { return THREAD_LOCAL; } zeroinitializer { return ZEROINITIALIZER; } \.\.\. { return DOTDOTDOT; } undef { return UNDEF; } Index: llvm/lib/AsmParser/Lexer.l.cvs diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.31 llvm/lib/AsmParser/Lexer.l.cvs:1.32 --- llvm/lib/AsmParser/Lexer.l.cvs:1.31 Sun Apr 8 20:56:05 2007 +++ llvm/lib/AsmParser/Lexer.l.cvs Thu Apr 12 13:32:50 2007 @@ -208,6 +208,7 @@ hidden { return HIDDEN; } extern_weak { return EXTERN_WEAK; } external { return EXTERNAL; } +thread_local { return THREAD_LOCAL; } zeroinitializer { return ZEROINITIALIZER; } \.\.\. { return DOTDOTDOT; } undef { return UNDEF; } Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.83 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.84 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.83 Tue Apr 10 21:44:19 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Thu Apr 12 13:32:50 2007 @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Skeleton implementation 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 @@ -18,13 +20,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* 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. */ +/* 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. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* 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 @@ -37,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.1" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -93,108 +103,109 @@ CONSTANT = 284, SECTION = 285, VOLATILE = 286, - TO = 287, - DOTDOTDOT = 288, - NULL_TOK = 289, - UNDEF = 290, - INTERNAL = 291, - LINKONCE = 292, - WEAK = 293, - APPENDING = 294, - DLLIMPORT = 295, - DLLEXPORT = 296, - EXTERN_WEAK = 297, - OPAQUE = 298, - EXTERNAL = 299, - TARGET = 300, - TRIPLE = 301, - ALIGN = 302, - DEPLIBS = 303, - CALL = 304, - TAIL = 305, - ASM_TOK = 306, - MODULE = 307, - SIDEEFFECT = 308, - CC_TOK = 309, - CCC_TOK = 310, - FASTCC_TOK = 311, - COLDCC_TOK = 312, - X86_STDCALLCC_TOK = 313, - X86_FASTCALLCC_TOK = 314, - DATALAYOUT = 315, - RET = 316, - BR = 317, - SWITCH = 318, - INVOKE = 319, - UNWIND = 320, - UNREACHABLE = 321, - ADD = 322, - SUB = 323, - MUL = 324, - UDIV = 325, - SDIV = 326, - FDIV = 327, - UREM = 328, - SREM = 329, - FREM = 330, - AND = 331, - OR = 332, - XOR = 333, - SHL = 334, - LSHR = 335, - ASHR = 336, - ICMP = 337, - FCMP = 338, - EQ = 339, - NE = 340, - SLT = 341, - SGT = 342, - SLE = 343, - SGE = 344, - ULT = 345, - UGT = 346, - ULE = 347, - UGE = 348, - OEQ = 349, - ONE = 350, - OLT = 351, - OGT = 352, - OLE = 353, - OGE = 354, - ORD = 355, - UNO = 356, - UEQ = 357, - UNE = 358, - MALLOC = 359, - ALLOCA = 360, - FREE = 361, - LOAD = 362, - STORE = 363, - GETELEMENTPTR = 364, - TRUNC = 365, - ZEXT = 366, - SEXT = 367, - FPTRUNC = 368, - FPEXT = 369, - BITCAST = 370, - UITOFP = 371, - SITOFP = 372, - FPTOUI = 373, - FPTOSI = 374, - INTTOPTR = 375, - PTRTOINT = 376, - PHI_TOK = 377, - SELECT = 378, - VAARG = 379, - EXTRACTELEMENT = 380, - INSERTELEMENT = 381, - SHUFFLEVECTOR = 382, - NORETURN = 383, - INREG = 384, - SRET = 385, - NOUNWIND = 386, - DEFAULT = 387, - HIDDEN = 388 + THREAD_LOCAL = 287, + TO = 288, + DOTDOTDOT = 289, + NULL_TOK = 290, + UNDEF = 291, + INTERNAL = 292, + LINKONCE = 293, + WEAK = 294, + APPENDING = 295, + DLLIMPORT = 296, + DLLEXPORT = 297, + EXTERN_WEAK = 298, + OPAQUE = 299, + EXTERNAL = 300, + TARGET = 301, + TRIPLE = 302, + ALIGN = 303, + DEPLIBS = 304, + CALL = 305, + TAIL = 306, + ASM_TOK = 307, + MODULE = 308, + SIDEEFFECT = 309, + CC_TOK = 310, + CCC_TOK = 311, + FASTCC_TOK = 312, + COLDCC_TOK = 313, + X86_STDCALLCC_TOK = 314, + X86_FASTCALLCC_TOK = 315, + DATALAYOUT = 316, + RET = 317, + BR = 318, + SWITCH = 319, + INVOKE = 320, + UNWIND = 321, + UNREACHABLE = 322, + ADD = 323, + SUB = 324, + MUL = 325, + UDIV = 326, + SDIV = 327, + FDIV = 328, + UREM = 329, + SREM = 330, + FREM = 331, + AND = 332, + OR = 333, + XOR = 334, + SHL = 335, + LSHR = 336, + ASHR = 337, + ICMP = 338, + FCMP = 339, + EQ = 340, + NE = 341, + SLT = 342, + SGT = 343, + SLE = 344, + SGE = 345, + ULT = 346, + UGT = 347, + ULE = 348, + UGE = 349, + OEQ = 350, + ONE = 351, + OLT = 352, + OGT = 353, + OLE = 354, + OGE = 355, + ORD = 356, + UNO = 357, + UEQ = 358, + UNE = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + TRUNC = 366, + ZEXT = 367, + SEXT = 368, + FPTRUNC = 369, + FPEXT = 370, + BITCAST = 371, + UITOFP = 372, + SITOFP = 373, + FPTOUI = 374, + FPTOSI = 375, + INTTOPTR = 376, + PTRTOINT = 377, + PHI_TOK = 378, + SELECT = 379, + VAARG = 380, + EXTRACTELEMENT = 381, + INSERTELEMENT = 382, + SHUFFLEVECTOR = 383, + NORETURN = 384, + INREG = 385, + SRET = 386, + NOUNWIND = 387, + DEFAULT = 388, + HIDDEN = 389 }; #endif /* Tokens. */ @@ -227,114 +238,115 @@ #define CONSTANT 284 #define SECTION 285 #define VOLATILE 286 -#define TO 287 -#define DOTDOTDOT 288 -#define NULL_TOK 289 -#define UNDEF 290 -#define INTERNAL 291 -#define LINKONCE 292 -#define WEAK 293 -#define APPENDING 294 -#define DLLIMPORT 295 -#define DLLEXPORT 296 -#define EXTERN_WEAK 297 -#define OPAQUE 298 -#define EXTERNAL 299 -#define TARGET 300 -#define TRIPLE 301 -#define ALIGN 302 -#define DEPLIBS 303 -#define CALL 304 -#define TAIL 305 -#define ASM_TOK 306 -#define MODULE 307 -#define SIDEEFFECT 308 -#define CC_TOK 309 -#define CCC_TOK 310 -#define FASTCC_TOK 311 -#define COLDCC_TOK 312 -#define X86_STDCALLCC_TOK 313 -#define X86_FASTCALLCC_TOK 314 -#define DATALAYOUT 315 -#define RET 316 -#define BR 317 -#define SWITCH 318 -#define INVOKE 319 -#define UNWIND 320 -#define UNREACHABLE 321 -#define ADD 322 -#define SUB 323 -#define MUL 324 -#define UDIV 325 -#define SDIV 326 -#define FDIV 327 -#define UREM 328 -#define SREM 329 -#define FREM 330 -#define AND 331 -#define OR 332 -#define XOR 333 -#define SHL 334 -#define LSHR 335 -#define ASHR 336 -#define ICMP 337 -#define FCMP 338 -#define EQ 339 -#define NE 340 -#define SLT 341 -#define SGT 342 -#define SLE 343 -#define SGE 344 -#define ULT 345 -#define UGT 346 -#define ULE 347 -#define UGE 348 -#define OEQ 349 -#define ONE 350 -#define OLT 351 -#define OGT 352 -#define OLE 353 -#define OGE 354 -#define ORD 355 -#define UNO 356 -#define UEQ 357 -#define UNE 358 -#define MALLOC 359 -#define ALLOCA 360 -#define FREE 361 -#define LOAD 362 -#define STORE 363 -#define GETELEMENTPTR 364 -#define TRUNC 365 -#define ZEXT 366 -#define SEXT 367 -#define FPTRUNC 368 -#define FPEXT 369 -#define BITCAST 370 -#define UITOFP 371 -#define SITOFP 372 -#define FPTOUI 373 -#define FPTOSI 374 -#define INTTOPTR 375 -#define PTRTOINT 376 -#define PHI_TOK 377 -#define SELECT 378 -#define VAARG 379 -#define EXTRACTELEMENT 380 -#define INSERTELEMENT 381 -#define SHUFFLEVECTOR 382 -#define NORETURN 383 -#define INREG 384 -#define SRET 385 -#define NOUNWIND 386 -#define DEFAULT 387 -#define HIDDEN 388 +#define THREAD_LOCAL 287 +#define TO 288 +#define DOTDOTDOT 289 +#define NULL_TOK 290 +#define UNDEF 291 +#define INTERNAL 292 +#define LINKONCE 293 +#define WEAK 294 +#define APPENDING 295 +#define DLLIMPORT 296 +#define DLLEXPORT 297 +#define EXTERN_WEAK 298 +#define OPAQUE 299 +#define EXTERNAL 300 +#define TARGET 301 +#define TRIPLE 302 +#define ALIGN 303 +#define DEPLIBS 304 +#define CALL 305 +#define TAIL 306 +#define ASM_TOK 307 +#define MODULE 308 +#define SIDEEFFECT 309 +#define CC_TOK 310 +#define CCC_TOK 311 +#define FASTCC_TOK 312 +#define COLDCC_TOK 313 +#define X86_STDCALLCC_TOK 314 +#define X86_FASTCALLCC_TOK 315 +#define DATALAYOUT 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define UDIV 326 +#define SDIV 327 +#define FDIV 328 +#define UREM 329 +#define SREM 330 +#define FREM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SHL 335 +#define LSHR 336 +#define ASHR 337 +#define ICMP 338 +#define FCMP 339 +#define EQ 340 +#define NE 341 +#define SLT 342 +#define SGT 343 +#define SLE 344 +#define SGE 345 +#define ULT 346 +#define UGT 347 +#define ULE 348 +#define UGE 349 +#define OEQ 350 +#define ONE 351 +#define OLT 352 +#define OGT 353 +#define OLE 354 +#define OGE 355 +#define ORD 356 +#define UNO 357 +#define UEQ 358 +#define UNE 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define TRUNC 366 +#define ZEXT 367 +#define SEXT 368 +#define FPTRUNC 369 +#define FPEXT 370 +#define BITCAST 371 +#define UITOFP 372 +#define SITOFP 373 +#define FPTOUI 374 +#define FPTOSI 375 +#define INTTOPTR 376 +#define PTRTOINT 377 +#define PHI_TOK 378 +#define SELECT 379 +#define VAARG 380 +#define EXTRACTELEMENT 381 +#define INSERTELEMENT 382 +#define SHUFFLEVECTOR 383 +#define NORETURN 384 +#define INREG 385 +#define SRET 386 +#define NOUNWIND 387 +#define DEFAULT 388 +#define HIDDEN 389 /* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 14 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1028,7 +1040,7 @@ GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool isConstantGlobal, const Type *Ty, - Constant *Initializer) { + Constant *Initializer, bool IsThreadLocal) { if (isa(Ty)) { GenerateError("Cannot declare global vars of function type"); return 0; @@ -1061,6 +1073,7 @@ GV->setLinkage(Linkage); GV->setVisibility(Visibility); GV->setConstant(isConstantGlobal); + GV->setThreadLocal(IsThreadLocal); InsertValue(GV, CurModule.Values); return GV; } @@ -1085,7 +1098,7 @@ // Otherwise there is no existing GV to use, create one now. GlobalVariable *GV = new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name, - CurModule.CurrentModule); + CurModule.CurrentModule, IsThreadLocal); GV->setVisibility(Visibility); InsertValue(GV, CurModule.Values); return GV; @@ -1276,9 +1289,10 @@ # define YYTOKEN_TABLE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 937 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 938 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1323,9 +1337,10 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -/* Line 196 of yacc.c. */ -#line 1329 "llvmAsmParser.tab.c" +} +/* Line 193 of yacc.c. */ +#line 1343 "llvmAsmParser.tab.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1336,23 +1351,56 @@ /* Copy the second part of user declarations. */ -/* Line 219 of yacc.c. */ -#line 1341 "llvmAsmParser.tab.c" +/* Line 216 of yacc.c. */ +#line 1356 "llvmAsmParser.tab.c" -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ +#ifdef short +# undef short #endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; #endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t + +#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 + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; #endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int + +#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 YYENABLE_NLS # if ENABLE_NLS @@ -1365,7 +1413,32 @@ # endif #endif -#if ! defined (yyoverflow) || YYERROR_VERBOSE +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* 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 + +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1373,64 +1446,76 @@ # 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 (__STDC__) || defined (__cplusplus) +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H +# 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 (0) + /* 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 2005 */ +# 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_T) -1) +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# ifdef __cplusplus -extern "C" { +# 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 (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) +# 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 (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) +# 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 -# ifdef __cplusplus -} -# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short int yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -1440,13 +1525,13 @@ /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + ((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__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else @@ -1457,7 +1542,7 @@ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -1475,53 +1560,47 @@ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 39 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1441 +#define YYLAST 1317 -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 148 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 78 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 286 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 559 +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 149 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 79 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 288 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 563 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 388 +#define YYMAXUTOK 389 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +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, - 138, 139, 136, 2, 135, 2, 2, 2, 2, 2, + 139, 140, 137, 2, 136, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 143, 134, 144, 2, 2, 2, 2, 2, 2, 2, + 144, 135, 145, 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, 140, 137, 142, 2, 2, 2, 2, 2, 147, + 2, 141, 138, 143, 2, 2, 2, 2, 2, 148, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 141, 2, 2, 145, 2, 146, 2, 2, 2, 2, + 142, 2, 2, 146, 2, 147, 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, @@ -1547,13 +1626,13 @@ 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 + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short int yyprhs[] = +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, @@ -1573,153 +1652,154 @@ 352, 358, 361, 364, 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 401, 407, 416, 423, 430, 438, 446, 453, 462, 471, 475, 477, 479, 481, 483, 484, - 486, 489, 490, 494, 495, 499, 503, 507, 511, 512, - 519, 520, 528, 529, 537, 540, 544, 546, 550, 554, - 558, 562, 564, 565, 571, 575, 577, 581, 583, 584, - 594, 596, 598, 603, 605, 607, 610, 614, 615, 617, - 619, 621, 623, 625, 627, 629, 631, 633, 637, 639, - 645, 647, 649, 651, 653, 655, 657, 660, 663, 666, - 670, 673, 674, 676, 679, 682, 686, 696, 706, 715, - 730, 732, 734, 741, 747, 750, 757, 765, 769, 775, - 776, 777, 781, 784, 786, 792, 798, 805, 812, 817, - 824, 829, 834, 841, 848, 851, 860, 862, 864, 865, - 869, 876, 880, 887, 890, 895, 902 + 486, 487, 489, 492, 493, 497, 498, 502, 506, 510, + 514, 515, 523, 524, 533, 534, 543, 546, 550, 552, + 556, 560, 564, 568, 570, 571, 577, 581, 583, 587, + 589, 590, 600, 602, 604, 609, 611, 613, 616, 620, + 621, 623, 625, 627, 629, 631, 633, 635, 637, 639, + 643, 645, 651, 653, 655, 657, 659, 661, 663, 666, + 669, 672, 676, 679, 680, 682, 685, 688, 692, 702, + 712, 721, 736, 738, 740, 747, 753, 756, 763, 771, + 775, 781, 782, 783, 787, 790, 792, 798, 804, 811, + 818, 823, 830, 835, 840, 847, 854, 857, 866, 868, + 870, 871, 875, 882, 886, 893, 896, 901, 908 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = { - 188, 0, -1, 67, -1, 68, -1, 69, -1, 70, - -1, 71, -1, 72, -1, 73, -1, 74, -1, 75, - -1, 79, -1, 80, -1, 81, -1, 76, -1, 77, - -1, 78, -1, 110, -1, 111, -1, 112, -1, 113, - -1, 114, -1, 115, -1, 116, -1, 117, -1, 118, - -1, 119, -1, 120, -1, 121, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 91, -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, 90, -1, 91, - -1, 92, -1, 93, -1, 22, -1, 23, -1, 11, - -1, 12, -1, 13, -1, 16, -1, 19, -1, 156, - -1, -1, 156, 134, -1, -1, 17, -1, 20, -1, - 159, 134, -1, -1, 36, -1, 38, -1, 37, -1, - 39, -1, 41, -1, 40, -1, 42, -1, 44, -1, - -1, 133, -1, -1, 40, -1, 42, -1, -1, 36, - -1, 37, -1, 38, -1, 41, -1, -1, 55, -1, - 56, -1, 57, -1, 58, -1, 59, -1, 54, 4, - -1, 111, -1, 112, -1, 129, -1, 130, -1, -1, - 168, 167, -1, 128, -1, 131, -1, 167, -1, -1, - 170, 169, -1, -1, 47, 4, -1, -1, 135, 47, - 4, -1, 30, 19, -1, -1, 173, -1, -1, 135, - 176, 175, -1, 173, -1, 47, 4, -1, 11, -1, - 12, -1, 13, -1, 14, -1, 43, -1, 177, -1, - 178, 136, -1, 210, -1, 137, 4, -1, 178, 138, - 182, 139, 170, -1, 10, 138, 182, 139, 170, -1, - 140, 4, 141, 178, 142, -1, 143, 4, 141, 178, - 144, -1, 145, 183, 146, -1, 145, 146, -1, 143, - 145, 183, 146, 144, -1, 143, 145, 146, 144, -1, - 178, 168, -1, 178, -1, 10, -1, 179, -1, 181, - 135, 179, -1, 181, -1, 181, 135, 33, -1, 33, - -1, -1, 178, -1, 183, 135, 178, -1, 178, 140, - 186, 142, -1, 178, 140, 142, -1, 178, 147, 19, - -1, 178, 143, 186, 144, -1, 178, 145, 186, 146, - -1, 178, 145, 146, -1, 178, 143, 145, 186, 146, - 144, -1, 178, 143, 145, 146, 144, -1, 178, 34, - -1, 178, 35, -1, 178, 210, -1, 178, 185, -1, - 178, 21, -1, 154, 3, -1, 154, 5, -1, 154, - 4, -1, 154, 6, -1, 11, 22, -1, 11, 23, - -1, 155, 9, -1, 151, 138, 184, 32, 178, 139, - -1, 109, 138, 184, 221, 139, -1, 123, 138, 184, - 135, 184, 135, 184, 139, -1, 149, 138, 184, 135, - 184, 139, -1, 150, 138, 184, 135, 184, 139, -1, - 82, 152, 138, 184, 135, 184, 139, -1, 83, 153, - 138, 184, 135, 184, 139, -1, 125, 138, 184, 135, - 184, 139, -1, 126, 138, 184, 135, 184, 135, 184, - 139, -1, 127, 138, 184, 135, 184, 135, 184, 139, - -1, 186, 135, 184, -1, 184, -1, 28, -1, 29, - -1, 189, -1, -1, 190, -1, 189, 190, -1, -1, - 27, 191, 206, -1, -1, 26, 192, 207, -1, 52, - 51, 196, -1, 158, 15, 178, -1, 158, 15, 10, - -1, -1, 160, 163, 187, 184, 193, 175, -1, -1, - 160, 161, 163, 187, 184, 194, 175, -1, -1, 160, - 162, 163, 187, 178, 195, 175, -1, 45, 197, -1, - 48, 134, 198, -1, 19, -1, 46, 134, 19, -1, - 60, 134, 19, -1, 140, 199, 142, -1, 199, 135, - 19, -1, 19, -1, -1, 200, 135, 178, 168, 157, - -1, 178, 168, 157, -1, 200, -1, 200, 135, 33, - -1, 33, -1, -1, 166, 180, 159, 138, 201, 139, - 170, 174, 171, -1, 24, -1, 145, -1, 165, 163, - 202, 203, -1, 25, -1, 146, -1, 213, 205, -1, - 164, 163, 202, -1, -1, 53, -1, 3, -1, 4, - -1, 9, -1, 22, -1, 23, -1, 34, -1, 35, - -1, 21, -1, 143, 186, 144, -1, 185, -1, 51, - 208, 19, 135, 19, -1, 7, -1, 8, -1, 156, - -1, 159, -1, 210, -1, 209, -1, 178, 211, -1, - 213, 214, -1, 204, 214, -1, 215, 158, 216, -1, - 215, 218, -1, -1, 18, -1, 61, 212, -1, 61, - 10, -1, 62, 14, 211, -1, 62, 11, 211, 135, - 14, 211, 135, 14, 211, -1, 63, 154, 211, 135, - 14, 211, 140, 217, 142, -1, 63, 154, 211, 135, - 14, 211, 140, 142, -1, 64, 166, 180, 211, 138, - 220, 139, 170, 32, 14, 211, 65, 14, 211, -1, - 65, -1, 66, -1, 217, 154, 209, 135, 14, 211, - -1, 154, 209, 135, 14, 211, -1, 158, 223, -1, - 178, 140, 211, 135, 211, 142, -1, 219, 135, 140, - 211, 135, 211, 142, -1, 178, 211, 168, -1, 220, - 135, 178, 211, 168, -1, -1, -1, 221, 135, 212, - -1, 50, 49, -1, 49, -1, 149, 178, 211, 135, - 211, -1, 150, 178, 211, 135, 211, -1, 82, 152, - 178, 211, 135, 211, -1, 83, 153, 178, 211, 135, - 211, -1, 151, 212, 32, 178, -1, 123, 212, 135, - 212, 135, 212, -1, 124, 212, 135, 178, -1, 125, - 212, 135, 212, -1, 126, 212, 135, 212, 135, 212, - -1, 127, 212, 135, 212, 135, 212, -1, 122, 219, - -1, 222, 166, 180, 211, 138, 220, 139, 170, -1, - 225, -1, 31, -1, -1, 104, 178, 172, -1, 104, - 178, 135, 11, 211, 172, -1, 105, 178, 172, -1, - 105, 178, 135, 11, 211, 172, -1, 106, 212, -1, - 224, 107, 178, 211, -1, 224, 108, 212, 135, 178, - 211, -1, 109, 178, 211, 221, -1 + 190, 0, -1, 68, -1, 69, -1, 70, -1, 71, + -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, + -1, 80, -1, 81, -1, 82, -1, 77, -1, 78, + -1, 79, -1, 111, -1, 112, -1, 113, -1, 114, + -1, 115, -1, 116, -1, 117, -1, 118, -1, 119, + -1, 120, -1, 121, -1, 122, -1, 85, -1, 86, + -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, + -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, 91, -1, 92, + -1, 93, -1, 94, -1, 22, -1, 23, -1, 11, + -1, 12, -1, 13, -1, 16, -1, 19, -1, 157, + -1, -1, 157, 135, -1, -1, 17, -1, 20, -1, + 160, 135, -1, -1, 37, -1, 39, -1, 38, -1, + 40, -1, 42, -1, 41, -1, 43, -1, 45, -1, + -1, 134, -1, -1, 41, -1, 43, -1, -1, 37, + -1, 38, -1, 39, -1, 42, -1, -1, 56, -1, + 57, -1, 58, -1, 59, -1, 60, -1, 55, 4, + -1, 112, -1, 113, -1, 130, -1, 131, -1, -1, + 169, 168, -1, 129, -1, 132, -1, 168, -1, -1, + 171, 170, -1, -1, 48, 4, -1, -1, 136, 48, + 4, -1, 30, 19, -1, -1, 174, -1, -1, 136, + 177, 176, -1, 174, -1, 48, 4, -1, 11, -1, + 12, -1, 13, -1, 14, -1, 44, -1, 178, -1, + 179, 137, -1, 212, -1, 138, 4, -1, 179, 139, + 183, 140, 171, -1, 10, 139, 183, 140, 171, -1, + 141, 4, 142, 179, 143, -1, 144, 4, 142, 179, + 145, -1, 146, 184, 147, -1, 146, 147, -1, 144, + 146, 184, 147, 145, -1, 144, 146, 147, 145, -1, + 179, 169, -1, 179, -1, 10, -1, 180, -1, 182, + 136, 180, -1, 182, -1, 182, 136, 34, -1, 34, + -1, -1, 179, -1, 184, 136, 179, -1, 179, 141, + 187, 143, -1, 179, 141, 143, -1, 179, 148, 19, + -1, 179, 144, 187, 145, -1, 179, 146, 187, 147, + -1, 179, 146, 147, -1, 179, 144, 146, 187, 147, + 145, -1, 179, 144, 146, 147, 145, -1, 179, 35, + -1, 179, 36, -1, 179, 212, -1, 179, 186, -1, + 179, 21, -1, 155, 3, -1, 155, 5, -1, 155, + 4, -1, 155, 6, -1, 11, 22, -1, 11, 23, + -1, 156, 9, -1, 152, 139, 185, 33, 179, 140, + -1, 110, 139, 185, 223, 140, -1, 124, 139, 185, + 136, 185, 136, 185, 140, -1, 150, 139, 185, 136, + 185, 140, -1, 151, 139, 185, 136, 185, 140, -1, + 83, 153, 139, 185, 136, 185, 140, -1, 84, 154, + 139, 185, 136, 185, 140, -1, 126, 139, 185, 136, + 185, 140, -1, 127, 139, 185, 136, 185, 136, 185, + 140, -1, 128, 139, 185, 136, 185, 136, 185, 140, + -1, 187, 136, 185, -1, 185, -1, 28, -1, 29, + -1, 32, -1, -1, 191, -1, -1, 192, -1, 191, + 192, -1, -1, 27, 193, 208, -1, -1, 26, 194, + 209, -1, 53, 52, 198, -1, 159, 15, 179, -1, + 159, 15, 10, -1, -1, 161, 164, 189, 188, 185, + 195, 176, -1, -1, 161, 162, 164, 189, 188, 185, + 196, 176, -1, -1, 161, 163, 164, 189, 188, 179, + 197, 176, -1, 46, 199, -1, 49, 135, 200, -1, + 19, -1, 47, 135, 19, -1, 61, 135, 19, -1, + 141, 201, 143, -1, 201, 136, 19, -1, 19, -1, + -1, 202, 136, 179, 169, 158, -1, 179, 169, 158, + -1, 202, -1, 202, 136, 34, -1, 34, -1, -1, + 167, 181, 160, 139, 203, 140, 171, 175, 172, -1, + 24, -1, 146, -1, 166, 164, 204, 205, -1, 25, + -1, 147, -1, 215, 207, -1, 165, 164, 204, -1, + -1, 54, -1, 3, -1, 4, -1, 9, -1, 22, + -1, 23, -1, 35, -1, 36, -1, 21, -1, 144, + 187, 145, -1, 186, -1, 52, 210, 19, 136, 19, + -1, 7, -1, 8, -1, 157, -1, 160, -1, 212, + -1, 211, -1, 179, 213, -1, 215, 216, -1, 206, + 216, -1, 217, 159, 218, -1, 217, 220, -1, -1, + 18, -1, 62, 214, -1, 62, 10, -1, 63, 14, + 213, -1, 63, 11, 213, 136, 14, 213, 136, 14, + 213, -1, 64, 155, 213, 136, 14, 213, 141, 219, + 143, -1, 64, 155, 213, 136, 14, 213, 141, 143, + -1, 65, 167, 181, 213, 139, 222, 140, 171, 33, + 14, 213, 66, 14, 213, -1, 66, -1, 67, -1, + 219, 155, 211, 136, 14, 213, -1, 155, 211, 136, + 14, 213, -1, 159, 225, -1, 179, 141, 213, 136, + 213, 143, -1, 221, 136, 141, 213, 136, 213, 143, + -1, 179, 213, 169, -1, 222, 136, 179, 213, 169, + -1, -1, -1, 223, 136, 214, -1, 51, 50, -1, + 50, -1, 150, 179, 213, 136, 213, -1, 151, 179, + 213, 136, 213, -1, 83, 153, 179, 213, 136, 213, + -1, 84, 154, 179, 213, 136, 213, -1, 152, 214, + 33, 179, -1, 124, 214, 136, 214, 136, 214, -1, + 125, 214, 136, 179, -1, 126, 214, 136, 214, -1, + 127, 214, 136, 214, 136, 214, -1, 128, 214, 136, + 214, 136, 214, -1, 123, 221, -1, 224, 167, 181, + 213, 139, 222, 140, 171, -1, 227, -1, 31, -1, + -1, 105, 179, 173, -1, 105, 179, 136, 11, 213, + 173, -1, 106, 179, 173, -1, 106, 179, 136, 11, + 213, 173, -1, 107, 214, -1, 226, 108, 179, 213, + -1, 226, 109, 214, 136, 179, 213, -1, 110, 179, + 213, 223, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = +static const yytype_uint16 yyrline[] = { - 0, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, - 1091, 1092, 1092, 1092, 1092, 1092, 1092, 1093, 1093, 1093, - 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1097, - 1097, 1098, 1098, 1099, 1099, 1100, 1100, 1101, 1101, 1105, - 1105, 1106, 1106, 1107, 1107, 1108, 1108, 1109, 1109, 1110, - 1110, 1111, 1111, 1112, 1113, 1118, 1119, 1119, 1121, 1121, - 1122, 1122, 1126, 1130, 1135, 1135, 1137, 1141, 1147, 1148, - 1149, 1150, 1151, 1155, 1156, 1157, 1161, 1162, 1166, 1167, - 1168, 1172, 1173, 1174, 1175, 1176, 1179, 1180, 1181, 1182, - 1183, 1184, 1185, 1192, 1193, 1194, 1195, 1198, 1199, 1204, - 1205, 1206, 1209, 1210, 1217, 1218, 1224, 1225, 1233, 1241, - 1242, 1247, 1248, 1249, 1254, 1267, 1267, 1267, 1267, 1270, - 1274, 1278, 1285, 1290, 1298, 1324, 1351, 1356, 1368, 1378, - 1382, 1392, 1399, 1406, 1413, 1418, 1423, 1430, 1431, 1438, - 1445, 1453, 1459, 1471, 1499, 1515, 1544, 1572, 1597, 1616, - 1642, 1662, 1674, 1681, 1747, 1757, 1767, 1773, 1783, 1789, - 1799, 1804, 1809, 1817, 1829, 1851, 1859, 1865, 1876, 1881, - 1886, 1892, 1898, 1907, 1911, 1919, 1919, 1930, 1935, 1943, - 1944, 1948, 1948, 1952, 1952, 1955, 1958, 1982, 1993, 1993, - 2003, 2003, 2011, 2011, 2021, 2024, 2030, 2043, 2047, 2052, - 2054, 2059, 2064, 2073, 2083, 2094, 2098, 2107, 2116, 2121, - 2240, 2240, 2242, 2251, 2251, 2253, 2258, 2270, 2274, 2279, - 2283, 2287, 2291, 2295, 2299, 2303, 2307, 2311, 2336, 2340, - 2354, 2358, 2362, 2366, 2372, 2372, 2378, 2387, 2391, 2400, - 2409, 2418, 2422, 2427, 2431, 2435, 2440, 2450, 2469, 2478, - 2554, 2558, 2565, 2576, 2589, 2599, 2610, 2620, 2629, 2638, - 2641, 2642, 2649, 2653, 2658, 2679, 2696, 2710, 2724, 2736, - 2744, 2751, 2757, 2763, 2769, 2784, 2856, 2861, 2865, 2872, - 2879, 2887, 2894, 2902, 2910, 2924, 2941 + 0, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1095, + 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1099, + 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1103, 1103, 1107, + 1107, 1108, 1108, 1109, 1109, 1110, 1110, 1111, 1111, 1112, + 1112, 1113, 1113, 1114, 1115, 1120, 1121, 1121, 1123, 1123, + 1124, 1124, 1128, 1132, 1137, 1137, 1139, 1143, 1149, 1150, + 1151, 1152, 1153, 1157, 1158, 1159, 1163, 1164, 1168, 1169, + 1170, 1174, 1175, 1176, 1177, 1178, 1181, 1182, 1183, 1184, + 1185, 1186, 1187, 1194, 1195, 1196, 1197, 1200, 1201, 1206, + 1207, 1208, 1211, 1212, 1219, 1220, 1226, 1227, 1235, 1243, + 1244, 1249, 1250, 1251, 1256, 1269, 1269, 1269, 1269, 1272, + 1276, 1280, 1287, 1292, 1300, 1326, 1353, 1358, 1370, 1380, + 1384, 1394, 1401, 1408, 1415, 1420, 1425, 1432, 1433, 1440, + 1447, 1455, 1461, 1473, 1501, 1517, 1546, 1574, 1599, 1618, + 1644, 1664, 1676, 1683, 1749, 1759, 1769, 1775, 1785, 1791, + 1801, 1806, 1811, 1819, 1831, 1853, 1861, 1867, 1878, 1883, + 1888, 1894, 1900, 1909, 1913, 1921, 1921, 1924, 1924, 1935, + 1940, 1948, 1949, 1953, 1953, 1957, 1957, 1960, 1963, 1987, + 1998, 1998, 2008, 2008, 2016, 2016, 2026, 2029, 2035, 2048, + 2052, 2057, 2059, 2064, 2069, 2078, 2088, 2099, 2103, 2112, + 2121, 2126, 2245, 2245, 2247, 2256, 2256, 2258, 2263, 2275, + 2279, 2284, 2288, 2292, 2296, 2300, 2304, 2308, 2312, 2316, + 2341, 2345, 2359, 2363, 2367, 2371, 2377, 2377, 2383, 2392, + 2396, 2405, 2414, 2423, 2427, 2432, 2436, 2440, 2445, 2455, + 2474, 2483, 2559, 2563, 2570, 2581, 2594, 2604, 2615, 2625, + 2634, 2643, 2646, 2647, 2654, 2658, 2663, 2684, 2701, 2715, + 2729, 2741, 2749, 2756, 2762, 2768, 2774, 2789, 2861, 2866, + 2870, 2877, 2884, 2892, 2899, 2907, 2915, 2929, 2946 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL", @@ -1727,17 +1807,17 @@ "FLOAT", "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT", "ATSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", - "CONSTANT", "SECTION", "VOLATILE", "TO", "DOTDOTDOT", "NULL_TOK", - "UNDEF", "INTERNAL", "LINKONCE", "WEAK", "APPENDING", "DLLIMPORT", - "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", "EXTERNAL", "TARGET", "TRIPLE", - "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", - "CC_TOK", "CCC_TOK", "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", - "X86_FASTCALLCC_TOK", "DATALAYOUT", "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", + "CONSTANT", "SECTION", "VOLATILE", "THREAD_LOCAL", "TO", "DOTDOTDOT", + "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", "APPENDING", + "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", "EXTERNAL", "TARGET", + "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", + "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", "COLDCC_TOK", + "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "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", @@ -1752,11 +1832,11 @@ "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", - "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "Module", - "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", - "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", - "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", - "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal", + "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", "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", @@ -1767,7 +1847,7 @@ # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = +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, @@ -1782,47 +1862,47 @@ 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, 61, 44, 42, 92, 40, 41, - 91, 120, 93, 60, 62, 123, 125, 99 + 385, 386, 387, 388, 389, 61, 44, 42, 92, 40, + 41, 91, 120, 93, 60, 62, 123, 125, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { - 0, 148, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 150, 150, 150, 150, 150, 150, 151, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, + 0, 149, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, - 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, - 153, 153, 153, 153, 153, 154, 155, 155, 156, 156, - 157, 157, 158, 158, 159, 159, 160, 160, 161, 161, - 161, 161, 161, 162, 162, 162, 163, 163, 164, 164, - 164, 165, 165, 165, 165, 165, 166, 166, 166, 166, - 166, 166, 166, 167, 167, 167, 167, 168, 168, 169, - 169, 169, 170, 170, 171, 171, 172, 172, 173, 174, - 174, 175, 175, 176, 176, 177, 177, 177, 177, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 179, 180, 180, 181, 181, 182, 182, 182, - 182, 183, 183, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 186, 186, 187, 187, 188, 188, 189, - 189, 191, 190, 192, 190, 190, 190, 190, 193, 190, - 194, 190, 195, 190, 190, 190, 196, 197, 197, 198, - 199, 199, 199, 200, 200, 201, 201, 201, 201, 202, - 203, 203, 204, 205, 205, 206, 207, 208, 208, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 210, 210, 210, 210, 211, 211, 212, 213, 213, 214, - 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 217, 217, 218, 219, 219, 220, 220, 220, - 221, 221, 222, 222, 223, 223, 223, 223, 223, 223, - 223, 223, 223, 223, 223, 223, 223, 224, 224, 225, - 225, 225, 225, 225, 225, 225, 225 + 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, + 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 154, 154, 155, 156, 156, 157, 157, + 158, 158, 159, 159, 160, 160, 161, 161, 162, 162, + 162, 162, 162, 163, 163, 163, 164, 164, 165, 165, + 165, 166, 166, 166, 166, 166, 167, 167, 167, 167, + 167, 167, 167, 168, 168, 168, 168, 169, 169, 170, + 170, 170, 171, 171, 172, 172, 173, 173, 174, 175, + 175, 176, 176, 177, 177, 178, 178, 178, 178, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 180, 181, 181, 182, 182, 183, 183, 183, + 183, 184, 184, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 187, 187, 188, 188, 189, 189, 190, + 190, 191, 191, 193, 192, 194, 192, 192, 192, 192, + 195, 192, 196, 192, 197, 192, 192, 192, 198, 199, + 199, 200, 201, 201, 201, 202, 202, 203, 203, 203, + 203, 204, 205, 205, 206, 207, 207, 208, 209, 210, + 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 212, 212, 212, 212, 213, 213, 214, 215, + 215, 216, 217, 217, 217, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 219, 219, 220, 221, 221, 222, + 222, 222, 223, 223, 224, 224, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, + 226, 227, 227, 227, 227, 227, 227, 227, 227 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +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, @@ -1842,534 +1922,511 @@ 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, 1, - 2, 0, 3, 0, 3, 3, 3, 3, 0, 6, - 0, 7, 0, 7, 2, 3, 1, 3, 3, 3, - 3, 1, 0, 5, 3, 1, 3, 1, 0, 9, - 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, 2, 2, 3, - 2, 0, 1, 2, 2, 3, 9, 9, 8, 14, - 1, 1, 6, 5, 2, 6, 7, 3, 5, 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, 4, 6, 4 + 0, 1, 2, 0, 3, 0, 3, 3, 3, 3, + 0, 7, 0, 8, 0, 8, 2, 3, 1, 3, + 3, 3, 3, 1, 0, 5, 3, 1, 3, 1, + 0, 9, 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, 2, + 2, 3, 2, 0, 1, 2, 2, 3, 9, 9, + 8, 14, 1, 1, 6, 5, 2, 6, 7, 3, + 5, 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, 4, 6, 4 }; /* 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 unsigned short int yydefact[] = +static const yytype_uint16 yydefact[] = { - 67, 58, 64, 59, 65, 183, 181, 0, 0, 0, - 0, 0, 0, 76, 0, 67, 179, 78, 81, 0, - 0, 194, 0, 0, 62, 0, 66, 68, 70, 69, - 71, 73, 72, 74, 75, 77, 76, 76, 0, 1, - 180, 79, 80, 76, 184, 82, 83, 84, 85, 76, - 241, 182, 241, 0, 0, 202, 195, 196, 185, 230, - 231, 187, 115, 116, 117, 118, 119, 0, 0, 0, - 0, 232, 233, 120, 186, 122, 0, 0, 175, 176, - 0, 86, 86, 242, 238, 63, 213, 214, 215, 237, - 197, 198, 201, 0, 140, 123, 0, 0, 0, 0, - 129, 141, 0, 121, 140, 0, 0, 115, 116, 117, - 0, 0, 0, 188, 0, 87, 88, 89, 90, 91, - 0, 216, 0, 278, 240, 0, 199, 139, 97, 135, - 137, 0, 0, 0, 0, 0, 0, 128, 0, 190, - 192, 160, 161, 156, 158, 157, 159, 162, 155, 151, - 152, 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, 0, - 0, 0, 154, 153, 111, 92, 134, 133, 0, 210, - 211, 212, 277, 263, 0, 0, 0, 0, 86, 250, - 251, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 239, 86, 254, 0, - 276, 200, 132, 0, 102, 0, 0, 131, 0, 142, - 102, 111, 111, 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, 144, 174, 0, 0, - 0, 148, 0, 145, 0, 0, 0, 0, 189, 0, - 262, 244, 0, 243, 0, 0, 55, 0, 0, 0, - 0, 106, 106, 283, 0, 0, 274, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 93, 94, - 95, 96, 98, 138, 136, 125, 126, 127, 130, 124, - 191, 193, 0, 0, 260, 0, 0, 0, 0, 0, - 143, 129, 141, 0, 146, 147, 0, 0, 0, 0, - 0, 113, 111, 208, 219, 220, 221, 226, 222, 223, - 224, 225, 217, 0, 228, 235, 234, 236, 0, 245, - 0, 0, 0, 0, 0, 279, 0, 281, 260, 0, + 67, 58, 64, 59, 65, 185, 183, 0, 0, 0, + 0, 0, 0, 76, 0, 67, 181, 78, 81, 0, + 0, 196, 0, 0, 62, 0, 66, 68, 70, 69, + 71, 73, 72, 74, 75, 77, 76, 76, 178, 1, + 182, 79, 80, 76, 186, 82, 83, 84, 85, 76, + 243, 184, 243, 0, 0, 204, 197, 198, 187, 232, + 233, 189, 115, 116, 117, 118, 119, 0, 0, 0, + 0, 234, 235, 120, 188, 122, 178, 178, 177, 0, + 86, 86, 244, 240, 63, 215, 216, 217, 239, 199, + 200, 203, 0, 140, 123, 0, 0, 0, 0, 129, + 141, 0, 121, 140, 0, 0, 175, 176, 0, 0, + 87, 88, 89, 90, 91, 0, 218, 0, 280, 242, + 0, 201, 139, 97, 135, 137, 0, 0, 0, 0, + 0, 0, 128, 0, 0, 0, 115, 116, 117, 0, + 0, 0, 190, 92, 134, 133, 0, 212, 213, 214, + 279, 265, 0, 0, 0, 0, 86, 252, 253, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, + 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 241, 86, 256, 0, 278, 202, 132, 0, 102, + 0, 0, 131, 0, 142, 102, 192, 194, 160, 161, + 156, 158, 157, 159, 162, 155, 151, 152, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 154, 153, 111, 0, 264, 246, 0, 245, + 0, 0, 55, 0, 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, 106, 106, 285, 0, 0, 276, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 93, 94, 95, 96, 98, 138, 136, 125, 126, 127, + 130, 124, 111, 111, 0, 0, 0, 0, 0, 0, + 0, 144, 174, 0, 0, 0, 148, 0, 145, 0, + 0, 0, 0, 191, 210, 221, 222, 223, 228, 224, + 225, 226, 227, 219, 0, 230, 237, 236, 238, 0, + 247, 0, 0, 0, 0, 0, 281, 0, 283, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 99, 100, 101, 103, 0, 0, 0, 0, - 0, 0, 0, 173, 150, 0, 0, 0, 0, 108, - 114, 112, 207, 97, 205, 0, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 286, 0, 0, - 0, 270, 271, 0, 0, 0, 0, 268, 0, 284, - 0, 0, 0, 0, 164, 0, 0, 0, 0, 149, - 0, 0, 0, 61, 0, 102, 0, 227, 0, 0, - 259, 0, 0, 106, 107, 106, 0, 0, 0, 0, - 0, 264, 265, 259, 0, 0, 0, 261, 0, 170, - 0, 0, 166, 167, 163, 60, 204, 206, 97, 109, - 0, 0, 0, 0, 0, 266, 267, 0, 280, 282, - 0, 0, 269, 272, 273, 0, 285, 168, 169, 0, - 0, 0, 61, 110, 104, 229, 0, 0, 97, 0, - 102, 255, 0, 102, 165, 171, 172, 203, 0, 209, - 0, 248, 0, 0, 257, 0, 0, 256, 275, 105, - 246, 0, 247, 0, 97, 0, 0, 0, 258, 0, - 0, 0, 0, 253, 0, 0, 252, 0, 249 + 0, 0, 0, 99, 100, 101, 103, 193, 195, 0, + 0, 262, 0, 0, 0, 0, 0, 143, 129, 141, + 0, 146, 147, 0, 0, 0, 0, 0, 113, 111, + 209, 97, 207, 0, 220, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 288, 0, 0, 0, 272, + 273, 0, 0, 0, 0, 270, 0, 286, 0, 0, + 0, 0, 0, 0, 0, 0, 173, 150, 0, 0, + 0, 0, 108, 114, 112, 61, 0, 102, 0, 229, + 0, 0, 261, 0, 0, 106, 107, 106, 0, 0, + 0, 0, 0, 0, 266, 267, 261, 0, 0, 0, + 164, 0, 0, 0, 0, 149, 0, 0, 0, 60, + 206, 208, 97, 109, 0, 0, 0, 0, 0, 268, + 269, 0, 282, 284, 263, 0, 0, 271, 274, 275, + 0, 287, 0, 0, 0, 170, 0, 0, 166, 167, + 163, 61, 110, 104, 231, 0, 0, 97, 0, 102, + 257, 0, 102, 168, 169, 0, 0, 0, 205, 0, + 211, 0, 250, 0, 0, 259, 0, 0, 258, 277, + 165, 171, 172, 105, 248, 0, 249, 0, 97, 0, + 0, 0, 260, 0, 0, 0, 0, 255, 0, 0, + 254, 0, 251 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -1, 189, 190, 191, 253, 270, 110, 111, 71, 486, - 11, 72, 13, 36, 37, 38, 43, 49, 120, 322, - 232, 395, 325, 529, 375, 351, 514, 288, 352, 73, - 112, 129, 198, 130, 131, 102, 277, 364, 278, 80, - 14, 15, 16, 18, 17, 194, 241, 242, 58, 21, - 56, 93, 414, 415, 121, 201, 50, 88, 51, 44, - 417, 365, 75, 367, 293, 52, 84, 85, 226, 533, - 124, 306, 494, 398, 227, 228, 229, 230 + -1, 239, 240, 241, 265, 282, 139, 140, 71, 480, + 11, 72, 13, 36, 37, 38, 43, 49, 115, 304, + 207, 376, 307, 530, 356, 398, 513, 333, 399, 73, + 141, 124, 146, 125, 126, 101, 322, 345, 323, 108, + 79, 14, 15, 16, 18, 17, 244, 312, 313, 58, + 21, 56, 92, 402, 403, 116, 149, 50, 87, 51, + 44, 405, 346, 75, 348, 249, 52, 83, 84, 201, + 534, 119, 288, 488, 415, 202, 203, 204, 205 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -428 -static const short int yypact[] = +#define YYPACT_NINF -476 +static const yytype_int16 yypact[] = { - 262, -428, -428, -428, -428, -428, -428, -26, -85, 60, - 5, 50, 9, 282, 135, 406, -428, 203, 191, 32, - 74, -428, 73, 134, -428, 1106, -428, -428, -428, -428, - -428, -428, -428, -428, -428, -428, 87, 87, 150, -428, - -428, -428, -428, 87, -428, -428, -428, -428, -428, 87, - 208, -428, 1, 228, 234, 248, -428, -428, -428, -428, - -428, 130, -428, -428, -428, -428, -428, 276, 280, 4, - 111, -428, -428, -428, -57, -428, 150, 150, -428, -428, - 1143, 311, 311, -428, -428, 118, -428, -428, -428, -428, - -428, -428, -428, -6, 40, -428, 144, 146, 908, 130, - -428, -57, -68, -428, 40, 1143, 1157, 39, 281, 285, - 232, 286, 738, -428, 292, -428, -428, -428, -428, -428, - 1191, -428, -7, 1314, -428, 278, -428, -428, -57, -428, - 166, 163, 1157, 1157, 159, -36, 1157, -428, 165, -428, - -57, -428, -428, -428, -428, -428, -428, -428, -428, -428, - -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, - -428, -428, -428, -428, -428, -428, 255, 594, 167, -428, - -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, - -428, 170, 171, 173, 175, 497, 1207, 945, 296, 187, - 196, 197, -428, -428, 192, -428, 130, -57, 213, -428, - -428, -428, -428, -428, 287, 1228, 247, 338, 311, -428, - -428, 255, 594, 1157, 1157, 1157, 1157, 1157, 1157, 1157, - 1157, 1157, 1157, 1157, 1157, 1157, -428, 311, -428, 152, - -428, -428, -43, 1003, -428, -41, -103, -428, 206, -57, - -428, 192, 192, -428, -428, -428, -428, -428, -428, -428, - -428, -428, -428, 214, -428, -428, -428, -428, -428, -428, - -428, -428, -428, -428, -428, -428, -428, -428, -428, -428, - 216, 1143, 1143, 1143, 1143, 1143, -428, -428, 17, 987, - -18, -428, -33, -428, 1143, 1143, 1143, 8, -428, 217, - -428, 130, 592, -428, 717, 717, -428, 717, 1191, 1157, - 1157, 106, 114, -428, 592, 31, 236, 239, 240, 241, - 242, 243, 592, 592, 347, 1191, 1157, 1157, -428, -428, - -428, -428, -428, -428, -428, -40, -428, -428, -428, -40, - -428, -428, 1143, 1143, -428, 245, 246, 252, 256, 1143, - -428, 238, 738, -31, -428, -428, 257, 259, 351, 371, - 393, -428, 192, 1050, -428, -428, -428, -428, -428, -428, - -428, -428, 346, 1143, -428, -428, -428, -428, 265, -428, - 267, 717, 592, 592, 16, -428, 19, -428, -428, 717, - 263, 1157, 1157, 1157, 1157, 1157, 269, 272, 1157, 717, - 592, 273, -428, -428, -428, -428, 275, 283, -32, 1143, - 1143, 1143, 1143, -428, -428, 290, 1143, 1143, 1157, -428, - -428, -428, -428, -57, 289, 288, -428, 398, 13, 415, - 417, 297, 302, 303, 717, 435, 717, 305, 306, 717, - 307, -57, -428, 308, 312, 717, 717, -57, 310, -428, - 1157, 1143, 1143, 1157, -428, 315, 313, 320, 321, -428, - 322, 324, 22, 21, 1088, -428, 325, -428, 717, 717, - 1157, 717, 717, 329, -428, 329, 717, 330, 1157, 1157, - 1157, -428, -428, 1157, 592, 327, 328, -428, 1143, -428, - 1143, 1143, -428, -428, -428, -428, -428, -428, -57, 34, - 440, 333, 331, 592, 72, -428, -428, 422, -428, -428, - 336, 717, -428, -428, -428, 75, -428, -428, -428, 340, - 343, 344, 21, -428, 423, -428, 461, -1, -428, 1157, - -428, -428, 345, -428, -428, -428, -428, -428, 481, -428, - 717, -428, 866, 2, -43, 592, 44, -428, -40, -428, - -428, 353, -428, 866, -428, 472, 475, 357, -43, 717, - 717, 479, 429, -428, 717, 482, -428, 717, -428 + 28, -476, -476, -476, -476, -476, -476, -10, -55, 8, + -33, 97, 3, 55, 167, 394, -476, 172, 210, 86, + 98, -476, 102, 219, -476, 1017, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, 123, 123, 218, -476, + -476, -476, -476, 123, -476, -476, -476, -476, -476, 123, + 241, -476, 2, 242, 251, 253, -476, -476, -476, -476, + -476, 137, -476, -476, -476, -476, -476, 274, 283, 1, + 456, -476, -476, -476, 83, -476, 218, 218, -476, 103, + 291, 291, -476, -476, 121, -476, -476, -476, -476, -476, + -476, -476, -26, 874, -476, 148, 149, 470, 137, -476, + 83, -97, -476, 874, 103, 103, -476, -476, 1031, 288, + -476, -476, -476, -476, -476, 1073, -476, -7, 1172, -476, + 282, -476, -476, 83, -476, 157, 162, 1087, 1087, 158, + -61, 1087, -476, 165, 1031, 1087, 60, 297, 298, 201, + 299, 656, -476, -476, 137, 83, 217, -476, -476, -476, + -476, -476, 262, 1129, 257, 302, 291, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, 461, 273, 1087, 1087, 1087, 1087, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087, + 1087, -476, 291, -476, 74, -476, -476, -25, 914, -476, + 19, 41, -476, 175, 83, -476, -476, 83, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, 461, 273, + 178, 182, 183, 184, 186, 933, 1171, 552, 309, 190, + 191, 194, -476, -476, 199, 197, -476, 137, 509, -476, + 635, 635, -476, 635, 1073, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 1087, -476, -476, -476, -476, + -476, -476, -476, -476, -476, -476, -476, -476, -476, -476, + -476, -476, 1087, -17, 92, -476, 509, 75, 207, 208, + 220, 221, 222, 223, 509, 509, 304, 1073, 1087, 1087, + -476, -476, -476, -476, -476, -476, -476, 154, -476, -476, + -476, 154, 199, 199, 214, 215, 1031, 1031, 1031, 1031, + 1031, -476, -476, -22, 828, -75, -476, -58, -476, 1031, + 1031, 1031, 5, -476, 972, -476, -476, -476, -476, -476, + -476, -476, -476, 301, 1031, -476, -476, -476, -476, 224, + -476, 226, 635, 509, 509, 14, -476, 23, -476, -476, + 635, 237, 1087, 1087, 1087, 1087, 1087, 243, 244, 1087, + 635, 509, 246, -476, -476, -476, -476, -476, -476, 1031, + 1031, -476, 247, 248, 254, 255, 1031, -476, 250, 656, + -46, -476, -476, 256, 261, 360, 383, 399, -476, 199, + -476, 83, 269, 266, -476, 388, -60, 398, 401, 277, + 272, 289, 635, 420, 635, 293, 294, 635, 295, 83, + -476, 296, 300, 635, 635, 83, 305, -476, 1087, 310, + 314, -98, 1031, 1031, 1031, 1031, -476, -476, 290, 1031, + 1031, 1087, -476, -476, -476, 33, 988, -476, 315, -476, + 635, 635, 1087, 635, 635, 316, -476, 316, 1087, 635, + 317, 1087, 1087, 1087, -476, -476, 1087, 509, 1031, 1031, + -476, 318, 287, 320, 321, -476, 319, 322, 116, -476, + -476, -476, 83, 79, 414, 324, 330, 509, 21, -476, + -476, 393, -476, -476, -476, 331, 635, -476, -476, -476, + 59, -476, 325, 339, 1031, -476, 1031, 1031, -476, -476, + -476, 33, -476, 410, -476, 447, -2, -476, 1087, -476, + -476, 342, -476, -476, -476, 348, 351, 352, -476, 489, + -476, 635, -476, 785, -1, -25, 509, 133, -476, 154, + -476, -476, -476, -476, -476, 359, -476, 785, -476, 482, + 483, 362, -25, 635, 635, 485, 439, -476, 635, 492, + -476, 635, -476 }; /* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = +static const yytype_int16 yypgoto[] = { - -428, 374, 375, 376, 291, 294, -205, -428, 0, -12, - 416, 14, -428, -428, -428, 57, -428, -428, -150, -313, - -404, -428, -237, -428, -295, 26, -428, -210, -428, -428, - -24, 270, -223, -428, 414, 421, -69, -108, -181, 189, - -428, -428, 505, -428, -428, -428, -428, -428, -428, -428, - -428, -428, -428, -428, 439, -428, -428, -428, -428, -428, - -428, -427, -73, 101, -197, -428, 470, -428, -428, -428, - -428, -428, 51, 145, -428, -428, -428, -428 + -476, 389, 392, 397, 292, 306, -153, -476, 0, 10, + 435, 4, -476, -476, -476, 87, -476, -476, -145, -295, + -383, -476, -208, -476, -276, 39, -476, -291, -476, -476, + -24, 326, -241, -476, 421, 426, 69, -138, -196, 89, + 204, -476, -476, 512, -476, -476, -476, -476, -476, -476, + -476, -476, -476, -476, -476, 452, -476, -476, -476, -476, + -476, -476, -475, -135, -227, -164, -476, 484, -476, -476, + -476, -476, -476, 73, 159, -476, -476, -476, -476 }; /* 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 -179 -static const short int yytable[] = +#define YYTABLE_NINF -181 +static const yytype_int16 yytable[] = { - 10, 74, 297, 329, 192, 280, 282, 377, 97, 453, - 296, 113, 394, 296, 12, 10, 394, 199, 303, 83, - 19, 307, 308, 309, 310, 311, 86, 424, 314, 12, - 426, 330, 331, 103, 20, 104, 139, 1, 349, 193, - 3, 327, -55, -55, -55, -55, 101, 59, 60, 22, - 99, 62, 63, 64, 65, 350, 1, 2, 298, 3, - 4, 141, 142, 425, 349, 25, 425, 136, 318, 319, - 128, 318, 319, 127, 101, 371, 545, 315, 137, 103, - 128, 104, 140, 66, 512, 10, 320, 321, 392, 320, - 321, 393, 389, 76, 77, 103, 197, 104, 343, 136, - 81, 326, 339, 443, 339, 541, 82, 444, 235, 236, - 238, 23, 239, 345, 534, 405, 547, 339, 59, 60, - 391, 99, 62, 63, 64, 65, 344, 1, 2, 125, - 3, 4, 318, 319, 1, 39, 126, 3, 200, 24, - 548, 531, 411, 26, 542, 318, 319, 87, 339, 98, - 320, 321, 339, 57, 66, 318, 319, 457, 103, 340, - 104, 484, 392, 320, 321, 393, 53, 103, 498, 104, - 499, 379, 392, 320, 321, 393, 394, 67, 78, 79, - 68, 292, 418, 69, 430, 70, 432, 433, 434, 301, - 302, 292, 304, 305, 292, 292, 292, 292, 292, 312, - 313, 292, 334, 335, 336, 337, 338, 519, 54, 128, - 519, 520, 289, 55, 523, 346, 347, 348, 489, 366, - 35, 366, 366, 394, 366, 394, 83, 45, 46, 47, - 2, 366, 48, 4, 192, 143, 144, 145, 146, 366, - 366, 374, 103, 41, 104, 42, 477, 90, 67, 376, - 103, 68, 104, 91, 69, 342, 70, 100, 294, 316, - 317, 295, -178, 396, 397, 105, 106, 92, 94, 193, - 403, 502, 503, 504, 197, 372, 373, -63, 1, 2, - 95, 3, 4, 536, 96, 132, 538, 133, 5, 6, - -56, 197, 390, 292, -57, 147, 195, 231, 366, 366, - 366, 233, 234, 237, 240, 271, 366, 7, 272, 273, - 8, 274, 532, 275, 9, 283, 366, 366, 27, 28, - 29, 30, 31, 32, 33, 284, 34, 287, 543, 413, - 445, 446, 447, 448, 285, 286, 290, 450, 451, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 296, - 328, 366, 332, 366, 333, 353, 366, 292, 431, 292, - 292, 292, 366, 366, 437, 114, 115, 116, 117, 118, - 119, 380, 475, 476, 381, 382, 383, 384, 385, 388, - 399, 400, 404, 408, 452, 366, 366, 401, 366, 366, - 409, 402, 406, 366, 407, 368, 369, 410, 370, 416, - 419, 366, 420, 429, 435, 378, -177, 436, 440, 509, - 441, 510, 511, 386, 387, 35, 474, 456, 442, 292, - 366, -63, 1, 2, 454, 3, 4, 455, 366, 458, - 488, 459, 5, 6, 449, 460, 493, 461, 462, 464, - 443, 466, 468, 469, 292, 292, 292, 470, 473, 493, - 478, 7, 479, 485, 8, 480, 481, 366, 9, 515, - 490, 482, 366, 483, 497, 501, 507, 508, 516, 425, - 528, 517, 421, 422, 423, 530, 366, 366, 521, 524, - 428, 366, 525, 526, 366, 539, 549, 537, 546, 550, - 438, 439, 551, 554, 555, 535, 557, 223, 224, 225, - 527, 123, 299, 324, 59, 60, 300, 99, 107, 108, - 109, 65, 485, 1, 2, 513, 3, 4, 138, 135, - 40, 122, 89, 427, 505, 463, 0, 465, 0, 0, - 467, 0, 0, 0, 0, 0, 471, 472, 0, 0, - 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 491, - 492, 0, 495, 496, 0, 0, 0, 500, 0, 0, - 0, 0, 0, 0, 0, 506, 0, 0, 0, 0, + 10, 74, 253, 242, 12, 96, 243, 311, 358, 252, + 252, 254, 375, 352, 285, 10, 375, 147, 445, 12, + 82, 377, 378, 349, 350, 412, 351, 85, -180, 289, + 290, 291, 292, 293, 414, 396, 296, 19, 458, 131, + 325, 327, 470, -63, 1, 2, 100, 3, 4, 1, + 132, 20, 3, 397, 5, 6, 370, 297, 545, 359, + 23, 386, 413, -55, -55, -55, -55, 367, 368, 123, + 391, 413, 551, 100, 7, 131, 386, 8, 386, 123, + 22, 9, 218, 219, 10, 449, 213, 300, 301, 392, + 386, 145, 27, 28, 29, 30, 31, 32, 33, 511, + 34, 438, 24, 210, 211, 302, 303, 214, 444, 396, + 120, 217, 25, 347, 386, 347, 347, 121, 347, 355, + 102, 387, 103, 76, 77, 409, 410, 411, 390, 248, + 80, 106, 107, 416, 535, 372, 81, 1, 26, 148, + 3, 532, 546, 426, 427, 300, 301, 97, 406, 86, + 245, 347, 283, 284, 248, 286, 102, 518, 103, 347, + 347, 519, 308, 302, 303, 552, 549, 39, 287, 248, + 248, 248, 248, 248, 294, 295, 248, 142, 102, 492, + 103, 493, 298, 299, 123, 455, 309, 457, 375, 35, + 460, 300, 301, 134, 135, 518, 464, 465, 418, 522, + 420, 421, 422, 216, 220, 221, 222, 223, 373, 302, + 303, 374, 102, 41, 103, 42, 360, 347, 347, 347, + 102, 53, 103, 485, 486, 347, 489, 490, 357, 102, + 145, 103, 495, 54, 2, 347, 347, 4, 57, 483, + 501, 353, 375, 55, 375, 300, 301, 45, 46, 47, + 78, 242, 48, 102, 243, 103, 510, 35, 354, 82, + 517, 89, 373, 302, 303, 374, 300, 301, 250, 521, + 90, 251, 91, 145, 371, 248, 93, 347, 94, 347, + 104, 105, 347, 373, 302, 303, 374, 95, 347, 347, + 127, 128, 143, 208, 494, 266, 267, 497, 498, 499, + 389, 206, 209, 212, 544, 215, -56, -57, 224, 548, + 401, 537, 246, 252, 539, 347, 347, 316, 347, 347, + 310, 317, 318, 319, 347, 320, 556, 557, 328, 329, + 330, 560, 347, 331, 562, 332, 334, 369, 248, 419, + 248, 248, 248, 361, 362, 425, 109, 110, 111, 112, + 113, 114, 347, 379, 380, 404, 363, 364, 365, 366, + 407, 347, 408, 533, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 417, 423, + 424, 547, 428, 432, 433, 381, 382, 383, 384, 385, + 434, 435, 439, 441, -179, 437, 347, 440, 393, 394, + 395, 347, 442, 443, 467, 446, 447, 448, 453, -63, + 1, 2, 450, 3, 4, 451, 452, 478, 347, 347, + 5, 6, 482, 347, 456, 454, 347, 505, 487, 458, + 459, 461, 462, 514, 248, 475, 463, 248, 248, 248, + 7, 413, 487, 8, 466, 479, 468, 9, 429, 430, + 469, 484, 491, 496, 504, 436, 506, 507, 529, 508, + 515, 531, 509, 59, 60, 523, 98, 62, 63, 64, + 65, 516, 1, 2, 520, 3, 4, 59, 60, 524, + 98, 62, 63, 64, 65, 538, 1, 2, 540, 3, + 4, 541, 542, 543, 536, 550, 553, 554, 555, 558, + 66, 471, 472, 473, 474, 559, 561, 198, 476, 477, + 199, 479, 335, 336, 66, 200, 59, 60, 337, 118, + 314, 528, 512, 130, 133, 1, 2, 40, 3, 4, + 338, 339, 340, 117, 306, 315, 88, 502, 503, 500, + 431, 0, 0, 0, 341, 342, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 0, 0, 0, 59, + 60, 343, 98, 136, 137, 138, 65, 0, 1, 2, + 0, 3, 4, 525, 0, 526, 527, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 228, 229, 67, 0, 66, 68, 0, 0, + 69, 0, 70, 99, 0, 0, 0, 0, 67, 0, + 0, 68, 0, 0, 69, 0, 70, 129, 0, 230, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 0, 231, 0, 232, 233, 234, 335, 336, + 0, 0, 59, 60, 337, 0, 102, 0, 103, 0, + 0, 1, 2, 344, 3, 4, 338, 339, 340, 0, + 0, 0, 0, 59, 60, 0, 0, 0, 0, 0, + 341, 342, 1, 2, 0, 3, 4, 225, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 343, 0, 0, + 67, 226, 227, 68, 0, 0, 69, 0, 70, 326, + 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, + 0, 0, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 228, + 229, 0, 0, 0, 0, 230, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 0, 231, + 0, 232, 233, 234, 0, 0, 230, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 344, + 231, 0, 232, 233, 234, 0, 0, 0, 335, 336, + 0, 0, 0, 102, 337, 103, 0, 235, 0, 0, + 236, 0, 237, 0, 238, 0, 338, 339, 340, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 518, 354, 355, 0, 0, 59, - 60, 356, 522, 0, 0, 0, 0, 0, 1, 2, - 0, 3, 4, 357, 358, 359, 254, 255, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 361, 0, 0, - 0, 540, 0, 0, 67, 0, 544, 68, 0, 276, - 69, 0, 70, 362, 0, 0, 0, 0, 0, 0, - 552, 553, 0, 0, 0, 556, 0, 0, 558, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 0, 0, 0, 0, - 0, 0, 0, 0, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 0, 0, - 0, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 0, 181, 0, 182, 183, 184, - 354, 355, 0, 0, 59, 60, 356, 0, 103, 0, - 104, 0, 0, 1, 2, 363, 3, 4, 357, 358, - 359, 0, 0, 0, 0, 59, 60, 0, 0, 0, - 0, 360, 361, 0, 1, 2, 0, 3, 4, 148, - 0, 0, 0, 0, 0, 0, 0, 0, 362, 0, - 0, 0, 149, 150, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 0, 0, 0, 0, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 0, 0, 0, 0, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 0, - 181, 0, 182, 183, 184, 0, 0, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 363, 181, 0, 182, 183, 184, 0, 0, 0, 354, - 355, 0, 0, 0, 103, 356, 104, 0, 185, 0, - 0, 186, 0, 187, 0, 188, 0, 357, 358, 359, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 360, 361, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 59, 60, 362, 99, 62, - 63, 64, 65, 0, 1, 2, 0, 3, 4, 0, - 0, 0, 0, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 0, 66, 59, 60, 0, 99, 107, 108, 109, 65, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 66, 181, - 0, 182, 183, 184, 59, 60, 0, 99, 107, 108, - 109, 65, 0, 1, 2, 0, 3, 4, 0, 363, - 59, 60, 0, 99, 62, 63, 64, 65, 0, 1, - 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, - 66, 0, 0, 0, 0, 0, 323, 0, 0, 0, - 0, 0, 0, 0, 0, 67, 66, 0, 68, 0, - 0, 69, 0, 70, 134, 0, 0, 59, 60, 0, - 99, 62, 63, 64, 65, 0, 1, 2, 0, 3, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 67, 412, 0, 68, 0, 0, 69, 0, - 70, 281, 0, 66, 0, 59, 60, 0, 99, 62, - 63, 64, 65, 0, 1, 2, 0, 3, 4, 0, - 0, 0, 0, 59, 60, 0, 61, 62, 63, 64, - 65, 487, 1, 2, 67, 3, 4, 68, 0, 0, - 69, 66, 70, 341, 0, 0, 0, 0, 0, 0, - 67, 0, 0, 68, 0, 0, 69, 0, 70, 66, - 59, 60, 0, 99, 107, 108, 109, 65, 0, 1, - 2, 0, 3, 4, 59, 60, 0, 99, 62, 63, + 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 59, 60, 343, 98, 136, + 137, 138, 65, 0, 1, 2, 0, 3, 4, 0, + 0, 0, 0, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 228, 229, + 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, + 0, 59, 60, 0, 98, 62, 63, 64, 65, 0, + 1, 2, 0, 3, 4, 230, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 122, 231, + 0, 232, 233, 234, 0, 0, 0, 0, 66, 0, + 0, 59, 60, 0, 98, 62, 63, 64, 65, 344, + 1, 2, 0, 3, 4, 0, 0, 0, 0, 0, + 59, 60, 0, 98, 136, 137, 138, 65, 305, 1, + 2, 0, 3, 4, 0, 0, 0, 0, 66, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, + 0, 0, 69, 0, 70, 388, 0, 66, 0, 59, + 60, 0, 98, 62, 63, 64, 65, 0, 1, 2, + 0, 3, 4, 0, 0, 59, 60, 0, 98, 62, + 63, 64, 65, 0, 1, 2, 400, 3, 4, 0, + 0, 0, 67, 0, 0, 68, 66, 0, 69, 0, + 70, 0, 481, 0, 59, 60, 0, 61, 62, 63, + 64, 65, 66, 1, 2, 0, 3, 4, 59, 60, + 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, + 3, 4, 67, 0, 0, 68, 0, 0, 69, 0, + 70, 66, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 68, 66, 321, 69, 0, 70, + 59, 60, 0, 144, 62, 63, 64, 65, 0, 1, + 2, 0, 3, 4, 59, 60, 0, 98, 62, 63, 64, 65, 0, 1, 2, 0, 3, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 66, 67, 0, 0, - 68, 0, 0, 69, 0, 70, 0, 0, 59, 60, - 66, 196, 62, 63, 64, 65, 0, 1, 2, 0, - 3, 4, 0, 0, 59, 60, 0, 99, 107, 108, - 109, 65, 0, 1, 2, 67, 3, 4, 68, 0, - 0, 69, 0, 70, 66, 59, 60, 0, 291, 62, - 63, 64, 65, 67, 1, 2, 68, 3, 4, 69, - 66, 70, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 67, 0, 0, 68, 0, 0, 69, 0, 70, 0, - 0, 0, 0, 0, 67, 0, 0, 68, 0, 0, - 69, 0, 70, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, - 0, 68, 0, 0, 69, 0, 70, 0, 0, 0, - 0, 0, 0, 0, 67, 202, 0, 68, 0, 0, - 69, 0, 279, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 203, 204, 67, 0, 0, 68, 0, - 0, 69, 0, 70, 0, 205, 206, 207, 208, 209, - 210, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 211, 212, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 213, 214, - 215, 0, 0, 216, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 217, 218, 219, 220, - 221, 222 + 67, 0, 0, 68, 0, 0, 69, 66, 70, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 68, + 0, 66, 69, 0, 70, 0, 59, 60, 0, 247, + 62, 63, 64, 65, 0, 1, 2, 0, 3, 4, + 0, 0, 0, 0, 0, 67, 0, 0, 68, 0, + 0, 69, 0, 70, 0, 0, 0, 0, 0, 67, + 0, 0, 68, 66, 0, 69, 0, 70, 59, 60, + 0, 98, 136, 137, 138, 65, 0, 1, 2, 0, + 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 0, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 68, 66, 0, 69, 0, 70, + 0, 0, 151, 152, 0, 67, 0, 0, 68, 0, + 0, 69, 0, 70, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, + 68, 0, 0, 69, 0, 70, 0, 176, 177, 178, + 0, 0, 179, 180, 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, 67, + 0, 0, 68, 0, 0, 69, 0, 324 }; -static const short int yycheck[] = +static const yytype_int16 yycheck[] = { - 0, 25, 207, 240, 112, 186, 187, 302, 4, 413, - 11, 80, 325, 11, 0, 15, 329, 24, 215, 18, - 46, 218, 219, 220, 221, 222, 25, 11, 225, 15, - 11, 241, 242, 136, 60, 138, 105, 16, 30, 112, - 19, 144, 3, 4, 5, 6, 70, 7, 8, 134, - 10, 11, 12, 13, 14, 47, 16, 17, 208, 19, - 20, 22, 23, 47, 30, 15, 47, 135, 111, 112, - 94, 111, 112, 33, 98, 298, 32, 227, 146, 136, - 104, 138, 106, 43, 488, 85, 129, 130, 128, 129, - 130, 131, 315, 36, 37, 136, 120, 138, 279, 135, - 43, 142, 135, 135, 135, 532, 49, 139, 132, 133, - 146, 51, 136, 146, 518, 146, 543, 135, 7, 8, - 317, 10, 11, 12, 13, 14, 144, 16, 17, 135, - 19, 20, 111, 112, 16, 0, 142, 19, 145, 134, - 544, 142, 352, 134, 142, 111, 112, 146, 135, 145, - 129, 130, 135, 19, 43, 111, 112, 144, 136, 142, - 138, 139, 128, 129, 130, 131, 134, 136, 463, 138, - 465, 140, 128, 129, 130, 131, 489, 137, 28, 29, - 140, 205, 363, 143, 381, 145, 383, 384, 385, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 271, 272, 273, 274, 275, 135, 134, 233, - 135, 139, 198, 140, 139, 284, 285, 286, 455, 292, - 133, 294, 295, 536, 297, 538, 18, 36, 37, 38, - 17, 304, 41, 20, 342, 3, 4, 5, 6, 312, - 313, 135, 136, 40, 138, 42, 443, 19, 137, 135, - 136, 140, 138, 19, 143, 279, 145, 146, 11, 107, - 108, 14, 0, 332, 333, 76, 77, 19, 138, 342, - 339, 468, 469, 470, 298, 299, 300, 15, 16, 17, - 4, 19, 20, 520, 4, 141, 523, 141, 26, 27, - 9, 315, 316, 317, 9, 9, 4, 19, 371, 372, - 373, 135, 139, 144, 139, 138, 379, 45, 138, 138, - 48, 138, 517, 138, 52, 19, 389, 390, 36, 37, - 38, 39, 40, 41, 42, 138, 44, 135, 533, 353, - 399, 400, 401, 402, 138, 138, 49, 406, 407, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 11, - 144, 424, 138, 426, 138, 138, 429, 381, 382, 383, - 384, 385, 435, 436, 388, 54, 55, 56, 57, 58, - 59, 135, 441, 442, 135, 135, 135, 135, 135, 32, - 135, 135, 144, 32, 408, 458, 459, 135, 461, 462, - 19, 135, 135, 466, 135, 294, 295, 4, 297, 53, - 135, 474, 135, 140, 135, 304, 0, 135, 135, 478, - 135, 480, 481, 312, 313, 133, 440, 19, 135, 443, - 493, 15, 16, 17, 135, 19, 20, 139, 501, 14, - 454, 14, 26, 27, 144, 138, 460, 135, 135, 4, - 135, 135, 135, 135, 468, 469, 470, 135, 138, 473, - 135, 45, 139, 453, 48, 135, 135, 530, 52, 19, - 135, 139, 535, 139, 135, 135, 139, 139, 135, 47, - 47, 140, 371, 372, 373, 14, 549, 550, 142, 139, - 379, 554, 139, 139, 557, 4, 14, 142, 135, 14, - 389, 390, 135, 14, 65, 519, 14, 123, 123, 123, - 512, 85, 211, 233, 7, 8, 212, 10, 11, 12, - 13, 14, 512, 16, 17, 489, 19, 20, 104, 98, - 15, 82, 52, 378, 473, 424, -1, 426, -1, -1, - 429, -1, -1, -1, -1, -1, 435, 436, -1, -1, - 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, - 459, -1, 461, 462, -1, -1, -1, 466, -1, -1, - -1, -1, -1, -1, -1, 474, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 493, 3, 4, -1, -1, 7, - 8, 9, 501, -1, -1, -1, -1, -1, 16, 17, - -1, 19, 20, 21, 22, 23, 22, 23, -1, -1, - -1, -1, -1, -1, -1, -1, 34, 35, -1, -1, - -1, 530, -1, -1, 137, -1, 535, 140, -1, 142, - 143, -1, 145, 51, -1, -1, -1, -1, -1, -1, - 549, 550, -1, -1, -1, 554, -1, -1, 557, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, -1, -1, -1, -1, - -1, -1, -1, -1, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, -1, -1, - -1, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, -1, 123, -1, 125, 126, 127, - 3, 4, -1, -1, 7, 8, 9, -1, 136, -1, - 138, -1, -1, 16, 17, 143, 19, 20, 21, 22, - 23, -1, -1, -1, -1, 7, 8, -1, -1, -1, - -1, 34, 35, -1, 16, 17, -1, 19, 20, 21, - -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, - -1, -1, 34, 35, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, -1, -1, -1, -1, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, -1, -1, -1, -1, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, - 123, -1, 125, 126, 127, -1, -1, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 143, 123, -1, 125, 126, 127, -1, -1, -1, 3, - 4, -1, -1, -1, 136, 9, 138, -1, 140, -1, - -1, 143, -1, 145, -1, 147, -1, 21, 22, 23, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 7, 8, 51, 10, 11, - 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, - -1, -1, -1, 67, 68, 69, 70, 71, 72, 73, + 0, 25, 155, 141, 0, 4, 141, 215, 284, 11, + 11, 156, 307, 254, 178, 15, 311, 24, 401, 15, + 18, 312, 313, 250, 251, 11, 253, 25, 0, 193, + 194, 195, 196, 197, 11, 30, 200, 47, 136, 136, + 236, 237, 140, 15, 16, 17, 70, 19, 20, 16, + 147, 61, 19, 48, 26, 27, 297, 202, 533, 286, + 52, 136, 48, 3, 4, 5, 6, 294, 295, 93, + 145, 48, 547, 97, 46, 136, 136, 49, 136, 103, + 135, 53, 22, 23, 84, 145, 147, 112, 113, 147, + 136, 115, 37, 38, 39, 40, 41, 42, 43, 482, + 45, 147, 135, 127, 128, 130, 131, 131, 399, 30, + 136, 135, 15, 248, 136, 250, 251, 143, 253, 136, + 137, 143, 139, 36, 37, 352, 353, 354, 324, 153, + 43, 28, 29, 360, 517, 299, 49, 16, 135, 146, + 19, 143, 143, 370, 371, 112, 113, 146, 344, 147, + 146, 286, 176, 177, 178, 179, 137, 136, 139, 294, + 295, 140, 143, 130, 131, 548, 33, 0, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 108, 137, 455, + 139, 457, 108, 109, 208, 412, 145, 414, 483, 134, + 417, 112, 113, 104, 105, 136, 423, 424, 362, 140, + 364, 365, 366, 134, 3, 4, 5, 6, 129, 130, + 131, 132, 137, 41, 139, 43, 141, 352, 353, 354, + 137, 135, 139, 450, 451, 360, 453, 454, 136, 137, + 254, 139, 459, 135, 17, 370, 371, 20, 19, 447, + 467, 265, 537, 141, 539, 112, 113, 37, 38, 39, + 32, 389, 42, 137, 389, 139, 140, 134, 282, 18, + 487, 19, 129, 130, 131, 132, 112, 113, 11, 496, + 19, 14, 19, 297, 298, 299, 139, 412, 4, 414, + 76, 77, 417, 129, 130, 131, 132, 4, 423, 424, + 142, 142, 4, 136, 458, 22, 23, 461, 462, 463, + 324, 19, 140, 145, 531, 140, 9, 9, 9, 536, + 334, 519, 50, 11, 522, 450, 451, 139, 453, 454, + 145, 139, 139, 139, 459, 139, 553, 554, 19, 139, + 139, 558, 467, 139, 561, 136, 139, 33, 362, 363, + 364, 365, 366, 136, 136, 369, 55, 56, 57, 58, + 59, 60, 487, 139, 139, 54, 136, 136, 136, 136, + 136, 496, 136, 516, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 141, 136, + 136, 534, 136, 136, 136, 316, 317, 318, 319, 320, + 136, 136, 136, 33, 0, 145, 531, 136, 329, 330, + 331, 536, 19, 4, 428, 136, 140, 19, 136, 15, + 16, 17, 14, 19, 20, 14, 139, 441, 553, 554, + 26, 27, 446, 558, 4, 136, 561, 140, 452, 136, + 136, 136, 136, 19, 458, 145, 136, 461, 462, 463, + 46, 48, 466, 49, 139, 445, 136, 53, 379, 380, + 136, 136, 136, 136, 136, 386, 136, 136, 48, 140, + 136, 14, 140, 7, 8, 140, 10, 11, 12, 13, + 14, 141, 16, 17, 143, 19, 20, 7, 8, 140, + 10, 11, 12, 13, 14, 143, 16, 17, 140, 19, + 20, 140, 140, 4, 518, 136, 14, 14, 136, 14, + 44, 432, 433, 434, 435, 66, 14, 118, 439, 440, + 118, 511, 3, 4, 44, 118, 7, 8, 9, 84, + 228, 511, 483, 97, 103, 16, 17, 15, 19, 20, + 21, 22, 23, 81, 208, 229, 52, 468, 469, 466, + 381, -1, -1, -1, 35, 36, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, -1, -1, -1, 7, + 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, + -1, 19, 20, 504, -1, 506, 507, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 138, -1, 44, 141, -1, -1, + 144, -1, 146, 147, -1, -1, -1, -1, 138, -1, + -1, 141, -1, -1, 144, -1, 146, 147, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, -1, 124, -1, 126, 127, 128, 3, 4, + -1, -1, 7, 8, 9, -1, 137, -1, 139, -1, + -1, 16, 17, 144, 19, 20, 21, 22, 23, -1, + -1, -1, -1, 7, 8, -1, -1, -1, -1, -1, + 35, 36, 16, 17, -1, 19, 20, 21, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 52, -1, -1, + 138, 35, 36, 141, -1, -1, 144, -1, 146, 147, + -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - -1, 43, 7, 8, -1, 10, 11, 12, 13, 14, - -1, 16, 17, -1, 19, 20, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 43, 123, - -1, 125, 126, 127, 7, 8, -1, 10, 11, 12, - 13, 14, -1, 16, 17, -1, 19, 20, -1, 143, - 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, - 17, -1, 19, 20, -1, -1, -1, -1, -1, -1, - 43, -1, -1, -1, -1, -1, 33, -1, -1, -1, - -1, -1, -1, -1, -1, 137, 43, -1, 140, -1, - -1, 143, -1, 145, 146, -1, -1, 7, 8, -1, - 10, 11, 12, 13, 14, -1, 16, 17, -1, 19, - 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 137, 33, -1, 140, -1, -1, 143, -1, - 145, 146, -1, 43, -1, 7, 8, -1, 10, 11, + 84, -1, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, -1, 124, + -1, 126, 127, 128, -1, -1, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 144, + 124, -1, 126, 127, 128, -1, -1, -1, 3, 4, + -1, -1, -1, 137, 9, 139, -1, 141, -1, -1, + 144, -1, 146, -1, 148, -1, 21, 22, 23, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 35, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 7, 8, 52, 10, 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, - -1, -1, -1, 7, 8, -1, 10, 11, 12, 13, - 14, 33, 16, 17, 137, 19, 20, 140, -1, -1, - 143, 43, 145, 146, -1, -1, -1, -1, -1, -1, - 137, -1, -1, 140, -1, -1, 143, -1, 145, 43, + -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + -1, 7, 8, -1, 10, 11, 12, 13, 14, -1, + 16, 17, -1, 19, 20, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 34, 124, + -1, 126, 127, 128, -1, -1, -1, -1, 44, -1, + -1, 7, 8, -1, 10, 11, 12, 13, 14, 144, + 16, 17, -1, 19, 20, -1, -1, -1, -1, -1, + 7, 8, -1, 10, 11, 12, 13, 14, 34, 16, + 17, -1, 19, 20, -1, -1, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, + -1, -1, 144, -1, 146, 147, -1, 44, -1, 7, + 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, + -1, 19, 20, -1, -1, 7, 8, -1, 10, 11, + 12, 13, 14, -1, 16, 17, 34, 19, 20, -1, + -1, -1, 138, -1, -1, 141, 44, -1, 144, -1, + 146, -1, 34, -1, 7, 8, -1, 10, 11, 12, + 13, 14, 44, 16, 17, -1, 19, 20, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, 138, -1, -1, 141, -1, -1, 144, -1, + 146, 44, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, 141, 44, 143, 144, -1, 146, 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, 7, 8, -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, -1, -1, - -1, -1, -1, -1, -1, -1, 43, 137, -1, -1, - 140, -1, -1, 143, -1, 145, -1, -1, 7, 8, - 43, 10, 11, 12, 13, 14, -1, 16, 17, -1, - 19, 20, -1, -1, 7, 8, -1, 10, 11, 12, - 13, 14, -1, 16, 17, 137, 19, 20, 140, -1, - -1, 143, -1, 145, 43, 7, 8, -1, 10, 11, - 12, 13, 14, 137, 16, 17, 140, 19, 20, 143, - 43, 145, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, - 137, -1, -1, 140, -1, -1, 143, -1, 145, -1, - -1, -1, -1, -1, 137, -1, -1, 140, -1, -1, - 143, -1, 145, -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, 137, -1, - -1, 140, -1, -1, 143, -1, 145, -1, -1, -1, - -1, -1, -1, -1, 137, 31, -1, 140, -1, -1, - 143, -1, 145, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 49, 50, 137, -1, -1, 140, -1, - -1, 143, -1, 145, -1, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 104, 105, - 106, -1, -1, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127 + 138, -1, -1, 141, -1, -1, 144, 44, 146, -1, + -1, -1, -1, -1, -1, -1, 138, -1, -1, 141, + -1, 44, 144, -1, 146, -1, 7, 8, -1, 10, + 11, 12, 13, 14, -1, 16, 17, -1, 19, 20, + -1, -1, -1, -1, -1, 138, -1, -1, 141, -1, + -1, 144, -1, 146, -1, -1, -1, -1, -1, 138, + -1, -1, 141, 44, -1, 144, -1, 146, 7, 8, + -1, 10, 11, 12, 13, 14, -1, 16, 17, -1, + 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 31, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, 141, 44, -1, 144, -1, 146, + -1, -1, 50, 51, -1, 138, -1, -1, 141, -1, + -1, 144, -1, 146, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, + 141, -1, -1, 144, -1, 146, -1, 105, 106, 107, + -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, -1, -1, -1, -1, -1, -1, -1, -1, 138, + -1, -1, 141, -1, -1, 144, -1, 146 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { - 0, 16, 17, 19, 20, 26, 27, 45, 48, 52, - 156, 158, 159, 160, 188, 189, 190, 192, 191, 46, - 60, 197, 134, 51, 134, 15, 134, 36, 37, 38, - 39, 40, 41, 42, 44, 133, 161, 162, 163, 0, - 190, 40, 42, 164, 207, 36, 37, 38, 41, 165, - 204, 206, 213, 134, 134, 140, 198, 19, 196, 7, - 8, 10, 11, 12, 13, 14, 43, 137, 140, 143, - 145, 156, 159, 177, 178, 210, 163, 163, 28, 29, - 187, 163, 163, 18, 214, 215, 25, 146, 205, 214, - 19, 19, 19, 199, 138, 4, 4, 4, 145, 10, - 146, 178, 183, 136, 138, 187, 187, 11, 12, 13, - 154, 155, 178, 184, 54, 55, 56, 57, 58, 59, - 166, 202, 202, 158, 218, 135, 142, 33, 178, 179, - 181, 182, 141, 141, 146, 183, 135, 146, 182, 184, - 178, 22, 23, 3, 4, 5, 6, 9, 21, 34, - 35, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 109, 110, + 0, 16, 17, 19, 20, 26, 27, 46, 49, 53, + 157, 159, 160, 161, 190, 191, 192, 194, 193, 47, + 61, 199, 135, 52, 135, 15, 135, 37, 38, 39, + 40, 41, 42, 43, 45, 134, 162, 163, 164, 0, + 192, 41, 43, 165, 209, 37, 38, 39, 42, 166, + 206, 208, 215, 135, 135, 141, 200, 19, 198, 7, + 8, 10, 11, 12, 13, 14, 44, 138, 141, 144, + 146, 157, 160, 178, 179, 212, 164, 164, 32, 189, + 164, 164, 18, 216, 217, 25, 147, 207, 216, 19, + 19, 19, 201, 139, 4, 4, 4, 146, 10, 147, + 179, 184, 137, 139, 189, 189, 28, 29, 188, 55, + 56, 57, 58, 59, 60, 167, 204, 204, 159, 220, + 136, 143, 34, 179, 180, 182, 183, 142, 142, 147, + 184, 136, 147, 183, 188, 188, 11, 12, 13, 155, + 156, 179, 185, 4, 10, 179, 181, 24, 146, 205, + 31, 50, 51, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 105, 106, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 123, 125, 126, 127, 140, 143, 145, 147, 149, - 150, 151, 185, 210, 193, 4, 10, 178, 180, 24, - 145, 203, 31, 49, 50, 61, 62, 63, 64, 65, - 66, 82, 83, 104, 105, 106, 109, 122, 123, 124, - 125, 126, 127, 149, 150, 151, 216, 222, 223, 224, - 225, 19, 168, 135, 139, 178, 178, 144, 146, 178, - 139, 194, 195, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 152, 22, 23, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 153, 138, 138, 138, 138, 138, 142, 184, 186, 145, - 186, 146, 186, 19, 138, 138, 138, 135, 175, 159, - 49, 10, 178, 212, 11, 14, 11, 154, 166, 152, - 153, 178, 178, 212, 178, 178, 219, 212, 212, 212, - 212, 212, 178, 178, 212, 166, 107, 108, 111, 112, - 129, 130, 167, 33, 179, 170, 142, 144, 144, 170, - 175, 175, 138, 138, 184, 184, 184, 184, 184, 135, - 142, 146, 178, 186, 144, 146, 184, 184, 184, 30, - 47, 173, 176, 138, 3, 4, 9, 21, 22, 23, - 34, 35, 51, 143, 185, 209, 210, 211, 211, 211, - 211, 180, 178, 178, 135, 172, 135, 172, 211, 140, - 135, 135, 135, 135, 135, 135, 211, 211, 32, 180, - 178, 212, 128, 131, 167, 169, 184, 184, 221, 135, - 135, 135, 135, 184, 144, 146, 135, 135, 32, 19, - 4, 175, 33, 178, 200, 201, 53, 208, 186, 135, - 135, 211, 211, 211, 11, 47, 11, 221, 211, 140, - 212, 178, 212, 212, 212, 135, 135, 178, 211, 211, - 135, 135, 135, 135, 139, 184, 184, 184, 184, 144, - 184, 184, 178, 168, 135, 139, 19, 144, 14, 14, - 138, 135, 135, 211, 4, 211, 135, 211, 135, 135, - 135, 211, 211, 138, 178, 184, 184, 212, 135, 139, - 135, 135, 139, 139, 139, 156, 157, 33, 178, 170, - 135, 211, 211, 178, 220, 211, 211, 135, 172, 172, - 211, 135, 212, 212, 212, 220, 211, 139, 139, 184, - 184, 184, 168, 173, 174, 19, 135, 140, 211, 135, - 139, 142, 211, 139, 139, 139, 139, 157, 47, 171, - 14, 142, 154, 217, 168, 178, 170, 142, 170, 4, - 211, 209, 142, 154, 211, 32, 135, 209, 168, 14, - 14, 135, 211, 211, 14, 65, 211, 14, 211 + 121, 122, 123, 124, 125, 126, 127, 128, 150, 151, + 152, 218, 224, 225, 226, 227, 19, 169, 136, 140, + 179, 179, 145, 147, 179, 140, 185, 179, 22, 23, + 3, 4, 5, 6, 9, 21, 35, 36, 83, 84, + 110, 124, 126, 127, 128, 141, 144, 146, 148, 150, + 151, 152, 186, 212, 195, 160, 50, 10, 179, 214, + 11, 14, 11, 155, 167, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 153, 22, 23, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 154, 179, 179, 214, 179, 179, 221, 214, + 214, 214, 214, 214, 179, 179, 214, 167, 108, 109, + 112, 113, 130, 131, 168, 34, 180, 171, 143, 145, + 145, 171, 196, 197, 153, 154, 139, 139, 139, 139, + 139, 143, 185, 187, 146, 187, 147, 187, 19, 139, + 139, 139, 136, 176, 139, 3, 4, 9, 21, 22, + 23, 35, 36, 52, 144, 186, 211, 212, 213, 213, + 213, 213, 181, 179, 179, 136, 173, 136, 173, 213, + 141, 136, 136, 136, 136, 136, 136, 213, 213, 33, + 181, 179, 214, 129, 132, 168, 170, 176, 176, 139, + 139, 185, 185, 185, 185, 185, 136, 143, 147, 179, + 187, 145, 147, 185, 185, 185, 30, 48, 174, 177, + 34, 179, 202, 203, 54, 210, 187, 136, 136, 213, + 213, 213, 11, 48, 11, 223, 213, 141, 214, 179, + 214, 214, 214, 136, 136, 179, 213, 213, 136, 185, + 185, 223, 136, 136, 136, 136, 185, 145, 147, 136, + 136, 33, 19, 4, 176, 169, 136, 140, 19, 145, + 14, 14, 139, 136, 136, 213, 4, 213, 136, 136, + 213, 136, 136, 136, 213, 213, 139, 179, 136, 136, + 140, 185, 185, 185, 185, 145, 185, 185, 179, 157, + 158, 34, 179, 171, 136, 213, 213, 179, 222, 213, + 213, 136, 173, 173, 214, 213, 136, 214, 214, 214, + 222, 213, 185, 185, 136, 140, 136, 136, 140, 140, + 140, 169, 174, 175, 19, 136, 141, 213, 136, 140, + 143, 213, 140, 140, 140, 185, 185, 185, 158, 48, + 172, 14, 143, 155, 219, 169, 179, 171, 143, 171, + 140, 140, 140, 4, 213, 211, 143, 155, 213, 33, + 136, 211, 169, 14, 14, 136, 213, 213, 14, 66, + 213, 14, 213 }; #define yyerrok (yyerrstatus = 0) @@ -2397,7 +2454,7 @@ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ @@ -2405,7 +2462,7 @@ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) #define YYTERROR 1 @@ -2420,7 +2477,7 @@ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (N) \ + if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -2434,7 +2491,7 @@ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (0) + while (YYID (0)) #endif @@ -2446,8 +2503,8 @@ # if 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) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -2474,36 +2531,96 @@ do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (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 (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]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short int *bottom, short int *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short int *bottom; - short int *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -2512,37 +2629,45 @@ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +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), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[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"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2576,42 +2701,44 @@ #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# 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 -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# 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 * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { char *yyd = yydest; const char *yys = yysrc; @@ -2637,7 +2764,7 @@ { if (*yystr == '"') { - size_t yyn = 0; + YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) @@ -2672,53 +2799,123 @@ } # endif -#endif /* YYERROR_VERBOSE */ +/* 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) +{ + 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; -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + 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; + } - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + if (yysize_overflow) + return YYSIZE_MAXIMUM; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; + 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; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -2729,8 +2926,7 @@ YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; @@ -2740,7 +2936,7 @@ { default: - break; + break; } } @@ -2748,13 +2944,13 @@ /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -2779,14 +2975,18 @@ `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -2804,6 +3004,12 @@ 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 /* Three stacks and their tools: `yyss': related to states, @@ -2814,9 +3020,9 @@ to reallocate them elsewhere. */ /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; @@ -2825,7 +3031,7 @@ -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -2834,9 +3040,9 @@ YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* 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")); @@ -2860,8 +3066,7 @@ `------------------------------------------------------------*/ 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. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -2874,11 +3079,11 @@ #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* 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 int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the @@ -2906,7 +3111,7 @@ yystacksize = YYMAXDEPTH; { - short int *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) @@ -2941,12 +3146,10 @@ `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ -/* yyresume: */ + /* 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 == YYPACT_NINF) goto yydefault; @@ -2988,22 +3191,21 @@ if (yyn == YYFINAL) YYACCEPT; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + /* 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; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - yystate = yyn; goto yynewstate; @@ -3039,150 +3241,150 @@ switch (yyn) { case 29: -#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1100 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1099 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1099 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1101 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1100 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1102 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1100 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1102 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1105 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1105 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1107 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1108 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1109 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1110 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1111 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1111 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1111 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1113 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1112 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1114 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1113 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1115 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 61: -#line 1122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1124 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 62: -#line 1126 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[-1].StrVal); + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR ;} break; case 63: -#line 1130 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3190,15 +3392,15 @@ break; case 66: -#line 1137 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.StrVal) = (yyvsp[-1].StrVal); + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR ;} break; case 67: -#line 1141 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1143 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3206,198 +3408,198 @@ break; case 68: -#line 1147 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 69: -#line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 70: -#line 1149 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 71: -#line 1150 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 72: -#line 1151 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 73: -#line 1155 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 74: -#line 1156 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 75: -#line 1157 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 76: -#line 1161 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 77: -#line 1162 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 78: -#line 1166 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 79: -#line 1167 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1169 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 80: -#line 1168 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1170 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 81: -#line 1172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 82: -#line 1173 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 83: -#line 1174 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 84: -#line 1175 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1177 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 85: -#line 1176 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1178 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 86: -#line 1179 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 87: -#line 1180 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 88: -#line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1183 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 89: -#line 1182 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 90: -#line 1183 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 91: -#line 1184 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1186 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 92: -#line 1185 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + 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 93: -#line 1192 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 94: -#line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1195 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 95: -#line 1194 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1196 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 96: -#line 1195 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1197 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 97: -#line 1198 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1200 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 98: -#line 1199 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1201 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 99: -#line 1204 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1206 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 100: -#line 1205 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1207 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 102: -#line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 103: -#line 1210 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ParamAttrs) = (yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs); + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 104: -#line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 105: -#line 1218 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); + (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 @@ -3405,14 +3607,14 @@ break; case 106: -#line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 107: -#line 1225 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); + (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 @@ -3420,57 +3622,57 @@ break; case 108: -#line 1233 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1235 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) - if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') + for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); 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 109: -#line 1241 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1243 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 110: -#line 1242 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[0].StrVal); ;} +#line 1244 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 111: -#line 1247 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 112: -#line 1248 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 113: -#line 1249 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurGV->setSection((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + CurGV->setSection((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR ;} break; case 114: -#line 1254 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) + 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 119: -#line 1270 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -3478,39 +3680,39 @@ break; case 120: -#line 1274 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1276 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); + (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR ;} break; case 121: -#line 1278 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1280 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? - if (*(yyvsp[-1].TypeVal) == Type::LabelTy) + if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); - delete (yyvsp[-1].TypeVal); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR ;} break; case 122: -#line 1285 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[0].ValIDVal)); + const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR (yyval.TypeVal) = new PATypeHolder(tmp); ;} break; case 123: -#line 1290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference - if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + 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... + 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 @@ -3518,14 +3720,14 @@ break; case 124: -#line 1298 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[(5) - (5)].ParamAttrs)); unsigned index = 1; - 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, ++index) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3539,22 +3741,22 @@ ParamAttrsList *ActualAttrs = 0; if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, ActualAttrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[-4].TypeVal); // Delete the return type handle + FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, ActualAttrs); + 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 125: -#line 1324 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsList Attrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - Attrs.addAttributes(0, (yyvsp[0].ParamAttrs)); - TypeWithAttrsList::iterator I = (yyvsp[-2].TypeWithAttrsList)->begin(), E = (yyvsp[-2].TypeWithAttrsList)->end(); + if ((yyvsp[(5) - (5)].ParamAttrs) != ParamAttr::None) + Attrs.addAttributes(0, (yyvsp[(5) - (5)].ParamAttrs)); + TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); unsigned index = 1; for ( ; I != E; ++I, ++index) { const Type* Ty = I->Ty->get(); @@ -3570,54 +3772,54 @@ if (!Attrs.empty()) ActualAttrs = new ParamAttrsList(Attrs); - FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, ActualAttrs); - delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list + FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, ActualAttrs); + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); CHECK_FOR_ERROR ;} break; case 126: -#line 1351 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/home/laurov/llvm/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); + (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 127: -#line 1356 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1358 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); - if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + 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"); - if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) GEN_ERROR("Vector length should be a power of 2"); - (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 128: -#line 1368 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1370 "/home/laurov/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); + delete (yyvsp[(2) - (3)].TypeList); CHECK_FOR_ERROR ;} break; case 129: -#line 1378 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -3625,21 +3827,21 @@ break; case 130: -#line 1382 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1384 "/home/laurov/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); + delete (yyvsp[(3) - (5)].TypeList); CHECK_FOR_ERROR ;} break; case 131: -#line 1392 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1394 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -3647,52 +3849,52 @@ break; case 132: -#line 1399 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1401 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs); + (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 133: -#line 1406 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1408 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - if (!(*(yyvsp[0].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); + if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - (yyval.TypeVal) = (yyvsp[0].TypeVal); + (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); ;} break; case 134: -#line 1413 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1415 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 135: -#line 1418 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1420 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs)); + (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 136: -#line 1423 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1425 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs)); + ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; case 138: -#line 1431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1433 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList); + (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); (yyval.TypeWithAttrsList)->push_back(TWA); @@ -3701,7 +3903,7 @@ break; case 139: -#line 1438 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1440 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -3712,7 +3914,7 @@ break; case 140: -#line 1445 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1447 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -3720,155 +3922,155 @@ break; case 141: -#line 1453 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1455 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); + (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); + delete (yyvsp[(1) - (1)].TypeVal); CHECK_FOR_ERROR ;} break; case 142: -#line 1459 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1461 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); - delete (yyvsp[0].TypeVal); + ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); + delete (yyvsp[(3) - (3)].TypeVal); CHECK_FOR_ERROR ;} break; case 143: -#line 1471 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1473 "/home/laurov/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 144: -#line 1499 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1501 "/home/laurov/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); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR ;} break; case 145: -#line 1515 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1517 "/home/laurov/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(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) + char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[0].StrVal))) + + itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); + for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[0].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free((yyvsp[0].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[-2].TypeVal); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR ;} break; case 146: -#line 1544 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1546 "/home/laurov/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 147: -#line 1572 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1574 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); + 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) + @@ -3878,21 +4080,21 @@ if (STy->isPacked()) 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 148: -#line 1597 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1599 "/home/laurov/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"); @@ -3902,25 +4104,25 @@ GEN_ERROR("Unpacked Initializer to vector type '" + STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-2].TypeVal); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR ;} break; case 149: -#line 1616 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1618 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get()); + 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) + @@ -3931,21 +4133,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 150: -#line 1642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1644 "/home/laurov/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"); @@ -3956,44 +4158,44 @@ STy->getDescription() + "'"); (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[-4].TypeVal); + delete (yyvsp[(1) - (5)].TypeVal); CHECK_FOR_ERROR ;} break; case 151: -#line 1662 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1664 "/home/laurov/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); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR ;} break; case 152: -#line 1674 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1676 "/home/laurov/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); + 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 153: -#line 1681 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1683 "/home/laurov/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"); @@ -4007,7 +4209,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; @@ -4022,16 +4224,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).Name; - else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID) + if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[(2) - (2)].ValIDVal).Name; + else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4047,277 +4249,287 @@ } // 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 + delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle CHECK_FOR_ERROR ;} break; case 154: -#line 1747 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1749 "/home/laurov/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); + (*(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 155: -#line 1757 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1759 "/home/laurov/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); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR ;} break; case 156: -#line 1767 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1769 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) + 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 157: -#line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1775 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); - if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { + 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); + (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); CHECK_FOR_ERROR ;} break; case 158: -#line 1783 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1785 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) + 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 159: -#line 1789 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1791 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[-1].PrimType))->getBitWidth(); - if ((yyvsp[0].APIntVal)->getBitWidth() > BitWidth) { + 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); + (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); CHECK_FOR_ERROR ;} break; case 160: -#line 1799 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1801 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getTrue(); CHECK_FOR_ERROR ;} break; case 161: -#line 1804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1806 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?"); + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); (yyval.ConstVal) = ConstantInt::getFalse(); CHECK_FOR_ERROR ;} break; case 162: -#line 1809 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1811 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) + if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); + (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); CHECK_FOR_ERROR ;} break; case 163: -#line 1817 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1819 "/home/laurov/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); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); + delete (yyvsp[(5) - (6)].TypeVal); ;} break; case 164: -#line 1829 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1831 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[-2].ConstVal)->getType())) + 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))[0], (yyvsp[-1].ValueList)->size(), + GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), &(*(yyvsp[(4) - (5)].ValueList))[0], (yyvsp[(4) - (5)].ValueList)->size(), 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 165: -#line 1851 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1853 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty) + 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 166: -#line 1859 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1861 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + 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)); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); ;} break; case 167: -#line 1865 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1867 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + 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 168: -#line 1876 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1878 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + 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)); + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); ;} break; case 169: -#line 1881 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1883 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + 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)); + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); ;} break; case 170: -#line 1886 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1888 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + 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 171: -#line 1892 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1894 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + 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 172: -#line 1898 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1900 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) + 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 173: -#line 1907 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1909 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); + ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR ;} break; case 174: -#line 1911 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1913 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); + (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR ;} break; case 175: -#line 1919 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 176: -#line 1919 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 177: -#line 1930 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 178: +#line 1924 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 179: +#line 1935 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4325,8 +4537,8 @@ ;} break; - case 178: -#line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 180: +#line 1940 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -4334,43 +4546,43 @@ ;} break; - case 181: -#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 183: +#line 1953 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; - case 182: -#line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 184: +#line 1953 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR ;} break; - case 183: -#line 1952 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 185: +#line 1957 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; - case 184: -#line 1952 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 186: +#line 1957 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 185: -#line 1955 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 187: +#line 1960 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 186: -#line 1958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 188: +#line 1963 "/home/laurov/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: // @@ -4380,111 +4592,111 @@ // 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 187: -#line 1982 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 189: +#line 1987 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType)); + 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 188: -#line 1993 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 190: +#line 1998 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ - if ((yyvsp[0].ConstVal) == 0) + if ((yyvsp[(5) - (5)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[(2) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal), (yyvsp[(3) - (5)].BoolVal)); CHECK_FOR_ERROR ;} break; - case 189: -#line 2000 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 191: +#line 2005 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 190: -#line 2003 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 192: +#line 2008 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[0].ConstVal) == 0) + if ((yyvsp[(6) - (6)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), (yyvsp[(6) - (6)].ConstVal)->getType(), (yyvsp[(6) - (6)].ConstVal), (yyvsp[(4) - (6)].BoolVal)); CHECK_FOR_ERROR ;} break; - case 191: -#line 2008 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 193: +#line 2013 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 192: -#line 2011 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 194: +#line 2016 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (6)].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), (yyvsp[(2) - (6)].Linkage), (yyvsp[(3) - (6)].Visibility), (yyvsp[(5) - (6)].BoolVal), *(yyvsp[(6) - (6)].TypeVal), 0, (yyvsp[(4) - (6)].BoolVal)); CHECK_FOR_ERROR - delete (yyvsp[0].TypeVal); + delete (yyvsp[(6) - (6)].TypeVal); ;} break; - case 193: -#line 2017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 195: +#line 2022 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 194: -#line 2021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 196: +#line 2026 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 195: -#line 2024 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 197: +#line 2029 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 196: -#line 2030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 198: +#line 2035 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string NewAsm((yyvsp[0].StrVal), EndStr); - free((yyvsp[0].StrVal)); + char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); + std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); + free((yyvsp[(1) - (1)].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); @@ -4494,87 +4706,87 @@ ;} break; - case 197: -#line 2043 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 199: +#line 2048 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); ;} break; - case 198: -#line 2047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 200: +#line 2052 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); ;} break; - case 200: -#line 2054 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 202: +#line 2059 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); CHECK_FOR_ERROR ;} break; - case 201: -#line 2059 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 203: +#line 2064 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); + CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR ;} break; - case 202: -#line 2064 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 204: +#line 2069 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 203: -#line 2073 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 205: +#line 2078 "/home/laurov/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); + 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 204: -#line 2083 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 206: +#line 2088 "/home/laurov/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); + 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 205: -#line 2094 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 207: +#line 2099 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[0].ArgList); + (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR ;} break; - case 206: -#line 2098 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 208: +#line 2103 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ArgList) = (yyvsp[-2].ArgList); + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; @@ -4584,8 +4796,8 @@ ;} break; - case 207: -#line 2107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 209: +#line 2112 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -4597,33 +4809,33 @@ ;} break; - case 208: -#line 2116 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 210: +#line 2121 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR ;} break; - case 209: -#line 2122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 211: +#line 2127 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - UnEscapeLexed((yyvsp[-6].StrVal)); - std::string FunctionName((yyvsp[-6].StrVal)); - free((yyvsp[-6].StrVal)); // Free strdup'd memory! + UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); + std::string FunctionName((yyvsp[(3) - (9)].StrVal)); + free((yyvsp[(3) - (9)].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[-7].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); std::vector ParamTypeList; ParamAttrsList ParamAttrs; - if ((yyvsp[-2].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[-2].ParamAttrs)); - if ((yyvsp[-4].ArgList)) { // If there are arguments... + if ((yyvsp[(7) - (9)].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[(7) - (9)].ParamAttrs)); + if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].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()); @@ -4641,10 +4853,10 @@ if (!ParamAttrs.empty()) ActualAttrs = new ParamAttrsList(ParamAttrs); - FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, ActualAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[-7].TypeVal); + delete (yyvsp[(2) - (9)].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4693,26 +4905,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[-8].UIntVal)); - Fn->setAlignment((yyvsp[0].UIntVal)); - if ((yyvsp[-1].StrVal)) { - Fn->setSection((yyvsp[-1].StrVal)); - free((yyvsp[-1].StrVal)); + Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); + Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); + if ((yyvsp[(8) - (9)].StrVal)) { + Fn->setSection((yyvsp[(8) - (9)].StrVal)); + free((yyvsp[(8) - (9)].StrVal)); } // Add all of the arguments we parsed to the function... - if ((yyvsp[-4].ArgList)) { // Is null if empty... + if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[-4].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[-4].ArgList)->back().Name == 0 && + assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[-4].ArgList)->back().Ty; - (yyvsp[-4].ArgList)->pop_back(); // Delete the last entry + delete (yyvsp[(5) - (9)].ArgList)->back().Ty; + (yyvsp[(5) - (9)].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[-4].ArgList)->begin(); - I != (yyvsp[-4].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); + I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4720,128 +4932,128 @@ Idx++; } - delete (yyvsp[-4].ArgList); // We're now done with the argument list + delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR ;} break; - case 212: -#line 2242 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 214: +#line 2247 "/home/laurov/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)); + (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); + (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); ;} break; - case 215: -#line 2253 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 217: +#line 2258 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 216: -#line 2258 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 218: +#line 2263 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - CurFun.CurrentFunction->setLinkage((yyvsp[-2].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[-1].Visibility)); + 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 217: -#line 2270 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 219: +#line 2275 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 218: -#line 2274 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 220: +#line 2279 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 219: -#line 2279 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 221: +#line 2284 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 220: -#line 2283 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 222: +#line 2288 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 221: -#line 2287 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 223: +#line 2292 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR ;} break; - case 222: -#line 2291 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 224: +#line 2296 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR ;} break; - case 223: -#line 2295 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 225: +#line 2300 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR ;} break; - case 224: -#line 2299 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 226: +#line 2304 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR ;} break; - case 225: -#line 2303 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 227: +#line 2308 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR ;} break; - case 226: -#line 2307 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 228: +#line 2312 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR ;} break; - case 227: -#line 2311 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 229: +#line 2316 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); - int NumElements = (yyvsp[-1].ConstVector)->size(); + 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( @@ -4853,209 +5065,209 @@ ); // 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 228: -#line 2336 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 230: +#line 2341 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 229: -#line 2340 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 231: +#line 2345 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); - std::string AsmStr = std::string((yyvsp[-2].StrVal), End); - End = UnEscapeLexed((yyvsp[0].StrVal), true); - std::string Constraints = std::string((yyvsp[0].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); - free((yyvsp[-2].StrVal)); - free((yyvsp[0].StrVal)); + char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); + std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); + End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); + std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); + free((yyvsp[(3) - (5)].StrVal)); + free((yyvsp[(5) - (5)].StrVal)); CHECK_FOR_ERROR ;} break; - case 230: -#line 2354 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 232: +#line 2359 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[0].UIntVal)); + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 231: -#line 2358 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 233: +#line 2363 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[0].UIntVal)); + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 232: -#line 2362 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 234: +#line 2367 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[0].StrVal)); + (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR ;} break; - case 233: -#line 2366 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 235: +#line 2371 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[0].StrVal)); + (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR ;} break; - case 236: -#line 2378 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 238: +#line 2383 "/home/laurov/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); + 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 237: -#line 2387 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 239: +#line 2392 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 238: -#line 2391 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 240: +#line 2396 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 239: -#line 2400 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 241: +#line 2405 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); + setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR - InsertValue((yyvsp[0].TermInstVal)); - (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); - (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); + 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 240: -#line 2409 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 242: +#line 2414 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (CastInst *CI1 = dyn_cast((yyvsp[0].InstVal))) + if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].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); + (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 241: -#line 2418 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 243: +#line 2423 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR ;} break; - case 242: -#line 2422 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 244: +#line 2427 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[0].StrVal))); + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal))); CHECK_FOR_ERROR ;} break; - case 243: -#line 2427 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 245: +#line 2432 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); + (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 244: -#line 2431 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 246: +#line 2436 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR ;} break; - case 245: -#line 2435 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 247: +#line 2440 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBB); ;} break; - case 246: -#line 2440 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 248: +#line 2445 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - assert(cast((yyvsp[-7].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[-3].ValIDVal)); + assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[0].ValIDVal)); + BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[-6].ValIDVal)); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); ;} break; - case 247: -#line 2450 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 249: +#line 2455 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)); + 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 = new SwitchInst(tmpVal, tmpBB, (yyvsp[-1].JumpTable)->size()); + SwitchInst *S = new SwitchInst(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 248: -#line 2469 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 250: +#line 2474 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - Value* tmpVal = getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)); + 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 = new SwitchInst(tmpVal, tmpBB, 0); (yyval.TermInstVal) = S; @@ -5063,21 +5275,21 @@ ;} break; - case 249: -#line 2479 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 251: +#line 2484 "/home/laurov/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; ParamAttrsList ParamAttrs; - if ((yyvsp[-6].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[-6].ParamAttrs)); - ValueRefList::iterator I = (yyvsp[-8].ValueRefList)->begin(), E = (yyvsp[-8].ValueRefList)->end(); + if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[(8) - (14)].ParamAttrs)); + ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -5091,22 +5303,22 @@ ParamAttrsList *Attrs = 0; if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[-11].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(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 // Check the arguments ValueList Args; - if ((yyvsp[-8].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[(6) - (14)].ValueRefList)->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 " @@ -5116,7 +5328,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-8].ValueRefList)->begin(), ArgE = (yyvsp[-8].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5135,346 +5347,346 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); - II->setCallingConv((yyvsp[-12].UIntVal)); + II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); (yyval.TermInstVal) = II; - delete (yyvsp[-8].ValueRefList); + delete (yyvsp[(6) - (14)].ValueRefList); CHECK_FOR_ERROR ;} break; - case 250: -#line 2554 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 252: +#line 2559 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR ;} break; - case 251: -#line 2558 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 253: +#line 2563 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR ;} break; - case 252: -#line 2565 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 254: +#line 2570 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.JumpTable) = (yyvsp[-5].JumpTable); - Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + (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 253: -#line 2576 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 255: +#line 2581 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingVal((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); + 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 254: -#line 2589 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 256: +#line 2594 "/home/laurov/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 255: -#line 2599 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 257: +#line 2604 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-5].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[-1].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[-5].TypeVal); + delete (yyvsp[(1) - (6)].TypeVal); ;} break; - case 256: -#line 2610 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 258: +#line 2615 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.PHIList) = (yyvsp[-6].PHIList); - Value* tmpVal = getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)); + (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)); + (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); ;} break; - case 257: -#line 2620 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 259: +#line 2625 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); // Used for call and invoke instructions (yyval.ValueRefList) = new ValueRefList(); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); + ValueRefListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); (yyval.ValueRefList)->push_back(E); - delete (yyvsp[-2].TypeVal); + delete (yyvsp[(1) - (3)].TypeVal); ;} break; - case 258: -#line 2629 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 260: +#line 2634 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[-4].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[0].ParamAttrs); E.Val = getVal((yyvsp[-2].TypeVal)->get(), (yyvsp[-1].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); + ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); (yyval.ValueRefList)->push_back(E); - delete (yyvsp[-2].TypeVal); + delete (yyvsp[(3) - (5)].TypeVal); CHECK_FOR_ERROR ;} break; - case 259: -#line 2638 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 261: +#line 2643 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueRefList) = new ValueRefList(); ;} break; - case 260: -#line 2641 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 262: +#line 2646 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; - case 261: -#line 2642 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 263: +#line 2647 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.ValueList) = (yyvsp[-2].ValueList); - (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); + (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); + (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 262: -#line 2649 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 264: +#line 2654 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 263: -#line 2653 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 265: +#line 2658 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 264: -#line 2658 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 266: +#line 2663 "/home/laurov/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"); - if (isa((*(yyvsp[-3].TypeVal)).get()) && - ((yyvsp[-4].BinaryOpVal) == Instruction::URem || - (yyvsp[-4].BinaryOpVal) == Instruction::SRem || - (yyvsp[-4].BinaryOpVal) == Instruction::FRem)) + if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && + ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || + (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || + (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) GEN_ERROR("Remainder not supported on vector types"); - 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); + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[-3].TypeVal); + delete (yyvsp[(2) - (5)].TypeVal); ;} break; - case 265: -#line 2679 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 267: +#line 2684 "/home/laurov/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); + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[-3].TypeVal); + delete (yyvsp[(2) - (5)].TypeVal); ;} break; - case 266: -#line 2696 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 268: +#line 2701 "/home/laurov/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); + (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); + delete (yyvsp[(3) - (6)].TypeVal); ;} break; - case 267: -#line 2710 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 269: +#line 2715 "/home/laurov/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); + (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); + delete (yyvsp[(3) - (6)].TypeVal); ;} break; - case 268: -#line 2724 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 270: +#line 2729 "/home/laurov/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); + (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); + delete (yyvsp[(4) - (4)].TypeVal); ;} break; - case 269: -#line 2736 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 271: +#line 2741 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if ((yyvsp[-4].ValueVal)->getType() != Type::Int1Ty) + 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) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 270: -#line 2744 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 272: +#line 2749 "/home/laurov/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); + 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 271: -#line 2751 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 273: +#line 2756 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + 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 272: -#line 2757 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 274: +#line 2762 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); - (yyval.InstVal) = new InsertElementInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 273: -#line 2763 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 275: +#line 2768 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) + 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 274: -#line 2769 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 276: +#line 2774 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); + 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) = new PHINode(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) + ((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 275: -#line 2785 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 277: +#line 2790 "/home/laurov/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; ParamAttrsList ParamAttrs; - if ((yyvsp[0].ParamAttrs) != ParamAttr::None) - ParamAttrs.addAttributes(0, (yyvsp[0].ParamAttrs)); + if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) + ParamAttrs.addAttributes(0, (yyvsp[(8) - (8)].ParamAttrs)); unsigned index = 1; - ValueRefList::iterator I = (yyvsp[-2].ValueRefList)->begin(), E = (yyvsp[-2].ValueRefList)->end(); + ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -5488,16 +5700,16 @@ if (!ParamAttrs.empty()) Attrs = new ParamAttrsList(ParamAttrs); - Ty = FunctionType::get((yyvsp[-5].TypeVal)->get(), ParamTypes, false, Attrs); + Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, Attrs); PFTy = PointerType::get(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 the arguments ValueList Args; - if ((yyvsp[-2].ValueRefList)->empty()) { // Has no arguments? + if ((yyvsp[(6) - (8)].ValueRefList)->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 " @@ -5508,7 +5720,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[-2].ValueRefList)->begin(), ArgE = (yyvsp[-2].ValueRefList)->end(); + ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5525,165 +5737,163 @@ } // Create the call node CallInst *CI = new CallInst(V, &Args[0], Args.size()); - CI->setTailCall((yyvsp[-7].BoolVal)); - CI->setCallingConv((yyvsp[-6].UIntVal)); + CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); + CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); (yyval.InstVal) = CI; - delete (yyvsp[-2].ValueRefList); - delete (yyvsp[-5].TypeVal); + delete (yyvsp[(6) - (8)].ValueRefList); + delete (yyvsp[(3) - (8)].TypeVal); CHECK_FOR_ERROR ;} break; - case 276: -#line 2856 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 278: +#line 2861 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - (yyval.InstVal) = (yyvsp[0].InstVal); + (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR ;} break; - case 277: -#line 2861 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 279: +#line 2866 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 278: -#line 2865 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 280: +#line 2870 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 279: -#line 2872 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 281: +#line 2877 "/home/laurov/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); + 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 280: -#line 2879 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 282: +#line 2884 "/home/laurov/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); + (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); ;} break; - case 281: -#line 2887 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 283: +#line 2892 "/home/laurov/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); + 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 282: -#line 2894 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 284: +#line 2899 "/home/laurov/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); + (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); ;} break; - case 283: -#line 2902 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 285: +#line 2907 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - if (!isa((yyvsp[0].ValueVal)->getType())) + 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 284: -#line 2910 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 286: +#line 2915 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - if (!isa((yyvsp[-1].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + if (!isa((yyvsp[(3) - (4)].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + if (!cast((yyvsp[(3) - (4)].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[(3) - (4)].TypeVal), (yyvsp[(4) - (4)].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[-3].BoolVal)); - delete (yyvsp[-1].TypeVal); + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); + delete (yyvsp[(3) - (4)].TypeVal); ;} break; - case 285: -#line 2924 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 287: +#line 2929 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[(5) - (6)].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[-1].TypeVal))->getDescription()); + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[-3].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + + if (ElTy != (yyvsp[(3) - (6)].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[(3) - (6)].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); + Value* tmpVal = getVal(*(yyvsp[(5) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), tmpVal, (yyvsp[-5].BoolVal)); - delete (yyvsp[-1].TypeVal); + (yyval.InstVal) = new StoreInst((yyvsp[(3) - (6)].ValueVal), tmpVal, (yyvsp[(1) - (6)].BoolVal)); + delete (yyvsp[(5) - (6)].TypeVal); ;} break; - case 286: -#line 2941 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" + case 288: +#line 2946 "/home/laurov/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))[0], (yyvsp[0].ValueList)->size(), true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size(), 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) = new GetElementPtrInst(tmpVal, &(*(yyvsp[0].ValueList))[0], (yyvsp[0].ValueList)->size()); - delete (yyvsp[-2].TypeVal); - delete (yyvsp[0].ValueList); + (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size()); + delete (yyvsp[(2) - (4)].TypeVal); + delete (yyvsp[(4) - (4)].ValueList); ;} break; +/* Line 1267 of yacc.c. */ +#line 5891 "llvmAsmParser.tab.c" default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 1126 of yacc.c. */ -#line 5682 "llvmAsmParser.tab.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -5712,110 +5922,41 @@ if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - char *yymsg = 0; -# define 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; - 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 ! 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 { - 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; + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } + } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= yysize1 < yysize; - yysize = yysize1; - - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg) - { - /* 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 = yymsg; - int yyi = 0; - while ((*yyp = *yyf)) - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - { - yyerror (YY_("syntax error")); + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) goto yyexhaustedlab; - } - } - else -#endif /* YYERROR_VERBOSE */ - yyerror (YY_("syntax error")); + } + } +#endif } @@ -5826,14 +5967,15 @@ error, discard it. */ if (yychar <= YYEOF) - { + { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; - } + } else { - yydestruct ("Error: discarding", yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; } } @@ -5851,11 +5993,14 @@ /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ - if (0) + if (/*CONSTCOND*/ 0) goto yyerrorlab; -yyvsp -= yylen; - yyssp -= yylen; + /* 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; @@ -5885,8 +6030,9 @@ YYABORT; - yydestruct ("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -5897,7 +6043,7 @@ *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -5932,21 +6078,30 @@ 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) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); - YYPOPSTACK; + YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 2958 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +#line 2963 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.64 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.65 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.64 Mon Apr 9 01:13:29 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Thu Apr 12 13:32:50 2007 @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 2.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* 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 @@ -18,10 +20,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -/* 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. */ +/* 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 @@ -58,108 +68,109 @@ CONSTANT = 284, SECTION = 285, VOLATILE = 286, - TO = 287, - DOTDOTDOT = 288, - NULL_TOK = 289, - UNDEF = 290, - INTERNAL = 291, - LINKONCE = 292, - WEAK = 293, - APPENDING = 294, - DLLIMPORT = 295, - DLLEXPORT = 296, - EXTERN_WEAK = 297, - OPAQUE = 298, - EXTERNAL = 299, - TARGET = 300, - TRIPLE = 301, - ALIGN = 302, - DEPLIBS = 303, - CALL = 304, - TAIL = 305, - ASM_TOK = 306, - MODULE = 307, - SIDEEFFECT = 308, - CC_TOK = 309, - CCC_TOK = 310, - FASTCC_TOK = 311, - COLDCC_TOK = 312, - X86_STDCALLCC_TOK = 313, - X86_FASTCALLCC_TOK = 314, - DATALAYOUT = 315, - RET = 316, - BR = 317, - SWITCH = 318, - INVOKE = 319, - UNWIND = 320, - UNREACHABLE = 321, - ADD = 322, - SUB = 323, - MUL = 324, - UDIV = 325, - SDIV = 326, - FDIV = 327, - UREM = 328, - SREM = 329, - FREM = 330, - AND = 331, - OR = 332, - XOR = 333, - SHL = 334, - LSHR = 335, - ASHR = 336, - ICMP = 337, - FCMP = 338, - EQ = 339, - NE = 340, - SLT = 341, - SGT = 342, - SLE = 343, - SGE = 344, - ULT = 345, - UGT = 346, - ULE = 347, - UGE = 348, - OEQ = 349, - ONE = 350, - OLT = 351, - OGT = 352, - OLE = 353, - OGE = 354, - ORD = 355, - UNO = 356, - UEQ = 357, - UNE = 358, - MALLOC = 359, - ALLOCA = 360, - FREE = 361, - LOAD = 362, - STORE = 363, - GETELEMENTPTR = 364, - TRUNC = 365, - ZEXT = 366, - SEXT = 367, - FPTRUNC = 368, - FPEXT = 369, - BITCAST = 370, - UITOFP = 371, - SITOFP = 372, - FPTOUI = 373, - FPTOSI = 374, - INTTOPTR = 375, - PTRTOINT = 376, - PHI_TOK = 377, - SELECT = 378, - VAARG = 379, - EXTRACTELEMENT = 380, - INSERTELEMENT = 381, - SHUFFLEVECTOR = 382, - NORETURN = 383, - INREG = 384, - SRET = 385, - NOUNWIND = 386, - DEFAULT = 387, - HIDDEN = 388 + THREAD_LOCAL = 287, + TO = 288, + DOTDOTDOT = 289, + NULL_TOK = 290, + UNDEF = 291, + INTERNAL = 292, + LINKONCE = 293, + WEAK = 294, + APPENDING = 295, + DLLIMPORT = 296, + DLLEXPORT = 297, + EXTERN_WEAK = 298, + OPAQUE = 299, + EXTERNAL = 300, + TARGET = 301, + TRIPLE = 302, + ALIGN = 303, + DEPLIBS = 304, + CALL = 305, + TAIL = 306, + ASM_TOK = 307, + MODULE = 308, + SIDEEFFECT = 309, + CC_TOK = 310, + CCC_TOK = 311, + FASTCC_TOK = 312, + COLDCC_TOK = 313, + X86_STDCALLCC_TOK = 314, + X86_FASTCALLCC_TOK = 315, + DATALAYOUT = 316, + RET = 317, + BR = 318, + SWITCH = 319, + INVOKE = 320, + UNWIND = 321, + UNREACHABLE = 322, + ADD = 323, + SUB = 324, + MUL = 325, + UDIV = 326, + SDIV = 327, + FDIV = 328, + UREM = 329, + SREM = 330, + FREM = 331, + AND = 332, + OR = 333, + XOR = 334, + SHL = 335, + LSHR = 336, + ASHR = 337, + ICMP = 338, + FCMP = 339, + EQ = 340, + NE = 341, + SLT = 342, + SGT = 343, + SLE = 344, + SGE = 345, + ULT = 346, + UGT = 347, + ULE = 348, + UGE = 349, + OEQ = 350, + ONE = 351, + OLT = 352, + OGT = 353, + OLE = 354, + OGE = 355, + ORD = 356, + UNO = 357, + UEQ = 358, + UNE = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + TRUNC = 366, + ZEXT = 367, + SEXT = 368, + FPTRUNC = 369, + FPEXT = 370, + BITCAST = 371, + UITOFP = 372, + SITOFP = 373, + FPTOUI = 374, + FPTOSI = 375, + INTTOPTR = 376, + PTRTOINT = 377, + PHI_TOK = 378, + SELECT = 379, + VAARG = 380, + EXTRACTELEMENT = 381, + INSERTELEMENT = 382, + SHUFFLEVECTOR = 383, + NORETURN = 384, + INREG = 385, + SRET = 386, + NOUNWIND = 387, + DEFAULT = 388, + HIDDEN = 389 }; #endif /* Tokens. */ @@ -192,115 +203,117 @@ #define CONSTANT 284 #define SECTION 285 #define VOLATILE 286 -#define TO 287 -#define DOTDOTDOT 288 -#define NULL_TOK 289 -#define UNDEF 290 -#define INTERNAL 291 -#define LINKONCE 292 -#define WEAK 293 -#define APPENDING 294 -#define DLLIMPORT 295 -#define DLLEXPORT 296 -#define EXTERN_WEAK 297 -#define OPAQUE 298 -#define EXTERNAL 299 -#define TARGET 300 -#define TRIPLE 301 -#define ALIGN 302 -#define DEPLIBS 303 -#define CALL 304 -#define TAIL 305 -#define ASM_TOK 306 -#define MODULE 307 -#define SIDEEFFECT 308 -#define CC_TOK 309 -#define CCC_TOK 310 -#define FASTCC_TOK 311 -#define COLDCC_TOK 312 -#define X86_STDCALLCC_TOK 313 -#define X86_FASTCALLCC_TOK 314 -#define DATALAYOUT 315 -#define RET 316 -#define BR 317 -#define SWITCH 318 -#define INVOKE 319 -#define UNWIND 320 -#define UNREACHABLE 321 -#define ADD 322 -#define SUB 323 -#define MUL 324 -#define UDIV 325 -#define SDIV 326 -#define FDIV 327 -#define UREM 328 -#define SREM 329 -#define FREM 330 -#define AND 331 -#define OR 332 -#define XOR 333 -#define SHL 334 -#define LSHR 335 -#define ASHR 336 -#define ICMP 337 -#define FCMP 338 -#define EQ 339 -#define NE 340 -#define SLT 341 -#define SGT 342 -#define SLE 343 -#define SGE 344 -#define ULT 345 -#define UGT 346 -#define ULE 347 -#define UGE 348 -#define OEQ 349 -#define ONE 350 -#define OLT 351 -#define OGT 352 -#define OLE 353 -#define OGE 354 -#define ORD 355 -#define UNO 356 -#define UEQ 357 -#define UNE 358 -#define MALLOC 359 -#define ALLOCA 360 -#define FREE 361 -#define LOAD 362 -#define STORE 363 -#define GETELEMENTPTR 364 -#define TRUNC 365 -#define ZEXT 366 -#define SEXT 367 -#define FPTRUNC 368 -#define FPEXT 369 -#define BITCAST 370 -#define UITOFP 371 -#define SITOFP 372 -#define FPTOUI 373 -#define FPTOSI 374 -#define INTTOPTR 375 -#define PTRTOINT 376 -#define PHI_TOK 377 -#define SELECT 378 -#define VAARG 379 -#define EXTRACTELEMENT 380 -#define INSERTELEMENT 381 -#define SHUFFLEVECTOR 382 -#define NORETURN 383 -#define INREG 384 -#define SRET 385 -#define NOUNWIND 386 -#define DEFAULT 387 -#define HIDDEN 388 - - - - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 937 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#define THREAD_LOCAL 287 +#define TO 288 +#define DOTDOTDOT 289 +#define NULL_TOK 290 +#define UNDEF 291 +#define INTERNAL 292 +#define LINKONCE 293 +#define WEAK 294 +#define APPENDING 295 +#define DLLIMPORT 296 +#define DLLEXPORT 297 +#define EXTERN_WEAK 298 +#define OPAQUE 299 +#define EXTERNAL 300 +#define TARGET 301 +#define TRIPLE 302 +#define ALIGN 303 +#define DEPLIBS 304 +#define CALL 305 +#define TAIL 306 +#define ASM_TOK 307 +#define MODULE 308 +#define SIDEEFFECT 309 +#define CC_TOK 310 +#define CCC_TOK 311 +#define FASTCC_TOK 312 +#define COLDCC_TOK 313 +#define X86_STDCALLCC_TOK 314 +#define X86_FASTCALLCC_TOK 315 +#define DATALAYOUT 316 +#define RET 317 +#define BR 318 +#define SWITCH 319 +#define INVOKE 320 +#define UNWIND 321 +#define UNREACHABLE 322 +#define ADD 323 +#define SUB 324 +#define MUL 325 +#define UDIV 326 +#define SDIV 327 +#define FDIV 328 +#define UREM 329 +#define SREM 330 +#define FREM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SHL 335 +#define LSHR 336 +#define ASHR 337 +#define ICMP 338 +#define FCMP 339 +#define EQ 340 +#define NE 341 +#define SLT 342 +#define SGT 343 +#define SLE 344 +#define SGE 345 +#define ULT 346 +#define UGT 347 +#define ULE 348 +#define UGE 349 +#define OEQ 350 +#define ONE 351 +#define OLT 352 +#define OGT 353 +#define OLE 354 +#define OGE 355 +#define ORD 356 +#define UNO 357 +#define UEQ 358 +#define UNE 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define TRUNC 366 +#define ZEXT 367 +#define SEXT 368 +#define FPTRUNC 369 +#define FPEXT 370 +#define BITCAST 371 +#define UITOFP 372 +#define SITOFP 373 +#define FPTOUI 374 +#define FPTOSI 375 +#define INTTOPTR 376 +#define PTRTOINT 377 +#define PHI_TOK 378 +#define SELECT 379 +#define VAARG 380 +#define EXTRACTELEMENT 381 +#define INSERTELEMENT 382 +#define SHUFFLEVECTOR 383 +#define NORETURN 384 +#define INREG 385 +#define SRET 386 +#define NOUNWIND 387 +#define DEFAULT 388 +#define HIDDEN 389 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 938 "/home/laurov/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -345,9 +358,10 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -/* Line 1447 of yacc.c. */ -#line 351 "llvmAsmParser.tab.h" +} +/* Line 1529 of yacc.c. */ +#line 364 "llvmAsmParser.tab.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -355,5 +369,3 @@ extern YYSTYPE llvmAsmlval; - - Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.338 llvm/lib/AsmParser/llvmAsmParser.y:1.339 --- llvm/lib/AsmParser/llvmAsmParser.y:1.338 Tue Apr 10 21:44:19 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Thu Apr 12 13:32:50 2007 @@ -704,7 +704,7 @@ GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool isConstantGlobal, const Type *Ty, - Constant *Initializer) { + Constant *Initializer, bool IsThreadLocal) { if (isa(Ty)) { GenerateError("Cannot declare global vars of function type"); return 0; @@ -737,6 +737,7 @@ GV->setLinkage(Linkage); GV->setVisibility(Visibility); GV->setConstant(isConstantGlobal); + GV->setThreadLocal(IsThreadLocal); InsertValue(GV, CurModule.Values); return GV; } @@ -761,7 +762,7 @@ // Otherwise there is no existing GV to use, create one now. GlobalVariable *GV = new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name, - CurModule.CurrentModule); + CurModule.CurrentModule, IsThreadLocal); GV->setVisibility(Visibility); InsertValue(GV, CurModule.Values); return GV; @@ -997,6 +998,7 @@ %type ArgType %type JumpTable %type GlobalType // GLOBAL or CONSTANT? +%type ThreadLocal // 'thread_local' or not %type OptVolatile // 'volatile' or not %type OptTailCall // TAIL CALL or plain CALL. %type OptSideEffect // 'sideeffect' or not. @@ -1038,7 +1040,7 @@ %type OptSection SectionString %token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK -%token DECLARE DEFINE GLOBAL CONSTANT SECTION VOLATILE +%token DECLARE DEFINE GLOBAL CONSTANT SECTION VOLATILE THREAD_LOCAL %token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING %token DLLIMPORT DLLEXPORT EXTERN_WEAK %token OPAQUE EXTERNAL TARGET TRIPLE ALIGN @@ -1918,6 +1920,9 @@ // GlobalType - Match either GLOBAL or CONSTANT for global declarations... GlobalType : GLOBAL { $$ = false; } | CONSTANT { $$ = true; }; +// ThreadLocal +ThreadLocal : THREAD_LOCAL { $$ = true; } | { $$ = false; }; + //===----------------------------------------------------------------------===// // Rules to match Modules @@ -1990,30 +1995,30 @@ } CHECK_FOR_ERROR } - | OptGlobalAssign GVVisibilityStyle GlobalType ConstVal { + | OptGlobalAssign GVVisibilityStyle ThreadLocal GlobalType ConstVal { /* "Externally Visible" Linkage */ - if ($4 == 0) + if ($5 == 0) GEN_ERROR("Global value initializer is not a constant"); CurGV = ParseGlobalVariable($1, GlobalValue::ExternalLinkage, - $2, $3, $4->getType(), $4); + $2, $4, $5->getType(), $5, $3); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; } - | OptGlobalAssign GVInternalLinkage GVVisibilityStyle GlobalType ConstVal { - if ($5 == 0) + | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal GlobalType ConstVal { + if ($6 == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable($1, $2, $3, $4, $5->getType(), $5); + CurGV = ParseGlobalVariable($1, $2, $3, $5, $6->getType(), $6, $4); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; } - | OptGlobalAssign GVExternalLinkage GVVisibilityStyle GlobalType Types { + | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal GlobalType Types { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription()); - CurGV = ParseGlobalVariable($1, $2, $3, $4, *$5, 0); + GEN_ERROR("Invalid upreference in type: " + (*$6)->getDescription()); + CurGV = ParseGlobalVariable($1, $2, $3, $5, *$6, 0, $4); CHECK_FOR_ERROR - delete $5; + delete $6; } GlobalVarAttributes { CurGV = 0; CHECK_FOR_ERROR Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.84 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.85 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.84 Tue Apr 10 21:44:19 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Thu Apr 12 13:32:50 2007 @@ -704,7 +704,7 @@ GlobalValue::LinkageTypes Linkage, GlobalValue::VisibilityTypes Visibility, bool isConstantGlobal, const Type *Ty, - Constant *Initializer) { + Constant *Initializer, bool IsThreadLocal) { if (isa(Ty)) { GenerateError("Cannot declare global vars of function type"); return 0; @@ -737,6 +737,7 @@ GV->setLinkage(Linkage); GV->setVisibility(Visibility); GV->setConstant(isConstantGlobal); + GV->setThreadLocal(IsThreadLocal); InsertValue(GV, CurModule.Values); return GV; } @@ -761,7 +762,7 @@ // Otherwise there is no existing GV to use, create one now. GlobalVariable *GV = new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name, - CurModule.CurrentModule); + CurModule.CurrentModule, IsThreadLocal); GV->setVisibility(Visibility); InsertValue(GV, CurModule.Values); return GV; @@ -997,6 +998,7 @@ %type ArgType %type JumpTable %type GlobalType // GLOBAL or CONSTANT? +%type ThreadLocal // 'thread_local' or not %type OptVolatile // 'volatile' or not %type OptTailCall // TAIL CALL or plain CALL. %type OptSideEffect // 'sideeffect' or not. @@ -1038,7 +1040,7 @@ %type OptSection SectionString %token ZEROINITIALIZER TRUETOK FALSETOK BEGINTOK ENDTOK -%token DECLARE DEFINE GLOBAL CONSTANT SECTION VOLATILE +%token DECLARE DEFINE GLOBAL CONSTANT SECTION VOLATILE THREAD_LOCAL %token TO DOTDOTDOT NULL_TOK UNDEF INTERNAL LINKONCE WEAK APPENDING %token DLLIMPORT DLLEXPORT EXTERN_WEAK %token OPAQUE EXTERNAL TARGET TRIPLE ALIGN @@ -1918,6 +1920,9 @@ // GlobalType - Match either GLOBAL or CONSTANT for global declarations... GlobalType : GLOBAL { $$ = false; } | CONSTANT { $$ = true; }; +// ThreadLocal +ThreadLocal : THREAD_LOCAL { $$ = true; } | { $$ = false; }; + //===----------------------------------------------------------------------===// // Rules to match Modules @@ -1990,30 +1995,30 @@ } CHECK_FOR_ERROR } - | OptGlobalAssign GVVisibilityStyle GlobalType ConstVal { + | OptGlobalAssign GVVisibilityStyle ThreadLocal GlobalType ConstVal { /* "Externally Visible" Linkage */ - if ($4 == 0) + if ($5 == 0) GEN_ERROR("Global value initializer is not a constant"); CurGV = ParseGlobalVariable($1, GlobalValue::ExternalLinkage, - $2, $3, $4->getType(), $4); + $2, $4, $5->getType(), $5, $3); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; } - | OptGlobalAssign GVInternalLinkage GVVisibilityStyle GlobalType ConstVal { - if ($5 == 0) + | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal GlobalType ConstVal { + if ($6 == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable($1, $2, $3, $4, $5->getType(), $5); + CurGV = ParseGlobalVariable($1, $2, $3, $5, $6->getType(), $6, $4); CHECK_FOR_ERROR } GlobalVarAttributes { CurGV = 0; } - | OptGlobalAssign GVExternalLinkage GVVisibilityStyle GlobalType Types { + | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal GlobalType Types { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*$5)->getDescription()); - CurGV = ParseGlobalVariable($1, $2, $3, $4, *$5, 0); + GEN_ERROR("Invalid upreference in type: " + (*$6)->getDescription()); + CurGV = ParseGlobalVariable($1, $2, $3, $5, *$6, 0, $4); CHECK_FOR_ERROR - delete $5; + delete $6; } GlobalVarAttributes { CurGV = 0; CHECK_FOR_ERROR From lauro.venancio at gmail.com Thu Apr 12 13:42:25 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 13:42:25 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704121842.l3CIgPaO009787@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.333 -> 1.334 --- Log message: Implement Thread Local Storage (TLS) in CBackend. --- Diffs of the changes: (+27 -17) CBackend.cpp | 44 +++++++++++++++++++++++++++----------------- 1 files changed, 27 insertions(+), 17 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.333 llvm/lib/Target/CBackend/CBackend.cpp:1.334 --- llvm/lib/Target/CBackend/CBackend.cpp:1.333 Tue Apr 10 21:44:19 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Thu Apr 12 13:42:08 2007 @@ -1505,22 +1505,23 @@ Out << "\n/* External Global Variable Declarations */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->hasExternalLinkage()) { + + if (I->hasExternalLinkage() || I->hasExternalWeakLinkage()) Out << "extern "; - printType(Out, I->getType()->getElementType(), false, - GetValueName(I)); - Out << ";\n"; - } else if (I->hasDLLImportLinkage()) { + else if (I->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; - printType(Out, I->getType()->getElementType(), false, - GetValueName(I)); - Out << ";\n"; - } else if (I->hasExternalWeakLinkage()) { - Out << "extern "; - printType(Out, I->getType()->getElementType(), false, - GetValueName(I)); - Out << " __EXTERNAL_WEAK__ ;\n"; - } + else + continue; // Internal Global + + // Thread Local Storage + if (I->isThreadLocal()) + Out << "__thread "; + + printType(Out, I->getType()->getElementType(), false, GetValueName(I)); + + if (I->hasExternalWeakLinkage()) + Out << " __EXTERNAL_WEAK__"; + Out << ";\n"; } } @@ -1563,11 +1564,16 @@ // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; - + if (I->hasInternalLinkage()) Out << "static "; else Out << "extern "; + + // Thread Local Storage + if (I->isThreadLocal()) + Out << "__thread "; + printType(Out, I->getType()->getElementType(), false, GetValueName(I)); @@ -1592,14 +1598,18 @@ // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; - + if (I->hasInternalLinkage()) Out << "static "; else if (I->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; else if (I->hasDLLExportLinkage()) Out << "__declspec(dllexport) "; - + + // Thread Local Storage + if (I->isThreadLocal()) + Out << "__thread "; + printType(Out, I->getType()->getElementType(), false, GetValueName(I)); if (I->hasLinkOnceLinkage()) From clattner at apple.com Thu Apr 12 13:50:47 2007 From: clattner at apple.com (clattner at apple.com) Date: Thu, 12 Apr 2007 11:50:47 -0700 (PDT) Subject: [llvm-commits] [126020] Add TLS support, patch by Lauro, thanks! Message-ID: <20070412185047.D9195E6F2507@src> Revision: 126020 Author: clattner Date: 2007-04-12 11:50:47 -0700 (Thu, 12 Apr 2007) Log Message: ----------- Add TLS support, patch by Lauro, thanks! Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-12 18:36:45 UTC (rev 126019) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-04-12 18:50:47 UTC (rev 126020) @@ -538,8 +538,6 @@ // FIXME: Support alignment on globals: DECL_ALIGN. // FIXME: DECL_PRESERVE_P indicates the var is marked with attribute 'used'. - if (TREE_CODE(decl) == VAR_DECL && DECL_THREAD_LOCAL(decl)) - sorry("thread-local data not supported by LLVM yet!"); // Global register variables don't turn into LLVM GlobalVariables. if (TREE_CODE(decl) == VAR_DECL && DECL_REGISTER(decl)) @@ -589,7 +587,11 @@ // Set the initializer. GV->setInitializer(Init); - + + // Set thread local (TLS) + if (TREE_CODE(decl) == VAR_DECL && DECL_THREAD_LOCAL(decl)) + GV->setThreadLocal(true); + // Set the linkage. if (!TREE_PUBLIC(decl)) { GV->setLinkage(GlobalValue::InternalLinkage); @@ -876,6 +878,10 @@ } } + // Set thread local (TLS) + if (TREE_CODE(decl) == VAR_DECL && DECL_THREAD_LOCAL(decl)) + GV->setThreadLocal(true); + SET_DECL_LLVM(decl, GV); } timevar_pop(TV_LLVM_GLOBALS); From rspencer at reidspencer.com Thu Apr 12 13:54:47 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 12 Apr 2007 11:54:47 -0700 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp In-Reply-To: <200704121833.l3CIXRZ7009414@zion.cs.uiuc.edu> References: <200704121833.l3CIXRZ7009414@zion.cs.uiuc.edu> Message-ID: <1176404087.23191.106.camel@bashful.x10sys.com> Hi Lauro, On Thu, 2007-04-12 at 13:33 -0500, Lauro Ramos Venancio wrote: > > Changes in directory llvm/lib/Bytecode/Reader: > > Analyzer.cpp updated: 1.39 -> 1.40 > Reader.cpp updated: 1.247 -> 1.248 > --- > Log message: > > Implement the "thread_local" keyword. Meta comment: I didn't see a commit to the BytecodeFormat.html document but you have changed the bytecode format. Please update the document. In general, I would prefer that you update the BytecodeFormat.html document before making these kinds of changes. This way everyone gets to review the proposed changes ahead of time and can make comments. The bytecode stuff is notoriously sensitive to bugs. Reid. > > > --- > Diffs of the changes: (+8 -5) > > Analyzer.cpp | 4 +++- > Reader.cpp | 9 +++++---- > 2 files changed, 8 insertions(+), 5 deletions(-) > > > Index: llvm/lib/Bytecode/Reader/Analyzer.cpp > diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.39 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.40 > --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.39 Wed Feb 14 21:39:18 2007 > +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Thu Apr 12 13:32:50 2007 > @@ -154,12 +154,14 @@ > GlobalValue::LinkageTypes Linkage, > GlobalValue::VisibilityTypes Visibility, > unsigned SlotNum, > - unsigned initSlot > + unsigned initSlot, > + bool isThreadLocal > ) { > if (os) { > *os << " GV: " > << ( initSlot == 0 ? "Uni" : "I" ) << "nitialized, " > << ( isConstant? "Constant, " : "Variable, ") > + << " Thread Local = " << ( isThreadLocal? "yes, " : "no, ") > << " Linkage=" << Linkage > << " Visibility="<< Visibility > << " Type="; > > > Index: llvm/lib/Bytecode/Reader/Reader.cpp > diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.247 llvm/lib/Bytecode/Reader/Reader.cpp:1.248 > --- llvm/lib/Bytecode/Reader/Reader.cpp:1.247 Mon Apr 9 15:28:40 2007 > +++ llvm/lib/Bytecode/Reader/Reader.cpp Thu Apr 12 13:32:50 2007 > @@ -1704,11 +1704,12 @@ > unsigned VarType = read_vbr_uint(); > while (VarType != Type::VoidTyID) { // List is terminated by Void > // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, bit2,3,4 = > - // Linkage, bit4+ = slot# > - unsigned SlotNo = VarType >> 5; > + // Linkage, bit5 = isThreadLocal, bit6+ = slot# > + unsigned SlotNo = VarType >> 6; This cuts in half the number of global variables that can handled. We're now down to 26 bits. I suppose that's okay but perhaps its time to use the "highest value means actual value follows in next word" trick. I.e. this should check to see if SlotNo is 2^26-1 and if it is it should read a uint64_t to get the actual slot number. The writer obviously needs to be changed too. > unsigned LinkageID = (VarType >> 2) & 7; > unsigned VisibilityID = 0; > bool isConstant = VarType & 1; > + bool isThreadLocal = (VarType >> 5) & 1; > bool hasInitializer = (VarType & 2) != 0; > unsigned Alignment = 0; > unsigned GlobalSectionID = 0; > @@ -1764,7 +1765,7 @@ > > // Create the global variable... > GlobalVariable *GV = new GlobalVariable(ElTy, isConstant, Linkage, > - 0, "", TheModule); > + 0, "", TheModule, isThreadLocal); > GV->setAlignment(Alignment); > GV->setVisibility(Visibility); > insertValue(GV, SlotNo, ModuleValues); > @@ -1781,7 +1782,7 @@ > // Notify handler about the global value. > if (Handler) > Handler->handleGlobalVariable(ElTy, isConstant, Linkage, Visibility, > - SlotNo, initSlot); > + SlotNo, initSlot, isThreadLocal); > > // Get next item > VarType = read_vbr_uint(); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Thu Apr 12 14:48:22 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 14:48:22 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121948.l3CJmM5D011296@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.86 -> 1.87 --- Log message: Add Michael McCracken. --- Diffs of the changes: (+3 -2) DevMtgMay2007.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.86 llvm-www/DevMtgMay2007.html:1.87 --- llvm-www/DevMtgMay2007.html:1.86 Thu Apr 12 13:20:39 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 14:48:05 2007 @@ -331,10 +331,11 @@
    Unconfirmed Attendees
    NameOrganization
    Lang HamesUniversity of Sydney
    Michael McCrackenUCSD, Ph.D. Candidate
    Unconfirmed 1Wind River
    Unconfirmed 1NASA, Ames
    -

    Total unconfirmed: 3

    +

    Total unconfirmed: 4

    @@ -439,6 +440,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 18:20:39 $ +
    Last modified: $Date: 2007/04/12 19:48:05 $ From lauro.venancio at gmail.com Thu Apr 12 14:53:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 14:53:03 -0500 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200704121953.l3CJr3TC011433@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.67 -> 1.68 --- Log message: update documentation --- Diffs of the changes: (+6 -2) BytecodeFormat.html | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.67 llvm/docs/BytecodeFormat.html:1.68 --- llvm/docs/BytecodeFormat.html:1.67 Tue Feb 27 20:33:06 2007 +++ llvm/docs/BytecodeFormat.html Thu Apr 12 14:52:46 2007 @@ -998,7 +998,11 @@ 6=DllExport, 7=ExternWeak - bit(5-31) + bit(5) + Is Thread Local? + + + bit(6-31) Type slot number of type for the global variable. @@ -2093,7 +2097,7 @@ Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/02/28 02:33:06 $ +Last modified: $Date: 2007/04/12 19:52:46 $ From reid at x10sys.com Thu Apr 12 14:53:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 14:53:58 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121953.l3CJrwq0011509@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.87 -> 1.88 --- Log message: Conference Room --- Diffs of the changes: (+6 -1) DevMtgMay2007.html | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.87 llvm-www/DevMtgMay2007.html:1.88 --- llvm-www/DevMtgMay2007.html:1.87 Thu Apr 12 14:48:05 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 14:53:41 2007 @@ -1,5 +1,7 @@
    May 25, 2007
    LLVM Developers' Meeting
    + + +
    1. Summary
    2. Agenda @@ -23,6 +25,9 @@
    3. Attendees
    4. Name That Compiler!
    +
    @@ -440,6 +445,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 19:48:05 $ +
    Last modified: $Date: 2007/04/12 19:53:41 $ From reid at x10sys.com Thu Apr 12 14:58:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 14:58:44 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121958.l3CJwiQb011650@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.88 -> 1.89 --- Log message: Rearrange to use some empty white space. --- Diffs of the changes: (+17 -18) DevMtgMay2007.html | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.88 llvm-www/DevMtgMay2007.html:1.89 --- llvm-www/DevMtgMay2007.html:1.88 Thu Apr 12 14:53:41 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 14:58:27 2007 @@ -3,7 +3,7 @@ -
      -
    1. Summary
    2. +
    3. Important Notes
    4. Agenda
      1. Session 0: LLVM History
      2. @@ -25,30 +25,30 @@
      3. Attendees
      4. Name That Compiler!
      -
    - - - -
    +
    • What: The first general meeting of LLVM Developers and Users.
    • Why: To get acquainted, learn how LLVM is used, and exchange ideas.
    • +
    • When: May 25, 2007, 8:00am to 6:00pm
    • Where: Cupertino Inn - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
    • -
    • When: May 25, 2007, 8:00am to 6:00pm
    • -
    • Who: Everyone is invited to participate and present. If you - would like to present, please send your ideas to - Reid Spencer so they can - be incorporated on this page.
    • -
    • How: You can attend for free just by sending an email to - LLVM Developers Mail List - indicating that you'd like to attend. Your name will be added below.
    + + + + + +
    +

    WHO IS INVITED: Everyone is invited to participate and present. If you + would like to present, please send your ideas to + Reid Spencer so they can be + incorporated on this page.

    +

    HOW TO REGISTER: You can attend for free just by sending an email to + LLVM Developers Mail List + indicating that you'd like to attend. Your name will be added below.

    NAME THAT COMPILER!: As mentioned in Chris Lattner's email, we are looking for an umbrella name for the collection of compiler and virtual @@ -56,7 +56,6 @@ prize! See Chris' email for details. We'll keep track of the proposed names here.

    -

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you pre-order your size. Send your size (S,M,L,XL) to Reid Spencer so they can be @@ -445,6 +444,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 19:53:41 $ +
    Last modified: $Date: 2007/04/12 19:58:27 $ From reid at x10sys.com Thu Apr 12 14:59:46 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 14:59:46 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704121959.l3CJxkxU011756@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.89 -> 1.90 --- Log message: Make the layout table wider. --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.89 llvm-www/DevMtgMay2007.html:1.90 --- llvm-www/DevMtgMay2007.html:1.89 Thu Apr 12 14:58:27 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 14:59:29 2007 @@ -25,7 +25,7 @@

  • Attendees
  • Name That Compiler!
  • - +
    • What: The first general meeting of LLVM Developers and Users.
    • @@ -444,6 +444,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 19:58:27 $ +
      Last modified: $Date: 2007/04/12 19:59:29 $ From lauro.venancio at gmail.com Thu Apr 12 15:34:53 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 12 Apr 2007 15:34:53 -0500 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200704122034.l3CKYraL012363@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.233 -> 1.234 --- Log message: update documentation --- Diffs of the changes: (+5 -3) LangRef.html | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.233 llvm/docs/LangRef.html:1.234 --- llvm/docs/LangRef.html:1.233 Wed Apr 11 20:03:03 2007 +++ llvm/docs/LangRef.html Thu Apr 12 15:34:36 2007 @@ -603,8 +603,10 @@

      Global variables define regions of memory allocated at compilation time instead of run-time. Global variables may optionally be initialized, may have an explicit section to be placed in, and may -have an optional explicit alignment specified. A -variable may be defined as a global "constant," which indicates that the +have an optional explicit alignment specified. A variable may be defined as +"thread_local", which means that it will not be shared by threads (each thread +will have a separated copy of the variable). +A variable may be defined as a global "constant," which indicates that the contents of the variable will never be modified (enabling better optimization, allowing the global data to be placed in the read-only section of an executable, etc). Note that variables that need runtime initialization @@ -4730,7 +4732,7 @@ Chris Lattner
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/04/12 01:03:03 $ + Last modified: $Date: 2007/04/12 20:34:36 $ From reid at x10sys.com Thu Apr 12 15:50:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 15:50:06 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122050.l3CKo62i012684@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.90 -> 1.91 --- Log message: Add LoveByte --- Diffs of the changes: (+3 -1) DevMtgMay2007.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.90 llvm-www/DevMtgMay2007.html:1.91 --- llvm-www/DevMtgMay2007.html:1.90 Thu Apr 12 14:59:29 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 15:49:49 2007 @@ -425,6 +425,8 @@ their domain. :) Duncan SandsOptLibPortmanteau of optimizing and library. Duncan SandsllvroomAs in the vrooming of a motorcycle engine. + Duncan SandsLoveByteAlong the Warloc - Loveloc + lines as baldric4 suggested in IRC. LOC = Lines of Code Paolo InvernizziMithrilThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. @@ -444,6 +446,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 19:59:29 $ +
      Last modified: $Date: 2007/04/12 20:49:49 $ From johannes at apple.com Thu Apr 12 15:54:25 2007 From: johannes at apple.com (johannes at apple.com) Date: Thu, 12 Apr 2007 13:54:25 -0700 (PDT) Subject: [llvm-commits] [126022] fix linkage of weak/linkonce functions Message-ID: <20070412205425.10F40E74D725@src> Revision: 126022 Author: johannes Date: 2007-04-12 13:54:24 -0700 (Thu, 12 Apr 2007) Log Message: ----------- fix linkage of weak/linkonce functions Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-12 19:07:05 UTC (rev 126021) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-12 20:54:24 UTC (rev 126022) @@ -495,16 +495,10 @@ // Compute the linkage that the function should get. if (!TREE_PUBLIC(FnDecl) /*|| lang_hooks.llvm_is_in_anon(subr)*/) { Fn->setLinkage(Function::InternalLinkage); - } else if (DECL_DECLARED_INLINE_P(FnDecl)) { - if (DECL_EXTERNAL(FnDecl)) { - Fn->setLinkage(Function::LinkOnceLinkage); - } else { - Fn->setLinkage(Function::WeakLinkage); - } - } else if (DECL_WEAK(FnDecl) || DECL_ONE_ONLY(FnDecl)) { - Fn->setLinkage(Function::WeakLinkage); } else if (DECL_COMDAT(FnDecl)) { Fn->setLinkage(Function::LinkOnceLinkage); + } else if (DECL_WEAK(FnDecl) || DECL_ONE_ONLY(FnDecl)) { + Fn->setLinkage(Function::WeakLinkage); } #ifdef TARGET_ADJUST_LLVM_LINKAGE From reid at x10sys.com Thu Apr 12 16:01:02 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 16:01:02 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704122101.l3CL123c012915@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.334 -> 1.335 --- Log message: Provide support for intrinsics that lower themselves to a function body. This can happen for intrinsics that are overloaded. In such cases it is necessary to emit a function prototype before the body of the function that calls the intrinsic and to ensure we don't emit it multiple times. --- Diffs of the changes: (+32 -2) CBackend.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.334 llvm/lib/Target/CBackend/CBackend.cpp:1.335 --- llvm/lib/Target/CBackend/CBackend.cpp:1.334 Thu Apr 12 13:42:08 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Thu Apr 12 16:00:45 2007 @@ -45,6 +45,7 @@ #include "llvm/Config/config.h" #include #include +// #include using namespace llvm; namespace { @@ -78,8 +79,9 @@ const TargetAsmInfo* TAsm; const TargetData* TD; std::map TypeNames; - std::map FPConstantMap; + std::set intrinsicPrototypesAlreadyGenerated; + public: CWriter(std::ostream &o) : Out(o), IL(0), Mang(0), LI(0), TheModule(0), TAsm(0), TD(0) {} @@ -2364,6 +2366,13 @@ void CWriter::lowerIntrinsics(Function &F) { + // This is used to keep track of intrinsics that get generated to a lowered + // function. We must generate the prototypes before the function body which + // will only be expanded on first use (by the loop below). + std::vector prototypesToGen; + + // Examine all the instructions in this function to find the intrinsics that + // need to be lowered. for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) if (CallInst *CI = dyn_cast(I++)) @@ -2404,10 +2413,31 @@ } else { I = BB->begin(); } + // If the intrinsic got lowered to another call, and that call has + // a definition then we need to make sure its prototype is emitted + // before any calls to it. + if (CallInst *Call = dyn_cast(I)) + if (Function *NewF = Call->getCalledFunction()) + if (!NewF->isDeclaration()) + prototypesToGen.push_back(NewF); + break; } -} + // We may have collected some prototypes to emit in the loop above. + // Emit them now, before the function that uses them is emitted. But, + // be careful not to emit them twice. + std::vector::iterator I = prototypesToGen.begin(); + std::vector::iterator E = prototypesToGen.end(); + for ( ; I != E; ++I) { + if (intrinsicPrototypesAlreadyGenerated.count(*I) == 0) { + Out << '\n'; + printFunctionSignature(*I, true); + Out << ";\n"; + intrinsicPrototypesAlreadyGenerated.insert(*I); + } + } +} void CWriter::visitCallInst(CallInst &I) { From dalej at apple.com Thu Apr 12 16:02:11 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 12 Apr 2007 16:02:11 -0500 Subject: [llvm-commits] CVS: llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp 2003-11-02-WeakLinkage.cpp.tr Message-ID: <200704122102.l3CL2B20012951@zion.cs.uiuc.edu> Changes in directory llvm/test/C++Frontend: 2007-04-11-InlineStorageClassC++.cpp added (r1.1) 2003-11-02-WeakLinkage.cpp.tr updated: 1.6 -> 1.7 --- Log message: testcases for function linkage --- Diffs of the changes: (+37 -1) 2003-11-02-WeakLinkage.cpp.tr | 1 2007-04-11-InlineStorageClassC++.cpp | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) Index: llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp diff -c /dev/null llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp:1.1 *** /dev/null Thu Apr 12 16:02:03 2007 --- llvm/test/C++Frontend/2007-04-11-InlineStorageClassC++.cpp Thu Apr 12 16:01:53 2007 *************** *** 0 **** --- 1,37 ---- + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | grep linkonce | wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | grep linkonce | wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xWeaknoinline | grep weak wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xWeakextnoinline | grep weak wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep declare | grep xglobnoWeak | grep linkonce | wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xstatnoWeak | grep internal | wc -l | grep 1 + // RUN: %llvmgxx %s -S -emit-llvm -O0 -o - | grep define | grep xextnoWeak | grep linkonce | wc -l | grep 1 + inline int xglobWeak(int) __attribute__((weak)); + inline int xglobWeak (int i) { + return i*2; + } + inline int xextWeak(int) __attribute__((weak)); + extern inline int xextWeak (int i) { + return i*4; + } + int xWeaknoinline(int) __attribute__((weak)); + int xWeaknoinline(int i) { + return i*8; + } + int xWeakextnoinline(int) __attribute__((weak)); + extern int xWeakextnoinline(int i) { + return i*16; + } + inline int xglobnoWeak (int i) { + return i*32; + } + static inline int xstatnoWeak (int i) { + return i*64; + } + extern inline int xextnoWeak (int i) { + return i*128; + } + int j(int y) { + return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+ + xglobWeak(y)+xextWeak(y)+ + xWeakextnoinline(y)+xWeaknoinline(y); + } Index: llvm/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr diff -u llvm/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.6 llvm/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.7 --- llvm/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr:1.6 Fri Jan 26 18:23:45 2007 +++ llvm/test/C++Frontend/2003-11-02-WeakLinkage.cpp.tr Thu Apr 12 16:01:53 2007 @@ -1,5 +1,4 @@ // RUN: %llvmgcc -xc++ -S -o - %s | not grep weak -// XFAIL: llvmgcc4 // The template should compile to linkonce linkage, not weak linkage. template From dalej at apple.com Thu Apr 12 16:02:13 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 12 Apr 2007 16:02:13 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-11-InlineStorageClassC89.c 2007-04-11-InlineStorageClassC99.c Message-ID: <200704122102.l3CL2D96012958@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-11-InlineStorageClassC89.c added (r1.1) 2007-04-11-InlineStorageClassC99.c added (r1.1) --- Log message: testcases for function linkage --- Diffs of the changes: (+74 -0) 2007-04-11-InlineStorageClassC89.c | 37 +++++++++++++++++++++++++++++++++++++ 2007-04-11-InlineStorageClassC99.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) Index: llvm/test/CFrontend/2007-04-11-InlineStorageClassC89.c diff -c /dev/null llvm/test/CFrontend/2007-04-11-InlineStorageClassC89.c:1.1 *** /dev/null Thu Apr 12 16:02:03 2007 --- llvm/test/CFrontend/2007-04-11-InlineStorageClassC89.c Thu Apr 12 16:01:53 2007 *************** *** 0 **** --- 1,37 ---- + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobWeak | grep weak | wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | grep weak | wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xWeaknoinline | grep weak wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xWeakextnoinline | grep weak wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xglobnoWeak | grep -v internal | grep -v weak | grep -v linkonce | wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep define | grep xstatnoWeak | grep internal | wc -l | grep 1 + // RUN: %llvmgcc %s -S -emit-llvm -O0 -o - | grep declare | grep xextnoWeak | grep -v internal | grep -v weak | grep -v linkonce | wc -l | grep 1 + inline int xglobWeak(int) __attribute__((weak)); + inline int xglobWeak (int i) { + return i*2; + } + inline int xextWeak(int) __attribute__((weak)); + extern inline int xextWeak (int i) { + return i*4; + } + int xWeaknoinline(int) __attribute__((weak)); + int xWeaknoinline(int i) { + return i*8; + } + int xWeakextnoinline(int) __attribute__((weak)); + extern int xWeakextnoinline(int i) { + return i*16; + } + inline int xglobnoWeak (int i) { + return i*32; + } + static inline int xstatnoWeak (int i) { + return i*64; + } + extern inline int xextnoWeak (int i) { + return i*128; + } + int j(int y) { + return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+ + xglobWeak(y)+xextWeak(y)+ + xWeakextnoinline(y)+xWeaknoinline(y); + } Index: llvm/test/CFrontend/2007-04-11-InlineStorageClassC99.c diff -c /dev/null llvm/test/CFrontend/2007-04-11-InlineStorageClassC99.c:1.1 *** /dev/null Thu Apr 12 16:02:13 2007 --- llvm/test/CFrontend/2007-04-11-InlineStorageClassC99.c Thu Apr 12 16:01:53 2007 *************** *** 0 **** --- 1,37 ---- + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | grep xglobWeak | grep extern_weak | wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | grep xextWeak | grep weak | wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | grep xWeaknoinline | grep weak wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | grep xWeakextnoinline | grep weak wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep declare | grep xglobnoWeak | grep -v internal | grep -v weak | grep -v linkonce | wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | grep xstatnoWeak | grep internal | wc -l | grep 1 + // RUN: %llvmgcc -std=c99 %s -S -emit-llvm -O0 -o - | grep define | grep xextnoWeak | grep -v internal | grep -v weak | grep -v linkonce | wc -l | grep 1 + inline int xglobWeak(int) __attribute__((weak)); + inline int xglobWeak (int i) { + return i*2; + } + inline int xextWeak(int) __attribute__((weak)); + extern inline int xextWeak (int i) { + return i*4; + } + int xWeaknoinline(int) __attribute__((weak)); + int xWeaknoinline(int i) { + return i*8; + } + int xWeakextnoinline(int) __attribute__((weak)); + extern int xWeakextnoinline(int i) { + return i*16; + } + inline int xglobnoWeak (int i) { + return i*32; + } + static inline int xstatnoWeak (int i) { + return i*64; + } + extern inline int xextnoWeak (int i) { + return i*128; + } + int j(int y) { + return xglobnoWeak(y)+xstatnoWeak(y)+xextnoWeak(y)+ + xglobWeak(y)+xextWeak(y)+ + xWeakextnoinline(y)+xWeaknoinline(y); + } From clattner at apple.com Thu Apr 12 16:29:35 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Apr 2007 14:29:35 -0700 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp In-Reply-To: <200704122101.l3CL123c012915@zion.cs.uiuc.edu> References: <200704122101.l3CL123c012915@zion.cs.uiuc.edu> Message-ID: <9CAEC576-6992-4266-9D85-6B67C23A3577@apple.com> > Provide support for intrinsics that lower themselves to a function > body. > This can happen for intrinsics that are overloaded. In such cases > it is > necessary to emit a function prototype before the body of the function > that calls the intrinsic and to ensure we don't emit it multiple > times. Please make sure these are emitted with weak linkage, so they get merged across .o files. > #include "llvm/Config/config.h" > #include > #include > +// #include > using namespace llvm; Plz remove. > > + // We may have collected some prototypes to emit in the loop above. > + // Emit them now, before the function that uses them is emitted. > But, > + // be careful not to emit them twice. > + std::vector::iterator I = prototypesToGen.begin(); > + std::vector::iterator E = prototypesToGen.end(); > + for ( ; I != E; ++I) { > + if (intrinsicPrototypesAlreadyGenerated.count(*I) == 0) { > + Out << '\n'; > + printFunctionSignature(*I, true); > + Out << ";\n"; > + intrinsicPrototypesAlreadyGenerated.insert(*I); Instead of count+insert, just use insert and check the result to see if it succeeded. Thanks, -chris > + } > + } > +} > > > void CWriter::visitCallInst(CallInst &I) { > > > > _______________________________________________ > 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 Thu Apr 12 16:30:52 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 13 Apr 2007 01:30:52 +0400 Subject: [llvm-commits] [126022] fix linkage of weak/linkonce functions In-Reply-To: <20070412205425.10F40E74D725.SS1429SS@src> References: <20070412205425.10F40E74D725.SS1429SS@src> Message-ID: <1176413452.13159.14.camel@asl.dorms.spbu.ru> Dale, > Log Message: > ----------- > fix linkage of weak/linkonce functions This patch definitely breaks Qt. This is very "fragile" place. In the past we've marked linkonce too much in order not to break stuff causing undefined references. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. From clattner at apple.com Thu Apr 12 16:30:57 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Apr 2007 14:30:57 -0700 Subject: [llvm-commits] [126022] fix linkage of weak/linkonce functions In-Reply-To: <1176413452.13159.14.camel@asl.dorms.spbu.ru> References: <20070412205425.10F40E74D725.SS1429SS@src> <1176413452.13159.14.camel@asl.dorms.spbu.ru> Message-ID: <10E7AF27-A66D-4F62-9291-8C826E606692@apple.com> On Apr 12, 2007, at 2:30 PM, Anton Korobeynikov wrote: > Dale, > >> Log Message: >> ----------- >> fix linkage of weak/linkonce functions > This patch definitely breaks Qt. This is very "fragile" place. In the > past we've marked linkonce too much in order not to break stuff > causing > undefined references. Anton, can you try to reduce a testcase that shows the incorrect linkage getting set? -Chris From dalej at apple.com Thu Apr 12 16:35:25 2007 From: dalej at apple.com (Dale Johannesen) Date: Thu, 12 Apr 2007 14:35:25 -0700 Subject: [llvm-commits] [126022] fix linkage of weak/linkonce functions In-Reply-To: <1176413452.13159.14.camel@asl.dorms.spbu.ru> References: <20070412205425.10F40E74D725.SS1429SS@src> <1176413452.13159.14.camel@asl.dorms.spbu.ru> Message-ID: On Apr 12, 2007, at 2:30 PM, Anton Korobeynikov wrote: > Dale, > >> Log Message: >> ----------- >> fix linkage of weak/linkonce functions > This patch definitely breaks Qt. This is very "fragile" place. In the > past we've marked linkonce too much in order not to break stuff > causing > undefined references. Agree it's fragile. This makes behavior same as gcc on MacOSX in all cases I could think of, could be I missed one, or OS difference. Please supply example. |-- > With best regards, Anton Korobeynikov. > > Faculty of Mathematics & Mechanics, Saint Petersburg State University. > > From reid at x10sys.com Thu Apr 12 16:53:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 16:53:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200704122153.l3CLruL3017642@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.79 -> 1.80 --- Log message: Make sure intrinsics that are lowered to functions make the function weak linkage so we only end up with one of them in a program. These are, after all overloaded and templatish in nature. --- Diffs of the changes: (+2 -2) IntrinsicLowering.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.79 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.80 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.79 Thu Apr 12 08:30:14 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Thu Apr 12 16:53:38 2007 @@ -264,7 +264,7 @@ Name[i] = '_'; Module* M = F->getParent(); F = cast(M->getOrInsertFunction(Name, FT)); - F->setLinkage(GlobalValue::InternalLinkage); + F->setLinkage(GlobalValue::WeakLinkage); // If we haven't defined the impl function yet, do so now if (F->isDeclaration()) { @@ -437,7 +437,7 @@ Name[i] = '_'; Module* M = F->getParent(); F = cast(M->getOrInsertFunction(Name, FT)); - F->setLinkage(GlobalValue::InternalLinkage); + F->setLinkage(GlobalValue::WeakLinkage); // If we haven't defined the impl function yet, do so now if (F->isDeclaration()) { From reid at x10sys.com Thu Apr 12 16:57:32 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 16:57:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704122157.l3CLvWAf018076@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.335 -> 1.336 --- Log message: Implement review feedback .. don't double search a set. --- Diffs of the changes: (+1 -3) CBackend.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.335 llvm/lib/Target/CBackend/CBackend.cpp:1.336 --- llvm/lib/Target/CBackend/CBackend.cpp:1.335 Thu Apr 12 16:00:45 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Thu Apr 12 16:57:15 2007 @@ -45,7 +45,6 @@ #include "llvm/Config/config.h" #include #include -// #include using namespace llvm; namespace { @@ -2430,11 +2429,10 @@ std::vector::iterator I = prototypesToGen.begin(); std::vector::iterator E = prototypesToGen.end(); for ( ; I != E; ++I) { - if (intrinsicPrototypesAlreadyGenerated.count(*I) == 0) { + if (intrinsicPrototypesAlreadyGenerated.insert(*I).second) { Out << '\n'; printFunctionSignature(*I, true); Out << ";\n"; - intrinsicPrototypesAlreadyGenerated.insert(*I); } } } From reid at x10sys.com Thu Apr 12 17:11:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 17:11:24 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.91 -> 1.92 --- Log message: More names. --- Diffs of the changes: (+11 -3) DevMtgMay2007.html | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.91 llvm-www/DevMtgMay2007.html:1.92 --- llvm-www/DevMtgMay2007.html:1.91 Thu Apr 12 15:49:49 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:11:07 2007 @@ -425,15 +425,23 @@ their domain. :) Duncan SandsOptLibPortmanteau of optimizing and library. Duncan SandsllvroomAs in the vrooming of a motorcycle engine. + Duncan SandsOptLOCPortmanteau of Optimization and + Lines Of Code Duncan SandsLoveByteAlong the Warloc - Loveloc - lines as baldric4 suggested in IRC. LOC = Lines of Code - + lines as baldric4 suggested in IRC. LOC = Lines of Code Paolo InvernizziMithrilThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. It could be beaten like copper, and polished like glass; and the Dwarves could make of it a metal, light and yet harder than tempered steel. Its beauty was like to that of common silver, but the beauty of mithril did not tarnish or grow dim." + Curt CoxOCTRUTHALOne Compiler To RUle THem ALl (and in the + darkness bind them)" You have to admit, it has a nice ring. + Michael McCrackenN??gadragon-like serpents from + Cambodian mythology, among other places. + Patrick MeredithAdamantAnother fictional Tolkien + metal. + Aaron GrayMotherNo explanation offered :)

      NOTE: Logos will need to be developed as well. If you have that talent, please send a JPEG/GIF to go with your name idea.

      @@ -446,6 +454,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 20:49:49 $ +
      Last modified: $Date: 2007/04/12 22:11:07 $ From jeffc at jolt-lang.org Thu Apr 12 17:19:31 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 12 Apr 2007 15:19:31 -0700 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html In-Reply-To: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> References: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> Message-ID: <461EB073.8090604@jolt-lang.org> Adamant isn't a Tolkien creation. It often refers to diamonds, but historically can mean any hard, "unbreakable" stone, metal or other substance. It's in the dictionary :) Reid Spencer wrote: > Changes in directory llvm-www: > > DevMtgMay2007.html updated: 1.91 -> 1.92 > --- > Log message: > > More names. > > > --- > Diffs of the changes: (+11 -3) > > DevMtgMay2007.html | 14 +++++++++++--- > 1 files changed, 11 insertions(+), 3 deletions(-) > > > Index: llvm-www/DevMtgMay2007.html > diff -u llvm-www/DevMtgMay2007.html:1.91 llvm-www/DevMtgMay2007.html:1.92 > --- llvm-www/DevMtgMay2007.html:1.91 Thu Apr 12 15:49:49 2007 > +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:11:07 2007 > @@ -425,15 +425,23 @@ > their domain. :) > Duncan SandsOptLibPortmanteau of optimizing and library. > Duncan SandsllvroomAs in the vrooming of a motorcycle engine. > + Duncan SandsOptLOCPortmanteau of Optimization and > + Lines Of Code > Duncan SandsLoveByteAlong the Warloc - Loveloc > - lines as baldric4 suggested in IRC. LOC = Lines of Code > - > + lines as baldric4 suggested in IRC. LOC = Lines of Code > Paolo InvernizziMithrilThe fictional metal from > JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. > It could be beaten like copper, and polished like glass; and the Dwarves could > make of it a metal, light and yet harder than tempered steel. Its beauty was like > to that of common silver, but the beauty of mithril did not tarnish or > grow dim." > + Curt CoxOCTRUTHALOne Compiler To RUle THem ALl (and in the > + darkness bind them)" You have to admit, it has a nice ring. > + Michael McCrackenN??gadragon-like serpents from > + Cambodian mythology, among other places. > + Patrick MeredithAdamantAnother fictional Tolkien > + metal. > + Aaron GrayMotherNo explanation offered :) > >

      NOTE: Logos will need to be developed as well. If you have that > talent, please send a JPEG/GIF to go with your name idea.

      > @@ -446,6 +454,6 @@ > src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> > src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> > -
      Last modified: $Date: 2007/04/12 20:49:49 $ > +
      Last modified: $Date: 2007/04/12 22:11:07 $ > > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070412/8541538b/attachment.html From reid at x10sys.com Thu Apr 12 17:21:30 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 17:21:30 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122221.l3CMLUi3020414@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.92 -> 1.93 --- Log message: Add Scott's Greek mythology names. --- Diffs of the changes: (+13 -5) DevMtgMay2007.html | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.92 llvm-www/DevMtgMay2007.html:1.93 --- llvm-www/DevMtgMay2007.html:1.92 Thu Apr 12 17:11:07 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:21:13 2007 @@ -423,11 +423,11 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) - Duncan SandsOptLibPortmanteau of optimizing and library. - Duncan SandsllvroomAs in the vrooming of a motorcycle engine. - Duncan SandsOptLOCPortmanteau of Optimization and + Duncan SandsOptLibPortmanteau of optimizing and library. + llvroomAs in the vrooming of a motorcycle engine. + OptLOCPortmanteau of Optimization and Lines Of Code - Duncan SandsLoveByteAlong the Warloc - Loveloc + LoveByteAlong the Warloc - Loveloc lines as baldric4 suggested in IRC. LOC = Lines of Code Paolo InvernizziMithrilThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. @@ -442,6 +442,14 @@ Patrick MeredithAdamantAnother fictional Tolkien metal. Aaron GrayMotherNo explanation offered :) + Scott McMurrayDaedalusGreek mythology: the + greatly skilled Athenian architect that built the palace of + Cnossus. + Heph??stusGreek mythology: God of smiths, builder of Helios's + chariot, maker of Talos, Crete and Europa's guardian robot, and fabricator of + the weapons of the Gods + LemnosGreek mythology: the island of Hephaestus + workshop

      NOTE: Logos will need to be developed as well. If you have that talent, please send a JPEG/GIF to go with your name idea.

      @@ -454,6 +462,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 22:11:07 $ +
      Last modified: $Date: 2007/04/12 22:21:13 $ From reid at x10sys.com Thu Apr 12 17:22:37 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 17:22:37 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122222.l3CMMb0r020595@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.93 -> 1.94 --- Log message: Learn how to do rowspan properly. --- Diffs of the changes: (+8 -7) DevMtgMay2007.html | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.93 llvm-www/DevMtgMay2007.html:1.94 --- llvm-www/DevMtgMay2007.html:1.93 Thu Apr 12 17:21:13 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:22:19 2007 @@ -423,11 +423,12 @@ Average Compiler" (BooBoo!). An acronym that you can pronounce. Unfortunately, the New York Athletic Club wouldn't like us stealing their domain. :) - Duncan SandsOptLibPortmanteau of optimizing and library. - llvroomAs in the vrooming of a motorcycle engine. - OptLOCPortmanteau of Optimization and + Duncan SandsOptLibPortmanteau of optimizing + and library. + llvroomAs in the vrooming of a motorcycle engine. + OptLOCPortmanteau of Optimization and Lines Of Code - LoveByteAlong the Warloc - Loveloc + LoveByteAlong the Warloc - Loveloc lines as baldric4 suggested in IRC. LOC = Lines of Code Paolo InvernizziMithrilThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. @@ -445,10 +446,10 @@ Scott McMurrayDaedalusGreek mythology: the greatly skilled Athenian architect that built the palace of Cnossus. - Heph??stusGreek mythology: God of smiths, builder of Helios's + Heph??stusGreek mythology: God of smiths, builder of Helios's chariot, maker of Talos, Crete and Europa's guardian robot, and fabricator of the weapons of the Gods - LemnosGreek mythology: the island of Hephaestus + LemnosGreek mythology: the island of Hephaestus workshop

      NOTE: Logos will need to be developed as well. If you have that @@ -462,6 +463,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 22:21:13 $ +
      Last modified: $Date: 2007/04/12 22:22:19 $ From reid at x10sys.com Thu Apr 12 17:25:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 17:25:09 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122225.l3CMP9Za021004@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.94 -> 1.95 --- Log message: Better grouping by submitter. --- Diffs of the changes: (+12 -15) DevMtgMay2007.html | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.94 llvm-www/DevMtgMay2007.html:1.95 --- llvm-www/DevMtgMay2007.html:1.94 Thu Apr 12 17:22:19 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:24:52 2007 @@ -388,20 +388,23 @@ Material displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already own the domain. Also connotes "illumination". - Reid Spencer + Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM letters but is a word and connotes "bed rock" and fluidity - Reid SpencerOptopiaA portmanteau from + OptopiaA portmanteau from optimization and utopia - Bill WendlingZemblaIt's a fictional northern European + NYACAlong Owen's idea: "Not Your + Average Compiler" (BooBoo!). An acronym that you can pronounce. + Unfortunately, the New York Athletic Club wouldn't like us stealing + their domain. :) + Bill WendlingZemblaIt's a fictional northern European country in "Pale Fire" by Nabokov. - Bill WendlingPalaThe island utopia in Aldos - Huxley's "Island". - Bill WendlingThraThe world of The Dark - Crystal. - Patrick MeredithInvictusunconquerable, and + PalaThe island utopia in Aldos Huxley's "Island". + ThraThe world of The Dark Crystal. + Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist. + AdamantA fictional Tolkien metal. Gabor GreifOtimoIt is a Portuguese word, meaning optimal, perfect. It is also different enough from plain English words to give a distinguished feel :-) and catch the eyes. The domains @@ -419,10 +422,6 @@ ALCS to make it even more unique. Zhongxing XuOmniC
      Omnipiler
      OmnicomStands for "Omnipotent Compiler". I prefer the first. - Reid SpencerNYACAlong Owen's idea: "Not Your - Average Compiler" (BooBoo!). An acronym that you can pronounce. - Unfortunately, the New York Athletic Club wouldn't like us stealing - their domain. :) Duncan SandsOptLibPortmanteau of optimizing and library. llvroomAs in the vrooming of a motorcycle engine. @@ -440,8 +439,6 @@ darkness bind them)" You have to admit, it has a nice ring. Michael McCrackenN??gadragon-like serpents from Cambodian mythology, among other places. - Patrick MeredithAdamantAnother fictional Tolkien - metal. Aaron GrayMotherNo explanation offered :) Scott McMurrayDaedalusGreek mythology: the greatly skilled Athenian architect that built the palace of @@ -463,6 +460,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 22:22:19 $ +
      Last modified: $Date: 2007/04/12 22:24:52 $ From reid at x10sys.com Thu Apr 12 17:32:51 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 17:32:51 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122232.l3CMWp98021798@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.95 -> 1.96 --- Log message: Fix description of Adamant. --- Diffs of the changes: (+5 -2) DevMtgMay2007.html | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.95 llvm-www/DevMtgMay2007.html:1.96 --- llvm-www/DevMtgMay2007.html:1.95 Thu Apr 12 17:24:52 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:32:33 2007 @@ -404,7 +404,10 @@ ThraThe world of The Dark Crystal. Patrick MeredithInvictusunconquerable, and Invictus.org doesn't appear to exist. - AdamantA fictional Tolkien metal. + Adamant + Often refers to diamonds, but historically can mean + any hard, "unbreakable" stone, metal or other substance. + Gabor GreifOtimoIt is a Portuguese word, meaning optimal, perfect. It is also different enough from plain English words to give a distinguished feel :-) and catch the eyes. The domains @@ -460,6 +463,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/12 22:24:52 $ +
      Last modified: $Date: 2007/04/12 22:32:33 $ From rspencer at reidspencer.com Thu Apr 12 17:34:35 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 12 Apr 2007 15:34:35 -0700 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html In-Reply-To: <461EB073.8090604@jolt-lang.org> References: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> <461EB073.8090604@jolt-lang.org> Message-ID: <1176417275.23191.123.camel@bashful.x10sys.com> On Thu, 2007-04-12 at 15:19 -0700, Jeff Cohen wrote: > Adamant isn't a Tolkien creation. It often refers to diamonds, but > historically can mean any hard, "unbreakable" stone, metal or other > substance. It's in the dictionary :) I'm having enough trouble this end just keeping up with the submissions, never mind tracking down the etymology of all submissions. If people could take the time to provide links and get the right description, it would go a long way to helping. Thanks, Reid. > > Reid Spencer wrote: > > Changes in directory llvm-www: > > > > DevMtgMay2007.html updated: 1.91 -> 1.92 > > --- > > Log message: > > > > More names. > > > > > > --- > > Diffs of the changes: (+11 -3) > > > > DevMtgMay2007.html | 14 +++++++++++--- > > 1 files changed, 11 insertions(+), 3 deletions(-) > > > > > > Index: llvm-www/DevMtgMay2007.html > > diff -u llvm-www/DevMtgMay2007.html:1.91 llvm-www/DevMtgMay2007.html:1.92 > > --- llvm-www/DevMtgMay2007.html:1.91 Thu Apr 12 15:49:49 2007 > > +++ llvm-www/DevMtgMay2007.html Thu Apr 12 17:11:07 2007 > > @@ -425,15 +425,23 @@ > > their domain. :) > > Duncan SandsOptLibPortmanteau of optimizing and library. > > Duncan SandsllvroomAs in the vrooming of a motorcycle engine. > > + Duncan SandsOptLOCPortmanteau of Optimization and > > + Lines Of Code > > Duncan SandsLoveByteAlong the Warloc - Loveloc > > - lines as baldric4 suggested in IRC. LOC = Lines of Code > > - > > + lines as baldric4 suggested in IRC. LOC = Lines of Code > > Paolo InvernizziMithrilThe fictional metal from > > JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. > > It could be beaten like copper, and polished like glass; and the Dwarves could > > make of it a metal, light and yet harder than tempered steel. Its beauty was like > > to that of common silver, but the beauty of mithril did not tarnish or > > grow dim." > > + Curt CoxOCTRUTHALOne Compiler To RUle THem ALl (and in the > > + darkness bind them)" You have to admit, it has a nice ring. > > + Michael McCrackenN??gadragon-like serpents from > > + Cambodian mythology, among other places. > > + Patrick MeredithAdamantAnother fictional Tolkien > > + metal. > > + Aaron GrayMotherNo explanation offered :) > > > >

      NOTE: Logos will need to be developed as well. If you have that > > talent, please send a JPEG/GIF to go with your name idea.

      > > @@ -446,6 +454,6 @@ > > src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> > > > src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> > > -
      Last modified: $Date: 2007/04/12 20:49:49 $ > > +
      Last modified: $Date: 2007/04/12 22:11:07 $ > > > > > > > > > > > > > > > > ____________________________________________________________________ > > > > _______________________________________________ > > 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 clattner at apple.com Thu Apr 12 17:36:43 2007 From: clattner at apple.com (Chris Lattner) Date: Thu, 12 Apr 2007 15:36:43 -0700 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html In-Reply-To: <1176417275.23191.123.camel@bashful.x10sys.com> References: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> <461EB073.8090604@jolt-lang.org> <1176417275.23191.123.camel@bashful.x10sys.com> Message-ID: <5698B694-C744-418A-8EF9-50D94A384CD9@apple.com> On Apr 12, 2007, at 3:34 PM, Reid Spencer wrote: > On Thu, 2007-04-12 at 15:19 -0700, Jeff Cohen wrote: >> Adamant isn't a Tolkien creation. It often refers to diamonds, but >> historically can mean any hard, "unbreakable" stone, metal or other >> substance. It's in the dictionary :) > > I'm having enough trouble this end just keeping up with the > submissions, > never mind tracking down the etymology of all submissions. If people > could take the time to provide links and get the right description, it > would go a long way to helping. We need a wiki :) -Chris From rspencer at reidspencer.com Thu Apr 12 17:47:29 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 12 Apr 2007 15:47:29 -0700 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html In-Reply-To: <5698B694-C744-418A-8EF9-50D94A384CD9@apple.com> References: <200704122211.l3CMBOjl019439@zion.cs.uiuc.edu> <461EB073.8090604@jolt-lang.org> <1176417275.23191.123.camel@bashful.x10sys.com> <5698B694-C744-418A-8EF9-50D94A384CD9@apple.com> Message-ID: <1176418049.23191.125.camel@bashful.x10sys.com> On Thu, 2007-04-12 at 15:36 -0700, Chris Lattner wrote: > On Apr 12, 2007, at 3:34 PM, Reid Spencer wrote: > > > On Thu, 2007-04-12 at 15:19 -0700, Jeff Cohen wrote: > >> Adamant isn't a Tolkien creation. It often refers to diamonds, but > >> historically can mean any hard, "unbreakable" stone, metal or other > >> substance. It's in the dictionary :) > > > > I'm having enough trouble this end just keeping up with the > > submissions, > > never mind tracking down the etymology of all submissions. If people > > could take the time to provide links and get the right description, it > > would go a long way to helping. > > We need a wiki :) YES! We DO! I wonder who's idea that was? Vikram? Done yet? ;> Reid. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Thu Apr 12 18:37:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 18:37:31 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704122337.l3CNbVsT027650@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.96 -> 1.97 --- Log message: Some minor adjustments. --- Diffs of the changes: (+15 -12) DevMtgMay2007.html | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.96 llvm-www/DevMtgMay2007.html:1.97 --- llvm-www/DevMtgMay2007.html:1.96 Thu Apr 12 17:32:33 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 18:37:14 2007 @@ -36,8 +36,10 @@ - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
    - - +
    + + Yes, this is the actual room
    + @@ -48,23 +50,24 @@ incorporated on this page.

    HOW TO REGISTER: You can attend for free just by sending an email to LLVM Developers Mail List - indicating that you'd like to attend. Your name will be added below.

    + indicating that you'd like to attend. Your name will be added + below.

    NAME THAT COMPILER!: As mentioned in Chris Lattner's email, - we are looking for an umbrella name for the collection of compiler and virtual - machine related things that we call LLVM today. Here's your chance to win a - prize! See Chris' + we are looking for an umbrella name for the collection of compiler, tool chain + and virtual machine related things that we call LLVM today. Here's your chance + to win a prize! See Chris' email for details. We'll keep track of the proposed names here.

    -

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you - pre-order your size. Send your size (S,M,L,XL) to +

    T-SHIRTS!: T-Shirts will be available + at the meeting but only if you pre-order your size. Send your size (S,M,L,XL) to Reid Spencer so they can be ordered in time for the meeting. The T-shirts will be good quality (heavy cotton) and have a small LLVM related phrase on the front. There is no cost for these T-Shirts as their cost is being donated to LLVM. But we will ask - you to make a donation to LLVM. If you want - a T-Shirt but can't make it to the meeting, please let Reid know. You will - have to pay for shipping only.

    + you to make a donation to LLVM at the + meeting. If you want a T-Shirt but can't make it to the meeting, please + let Reid know. You will have to pay for shipping only.

    CALL FOR PRESENTATIONS: This meeting is for you and by you. If you have an LLVM related topic idea (even if you don't plan to present it), please send it in. We need work group topics as well as people who would @@ -463,6 +466,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 22:32:33 $ +
    Last modified: $Date: 2007/04/12 23:37:14 $ From reid at x10sys.com Thu Apr 12 20:42:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 20:42:13 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704130142.l3D1gDwB000565@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.97 -> 1.98 --- Log message: Fix a link. --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.97 llvm-www/DevMtgMay2007.html:1.98 --- llvm-www/DevMtgMay2007.html:1.97 Thu Apr 12 18:37:14 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 20:41:56 2007 @@ -51,7 +51,7 @@

    HOW TO REGISTER: You can attend for free just by sending an email to LLVM Developers Mail List indicating that you'd like to attend. Your name will be added - below.

    + below.

    NAME THAT COMPILER!: As mentioned in Chris Lattner's email, we are looking for an umbrella name for the collection of compiler, tool chain @@ -466,6 +466,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/12 23:37:14 $ +
    Last modified: $Date: 2007/04/13 01:41:56 $ From reid at x10sys.com Thu Apr 12 21:18:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:18:28 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130218.l3D2ISBn001165@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html added (r1.1) --- Log message: The project renaming deserves a page of its own. --- Diffs of the changes: (+218 -0) Name.html | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 218 insertions(+) Index: llvm-www/Name.html diff -c /dev/null llvm-www/Name.html:1.1 *** /dev/null Thu Apr 12 21:18:21 2007 --- llvm-www/Name.html Thu Apr 12 21:18:11 2007 *************** *** 0 **** --- 1,218 ---- + +

    Name That Compiler!
    +
    Background
    +
    +

    As mentioned in Chris Lattner's + email, + we are looking for an umbrella name for the collection of compiler, tool chain + and virtual machine related things that we call LLVM today. As Chris put it:

    + +
    "LLVM is a growing project, and many of us are very fond of it. :) LLVM + is continuing to grow, both in maturity in specific areas and in the scope of + areas to which it applies.
    + +
    When we first started the project, we focused on the design of the + intermediate representation (IR). It is a strong design goal that the IR be a + self-contained virtual instruction set, which fully describes a program. + Because of this, we named the compiler LLVM, which reflects well on the + design of the IR.
    + +
    However, the scope of the LLVM project has outgrown this name. Today + LLVM does many "non-VMy" tasks, such as serving as a great static + compiler. It also has components that overlap with traditional low-level + tool chain components like assemblers and linkers. Further, LLVM's scope + is about to grow significantly with new front-end technologies (e.g. HLVM, + new SoC work on a python front-end, etc). For all of these reasons, I + think that "LLVM" is an increasingly poor name for the project as a whole, + and it causes a large amount of confusion, particularly with people who + do not know much about it yet.
    + +
    For what it is worth, this is not a new thought. I have been kicking + around the idea of renaming the project for several years now, but have + been stymied by not being able to come up with a better name! The problem + is hard: how do you concisely describe a modern, modular, component based + compiler and tool-chain system, which can be used for many different + things, hopefully many of which we haven't even thought of yet? How do + you pick a name that both memberable, relatively unique (searchable), has + an open domain name, etc? How do you come up with a name that is amenable + to making a logo? So far, I haven't! :)
    + +
    Note that the name need not capture every aspect of the project. Just + having a distinguished name with no specific connotation is probably good + enough. 20 years ago, "google" and "yahoo" had very different meanings, + and "mozilla" or "firefox" were pretty meaningless. Today, there is very + strong awareness of what they are.
    + +
    As such, I'd like to open up a forum for naming ideas.
    + +
    To make this more fun, "success" is extremely subjective, and I have no + idea how we will declare a victor (we can figure it out as we go, right? + :). I propose that people add ideas to this pageand we kick some potential + names around at the developer mtg in May. That gives us 5 or 6 weeks to + come up with a name and/or logo."
    + +

    With that in mind, this page is all about finding a new name for the + project.

    +
    + + + + + +
    +

    We have a few objectives, ideas and rules we've already decided upon for the + name:

    +
      +
    • LLVM Is Name Of IR. We need to continue to use the name + 'LLVM' to refer to the IR (i.e. that which is described in + the Language Reference).
    • + +
    • /LLVM suffix. We need to keep "/LLVM" as a suffix to the name + some time number of years to come so that we do not lose the brand + recognition we've developed with LLVM. For example: "Use the Foo/LLVM + Compiler System, it runs infinite loops faster than the competition!".
    • +
    • Avoid VM. We would like to avoid "VM" in the name. Because of the + /LLVM suffix it would be redundant for some period of time. Also, while the + project will retain components that allow you to make a VM, it isn't really + "just" a VM, its much more. In other words, labeling the project VM is + too limiting. The projects scope has outstripped being just a VM.
    • +
    • Figurative. We would like to stay away from acronyms unless a + really good one comes along. We don't want to replace LLVM with another + acronym that out-dates itself in a few years. Instead a name that is + metaphorical or figurative or otherwise conjures up the notion of LLVM would + be best.
    • +
    • Made Up Names. You can also just make up a name. Some of the best + brands have been + portmanteau words + (combining two or more words or phonemes to produce a new word). For + example, a combination spoon/fork leads to spork. Infomercial is another + example. So can you find the perfect portmanteau words that describe this + project? You can find a big list of examples + here
    • +
    • Connotations. The name should have a connotation that is + descriptive of the project as a whole. Some connotations that would be + appropriate are: components, fast, toolkit, optimizing, languages, building + blocks, etc. Many other characteristics could apply, these are just a + few.
    • +
    • Logos. Logos will need to be developed as well. Keep that in mind + as you think of names. Can a logo be developed? If you have graphical + talents, please send a JPEG/GIF to go with your name idea.
    • +
    +
    + + +
    +

    To help with the naming, we'll keep track of all name ideas here. This goes + along with the brain-storming rule: there are no bad ideas. So, send + your entries to llvmdev and we'll add + them here (or add them yourself).

    +

    At the May 25, 2007 Developer's Meeting + the list of names generated here will be used to discuss and possibly decide + the new name for the project.

    +

    In your submissions, please include the name, description, and one + link for the name.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Proposed New Names For LLVM
    WhoNameDescription
    Jeff Cohen + IlluviumMaterial displaced across a soil profile, from one layer to another + one, by the action of rainwater. Retains the LLVM letters. We already + own the domain. Also connotes "illumination".
    Reid Spencer + AlluviumThe layers of sediment deposited by a river. Also retains the LLVM + letters but is a word and connotes "bed rock" and fluidity
    OptopiaA portmanteau from + optimization and utopia
    NYACAlong Owen's idea: "Not Your + Average Compiler" (BooBoo!). An acronym that you can pronounce. + Unfortunately, the New York Athletic Club wouldn't like us stealing + their domain. :)
    Bill WendlingZemblaIt's a fictional northern European + country in "Pale Fire" by Nabokov.
    PalaThe island utopia in Aldos Huxley's "Island".
    ThraThe world of The Dark Crystal.
    Patrick MeredithInvictusunconquerable, and + Invictus.org doesn't appear to exist.
    AdamantOften refers to diamonds, but historically can mean + any hard, "unbreakable" stone, metal or other substance.
    Gabor GreifOtimoIt is a Portuguese word, + meaning optimal, perfect. It is also different enough from plain English words + to give a distinguished feel :-) and catch the eyes. The domains + otimo.org and otimo.info are both available. Last, but not least + it is a boon to the several LLVM developers of Portuguese + tongue.
    Owen AndersonWarloc
    Warlock
    It can be thought + of as standing for "We aren't like other compilers," but that doesn't + have to be pointed out, as it's also a word on its own. It has a + sense of being something powerful and/or magical, and should be + feasible to make a logo to go along with.
    Erick TryzelaarLCSFor language compiling system. + It's suggestive of an old name, easy to remember, easy to say, and seems + to be easy to Google. "Advanced" could be pre-pended to it to make it + ALCS to make it even more unique.
    Zhongxing XuOmniC
    Omnipiler
    Omnicom
    Stands for + "Omnipotent Compiler". I prefer the first.
    Duncan SandsOptLibPortmanteau of optimizing + and library.
    llvroomAs in the vrooming of a motorcycle engine. +
    OptLOCPortmanteau of Optimization and + Lines Of Code
    LoveByteAlong the Warloc - Loveloc + lines as baldric4 suggested in IRC. LOC = Lines of Code
    Paolo InvernizziMithrilThe fictional metal from + JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. + It could be beaten like copper, and polished like glass; and the Dwarves could + make of it a metal, light and yet harder than tempered steel. Its beauty was like + to that of common silver, but the beauty of mithril did not tarnish or + grow dim."
    Curt CoxOCTRUTHALOne Compiler To RUle THem ALl (and in the + darkness bind them)" You have to admit, it has a nice ring.
    Michael McCracken + Naga + dragon-like serpents from Cambodian mythology, among other places. + I like this as a name, because it's unique short and easy to type and remember + (as long as you omit the accent, which is commonly done), it's basically a + southeast-asian dragon, so we're sticking with traditional compiler iconography, + and it's seven-headed, so it nicely represents the many different uses LLVM can + be put to.
    It's also pretty easy to imagine a logo, because Cambodian N??ga + sculptures are pretty memorable as is: + NagaPhnomPenh. + They're all over Angkor, too. I picture a simplified line-drawing of a seven-headed + serpent like the one in the image.
    For what it's worth, there are also + a couple other good-sounding Asian dragon names on the wikipedia page for + N??ga: "L??ng" (Chinese), "Ry??" (Japanese), and my second-favorite after + N??ga, "kyo" ("Korean mountain dragon"), which has nice consonance with "compiler". +
    Aaron GrayMotherNo explanation offered :)
    Scott McMurrayDaedalusGreek mythology: the + greatly skilled Athenian architect that built the palace of + Cnossus.
    Heph??stusGreek mythology: God of smiths, builder of Helios's + chariot, maker of Talos, Crete and Europa's guardian robot, and fabricator of + the weapons of the Gods
    LemnosGreek mythology: the island of Hephaestus + workshop
    +
    + + +
    +
    + Valid CSS! + Valid HTML 4.01! +
    Last modified: $Date: 2007/04/13 02:18:11 $ +
    + From reid at x10sys.com Thu Apr 12 21:21:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:21:38 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130221.l3D2LcxN001294@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.1 -> 1.2 --- Log message: Add TOC. --- Diffs of the changes: (+10 -2) Name.html | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.1 llvm-www/Name.html:1.2 --- llvm-www/Name.html:1.1 Thu Apr 12 21:18:11 2007 +++ llvm-www/Name.html Thu Apr 12 21:21:20 2007 @@ -1,6 +1,14 @@
    Name That Compiler!
    -
    Background
    + +

    As mentioned in Chris Lattner's email, @@ -213,6 +221,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:18:11 $ +
    Last modified: $Date: 2007/04/13 02:21:20 $ From reid at x10sys.com Thu Apr 12 21:24:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:24:09 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130224.l3D2O9Ac001422@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.2 -> 1.3 --- Log message: Fix validation errors. --- Diffs of the changes: (+51 -44) Name.html | 95 +++++++++++++++++++++++++++++++++----------------------------- 1 files changed, 51 insertions(+), 44 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.2 llvm-www/Name.html:1.3 --- llvm-www/Name.html:1.2 Thu Apr 12 21:21:20 2007 +++ llvm-www/Name.html Thu Apr 12 21:23:52 2007 @@ -15,49 +15,51 @@ we are looking for an umbrella name for the collection of compiler, tool chain and virtual machine related things that we call LLVM today. As Chris put it:

    -
    "LLVM is a growing project, and many of us are very fond of it. :) LLVM - is continuing to grow, both in maturity in specific areas and in the scope of - areas to which it applies.
    - -
    When we first started the project, we focused on the design of the - intermediate representation (IR). It is a strong design goal that the IR be a - self-contained virtual instruction set, which fully describes a program. - Because of this, we named the compiler LLVM, which reflects well on the - design of the IR.
    - -
    However, the scope of the LLVM project has outgrown this name. Today - LLVM does many "non-VMy" tasks, such as serving as a great static - compiler. It also has components that overlap with traditional low-level - tool chain components like assemblers and linkers. Further, LLVM's scope - is about to grow significantly with new front-end technologies (e.g. HLVM, - new SoC work on a python front-end, etc). For all of these reasons, I - think that "LLVM" is an increasingly poor name for the project as a whole, - and it causes a large amount of confusion, particularly with people who - do not know much about it yet.
    - -
    For what it is worth, this is not a new thought. I have been kicking - around the idea of renaming the project for several years now, but have - been stymied by not being able to come up with a better name! The problem - is hard: how do you concisely describe a modern, modular, component based - compiler and tool-chain system, which can be used for many different - things, hopefully many of which we haven't even thought of yet? How do - you pick a name that both memberable, relatively unique (searchable), has - an open domain name, etc? How do you come up with a name that is amenable - to making a logo? So far, I haven't! :)
    - -
    Note that the name need not capture every aspect of the project. Just - having a distinguished name with no specific connotation is probably good - enough. 20 years ago, "google" and "yahoo" had very different meanings, - and "mozilla" or "firefox" were pretty meaningless. Today, there is very - strong awareness of what they are.
    - -
    As such, I'd like to open up a forum for naming ideas.
    - -
    To make this more fun, "success" is extremely subjective, and I have no - idea how we will declare a victor (we can figure it out as we go, right? - :). I propose that people add ideas to this pageand we kick some potential - names around at the developer mtg in May. That gives us 5 or 6 weeks to - come up with a name and/or logo."
    +
    +

    "LLVM is a growing project, and many of us are very fond of it. :) LLVM + is continuing to grow, both in maturity in specific areas and in the scope of + areas to which it applies.

    + +

    When we first started the project, we focused on the design of the + intermediate representation (IR). It is a strong design goal that the IR be a + self-contained virtual instruction set, which fully describes a program. + Because of this, we named the compiler LLVM, which reflects well on the + design of the IR.

    + +

    However, the scope of the LLVM project has outgrown this name. Today + LLVM does many "non-VMy" tasks, such as serving as a great static + compiler. It also has components that overlap with traditional low-level + tool chain components like assemblers and linkers. Further, LLVM's scope + is about to grow significantly with new front-end technologies (e.g. HLVM, + new SoC work on a python front-end, etc). For all of these reasons, I + think that "LLVM" is an increasingly poor name for the project as a whole, + and it causes a large amount of confusion, particularly with people who + do not know much about it yet.

    + +

    For what it is worth, this is not a new thought. I have been kicking + around the idea of renaming the project for several years now, but have + been stymied by not being able to come up with a better name! The problem + is hard: how do you concisely describe a modern, modular, component based + compiler and tool-chain system, which can be used for many different + things, hopefully many of which we haven't even thought of yet? How do + you pick a name that both memberable, relatively unique (searchable), has + an open domain name, etc? How do you come up with a name that is amenable + to making a logo? So far, I haven't! :)

    + +

    Note that the name need not capture every aspect of the project. Just + having a distinguished name with no specific connotation is probably good + enough. 20 years ago, "google" and "yahoo" had very different meanings, + and "mozilla" or "firefox" were pretty meaningless. Today, there is very + strong awareness of what they are.

    + +

    As such, I'd like to open up a forum for naming ideas.

    + +

    To make this more fun, "success" is extremely subjective, and I have no + idea how we will declare a victor (we can figure it out as we go, right? + :). I propose that people add ideas to this pageand we kick some potential + names around at the developer mtg in May. That gives us 5 or 6 weeks to + come up with a name and/or logo."

    +

    With that in mind, this page is all about finding a new name for the project.

    @@ -86,16 +88,19 @@ some time number of years to come so that we do not lose the brand recognition we've developed with LLVM. For example: "Use the Foo/LLVM Compiler System, it runs infinite loops faster than the competition!". +
  • Avoid VM. We would like to avoid "VM" in the name. Because of the /LLVM suffix it would be redundant for some period of time. Also, while the project will retain components that allow you to make a VM, it isn't really "just" a VM, its much more. In other words, labeling the project VM is too limiting. The projects scope has outstripped being just a VM.
  • +
  • Figurative. We would like to stay away from acronyms unless a really good one comes along. We don't want to replace LLVM with another acronym that out-dates itself in a few years. Instead a name that is metaphorical or figurative or otherwise conjures up the notion of LLVM would be best.
  • +
  • Made Up Names. You can also just make up a name. Some of the best brands have been portmanteau words @@ -104,11 +109,13 @@ example. So can you find the perfect portmanteau words that describe this project? You can find a big list of examples here
  • +
  • Connotations. The name should have a connotation that is descriptive of the project as a whole. Some connotations that would be appropriate are: components, fast, toolkit, optimizing, languages, building blocks, etc. Many other characteristics could apply, these are just a few.
  • +
  • Logos. Logos will need to be developed as well. Keep that in mind as you think of names. Can a logo be developed? If you have graphical talents, please send a JPEG/GIF to go with your name idea.
  • @@ -221,6 +228,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:21:20 $ +
    Last modified: $Date: 2007/04/13 02:23:52 $ From reid at x10sys.com Thu Apr 12 21:26:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:26:24 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130226.l3D2QOq3001529@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.3 -> 1.4 --- Log message: More validation errors. --- Diffs of the changes: (+4 -4) Name.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.3 llvm-www/Name.html:1.4 --- llvm-www/Name.html:1.3 Thu Apr 12 21:23:52 2007 +++ llvm-www/Name.html Thu Apr 12 21:26:07 2007 @@ -65,7 +65,7 @@ project.

    - +

    If we find a good name, we can honor the one who came up with it with a small amount of booty. For example, we're prepared to award a compiler @@ -75,7 +75,7 @@ or some other place.

    - +

    We have a few objectives, ideas and rules we've already decided upon for the name:

    @@ -159,7 +159,7 @@ Invictus.org doesn't appear to exist. Adamant Often refers to diamonds, but historically can mean - any hard, "unbreakable" stone, metal or other substance. + any hard, "unbreakable" stone, metal or other substance. Gabor GreifOtimoIt is a Portuguese word, meaning optimal, perfect. It is also different enough from plain English words @@ -228,6 +228,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:23:52 $ +
    Last modified: $Date: 2007/04/13 02:26:07 $ From reid at x10sys.com Thu Apr 12 21:27:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:27:16 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130227.l3D2RGf7001680@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.4 -> 1.5 --- Log message: Final validation errors :) --- Diffs of the changes: (+2 -2) Name.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.4 llvm-www/Name.html:1.5 --- llvm-www/Name.html:1.4 Thu Apr 12 21:26:07 2007 +++ llvm-www/Name.html Thu Apr 12 21:26:59 2007 @@ -122,7 +122,7 @@
    - +

    To help with the naming, we'll keep track of all name ideas here. This goes along with the brain-storming rule: there are no bad ideas. So, send @@ -228,6 +228,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:26:07 $ +
    Last modified: $Date: 2007/04/13 02:26:59 $ From reid at x10sys.com Thu Apr 12 21:30:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:30:28 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704130230.l3D2USSO001840@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.98 -> 1.99 --- Log message: Move name stuff to its own page. --- Diffs of the changes: (+4 -118) DevMtgMay2007.html | 122 +---------------------------------------------------- 1 files changed, 4 insertions(+), 118 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.98 llvm-www/DevMtgMay2007.html:1.99 --- llvm-www/DevMtgMay2007.html:1.98 Thu Apr 12 20:41:56 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 21:30:11 2007 @@ -56,9 +56,9 @@ email, we are looking for an umbrella name for the collection of compiler, tool chain and virtual machine related things that we call LLVM today. Here's your chance - to win a prize! See Chris' - email - for details. We'll keep track of the proposed names here.

    + to win a prize! Please see the Name page for the + current list of entries, naming rules, booty you can get and other details. + The name may be decided at this meeting!

    T-SHIRTS!: T-Shirts will be available at the meeting but only if you pre-order your size. Send your size (S,M,L,XL) to Reid Spencer so they can be @@ -346,126 +346,12 @@

    - -
    -

    To help with the naming, we'll keep track of all ideas here. This goes - along with the brain-storming rule: there are no bad ideas. So, send - your entries to llvmdev and I'll add - them here (or add them yourself). We'll use this list to discuss the name - at the meeting.

    -

    We have a few objectives and rules we've already decided upon for the - name:

    -
      -
    • /LLVM suffix. We need to keep /LLVM at the end of the name for - some time (years) so that we do not lose the brand association we've - developed with LLVM.
    • -
    • Avoid VM. We would like to avoid "VM" in the name. Because of the - /LLVM suffix it would be redundant for some period of time. Also, while the - project will retain components that allow you to make a VM, it isn't really - "just" a VM, its much more. In other words, labeling the project VM is - too limiting. The projects scope has outstripped being just a VM.
    • -
    • Figurative. We would like to stay away from acronyms unless a - really good one comes along. We don't want to replace LLVM with another - acronym that out-dates itself in a few years. Instead a name that is - metaphorical or figurative or otherwise conjures up the notion of LLVM would - be best.
    • -
    • Made Up Names. You can also just make up a name. Some of the best - brands have been - portmanteau words - (combining two or more words or phonemes to produce a new word). For - example, a combination spoon/fork leads to spork. Infomercial is another - example. So can you find the perfect portmanteau words that describe this - project? You can find a big list of examples - here
    • -
    • Connotations. The name should have a connotation that is - descriptive of the project as a whole. Some connotations that would be - appropriate are: components, fast, toolkit, optimizing, languages, building - blocks, etc. Many other characteristics could apply, these are just a - few.
    • -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Proposed New Names For LLVM
    WhoNameDescription
    Jeff Cohen - IlluviumMaterial displaced across a soil profile, from one layer to another - one, by the action of rainwater. Retains the LLVM letters. We already - own the domain. Also connotes "illumination".
    Reid Spencer - AlluviumThe layers of sediment deposited by a river. Also retains the LLVM - letters but is a word and connotes "bed rock" and fluidity
    OptopiaA portmanteau from - optimization and utopia
    NYACAlong Owen's idea: "Not Your - Average Compiler" (BooBoo!). An acronym that you can pronounce. - Unfortunately, the New York Athletic Club wouldn't like us stealing - their domain. :)
    Bill WendlingZemblaIt's a fictional northern European - country in "Pale Fire" by Nabokov.
    PalaThe island utopia in Aldos Huxley's "Island".
    ThraThe world of The Dark Crystal.
    Patrick MeredithInvictusunconquerable, and - Invictus.org doesn't appear to exist.
    AdamantOften refers to diamonds, but historically can mean - any hard, "unbreakable" stone, metal or other substance.
    Gabor GreifOtimoIt is a Portuguese word, - meaning optimal, perfect. It is also different enough from plain English words - to give a distinguished feel :-) and catch the eyes. The domains - otimo.org and otimo.info are both available. Last, but not least - it is a boon to the several LLVM developers of Portuguese - tongue.
    Owen AndersonWarloc
    Warlock
    It can be thought - of as standing for "We aren't like other compilers," but that doesn't - have to be pointed out, as it's also a word on its own. It has a - sense of being something powerful and/or magical, and should be - feasible to make a logo to go along with.
    Erick TryzelaarLCSFor language compiling system. - It's suggestive of an old name, easy to remember, easy to say, and seems - to be easy to Google. "Advanced" could be pre-pended to it to make it - ALCS to make it even more unique.
    Zhongxing XuOmniC
    Omnipiler
    Omnicom
    Stands for - "Omnipotent Compiler". I prefer the first.
    Duncan SandsOptLibPortmanteau of optimizing - and library.
    llvroomAs in the vrooming of a motorcycle engine. -
    OptLOCPortmanteau of Optimization and - Lines Of Code
    LoveByteAlong the Warloc - Loveloc - lines as baldric4 suggested in IRC. LOC = Lines of Code
    Paolo InvernizziMithrilThe fictional metal from - JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. - It could be beaten like copper, and polished like glass; and the Dwarves could - make of it a metal, light and yet harder than tempered steel. Its beauty was like - to that of common silver, but the beauty of mithril did not tarnish or - grow dim."
    Curt CoxOCTRUTHALOne Compiler To RUle THem ALl (and in the - darkness bind them)" You have to admit, it has a nice ring.
    Michael McCrackenN??gadragon-like serpents from - Cambodian mythology, among other places.
    Aaron GrayMotherNo explanation offered :)
    Scott McMurrayDaedalusGreek mythology: the - greatly skilled Athenian architect that built the palace of - Cnossus.
    Heph??stusGreek mythology: God of smiths, builder of Helios's - chariot, maker of Talos, Crete and Europa's guardian robot, and fabricator of - the weapons of the Gods
    LemnosGreek mythology: the island of Hephaestus - workshop
    -

    NOTE: Logos will need to be developed as well. If you have that - talent, please send a JPEG/GIF to go with your name idea.

    -
    - -
    Valid CSS! Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 01:41:56 $ +
    Last modified: $Date: 2007/04/13 02:30:11 $
    From reid at x10sys.com Thu Apr 12 21:51:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 21:51:12 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130251.l3D2pCRo002236@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.5 -> 1.6 --- Log message: Add Gabe's "Wyrm" entry. --- Diffs of the changes: (+15 -1) Name.html | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.5 llvm-www/Name.html:1.6 --- llvm-www/Name.html:1.5 Thu Apr 12 21:26:59 2007 +++ llvm-www/Name.html Thu Apr 12 21:50:54 2007 @@ -218,6 +218,20 @@ the weapons of the Gods LemnosGreek mythology: the island of Hephaestus workshop + Gabe McArthurWyrmAlong the same 'dragon' line, + here's a little old english for you. Also it seems www.wyrm.org is for + sale. +
    +        "                     Dracan ec scufun,
    +        wyrm ofer weallclif,   leton weg niman,
    +        flod f????mian   fr??twa hyrde."
    +
    +        "                    The dragon they cast,
    +        the worm, o'er the wall for the wave to take,
    +        and surges swallowed that shepherd of gems."
    +
    +        Beowulf
    +        
    @@ -228,6 +242,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:26:59 $ +
    Last modified: $Date: 2007/04/13 02:50:54 $ From isanbard at gmail.com Thu Apr 12 22:38:17 2007 From: isanbard at gmail.com (Bill Wendling) Date: Thu, 12 Apr 2007 20:38:17 -0700 Subject: [llvm-commits] CVS: llvm-www/Funding.html In-Reply-To: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> References: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> Message-ID: <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: > +

    Tax Exempt. Your donations are tax exempt in the > United States (and > + probably other countries). UIUC is a recognized non-profit > organization. > + Reciepts are available upon request.

    > +

    "Exempt" or "Deductible"? -bw From jeffc at jolt-lang.org Thu Apr 12 22:45:35 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 12 Apr 2007 20:45:35 -0700 Subject: [llvm-commits] CVS: llvm-www/Funding.html In-Reply-To: <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> References: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> Message-ID: <461EFCDF.1020909@jolt-lang.org> Should be "deductible" (in the U.S. anyway). And if you donate $500 or more, you need to have the donation documented or else the IRS will be unhappy. Bill Wendling wrote: > On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: > > >> +

    Tax Exempt. Your donations are tax exempt in the >> United States (and >> + probably other countries). UIUC is a recognized non-profit >> organization. >> + Reciepts are available upon request.

    >> +

    >> > > "Exempt" or "Deductible"? > > -bw > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > From reid at x10sys.com Thu Apr 12 22:45:53 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 22:45:53 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704130345.l3D3jr98003260@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.99 -> 1.100 --- Log message: Fix a bad link and a typo. --- Diffs of the changes: (+2 -3) DevMtgMay2007.html | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.99 llvm-www/DevMtgMay2007.html:1.100 --- llvm-www/DevMtgMay2007.html:1.99 Thu Apr 12 21:30:11 2007 +++ llvm-www/DevMtgMay2007.html Thu Apr 12 22:45:36 2007 @@ -23,7 +23,6 @@

  • Attendees
  • -
  • Name That Compiler!
    • @@ -265,7 +264,7 @@
      Check Out: Saturday May 26th-28th
      If you are flying in Friday morning and want to stay the weekend then don't mention Apple! Their discount rate of $123.00 applies to any day. - However the regular weekend rate is $99.00 so its cheaper to just not + However the regular weekend rate is $99.00 so it's cheaper to just not mention Apple if you don't have to stay over on a week night.
    @@ -352,6 +351,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:30:11 $ +
    Last modified: $Date: 2007/04/13 03:45:36 $ From rspencer at reidspencer.com Thu Apr 12 22:52:56 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Thu, 12 Apr 2007 20:52:56 -0700 Subject: [llvm-commits] CVS: llvm-www/Funding.html In-Reply-To: <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> References: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> Message-ID: <1176436376.23191.164.camel@bashful.x10sys.com> On Thu, 2007-04-12 at 20:38 -0700, Bill Wendling wrote: > On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: > > > +

    Tax Exempt. Your donations are tax exempt in the > > United States (and > > + probably other countries). UIUC is a recognized non-profit > > organization. > > + Reciepts are available upon request.

    > > +

    > > "Exempt" or "Deductible"? I dunno. You can legally claim it as a charitable donation. Whether that makes it an exemption or a deduction or even what those two words mean in the gobbledy gook of Title 26, I have no idea. I'm not a tax lawyer. Reid. > > -bw > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Thu Apr 12 22:54:30 2007 From: reid at x10sys.com (Reid Spencer) Date: Thu, 12 Apr 2007 22:54:30 -0500 Subject: [llvm-commits] CVS: llvm-www/Funding.html Message-ID: <200704130354.l3D3sUlP003463@zion.cs.uiuc.edu> Changes in directory llvm-www: Funding.html updated: 1.2 -> 1.3 --- Log message: exempt -> deductible. --- Diffs of the changes: (+3 -3) Funding.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/Funding.html diff -u llvm-www/Funding.html:1.2 llvm-www/Funding.html:1.3 --- llvm-www/Funding.html:1.2 Thu Apr 12 07:29:54 2007 +++ llvm-www/Funding.html Thu Apr 12 22:54:13 2007 @@ -25,8 +25,8 @@ means that virtually 100% of your donated funds will be used to advance the project. We are using the facilities of UIUC for managing the funds, doing the accounting, etc.

    -

    Tax Exempt. Your donations are tax exempt in the United States (and - probably other countries). UIUC is a recognized non-profit organization. +

    Tax Exempt. Your donations are tax deductible in the United States + (and probably other countries). UIUC is a recognized non-profit organization. Receipts are available upon request.

    @@ -57,7 +57,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/04/12 12:29:54 $ + Last modified: $Date: 2007/04/13 03:54:13 $ From jeffc at jolt-lang.org Thu Apr 12 22:58:54 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Thu, 12 Apr 2007 20:58:54 -0700 Subject: [llvm-commits] CVS: llvm-www/Funding.html In-Reply-To: <1176436376.23191.164.camel@bashful.x10sys.com> References: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> <1176436376.23191.164.camel@bashful.x10sys.com> Message-ID: <461EFFFE.8050305@jolt-lang.org> Reid Spencer wrote: > On Thu, 2007-04-12 at 20:38 -0700, Bill Wendling wrote: > >> On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: >> >> >>> +

    Tax Exempt. Your donations are tax exempt in the >>> United States (and >>> + probably other countries). UIUC is a recognized non-profit >>> organization. >>> + Reciepts are available upon request.

    >>> +

    >>> >> "Exempt" or "Deductible"? >> > > I dunno. You can legally claim it as a charitable donation. Whether that > makes it an exemption or a deduction or even what those two words mean > in the gobbledy gook of Title 26, I have no idea. I'm not a tax > lawyer. > > Reid. You can deduct it assuming (1) you itemize your deductions on Schedule A, and (2) your deductions are not limited because you make too much money. I think it is still deductible under the alternative minimum tax. April 16 is right around the corner :) From resistor at mac.com Thu Apr 12 23:31:37 2007 From: resistor at mac.com (Owen Anderson) Date: Thu, 12 Apr 2007 23:31:37 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130431.l3D4Vb3f004272@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.6 -> 1.7 --- Log message: Linkify my suggestion. --- Diffs of the changes: (+4 -2) Name.html | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.6 llvm-www/Name.html:1.7 --- llvm-www/Name.html:1.6 Thu Apr 12 21:50:54 2007 +++ llvm-www/Name.html Thu Apr 12 23:31:20 2007 @@ -167,7 +167,9 @@ otimo.org and otimo.info are both available. Last, but not least it is a boon to the several LLVM developers of Portuguese tongue. - Owen AndersonWarloc
    WarlockIt can be thought + Owen AndersonWarloc
    + Warlock + It can be thought of as standing for "We aren't like other compilers," but that doesn't have to be pointed out, as it's also a word on its own. It has a sense of being something powerful and/or magical, and should be @@ -242,6 +244,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 02:50:54 $ +
    Last modified: $Date: 2007/04/13 04:31:20 $ From tonic at nondot.org Thu Apr 12 23:37:05 2007 From: tonic at nondot.org (Tanya Lattner) Date: Thu, 12 Apr 2007 23:37:05 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200704130437.l3D4b5QZ004462@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.70 -> 1.71 --- Log message: Adding target triplet to be passed to database. --- Diffs of the changes: (+18 -1) NewNightlyTest.pl | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletion(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.70 llvm/utils/NewNightlyTest.pl:1.71 --- llvm/utils/NewNightlyTest.pl:1.70 Tue Apr 10 14:13:43 2007 +++ llvm/utils/NewNightlyTest.pl Thu Apr 12 23:36:48 2007 @@ -193,7 +193,12 @@ if ($ENV{'LLVMGCCDIR'}) { $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'}; + $LLVMGCCPATH = $ENV{'LLVMGCCDIR'}; } +else { + $LLVMGCCPATH = ""; +} + if ($CONFIGUREARGS !~ /--disable-jit/) { $CONFIGUREARGS .= " --enable-jit"; } @@ -1058,6 +1063,17 @@ @GCC_VERSION = split '\n', $gcc_version_long; $gcc_version = $GCC_VERSION[0]; +$llvmgcc_version_long=""; +if ($LLVMGCCPATH ne "") { + $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`; +} else { + $llvmgcc_version_long = `llvm-gcc -v 2>&1`; +} + at LLVMGCC_VERSION = split '\n', $llvmgcc_version_long; +$llvmgcc_versionTarget = $LLVMGCC_VERSION[1]; +$llvmgcc_versionTarget =~ /Target: (.+)/; +$targetTriple = $1; + if(!$BuildError){ @DEJAGNU_LOG = ReadFile "$DejagnuLog"; @DEJAGNU_SUM = ReadFile "$DejagnuSum"; @@ -1116,7 +1132,8 @@ 'starttime' => $starttime, 'endtime' => $endtime, 'o_file_sizes' => $o_file_sizes, - 'a_file_sizes' => $a_file_sizes + 'a_file_sizes' => $a_file_sizes, + 'target_triple' => $targetTriple ); $TESTING = 0; From sabre at nondot.org Fri Apr 13 00:04:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 00:04:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Message-ID: <200704130504.l3D54feb005123@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: ScalarEvolutionExpander.h updated: 1.13 -> 1.14 --- Log message: CSE simple binary expressions when they are inserted. This makes LSR produce less huge code that needs to be cleaned up by sdisel. --- Diffs of the changes: (+7 -4) ScalarEvolutionExpander.h | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.13 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.14 --- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.13 Sat Jan 20 18:29:25 2007 +++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Fri Apr 13 00:04:18 2007 @@ -89,7 +89,10 @@ /// we can to share the casts. static Value *InsertCastOfTo(Instruction::CastOps opcode, Value *V, const Type *Ty); - + /// InsertBinop - Insert the specified binary operator, doing a small amount + /// of work to avoid inserting an obviously redundant operation. + static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, + Value *RHS, Instruction *InsertPt); protected: Value *expand(SCEV *S) { // Check to see if we already expanded this. @@ -141,8 +144,8 @@ // Emit a bunch of add instructions for (int i = S->getNumOperands()-2; i >= 0; --i) - V = BinaryOperator::createAdd(V, expandInTy(S->getOperand(i), Ty), - "tmp.", InsertPt); + V = InsertBinop(Instruction::Add, V, expandInTy(S->getOperand(i), Ty), + InsertPt); return V; } @@ -152,7 +155,7 @@ const Type *Ty = S->getType(); Value *LHS = expandInTy(S->getLHS(), Ty); Value *RHS = expandInTy(S->getRHS(), Ty); - return BinaryOperator::createSDiv(LHS, RHS, "tmp.", InsertPt); + return InsertBinop(Instruction::SDiv, LHS, RHS, InsertPt); } Value *visitAddRecExpr(SCEVAddRecExpr *S); From sabre at nondot.org Fri Apr 13 00:04:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 00:04:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolutionExpander.cpp Message-ID: <200704130504.l3D54fF4005126@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: ScalarEvolutionExpander.cpp updated: 1.15 -> 1.16 --- Log message: CSE simple binary expressions when they are inserted. This makes LSR produce less huge code that needs to be cleaned up by sdisel. --- Diffs of the changes: (+25 -5) ScalarEvolutionExpander.cpp | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-) Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.15 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.16 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.15 Thu Mar 1 18:28:51 2007 +++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp Fri Apr 13 00:04:18 2007 @@ -68,6 +68,25 @@ return CastInst::create(opcode, V, Ty, V->getName(), IP); } +/// InsertBinop - Insert the specified binary operator, doing a small amount +/// of work to avoid inserting an obviously redundant operation. +Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, + Value *RHS, Instruction *InsertPt) { + // Do a quick scan to see if we have this binop nearby. If so, reuse it. + unsigned ScanLimit = 6; + for (BasicBlock::iterator IP = InsertPt, E = InsertPt->getParent()->begin(); + ScanLimit; --IP, --ScanLimit) { + if (BinaryOperator *BinOp = dyn_cast(IP)) + if (BinOp->getOpcode() == Opcode && BinOp->getOperand(0) == LHS && + BinOp->getOperand(1) == RHS) + return BinOp; + if (IP == E) break; + } + + // If we don't have + return BinaryOperator::create(Opcode, LHS, RHS, "tmp.", InsertPt); +} + Value *SCEVExpander::visitMulExpr(SCEVMulExpr *S) { const Type *Ty = S->getType(); int FirstOp = 0; // Set if we should emit a subtract. @@ -80,11 +99,12 @@ // Emit a bunch of multiply instructions for (; i >= FirstOp; --i) - V = BinaryOperator::createMul(V, expandInTy(S->getOperand(i), Ty), - "tmp.", InsertPt); + V = InsertBinop(Instruction::Mul, V, expandInTy(S->getOperand(i), Ty), + InsertPt); // -1 * ... ---> 0 - ... if (FirstOp == 1) - V = BinaryOperator::createNeg(V, "tmp.", InsertPt); + V = InsertBinop(Instruction::Sub, Constant::getNullValue(V->getType()), V, + InsertPt); return V; } @@ -103,7 +123,7 @@ Value *Rest = expandInTy(SCEVAddRecExpr::get(NewOps, L), Ty); // FIXME: look for an existing add to use. - return BinaryOperator::createAdd(Rest, Start, "tmp.", InsertPt); + return InsertBinop(Instruction::Add, Rest, Start, InsertPt); } // {0,+,1} --> Insert a canonical induction variable into the loop! @@ -164,7 +184,7 @@ } } - return BinaryOperator::createMul(I, F, "tmp.", MulInsertPt); + return InsertBinop(Instruction::Mul, I, F, MulInsertPt); } // If this is a chain of recurrences, turn it into a closed form, using the From reid at x10sys.com Fri Apr 13 00:40:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 00:40:29 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704130540.l3D5eTli005719@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.100 -> 1.101 --- Log message: Fix a link. --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.100 llvm-www/DevMtgMay2007.html:1.101 --- llvm-www/DevMtgMay2007.html:1.100 Thu Apr 12 22:45:36 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 00:40:11 2007 @@ -181,7 +181,7 @@ and Expected Release would give new users an idea of what is being worked on. The details of each new feature could be tracked in Bugzilla. - Reid SpencerPick a name for LLVM + Reid SpencerPick a name for LLVM - We would like to resolve this. If there's a clear winner (show of hands) then we'll adopt it, otherwise we'll keep waiting for the perfect name @@ -351,6 +351,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 03:45:36 $ +
    Last modified: $Date: 2007/04/13 05:40:11 $ From reid at x10sys.com Fri Apr 13 00:43:32 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 00:43:32 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704130543.l3D5hWUY005826@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.101 -> 1.102 --- Log message: Hame? --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.101 llvm-www/DevMtgMay2007.html:1.102 --- llvm-www/DevMtgMay2007.html:1.101 Fri Apr 13 00:40:11 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 00:43:15 2007 @@ -181,7 +181,7 @@ and Expected Release would give new users an idea of what is being worked on. The details of each new feature could be tracked in Bugzilla. - Reid SpencerPick a name for LLVM + Reid SpencerPick a name for LLVM - We would like to resolve this. If there's a clear winner (show of hands) then we'll adopt it, otherwise we'll keep waiting for the perfect name @@ -351,6 +351,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 05:40:11 $ +
    Last modified: $Date: 2007/04/13 05:43:15 $ From reid at x10sys.com Fri Apr 13 00:45:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 00:45:25 -0500 Subject: [llvm-commits] CVS: llvm-www/GSoCProjects.html Message-ID: <200704130545.l3D5jPiT005918@zion.cs.uiuc.edu> Changes in directory llvm-www: GSoCProjects.html updated: 1.1 -> 1.2 --- Log message: Make ToC match content. --- Diffs of the changes: (+2 -2) GSoCProjects.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/GSoCProjects.html diff -u llvm-www/GSoCProjects.html:1.1 llvm-www/GSoCProjects.html:1.2 --- llvm-www/GSoCProjects.html:1.1 Thu Apr 12 09:06:27 2007 +++ llvm-www/GSoCProjects.html Fri Apr 13 00:45:07 2007 @@ -3,7 +3,7 @@

    Google Summer of Code Projects
      -
    • Introduction
    • +
    • What Is This?
    • The Projects
      1. Mips Target
      2. @@ -78,7 +78,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
        - Last modified: $Date: 2007/04/12 14:06:27 $ + Last modified: $Date: 2007/04/13 05:45:07 $ From zhousheng00 at gmail.com Fri Apr 13 00:57:50 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Fri, 13 Apr 2007 00:57:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/ConstantRange.cpp Message-ID: <200704130557.l3D5voTk006142@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ConstantRange.cpp updated: 1.43 -> 1.44 --- Log message: Make the apint construction more effective. --- Diffs of the changes: (+3 -3) ConstantRange.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Support/ConstantRange.cpp diff -u llvm/lib/Support/ConstantRange.cpp:1.43 llvm/lib/Support/ConstantRange.cpp:1.44 --- llvm/lib/Support/ConstantRange.cpp:1.43 Sat Apr 7 10:41:33 2007 +++ llvm/lib/Support/ConstantRange.cpp Fri Apr 13 00:57:32 2007 @@ -108,7 +108,7 @@ /// ConstantRange. /// APInt ConstantRange::getSignedMax() const { - APInt SignedMax = APInt::getSignedMaxValue(getBitWidth()); + APInt SignedMax(APInt::getSignedMaxValue(getBitWidth())); if (!isWrappedSet()) { if (getLower().slt(getUpper() - 1)) return getUpper() - 1; @@ -130,7 +130,7 @@ /// ConstantRange. /// APInt ConstantRange::getSignedMin() const { - APInt SignedMin = APInt::getSignedMinValue(getBitWidth()); + APInt SignedMin(APInt::getSignedMinValue(getBitWidth())); if (!isWrappedSet()) { if (getLower().slt(getUpper() - 1)) return getLower(); @@ -370,7 +370,7 @@ ConstantRange ConstantRange::truncate(uint32_t DstTySize) const { unsigned SrcTySize = getBitWidth(); assert(SrcTySize > DstTySize && "Not a value truncation"); - APInt Size = APInt::getMaxValue(DstTySize).zext(SrcTySize); + APInt Size(APInt::getLowBitsSet(SrcTySize, DstTySize)); if (isFullSet() || getSetSize().ugt(Size)) return ConstantRange(DstTySize); From tonic at nondot.org Fri Apr 13 01:18:18 2007 From: tonic at nondot.org (Tanya Lattner) Date: Fri, 13 Apr 2007 01:18:18 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php Message-ID: <200704130618.l3D6IIN9006556@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.php updated: 1.61 -> 1.62 --- Log message: Moving guts of accept script to a function. --- Diffs of the changes: (+435 -431) NightlyTestAccept.php | 866 +++++++++++++++++++++++++------------------------- 1 files changed, 435 insertions(+), 431 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.php diff -u nightlytest-serverside/NightlyTestAccept.php:1.61 nightlytest-serverside/NightlyTestAccept.php:1.62 --- nightlytest-serverside/NightlyTestAccept.php:1.61 Mon Dec 4 03:36:35 2006 +++ nightlytest-serverside/NightlyTestAccept.php Fri Apr 13 01:18:01 2007 @@ -481,500 +481,504 @@ * Setting up variables * *******************************************************************************/ -if ($print_debug) { - print "Reading _POST Variables\n"; -} +function acceptTest() { + if ($print_debug) { + print "Reading _POST Variables\n"; + } -$spliton ="\n"; + $spliton ="\n"; -$machine_data = $_POST['machine_data']; -if (!isset($machine_data)) { - $machine_data = ""; -} -$MACHINE_DATA = split($spliton, $machine_data); + $machine_data = $_POST['machine_data']; + if (!isset($machine_data)) { + $machine_data = ""; + } + $MACHINE_DATA = split($spliton, $machine_data); -$cvs_log = $_POST['cvs_data']; -if (!isset($cvs_log)) { - $cvs_log = ""; -} -$CVS_LOG = split($spliton, $cvs_log); + $cvs_log = $_POST['cvs_data']; + if (!isset($cvs_log)) { + $cvs_log = ""; + } + $CVS_LOG = split($spliton, $cvs_log); -$build_log = $_POST['build_data']; -if (!isset($build_log)) { - $build_log = ""; -} -$BUILD_LOG = split($spliton, $build_log); + $build_log = $_POST['build_data']; + if (!isset($build_log)) { + $build_log = ""; + } + $BUILD_LOG = split($spliton, $build_log); -$dejagnutests_results = $_POST['dejagnutests_results']; -if (!isset($dejagnutests_results)) { - $dejagnutests_results = ""; -} -$DEJAGNUTESTS_RESULTS = split($spliton, $dejagnutests_results); + $dejagnutests_results = $_POST['dejagnutests_results']; + if (!isset($dejagnutests_results)) { + $dejagnutests_results = ""; + } + $DEJAGNUTESTS_RESULTS = split($spliton, $dejagnutests_results); -$dejagnutests_log = $_POST['dejagnutests_log']; -if (!isset($dejagnutests_log)) { - $dejagnutests_log = ""; -} -$DEJAGNUTESTS_LOG = split($spliton, $dejagnutests_log); + $dejagnutests_log = $_POST['dejagnutests_log']; + if (!isset($dejagnutests_log)) { + $dejagnutests_log = ""; + } + $DEJAGNUTESTS_LOG = split($spliton, $dejagnutests_log); -$singlesource_tests = $_POST['singlesource_programstable']; -if (!isset($singlesource_tests)) { - $singlesource_tests = ""; -} -$SINGLESOURCE_TESTS = split($spliton, $singlesource_tests); + $singlesource_tests = $_POST['singlesource_programstable']; + if (!isset($singlesource_tests)) { + $singlesource_tests = ""; + } + $SINGLESOURCE_TESTS = split($spliton, $singlesource_tests); -$multisource_tests = $_POST['multisource_programstable']; -if (!isset($multisource_tests)) { - $multisource_tests = ""; -} -$MULTISOURCE_TESTS = split($spliton, $multisource_tests); + $multisource_tests = $_POST['multisource_programstable']; + if (!isset($multisource_tests)) { + $multisource_tests = ""; + } + $MULTISOURCE_TESTS = split($spliton, $multisource_tests); -$external_tests = $_POST['externalsource_programstable']; -if (!isset($external_tests)) { - $external_tests = ""; -} -$EXTERNAL_TESTS = split($spliton, $external_tests); + $external_tests = $_POST['externalsource_programstable']; + if (!isset($external_tests)) { + $external_tests = ""; + } + $EXTERNAL_TESTS = split($spliton, $external_tests); -$o_file_size = $_POST['o_file_sizes']; -if (!isset($o_file_size)) { - $o_file_size = ""; -} -$o_file_size = rtrim($o_file_size); -$O_FILE_SIZE = split($spliton, $o_file_size); + $o_file_size = $_POST['o_file_sizes']; + if (!isset($o_file_size)) { + $o_file_size = ""; + } + $o_file_size = rtrim($o_file_size); + $O_FILE_SIZE = split($spliton, $o_file_size); -$a_file_size = $_POST['a_file_sizes']; -if (!isset($a_file_size)) { - $a_file_size = ""; -} -$a_file_size = rtrim($a_file_size); -$A_FILE_SIZE = split($spliton, $a_file_size); + $a_file_size = $_POST['a_file_sizes']; + if (!isset($a_file_size)) { + $a_file_size = ""; + } + $a_file_size = rtrim($a_file_size); + $A_FILE_SIZE = split($spliton, $a_file_size); -$filesincvs = $_POST['cvs_file_count']; -$dirsincvs = $_POST['cvs_dir_count']; -$loc = $_POST['lines_of_code']; -$nickname = $_POST['nickname']; -$cvscheckouttime_cpu = $_POST['cvscheckouttime_cpu']; -$cvscheckouttime_wall = $_POST['cvscheckouttime_wall']; -$configtime_wall = $_POST['configtime_wall']; -$configtime_cpu = $_POST['configtime_cpu']; -$buildtime_cpu = $_POST['buildtime_cpu']; -$buildtime_wall = $_POST['buildtime_wall']; -$dejagnutime_cpu = $_POST['dejagnutime_cpu']; -$dejagnutime_wall = $_POST['dejagnutime_wall']; -$buildwarnings = $_POST['warnings']; -$cvsaddedfiles = $_POST['cvsaddedfiles']; -$cvsremovedfiles = $_POST['cvsremovedfiles']; -$cvsmodifiedfiles = $_POST['cvsmodifiedfiles']; -$cvsusercommitlist = $_POST['cvsusercommitlist']; -$cvsuserupdatelist = $_POST['cvsuserupdatelist']; -$buildstatus = $_POST['buildstatus']; -$warnings_added = $_POST['warnings_removed']; -$warnings_removed = $_POST['warnings_added']; -$all_tests = $_POST['all_tests']; -$unexpfail_tests = $_POST['unexpfail_tests']; -$passing_tests = $_POST['passing_tests']; -$expfail_tests = $_POST['expfail_tests']; -$newly_passing_tests = $_POST['newly_passing_tests']; -$newly_failing_tests = $_POST['newly_failing_tests']; -$new_tests = $_POST['new_tests']; -$removed_tests = $_POST['removed_tests']; -$gcc_version = $_POST['gcc_version']; -$warnings = $_POST['warnings']; -$lines_of_code = $_POST['lines_of_code']; + $filesincvs = $_POST['cvs_file_count']; + $dirsincvs = $_POST['cvs_dir_count']; + $loc = $_POST['lines_of_code']; + $nickname = $_POST['nickname']; + $cvscheckouttime_cpu = $_POST['cvscheckouttime_cpu']; + $cvscheckouttime_wall = $_POST['cvscheckouttime_wall']; + $configtime_wall = $_POST['configtime_wall']; + $configtime_cpu = $_POST['configtime_cpu']; + $buildtime_cpu = $_POST['buildtime_cpu']; + $buildtime_wall = $_POST['buildtime_wall']; + $dejagnutime_cpu = $_POST['dejagnutime_cpu']; + $dejagnutime_wall = $_POST['dejagnutime_wall']; + $buildwarnings = $_POST['warnings']; + $cvsaddedfiles = $_POST['cvsaddedfiles']; + $cvsremovedfiles = $_POST['cvsremovedfiles']; + $cvsmodifiedfiles = $_POST['cvsmodifiedfiles']; + $cvsusercommitlist = $_POST['cvsusercommitlist']; + $cvsuserupdatelist = $_POST['cvsuserupdatelist']; + $buildstatus = $_POST['buildstatus']; + $warnings_added = $_POST['warnings_removed']; + $warnings_removed = $_POST['warnings_added']; + $all_tests = $_POST['all_tests']; + $unexpfail_tests = $_POST['unexpfail_tests']; + $passing_tests = $_POST['passing_tests']; + $expfail_tests = $_POST['expfail_tests']; + $newly_passing_tests = $_POST['newly_passing_tests']; + $newly_failing_tests = $_POST['newly_failing_tests']; + $new_tests = $_POST['new_tests']; + $removed_tests = $_POST['removed_tests']; + $gcc_version = $_POST['gcc_version']; + $warnings = $_POST['warnings']; + $lines_of_code = $_POST['lines_of_code']; -if ($print_debug) { - print "Finished Reading _POST Variables\n"; -} + if ($print_debug) { + print "Finished Reading _POST Variables\n"; + } -/******************************************************************************* - * - * Extracting the machine information - * - *******************************************************************************/ -$uname = MatchOne("/uname\:\s*(.+)/", $MACHINE_DATA[0], ""); -$hardware = MatchOne("/hardware\:\s*(.+)/", $MACHINE_DATA[1], ""); -$os = MatchOne("/os\:\s*(.+)/", $MACHINE_DATA[2], ""); -$name = MatchOne("/name\:\s*(.+)/", $MACHINE_DATA[3], ""); -$date = MatchOne("/date\:\s*(.+)/", $MACHINE_DATA[4], ""); -$time = MatchOne("/time\:\s*(.+)/", $MACHINE_DATA[5], ""); - -if ($print_debug) { - print "uname: $uname\n"; - print "hardware: $hardware\n"; - print "os: $os\n"; - print "name: $name\n"; - print "date: $date\n"; - print "time: $time\n"; -} + /******************************************************************************* + * + * Extracting the machine information + * + *******************************************************************************/ + $uname = MatchOne("/uname\:\s*(.+)/", $MACHINE_DATA[0], ""); + $hardware = MatchOne("/hardware\:\s*(.+)/", $MACHINE_DATA[1], ""); + $os = MatchOne("/os\:\s*(.+)/", $MACHINE_DATA[2], ""); + $name = MatchOne("/name\:\s*(.+)/", $MACHINE_DATA[3], ""); + $date = MatchOne("/date\:\s*(.+)/", $MACHINE_DATA[4], ""); + $time = MatchOne("/time\:\s*(.+)/", $MACHINE_DATA[5], ""); + + if ($print_debug) { + print "uname: $uname\n"; + print "hardware: $hardware\n"; + print "os: $os\n"; + print "name: $name\n"; + print "date: $date\n"; + print "time: $time\n"; + } -/******************************************************************************* - * - * Extracting the dejagnu test numbers - * - *******************************************************************************/ - -$dejagnu_exp_passes = MatchOne("/\# of expected passes\s*([0-9]+)/", $dejagnutests_log, 0); -$dejagnu_unexp_failures = MatchOne("/unexpected failures\s*([0-9]+)/", $dejagnutests_log, 0); -$dejagnu_exp_failures = MatchOne("/\# of expected failures\s*([0-9]+)/", $dejagnutests_log, 0); - -if ($print_debug) { - print "dejagnu_exp_passes: $dejagnu_exp_passes\n"; - print "dejagnu_unexp_failures: $dejagnu_unexp_failures\n"; - print "dejagnu_exp_failures: $dejagnu_exp_failures\n"; -} + /******************************************************************************* + * + * Extracting the dejagnu test numbers + * + *******************************************************************************/ + + $dejagnu_exp_passes = MatchOne("/\# of expected passes\s*([0-9]+)/", $dejagnutests_log, 0); + $dejagnu_unexp_failures = MatchOne("/unexpected failures\s*([0-9]+)/", $dejagnutests_log, 0); + $dejagnu_exp_failures = MatchOne("/\# of expected failures\s*([0-9]+)/", $dejagnutests_log, 0); + + if ($print_debug) { + print "dejagnu_exp_passes: $dejagnu_exp_passes\n"; + print "dejagnu_unexp_failures: $dejagnu_unexp_failures\n"; + print "dejagnu_exp_failures: $dejagnu_exp_failures\n"; + } -/******************************************************************************* - * - * Processing Program Test Table Logs - * - *******************************************************************************/ - -$singlesource_processed = ProcessProgramLogs($SINGLESOURCE_TESTS); -$multisource_processed = ProcessProgramLogs($MULTISOURCE_TESTS); -$external_processed = ProcessProgramLogs($EXTERNAL_TESTS); - -if ($print_debug) { - $singlesource_processed_count = count($singlesource_processed); - $multisource_processed_count = count($multisource_processed); - $external_processed_count = count($external_processed); - print "singlesource_processed#: $singlesource_processed_count\n"; - print "multisource_processed#: $multisource_processed_count\n"; - print "external_processed#: $external_processed_count\n"; -} + /******************************************************************************* + * + * Processing Program Test Table Logs + * + *******************************************************************************/ + + $singlesource_processed = ProcessProgramLogs($SINGLESOURCE_TESTS); + $multisource_processed = ProcessProgramLogs($MULTISOURCE_TESTS); + $external_processed = ProcessProgramLogs($EXTERNAL_TESTS); + + if ($print_debug) { + $singlesource_processed_count = count($singlesource_processed); + $multisource_processed_count = count($multisource_processed); + $external_processed_count = count($external_processed); + print "singlesource_processed#: $singlesource_processed_count\n"; + print "multisource_processed#: $multisource_processed_count\n"; + print "external_processed#: $external_processed_count\n"; + } -/******************************************************************************* - * - * creating the response - * - *******************************************************************************/ -if (!DoesMachineExist($uname, $hardware, $os, $name, $nickname, $gcc_version)) { - AddMachine($uname, $hardware, $os, $name, $nickname, $gcc_version, "test"); -} -$machine_id = GetMachineId($uname, $hardware, $os, $name, $nickname, $gcc_version); + /******************************************************************************* + * + * creating the response + * + *******************************************************************************/ + if (!DoesMachineExist($uname, $hardware, $os, $name, $nickname, $gcc_version)) { + AddMachine($uname, $hardware, $os, $name, $nickname, $gcc_version, "test"); + } + $machine_id = GetMachineId($uname, $hardware, $os, $name, $nickname, $gcc_version); -if ($print_debug) { - print "machine_id: $machine_id\n"; -} + if ($print_debug) { + print "machine_id: $machine_id\n"; + } -/******************************************************************************* - * - * Submitting information to database - * - *******************************************************************************/ -$db_date = date("Y-m-d H:i:s"); -$blank=""; -$night_id= CreateNight($machine_id, $db_date, $buildstatus, - $configtime_cpu, $configtime_wall, $cvscheckouttime_cpu, - $cvscheckouttime_wall, $buildtime_cpu, $buildtime_wall, - $dejagnutime_cpu, $dejagnutime_wall, $warnings, - $warnings_added, $warnings_removed, - $dejagnu_exp_passes, $dejagnu_unexp_failures, $dejagnu_exp_failures, - $blank, $blank, $blank, // $all_tests, $passing_tests, $unexpfail_tests, - $blank, $blank, $blank, // $expfail_tests, $TestsFixed, $TestsBroken, - $blank, $blank, // $TestsAdded, $TestsRemoved, - $cvsaddedfiles, $cvsremovedfiles, $cvsmodifiedfiles, - $cvsusercommitlist, $cvsuserupdatelist); - -if ($print_debug) { - print "db_date: $db_date\n"; - print "night_id: $night_id\n"; -} + /******************************************************************************* + * + * Submitting information to database + * + *******************************************************************************/ + $db_date = date("Y-m-d H:i:s"); + $blank=""; + $night_id= CreateNight($machine_id, $db_date, $buildstatus, + $configtime_cpu, $configtime_wall, $cvscheckouttime_cpu, + $cvscheckouttime_wall, $buildtime_cpu, $buildtime_wall, + $dejagnutime_cpu, $dejagnutime_wall, $warnings, + $warnings_added, $warnings_removed, + $dejagnu_exp_passes, $dejagnu_unexp_failures, $dejagnu_exp_failures, + $blank, $blank, $blank, // $all_tests, $passing_tests, $unexpfail_tests, + $blank, $blank, $blank, // $expfail_tests, $TestsFixed, $TestsBroken, + $blank, $blank, // $TestsAdded, $TestsRemoved, + $cvsaddedfiles, $cvsremovedfiles, $cvsmodifiedfiles, + $cvsusercommitlist, $cvsuserupdatelist); + + if ($print_debug) { + print "db_date: $db_date\n"; + print "night_id: $night_id\n"; + } -foreach ($singlesource_processed as $key => $value) { - AddProgram($key, $value, "singlesource", $night_id); -} + foreach ($singlesource_processed as $key => $value) { + AddProgram($key, $value, "singlesource", $night_id); + } -foreach ($multisource_processed as $key => $value) { - AddProgram($key, $value, "multisource", $night_id); -} + foreach ($multisource_processed as $key => $value) { + AddProgram($key, $value, "multisource", $night_id); + } -foreach ($external_processed as $key => $value) { - AddProgram($key, $value, "external", $night_id); -} + foreach ($external_processed as $key => $value) { + AddProgram($key, $value, "external", $night_id); + } -if ($print_debug) { - print "Programs Added\n"; -} + if ($print_debug) { + print "Programs Added\n"; + } -foreach ($O_FILE_SIZE as $info) { - list($ignore, $size, $file, $type) = Match("/(.+)\s+(.+)\s+(.+)/", $info); - AddFile($file, $size, $night_id, $type); -} + foreach ($O_FILE_SIZE as $info) { + list($ignore, $size, $file, $type) = Match("/(.+)\s+(.+)\s+(.+)/", $info); + AddFile($file, $size, $night_id, $type); + } -if ($print_debug) { - $O_FILE_SIZE_COUNT = count($O_FILE_SIZE); - print "o file sizes#: $O_FILE_SIZE_COUNT\n"; -} + if ($print_debug) { + $O_FILE_SIZE_COUNT = count($O_FILE_SIZE); + print "o file sizes#: $O_FILE_SIZE_COUNT\n"; + } -foreach ($A_FILE_SIZE as $info) { - list($ignore, $size, $file, $type) = Match("/(.+)\s+(.+)\s+(.+)/", $info); - AddFile($file, $size, $night_id, $type); -} + foreach ($A_FILE_SIZE as $info) { + list($ignore, $size, $file, $type) = Match("/(.+)\s+(.+)\s+(.+)/", $info); + AddFile($file, $size, $night_id, $type); + } -if ($print_debug) { - $A_FILE_SIZE_COUNT = count($A_FILE_SIZE); - print "a file sizes#: $A_FILE_SIZE_COUNT\n"; -} + if ($print_debug) { + $A_FILE_SIZE_COUNT = count($A_FILE_SIZE); + print "a file sizes#: $A_FILE_SIZE_COUNT\n"; + } -/******************************************************************************* - * - * Adding test results pass/fail/xfail status to database - * - *******************************************************************************/ -$ALL_TESTS = split("\n", $all_tests); -foreach ($ALL_TESTS as $info) { - $subpatterns = array(); - if (preg_match("/(TEST-)?(XPASS|PASS|XFAIL|FAIL):\s(.+?)\s(.+)/", $info, $subpatterns)) { - list($ignore1, $ignore2, $result, $measure, $program) = $subpatterns; - AddTests($program, $result, $measure, $night_id); + /******************************************************************************* + * + * Adding test results pass/fail/xfail status to database + * + *******************************************************************************/ + $ALL_TESTS = split("\n", $all_tests); + foreach ($ALL_TESTS as $info) { + $subpatterns = array(); + if (preg_match("/(TEST-)?(XPASS|PASS|XFAIL|FAIL):\s(.+?)\s(.+)/", $info, $subpatterns)) { + list($ignore1, $ignore2, $result, $measure, $program) = $subpatterns; + AddTests($program, $result, $measure, $night_id); + } } -} -if ($print_debug) { - print "Program Tests Added\n"; -} + if ($print_debug) { + print "Program Tests Added\n"; + } -foreach ($DEJAGNUTESTS_RESULTS as $info) { - $subpatterns = array(); - if (preg_match("/^(XPASS|PASS|XFAIL|FAIL):\s(.+):?/", $info, $subpatterns)) { - list($ignore, $result, $program) = $subpatterns; - AddTests($program, $result, "dejagnu", $night_id); + foreach ($DEJAGNUTESTS_RESULTS as $info) { + $subpatterns = array(); + if (preg_match("/^(XPASS|PASS|XFAIL|FAIL):\s(.+):?/", $info, $subpatterns)) { + list($ignore, $result, $program) = $subpatterns; + AddTests($program, $result, "dejagnu", $night_id); + } } -} -if ($print_debug) { - print "Dejagnu Test Results Added\n"; -} + if ($print_debug) { + print "Dejagnu Test Results Added\n"; + } -/******************************************************************************* - * - * Adding lines of code to the database - * - *******************************************************************************/ -if(StringEqual($buildstatus, "OK")) { - // only update loc if successful build - UpdateCodeInfo($db_date, $loc, $filesincvs, $dirsincvs); -} + /******************************************************************************* + * + * Adding lines of code to the database + * + *******************************************************************************/ + if(StringEqual($buildstatus, "OK")) { + // only update loc if successful build + UpdateCodeInfo($db_date, $loc, $filesincvs, $dirsincvs); + } -print "received ${_SERVER['CONTENT_LENGTH']} bytes\n"; - -$nights = GetMachineNights($machine_id); -$length = count($nights); -print "DB date : $db_date\n"; -print "Machine $machine_id now has ids [$nights]{$length} ". - "associated with it in the database\n"; - -/******************************************************************************* - * - * building hash of arrays of signifigant changes to place into the nightly - * test results email. This is ugly code and is somewhat of a hack. However, it - * adds very useful information to the nightly test email. - * - *******************************************************************************/ -$query = "SELECT id FROM night WHERE id<$night_id AND machine=$machine_id AND ". - "buildstatus=\"OK\" ORDER BY id DESC"; -$night_query = mysql_query($query) or die(mysql_error()); -$row = mysql_fetch_assoc($night_query); -$prev_night = $row['id']; -if (!isset($prev_night)) { - $prev_night = $night_id; -} -mysql_free_result($night_query); + print "received ${_SERVER['CONTENT_LENGTH']} bytes\n"; + + $nights = GetMachineNights($machine_id); + $length = count($nights); + print "DB date : $db_date\n"; + print "Machine $machine_id now has ids [$nights]{$length} ". + "associated with it in the database\n"; + + /******************************************************************************* + * + * building hash of arrays of signifigant changes to place into the nightly + * test results email. This is ugly code and is somewhat of a hack. However, it + * adds very useful information to the nightly test email. + * + *******************************************************************************/ + $query = "SELECT id FROM night WHERE id<$night_id AND machine=$machine_id AND ". + "buildstatus=\"OK\" ORDER BY id DESC"; + $night_query = mysql_query($query) or die(mysql_error()); + $row = mysql_fetch_assoc($night_query); + $prev_night = $row['id']; + if (!isset($prev_night)) { + $prev_night = $night_id; + } + mysql_free_result($night_query); -if ($print_debug) { - print "prev_night: $prev_night\n"; -} + if ($print_debug) { + print "prev_night: $prev_night\n"; + } -$query = "SELECT * FROM program WHERE night=$night_id"; -$program_query = mysql_query($query) or die(mysql_error()); + $query = "SELECT * FROM program WHERE night=$night_id"; + $program_query = mysql_query($query) or die(mysql_error()); -$prog_hash_new = array(); -while ($row = mysql_fetch_assoc($program_query)) { - $program = $row['type']."/".$row['program']; - $result = $row['result']; - $prog_hash_new[$program] = $result; -} -mysql_free_result($program_query); + $prog_hash_new = array(); + while ($row = mysql_fetch_assoc($program_query)) { + $program = $row['type']."/".$row['program']; + $result = $row['result']; + $prog_hash_new[$program] = $result; + } + mysql_free_result($program_query); -if ($print_debug) { - print "Gathered all tonight\'s programs\n"; -} + if ($print_debug) { + print "Gathered all tonight\'s programs\n"; + } -$query = "SELECT * FROM program WHERE night=$prev_night"; -$program_query = mysql_query($query) or die(mysql_error()); + $query = "SELECT * FROM program WHERE night=$prev_night"; + $program_query = mysql_query($query) or die(mysql_error()); -$prog_hash_old = array(); -while ($row = mysql_fetch_assoc($program_query)) { - $program = $row['type']."/".$row['program']; - $result = $row['result']; - $prog_hash_old[$program] = $result; -} -mysql_free_result($program_query); + $prog_hash_old = array(); + while ($row = mysql_fetch_assoc($program_query)) { + $program = $row['type']."/".$row['program']; + $result = $row['result']; + $prog_hash_old[$program] = $result; + } + mysql_free_result($program_query); -if ($print_debug) { - print "Gathered all previous night\'s programs\n"; -} + if ($print_debug) { + print "Gathered all previous night\'s programs\n"; + } -$monitoring = array("Bytecode", "CBE", "GCCAS", "JIT", "LLC", "LLC-BETA", "LLC compile", "LLC-BETA compile"); -$output_big_changes = array(); -foreach ($prog_hash_new as $prog => $prog_new) { - $prog_old = $prog_hash_old[$prog]; - - // get data from server - $vals_new = split(", ", $prog_new); - $vals_old = split(", ", $prog_old); - - // get list of values measured from newest test - $new_measures = array(); - foreach ($vals_new as $measure) { - list($measure, $value) = split(": ", $measure); - $new_measures[$measure] = $value; - } - - // get list of values measured from older test - $old_measures = array(); - foreach ($vals_old as $measure) { - list($measure, $value) = split(": ", $measure); - $old_measures[$measure] = $value; - } - - // put measures into hash of arrays - foreach ($monitoring as $measure) { - $value_new = MatchOne("/(\d+\.?\d*)/", $new_measures[$measure], ""); - $value_old = MatchOne("/(\d+\.?\d*)/", $old_measures[$measure], ""); - - if (StringIsNull($value_new) || StringIsNull($value_old)) continue; - - $diff = ($value_old - $value_new); - $perc = 0; + $monitoring = array("Bytecode", "CBE", "GCCAS", "JIT", "LLC", "LLC-BETA", "LLC compile", "LLC-BETA compile"); + $output_big_changes = array(); + foreach ($prog_hash_new as $prog => $prog_new) { + $prog_old = $prog_hash_old[$prog]; + + // get data from server + $vals_new = split(", ", $prog_new); + $vals_old = split(", ", $prog_old); - if ($value_old != 0 && ($diff > 0.2 || $diff < -0.2) ) { - $perc = ($diff / $value_old) * 100; + // get list of values measured from newest test + $new_measures = array(); + foreach ($vals_new as $measure) { + list($measure, $value) = split(": ", $measure); + $new_measures[$measure] = $value; } - if ($perc > 5 || $perc < -5) { - $changes = $output_big_changes[$measure]; + // get list of values measured from older test + $old_measures = array(); + foreach ($vals_old as $measure) { + list($measure, $value) = split(": ", $measure); + $old_measures[$measure] = $value; + } + + // put measures into hash of arrays + foreach ($monitoring as $measure) { + $value_new = MatchOne("/(\d+\.?\d*)/", $new_measures[$measure], ""); + $value_old = MatchOne("/(\d+\.?\d*)/", $old_measures[$measure], ""); + + if (StringIsNull($value_new) || StringIsNull($value_old)) continue; + + $diff = ($value_old - $value_new); + $perc = 0; - if (!isset($changes)) { - $changes = array(); + if ($value_old != 0 && ($diff > 0.2 || $diff < -0.2) ) { + $perc = ($diff / $value_old) * 100; } - $rounded_perc = sprintf("%1.2f", $perc); - array_push($changes, "$prog: $rounded_perc% ($value_old => $value_new)\n"); - $output_big_changes[$measure] = $changes; + if ($perc > 5 || $perc < -5) { + $changes = $output_big_changes[$measure]; + + if (!isset($changes)) { + $changes = array(); + } + + $rounded_perc = sprintf("%1.2f", $perc); + array_push($changes, "$prog: $rounded_perc% ($value_old => $value_new)\n"); + $output_big_changes[$measure] = $changes; + } } } -} -if ($print_debug) { - print "Determined measures\n"; -} + if ($print_debug) { + print "Determined measures\n"; + } -/******************************************************************************* - * - * Determining changes in new tests and old tests - * - *******************************************************************************/ - -$removed = getRemovedTests($night_id, $prev_night); -$added = getNewTests($night_id, $prev_night); -$passing = getFixedTests($night_id, $prev_night); -$failing = getBrokenTests($night_id, $prev_night); + /******************************************************************************* + * + * Determining changes in new tests and old tests + * + *******************************************************************************/ + + $removed = getRemovedTests($night_id, $prev_night); + $added = getNewTests($night_id, $prev_night); + $passing = getFixedTests($night_id, $prev_night); + $failing = getBrokenTests($night_id, $prev_night); -if ($print_debug) { - print "Determined changes in new tests and old tests\n"; -} + if ($print_debug) { + print "Determined changes in new tests and old tests\n"; + } -/******************************************************************************* - * - * Encode date for file name use - * - *******************************************************************************/ - -$db_date = preg_replace("/ /", "_", $db_date); - -/******************************************************************************* - * - * Sending email to nightly test email archive - * - *******************************************************************************/ -$link_to_page="http://llvm.org/nightlytest/test.php?machine=$machine_id&". - "night=$night_id"; -$email = "$link_to_page\n"; -$email .= "Name: $name\n"; -$email .= "Nickname: $nickname\n"; -$email .= "Buildstatus: $buildstatus\n"; - -if(StringEqual($buildstatus, "OK")) { - if (StringIsNull($passing)) { - $passing = "None"; - } - $email .= "\nNew Test Passes:\n$passing\n"; - if (StringIsNull($failing)) { - $failing = "None"; - } - $email .= "\nNew Test Failures:\n$failing\n"; - if (StringIsNull($added)) { - $added = "None"; - } - $email .= "\nAdded Tests:\n$added\n"; - if (StringIsNull($removed)) { - $removed= "None"; - } - $email .= "\nRemoved Tests:\n$removed\n"; - - $email .= "\nSignificant changes in test results:\n"; - foreach ($output_big_changes as $measure => $values) { - $email.= "$measure:\n"; - foreach ($values as $value) { - $email.= " $value"; + /******************************************************************************* + * + * Encode date for file name use + * + *******************************************************************************/ + + $db_date = preg_replace("/ /", "_", $db_date); + + /******************************************************************************* + * + * Sending email to nightly test email archive + * + *******************************************************************************/ + $link_to_page="http://llvm.org/nightlytest/test.php?machine=$machine_id&". + "night=$night_id"; + $email = "$link_to_page\n"; + $email .= "Name: $name\n"; + $email .= "Nickname: $nickname\n"; + $email .= "Buildstatus: $buildstatus\n"; + + if(StringEqual($buildstatus, "OK")) { + if (StringIsNull($passing)) { + $passing = "None"; + } + $email .= "\nNew Test Passes:\n$passing\n"; + if (StringIsNull($failing)) { + $failing = "None"; + } + $email .= "\nNew Test Failures:\n$failing\n"; + if (StringIsNull($added)) { + $added = "None"; + } + $email .= "\nAdded Tests:\n$added\n"; + if (StringIsNull($removed)) { + $removed= "None"; + } + $email .= "\nRemoved Tests:\n$removed\n"; + + $email .= "\nSignificant changes in test results:\n"; + foreach ($output_big_changes as $measure => $values) { + $email.= "$measure:\n"; + foreach ($values as $value) { + $email.= " $value"; + } } } -} -else{ - $email .= "\nBuildlog available at http://llvm.org/nightlytest/". - "machines/$db_date-Build-Log.txt\n"; -} + else{ + $email .= "\nBuildlog available at http://llvm.org/nightlytest/". + "machines/$db_date-Build-Log.txt\n"; + } -$email_addr = "llvm-testresults\@cs.uiuc.edu"; -`echo "$email" | mail -s '$nickname $hardware nightly tester results' $email_addr`; + $email_addr = "llvm-testresults\@cs.uiuc.edu"; + `echo "$email" | mail -s '$nickname $hardware nightly tester results' $email_addr`; -/******************************************************************************* - * - * writing logs to directory - * - *******************************************************************************/ -$cwd = getcwd(); + /******************************************************************************* + * + * writing logs to directory + * + *******************************************************************************/ + $cwd = getcwd(); -if (!file_exists('machines')) { - mkdir('machines', 777); -} -chdir("$cwd/machines"); + if (!file_exists('machines')) { + mkdir('machines', 777); + } + chdir("$cwd/machines"); -if (!file_exists("$machine_id")) { - mkdir("$machine_id", 777); -} -chdir("$cwd/machines/$machine_id"); + if (!file_exists("$machine_id")) { + mkdir("$machine_id", 777); + } + chdir("$cwd/machines/$machine_id"); -WriteFile("$db_date-Build-Log.txt", $build_log); + WriteFile("$db_date-Build-Log.txt", $build_log); + + $sentdata=""; + foreach ($_GET as $key => $value) { + if(strpos($value, "\n") == 0) { + $sentdata .= "'$key' => \"$value\",\n"; + } else { + $sentdata .= "'$key' => < $value) { + if(strpos($value, "\n") == 0) { + $sentdata .= "'$key' => \"$value\",\n"; + } else { + $sentdata .= "'$key' => < $value) { - if(strpos($value, "\n") == 0) { - $sentdata .= "'$key' => \"$value\",\n"; - } else { - $sentdata .= "'$key' => < $value) { - if(strpos($value, "\n") == 0) { - $sentdata .= "'$key' => \"$value\",\n"; - } else { - $sentdata .= "'$key' => < From sabre at nondot.org Fri Apr 13 01:51:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 01:51:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200704130651.l3D6pC4f007943@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.43 -> 1.44 --- Log message: arm has r+r*s and r+i addr modes, but no r+i+r*s addr modes. --- Diffs of the changes: (+5 -1) ARMISelLowering.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.43 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.44 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.43 Wed Apr 11 11:17:12 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Apr 13 01:50:55 2007 @@ -1370,8 +1370,12 @@ case 1: if (Subtarget->isThumb()) return false; - + // FALL THROUGH. default: + // ARM doesn't support any R+R*scale+imm addr modes. + if (AM.BaseOffs) + return false; + int Scale = AM.Scale; switch (getValueType(Ty)) { default: return false; From asl at math.spbu.ru Fri Apr 13 01:54:13 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 13 Apr 2007 01:54:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704130654.l3D6sDBC008041@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.417 -> 1.418 --- Log message: Fix PR1323: http://llvm.org/PR1323 : we haven't updated phi nodes in good manner :) --- Diffs of the changes: (+1 -0) SelectionDAGISel.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.417 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.417 Thu Apr 12 01:00:20 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr 13 01:53:51 2007 @@ -4634,6 +4634,7 @@ if (PHIBB == BitTestCases[i].Default) { PHI->addRegOperand(PHINodesToUpdate[pi].second, false); PHI->addMachineBasicBlockOperand(BitTestCases[i].Parent); + PHI->addRegOperand(PHINodesToUpdate[pi].second, false); PHI->addMachineBasicBlockOperand(BitTestCases[i].Cases.back().ThisBB); } // One of "cases" BB. From asl at math.spbu.ru Fri Apr 13 01:54:13 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 13 Apr 2007 01:54:13 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll Message-ID: <200704130654.l3D6sDJ0008044@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-04-13-SwitchLowerBadPhi.ll added (r1.1) --- Log message: Fix PR1323: http://llvm.org/PR1323 : we haven't updated phi nodes in good manner :) --- Diffs of the changes: (+27 -0) 2007-04-13-SwitchLowerBadPhi.ll | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll:1.1 *** /dev/null Fri Apr 13 01:54:01 2007 --- llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll Fri Apr 13 01:53:51 2007 *************** *** 0 **** --- 1,27 ---- + ; RUN: llvm-as < %s | llc -fast + ; PR 1323 + + ; ModuleID = 'test.bc' + 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" + target triple = "i686-apple-darwin8" + %struct.comp = type { i8*, i32, i8*, [3 x i8], i32 } + + define void @regbranch() { + cond_next240.i: + br i1 false, label %cond_true251.i, label %cond_next272.i + + cond_true251.i: ; preds = %cond_next240.i + switch i8 0, label %cond_next272.i [ + i8 42, label %bb268.i + i8 43, label %bb268.i + i8 63, label %bb268.i + ] + + bb268.i: ; preds = %cond_true251.i, %cond_true251.i, %cond_true251.i + br label %cond_next272.i + + cond_next272.i: ; preds = %bb268.i, %cond_true251.i, %cond_next240.i + %len.2.i = phi i32 [ 0, %bb268.i ], [ 0, %cond_next240.i ], [ 0, %cond_true251.i ] ; [#uses=1] + %tmp278.i = icmp eq i32 %len.2.i, 1 ; [#uses=0] + ret void + } From isanbard at gmail.com Fri Apr 13 03:41:57 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 13 Apr 2007 01:41:57 -0700 Subject: [llvm-commits] CVS: llvm-www/Funding.html In-Reply-To: <1176436376.23191.164.camel@bashful.x10sys.com> References: <200704121225.l3CCPiUh026275@zion.cs.uiuc.edu> <29126B10-EA2E-4402-9363-E68380EF96F4@gmail.com> <1176436376.23191.164.camel@bashful.x10sys.com> Message-ID: On Apr 12, 2007, at 8:52 PM, Reid Spencer wrote: > On Thu, 2007-04-12 at 20:38 -0700, Bill Wendling wrote: >> On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: >> >>> +

        Tax Exempt. Your donations are tax exempt in the >>> United States (and >>> + probably other countries). UIUC is a recognized non-profit >>> organization. >>> + Reciepts are available upon request.

        >>> +

        >> >> "Exempt" or "Deductible"? > > I dunno. You can legally claim it as a charitable donation. Whether > that > makes it an exemption or a deduction or even what those two words mean > in the gobbledy gook of Title 26, I have no idea. I'm not a tax > lawyer. > An organization that's designated as a non-profit is "tax exempt". The donations to it are deductible. it doesn't make sense for a donation to be tax exempt to the person giving the donation. -bw From isanbard at gmail.com Fri Apr 13 03:57:40 2007 From: isanbard at gmail.com (Bill Wendling) Date: Fri, 13 Apr 2007 03:57:40 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704130857.l3D8veGU020093@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.7 -> 1.8 --- Log message: Fix anchor tags. --- Diffs of the changes: (+5 -5) Name.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.7 llvm-www/Name.html:1.8 --- llvm-www/Name.html:1.7 Thu Apr 12 23:31:20 2007 +++ llvm-www/Name.html Fri Apr 13 03:57:22 2007 @@ -2,10 +2,10 @@

        Name That Compiler!
        @@ -244,6 +244,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
        Last modified: $Date: 2007/04/13 04:31:20 $ +
        Last modified: $Date: 2007/04/13 08:57:22 $ From johannes at apple.com Fri Apr 13 11:36:57 2007 From: johannes at apple.com (johannes at apple.com) Date: Fri, 13 Apr 2007 09:36:57 -0700 (PDT) Subject: [llvm-commits] [126077] Apply FSF patch to make thunks non-comdat Message-ID: <20070413163657.47A42E93BCC5@src> Revision: 126077 Author: johannes Date: 2007-04-13 09:36:56 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Apply FSF patch to make thunks non-comdat Modified Paths: -------------- apple-local/branches/llvm/gcc/cp/method.c Modified: apple-local/branches/llvm/gcc/cp/method.c =================================================================== --- apple-local/branches/llvm/gcc/cp/method.c 2007-04-13 16:25:48 UTC (rev 126076) +++ apple-local/branches/llvm/gcc/cp/method.c 2007-04-13 16:36:56 UTC (rev 126077) @@ -136,8 +136,7 @@ TREE_READONLY (thunk) = TREE_READONLY (function); TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function); TREE_PUBLIC (thunk) = TREE_PUBLIC (function); - if (flag_weak) - comdat_linkage (thunk); + /* APPLE LOCAL mainline do not make thunks comdat */ SET_DECL_THUNK_P (thunk, this_adjusting); THUNK_TARGET (thunk) = function; THUNK_FIXED_OFFSET (thunk) = d; @@ -378,8 +377,10 @@ DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); DECL_VISIBILITY_SPECIFIED (thunk_fndecl) = DECL_VISIBILITY_SPECIFIED (function); - if (flag_weak && TREE_PUBLIC (thunk_fndecl)) - comdat_linkage (thunk_fndecl); + /* APPLE LOCAL begin mainline do not make thunks comdat */ + if (DECL_ONE_ONLY (function)) + make_decl_one_only (thunk_fndecl); + /* APPLE LOCAL end mainline do not make thunks comdat */ if (flag_syntax_only) { From dpatel at apple.com Fri Apr 13 11:49:41 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 13 Apr 2007 11:49:41 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704131649.l3DGnfO4012384@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.8 -> 1.9 --- Log message: Add Oscar. --- Diffs of the changes: (+4 -1) Name.html | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.8 llvm-www/Name.html:1.9 --- llvm-www/Name.html:1.8 Fri Apr 13 03:57:22 2007 +++ llvm-www/Name.html Fri Apr 13 11:49:24 2007 @@ -141,6 +141,9 @@ Material displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already own the domain. Also connotes "illumination". + Jeff Cohen + Oscar + Oscar = Open Source Compiler And Runtime Reid Spencer Alluvium The layers of sediment deposited by a river. Also retains the LLVM @@ -244,6 +247,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
        Last modified: $Date: 2007/04/13 08:57:22 $ +
        Last modified: $Date: 2007/04/13 16:49:24 $ From reid at x10sys.com Fri Apr 13 12:38:23 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 12:38:23 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704131738.l3DHcN0Y014584@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.9 -> 1.10 --- Log message: Add Christopher Lamb's idea. --- Diffs of the changes: (+3 -1) Name.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.9 llvm-www/Name.html:1.10 --- llvm-www/Name.html:1.9 Fri Apr 13 11:49:24 2007 +++ llvm-www/Name.html Fri Apr 13 12:38:05 2007 @@ -237,6 +237,8 @@ Beowulf + Christopher LambTakoaFinnish for 'to hammer' or 'forge'. + takoa.org is unclaimed. The image of a hammer is pretty iconographic. @@ -247,6 +249,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
        Last modified: $Date: 2007/04/13 16:49:24 $ +
        Last modified: $Date: 2007/04/13 17:38:05 $ From djg at cray.com Fri Apr 13 13:12:29 2007 From: djg at cray.com (Dan Gohman) Date: Fri, 13 Apr 2007 13:12:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Argument.h BasicBlock.h Constant.h Constants.h Function.h GlobalValue.h GlobalVariable.h InlineAsm.h Instruction.h Value.h Message-ID: <200704131812.l3DICTsD015576@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Argument.h updated: 1.14 -> 1.15 BasicBlock.h updated: 1.63 -> 1.64 Constant.h updated: 1.35 -> 1.36 Constants.h updated: 1.145 -> 1.146 Function.h updated: 1.73 -> 1.74 GlobalValue.h updated: 1.34 -> 1.35 GlobalVariable.h updated: 1.40 -> 1.41 InlineAsm.h updated: 1.14 -> 1.15 Instruction.h updated: 1.82 -> 1.83 Value.h updated: 1.99 -> 1.100 --- Log message: Rename Value::getValueType to getValueID, to avoid confusion with other things named getValueType. --- Diffs of the changes: (+30 -30) Argument.h | 2 +- BasicBlock.h | 2 +- Constant.h | 4 ++-- Constants.h | 18 +++++++++--------- Function.h | 2 +- GlobalValue.h | 4 ++-- GlobalVariable.h | 2 +- InlineAsm.h | 2 +- Instruction.h | 4 ++-- Value.h | 20 ++++++++++---------- 10 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/include/llvm/Argument.h diff -u llvm/include/llvm/Argument.h:1.14 llvm/include/llvm/Argument.h:1.15 --- llvm/include/llvm/Argument.h:1.14 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/Argument.h Fri Apr 13 13:12:09 2007 @@ -64,7 +64,7 @@ /// static inline bool classof(const Argument *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == ArgumentVal; + return V->getValueID() == ArgumentVal; } }; Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.63 llvm/include/llvm/BasicBlock.h:1.64 --- llvm/include/llvm/BasicBlock.h:1.63 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/BasicBlock.h Fri Apr 13 13:12:09 2007 @@ -158,7 +158,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BasicBlock *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == Value::BasicBlockVal; + return V->getValueID() == Value::BasicBlockVal; } /// dropAllReferences() - This function causes all the subinstructions to "let Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.35 llvm/include/llvm/Constant.h:1.36 --- llvm/include/llvm/Constant.h:1.35 Wed Mar 7 18:59:12 2007 +++ llvm/include/llvm/Constant.h Fri Apr 13 13:12:09 2007 @@ -88,8 +88,8 @@ static inline bool classof(const Constant *) { return true; } static inline bool classof(const GlobalValue *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() >= ConstantFirstVal && - V->getValueType() <= ConstantLastVal; + return V->getValueID() >= ConstantFirstVal && + V->getValueID() <= ConstantLastVal; } /// replaceUsesOfWithOnConstant - This method is a special form of Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.145 llvm/include/llvm/Constants.h:1.146 --- llvm/include/llvm/Constants.h:1.145 Tue Apr 10 01:44:12 2007 +++ llvm/include/llvm/Constants.h Fri Apr 13 13:12:09 2007 @@ -201,7 +201,7 @@ /// @brief Methods to support type inquiry through isa, cast, and dyn_cast. static inline bool classof(const ConstantInt *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantIntVal; + return V->getValueID() == ConstantIntVal; } static void ResetTrueFalse() { TheTrueVal = TheFalseVal = 0; } private: @@ -239,7 +239,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantFP *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantFPVal; + return V->getValueID() == ConstantFPVal; } }; @@ -267,7 +267,7 @@ /// static bool classof(const ConstantAggregateZero *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantAggregateZeroVal; + return V->getValueID() == ConstantAggregateZeroVal; } }; @@ -331,7 +331,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantArray *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantArrayVal; + return V->getValueID() == ConstantArrayVal; } }; @@ -376,7 +376,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantStruct *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantStructVal; + return V->getValueID() == ConstantStructVal; } }; @@ -428,7 +428,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantVector *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantVectorVal; + return V->getValueID() == ConstantVectorVal; } }; @@ -464,7 +464,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantPointerNull *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantPointerNullVal; + return V->getValueID() == ConstantPointerNullVal; } }; @@ -673,7 +673,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantExpr *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == ConstantExprVal; + return V->getValueID() == ConstantExprVal; } }; @@ -704,7 +704,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const UndefValue *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == UndefValueVal; + return V->getValueID() == UndefValueVal; } }; Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.73 llvm/include/llvm/Function.h:1.74 --- llvm/include/llvm/Function.h:1.73 Mon Apr 9 10:01:12 2007 +++ llvm/include/llvm/Function.h Fri Apr 13 13:12:09 2007 @@ -220,7 +220,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Function *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == Value::FunctionVal; + return V->getValueID() == Value::FunctionVal; } /// dropAllReferences() - This method causes all the subinstructions to "let Index: llvm/include/llvm/GlobalValue.h diff -u llvm/include/llvm/GlobalValue.h:1.34 llvm/include/llvm/GlobalValue.h:1.35 --- llvm/include/llvm/GlobalValue.h:1.34 Sun Feb 25 15:06:13 2007 +++ llvm/include/llvm/GlobalValue.h Fri Apr 13 13:12:09 2007 @@ -133,8 +133,8 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GlobalValue *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == Value::FunctionVal || - V->getValueType() == Value::GlobalVariableVal; + return V->getValueID() == Value::FunctionVal || + V->getValueID() == Value::GlobalVariableVal; } }; Index: llvm/include/llvm/GlobalVariable.h diff -u llvm/include/llvm/GlobalVariable.h:1.40 llvm/include/llvm/GlobalVariable.h:1.41 --- llvm/include/llvm/GlobalVariable.h:1.40 Thu Apr 12 13:32:50 2007 +++ llvm/include/llvm/GlobalVariable.h Fri Apr 13 13:12:09 2007 @@ -132,7 +132,7 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GlobalVariable *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == Value::GlobalVariableVal; + return V->getValueID() == Value::GlobalVariableVal; } }; Index: llvm/include/llvm/InlineAsm.h diff -u llvm/include/llvm/InlineAsm.h:1.14 llvm/include/llvm/InlineAsm.h:1.15 --- llvm/include/llvm/InlineAsm.h:1.14 Sat Dec 16 23:15:12 2006 +++ llvm/include/llvm/InlineAsm.h Fri Apr 13 13:12:09 2007 @@ -124,7 +124,7 @@ // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const InlineAsm *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() == Value::InlineAsmVal; + return V->getValueID() == Value::InlineAsmVal; } }; Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.82 llvm/include/llvm/Instruction.h:1.83 --- llvm/include/llvm/Instruction.h:1.82 Fri Feb 23 18:55:48 2007 +++ llvm/include/llvm/Instruction.h Fri Apr 13 13:12:09 2007 @@ -110,7 +110,7 @@ /// Subclass classification... getOpcode() returns a member of /// one of the enums that is coming soon (down below)... /// - unsigned getOpcode() const { return getValueType() - InstructionVal; } + unsigned getOpcode() const { return getValueID() - InstructionVal; } const char *getOpcodeName() const { return getOpcodeName(getOpcode()); } @@ -193,7 +193,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Instruction *) { return true; } static inline bool classof(const Value *V) { - return V->getValueType() >= Value::InstructionVal; + return V->getValueID() >= Value::InstructionVal; } //---------------------------------------------------------------------- Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.99 llvm/include/llvm/Value.h:1.100 --- llvm/include/llvm/Value.h:1.99 Mon Mar 5 17:06:32 2007 +++ llvm/include/llvm/Value.h Fri Apr 13 13:12:09 2007 @@ -178,7 +178,7 @@ ConstantLastVal = ConstantPointerNullVal }; - /// getValueType - Return an ID for the concrete type of this object. This is + /// getValueID - Return an ID for the concrete type of this object. This is /// used to implement the classof checks. This should not be used for any /// other purpose, as the values may change as LLVM evolves. Also, note that /// for instructions, the Instruction's opcode is added to InstructionVal. So @@ -187,7 +187,7 @@ /// # there are more possible values for the value type than in ValueTy enum. /// # the InstructionVal enumerator must be the highest valued enumerator in /// the ValueTy enum. - unsigned getValueType() const { + unsigned getValueID() const { return SubclassID; } @@ -227,26 +227,26 @@ // the subtype header files to test to see if the value is a subclass... // template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() >= Value::ConstantFirstVal && - Val.getValueType() <= Value::ConstantLastVal; + return Val.getValueID() >= Value::ConstantFirstVal && + Val.getValueID() <= Value::ConstantLastVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::ArgumentVal; + return Val.getValueID() == Value::ArgumentVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::InlineAsmVal; + return Val.getValueID() == Value::InlineAsmVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() >= Value::InstructionVal; + return Val.getValueID() >= Value::InstructionVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::BasicBlockVal; + return Val.getValueID() == Value::BasicBlockVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::FunctionVal; + return Val.getValueID() == Value::FunctionVal; } template <> inline bool isa_impl(const Value &Val) { - return Val.getValueType() == Value::GlobalVariableVal; + return Val.getValueID() == Value::GlobalVariableVal; } template <> inline bool isa_impl(const Value &Val) { return isa(Val) || isa(Val); From djg at cray.com Fri Apr 13 13:12:30 2007 From: djg at cray.com (Dan Gohman) Date: Fri, 13 Apr 2007 13:12:30 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h Message-ID: <200704131812.l3DICU9g015581@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: PatternMatch.h updated: 1.19 -> 1.20 --- Log message: Rename Value::getValueType to getValueID, to avoid confusion with other things named getValueType. --- Diffs of the changes: (+3 -3) PatternMatch.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Support/PatternMatch.h diff -u llvm/include/llvm/Support/PatternMatch.h:1.19 llvm/include/llvm/Support/PatternMatch.h:1.20 --- llvm/include/llvm/Support/PatternMatch.h:1.19 Mon Feb 12 18:37:50 2007 +++ llvm/include/llvm/Support/PatternMatch.h Fri Apr 13 13:12:09 2007 @@ -81,7 +81,7 @@ template bool match(OpTy *V) { - if (V->getValueType() == Value::InstructionVal + Opcode) { + if (V->getValueID() == Value::InstructionVal + Opcode) { ConcreteTy *I = cast(V); return I->getOpcode() == Opcode && L.match(I->getOperand(0)) && R.match(I->getOperand(1)); @@ -195,8 +195,8 @@ template bool match(OpTy *V) { - if (V->getValueType() == Value::InstructionVal + Instruction::LShr || - V->getValueType() == Value::InstructionVal + Instruction::AShr) { + if (V->getValueID() == Value::InstructionVal + Instruction::LShr || + V->getValueID() == Value::InstructionVal + Instruction::AShr) { ConcreteTy *I = cast(V); return (I->getOpcode() == Instruction::AShr || I->getOpcode() == Instruction::LShr) && From dpatel at apple.com Fri Apr 13 13:28:41 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 13 Apr 2007 13:28:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile Message-ID: <200704131828.l3DISfLp016129@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.7 -> 1.8 --- Log message: Hello uses LLVMSupport.a (SlowerOperationInformer) --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.7 llvm/lib/Transforms/Hello/Makefile:1.8 --- llvm/lib/Transforms/Hello/Makefile:1.7 Mon Apr 9 14:17:47 2007 +++ llvm/lib/Transforms/Hello/Makefile Fri Apr 13 13:28:23 2007 @@ -10,7 +10,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMHello LOADABLE_MODULE = 1 -USEDLIBS = +USEDLIBS = LLVMSupport.a include $(LEVEL)/Makefile.common From dpatel at apple.com Fri Apr 13 13:35:32 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 13 Apr 2007 13:35:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile Message-ID: <200704131835.l3DIZWJu016274@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.8 -> 1.9 --- Log message: Undo previous check-in. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.8 llvm/lib/Transforms/Hello/Makefile:1.9 --- llvm/lib/Transforms/Hello/Makefile:1.8 Fri Apr 13 13:28:23 2007 +++ llvm/lib/Transforms/Hello/Makefile Fri Apr 13 13:35:15 2007 @@ -10,7 +10,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMHello LOADABLE_MODULE = 1 -USEDLIBS = LLVMSupport.a +USEDLIBS = include $(LEVEL)/Makefile.common From dpatel at apple.com Fri Apr 13 13:58:35 2007 From: dpatel at apple.com (Devang Patel) Date: Fri, 13 Apr 2007 13:58:35 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp Message-ID: <200704131858.l3DIwZKw016628@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.13 -> 1.14 --- Log message: Remove use of SlowOperationInformer. --- Diffs of the changes: (+0 -3) Hello.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.13 llvm/lib/Transforms/Hello/Hello.cpp:1.14 --- llvm/lib/Transforms/Hello/Hello.cpp:1.13 Tue Dec 19 16:24:09 2006 +++ llvm/lib/Transforms/Hello/Hello.cpp Fri Apr 13 13:58:18 2007 @@ -16,7 +16,6 @@ #include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Support/SlowOperationInformer.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" using namespace llvm; @@ -27,7 +26,6 @@ // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { virtual bool runOnFunction(Function &F) { - SlowOperationInformer soi("EscapeString"); HelloCounter++; std::string fname = F.getName(); EscapeString(fname); @@ -40,7 +38,6 @@ // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { virtual bool runOnFunction(Function &F) { - SlowOperationInformer soi("EscapeString"); HelloCounter++; std::string fname = F.getName(); EscapeString(fname); From reid at x10sys.com Fri Apr 13 14:19:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 14:19:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200704131919.l3DJJOwn017079@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.76 -> 1.77 --- Log message: Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. --- Diffs of the changes: (+37 -0) APInt.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.76 llvm/lib/Support/APInt.cpp:1.77 --- llvm/lib/Support/APInt.cpp:1.76 Wed Apr 11 08:00:04 2007 +++ llvm/lib/Support/APInt.cpp Fri Apr 13 14:19:07 2007 @@ -659,6 +659,43 @@ return *this; } +uint32_t APInt::getBitsNeeded(const char* str, uint32_t slen, uint8_t radix) { + assert(str != 0 && "Invalid value string"); + assert(slen > 0 && "Invalid string length"); + + // Each computation below needs to know if its negative + uint32_t isNegative = str[0] == '-'; + if (isNegative) { + slen--; + str++; + } + // For radixes of power-of-two values, the bits required is accurately and + // easily computed + if (radix == 2) + return slen + isNegative; + if (radix == 8) + return slen * 3 + isNegative; + if (radix == 16) + return slen * 4 + isNegative; + + // Otherwise it must be radix == 10, the hard case + assert(radix == 10 && "Invalid radix"); + + // This is grossly inefficient but accurate. We could probably do something + // with a computation of roughly slen*64/20 and then adjust by the value of + // the first few digits. But, I'm not sure how accurate that could be. + + // Compute a sufficient number of bits that is always large enough but might + // be too large. This avoids the assertion in the constructor. + uint32_t sufficient = slen*64/18; + + // Convert to the actual binary value. + APInt tmp(sufficient, str, slen, radix); + + // Compute how many bits are required. + return isNegative + tmp.logBase2(); +} + uint64_t APInt::getHashValue() const { // Put the bit width into the low order bits. uint64_t hash = BitWidth; From reid at x10sys.com Fri Apr 13 14:19:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 14:19:27 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200704131919.l3DJJRS3017084@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.65 -> 1.66 --- Log message: Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. --- Diffs of the changes: (+6 -0) APInt.h | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.65 llvm/include/llvm/ADT/APInt.h:1.66 --- llvm/include/llvm/ADT/APInt.h:1.65 Tue Apr 10 11:33:06 2007 +++ llvm/include/llvm/ADT/APInt.h Fri Apr 13 14:19:07 2007 @@ -840,6 +840,12 @@ assert(getActiveBits() <= 64 && "Too many bits for int64_t"); return int64_t(pVal[0]); } + + /// This method determines how many bits are required to hold the APInt + /// equivalent of the string given by \p str of length \p slen. + /// @brief Get bits required for string value. + static uint32_t getBitsNeeded(const char* str, uint32_t slen, uint8_t radix); + /// countLeadingZeros - This function is an APInt version of the /// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number /// of zeros from the most significant bit to the first one bit. From sabre at nondot.org Fri Apr 13 15:00:19 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:00:19 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132000.l3DK0Jjc017794@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.102 -> 1.103 --- Log message: add Alex --- Diffs of the changes: (+5 -5) DevMtgMay2007.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.102 llvm-www/DevMtgMay2007.html:1.103 --- llvm-www/DevMtgMay2007.html:1.102 Fri Apr 13 00:43:15 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:00:01 2007 @@ -35,9 +35,8 @@ - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
    -
    - - Yes, this is the actual room
    +
    + Yes, this is the actual room. @@ -322,6 +321,7 @@ Jeff PoznanovicCray Inc. Ron PriceApple Inc. Chuck RoseAdobe Systems Incorporated. + Alex RosenbergSony Mark SchimmelWind River Reid SpencerIndependent Mark ThomasAerospace @@ -332,7 +332,7 @@ -

    Total confirmed: 34

    +

    Total confirmed: 35

    @@ -351,6 +351,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 05:43:15 $ +
    Last modified: $Date: 2007/04/13 20:00:01 $ From sabre at nondot.org Fri Apr 13 15:02:05 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:02:05 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132002.l3DK25NO017880@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.103 -> 1.104 --- Log message: move the image --- Diffs of the changes: (+3 -1) DevMtgMay2007.html | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.103 llvm-www/DevMtgMay2007.html:1.104 --- llvm-www/DevMtgMay2007.html:1.103 Fri Apr 13 15:00:01 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:01:47 2007 @@ -35,8 +35,10 @@ - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple +

    Yes, this is the actual room. +
    Unconfirmed Attendees
    NameOrganization
    @@ -351,6 +353,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 20:00:01 $ +
    Last modified: $Date: 2007/04/13 20:01:47 $ From sabre at nondot.org Fri Apr 13 15:02:53 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:02:53 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132002.l3DK2rBS017940@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.104 -> 1.105 --- Log message: slightly better formatting --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.104 llvm-www/DevMtgMay2007.html:1.105 --- llvm-www/DevMtgMay2007.html:1.104 Fri Apr 13 15:01:47 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:02:35 2007 @@ -33,7 +33,7 @@
  • When: May 25, 2007, 8:00am to 6:00pm
  • Where: Cupertino Inn - 10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple
  • + href="http://maps.google.com/maps?f=q&hl=en&q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014&sll=37.0625,-95.677068&sspn=48.106236,62.050781&layer=&ie=UTF8&z=16&om=1&iwloc=addr">10889 N De Anza Blvd, Cupertino, CA, 95014
    - across the street from Apple

    @@ -353,6 +353,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 20:01:47 $ +
    Last modified: $Date: 2007/04/13 20:02:35 $ From sabre at nondot.org Fri Apr 13 15:03:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:03:52 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132003.l3DK3qPR018001@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.105 -> 1.106 --- Log message: who loves tables? --- Diffs of the changes: (+2 -2) DevMtgMay2007.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.105 llvm-www/DevMtgMay2007.html:1.106 --- llvm-www/DevMtgMay2007.html:1.105 Fri Apr 13 15:02:35 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:03:35 2007 @@ -1,7 +1,7 @@
    May 25, 2007
    LLVM Developers' Meeting
    -
    +
    1. Important Notes
    2. Agenda @@ -353,6 +353,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
      Last modified: $Date: 2007/04/13 20:02:35 $ +
      Last modified: $Date: 2007/04/13 20:03:35 $ From rspencer at reidspencer.com Fri Apr 13 15:21:07 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Fri, 13 Apr 2007 13:21:07 -0700 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html In-Reply-To: <200704132000.l3DK0Jjc017794@zion.cs.uiuc.edu> References: <200704132000.l3DK0Jjc017794@zion.cs.uiuc.edu> Message-ID: <1176495667.23191.238.camel@bashful.x10sys.com> Chris, On Fri, 2007-04-13 at 15:00 -0500, Chris Lattner wrote: > > Changes in directory llvm-www: > > DevMtgMay2007.html updated: 1.102 -> 1.103 > --- > Log message: > > add Alex > -
      > - > - Yes, this is the actual room
      > +
      That's a validation error. Please close your elements. SHould be
      > + Yes, this is the actual room. >
    > > > @@ -322,6 +321,7 @@ > Jeff PoznanovicCray Inc. > Ron PriceApple Inc. > Chuck RoseAdobe Systems Incorporated. > + Alex RosenbergSony > Mark SchimmelWind River > Reid SpencerIndependent > Mark ThomasAerospace > @@ -332,7 +332,7 @@ > > > > -

    Total confirmed: 34

    > +

    Total confirmed: 35

    > > > > @@ -351,6 +351,6 @@ > src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> > src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> > -
    Last modified: $Date: 2007/04/13 05:43:15 $ > +
    Last modified: $Date: 2007/04/13 20:00:01 $ > > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Fri Apr 13 15:28:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:28:26 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/isel-sink.ll Message-ID: <200704132028.l3DKSQBh018551@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: isel-sink.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+17 -0) isel-sink.ll | 17 +++++++++++++++++ 1 files changed, 17 insertions(+) Index: llvm/test/CodeGen/X86/isel-sink.ll diff -c /dev/null llvm/test/CodeGen/X86/isel-sink.ll:1.1 *** /dev/null Fri Apr 13 15:28:19 2007 --- llvm/test/CodeGen/X86/isel-sink.ll Fri Apr 13 15:28:08 2007 *************** *** 0 **** --- 1,17 ---- + ; RUN: llvm-as < %s | llc -march=x86 | not grep lea && + ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-apple-darwin8 | grep 'movl $4, (%ecx,%eax,4)' + + define i32 @test(i32* %X, i32 %B) { + ; This gep should be sunk out of this block into the load/store users. + %P = getelementptr i32* %X, i32 %B + %G = icmp ult i32 %B, 1234 + br i1 %G, label %T, label %F + T: + store i32 4, i32* %P + ret i32 141 + F: + %V = load i32* %P + ret i32 %V + } + + From sabre at nondot.org Fri Apr 13 15:31:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:31:13 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200704132031.l3DKVDuU018606@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: CodeGenPrepare.cpp updated: 1.3 -> 1.4 --- Log message: Completely rewrite addressing-mode related sinking of code. In particular, this fixes problems where codegenprepare would sink expressions into load/stores that are not valid, and fixes cases where it would miss important valid ones. This fixes several serious codesize and perf issues, particularly on targets with complex addressing modes like arm and x86. For example, now we compile CodeGen/X86/isel-sink.ll to: _test: movl 8(%esp), %eax movl 4(%esp), %ecx cmpl $1233, %eax ja LBB1_2 #F LBB1_1: #T movl $4, (%ecx,%eax,4) movl $141, %eax ret LBB1_2: #F movl (%ecx,%eax,4), %eax ret instead of: _test: movl 8(%esp), %eax leal (,%eax,4), %ecx addl 4(%esp), %ecx cmpl $1233, %eax ja LBB1_2 #F LBB1_1: #T movl $4, (%ecx) movl $141, %eax ret LBB1_2: #F movl (%ecx), %eax ret --- Diffs of the changes: (+543 -342) CodeGenPrepare.cpp | 885 ++++++++++++++++++++++++++++++++--------------------- 1 files changed, 543 insertions(+), 342 deletions(-) Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3 Mon Apr 9 18:29:07 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Apr 13 15:30:56 2007 @@ -25,9 +25,12 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include "llvm/Transforms/Utils/Local.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallSet.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/GetElementPtrTypeIterator.h" using namespace llvm; namespace { @@ -44,7 +47,9 @@ bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const; void EliminateMostlyEmptyBlock(BasicBlock *BB); bool OptimizeBlock(BasicBlock &BB); - bool OptimizeGEPExpression(GetElementPtrInst *GEPI); + bool OptimizeLoadStoreInst(Instruction *I, Value *Addr, + const Type *AccessTy, + DenseMap &SunkAddrs); }; } static RegisterPass X("codegenprepare", @@ -291,312 +296,37 @@ SplitCriticalEdge(TI, SuccNum, P, true); } - -/// InsertGEPComputeCode - Insert code into BB to compute Ptr+PtrOffset, -/// casting to the type of GEPI. -static Instruction *InsertGEPComputeCode(Instruction *&V, BasicBlock *BB, - Instruction *GEPI, Value *Ptr, - Value *PtrOffset) { - if (V) return V; // Already computed. - - // Figure out the insertion point - BasicBlock::iterator InsertPt; - if (BB == GEPI->getParent()) { - // If GEP is already inserted into BB, insert right after the GEP. - InsertPt = GEPI; - ++InsertPt; - } else { - // Otherwise, insert at the top of BB, after any PHI nodes - InsertPt = BB->begin(); - while (isa(InsertPt)) ++InsertPt; - } - - // If Ptr is itself a cast, but in some other BB, emit a copy of the cast into - // BB so that there is only one value live across basic blocks (the cast - // operand). - if (CastInst *CI = dyn_cast(Ptr)) - if (CI->getParent() != BB && isa(CI->getOperand(0)->getType())) - Ptr = CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(), - "", InsertPt); - - // Add the offset, cast it to the right type. - Ptr = BinaryOperator::createAdd(Ptr, PtrOffset, "", InsertPt); - // Ptr is an integer type, GEPI is pointer type ==> IntToPtr - return V = CastInst::create(Instruction::IntToPtr, Ptr, GEPI->getType(), - "", InsertPt); -} - -/// ReplaceUsesOfGEPInst - Replace all uses of RepPtr with inserted code to -/// compute its value. The RepPtr value can be computed with Ptr+PtrOffset. One -/// trivial way of doing this would be to evaluate Ptr+PtrOffset in RepPtr's -/// block, then ReplaceAllUsesWith'ing everything. However, we would prefer to -/// sink PtrOffset into user blocks where doing so will likely allow us to fold -/// the constant add into a load or store instruction. Additionally, if a user -/// is a pointer-pointer cast, we look through it to find its users. -static void ReplaceUsesOfGEPInst(Instruction *RepPtr, Value *Ptr, - Constant *PtrOffset, BasicBlock *DefBB, - GetElementPtrInst *GEPI, - std::map &InsertedExprs) { - while (!RepPtr->use_empty()) { - Instruction *User = cast(RepPtr->use_back()); - - // If the user is a Pointer-Pointer cast, recurse. Only BitCast can be - // used for a Pointer-Pointer cast. - if (isa(User)) { - ReplaceUsesOfGEPInst(User, Ptr, PtrOffset, DefBB, GEPI, InsertedExprs); - - // Drop the use of RepPtr. The cast is dead. Don't delete it now, else we - // could invalidate an iterator. - User->setOperand(0, UndefValue::get(RepPtr->getType())); - continue; - } - - // If this is a load of the pointer, or a store through the pointer, emit - // the increment into the load/store block. - Instruction *NewVal; - if (isa(User) || - (isa(User) && User->getOperand(0) != RepPtr)) { - NewVal = InsertGEPComputeCode(InsertedExprs[User->getParent()], - User->getParent(), GEPI, - Ptr, PtrOffset); - } else { - // If this use is not foldable into the addressing mode, use a version - // emitted in the GEP block. - NewVal = InsertGEPComputeCode(InsertedExprs[DefBB], DefBB, GEPI, - Ptr, PtrOffset); - } - - if (GEPI->getType() != RepPtr->getType()) { - BasicBlock::iterator IP = NewVal; - ++IP; - // NewVal must be a GEP which must be pointer type, so BitCast - NewVal = new BitCastInst(NewVal, RepPtr->getType(), "", IP); - } - User->replaceUsesOfWith(RepPtr, NewVal); - } -} - -/// OptimizeGEPExpression - Since we are doing basic-block-at-a-time instruction -/// selection, we want to be a bit careful about some things. In particular, if -/// we have a GEP instruction that is used in a different block than it is -/// defined, the addressing expression of the GEP cannot be folded into loads or -/// stores that use it. In this case, decompose the GEP and move constant -/// indices into blocks that use it. -bool CodeGenPrepare::OptimizeGEPExpression(GetElementPtrInst *GEPI) { - // If this GEP is only used inside the block it is defined in, there is no - // need to rewrite it. - bool isUsedOutsideDefBB = false; - BasicBlock *DefBB = GEPI->getParent(); - for (Value::use_iterator UI = GEPI->use_begin(), E = GEPI->use_end(); - UI != E; ++UI) { - if (cast(*UI)->getParent() != DefBB) { - isUsedOutsideDefBB = true; - break; - } - } - if (!isUsedOutsideDefBB) return false; - - // If this GEP has no non-zero constant indices, there is nothing we can do, - // ignore it. - bool hasConstantIndex = false; - bool hasVariableIndex = false; - for (GetElementPtrInst::op_iterator OI = GEPI->op_begin()+1, - E = GEPI->op_end(); OI != E; ++OI) { - if (ConstantInt *CI = dyn_cast(*OI)) { - if (!CI->isZero()) { - hasConstantIndex = true; - break; - } - } else { - hasVariableIndex = true; - } - } - - // If this is a "GEP X, 0, 0, 0", turn this into a cast. - if (!hasConstantIndex && !hasVariableIndex) { - /// The GEP operand must be a pointer, so must its result -> BitCast - Value *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), - GEPI->getName(), GEPI); - GEPI->replaceAllUsesWith(NC); - GEPI->eraseFromParent(); - return true; - } +/// OptimizeNoopCopyExpression - If the specified cast instruction is a noop +/// copy (e.g. it's casting from one pointer type to another, int->uint, or +/// int->sbyte on PPC), sink it into user blocks to reduce the number of virtual +/// registers that must be created and coallesced. +/// +/// Return true if any changes are made. +static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){ + // If this is a noop copy, + MVT::ValueType SrcVT = TLI.getValueType(CI->getOperand(0)->getType()); + MVT::ValueType DstVT = TLI.getValueType(CI->getType()); - // If this is a GEP &Alloca, 0, 0, forward subst the frame index into uses. - if (!hasConstantIndex && !isa(GEPI->getOperand(0))) + // This is an fp<->int conversion? + if (MVT::isInteger(SrcVT) != MVT::isInteger(DstVT)) return false; - - // If we don't have target lowering info, we can't lower the GEP. - if (!TLI) return false; - const TargetData *TD = TLI->getTargetData(); - - // Otherwise, decompose the GEP instruction into multiplies and adds. Sum the - // constant offset (which we now know is non-zero) and deal with it later. - uint64_t ConstantOffset = 0; - const Type *UIntPtrTy = TD->getIntPtrType(); - Value *Ptr = new PtrToIntInst(GEPI->getOperand(0), UIntPtrTy, "", GEPI); - const Type *Ty = GEPI->getOperand(0)->getType(); - - for (GetElementPtrInst::op_iterator OI = GEPI->op_begin()+1, - E = GEPI->op_end(); OI != E; ++OI) { - Value *Idx = *OI; - if (const StructType *StTy = dyn_cast(Ty)) { - unsigned Field = cast(Idx)->getZExtValue(); - if (Field) - ConstantOffset += TD->getStructLayout(StTy)->getElementOffset(Field); - Ty = StTy->getElementType(Field); - } else { - Ty = cast(Ty)->getElementType(); - - // Handle constant subscripts. - if (ConstantInt *CI = dyn_cast(Idx)) { - if (CI->getZExtValue() == 0) continue; - ConstantOffset += (int64_t)TD->getTypeSize(Ty)*CI->getSExtValue(); - continue; - } - - // Ptr = Ptr + Idx * ElementSize; - - // Cast Idx to UIntPtrTy if needed. - Idx = CastInst::createIntegerCast(Idx, UIntPtrTy, true/*SExt*/, "", GEPI); - - uint64_t ElementSize = TD->getTypeSize(Ty); - // Mask off bits that should not be set. - ElementSize &= ~0ULL >> (64-UIntPtrTy->getPrimitiveSizeInBits()); - Constant *SizeCst = ConstantInt::get(UIntPtrTy, ElementSize); - - // Multiply by the element size and add to the base. - Idx = BinaryOperator::createMul(Idx, SizeCst, "", GEPI); - Ptr = BinaryOperator::createAdd(Ptr, Idx, "", GEPI); - } - } - // Make sure that the offset fits in uintptr_t. - ConstantOffset &= ~0ULL >> (64-UIntPtrTy->getPrimitiveSizeInBits()); - Constant *PtrOffset = ConstantInt::get(UIntPtrTy, ConstantOffset); - - // Okay, we have now emitted all of the variable index parts to the BB that - // the GEP is defined in. Loop over all of the using instructions, inserting - // an "add Ptr, ConstantOffset" into each block that uses it and update the - // instruction to use the newly computed value, making GEPI dead. When the - // user is a load or store instruction address, we emit the add into the user - // block, otherwise we use a canonical version right next to the gep (these - // won't be foldable as addresses, so we might as well share the computation). + // If this is an extension, it will be a zero or sign extension, which + // isn't a noop. + if (SrcVT < DstVT) return false; + + // If these values will be promoted, find out what they will be promoted + // to. This helps us consider truncates on PPC as noop copies when they + // are. + if (TLI.getTypeAction(SrcVT) == TargetLowering::Promote) + SrcVT = TLI.getTypeToTransformTo(SrcVT); + if (TLI.getTypeAction(DstVT) == TargetLowering::Promote) + DstVT = TLI.getTypeToTransformTo(DstVT); - std::map InsertedExprs; - ReplaceUsesOfGEPInst(GEPI, Ptr, PtrOffset, DefBB, GEPI, InsertedExprs); - - // Finally, the GEP is dead, remove it. - GEPI->eraseFromParent(); - - return true; -} - -/// SinkInvariantGEPIndex - If a GEP instruction has a variable index that has -/// been hoisted out of the loop by LICM pass, sink it back into the use BB -/// if it can be determined that the index computation can be folded into the -/// addressing mode of the load / store uses. -static bool SinkInvariantGEPIndex(BinaryOperator *BinOp, - const TargetLowering &TLI) { - // Only look at Add. - if (BinOp->getOpcode() != Instruction::Add) - return false; - - // DestBBs - These are the blocks where a copy of BinOp will be inserted. - SmallSet DestBBs; - BasicBlock *DefBB = BinOp->getParent(); - bool MadeChange = false; - for (Value::use_iterator UI = BinOp->use_begin(), E = BinOp->use_end(); - UI != E; ++UI) { - Instruction *GEPI = cast(*UI); - // Only look for GEP use in another block. - if (GEPI->getParent() == DefBB) continue; - - if (isa(GEPI)) { - // If the GEP has another variable index, abondon. - bool hasVariableIndex = false; - for (GetElementPtrInst::op_iterator OI = GEPI->op_begin()+1, - OE = GEPI->op_end(); OI != OE; ++OI) - if (*OI != BinOp && !isa(*OI)) { - hasVariableIndex = true; - break; - } - if (hasVariableIndex) - break; - - BasicBlock *GEPIBB = GEPI->getParent(); - for (Value::use_iterator UUI = GEPI->use_begin(), UE = GEPI->use_end(); - UUI != UE; ++UUI) { - Instruction *GEPIUser = cast(*UUI); - const Type *UseTy = NULL; - if (LoadInst *Load = dyn_cast(GEPIUser)) - UseTy = Load->getType(); - else if (StoreInst *Store = dyn_cast(GEPIUser)) - UseTy = Store->getOperand(0)->getType(); - - // Check if it is possible to fold the expression to address mode. - if (UseTy && isa(BinOp->getOperand(1))) { - int64_t Cst = cast(BinOp->getOperand(1))->getSExtValue(); - // e.g. load (gep i32 * %P, (X+42)) => load (%P + X*4 + 168). - TargetLowering::AddrMode AM; - // FIXME: This computation isn't right, scale is incorrect. - AM.Scale = TLI.getTargetData()->getTypeSize(UseTy); - // FIXME: Should should also include other fixed offsets. - AM.BaseOffs = Cst*AM.Scale; - - if (TLI.isLegalAddressingMode(AM, UseTy)) { - DestBBs.insert(GEPIBB); - MadeChange = true; - break; - } - } - } - } - } - - // Nothing to do. - if (!MadeChange) + // If, after promotion, these are the same types, this is a noop copy. + if (SrcVT != DstVT) return false; - - /// InsertedOps - Only insert a duplicate in each block once. - std::map InsertedOps; - for (Value::use_iterator UI = BinOp->use_begin(), E = BinOp->use_end(); - UI != E; ) { - Instruction *User = cast(*UI); - BasicBlock *UserBB = User->getParent(); - - // Preincrement use iterator so we don't invalidate it. - ++UI; - - // If any user in this BB wants it, replace all the uses in the BB. - if (DestBBs.count(UserBB)) { - // Sink it into user block. - BinaryOperator *&InsertedOp = InsertedOps[UserBB]; - if (!InsertedOp) { - BasicBlock::iterator InsertPt = UserBB->begin(); - while (isa(InsertPt)) ++InsertPt; - - InsertedOp = - BinaryOperator::create(BinOp->getOpcode(), BinOp->getOperand(0), - BinOp->getOperand(1), "", InsertPt); - } - - User->replaceUsesOfWith(BinOp, InsertedOp); - } - } - - if (BinOp->use_empty()) - BinOp->eraseFromParent(); - - return true; -} - -/// OptimizeNoopCopyExpression - We have determined that the specified cast -/// instruction is a noop copy (e.g. it's casting from one pointer type to -/// another, int->uint, or int->sbyte on PPC. -/// -/// Return true if any changes are made. -static bool OptimizeNoopCopyExpression(CastInst *CI) { + BasicBlock *DefBB = CI->getParent(); /// InsertedCasts - Only insert a cast in each block once. @@ -646,7 +376,468 @@ return MadeChange; } +/// EraseDeadInstructions - Erase any dead instructions +static void EraseDeadInstructions(Value *V) { + Instruction *I = dyn_cast(V); + if (!I || !I->use_empty()) return; + + SmallPtrSet Insts; + Insts.insert(I); + + while (!Insts.empty()) { + I = *Insts.begin(); + Insts.erase(I); + if (isInstructionTriviallyDead(I)) { + for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) + if (Instruction *U = dyn_cast(I->getOperand(i))) + Insts.insert(U); + I->eraseFromParent(); + } + } +} + +/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode which +/// holds actual Value*'s for register values. +struct ExtAddrMode : public TargetLowering::AddrMode { + Value *BaseReg; + Value *ScaledReg; + ExtAddrMode() : BaseReg(0), ScaledReg(0) {} + void dump() const; +}; + +static std::ostream &operator<<(std::ostream &OS, const ExtAddrMode &AM) { + bool NeedPlus = false; + OS << "["; + if (AM.BaseGV) + OS << (NeedPlus ? " + " : "") + << "GV:%" << AM.BaseGV->getName(), NeedPlus = true; + + if (AM.BaseOffs) + OS << (NeedPlus ? " + " : "") << AM.BaseOffs, NeedPlus = true; + + if (AM.BaseReg) + OS << (NeedPlus ? " + " : "") + << "Base:%" << AM.BaseReg->getName(), NeedPlus = true; + if (AM.Scale) + OS << (NeedPlus ? " + " : "") + << AM.Scale << "*%" << AM.ScaledReg->getName(), NeedPlus = true; + + return OS << "]"; +} + +void ExtAddrMode::dump() const { + cerr << *this << "\n"; +} + +static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale, + const Type *AccessTy, ExtAddrMode &AddrMode, + SmallVector &AddrModeInsts, + const TargetLowering &TLI, unsigned Depth); + +/// FindMaximalLegalAddressingMode - If we can, try to merge the computation of +/// Addr into the specified addressing mode. If Addr can't be added to AddrMode +/// this returns false. This assumes that Addr is either a pointer type or +/// intptr_t for the target. +static bool FindMaximalLegalAddressingMode(Value *Addr, const Type *AccessTy, + ExtAddrMode &AddrMode, + SmallVector &AddrModeInsts, + const TargetLowering &TLI, + unsigned Depth) { + + // If this is a global variable, fold it into the addressing mode if possible. + if (GlobalValue *GV = dyn_cast(Addr)) { + if (AddrMode.BaseGV == 0) { + AddrMode.BaseGV = GV; + if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) + return true; + AddrMode.BaseGV = 0; + } + } else if (ConstantInt *CI = dyn_cast(Addr)) { + AddrMode.BaseOffs += CI->getSExtValue(); + if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) + return true; + AddrMode.BaseOffs -= CI->getSExtValue(); + } else if (isa(Addr)) { + return true; + } + + // Look through constant exprs and instructions. + unsigned Opcode = ~0U; + User *AddrInst = 0; + if (Instruction *I = dyn_cast(Addr)) { + Opcode = I->getOpcode(); + AddrInst = I; + } else if (ConstantExpr *CE = dyn_cast(Addr)) { + Opcode = CE->getOpcode(); + AddrInst = CE; + } + + // Limit recursion to avoid exponential behavior. + if (Depth == 5) { AddrInst = 0; Opcode = ~0U; } + + // If this is really an instruction, add it to our list of related + // instructions. + if (Instruction *I = dyn_cast_or_null(AddrInst)) + AddrModeInsts.push_back(I); + + switch (Opcode) { + case Instruction::PtrToInt: + // PtrToInt is always a noop, as we know that the int type is pointer sized. + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth)) + return true; + break; + case Instruction::IntToPtr: + // This inttoptr is a no-op if the integer type is pointer sized. + if (TLI.getValueType(AddrInst->getOperand(0)->getType()) == + TLI.getPointerTy()) { + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth)) + return true; + } + break; + case Instruction::Add: { + // Check to see if we can merge in the RHS then the LHS. If so, we win. + ExtAddrMode BackupAddrMode = AddrMode; + unsigned OldSize = AddrModeInsts.size(); + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(1), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth+1) && + FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth+1)) + return true; + + // Restore the old addr mode info. + AddrMode = BackupAddrMode; + AddrModeInsts.resize(OldSize); + + // Otherwise this was over-aggressive. Try merging in the LHS then the RHS. + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth+1) && + FindMaximalLegalAddressingMode(AddrInst->getOperand(1), AccessTy, + AddrMode, AddrModeInsts, TLI, Depth+1)) + return true; + + // Otherwise we definitely can't merge the ADD in. + AddrMode = BackupAddrMode; + AddrModeInsts.resize(OldSize); + break; + } + case Instruction::Or: { + ConstantInt *RHS = dyn_cast(AddrInst->getOperand(1)); + if (!RHS) break; + // TODO: We can handle "Or Val, Imm" iff this OR is equivalent to an ADD. + break; + } + case Instruction::Mul: + case Instruction::Shl: { + // Can only handle X*C and X << C, and can only handle this when the scale + // field is available. + ConstantInt *RHS = dyn_cast(AddrInst->getOperand(1)); + if (!RHS) break; + int64_t Scale = RHS->getSExtValue(); + if (Opcode == Instruction::Shl) + Scale = 1 << Scale; + + if (TryMatchingScaledValue(AddrInst->getOperand(0), Scale, AccessTy, + AddrMode, AddrModeInsts, TLI, Depth)) + return true; + break; + } + case Instruction::GetElementPtr: { + // Scan the GEP. We check it if it contains constant offsets and at most + // one variable offset. + int VariableOperand = -1; + unsigned VariableScale = 0; + + int64_t ConstantOffset = 0; + const TargetData *TD = TLI.getTargetData(); + gep_type_iterator GTI = gep_type_begin(AddrInst); + for (unsigned i = 1, e = AddrInst->getNumOperands(); i != e; ++i, ++GTI) { + if (const StructType *STy = dyn_cast(*GTI)) { + const StructLayout *SL = TD->getStructLayout(STy); + unsigned Idx = + cast(AddrInst->getOperand(i))->getZExtValue(); + ConstantOffset += SL->getElementOffset(Idx); + } else { + uint64_t TypeSize = TD->getTypeSize(GTI.getIndexedType()); + if (ConstantInt *CI = dyn_cast(AddrInst->getOperand(i))) { + ConstantOffset += CI->getSExtValue()*TypeSize; + } else if (TypeSize) { // Scales of zero don't do anything. + // We only allow one variable index at the moment. + if (VariableOperand != -1) { + VariableOperand = -2; + break; + } + + // Remember the variable index. + VariableOperand = i; + VariableScale = TypeSize; + } + } + } + + // If the GEP had multiple variable indices, punt. + if (VariableOperand == -2) + break; + + // A common case is for the GEP to only do a constant offset. In this case, + // just add it to the disp field and check validity. + if (VariableOperand == -1) { + AddrMode.BaseOffs += ConstantOffset; + if (ConstantOffset == 0 || TLI.isLegalAddressingMode(AddrMode, AccessTy)){ + // Check to see if we can fold the base pointer in too. + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, + Depth+1)) + return true; + } + AddrMode.BaseOffs -= ConstantOffset; + } else { + // Check that this has no base reg yet. If so, we won't have a place to + // put the base of the GEP (assuming it is not a null ptr). + bool SetBaseReg = false; + if (AddrMode.HasBaseReg) { + if (!isa(AddrInst->getOperand(0))) + break; + } else { + AddrMode.HasBaseReg = true; + AddrMode.BaseReg = AddrInst->getOperand(0); + SetBaseReg = true; + } + + // See if the scale amount is valid for this target. + AddrMode.BaseOffs += ConstantOffset; + if (TryMatchingScaledValue(AddrInst->getOperand(VariableOperand), + VariableScale, AccessTy, AddrMode, + AddrModeInsts, TLI, Depth)) { + if (!SetBaseReg) return true; + + // If this match succeeded, we know that we can form an address with the + // GepBase as the basereg. See if we can match *more*. + AddrMode.HasBaseReg = false; + AddrMode.BaseReg = 0; + if (FindMaximalLegalAddressingMode(AddrInst->getOperand(0), AccessTy, + AddrMode, AddrModeInsts, TLI, + Depth+1)) + return true; + // Strange, shouldn't happen. Restore the base reg and succeed the easy + // way. + AddrMode.HasBaseReg = true; + AddrMode.BaseReg = AddrInst->getOperand(0); + return true; + } + + AddrMode.BaseOffs -= ConstantOffset; + if (SetBaseReg) { + AddrMode.HasBaseReg = false; + AddrMode.BaseReg = 0; + } + } + break; + } + } + + if (Instruction *I = dyn_cast_or_null(AddrInst)) { + assert(AddrModeInsts.back() == I && "Stack imbalance"); + AddrModeInsts.pop_back(); + } + + // Worse case, the target should support [reg] addressing modes. :) + if (!AddrMode.HasBaseReg) { + AddrMode.HasBaseReg = true; + // Still check for legality in case the target supports [imm] but not [i+r]. + if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) { + AddrMode.BaseReg = Addr; + return true; + } + AddrMode.HasBaseReg = false; + } + + // If the base register is already taken, see if we can do [r+r]. + if (AddrMode.Scale == 0) { + AddrMode.Scale = 1; + if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) { + AddrMode.ScaledReg = Addr; + return true; + } + AddrMode.Scale = 0; + } + // Couldn't match. + return false; +} + +/// TryMatchingScaledValue - Try adding ScaleReg*Scale to the specified +/// addressing mode. Return true if this addr mode is legal for the target, +/// false if not. +static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale, + const Type *AccessTy, ExtAddrMode &AddrMode, + SmallVector &AddrModeInsts, + const TargetLowering &TLI, unsigned Depth) { + // If we already have a scale of this value, we can add to it, otherwise, we + // need an available scale field. + if (AddrMode.Scale != 0 && AddrMode.ScaledReg != ScaleReg) + return false; + + ExtAddrMode InputAddrMode = AddrMode; + + // Add scale to turn X*4+X*3 -> X*7. This could also do things like + // [A+B + A*7] -> [B+A*8]. + AddrMode.Scale += Scale; + AddrMode.ScaledReg = ScaleReg; + + if (TLI.isLegalAddressingMode(AddrMode, AccessTy)) { + // Okay, we decided that we can add ScaleReg+Scale to AddrMode. Check now + // to see if ScaleReg is actually X+C. If so, we can turn this into adding + // X*Scale + C*Scale to addr mode. + BinaryOperator *BinOp = dyn_cast(ScaleReg); + if (BinOp && BinOp->getOpcode() == Instruction::Add && + isa(BinOp->getOperand(1)) && InputAddrMode.ScaledReg ==0) { + + InputAddrMode.Scale = Scale; + InputAddrMode.ScaledReg = BinOp->getOperand(0); + InputAddrMode.BaseOffs += + cast(BinOp->getOperand(1))->getSExtValue()*Scale; + if (TLI.isLegalAddressingMode(InputAddrMode, AccessTy)) { + AddrModeInsts.push_back(BinOp); + AddrMode = InputAddrMode; + return true; + } + } + + // Otherwise, not (x+c)*scale, just return what we have. + return true; + } + + // Otherwise, back this attempt out. + AddrMode.Scale -= Scale; + if (AddrMode.Scale == 0) AddrMode.ScaledReg = 0; + + return false; +} + + +/// IsNonLocalValue - Return true if the specified values are defined in a +/// different basic block than BB. +static bool IsNonLocalValue(Value *V, BasicBlock *BB) { + if (Instruction *I = dyn_cast(V)) + return I->getParent() != BB; + return false; +} + +/// OptimizeLoadStoreInst - Load and Store Instructions have often have +/// addressing modes that can do significant amounts of computation. As such, +/// instruction selection will try to get the load or store to do as much +/// computation as possible for the program. The problem is that isel can only +/// see within a single block. As such, we sink as much legal addressing mode +/// stuff into the block as possible. +bool CodeGenPrepare::OptimizeLoadStoreInst(Instruction *LdStInst, Value *Addr, + const Type *AccessTy, + DenseMap &SunkAddrs) { + // Figure out what addressing mode will be built up for this operation. + SmallVector AddrModeInsts; + ExtAddrMode AddrMode; + bool Success = FindMaximalLegalAddressingMode(Addr, AccessTy, AddrMode, + AddrModeInsts, *TLI, 0); + Success = Success; assert(Success && "Couldn't select *anything*?"); + + // Check to see if any of the instructions supersumed by this addr mode are + // non-local to I's BB. + bool AnyNonLocal = false; + for (unsigned i = 0, e = AddrModeInsts.size(); i != e; ++i) { + if (IsNonLocalValue(AddrModeInsts[i], LdStInst->getParent())) { + AnyNonLocal = true; + break; + } + } + + // If all the instructions matched are already in this BB, don't do anything. + if (!AnyNonLocal) { + DEBUG(cerr << "CGP: Found local addrmode: " << AddrMode << "\n"); + return false; + } + + // Insert this computation right after this user. Since our caller is + // scanning from the top of the BB to the bottom, reuse of the expr are + // guaranteed to happen later. + BasicBlock::iterator InsertPt = LdStInst; + + // Now that we determined the addressing expression we want to use and know + // that we have to sink it into this block. Check to see if we have already + // done this for some other load/store instr in this block. If so, reuse the + // computation. + Value *&SunkAddr = SunkAddrs[Addr]; + if (SunkAddr) { + DEBUG(cerr << "CGP: Reusing nonlocal addrmode: " << AddrMode << "\n"); + if (SunkAddr->getType() != Addr->getType()) + SunkAddr = new BitCastInst(SunkAddr, Addr->getType(), "tmp", InsertPt); + } else { + DEBUG(cerr << "CGP: SINKING nonlocal addrmode: " << AddrMode << "\n"); + const Type *IntPtrTy = TLI->getTargetData()->getIntPtrType(); + + Value *Result = 0; + // Start with the scale value. + if (AddrMode.Scale) { + Value *V = AddrMode.ScaledReg; + if (V->getType() == IntPtrTy) { + // done. + } else if (isa(V->getType())) { + V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt); + } else if (cast(IntPtrTy)->getBitWidth() < + cast(V->getType())->getBitWidth()) { + V = new TruncInst(V, IntPtrTy, "sunkaddr", InsertPt); + } else { + V = new SExtInst(V, IntPtrTy, "sunkaddr", InsertPt); + } + if (AddrMode.Scale != 1) + V = BinaryOperator::createMul(V, ConstantInt::get(IntPtrTy, + AddrMode.Scale), + "sunkaddr", InsertPt); + Result = V; + } + + // Add in the base register. + if (AddrMode.BaseReg) { + Value *V = AddrMode.BaseReg; + if (V->getType() != IntPtrTy) + V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt); + if (Result) + Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt); + else + Result = V; + } + + // Add in the BaseGV if present. + if (AddrMode.BaseGV) { + Value *V = new PtrToIntInst(AddrMode.BaseGV, IntPtrTy, "sunkaddr", + InsertPt); + if (Result) + Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt); + else + Result = V; + } + + // Add in the Base Offset if present. + if (AddrMode.BaseOffs) { + Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs); + if (Result) + Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt); + else + Result = V; + } + + if (Result == 0) + SunkAddr = Constant::getNullValue(Addr->getType()); + else + SunkAddr = new IntToPtrInst(Result, Addr->getType(), "sunkaddr",InsertPt); + } + + LdStInst->replaceUsesOfWith(Addr, SunkAddr); + + if (Addr->use_empty()) + EraseDeadInstructions(Addr); + return true; +} // In this pass we look for GEP and cast instructions that are used // across basic blocks and rewrite them to improve basic-block-at-a-time @@ -665,21 +856,15 @@ } + // Keep track of non-local addresses that have been sunk into this block. + // This allows us to avoid inserting duplicate code for blocks with multiple + // load/stores of the same address. + DenseMap SunkAddrs; + for (BasicBlock::iterator BBI = BB.begin(), E = BB.end(); BBI != E; ) { Instruction *I = BBI++; - if (CallInst *CI = dyn_cast(I)) { - // If we found an inline asm expession, and if the target knows how to - // lower it to normal LLVM code, do so now. - if (TLI && isa(CI->getCalledValue())) - if (const TargetAsmInfo *TAI = - TLI->getTargetMachine().getTargetAsmInfo()) { - if (TAI->ExpandInlineAsm(CI)) - BBI = BB.begin(); - } - } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { - MadeChange |= OptimizeGEPExpression(GEPI); - } else if (CastInst *CI = dyn_cast(I)) { + if (CastInst *CI = dyn_cast(I)) { // If the source of the cast is a constant, then this should have // already been constant folded. The only reason NOT to constant fold // it is if something (e.g. LSR) was careful to place the constant @@ -689,37 +874,53 @@ if (isa(CI->getOperand(0))) continue; - if (!TLI) continue; - - // If this is a noop copy, sink it into user blocks to reduce the number - // of virtual registers that must be created and coallesced. - MVT::ValueType SrcVT = TLI->getValueType(CI->getOperand(0)->getType()); - MVT::ValueType DstVT = TLI->getValueType(CI->getType()); - - // This is an fp<->int conversion? - if (MVT::isInteger(SrcVT) != MVT::isInteger(DstVT)) - continue; - - // If this is an extension, it will be a zero or sign extension, which - // isn't a noop. - if (SrcVT < DstVT) continue; - - // If these values will be promoted, find out what they will be promoted - // to. This helps us consider truncates on PPC as noop copies when they - // are. - if (TLI->getTypeAction(SrcVT) == TargetLowering::Promote) - SrcVT = TLI->getTypeToTransformTo(SrcVT); - if (TLI->getTypeAction(DstVT) == TargetLowering::Promote) - DstVT = TLI->getTypeToTransformTo(DstVT); - - // If, after promotion, these are the same types, this is a noop copy. - if (SrcVT == DstVT) - MadeChange |= OptimizeNoopCopyExpression(CI); - } else if (BinaryOperator *BinOp = dyn_cast(I)) { if (TLI) - MadeChange |= SinkInvariantGEPIndex(BinOp, *TLI); + MadeChange |= OptimizeNoopCopyExpression(CI, *TLI); + } else if (LoadInst *LI = dyn_cast(I)) { + if (TLI) + MadeChange |= OptimizeLoadStoreInst(I, I->getOperand(0), LI->getType(), + SunkAddrs); + } else if (StoreInst *SI = dyn_cast(I)) { + if (TLI) + MadeChange |= OptimizeLoadStoreInst(I, SI->getOperand(1), + SI->getOperand(0)->getType(), + SunkAddrs); + } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { + bool HasNonZeroIdx = false; + for (GetElementPtrInst::op_iterator OI = GEPI->op_begin()+1, + E = GEPI->op_end(); OI != E; ++OI) { + if (ConstantInt *CI = dyn_cast(*OI)) { + if (!CI->isZero()) { + HasNonZeroIdx = true; + break; + } + } else { + HasNonZeroIdx = true; + break; + } + } + + if (!HasNonZeroIdx) { + /// The GEP operand must be a pointer, so must its result -> BitCast + Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), + GEPI->getName(), GEPI); + GEPI->replaceAllUsesWith(NC); + GEPI->eraseFromParent(); + MadeChange = true; + BBI = NC; + } + } else if (CallInst *CI = dyn_cast(I)) { + // If we found an inline asm expession, and if the target knows how to + // lower it to normal LLVM code, do so now. + if (TLI && isa(CI->getCalledValue())) + if (const TargetAsmInfo *TAI = + TLI->getTargetMachine().getTargetAsmInfo()) { + if (TAI->ExpandInlineAsm(CI)) + BBI = BB.begin(); + } } } + return MadeChange; } From sabre at nondot.org Fri Apr 13 15:38:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:38:31 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/lsr-code-insertion.ll Message-ID: <200704132038.l3DKcVJB018814@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: lsr-code-insertion.ll added (r1.1) --- Log message: new lsr testcase --- Diffs of the changes: (+60 -0) lsr-code-insertion.ll | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+) Index: llvm/test/CodeGen/ARM/lsr-code-insertion.ll diff -c /dev/null llvm/test/CodeGen/ARM/lsr-code-insertion.ll:1.1 *** /dev/null Fri Apr 13 15:38:24 2007 --- llvm/test/CodeGen/ARM/lsr-code-insertion.ll Fri Apr 13 15:38:14 2007 *************** *** 0 **** --- 1,60 ---- + ; RUN: llvm-as < %s | llc -stats 2>&1 | grep '40.*Number of machine instrs printed' + ; This test really wants to check that the resultant "cond_true" block only has a single + ; store in it, and that cond_true55 only has code to materialize the constant and do + ; a store. We do *not* want something like this: + ; + ;LBB1_3: @cond_true + ; add r8, r0, r6 + ; str r10, [r8, #+4] + ; + + target triple = "arm-apple-darwin8" + + define void @foo(i32* %mc, i32* %mpp, i32* %ip, i32* %dpp, i32* %tpmm, i32 %M, i32* %tpim, i32* %tpdm, i32* %bp, i32* %ms, i32 %xmb) { + entry: + %tmp6584 = icmp slt i32 %M, 1 ; [#uses=1] + br i1 %tmp6584, label %return, label %bb + + bb: ; preds = %cond_next59, %entry + %indvar = phi i32 [ 0, %entry ], [ %k.069.0, %cond_next59 ] ; [#uses=6] + %k.069.0 = add i32 %indvar, 1 ; [#uses=3] + %tmp3 = getelementptr i32* %mpp, i32 %indvar ; [#uses=1] + %tmp4 = load i32* %tmp3 ; [#uses=1] + %tmp8 = getelementptr i32* %tpmm, i32 %indvar ; [#uses=1] + %tmp9 = load i32* %tmp8 ; [#uses=1] + %tmp10 = add i32 %tmp9, %tmp4 ; [#uses=2] + %tmp13 = getelementptr i32* %mc, i32 %k.069.0 ; [#uses=5] + store i32 %tmp10, i32* %tmp13 + %tmp17 = getelementptr i32* %ip, i32 %indvar ; [#uses=1] + %tmp18 = load i32* %tmp17 ; [#uses=1] + %tmp22 = getelementptr i32* %tpim, i32 %indvar ; [#uses=1] + %tmp23 = load i32* %tmp22 ; [#uses=1] + %tmp24 = add i32 %tmp23, %tmp18 ; [#uses=2] + %tmp30 = icmp sgt i32 %tmp24, %tmp10 ; [#uses=1] + br i1 %tmp30, label %cond_true, label %cond_next + + cond_true: ; preds = %bb + store i32 %tmp24, i32* %tmp13 + br label %cond_next + + cond_next: ; preds = %cond_true, %bb + %tmp39 = load i32* %tmp13 ; [#uses=1] + %tmp42 = getelementptr i32* %ms, i32 %k.069.0 ; [#uses=1] + %tmp43 = load i32* %tmp42 ; [#uses=1] + %tmp44 = add i32 %tmp43, %tmp39 ; [#uses=2] + store i32 %tmp44, i32* %tmp13 + %tmp52 = icmp slt i32 %tmp44, -987654321 ; [#uses=1] + br i1 %tmp52, label %cond_true55, label %cond_next59 + + cond_true55: ; preds = %cond_next + store i32 -987654321, i32* %tmp13 + br label %cond_next59 + + cond_next59: ; preds = %cond_true55, %cond_next + %tmp61 = add i32 %indvar, 2 ; [#uses=1] + %tmp65 = icmp sgt i32 %tmp61, %M ; [#uses=1] + br i1 %tmp65, label %return, label %bb + + return: ; preds = %cond_next59, %entry + ret void + } From sabre at nondot.org Fri Apr 13 15:42:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 15:42:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200704132042.l3DKgxU8018914@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.128 -> 1.129 --- Log message: Now that codegen prepare isn't defeating me, I can finally fix what I set out to do! :) This fixes a problem where LSR would insert a bunch of code into each MBB that uses a particular subexpression (e.g. IV+base+C). The problem is that this code cannot be CSE'd back together if inserted into different blocks. This patch changes LSR to attempt to insert a single copy of this code and share it, allowing codegenprepare to duplicate the code if it can be sunk into various addressing modes. On CodeGen/ARM/lsr-code-insertion.ll, for example, this gives us code like: add r8, r0, r5 str r6, [r8, #+4] .. ble LBB1_4 @cond_next LBB1_3: @cond_true str r10, [r8, #+4] LBB1_4: @cond_next ... LBB1_5: @cond_true55 ldr r6, LCPI1_1 str r6, [r8, #+4] instead of: add r10, r0, r6 str r8, [r10, #+4] ... ble LBB1_4 @cond_next LBB1_3: @cond_true add r8, r0, r6 str r10, [r8, #+4] LBB1_4: @cond_next ... LBB1_5: @cond_true55 add r8, r0, r6 ldr r10, LCPI1_1 str r10, [r8, #+4] Besides being smaller and more efficient, this makes it immediately obvious that it is profitable to predicate LBB1_3 now :) --- Diffs of the changes: (+19 -1) LoopStrengthReduce.cpp | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.129 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128 Mon Apr 9 17:20:14 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Apr 13 15:42:26 2007 @@ -568,7 +568,25 @@ SCEVExpander &Rewriter, Loop *L, Pass *P) { if (!isa(Inst)) { - Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, Inst, L); + // By default, insert code at the user instruction. + BasicBlock::iterator InsertPt = Inst; + + // However, if the Operand is itself an instruction, the (potentially + // complex) inserted code may be shared by many users. Because of this, we + // want to emit code for the computation of the operand right before its old + // computation. This is usually safe, because we obviously used to use the + // computation when it was computed in its current block. However, in some + // cases (e.g. use of a post-incremented induction variable) the NewBase + // value will be pinned to live somewhere after the original computation. + // In this case, we have to back off. + if (!isUseOfPostIncrementedValue) { + if (Instruction *OpInst = dyn_cast(OperandValToReplace)) { + InsertPt = OpInst; + while (isa(InsertPt)) ++InsertPt; + } + } + + Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L); // Replace the use of the operand Value with the new Phi we just created. Inst->replaceUsesOfWith(OperandValToReplace, NewVal); DOUT << " CHANGED: IMM =" << *Imm << " Inst = " << *Inst; From sabre at nondot.org Fri Apr 13 16:42:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 16:42:04 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132142.l3DLg457020481@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.106 -> 1.107 --- Log message: make the reid happier. --- Diffs of the changes: (+6 -6) DevMtgMay2007.html | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.106 llvm-www/DevMtgMay2007.html:1.107 --- llvm-www/DevMtgMay2007.html:1.106 Fri Apr 13 15:03:35 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 16:41:47 2007 @@ -33,10 +33,10 @@
  • When: May 25, 2007, 8:00am to 6:00pm
  • Where: Cupertino Inn - 10889 N De Anza Blvd, Cupertino, CA, 95014
    - across the street from Apple
  • + href="http://maps.google.com/maps?f=q&hl=en&q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014&sll=37.0625,-95.677068&sspn=48.106236,62.050781&layer=&ie=UTF8&z=16&om=1&iwloc=addr">10889 N De Anza Blvd, Cupertino, CA, 95014
    - across the street from Apple
    -
    +
    Yes, this is the actual room.
    Unconfirmed Attendees
    NameOrganization
    @@ -287,7 +287,7 @@ - + @@ -306,13 +306,13 @@ +
    Confirmed Attendees (A-Ler)
    Confirmed Attendees
    NameOrganization
    Vikram AdveUIUC
    Bob ArcherAdobe Systems Incorporated.
    Chris LattnerApple Inc.
    Andrew LenharthUIUC
    Julien LerougeApple Inc.
    Nick LewyckyIndependent
    - + - @@ -353,6 +353,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 20:03:35 $ +
    Last modified: $Date: 2007/04/13 21:41:47 $ From reid at x10sys.com Fri Apr 13 17:13:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 17:13:44 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704132213.l3DMDiPX021139@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.107 -> 1.108 --- Log message: Hopefully fix validation problems. --- Diffs of the changes: (+5 -5) DevMtgMay2007.html | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.107 llvm-www/DevMtgMay2007.html:1.108 --- llvm-www/DevMtgMay2007.html:1.107 Fri Apr 13 16:41:47 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 17:13:27 2007 @@ -33,12 +33,12 @@
  • When: May 25, 2007, 8:00am to 6:00pm
  • Where: Cupertino Inn - 10889 N De Anza Blvd, Cupertino, CA, 95014
    - across the street from Apple
  • + href="http://maps.google.com/maps?f=q&hl=en&q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014&sll=37.0625,-95.677068&sspn=48.106236,62.050781&layer=&ie=UTF8&z=16&om=1&iwloc=addr">10889 N De Anza Blvd, Cupertino, CA, 95014 - across the street from Apple -
    -
    +
    + Meeting Room
    Yes, this is the actual room. -
    +
    Confirmed Attendees (Lew-Z)
    Confirmed Attendees
    NameOrganization
    Nick LewyckyIndependent
    Efrem LipkinCoDesign
    Gabe McArthurIndependent
    Paul McJonesAdobe Systems Incorporated.
    @@ -353,6 +353,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 21:41:47 $ +
    Last modified: $Date: 2007/04/13 22:13:27 $ From sabre at nondot.org Fri Apr 13 17:20:44 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 17:20:44 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll Message-ID: <200704132220.l3DMKi6r021275@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: 2007-03-15-GEP-Idx-Sink.ll updated: 1.1 -> 1.2 --- Log message: xfail this for now --- Diffs of the changes: (+3 -0) 2007-03-15-GEP-Idx-Sink.ll | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll diff -u llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.1 llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.2 --- llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.1 Fri Mar 16 22:18:32 2007 +++ llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll Fri Apr 13 17:20:27 2007 @@ -1,6 +1,9 @@ ; RUN: llvm-as < %s | llc -march=arm && ; RUN: llvm-as < %s | llc -march=arm -stats 2>&1 | not grep 'register spills' +;; Must talk to evan about this. +; XFAIL: * + define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) { entry: icmp sgt i32 %size, 0 ; :0 [#uses=1] From baldrick at free.fr Fri Apr 13 14:21:10 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Apr 2007 21:21:10 +0200 Subject: [llvm-commits] llvm-gcc: implement CEIL_DIV_EXPR Message-ID: <200704132121.12332.baldrick@free.fr> CEIL_DIV_EXPR performs integer division with rounding towards positive infinity, thus 3 cdiv 2 = 2 while -3 cdiv 2 = -1. Testing is tricky, because CEIL_DIV_EXPR is only generated in unusual circumstances, giving little coverage, so I modified the llvm- and mainline gcc compilers to output CEIL_DIV_EXPR for normal division, and compared the results for all possible signed and unsigned i8 values for the left- and right-hand sides. Best wishes, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: ceil_div_expr.diff Type: text/x-diff Size: 5225 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070413/e7256eb5/attachment.bin From reid at x10sys.com Fri Apr 13 17:33:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 17:33:27 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/SCCP/apint-array.ll apint-basictest.ll apint-basictest2.ll apint-basictest3.ll apint-basictest4.ll apint-bigarray.ll apint-bigint.ll apint-bigint2.ll apint-ipsccp1.ll apint-ipsccp2.ll apint-ipsccp3.ll apint-ipsccp4.ll apint-load.ll apint-phi.ll apint-select.ll Message-ID: <200704132233.l3DMXRsd021505@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/SCCP: apint-array.ll added (r1.1) apint-basictest.ll added (r1.1) apint-basictest2.ll added (r1.1) apint-basictest3.ll added (r1.1) apint-basictest4.ll added (r1.1) apint-bigarray.ll added (r1.1) apint-bigint.ll added (r1.1) apint-bigint2.ll added (r1.1) apint-ipsccp1.ll added (r1.1) apint-ipsccp2.ll added (r1.1) apint-ipsccp3.ll added (r1.1) apint-ipsccp4.ll added (r1.1) apint-load.ll added (r1.1) apint-phi.ll added (r1.1) apint-select.ll added (r1.1) --- Log message: Add the SCCP regression tests for APInt expressions. These test cases turned up some regressions that have since been fixed. We don't want to loose the regression tests. Test cases by Guoling Han. --- Diffs of the changes: (+360 -0) apint-array.ll | 23 +++++++++++++++++++++++ apint-basictest.ll | 17 +++++++++++++++++ apint-basictest2.ll | 18 ++++++++++++++++++ apint-basictest3.ll | 24 ++++++++++++++++++++++++ apint-basictest4.ll | 26 ++++++++++++++++++++++++++ apint-bigarray.ll | 24 ++++++++++++++++++++++++ apint-bigint.ll | 10 ++++++++++ apint-bigint2.ll | 19 +++++++++++++++++++ apint-ipsccp1.ll | 23 +++++++++++++++++++++++ apint-ipsccp2.ll | 21 +++++++++++++++++++++ apint-ipsccp3.ll | 24 ++++++++++++++++++++++++ apint-ipsccp4.ll | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ apint-load.ll | 38 ++++++++++++++++++++++++++++++++++++++ apint-phi.ll | 20 ++++++++++++++++++++ apint-select.ll | 22 ++++++++++++++++++++++ 15 files changed, 360 insertions(+) Index: llvm/test/Transforms/SCCP/apint-array.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-array.ll:1.1 *** /dev/null Fri Apr 13 17:33:20 2007 --- llvm/test/Transforms/SCCP/apint-array.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,23 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep 'ret i101 12' + + @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,i101 + -123456789000000, i101 0,i101 9123456789000000] + + define i101 @array() + { + Head: + %A = getelementptr [6 x i101]* @Y, i32 0, i32 1 + + %B = load i101* %A + %C = icmp sge i101 %B, 1 + br i1 %C, label %True, label %False + True: + %D = and i101 %B, 1 + %E = trunc i101 %D to i32 + %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E + %G = load i101* %F + br label %False + False: + %H = phi i101 [%G, %True], [-1, %Head] + ret i101 %H + } Index: llvm/test/Transforms/SCCP/apint-basictest.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,17 ---- + ; This is a basic sanity check for constant propogation. The add instruction + ; should be eliminated. + + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %Val = add i128 0, 1 + br label %BB3 + BB2: + br label %BB3 + BB3: + %Ret = phi i128 [%Val, %BB1], [2, %BB2] + ret i128 %Ret + } Index: llvm/test/Transforms/SCCP/apint-basictest2.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest2.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest2.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,18 ---- + ; This is a basic sanity check for constant propogation. The add instruction + ; and phi instruction should be eliminated. + + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep add + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %Val = add i128 0, 1 + br label %BB3 + BB2: + br label %BB3 + BB3: + %Ret = phi i128 [%Val, %BB1], [1, %BB2] + ret i128 %Ret + } Index: llvm/test/Transforms/SCCP/apint-basictest3.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest3.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest3.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,24 ---- + ; This is a basic sanity check for constant propogation. It tests the basic + ; arithmatic operations. + + + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep mul + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep umod + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %t1 = add i128 0, 1 + %t2 = sub i128 0, %t1 + %t3 = mul i128 %t2, -1 + br label %BB3 + BB2: + %f1 = udiv i128 -1, 1 + %f2 = add i128 %f1, 1 + %f3 = umod i128 %f2, 2121 + br label %BB3 + BB3: + %Ret = phi i128 [%t3, %BB1], [%f3, %BB2] + ret i128 %Ret + } Index: llvm/test/Transforms/SCCP/apint-basictest4.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest4.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest4.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,26 ---- + ; This is a basic sanity check for constant propogation. It tests the basic + ; logic operations. + + + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep and + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep trunc + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep "ret i100 -1" + + define i100 @test(i133 %A) { + %B = and i133 0, %A + %C = icmp sgt i133 %B, 0 + br i1 %C, label %BB1, label %BB2 + BB1: + %t3 = xor i133 %B, -1 + %t4 = trunc i133 %t3 to i100 + br label %BB3 + BB2: + %f1 = or i133 -1, %A + %f2 = lshr i133 %f1, 33 + %f3 = trunc i133 %f2 to i100 + br label %BB3 + BB3: + %Ret = phi i100 [%t4, %BB1], [%f3, %BB2] + ret i100 %Ret + } Index: llvm/test/Transforms/SCCP/apint-bigarray.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-bigarray.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-bigarray.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,24 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep '%X' + + @G = global [1000000 x i10000] zeroinitializer + + define internal i10000* @test(i10000 %Arg) { + %X = getelementptr [1000000 x i10000]* @G, i32 0, i32 999 + store i10000 %Arg, i10000* %X + ret i10000* %X + } + + define i10000 @caller() + { + %Y = call i10000* @test(i10000 -1) + %Z = load i10000* %Y + ret i10000 %Z + } + + define i10000 @caller2() + { + %Y = call i10000* @test(i10000 1) + %Z = load i10000* %Y + ret i10000 %Z + } Index: llvm/test/Transforms/SCCP/apint-bigint.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-bigint.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-bigint.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep xor + + define i11129 @test1() { + %B = shl i11129 1, 11128 + %C = sub i11129 %B, 1 + %D = xor i11129 %B, %C + + ret i11129 %D + } Index: llvm/test/Transforms/SCCP/apint-bigint2.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-bigint2.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-bigint2.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,19 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep load + + @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12, + i101 -123456789000000, i101 0,i101 9123456789000000] + + define i101 @array() + { + Head: + %A = getelementptr [6 x i101]* @Y, i32 0, i32 1 + %B = load i101* %A + %D = and i101 %B, 1 + %DD = or i101 %D, 1 + %E = trunc i101 %DD to i32 + %F = getelementptr [6 x i101]* @Y, i32 0, i32 %E + %G = load i101* %F + + ret i101 %G + } Index: llvm/test/Transforms/SCCP/apint-ipsccp1.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-ipsccp1.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-ipsccp1.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,23 ---- + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v 'ret i512 undef' | grep 'ret i8 2' + + define internal i512 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %Val = add i512 0, 1 + br label %BB3 + BB2: + br label %BB3 + BB3: + %Ret = phi i512 [%Val, %BB1], [2, %BB2] + ret i512 %Ret + } + + define i8 @caller() + { + %t1 = and i2 2, 1 + %t11 = trunc i2 %t1 to i1 + %t2 = call i512 @test(i1 %t11) + %t3 = trunc i512 %t2 to i8 + ret i8 %t3 + } + Index: llvm/test/Transforms/SCCP/apint-ipsccp2.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-ipsccp2.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-ipsccp2.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,21 ---- + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v 'ret i101 0' | \ + ; RUN: grep -v 'ret i101 undef' | not grep ret + + + + define internal i101 @bar(i101 %A) { + %x = icmp eq i101 %A, 0 + br i1 %x, label %T, label %F + T: + %B = call i101 @bar(i101 0) + ret i101 0 + F: ; unreachable + %C = call i101 @bar(i101 1) + ret i101 %C + } + + define i101 @foo() { + %X = call i101 @bar(i101 0) + ret i101 %X + } Index: llvm/test/Transforms/SCCP/apint-ipsccp3.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-ipsccp3.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-ipsccp3.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,24 ---- + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep global + + @G = internal global i66 undef + + + + define void @foo() { + %X = load i66* @G + store i66 %X, i66* @G + ret void + } + + define i66 @bar() { + %V = load i66* @G + %C = icmp eq i66 %V, 17 + br i1 %C, label %T, label %F + T: + store i66 17, i66* @G + ret i66 %V + F: + store i66 123, i66* @G + ret i66 0 + } Index: llvm/test/Transforms/SCCP/apint-ipsccp4.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-ipsccp4.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-ipsccp4.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,51 ---- + ; This test makes sure that these instructions are properly constant propagated. + ; + + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep add + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep phi + + + @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, + { i212, float } { i212 37, float 2.0 } ] + + define internal float @test2() { + %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 + %B = load float* %A + ret float %B + } + + define internal float @test3() { + %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 1 + %B = load float* %A + ret float %B + } + + define internal float @test() + { + %A = call float @test2() + %B = call float @test3() + + %E = fdiv float %B, %A + ret float %E + } + + define float @All() + { + %A = call float @test() + %B = fcmp oge float %A, 1.0 + br i1 %B, label %T, label %F + T: + %C = add float %A, 1.0 + br label %exit + F: + %D = add float %A, 2.0 + br label %exit + exit: + %E = phi float [%C, %T], [%D, %F] + ret float %E + } + + + Index: llvm/test/Transforms/SCCP/apint-load.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-load.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-load.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,38 ---- + ; This test makes sure that these instructions are properly constant propagated. + ; + + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep load + ; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | not grep fdiv + + @X = constant i212 42 + @Y = constant [2 x { i212, float }] [ { i212, float } { i212 12, float 1.0 }, + { i212, float } { i212 37, float 1.2312 } ] + define i212 @test1() { + %B = load i212* @X + ret i212 %B + } + + define internal float @test2() { + %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 1, i32 1 + %B = load float* %A + ret float %B + } + + define internal i212 @test3() { + %A = getelementptr [2 x { i212, float}]* @Y, i32 0, i32 0, i32 0 + %B = load i212* %A + ret i212 %B + } + + define float @All() + { + %A = call float @test2() + %B = call i212 @test3() + %C = mul i212 %B, -1234567 + %D = sitofp i212 %C to float + %E = fdiv float %A, %D + ret float %E + } + + Index: llvm/test/Transforms/SCCP/apint-phi.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-phi.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-phi.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,20 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep phi + + define i999 @test(i999%A, i1 %c) { + bb1: + br label %BB2 + BB2: + %V = phi i999 [2, %bb1], [%A, %BB4] + br label %BB3 + + BB3: + %E = trunc i999 %V to i1 + %F = and i1 %E, %c + br i1 %F, label %BB4, label %BB5 + BB4: + br label %BB2 + + BB5: + ret i999 %V + } Index: llvm/test/Transforms/SCCP/apint-select.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-select.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-select.ll Fri Apr 13 17:33:10 2007 *************** *** 0 **** --- 1,22 ---- + ; RUN: llvm-as < %s | opt -sccp | llvm-dis -o /dev/null -f && + ; RUN: llvm-as < %s | opt -sccp | llvm-dis | not grep select + + @A = constant i32 10 + + define i712 @test1() { + %P = getelementptr i32* @A, i32 0 + %B = ptrtoint i32* %P to i64 + %BB = and i64 %B, undef + %C = icmp sge i64 %BB, 0 + %X = select i1 %C, i712 0, i712 1 + ret i712 %X + } + + + + define i712 @test2(i1 %C) { + %X = select i1 %C, i712 0, i712 undef + ret i712 %X + } + + From baldrick at free.fr Fri Apr 13 17:43:08 2007 From: baldrick at free.fr (Duncan Sands) Date: Fri, 13 Apr 2007 17:43:08 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704132243.l3DMh83m021729@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.10 -> 1.11 --- Log message: Yet another name suggestion. --- Diffs of the changes: (+3 -2) Name.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.10 llvm-www/Name.html:1.11 --- llvm-www/Name.html:1.10 Fri Apr 13 12:38:05 2007 +++ llvm-www/Name.html Fri Apr 13 17:42:50 2007 @@ -183,13 +183,14 @@ ALCS to make it even more unique. Zhongxing XuOmniC
    Omnipiler
    OmnicomStands for "Omnipotent Compiler". I prefer the first. - Duncan SandsOptLibPortmanteau of optimizing + Duncan SandsOptLibPortmanteau of optimizing and library. llvroomAs in the vrooming of a motorcycle engine. OptLOCPortmanteau of Optimization and Lines Of Code LoveByteAlong the Warloc - Loveloc lines as baldric4 suggested in IRC. LOC = Lines of Code + Tuneful or TuneUpAs in tuning Paolo InvernizziMithrilThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: "Mithril! All folk desired it. It could be beaten like copper, and polished like glass; and the Dwarves could @@ -249,6 +250,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 17:38:05 $ +
    Last modified: $Date: 2007/04/13 22:42:50 $ From jeffc at jolt-lang.org Fri Apr 13 17:52:20 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Fri, 13 Apr 2007 17:52:20 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200704132252.l3DMqKEH021983@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.336 -> 1.337 --- Log message: Silence VC++ warning. --- Diffs of the changes: (+1 -1) CBackend.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.336 llvm/lib/Target/CBackend/CBackend.cpp:1.337 --- llvm/lib/Target/CBackend/CBackend.cpp:1.336 Thu Apr 12 16:57:15 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Fri Apr 13 17:52:03 2007 @@ -2372,7 +2372,7 @@ // Examine all the instructions in this function to find the intrinsics that // need to be lowered. - for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) + for (Function::iterator BB = F.begin(), EE = F.end(); BB != EE; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) if (CallInst *CI = dyn_cast(I++)) if (Function *F = CI->getCalledFunction()) From johannes at apple.com Fri Apr 13 17:52:01 2007 From: johannes at apple.com (johannes at apple.com) Date: Fri, 13 Apr 2007 15:52:01 -0700 (PDT) Subject: [llvm-commits] [126086] Allow reg-sized structs and unions as inputs to asm. Message-ID: <20070413225201.206E1EA69968@src> Revision: 126086 Author: johannes Date: 2007-04-13 15:52:00 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Allow reg-sized structs and unions as inputs to asm. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-13 22:35:30 UTC (rev 126085) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-13 22:52:00 UTC (rev 126086) @@ -3638,7 +3638,20 @@ return 0; if (AllowsReg || !AllowsMem) { // Register operand. - Value *Op = Emit(Val, 0); + const Type *LLVMTy = ConvertType(type); + Value *Op; + if (!LLVMTy->isFirstClassType()) { + // Structs and unions are permitted here, as long as they're the + // same size as a register. + Value *Target = CreateTemporary(LLVMTy); + LValue LV = EmitLV(Val); + EmitAggregateCopy(Target, LV.Ptr, type, false, TREE_THIS_VOLATILE (Val)); + LLVMTy = IntegerType::get(TD.getTypeSizeInBits(LLVMTy)); + Op = new LoadInst(CastToType(Instruction::BitCast, Target, + PointerType::get(LLVMTy)), "tmp", CurBB); + } else { + Op = Emit(Val, 0); + } CallOps.push_back(Op); CallArgTypes.push_back(Op->getType()); } else { // Memory operand. From dalej at apple.com Fri Apr 13 17:54:29 2007 From: dalej at apple.com (Dale Johannesen) Date: Fri, 13 Apr 2007 17:54:29 -0500 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c 2007-04-13-InlineAsmUnion2.c Message-ID: <200704132254.l3DMsTCM022040@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-04-13-InlineAsmStruct2.c added (r1.1) 2007-04-13-InlineAsmUnion2.c added (r1.1) --- Log message: tests for struct/union as input operands to asm. --- Diffs of the changes: (+16 -0) 2007-04-13-InlineAsmStruct2.c | 9 +++++++++ 2007-04-13-InlineAsmUnion2.c | 7 +++++++ 2 files changed, 16 insertions(+) Index: llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c diff -c /dev/null llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c:1.1 *** /dev/null Fri Apr 13 17:54:21 2007 --- llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c Fri Apr 13 17:54:11 2007 *************** *** 0 **** --- 1,9 ---- + // RUN: %llvmgcc %s -S -emit-llvm -o - | grep 'call void asm' + + struct V { short X, Y; }; + int bar() { + struct V bar; + __asm__ volatile("foo %0\n" :: "r"(bar)); + return bar.X; + } + Index: llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.c diff -c /dev/null llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.c:1.1 *** /dev/null Fri Apr 13 17:54:29 2007 --- llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.c Fri Apr 13 17:54:11 2007 *************** *** 0 **** --- 1,7 ---- + // RUN: %llvmgcc %s -S -emit-llvm -o - | grep 'call void asm' + + union U { int x; char* p; }; + void foo() { + union U bar; + __asm__ volatile("foo %0\n" :: "r"(bar)); + } From reid at x10sys.com Fri Apr 13 19:00:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 19:00:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200704140000.l3E00VYH023959@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.77 -> 1.78 --- Log message: We want the number of bits needed, not the power of 2. --- Diffs of the changes: (+1 -1) APInt.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.77 llvm/lib/Support/APInt.cpp:1.78 --- llvm/lib/Support/APInt.cpp:1.77 Fri Apr 13 14:19:07 2007 +++ llvm/lib/Support/APInt.cpp Fri Apr 13 19:00:10 2007 @@ -693,7 +693,7 @@ APInt tmp(sufficient, str, slen, radix); // Compute how many bits are required. - return isNegative + tmp.logBase2(); + return isNegative + tmp.logBase2() + 1; } uint64_t APInt::getHashValue() const { From sabre at nondot.org Fri Apr 13 19:13:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 19:13:20 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200704140013.l3E0DK36024289@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.65 -> 1.66 --- Log message: add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method. Writing it twice in the same day was too much for me. --- Diffs of the changes: (+5 -0) Instructions.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.65 llvm/include/llvm/Instructions.h:1.66 --- llvm/include/llvm/Instructions.h:1.65 Mon Apr 9 13:00:57 2007 +++ llvm/include/llvm/Instructions.h Fri Apr 13 19:12:57 2007 @@ -408,6 +408,11 @@ inline bool hasIndices() const { return getNumOperands() > 1; } + + /// hasAllZeroIndices - Return true if all of the indices of this GEP are + /// zeros. If so, the result pointer and the first operand have the same + /// value, just potentially different types. + bool hasAllZeroIndices() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GetElementPtrInst *) { return true; } From sabre at nondot.org Fri Apr 13 19:13:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 19:13:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200704140013.l3E0DMfw024295@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.84 -> 1.85 --- Log message: add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method. Writing it twice in the same day was too much for me. --- Diffs of the changes: (+16 -0) Instructions.cpp | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.84 llvm/lib/VMCore/Instructions.cpp:1.85 --- llvm/lib/VMCore/Instructions.cpp:1.84 Wed Apr 11 08:04:48 2007 +++ llvm/lib/VMCore/Instructions.cpp Fri Apr 13 19:12:57 2007 @@ -966,6 +966,22 @@ return PTy->getElementType(); } + +/// hasAllZeroIndices - Return true if all of the indices of this GEP are +/// zeros. If so, the result pointer and the first operand have the same +/// value, just potentially different types. +bool GetElementPtrInst::hasAllZeroIndices() const { + for (unsigned i = 1, e = getNumOperands(); i != e; ++i) { + if (ConstantInt *CI = dyn_cast(getOperand(i))) { + if (!CI->isZero()) return false; + } else { + return false; + } + } + return true; +} + + //===----------------------------------------------------------------------===// // ExtractElementInst Implementation //===----------------------------------------------------------------------===// From sabre at nondot.org Fri Apr 13 19:18:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 19:18:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Message-ID: <200704140018.l3E0I0Tv024464@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: CodeGenPrepare.cpp updated: 1.4 -> 1.5 --- Log message: use an accessor to simplify code. --- Diffs of the changes: (+1 -15) CodeGenPrepare.cpp | 16 +--------------- 1 files changed, 1 insertion(+), 15 deletions(-) Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.5 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 Fri Apr 13 15:30:56 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Apr 13 19:17:39 2007 @@ -886,21 +886,7 @@ SI->getOperand(0)->getType(), SunkAddrs); } else if (GetElementPtrInst *GEPI = dyn_cast(I)) { - bool HasNonZeroIdx = false; - for (GetElementPtrInst::op_iterator OI = GEPI->op_begin()+1, - E = GEPI->op_end(); OI != E; ++OI) { - if (ConstantInt *CI = dyn_cast(*OI)) { - if (!CI->isZero()) { - HasNonZeroIdx = true; - break; - } - } else { - HasNonZeroIdx = true; - break; - } - } - - if (!HasNonZeroIdx) { + if (GEPI->hasAllZeroIndices()) { /// The GEP operand must be a pointer, so must its result -> BitCast Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), GEPI->getName(), GEPI); From sabre at nondot.org Fri Apr 13 19:19:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 19:19:57 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/malloc-free-delete.ll Message-ID: <200704140019.l3E0Jv1v024571@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: malloc-free-delete.ll added (r1.1) --- Log message: testcase for PR1201: http://llvm.org/PR1201 --- Diffs of the changes: (+12 -0) malloc-free-delete.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/Transforms/InstCombine/malloc-free-delete.ll diff -c /dev/null llvm/test/Transforms/InstCombine/malloc-free-delete.ll:1.1 *** /dev/null Fri Apr 13 19:19:46 2007 --- llvm/test/Transforms/InstCombine/malloc-free-delete.ll Fri Apr 13 19:19:36 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'ret i32 0' && + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep malloc + ; PR1201 + define i32 @main(i32 %argc, i8** %argv) { + %c_19 = alloca i8* ; [#uses=2] + %malloc_206 = malloc i8, i32 10 ; [#uses=1] + store i8* %malloc_206, i8** %c_19 + %tmp_207 = load i8** %c_19 ; [#uses=1] + free i8* %tmp_207 + ret i32 0 + } + From sabre at nondot.org Fri Apr 13 19:20:24 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 19:20:24 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200704140020.l3E0KO3Z024593@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.742 -> 1.743 --- Log message: Implement PR1201: http://llvm.org/PR1201 and test/Transforms/InstCombine/malloc-free-delete.ll --- Diffs of the changes: (+23 -8) InstructionCombining.cpp | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.742 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.743 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.742 Wed Apr 11 01:57:46 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Apr 13 19:20:02 2007 @@ -8367,13 +8367,6 @@ Instruction *InstCombiner::visitFreeInst(FreeInst &FI) { Value *Op = FI.getOperand(0); - // Change free * (cast * X to *) into free * X - if (CastInst *CI = dyn_cast(Op)) - if (isa(CI->getOperand(0)->getType())) { - FI.setOperand(0, CI->getOperand(0)); - return &FI; - } - // free undef -> unreachable. if (isa(Op)) { // Insert a new store to null because we cannot modify the CFG here. @@ -8381,11 +8374,33 @@ UndefValue::get(PointerType::get(Type::Int1Ty)), &FI); return EraseInstFromFunction(FI); } - + // If we have 'free null' delete the instruction. This can happen in stl code // when lots of inlining happens. if (isa(Op)) return EraseInstFromFunction(FI); + + // Change free * (cast * X to *) into free * X + if (BitCastInst *CI = dyn_cast(Op)) { + FI.setOperand(0, CI->getOperand(0)); + return &FI; + } + + // Change free (gep X, 0,0,0,0) into free(X) + if (GetElementPtrInst *GEPI = dyn_cast(Op)) { + if (GEPI->hasAllZeroIndices()) { + AddToWorkList(GEPI); + FI.setOperand(0, GEPI->getOperand(0)); + return &FI; + } + } + + // Change free(malloc) into nothing, if the malloc has a single use. + if (MallocInst *MI = dyn_cast(Op)) + if (MI->hasOneUse()) { + EraseInstFromFunction(FI); + return EraseInstFromFunction(*MI); + } return 0; } From reid at x10sys.com Fri Apr 13 19:35:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 19:35:15 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704140035.l3E0ZFcn025033@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.11 -> 1.12 --- Log message: Add some submission rules. --- Diffs of the changes: (+8 -1) Name.html | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.11 llvm-www/Name.html:1.12 --- llvm-www/Name.html:1.11 Fri Apr 13 17:42:50 2007 +++ llvm-www/Name.html Fri Apr 13 19:34:54 2007 @@ -120,6 +120,13 @@ as you think of names. Can a logo be developed? If you have graphical talents, please send a JPEG/GIF to go with your name idea. +

    Some submissions rules:

    +
      +
    • If you have commit access, please just commit your idea to this file + directly.
    • +
    • If you don't have commit access, please submit a patch against this file + and send it to llvm-commits mailing list. It will get committed.
    • +
    @@ -250,6 +257,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 22:42:50 $ +
    Last modified: $Date: 2007/04/14 00:34:54 $ From sabre at nondot.org Fri Apr 13 20:12:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 20:12:15 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp Message-ID: <200704140112.l3E1CFno025710@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ConstantMerge.cpp updated: 1.35 -> 1.36 --- Log message: in addition to merging, constantmerge should also delete trivially dead globals, in order to clean up after simplifylibcalls. --- Diffs of the changes: (+8 -1) ConstantMerge.cpp | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.35 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.36 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.35 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Fri Apr 13 20:11:54 2007 @@ -61,7 +61,13 @@ // invalidating the Constant* pointers in CMap. // for (Module::global_iterator GV = M.global_begin(), E = M.global_end(); - GV != E; ++GV) + GV != E; ++GV) { + // If this GV is dead, remove it. + GV->removeDeadConstantUsers(); + if (GV->use_empty() && GV->hasInternalLinkage()) { + (GV++)->eraseFromParent(); + } + // Only process constants with initializers. if (GV->isConstant() && GV->hasInitializer()) { Constant *Init = GV->getInitializer(); @@ -80,6 +86,7 @@ Slot = GV; } } + } if (Replacements.empty()) return MadeChange; From sabre at nondot.org Fri Apr 13 20:18:10 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 20:18:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Message-ID: <200704140118.l3E1IADx025892@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.110 -> 1.111 --- Log message: Implement a few missing xforms: printf("foo\n") -> puts. printf("x") -> putchar printf("") -> noop. Still need to do the xforms for fprintf. This implements Transforms/SimplifyLibCalls/Printf.ll --- Diffs of the changes: (+48 -9) SimplifyLibCalls.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 48 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.110 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.111 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.110 Sun Apr 8 13:11:26 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Fri Apr 13 20:17:48 2007 @@ -1154,22 +1154,61 @@ /// @brief Make sure that the "printf" function has the right prototype virtual bool ValidateCalledFunction(const Function *F, SimplifyLibCalls &SLC){ - // Just make sure this has at least 1 arguments - return F->arg_size() >= 1; + // Just make sure this has at least 1 argument and returns an integer or + // void type. + const FunctionType *FT = F->getFunctionType(); + return FT->getNumParams() >= 1 && + (isa(FT->getReturnType()) || + FT->getReturnType() == Type::VoidTy); } /// @brief Perform the printf optimization. virtual bool OptimizeCall(CallInst *CI, SimplifyLibCalls &SLC) { - // If the call has more than 2 operands, we can't optimize it - if (CI->getNumOperands() != 3) - return false; - // All the optimizations depend on the length of the first argument and the // fact that it is a constant string array. Check that now std::string FormatStr; if (!GetConstantStringInfo(CI->getOperand(1), FormatStr)) return false; + + // If this is a simple constant string with no format specifiers that ends + // with a \n, turn it into a puts call. + if (FormatStr.empty()) { + // Tolerate printf's declared void. + if (CI->use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, ConstantInt::get(CI->getType(), 0)); + } + + if (FormatStr.size() == 1) { + // Turn this into a putchar call, even if it is a %. + Value *V = ConstantInt::get(Type::Int32Ty, FormatStr[0]); + new CallInst(SLC.get_putchar(), V, "", CI); + if (CI->use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, ConstantInt::get(CI->getType(), 1)); + } + // Check to see if the format str is something like "foo\n", in which case + // we convert it to a puts call. We don't allow it to contain any format + // characters. + if (FormatStr[FormatStr.size()-1] == '\n' && + FormatStr.find('%') == std::string::npos) { + // Create a string literal with no \n on it. We expect the constant merge + // pass to be run after this pass, to merge duplicate strings. + FormatStr.erase(FormatStr.end()-1); + Constant *Init = ConstantArray::get(FormatStr, true); + Constant *GV = new GlobalVariable(Init->getType(), true, + GlobalVariable::InternalLinkage, + Init, "str", + CI->getParent()->getParent()->getParent()); + // Cast GV to be a pointer to char. + GV = ConstantExpr::getBitCast(GV, PointerType::get(Type::Int8Ty)); + new CallInst(SLC.get_puts(), GV, "", CI); + + if (CI->use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, + ConstantInt::get(CI->getType(), FormatStr.size())); + } + + // Only support %c or "%s\n" for now. if (FormatStr.size() < 2 || FormatStr[0] != '%') return false; @@ -1178,7 +1217,7 @@ switch (FormatStr[1]) { default: return false; case 's': - if (FormatStr != "%s\n" || + if (FormatStr != "%s\n" || CI->getNumOperands() < 3 || // TODO: could insert strlen call to compute string length. !CI->use_empty()) return false; @@ -1189,7 +1228,7 @@ return ReplaceCallWith(CI, 0); case 'c': { // printf("%c",c) -> putchar(c) - if (FormatStr.size() != 2) + if (FormatStr.size() != 2 || CI->getNumOperands() < 3) return false; Value *V = CI->getOperand(2); @@ -1917,7 +1956,7 @@ // * pow(pow(x,y),z)-> pow(x,y*z) // // puts: -// * puts("") -> fputc("\n",stdout) (how do we get "stdout"?) +// * puts("") -> putchar("\n") // // round, roundf, roundl: // * round(cnst) -> cnst' From sabre at nondot.org Fri Apr 13 20:18:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 20:18:11 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/SimplifyLibCalls/Printf.ll Message-ID: <200704140118.l3E1IBf5025897@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/SimplifyLibCalls: Printf.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+20 -0) Printf.ll | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) Index: llvm/test/Transforms/SimplifyLibCalls/Printf.ll diff -c /dev/null llvm/test/Transforms/SimplifyLibCalls/Printf.ll:1.1 *** /dev/null Fri Apr 13 20:17:48 2007 --- llvm/test/Transforms/SimplifyLibCalls/Printf.ll Fri Apr 13 20:17:38 2007 *************** *** 0 **** --- 1,20 ---- + ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar && + ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*printf' + + @str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1] + @str1 = internal constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1] + + define void @foo() { + entry: + %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @str, i32 0, i32 0) ) ; [#uses=0] + ret void + } + + declare i32 @printf(i8*, ...) + + define void @bar() { + entry: + %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([2 x i8]* @str1, i32 0, i32 0) ) ; [#uses=0] + ret void + } + From sabre at nondot.org Fri Apr 13 21:27:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Fri, 13 Apr 2007 21:27:17 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704140227.l3E2RH68028052@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.418 -> 1.419 --- Log message: disable shift/and lowering to work around PR1325: http://llvm.org/PR1325 for now. --- Diffs of the changes: (+3 -1) SelectionDAGISel.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418 Fri Apr 13 01:53:51 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr 13 21:26:56 2007 @@ -1677,7 +1677,9 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR, CaseRecVector& WorkList, Value* SV, - MachineBasicBlock* Default) { + MachineBasicBlock* Default){ + return false; // DISABLED FOR NOW: PR1325. + unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); Case& FrontCase = *CR.Range.first; From reid at x10sys.com Fri Apr 13 22:59:57 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 13 Apr 2007 22:59:57 -0500 Subject: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html Message-ID: <200704140359.l3E3xvxN032446@zion.cs.uiuc.edu> Changes in directory llvm-www: DevMtgMay2007.html updated: 1.108 -> 1.109 --- Log message: Add Gabe McArthur. --- Diffs of the changes: (+3 -2) DevMtgMay2007.html | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.108 llvm-www/DevMtgMay2007.html:1.109 --- llvm-www/DevMtgMay2007.html:1.108 Fri Apr 13 17:13:27 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 22:59:36 2007 @@ -320,6 +320,7 @@ Steve NaroffApple Inc. Devang PatelApple Inc. Fernando Magno Quintao PereiraUCLA + Gabe McArthurIndependent Jeff PoznanovicCray Inc. Ron PriceApple Inc. Chuck RoseAdobe Systems Incorporated. @@ -334,7 +335,7 @@ -

    Total confirmed: 35

    +

    Total confirmed: 36

    @@ -353,6 +354,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!">Valid HTML 4.01! -
    Last modified: $Date: 2007/04/13 22:13:27 $ +
    Last modified: $Date: 2007/04/14 03:59:36 $ From reid at x10sys.com Sat Apr 14 04:39:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 04:39:49 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704140939.l3E9dnmM015970@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp added (r1.1) --- Log message: Initial version of a re-write of llvm-runtest that doesn't write the tests to a script file but executes each line individually and catches errors on each line too. --- Diffs of the changes: (+159 -0) llvm.exp | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 159 insertions(+) Index: llvm/test/lib/llvm.exp diff -c /dev/null llvm/test/lib/llvm.exp:1.1 *** /dev/null Sat Apr 14 04:39:38 2007 --- llvm/test/lib/llvm.exp Sat Apr 14 04:39:28 2007 *************** *** 0 **** --- 1,159 ---- + proc execOneLine { test outcome lineno line } { + set status 0 + set resultmsg "" + set retval [ catch { eval exec -keepnewline -- $line } errmsg ] + if { $retval != 0 } { + set code [lindex $::errorCode 0] + switch "$code" { + CHILDSTATUS { + set status [lindex $::errorCode 2] + if { $status ne 0 } { + set resultmsg "$test: exit($status)\nwhile running: $line\n$errmsg" + } + } + CHILDKILLED { + set signal [lindex $::errorCode 2] + set resultmsg "$test: signal($signal)\nwhile running: $line\n$errmsg" + } + CHILDSUSP { + set signal [lindex $::errorCode 2] + set resultmsg "$test: suspend($signal)\nwhile running: $line\n$errmsg" + } + POSIX { + set posixNum [lindex $::errorCode 1] + set posixMsg [lindex $::errorCode 2] + set resultmsg "$test: posix($posixNum)\n$posixMsg\nwhile running: $line\n$errmsg" + } + NONE { + } + default { + } + } + } + return $resultmsg + } + + proc substitute { line test tmpFile } { + global srcroot objroot srcdir objdir subdir target_triplet prcontext + global llvmgcc llvmgxx global llvmgcc_version llvmgccmajvers + global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir + + set new_line $line + #replace %prcontext with prcontext.tcl (Must replace before %p) + regsub -all {%prcontext} $new_line $prcontext new_line + #replace %llvmgcc with actual path to llvmgcc + regsub -all {%llvmgcc} $new_line "$llvmgcc -emit-llvm" new_line + #replace %llvmgxx with actual path to llvmg++ + regsub -all {%llvmgxx} $new_line "$llvmgxx -emit-llvm" new_line + #replace %compile_c with C compilation command + regsub -all {%compile_c} $new_line "$compile_c" new_line + #replace %compile_cxx with C++ compilation command + regsub -all {%compile_cxx} $new_line "$compile_cxx" new_line + #replace %link with C++ link command + regsub -all {%link} $new_line "$link" new_line + #replace %shlibext with shared library extension + regsub -all {%shlibext} $new_line "$shlibext" new_line + #replace %llvmlibsdir with configure library directory + regsub -all {%llvmlibsdir} $new_line "$llvmlibsdir" new_line + #replace %p with path to source, + regsub -all {%p} $new_line [file join $srcdir $subdir] new_line + #replace %s with filename + regsub -all {%s} $new_line $test new_line + #replace %t with temp filenames + regsub -all {%t} $new_line [file join Output $tmpFile] new_line + return $new_line + } + + proc llvm-runtest { programs } { + global srcroot objroot srcdir objdir subdir target_triplet + set timeout 60 + + set path [file join $objdir $subdir] + + #Make Output Directory if it does not exist already + if { [file exists path] } { + cd $path + } else { + file mkdir $path + cd $path + } + + file mkdir Output + + foreach test $programs { + #Should figure out best way to set the timeout + #set timeout 40 + + set filename [file tail $test] + set outcome PASS + set tmpFile "$filename.tmp" + + #set hasRunline bool to check if testcase has a runline + set numLines 0 + + # Open the test file and start reading lines + set testFileId [ open $test r] + set runline "" + foreach line [split [read $testFileId] \n] { + + #see if this is our run line + if {[regexp {END.[ *]$} $line match endofscript]} { + break + } elseif {[regexp {RUN: *([^\\]+)(\\)} $line match oneline suffix]} { + set runline "$runline$oneline " + } elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} { + set runline "$runline$oneline" + set runline [ substitute $runline $test $tmpFile ] + set lines($numLines) $runline + set numLines [expr $numLines + 1] + set runline "" + } elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} { + set targets + + #split up target if more then 1 specified + foreach target [split $targets ,] { + if { [regexp {\*} $target match] } { + set outcome XFAIL + } elseif { [regexp $target $target_triplet match] } { + set outcome XFAIL + } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } { + if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } { + set outcome XFAIL + } + } + } + } + } + + # Done reading the script + close $testFileId + + + if { $numLines == 0 } { + fail "$test: \nDoes not have a RUN line\n" + } else { + set failed 0 + for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } { + regsub ^.*RUN:(.*) $lines($i) \1 theLine + set theLine [subst $theLine ] + set resultmsg [execOneLine $test $outcome $i $theLine ] + if { $resultmsg != "" } { + if { $outcome == "XFAIL" } { + xfail "$resultmsg" + } else { + fail "$resultmsg" + } + set failed 1 + break + } + } + if { !$failed } { + if { $outcome == "XFAIL" } { + xpass "$test" + } else { + pass "$resultmsg" + } + } + } + } + } From reid at x10sys.com Sat Apr 14 04:43:51 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 04:43:51 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/llvm2cpp.ll Message-ID: <200704140943.l3E9hphS016062@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: llvm2cpp.ll updated: 1.2 -> 1.3 --- Log message: Fix a missing -f caught by the new llvm.exp script. --- Diffs of the changes: (+1 -1) llvm2cpp.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Feature/llvm2cpp.ll diff -u llvm/test/Feature/llvm2cpp.ll:1.2 llvm/test/Feature/llvm2cpp.ll:1.3 --- llvm/test/Feature/llvm2cpp.ll:1.2 Wed Apr 11 16:00:00 2007 +++ llvm/test/Feature/llvm2cpp.ll Sat Apr 14 04:43:30 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llvm-dis > %t1.ll -; RUN: llvm-as < %s | llvm2cpp -gen-program -o %t2.cpp - +; RUN: llvm-as < %s | llvm2cpp -gen-program -o %t2.cpp - -f ; RUN: %link -o %t2.exe %t2.cpp -lLLVMCore -lLLVMSupport -lLLVMbzip2 -lLLVMSystem -lstdc++ ; RUN: %t2.exe > %t2.ll ; RUN: diff %t1.ll %t2.ll From reid at x10sys.com Sat Apr 14 04:45:38 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 04:45:38 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/fold-fpcast.ll Message-ID: <200704140945.l3E9jcet016118@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: fold-fpcast.ll updated: 1.2 -> 1.3 --- Log message: Fix a missing -f that the new llvm.exp found. --- Diffs of the changes: (+1 -1) fold-fpcast.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Feature/fold-fpcast.ll diff -u llvm/test/Feature/fold-fpcast.ll:1.2 llvm/test/Feature/fold-fpcast.ll:1.3 --- llvm/test/Feature/fold-fpcast.ll:1.2 Wed Apr 11 07:04:33 2007 +++ llvm/test/Feature/fold-fpcast.ll Sat Apr 14 04:45:16 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null && +; RUN: llvm-upgrade < %s | llvm-as | llvm-dis -o /dev/null -f && ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep bitcast int %test1() { From reid at x10sys.com Sat Apr 14 04:49:30 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 04:49:30 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704140949.l3E9nUZa016237@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.12 -> 1.13 --- Log message: Add Ralph's naming entry. --- Diffs of the changes: (+13 -1) Name.html | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.12 llvm-www/Name.html:1.13 --- llvm-www/Name.html:1.12 Fri Apr 13 19:34:54 2007 +++ llvm-www/Name.html Sat Apr 14 04:49:08 2007 @@ -247,6 +247,18 @@ + + + +
    Unconfirmed Attendees
    NameOrganization
    Christopher LambTakoaFinnish for 'to hammer' or 'forge'. takoa.org is unclaimed. The image of a hammer is pretty iconographic.
    Ralph CorderoyDragomniThe cover of the Dragon book sets out to + slay the dragon, LLVM will slay all dragons in its field. Using + 'omni' wrongly as a suffix sounds better and keeps the "dragon" + sound going.
    DragonskiSimilar theory, "dragons + ki(ller)". + How to spell it is guessable from hearing it. Pronounciation + would be "dra-GONS-key" so hiding the origin a bit. The harsh + -ski ending sounds good. For both + this and the Dragomni above a "BSD daemon"-like logo of a dragon + named, e.g. Dragonski, could be used.
    @@ -257,6 +269,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/14 00:34:54 $ +
    Last modified: $Date: 2007/04/14 09:49:08 $ From baldrick at free.fr Sat Apr 14 07:30:48 2007 From: baldrick at free.fr (Duncan Sands) Date: Sat, 14 Apr 2007 07:30:48 -0500 Subject: [llvm-commits] CVS: llvm/docs/ExceptionHandling.html Message-ID: <200704141230.l3ECUm4T018884@zion.cs.uiuc.edu> Changes in directory llvm/docs: ExceptionHandling.html updated: 1.2 -> 1.3 --- Log message: Correct typo. --- Diffs of the changes: (+2 -2) ExceptionHandling.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ExceptionHandling.html diff -u llvm/docs/ExceptionHandling.html:1.2 llvm/docs/ExceptionHandling.html:1.3 --- llvm/docs/ExceptionHandling.html:1.2 Fri Mar 30 07:22:09 2007 +++ llvm/docs/ExceptionHandling.html Sat Apr 14 07:30:27 2007 @@ -186,7 +186,7 @@
    -

    A call within the scope of a try statement can potential raise an exception. +

    A call within the scope of a try statement can potentially raise an exception. In those circumstances, the LLVM C++ front-end replaces the call with an invoke instruction. Unlike a call, the invoke has two potential continuation points; where to continue when the call succeeds as per normal, and @@ -453,7 +453,7 @@ Chris Lattner
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/03/30 12:22:09 $ + Last modified: $Date: 2007/04/14 12:30:27 $ From asl at math.spbu.ru Sat Apr 14 08:26:26 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 14 Apr 2007 08:26:26 -0500 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll Message-ID: <200704141326.l3EDQQbY019747@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: 2007-04-14-BitTestsBadMask.ll added (r1.1) --- Log message: Fix PR1325: http://llvm.org/PR1325 : Case range optimization was performed in the case it shouldn't. Also fix some "latent" bug on 64-bit platforms --- Diffs of the changes: (+160 -0) 2007-04-14-BitTestsBadMask.ll | 160 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 160 insertions(+) Index: llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll:1.1 *** /dev/null Sat Apr 14 08:26:05 2007 --- llvm/test/CodeGen/Generic/2007-04-14-BitTestsBadMask.ll Sat Apr 14 08:25:55 2007 *************** *** 0 **** --- 1,160 ---- + ; RUN: llvm-as < %s | llc -march=x86 | grep '8388635' && + ; RUN: llvm-as < %s | llc -march=x86-64 | grep '4294981120' + ; PR 1325 + + ; ModuleID = 'bugpoint.test.bc' + 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" + target triple = "powerpc-apple-darwin8.8.0" + ;target triple = "i686-linux-gnu" + %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } + %struct.__sFILEX = type opaque + %struct.__sbuf = type { i8*, i32 } + @PL_rsfp = external global %struct.FILE* ; <%struct.FILE**> [#uses=1] + @PL_bufend = external global i8* ; [#uses=1] + @PL_in_eval = external global i32 ; [#uses=1] + + declare fastcc void @incline(i8*) + + define i16 @Perl_skipspace_bb60(i8* %s, i8** %s_addr.4.out) { + newFuncRoot: + %tmp138.loc = alloca i8* ; [#uses=2] + %s_addr.4.loc = alloca i8* ; [#uses=2] + %tmp274.loc = alloca i8* ; [#uses=2] + br label %bb60 + + cond_next154.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 0 + + cond_next161.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 1 + + cond_next167.UnifiedReturnBlock_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 2 + + cond_false29.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 3 + + cond_next.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 4 + + cond_true19.i.cond_true190_crit_edge.exitStub: ; preds = %codeRepl + store i8* %s_addr.4.reload, i8** %s_addr.4.out + ret i16 5 + + bb60: ; preds = %bb60.backedge, %newFuncRoot + %s_addr.2 = phi i8* [ %s, %newFuncRoot ], [ %s_addr.2.be, %bb60.backedge ] ; [#uses=3] + %tmp61 = load i8** @PL_bufend ; [#uses=1] + %tmp63 = icmp ult i8* %s_addr.2, %tmp61 ; [#uses=1] + br i1 %tmp63, label %bb60.cond_next67_crit_edge, label %bb60.bb101_crit_edge + + bb37: ; preds = %cond_next67.bb37_crit_edge5, %cond_next67.bb37_crit_edge4, %cond_next67.bb37_crit_edge3, %cond_next67.bb37_crit_edge2, %cond_next67.bb37_crit_edge + %tmp40 = icmp eq i8 %tmp69, 10 ; [#uses=1] + %tmp43 = getelementptr i8* %s_addr.27.2, i32 1 ; [#uses=5] + br i1 %tmp40, label %cond_true45, label %bb37.bb60_crit_edge + + cond_true45: ; preds = %bb37 + %tmp46 = volatile load i32* @PL_in_eval ; [#uses=1] + %tmp47 = icmp eq i32 %tmp46, 0 ; [#uses=1] + br i1 %tmp47, label %cond_true45.bb60_crit_edge, label %cond_true50 + + cond_true50: ; preds = %cond_true45 + %tmp51 = volatile load %struct.FILE** @PL_rsfp ; <%struct.FILE*> [#uses=1] + %tmp52 = icmp eq %struct.FILE* %tmp51, null ; [#uses=1] + br i1 %tmp52, label %cond_true55, label %cond_true50.bb60_crit_edge + + cond_true55: ; preds = %cond_true50 + tail call fastcc void @incline( i8* %tmp43 ) + br label %bb60.backedge + + cond_next67: ; preds = %Perl_newSV.exit.cond_next67_crit_edge, %cond_true148.cond_next67_crit_edge, %bb60.cond_next67_crit_edge + %s_addr.27.2 = phi i8* [ %s_addr.2, %bb60.cond_next67_crit_edge ], [ %tmp274.reload, %Perl_newSV.exit.cond_next67_crit_edge ], [ %tmp138.reload, %cond_true148.cond_next67_crit_edge ] ; [#uses=3] + %tmp69 = load i8* %s_addr.27.2 ; [#uses=2] + switch i8 %tmp69, label %cond_next67.bb101_crit_edge [ + i8 32, label %cond_next67.bb37_crit_edge + i8 9, label %cond_next67.bb37_crit_edge2 + i8 10, label %cond_next67.bb37_crit_edge3 + i8 13, label %cond_next67.bb37_crit_edge4 + i8 12, label %cond_next67.bb37_crit_edge5 + ] + + codeRepl: ; preds = %bb101.preheader + %targetBlock = call i16 @Perl_skipspace_bb60_bb101( i8* %s_addr.27.3.ph, i8** %tmp274.loc, i8** %s_addr.4.loc, i8** %tmp138.loc ) ; [#uses=1] + %tmp274.reload = load i8** %tmp274.loc ; [#uses=4] + %s_addr.4.reload = load i8** %s_addr.4.loc ; [#uses=6] + %tmp138.reload = load i8** %tmp138.loc ; [#uses=1] + switch i16 %targetBlock, label %cond_true19.i.cond_true190_crit_edge.exitStub [ + i16 0, label %cond_next271.bb60_crit_edge + i16 1, label %cond_true290.bb60_crit_edge + i16 2, label %cond_true295.bb60_crit_edge + i16 3, label %Perl_newSV.exit.cond_next67_crit_edge + i16 4, label %cond_true148.cond_next67_crit_edge + i16 5, label %cond_next154.UnifiedReturnBlock_crit_edge.exitStub + i16 6, label %cond_next161.UnifiedReturnBlock_crit_edge.exitStub + i16 7, label %cond_next167.UnifiedReturnBlock_crit_edge.exitStub + i16 8, label %cond_false29.i.cond_true190_crit_edge.exitStub + i16 9, label %cond_next.i.cond_true190_crit_edge.exitStub + ] + + bb37.bb60_crit_edge: ; preds = %bb37 + br label %bb60.backedge + + cond_true45.bb60_crit_edge: ; preds = %cond_true45 + br label %bb60.backedge + + cond_true50.bb60_crit_edge: ; preds = %cond_true50 + br label %bb60.backedge + + bb60.cond_next67_crit_edge: ; preds = %bb60 + br label %cond_next67 + + bb60.bb101_crit_edge: ; preds = %bb60 + br label %bb101.preheader + + cond_next67.bb101_crit_edge: ; preds = %cond_next67 + br label %bb101.preheader + + cond_next67.bb37_crit_edge: ; preds = %cond_next67 + br label %bb37 + + cond_next67.bb37_crit_edge2: ; preds = %cond_next67 + br label %bb37 + + cond_next67.bb37_crit_edge3: ; preds = %cond_next67 + br label %bb37 + + cond_next67.bb37_crit_edge4: ; preds = %cond_next67 + br label %bb37 + + cond_next67.bb37_crit_edge5: ; preds = %cond_next67 + br label %bb37 + + cond_true148.cond_next67_crit_edge: ; preds = %codeRepl + br label %cond_next67 + + cond_next271.bb60_crit_edge: ; preds = %codeRepl + br label %bb60.backedge + + cond_true290.bb60_crit_edge: ; preds = %codeRepl + br label %bb60.backedge + + cond_true295.bb60_crit_edge: ; preds = %codeRepl + br label %bb60.backedge + + Perl_newSV.exit.cond_next67_crit_edge: ; preds = %codeRepl + br label %cond_next67 + + bb101.preheader: ; preds = %cond_next67.bb101_crit_edge, %bb60.bb101_crit_edge + %s_addr.27.3.ph = phi i8* [ %s_addr.27.2, %cond_next67.bb101_crit_edge ], [ %s_addr.2, %bb60.bb101_crit_edge ] ; [#uses=1] + br label %codeRepl + + bb60.backedge: ; preds = %cond_true295.bb60_crit_edge, %cond_true290.bb60_crit_edge, %cond_next271.bb60_crit_edge, %cond_true50.bb60_crit_edge, %cond_true45.bb60_crit_edge, %bb37.bb60_crit_edge, %cond_true55 + %s_addr.2.be = phi i8* [ %tmp43, %cond_true55 ], [ %tmp43, %bb37.bb60_crit_edge ], [ %tmp43, %cond_true45.bb60_crit_edge ], [ %tmp43, %cond_true50.bb60_crit_edge ], [ %tmp274.reload, %cond_next271.bb60_crit_edge ], [ %tmp274.reload, %cond_true290.bb60_crit_edge ], [ %tmp274.reload, %cond_true295.bb60_crit_edge ] ; [#uses=1] + br label %bb60 + } + + declare i16 @Perl_skipspace_bb60_bb101(i8*, i8**, i8**, i8**) From asl at math.spbu.ru Sat Apr 14 08:26:27 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 14 Apr 2007 08:26:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704141326.l3EDQRMx019752@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.419 -> 1.420 --- Log message: Fix PR1325: http://llvm.org/PR1325 : Case range optimization was performed in the case it shouldn't. Also fix some "latent" bug on 64-bit platforms --- Diffs of the changes: (+2 -4) SelectionDAGISel.cpp | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.420 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419 Fri Apr 13 21:26:56 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat Apr 14 08:25:55 2007 @@ -1678,8 +1678,6 @@ CaseRecVector& WorkList, Value* SV, MachineBasicBlock* Default){ - return false; // DISABLED FOR NOW: PR1325. - unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); Case& FrontCase = *CR.Range.first; @@ -1732,7 +1730,7 @@ // word without having to subtract minValue. In this case, // we can optimize away the subtraction. if (cast(minValue)->getSExtValue() >= 0 && - cast(maxValue)->getSExtValue() <= IntPtrBits) { + cast(maxValue)->getSExtValue() < IntPtrBits) { range = cast(maxValue)->getSExtValue(); } else { lowBound = cast(minValue)->getSExtValue(); @@ -1757,7 +1755,7 @@ uint64_t hi = cast(I->High)->getSExtValue() - lowBound; for (uint64_t j = lo; j <= hi; j++) { - CasesBits[i].Mask |= 1 << j; + CasesBits[i].Mask |= 1ULL << j; CasesBits[i].Bits++; } From baldrick at free.fr Sat Apr 14 10:34:52 2007 From: baldrick at free.fr (Duncan Sands) Date: Sat, 14 Apr 2007 17:34:52 +0200 Subject: [llvm-commits] Handle global variables in eh_selector lowering Message-ID: <200704141734.53098.baldrick@free.fr> The eh_selector intrinsic wants global variables for its extra arguments, but wasn't expecting to get... global variables! Only bitcasts of global variables. Discovered by the Ada f-e, fix attached. Maybe it can be done more neatly, but I don't know LLVM well enough to say. Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: eh.diff Type: text/x-diff Size: 1717 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070414/135a5ab7/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: testcase.diff Type: text/x-diff Size: 779 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070414/135a5ab7/attachment-0001.bin From reid at x10sys.com Sat Apr 14 11:14:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:14:29 -0500 Subject: [llvm-commits] CVS: llvm/test/Scripts/ignore Message-ID: <200704141614.l3EGETsA022262@zion.cs.uiuc.edu> Changes in directory llvm/test/Scripts: ignore added (r1.1) --- Log message: Add a script to run a command but ignore its return code. This script always returns 0. This is useful with the llvm.exp based dejagnu testing when a test wants to check the error output of tool invocation that returns non-zero. Since every command is checked with llvm.exp, there needs to be a way to prevent that checking and this script is it. --- Diffs of the changes: (+10 -0) ignore | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/test/Scripts/ignore diff -c /dev/null llvm/test/Scripts/ignore:1.1 *** /dev/null Sat Apr 14 11:14:18 2007 --- llvm/test/Scripts/ignore Sat Apr 14 11:14:08 2007 *************** *** 0 **** --- 1,10 ---- + #!/bin/sh + # + # Program: ignore + # + # Synopsis: Ignore the result code of the command and always return 0 + # + # Syntax: ignore command + + "$@" || exit 0 && exit 0 + exit 0 From reid at x10sys.com Sat Apr 14 11:19:47 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:19:47 -0500 Subject: [llvm-commits] CVS: llvm/test/Integer/fold-fpcast_bt.ll Message-ID: <200704141619.l3EGJltU022392@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: fold-fpcast_bt.ll updated: 1.2 -> 1.3 --- Log message: FIx this test, thanks to llvm.exp --- Diffs of the changes: (+10 -10) fold-fpcast_bt.ll | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm/test/Integer/fold-fpcast_bt.ll diff -u llvm/test/Integer/fold-fpcast_bt.ll:1.2 llvm/test/Integer/fold-fpcast_bt.ll:1.3 --- llvm/test/Integer/fold-fpcast_bt.ll:1.2 Fri Jan 19 08:30:59 2007 +++ llvm/test/Integer/fold-fpcast_bt.ll Sat Apr 14 11:19:26 2007 @@ -1,33 +1,33 @@ ; RUN: llvm-as < %s | llvm-dis | not grep bitcast -define i60 %test1() { +define i60 @test1() { ret i60 fptoui(float 3.7 to i60) } -define float %test2() { +define float @test2() { ret float uitofp(i60 17 to float) } -define i64 %test3() { +define i64 @test3() { ret i64 bitcast (double 3.1415926 to i64) } -define double %test4() { +define double @test4() { ret double bitcast (i64 42 to double) } -define i30 %test5() { +define i30 @test5() { ret i30 fptoui(float 3.7 to i30) } -define float %test6() { +define float @test6() { ret float uitofp(i30 17 to float) } -define i6 %test7() { - ret i6 bitcast (double 3.1415926 to i6) +define i64 @test7() { + ret i64 bitcast (double 3.1415926 to i64) } -define double %test8() { - ret double bitcast (i9 42 to double) +define double @test8() { + ret double bitcast (i64 42 to double) } From reid at x10sys.com Sat Apr 14 11:40:29 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:40:29 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/dg.exp globalredefinition2.ll globalredefinition3.ll packed_struct.ll Message-ID: <200704141640.l3EGeTZd022814@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: dg.exp updated: 1.6 -> 1.7 globalredefinition2.ll updated: 1.2 -> 1.3 globalredefinition3.ll updated: 1.3 -> 1.4 packed_struct.ll updated: 1.6 -> 1.7 --- Log message: For PR1319: http://llvm.org/PR1319 : Changes necessary for conversion of this directory to run the tests under the llvm.exp version of llvm_runtest --- Diffs of the changes: (+8 -9) dg.exp | 2 +- globalredefinition2.ll | 2 +- globalredefinition3.ll | 6 ++---- packed_struct.ll | 7 ++++--- 4 files changed, 8 insertions(+), 9 deletions(-) Index: llvm/test/Feature/dg.exp diff -u llvm/test/Feature/dg.exp:1.6 llvm/test/Feature/dg.exp:1.7 --- llvm/test/Feature/dg.exp:1.6 Wed Apr 11 14:56:58 2007 +++ llvm/test/Feature/dg.exp Sat Apr 14 11:40:08 2007 @@ -1,3 +1,3 @@ -load_lib llvm-dg.exp +load_lib llvm.exp llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] Index: llvm/test/Feature/globalredefinition2.ll diff -u llvm/test/Feature/globalredefinition2.ll:1.2 llvm/test/Feature/globalredefinition2.ll:1.3 --- llvm/test/Feature/globalredefinition2.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Feature/globalredefinition2.ll Sat Apr 14 11:40:08 2007 @@ -1,5 +1,5 @@ ; Test that redefinitions of globals produces an error in llvm-upgrade -; RUN: llvm-upgrade < %s -o /dev/null -f 2>&1 | \ +; RUN: llvm-upgrade < %s -o /dev/null -f |& \ ; RUN: grep "Renaming global variable 'B' to.*linkage errors" %B = global int 7 Index: llvm/test/Feature/globalredefinition3.ll diff -u llvm/test/Feature/globalredefinition3.ll:1.3 llvm/test/Feature/globalredefinition3.ll:1.4 --- llvm/test/Feature/globalredefinition3.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Feature/globalredefinition3.ll Sat Apr 14 11:40:08 2007 @@ -1,8 +1,6 @@ -; When PR1067 is fixed, this should not be XFAIL any more. -; RUN: llvm-as < %s -o /dev/null -f 2>&1 | \ +; RUN: ignore llvm-as < %s -o /dev/null -f |& \ ; RUN: grep "Redefinition of global variable named 'B'" - -; Test forward references and redefinitions of globals +; END. @B = global i32 7 @B = global i32 7 Index: llvm/test/Feature/packed_struct.ll diff -u llvm/test/Feature/packed_struct.ll:1.6 llvm/test/Feature/packed_struct.ll:1.7 --- llvm/test/Feature/packed_struct.ll:1.6 Tue Mar 27 21:38:26 2007 +++ llvm/test/Feature/packed_struct.ll Sat Apr 14 11:40:08 2007 @@ -1,8 +1,9 @@ ; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll -; RUN: diff %t1.ll %t2.ll && -; RUN: not grep cast %t2.ll && -; RUN: grep "<{" %t2.ll +; RUN: diff %t1.ll %t2.ll +; RUN: not grep cast %t2.ll +; RUN: grep '\<{' %t2.ll +; END. %struct.anon = type <{ i8, i32, i32, i32 }> @foos = external global %struct.anon From reid at x10sys.com Sat Apr 14 11:42:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:42:00 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704141642.l3EGg0Yh022902@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.1 -> 1.2 --- Log message: Add the line number where the script failed to the error output. --- Diffs of the changes: (+6 -4) llvm.exp | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.1 llvm/test/lib/llvm.exp:1.2 --- llvm/test/lib/llvm.exp:1.1 Sat Apr 14 04:39:28 2007 +++ llvm/test/lib/llvm.exp Sat Apr 14 11:41:39 2007 @@ -4,25 +4,27 @@ set retval [ catch { eval exec -keepnewline -- $line } errmsg ] if { $retval != 0 } { set code [lindex $::errorCode 0] + set lineno [expr $lineno + 1] + set errmsg " at RUN: line $lineno\nwhile running: $line\n$errmsg" switch "$code" { CHILDSTATUS { set status [lindex $::errorCode 2] if { $status ne 0 } { - set resultmsg "$test: exit($status)\nwhile running: $line\n$errmsg" + set resultmsg "$test: exit($status)$errmsg" } } CHILDKILLED { set signal [lindex $::errorCode 2] - set resultmsg "$test: signal($signal)\nwhile running: $line\n$errmsg" + set resultmsg "$test: signal($signal)$errmsg" } CHILDSUSP { set signal [lindex $::errorCode 2] - set resultmsg "$test: suspend($signal)\nwhile running: $line\n$errmsg" + set resultmsg "$test: suspend($signal)$errmsg" } POSIX { set posixNum [lindex $::errorCode 1] set posixMsg [lindex $::errorCode 2] - set resultmsg "$test: posix($posixNum)\n$posixMsg\nwhile running: $line\n$errmsg" + set resultmsg "$test: posix($posixNum,$posixMsg)$errmsg" } NONE { } From reid at x10sys.com Sat Apr 14 11:49:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:49:16 -0500 Subject: [llvm-commits] CVS: llvm/test/Integer/2007-01-19-TruncSext.ll dg.exp packed_struct_bt.ll Message-ID: <200704141649.l3EGnG1G023044@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: 2007-01-19-TruncSext.ll updated: 1.3 -> 1.4 dg.exp updated: 1.2 -> 1.3 packed_struct_bt.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Changes necessary to run this with the "llvm.exp" version of llvm_runtest. --- Diffs of the changes: (+6 -5) 2007-01-19-TruncSext.ll | 2 +- dg.exp | 2 +- packed_struct_bt.ll | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) Index: llvm/test/Integer/2007-01-19-TruncSext.ll diff -u llvm/test/Integer/2007-01-19-TruncSext.ll:1.3 llvm/test/Integer/2007-01-19-TruncSext.ll:1.4 --- llvm/test/Integer/2007-01-19-TruncSext.ll:1.3 Tue Jan 30 10:16:01 2007 +++ llvm/test/Integer/2007-01-19-TruncSext.ll Sat Apr 14 11:48:55 2007 @@ -24,6 +24,6 @@ %result = sext i17 %X to i32 %fmt = getelementptr [4 x i8]* @FORMAT, i32 0, i32 0 call i32 (i8*,...)* @printf(i8* %fmt, i32 %result) - ret i32 %result + ret i32 0 } Index: llvm/test/Integer/dg.exp diff -u llvm/test/Integer/dg.exp:1.2 llvm/test/Integer/dg.exp:1.3 --- llvm/test/Integer/dg.exp:1.2 Wed Apr 11 14:56:58 2007 +++ llvm/test/Integer/dg.exp Sat Apr 14 11:48:55 2007 @@ -1,3 +1,3 @@ -load_lib llvm-dg.exp +load_lib llvm.exp llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] Index: llvm/test/Integer/packed_struct_bt.ll diff -u llvm/test/Integer/packed_struct_bt.ll:1.3 llvm/test/Integer/packed_struct_bt.ll:1.4 --- llvm/test/Integer/packed_struct_bt.ll:1.3 Tue Mar 27 21:38:26 2007 +++ llvm/test/Integer/packed_struct_bt.ll Sat Apr 14 11:48:55 2007 @@ -1,8 +1,9 @@ ; RUN: llvm-as < %s | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll -; RUN: diff %t1.ll %t2.ll && -; RUN: not grep cast %t2.ll && -; RUN: grep "<{" %t2.ll +; RUN: diff %t1.ll %t2.ll +; RUN: not grep cast %t2.ll +; RUN: grep '\<{' %t2.ll +; END. %struct.anon = type <{ i8, i35, i35, i35 }> @foos = external global %struct.anon From reid at x10sys.com Sat Apr 14 11:50:28 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 11:50:28 -0500 Subject: [llvm-commits] CVS: llvm-www/Name.html Message-ID: <200704141650.l3EGoSpV023140@zion.cs.uiuc.edu> Changes in directory llvm-www: Name.html updated: 1.13 -> 1.14 --- Log message: Add Gabor's entry. --- Diffs of the changes: (+7 -2) Name.html | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.13 llvm-www/Name.html:1.14 --- llvm-www/Name.html:1.13 Sat Apr 14 04:49:08 2007 +++ llvm-www/Name.html Sat Apr 14 11:50:07 2007 @@ -171,12 +171,17 @@ Often refers to diamonds, but historically can mean any hard, "unbreakable" stone, metal or other substance. - Gabor GreifOtimoIt is a Portuguese word, + Gabor GreifOtimoIt is a Portuguese word, meaning optimal, perfect. It is also different enough from plain English words to give a distinguished feel :-) and catch the eyes. The domains otimo.org and otimo.info are both available. Last, but not least it is a boon to the several LLVM developers of Portuguese tongue. + LeptonLoosely + meaning light (featherweight) in Greek. It is used in particle physics to refer to + very light particles (electrons, muons).
    + For me it also has the connotations of fastness and restlessness (in the LLVM sense + of post-compile optimization). Owen AndersonWarloc
    Warlock It can be thought @@ -269,6 +274,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! -
    Last modified: $Date: 2007/04/14 09:49:08 $ +
    Last modified: $Date: 2007/04/14 16:50:07 $ From jeffc at jolt-lang.org Sat Apr 14 11:55:41 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 14 Apr 2007 11:55:41 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp Message-ID: <200704141655.l3EGtf3Y023328@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ConstantMerge.cpp updated: 1.36 -> 1.37 --- Log message: Fix recent regression that broke several llvm-tests. --- Diffs of the changes: (+2 -0) ConstantMerge.cpp | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.36 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.37 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.36 Fri Apr 13 20:11:54 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Sat Apr 14 11:55:19 2007 @@ -66,6 +66,8 @@ GV->removeDeadConstantUsers(); if (GV->use_empty() && GV->hasInternalLinkage()) { (GV++)->eraseFromParent(); + if (GV == E) + break; } // Only process constants with initializers. From reid at x10sys.com Sat Apr 14 12:12:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 12:12:43 -0500 Subject: [llvm-commits] CVS: llvm/test/Integer/2007-01-19-TruncSext.ll Message-ID: <200704141712.l3EHChSd023649@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: 2007-01-19-TruncSext.ll updated: 1.4 -> 1.5 --- Log message: No need to quote things, shell isn't interpreting any more. --- Diffs of the changes: (+1 -1) 2007-01-19-TruncSext.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Integer/2007-01-19-TruncSext.ll diff -u llvm/test/Integer/2007-01-19-TruncSext.ll:1.4 llvm/test/Integer/2007-01-19-TruncSext.ll:1.5 --- llvm/test/Integer/2007-01-19-TruncSext.ll:1.4 Sat Apr 14 11:48:55 2007 +++ llvm/test/Integer/2007-01-19-TruncSext.ll Sat Apr 14 12:12:21 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -; RUN: llvm-as < %s | lli --force-interpreter=true | grep -- '-255' +; RUN: llvm-as < %s | lli --force-interpreter=true %t3.bc | grep -- -255 @ARRAY = global [ 20 x i17 ] zeroinitializer @FORMAT = constant [ 4 x i8 ] c"%d\0A\00" From jeffc at jolt-lang.org Sat Apr 14 12:18:50 2007 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 14 Apr 2007 12:18:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp Message-ID: <200704141718.l3EHIo3U023759@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ConstantMerge.cpp updated: 1.37 -> 1.38 --- Log message: An even better fix. --- Diffs of the changes: (+2 -3) ConstantMerge.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.37 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.38 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.37 Sat Apr 14 11:55:19 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Sat Apr 14 12:18:29 2007 @@ -65,9 +65,8 @@ // If this GV is dead, remove it. GV->removeDeadConstantUsers(); if (GV->use_empty() && GV->hasInternalLinkage()) { - (GV++)->eraseFromParent(); - if (GV == E) - break; + GV->eraseFromParent(); + continue; } // Only process constants with initializers. From baldrick at free.fr Sat Apr 14 12:29:35 2007 From: baldrick at free.fr (Duncan Sands) Date: Sat, 14 Apr 2007 19:29:35 +0200 Subject: [llvm-commits] Handle global variables in eh_selector lowering In-Reply-To: <200704141734.53098.baldrick@free.fr> References: <200704141734.53098.baldrick@free.fr> Message-ID: <200704141929.36762.baldrick@free.fr> How about this instead? Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: eh.diff Type: text/x-diff Size: 1613 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070414/7cad510c/attachment.bin From reid at x10sys.com Sat Apr 14 12:36:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 12:36:42 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704141736.l3EHagQW024113@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.2 -> 1.3 --- Log message: Print full errorInfo when a failure occurs. --- Diffs of the changes: (+1 -1) llvm.exp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.2 llvm/test/lib/llvm.exp:1.3 --- llvm/test/lib/llvm.exp:1.2 Sat Apr 14 11:41:39 2007 +++ llvm/test/lib/llvm.exp Sat Apr 14 12:36:20 2007 @@ -5,7 +5,7 @@ if { $retval != 0 } { set code [lindex $::errorCode 0] set lineno [expr $lineno + 1] - set errmsg " at RUN: line $lineno\nwhile running: $line\n$errmsg" + set errmsg " at RUN: line $lineno\n$::errorInfo\n$errmsg" switch "$code" { CHILDSTATUS { set status [lindex $::errorCode 2] From reid at x10sys.com Sat Apr 14 12:41:34 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 12:41:34 -0500 Subject: [llvm-commits] CVS: llvm/test/Integer/2007-01-19-TruncSext.ll Message-ID: <200704141741.l3EHfY6D024200@zion.cs.uiuc.edu> Changes in directory llvm/test/Integer: 2007-01-19-TruncSext.ll updated: 1.5 -> 1.6 --- Log message: Don't try to interpret a fictitious file. --- Diffs of the changes: (+1 -1) 2007-01-19-TruncSext.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Integer/2007-01-19-TruncSext.ll diff -u llvm/test/Integer/2007-01-19-TruncSext.ll:1.5 llvm/test/Integer/2007-01-19-TruncSext.ll:1.6 --- llvm/test/Integer/2007-01-19-TruncSext.ll:1.5 Sat Apr 14 12:12:21 2007 +++ llvm/test/Integer/2007-01-19-TruncSext.ll Sat Apr 14 12:41:12 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll ; RUN: diff %t1.ll %t2.ll -; RUN: llvm-as < %s | lli --force-interpreter=true %t3.bc | grep -- -255 +; RUN: llvm-as < %s | lli --force-interpreter=true | grep -- -255 @ARRAY = global [ 20 x i17 ] zeroinitializer @FORMAT = constant [ 4 x i8 ] c"%d\0A\00" From reid at x10sys.com Sat Apr 14 12:49:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 12:49:27 -0500 Subject: [llvm-commits] CVS: llvm/test/Feature/load_module.ll Message-ID: <200704141749.l3EHnRMU024482@zion.cs.uiuc.edu> Changes in directory llvm/test/Feature: load_module.ll updated: 1.3 -> 1.4 --- Log message: Simplify this test and correct redirection for Tcl exec. --- Diffs of the changes: (+2 -3) load_module.ll | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/test/Feature/load_module.ll diff -u llvm/test/Feature/load_module.ll:1.3 llvm/test/Feature/load_module.ll:1.4 --- llvm/test/Feature/load_module.ll:1.3 Wed Apr 11 20:12:54 2007 +++ llvm/test/Feature/load_module.ll Sat Apr 14 12:49:06 2007 @@ -1,7 +1,6 @@ ; PR1318 -; RUN: llvm-as < %s > %t.bc && -; RUN: opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \ -; RUN: -disable-output %t.bc 2>&1 | grep Hello +; RUN: llvm-as < %s | opt -load=%llvmlibsdir/LLVMHello%shlibext -hello \ +; RUN: -disable-output - |& grep Hello @junk = global i32 0 From sabre at nondot.org Sat Apr 14 13:07:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 14 Apr 2007 13:07:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp Message-ID: <200704141807.l3EI7EkG024940@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ConstantMerge.cpp updated: 1.38 -> 1.39 --- Log message: avoid iterator invalidation. --- Diffs of the changes: (+4 -2) ConstantMerge.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.38 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.39 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.38 Sat Apr 14 12:18:29 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Sat Apr 14 13:06:52 2007 @@ -60,8 +60,10 @@ // because doing so may cause initializers of other globals to be rewritten, // invalidating the Constant* pointers in CMap. // - for (Module::global_iterator GV = M.global_begin(), E = M.global_end(); - GV != E; ++GV) { + for (Module::global_iterator GVI = M.global_begin(), E = M.global_end(); + GVI != E; ) { + GlobalVariable *GV = GVI++; + // If this GV is dead, remove it. GV->removeDeadConstantUsers(); if (GV->use_empty() && GV->hasInternalLinkage()) { From reid at x10sys.com Sat Apr 14 13:26:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 13:26:25 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/apint-binop-cast.ll Message-ID: <200704141826.l3EIQPHV025317@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: apint-binop-cast.ll updated: 1.1 -> 1.2 --- Log message: Fix an "already-upgraded" test that llvm.exp found. --- Diffs of the changes: (+1 -1) apint-binop-cast.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/InstCombine/apint-binop-cast.ll diff -u llvm/test/Transforms/InstCombine/apint-binop-cast.ll:1.1 llvm/test/Transforms/InstCombine/apint-binop-cast.ll:1.2 --- llvm/test/Transforms/InstCombine/apint-binop-cast.ll:1.1 Fri Mar 23 15:48:33 2007 +++ llvm/test/Transforms/InstCombine/apint-binop-cast.ll Sat Apr 14 13:26:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast define i47 @testAdd(i31 %X, i31 %Y) { %tmp = add i31 %X, %Y From reid at x10sys.com Sat Apr 14 13:28:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 13:28:40 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/apint-div1.ll Message-ID: <200704141828.l3EISeIn025369@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: apint-div1.ll updated: 1.2 -> 1.3 --- Log message: Fix a syntax error that llvm.exp found. --- Diffs of the changes: (+1 -2) apint-div1.ll | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/Transforms/InstCombine/apint-div1.ll diff -u llvm/test/Transforms/InstCombine/apint-div1.ll:1.2 llvm/test/Transforms/InstCombine/apint-div1.ll:1.3 --- llvm/test/Transforms/InstCombine/apint-div1.ll:1.2 Tue Mar 27 21:38:26 2007 +++ llvm/test/Transforms/InstCombine/apint-div1.ll Sat Apr 14 13:28:16 2007 @@ -1,7 +1,6 @@ ; This test makes sure that div instructions are properly eliminated. ; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0. ; - ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div @@ -17,7 +16,7 @@ } define i59 @test3(i59 %X, bool %C) { - %V = select bool %C, i59 1024, i59 4096 + %V = select i1 %C, i59 1024, i59 4096 %R = udiv i59 %X, %V ret i59 %R } From reid at x10sys.com Sat Apr 14 13:30:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 13:30:27 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/apint-div1.ll apint-div2.ll Message-ID: <200704141830.l3EIURvV025415@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: apint-div1.ll updated: 1.3 -> 1.4 apint-div2.ll updated: 1.2 -> 1.3 --- Log message: bool -> i1 (found by llvm.exp) --- Diffs of the changes: (+3 -4) apint-div1.ll | 2 +- apint-div2.ll | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/test/Transforms/InstCombine/apint-div1.ll diff -u llvm/test/Transforms/InstCombine/apint-div1.ll:1.3 llvm/test/Transforms/InstCombine/apint-div1.ll:1.4 --- llvm/test/Transforms/InstCombine/apint-div1.ll:1.3 Sat Apr 14 13:28:16 2007 +++ llvm/test/Transforms/InstCombine/apint-div1.ll Sat Apr 14 13:30:06 2007 @@ -15,7 +15,7 @@ ret i49 %Y } -define i59 @test3(i59 %X, bool %C) { +define i59 @test3(i59 %X, i1 %C) { %V = select i1 %C, i59 1024, i59 4096 %R = udiv i59 %X, %V ret i59 %R Index: llvm/test/Transforms/InstCombine/apint-div2.ll diff -u llvm/test/Transforms/InstCombine/apint-div2.ll:1.2 llvm/test/Transforms/InstCombine/apint-div2.ll:1.3 --- llvm/test/Transforms/InstCombine/apint-div2.ll:1.2 Tue Mar 27 21:38:26 2007 +++ llvm/test/Transforms/InstCombine/apint-div2.ll Sat Apr 14 13:30:06 2007 @@ -1,7 +1,6 @@ ; This test makes sure that div instructions are properly eliminated. ; This test is for Integer BitWidth >= 64 && BitWidth <= 1024. ; - ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep div @@ -16,8 +15,8 @@ ret i499 %Y } -define i599 @test3(i599 %X, bool %C) { - %V = select bool %C, i599 70368744177664, i599 4096 +define i599 @test3(i599 %X, i1 %C) { + %V = select i1 %C, i599 70368744177664, i599 4096 %R = udiv i599 %X, %V ret i599 %R } From reid at x10sys.com Sat Apr 14 13:33:52 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 13:33:52 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/binop-cast.ll Message-ID: <200704141833.l3EIXqMe025477@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: binop-cast.ll updated: 1.2 -> 1.3 --- Log message: Fix a test test llvm.exp found. --- Diffs of the changes: (+5 -5) binop-cast.ll | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/test/Transforms/InstCombine/binop-cast.ll diff -u llvm/test/Transforms/InstCombine/binop-cast.ll:1.2 llvm/test/Transforms/InstCombine/binop-cast.ll:1.3 --- llvm/test/Transforms/InstCombine/binop-cast.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/binop-cast.ll Sat Apr 14 13:33:31 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | notcast -uint %testAdd(int %X, int %Y) { - %tmp = add int %X, %Y - %tmp.l = sext int %tmp to uint - ret uint %tmp.l +define i32 @testAdd(i32 %X, i32 %Y) { + %tmp = add i32 %X, %Y + %tmp.l = bitcast i32 %tmp to i32 + ret i32 %tmp.l } From reid at x10sys.com Sat Apr 14 13:51:40 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 13:51:40 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704141851.l3EIpeNs025812@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.3 -> 1.4 --- Log message: 1. Don't generate redundant copy of stderr 2. Only match \ at the *end* of a line. --- Diffs of the changes: (+2 -2) llvm.exp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.3 llvm/test/lib/llvm.exp:1.4 --- llvm/test/lib/llvm.exp:1.3 Sat Apr 14 12:36:20 2007 +++ llvm/test/lib/llvm.exp Sat Apr 14 13:51:19 2007 @@ -5,7 +5,7 @@ if { $retval != 0 } { set code [lindex $::errorCode 0] set lineno [expr $lineno + 1] - set errmsg " at RUN: line $lineno\n$::errorInfo\n$errmsg" + set errmsg " at RUN: line $lineno\n$::errorInfo" switch "$code" { CHILDSTATUS { set status [lindex $::errorCode 2] @@ -101,7 +101,7 @@ #see if this is our run line if {[regexp {END.[ *]$} $line match endofscript]} { break - } elseif {[regexp {RUN: *([^\\]+)(\\)} $line match oneline suffix]} { + } elseif {[regexp {RUN: *([^\\]+)(\\)$} $line match oneline suffix]} { set runline "$runline$oneline " } elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} { set runline "$runline$oneline" From reid at x10sys.com Sat Apr 14 14:10:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 14:10:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/Andersens/dg.exp modreftest.ll Message-ID: <200704141910.l3EJAgHP026222@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/Andersens: dg.exp updated: 1.4 -> 1.5 modreftest.ll updated: 1.3 -> 1.4 --- Log message: For PR1319: http://llvm.org/PR1319 : Convert to use new llvm.exp version of llvm_testrun --- Diffs of the changes: (+2 -2) dg.exp | 2 +- modreftest.ll | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Analysis/Andersens/dg.exp diff -u llvm/test/Analysis/Andersens/dg.exp:1.4 llvm/test/Analysis/Andersens/dg.exp:1.5 --- llvm/test/Analysis/Andersens/dg.exp:1.4 Wed Apr 11 14:56:57 2007 +++ llvm/test/Analysis/Andersens/dg.exp Sat Apr 14 14:10:21 2007 @@ -1,4 +1,4 @@ -load_lib llvm-dg.exp +load_lib llvm.exp llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] Index: llvm/test/Analysis/Andersens/modreftest.ll diff -u llvm/test/Analysis/Andersens/modreftest.ll:1.3 llvm/test/Analysis/Andersens/modreftest.ll:1.4 --- llvm/test/Analysis/Andersens/modreftest.ll:1.3 Fri Jan 12 23:06:52 2007 +++ llvm/test/Analysis/Andersens/modreftest.ll Sat Apr 14 14:10:21 2007 @@ -1,6 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as | \ ; RUN: opt -anders-aa -load-vn -gcse -instcombine | llvm-dis | \ -; RUN: grep 'ret i1 true' +; RUN: grep {ret i1 true} %G = internal global int* null declare int *%ext() From reid at x10sys.com Sat Apr 14 14:27:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 14:27:24 -0500 Subject: [llvm-commits] CVS: llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx 2004-07-28-MustAliasbug.llx 2005-03-09-BrokenBasicAA.ll 2007-01-13-BasePointerBadNoAlias.ll dg.exp tailcall-modref.ll Message-ID: <200704141927.l3EJROfN026695@zion.cs.uiuc.edu> Changes in directory llvm/test/Analysis/BasicAA: 2004-01-29-InvariantMemory.llx updated: 1.1 -> 1.2 2004-07-28-MustAliasbug.llx updated: 1.3 -> 1.4 2005-03-09-BrokenBasicAA.ll updated: 1.3 -> 1.4 2007-01-13-BasePointerBadNoAlias.ll updated: 1.3 -> 1.4 dg.exp updated: 1.4 -> 1.5 tailcall-modref.ll updated: 1.3 -> 1.4 --- Log message: Convert test cases to new llvm.exp version of llvm_runtest and fix tests that it found to be broken. --- Diffs of the changes: (+13 -7) 2004-01-29-InvariantMemory.llx | 3 ++- 2004-07-28-MustAliasbug.llx | 2 +- 2005-03-09-BrokenBasicAA.ll | 3 ++- 2007-01-13-BasePointerBadNoAlias.ll | 7 +++++-- dg.exp | 2 +- tailcall-modref.ll | 3 ++- 6 files changed, 13 insertions(+), 7 deletions(-) Index: llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx diff -u llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx:1.1 llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx:1.2 --- llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx:1.1 Fri Jan 30 16:18:47 2004 +++ llvm/test/Analysis/BasicAA/2004-01-29-InvariantMemory.llx Sat Apr 14 14:27:03 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-as < %s | opt -load-vn -gcse -instcombine | llvm-dis | not grep load +; RUN: llvm-upgrade < %s | llvm-as | opt -load-vn -gcse -instcombine | \ +; RUN: llvm-dis | not grep load %X = constant [2 x int] [int 4, int 5] Index: llvm/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx diff -u llvm/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx:1.3 llvm/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx:1.4 --- llvm/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Analysis/BasicAA/2004-07-28-MustAliasbug.llx Sat Apr 14 14:27:03 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep 'store i32 0' +; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep {store i32 0} void %test({int,int }* %P) { %Q = getelementptr {int,int}* %P, int 1 Index: llvm/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll diff -u llvm/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll:1.3 llvm/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll:1.4 --- llvm/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll Sat Apr 14 14:27:03 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'load i32\* %A' +; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine |\ +; RUN: llvm-dis | grep {load i32\\* %A} declare double* %useit(int*) Index: llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll diff -u llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll:1.3 llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll:1.4 --- llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll:1.3 Tue Mar 27 21:38:26 2007 +++ llvm/test/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll Sat Apr 14 14:27:03 2007 @@ -1,6 +1,9 @@ -; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'sub i32' && -; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep 'ret i32 0' ; PR1109 +; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | \ +; RUN: grep {sub i32} +; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | \ +; RUN: not grep {ret i32 0} +; END. target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8" Index: llvm/test/Analysis/BasicAA/dg.exp diff -u llvm/test/Analysis/BasicAA/dg.exp:1.4 llvm/test/Analysis/BasicAA/dg.exp:1.5 --- llvm/test/Analysis/BasicAA/dg.exp:1.4 Wed Apr 11 14:56:57 2007 +++ llvm/test/Analysis/BasicAA/dg.exp Sat Apr 14 14:27:03 2007 @@ -1,3 +1,3 @@ -load_lib llvm-dg.exp +load_lib llvm.exp llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] Index: llvm/test/Analysis/BasicAA/tailcall-modref.ll diff -u llvm/test/Analysis/BasicAA/tailcall-modref.ll:1.3 llvm/test/Analysis/BasicAA/tailcall-modref.ll:1.4 --- llvm/test/Analysis/BasicAA/tailcall-modref.ll:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Analysis/BasicAA/tailcall-modref.ll Sat Apr 14 14:27:03 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'ret i32 0' +; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine |\ +; RUN: llvm-dis | grep {ret i32 0} declare void %foo(int*) declare void %bar() From reid at x10sys.com Sat Apr 14 14:37:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 14:37:44 -0500 Subject: [llvm-commits] CVS: llvm/test/lib/llvm.exp Message-ID: <200704141937.l3EJbi8M026895@zion.cs.uiuc.edu> Changes in directory llvm/test/lib: llvm.exp updated: 1.4 -> 1.5 --- Log message: For PR1319: http://llvm.org/PR1319 : More improvements: 1. Using ::errorInfo wasn't such a hot idea. Go back to just printing the offending line of code and the stderr output. This is sufficient and not entangled with Tcl goop. 2. Capture the problem report numbers and report them whether pass or fail. This helps quickly get some context when a test fails, if it has an associated PR number. --- Diffs of the changes: (+27 -6) llvm.exp | 33 +++++++++++++++++++++++++++------ 1 files changed, 27 insertions(+), 6 deletions(-) Index: llvm/test/lib/llvm.exp diff -u llvm/test/lib/llvm.exp:1.4 llvm/test/lib/llvm.exp:1.5 --- llvm/test/lib/llvm.exp:1.4 Sat Apr 14 13:51:19 2007 +++ llvm/test/lib/llvm.exp Sat Apr 14 14:37:22 2007 @@ -1,11 +1,14 @@ -proc execOneLine { test outcome lineno line } { +proc execOneLine { test PRS outcome lineno line } { set status 0 set resultmsg "" set retval [ catch { eval exec -keepnewline -- $line } errmsg ] if { $retval != 0 } { set code [lindex $::errorCode 0] set lineno [expr $lineno + 1] - set errmsg " at RUN: line $lineno\n$::errorInfo" + if { $PRS != ""} { + set PRS " for $PRS" + } + set errmsg " at line $lineno$PRS\nwhile running: $line\n$errmsg" switch "$code" { CHILDSTATUS { set status [lindex $::errorCode 2] @@ -96,19 +99,34 @@ # Open the test file and start reading lines set testFileId [ open $test r] set runline "" + set PRNUMS "" foreach line [split [read $testFileId] \n] { - #see if this is our run line + # if its the END. line then stop parsing (optimization for big files) if {[regexp {END.[ *]$} $line match endofscript]} { break + + # if the line is continued, concatente and continue the loop } elseif {[regexp {RUN: *([^\\]+)(\\)$} $line match oneline suffix]} { set runline "$runline$oneline " + + # if its a terminating RUN: line then do substitution on the whole line + # and then save the line. } elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} { set runline "$runline$oneline" set runline [ substitute $runline $test $tmpFile ] set lines($numLines) $runline set numLines [expr $numLines + 1] set runline "" + + # if its an PR line, save the problem report number + } elseif {[regexp {PR([0-9]+)} $line match prnum]} { + if {$PRNUMS == ""} { + set PRNUMS $prnum + } else { + set PRNUMS "$PRNUMS,$prnum" + } + # if its an XFAIL line, see if we should be XFAILing or not. } elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} { set targets @@ -138,7 +156,7 @@ for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } { regsub ^.*RUN:(.*) $lines($i) \1 theLine set theLine [subst $theLine ] - set resultmsg [execOneLine $test $outcome $i $theLine ] + set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ] if { $resultmsg != "" } { if { $outcome == "XFAIL" } { xfail "$resultmsg" @@ -150,10 +168,13 @@ } } if { !$failed } { + if {$PRNUMS != ""} { + set PRNUMS " for $PRNUMS" + } if { $outcome == "XFAIL" } { - xpass "$test" + xpass "$test$PRNUMS" } else { - pass "$resultmsg" + pass "$test$PRNUMS" } } } From sabre at nondot.org Sat Apr 14 14:40:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Sat, 14 Apr 2007 14:40:03 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200704141940.l3EJe3Ec026981@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.420 -> 1.421 --- Log message: disable switch lowering using shift/and. It still breaks ppc bootstrap for some reason. :( Will investigate. --- Diffs of the changes: (+1 -0) SelectionDAGISel.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.420 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.421 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.420 Sat Apr 14 08:25:55 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sat Apr 14 14:39:41 2007 @@ -1678,6 +1678,7 @@ CaseRecVector& WorkList, Value* SV, MachineBasicBlock* Default){ + return false; unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); Case& FrontCase = *CR.Range.first; From clattner at apple.com Sat Apr 14 14:42:51 2007 From: clattner at apple.com (clattner at apple.com) Date: Sat, 14 Apr 2007 12:42:51 -0700 (PDT) Subject: [llvm-commits] [126124] CEIL_DIV_EXPR performs integer division with rounding Message-ID: <20070414194251.D574CEBD0F73@src> Revision: 126124 Author: clattner Date: 2007-04-14 12:42:51 -0700 (Sat, 14 Apr 2007) Log Message: ----------- CEIL_DIV_EXPR performs integer division with rounding towards positive infinity, thus 3 cdiv 2 = 2 while -3 cdiv 2 = -1. Testing is tricky, because CEIL_DIV_EXPR is only generated in unusual circumstances, giving little coverage, so I modified the llvm- and mainline gcc compilers to output CEIL_DIV_EXPR for normal division, and compared the results for all possible signed and unsigned i8 values for the left- and right-hand sides. Patch by Duncan Sands. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-internal.h Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-14 18:14:58 UTC (rev 126123) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-14 19:42:51 UTC (rev 126124) @@ -779,6 +779,7 @@ Result = EmitBinOp(exp, DestLoc, Instruction::SDiv); break; case RDIV_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::FDiv); break; + case CEIL_DIV_EXPR: Result = EmitCEIL_DIV_EXPR(exp); break; case ROUND_DIV_EXPR: Result = EmitROUND_DIV_EXPR(exp); break; case TRUNC_MOD_EXPR: if (TYPE_UNSIGNED(TREE_TYPE(exp))) @@ -3200,6 +3201,82 @@ return new SelectInst(SameAsRem, Rem, RemPlusRHS, "mod", CurBB); } +Value *TreeToLLVM::EmitCEIL_DIV_EXPR(tree exp) { + // Notation: CEIL_DIV_EXPR <-> CDiv, TRUNC_DIV_EXPR <-> Div. + + // CDiv calculates LHS/RHS by rounding up to the nearest integer. In terms + // of Div this means if the values of LHS and RHS have opposite signs or if + // LHS is zero, then CDiv necessarily equals Div; and + // LHS CDiv RHS = (LHS - Sign(RHS)) Div RHS + 1 + // otherwise. + + const Type *Ty = ConvertType(TREE_TYPE(exp)); + Constant *Zero = ConstantInt::get(Ty, 0); + Constant *One = ConstantInt::get(Ty, 1); + Constant *MinusOne = ConstantInt::get(Ty, -1); + + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); + Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); + + if (!TYPE_UNSIGNED(TREE_TYPE(exp))) { + // In the case of signed arithmetic, we calculate CDiv as follows: + // LHS CDiv RHS = (LHS - Sign(RHS) * Offset) Div RHS + Offset, + // where Offset is 1 if LHS and RHS have the same sign and LHS is + // not zero, and 0 otherwise. + + // On some machines INT_MIN Div -1 traps. You might expect a trap for + // INT_MIN CDiv -1 too, but this implementation will not generate one. + // Quick quiz question: what value is returned for INT_MIN CDiv -1? + + // Determine the signs of LHS and RHS, and whether they have the same sign. + Value *LHSIsPositive = new ICmpInst(ICmpInst::ICMP_SGE, LHS, Zero, "tmp", + CurBB); + Value *RHSIsPositive = new ICmpInst(ICmpInst::ICMP_SGE, RHS, Zero, "tmp", + CurBB); + Value *HaveSameSign = new ICmpInst(ICmpInst::ICMP_EQ, LHSIsPositive, + RHSIsPositive, "tmp", CurBB); + + // Offset equals 1 if LHS and RHS have the same sign and LHS is not zero ... + Value *LHSNotZero = new ICmpInst(ICmpInst::ICMP_NE, LHS, Zero, "tmp", + CurBB); + Value *OffsetOne = BinaryOperator::create(Instruction::And, HaveSameSign, + LHSNotZero, "tmp", CurBB); + // ... otherwise it is 0. + Value *Offset = new SelectInst(OffsetOne, One, Zero, "tmp", CurBB); + + // Calculate Sign(RHS) ... + Value *SignRHS = new SelectInst(RHSIsPositive, One, MinusOne, "tmp", CurBB); + // ... and Sign(RHS) * Offset + Value *SignedOffset = CastToType(Instruction::SExt, OffsetOne, Ty); + SignedOffset = BinaryOperator::create(Instruction::And, SignRHS, + SignedOffset, "tmp", CurBB); + + // Return CDiv = (LHS - Sign(RHS) * Offset) Div RHS + Offset. + Value *CDiv = BinaryOperator::create(Instruction::Sub, LHS, SignedOffset, + "tmp", CurBB); + CDiv = BinaryOperator::create(Instruction::SDiv, CDiv, RHS, "tmp", CurBB); + return BinaryOperator::create(Instruction::Add, CDiv, Offset, "cdiv", + CurBB); + } else { + // In the case of unsigned arithmetic, LHS and RHS necessarily have the + // same sign, so we can use + // LHS CDiv RHS = (LHS - 1) Div RHS + 1 + // as long as LHS is non-zero. + + // Offset is 1 if LHS is non-zero, 0 otherwise. + Value *LHSNotZero = new ICmpInst(ICmpInst::ICMP_NE, LHS, Zero, "tmp", + CurBB); + Value *Offset = new SelectInst(LHSNotZero, One, Zero, "tmp", CurBB); + + // Return CDiv = (LHS - Offset) Div RHS + Offset. + Value *CDiv = BinaryOperator::create(Instruction::Sub, LHS, Offset, "tmp", + CurBB); + CDiv = BinaryOperator::create(Instruction::UDiv, CDiv, RHS, "tmp", CurBB); + return BinaryOperator::create(Instruction::Add, CDiv, Offset, "cdiv", + CurBB); + } +} + Value *TreeToLLVM::EmitROUND_DIV_EXPR(tree exp) { // Notation: ROUND_DIV_EXPR <-> RDiv, TRUNC_DIV_EXPR <-> Div. Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-14 18:14:58 UTC (rev 126123) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-04-14 19:42:51 UTC (rev 126124) @@ -466,6 +466,7 @@ Value *EmitMinMaxExpr(tree_node *exp, unsigned UIPred, unsigned SIPred, unsigned Opc); Value *EmitFLOOR_MOD_EXPR(tree_node *exp, Value *DestLoc); + Value *EmitCEIL_DIV_EXPR(tree_node *exp); Value *EmitROUND_DIV_EXPR(tree_node *exp); // Inline Assembly and Register Variables. From clattner at apple.com Sat Apr 14 14:45:35 2007 From: clattner at apple.com (Chris Lattner) Date: Sat, 14 Apr 2007 12:45:35 -0700 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/tls.c Makefile In-Reply-To: <200704111857.l3BIv36r028008@zion.cs.uiuc.edu> References: <200704111857.l3BIv36r028008@zion.cs.uiuc.edu> Message-ID: <56E217D4-4135-477B-9DDF-E45CC38D30FE@apple.com> On Apr 11, 2007, at 11:57 AM, Lauro Ramos Venancio wrote: > Add a TLS test. Hi Lauro, can you please add a "Threads" subdirectory of UnitTests and move this testcase there? That way we won't be linking all UnitTests with -lpthreads. Thanks! -Chris > > --- > Diffs of the changes: (+21 -0) > > Makefile | 1 + > tls.c | 20 ++++++++++++++++++++ > 2 files changed, 21 insertions(+) > > > Index: llvm-test/SingleSource/UnitTests/tls.c > diff -c /dev/null llvm-test/SingleSource/UnitTests/tls.c:1.1 > *** /dev/null Wed Apr 11 13:56:56 2007 > --- llvm-test/SingleSource/UnitTests/tls.c Wed Apr 11 13:56:46 2007 > *************** > *** 0 **** > --- 1,20 ---- > + #include > + #include > + > + void *f(void *a){ > + static __thread int i = 1; > + i++; > + return (void *)i; > + } > + > + int main() { > + pthread_t t; > + int ret; > + pthread_create(&t, NULL, f, NULL); > + pthread_join(t, (void **) &ret); > + printf("Thread 1: %d\n",ret); > + pthread_create(&t, NULL, f, NULL); > + pthread_join(t, (void **) &ret); > + printf("Thread 2: %d\n",ret); > + return 0; > + } > > > Index: llvm-test/SingleSource/UnitTests/Makefile > diff -u llvm-test/SingleSource/UnitTests/Makefile:1.14 llvm-test/ > SingleSource/UnitTests/Makefile:1.15 > --- llvm-test/SingleSource/UnitTests/Makefile:1.14 Tue Apr 10 > 18:52:47 2007 > +++ llvm-test/SingleSource/UnitTests/Makefile Wed Apr 11 13:56:46 2007 > @@ -15,5 +15,6 @@ > > DIRS += SignlessTypes > > +LDFLAGS += -lpthread > PROGRAM_REQUIRED_TO_EXIT_OK := 1 > include $(LEVEL)/SingleSource/Makefile.singlesrc > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Sat Apr 14 15:03:12 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 15:03:12 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/fpcast.ll Message-ID: <200704142003.l3EK3CdX027623@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: fpcast.ll updated: 1.3 -> 1.4 --- Log message: This test needs to use egrep. --- Diffs of the changes: (+1 -1) fpcast.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/InstCombine/fpcast.ll diff -u llvm/test/Transforms/InstCombine/fpcast.ll:1.3 llvm/test/Transforms/InstCombine/fpcast.ll:1.4 --- llvm/test/Transforms/InstCombine/fpcast.ll:1.3 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/InstCombine/fpcast.ll Sat Apr 14 15:02:51 2007 @@ -1,7 +1,7 @@ ; Test some floating point casting cases ; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast ; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \ -; RUN: grep 'ret i8 \(-1\)\|\(255\)' +; RUN: egrep {ret i8 \(-1\)\|\(255\)} sbyte %test1() { %x = fptoui float 255.0 to sbyte From reid at x10sys.com Sat Apr 14 15:13:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Sat, 14 Apr 2007 15:13:24 -0500 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll 2003-08-12-AllocaNonNull.ll 2004-08-10-BoolSetCC.ll 2004-09-20-BadLoadCombine.llx 2004-09-20-BadLoadCombine2.llx 2004-11-27-SetCCForCastLargerAndConstant.ll 2005-03-04-ShiftOverflow.ll 2005-06-16-SetCCOrSetCCMiscompile.ll 2006-02-13-DemandedMiscompile.ll 2006-04-28-ShiftShiftLongLong.ll 2006-10-19-SignedToUnsignedCastAndConst-2.ll 2006-10-19-SignedToUnsignedCastAndConst.ll 2006-10-20-mask.ll 2006-10-26-VectorReassoc.ll 2006-11-03-Memmove64.ll 2006-11-27-XorBug.ll 2006-12-01-BadFPVectorXform.ll 2006-12-08-ICmp-Combining.ll 2006-12-08-Phi-ICmp-Op-Fold.ll 2006-12-08-Select-ICmp.ll 2006-12-10-ICmp-GEP-GEP.ll 2006-12-15-Range-Test.ll 2006-12-23-Select-Cmp-Cmp.ll 2007-01-14-FcmpSelf.ll 2007-01-27-AndICmp.ll 2007-02-01-LoadSinkAlloca.ll 2007-02-07-PointerCast.ll 2007-03-13-CompareMerge.ll 2007-03-21-SignedRangeTest.ll 2007-03-25-BadShiftMask.ll 2007-03-26-BadShiftMask.ll 2007-03-27-PR1280.ll 2007-03-31-InfiniteL! oop.ll 2007-04-04-BadFoldBitcastIntoMalloc.ll CPP_min_max.llx GEPIdxCanon.ll JavaCompare.ll alloca.ll and-compare.ll and-or-and.ll and-xor-merge.ll apint-add1.ll apint-add2.ll apint-and-or-and.ll apint-and-xor-merge.ll apint-and1.ll apint-and2.ll apint-cast.ll apint-elim-logicalops.ll apint-or2.ll apint-rem1.ll apint-rem2.ll apint-select.ll apint-shift-simplify.ll apint-shift.ll apint-shl-trunc.ll apint-sub.ll apint-xor1.ll apint-xor2.ll apint-zext1.ll apint-zext2.ll bit-tracking.ll bitcount.ll bittest.ll bswap-fold.ll bswap.ll call-cast-target.ll call.ll canonicalize_branch.ll cast-and-cast.ll cast-cast-to-and.ll cast-load-gep.ll cast-propagate.ll cast.ll cast2.ll cast_ptr.ll deadcode.ll dg.exp getelementptr-setcc.ll getelementptr.ll getelementptr_cast.ll getelementptr_const.ll hoist_instr.ll icmp.ll load.ll malloc-free-delete.ll malloc2.ll memmove.ll mul.ll narrow.ll or.ll or2.ll phi.ll rem.ll select.ll set.ll setcc-cast-cast.ll setcc-strength-reduce.ll shift-simplify.ll ! shift-sra.ll shift.ll signext.ll sink_instruction.ll stacksave! restore. Message-ID: <200704142013.l3EKDO74028019@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: 2002-08-02-CastTest.ll updated: 1.7 -> 1.8 2003-08-12-AllocaNonNull.ll updated: 1.3 -> 1.4 2004-08-10-BoolSetCC.ll updated: 1.3 -> 1.4 2004-09-20-BadLoadCombine.llx updated: 1.2 -> 1.3 2004-09-20-BadLoadCombine2.llx updated: 1.2 -> 1.3 2004-11-27-SetCCForCastLargerAndConstant.ll updated: 1.8 -> 1.9 2005-03-04-ShiftOverflow.ll updated: 1.2 -> 1.3 2005-06-16-SetCCOrSetCCMiscompile.ll updated: 1.3 -> 1.4 2006-02-13-DemandedMiscompile.ll updated: 1.2 -> 1.3 2006-04-28-ShiftShiftLongLong.ll updated: 1.3 -> 1.4 2006-10-19-SignedToUnsignedCastAndConst-2.ll updated: 1.4 -> 1.5 2006-10-19-SignedToUnsignedCastAndConst.ll updated: 1.4 -> 1.5 2006-10-20-mask.ll updated: 1.2 -> 1.3 2006-10-26-VectorReassoc.ll updated: 1.2 -> 1.3 2006-11-03-Memmove64.ll updated: 1.2 -> 1.3 2006-11-27-XorBug.ll updated: 1.2 -> 1.3 2006-12-01-BadFPVectorXform.ll updated: 1.2 -> 1.3 2006-12-08-ICmp-Combining.ll updated: 1.1 -> 1.2 2006-12-08-Phi-ICmp-Op-Fold.ll updated: 1.3 -> 1.4 2006-12-08-Select-ICmp.ll updated: 1.1 -> 1.2 2006-12-10-ICmp-GEP-GEP.ll updated: 1.1 -> 1.2 2006-12-15-Range-Test.ll updated: 1.2 -> 1.3 2006-12-23-Select-Cmp-Cmp.ll updated: 1.2 -> 1.3 2007-01-14-FcmpSelf.ll updated: 1.2 -> 1.3 2007-01-27-AndICmp.ll updated: 1.1 -> 1.2 2007-02-01-LoadSinkAlloca.ll updated: 1.2 -> 1.3 2007-02-07-PointerCast.ll updated: 1.1 -> 1.2 2007-03-13-CompareMerge.ll updated: 1.1 -> 1.2 2007-03-21-SignedRangeTest.ll updated: 1.2 -> 1.3 2007-03-25-BadShiftMask.ll updated: 1.2 -> 1.3 2007-03-26-BadShiftMask.ll updated: 1.2 -> 1.3 2007-03-27-PR1280.ll updated: 1.1 -> 1.2 2007-03-31-InfiniteLoop.ll updated: 1.1 -> 1.2 2007-04-04-BadFoldBitcastIntoMalloc.ll updated: 1.3 -> 1.4 CPP_min_max.llx updated: 1.2 -> 1.3 GEPIdxCanon.ll updated: 1.2 -> 1.3 JavaCompare.ll updated: 1.5 -> 1.6 alloca.ll updated: 1.3 -> 1.4 and-compare.ll updated: 1.2 -> 1.3 and-or-and.ll updated: 1.2 -> 1.3 and-xor-merge.ll updated: 1.1 -> 1.2 apint-add1.ll updated: 1.3 -> 1.4 apint-add2.ll updated: 1.3 -> 1.4 apint-and-or-and.ll updated: 1.1 -> 1.2 apint-and-xor-merge.ll updated: 1.1 -> 1.2 apint-and1.ll updated: 1.2 -> 1.3 apint-and2.ll updated: 1.2 -> 1.3 apint-cast.ll updated: 1.1 -> 1.2 apint-elim-logicalops.ll updated: 1.1 -> 1.2 apint-or2.ll updated: 1.2 -> 1.3 apint-rem1.ll updated: 1.2 -> 1.3 apint-rem2.ll updated: 1.2 -> 1.3 apint-select.ll updated: 1.2 -> 1.3 apint-shift-simplify.ll updated: 1.1 -> 1.2 apint-shift.ll updated: 1.1 -> 1.2 apint-shl-trunc.ll updated: 1.1 -> 1.2 apint-sub.ll updated: 1.2 -> 1.3 apint-xor1.ll updated: 1.3 -> 1.4 apint-xor2.ll updated: 1.2 -> 1.3 apint-zext1.ll updated: 1.1 -> 1.2 apint-zext2.ll updated: 1.1 -> 1.2 bit-tracking.ll updated: 1.6 -> 1.7 bitcount.ll updated: 1.3 -> 1.4 bittest.ll updated: 1.3 -> 1.4 bswap-fold.ll updated: 1.4 -> 1.5 bswap.ll updated: 1.5 -> 1.6 call-cast-target.ll updated: 1.3 -> 1.4 call.ll updated: 1.7 -> 1.8 canonicalize_branch.ll updated: 1.2 -> 1.3 cast-and-cast.ll updated: 1.4 -> 1.5 cast-cast-to-and.ll updated: 1.2 -> 1.3 cast-load-gep.ll updated: 1.2 -> 1.3 cast-propagate.ll updated: 1.3 -> 1.4 cast.ll updated: 1.36 -> 1.37 cast2.ll updated: 1.2 -> 1.3 cast_ptr.ll updated: 1.5 -> 1.6 deadcode.ll updated: 1.3 -> 1.4 dg.exp updated: 1.4 -> 1.5 getelementptr-setcc.ll updated: 1.3 -> 1.4 getelementptr.ll updated: 1.20 -> 1.21 getelementptr_cast.ll updated: 1.3 -> 1.4 getelementptr_const.ll updated: 1.2 -> 1.3 hoist_instr.ll updated: 1.2 -> 1.3 icmp.ll updated: 1.2 -> 1.3 load.ll updated: 1.14 -> 1.15 malloc-free-delete.ll updated: 1.1 -> 1.2 malloc2.ll updated: 1.1 -> 1.2 memmove.ll updated: 1.2 -> 1.3 mul.ll updated: 1.14 -> 1.15 narrow.ll updated: 1.5 -> 1.6 or.ll updated: 1.33 -> 1.34 or2.ll updated: 1.1 -> 1.2 phi.ll updated: 1.15 -> 1.16 rem.ll updated: 1.14 -> 1.15 select.ll updated: 1.15 -> 1.16 set.ll updated: 1.22 -> 1.23 setcc-cast-cast.ll updated: 1.2 -> 1.3 setcc-strength-reduce.ll updated: 1.8 -> 1.9 shift-simplify.ll updated: 1.3 -> 1.4 shift-sra.ll updated: 1.6 -> 1.7 shift.ll updated: 1.24 -> 1.25 signext.ll updated: 1.3 -> 1.4 sink_instruction.ll updated: 1.2 -> 1.3 stacksaverestore.ll updated: 1.2 -> 1.3 store.ll updated: 1.3 -> 1.4 sub.ll updated: 1.26 -> 1.27 udiv_select_to_select_shift.ll updated: 1.1 -> 1.2 vec_demanded_elts.ll updated: 1.2 -> 1.3 vec_insert_to_shuffle.ll updated: 1.2 -> 1.3 vec_insertelt.ll updated: 1.1 -> 1.2 vec_narrow.ll updated: 1.2 -> 1.3 vec_shuffle.ll updated: 1.10 -> 1.11 xor.ll updated: 1.21 -> 1.22 xor2.ll updated: 1.1 -> 1.2 zeroext-and-reduce.ll updated: 1.5 -> 1.6 zext.ll updated: 1.2 -> 1.3 --- Log message: For PR1319: http://llvm.org/PR1319 : Upgrade tests to work with new llvm.exp version of llvm_runtest. --- Diffs of the changes: (+199 -171) 2002-08-02-CastTest.ll | 2 +- 2003-08-12-AllocaNonNull.ll | 3 ++- 2004-08-10-BoolSetCC.ll | 3 ++- 2004-09-20-BadLoadCombine.llx | 3 ++- 2004-09-20-BadLoadCombine2.llx | 4 ++-- 2004-11-27-SetCCForCastLargerAndConstant.ll | 3 ++- 2005-03-04-ShiftOverflow.ll | 4 +++- 2005-06-16-SetCCOrSetCCMiscompile.ll | 2 +- 2006-02-13-DemandedMiscompile.ll | 4 ++-- 2006-04-28-ShiftShiftLongLong.ll | 2 +- 2006-10-19-SignedToUnsignedCastAndConst-2.ll | 3 ++- 2006-10-19-SignedToUnsignedCastAndConst.ll | 3 ++- 2006-10-20-mask.ll | 3 ++- 2006-10-26-VectorReassoc.ll | 3 ++- 2006-11-03-Memmove64.ll | 3 ++- 2006-11-27-XorBug.ll | 5 +++-- 2006-12-01-BadFPVectorXform.ll | 2 +- 2006-12-08-ICmp-Combining.ll | 3 ++- 2006-12-08-Phi-ICmp-Op-Fold.ll | 5 ++++- 2006-12-08-Select-ICmp.ll | 1 + 2006-12-10-ICmp-GEP-GEP.ll | 3 ++- 2006-12-15-Range-Test.ll | 7 ++++--- 2006-12-23-Select-Cmp-Cmp.ll | 1 + 2007-01-14-FcmpSelf.ll | 2 +- 2007-01-27-AndICmp.ll | 2 +- 2007-02-01-LoadSinkAlloca.ll | 6 ++++-- 2007-02-07-PointerCast.ll | 12 +++++------- 2007-03-13-CompareMerge.ll | 2 +- 2007-03-21-SignedRangeTest.ll | 2 +- 2007-03-25-BadShiftMask.ll | 2 +- 2007-03-26-BadShiftMask.ll | 3 ++- 2007-03-27-PR1280.ll | 2 +- 2007-03-31-InfiniteLoop.ll | 1 + 2007-04-04-BadFoldBitcastIntoMalloc.ll | 2 +- CPP_min_max.llx | 3 ++- GEPIdxCanon.ll | 3 ++- JavaCompare.ll | 3 ++- alloca.ll | 4 +++- and-compare.ll | 3 ++- and-or-and.ll | 3 ++- and-xor-merge.ll | 2 +- apint-add1.ll | 1 - apint-add2.ll | 1 - apint-and-or-and.ll | 2 +- apint-and-xor-merge.ll | 2 +- apint-and1.ll | 3 +-- apint-and2.ll | 3 +-- apint-cast.ll | 1 - apint-elim-logicalops.ll | 5 ++--- apint-or2.ll | 2 -- apint-rem1.ll | 1 - apint-rem2.ll | 1 - apint-select.ll | 3 +-- apint-shift-simplify.ll | 2 +- apint-shift.ll | 3 +-- apint-shl-trunc.ll | 2 +- apint-sub.ll | 4 ++-- apint-xor1.ll | 3 +-- apint-xor2.ll | 3 +-- apint-zext1.ll | 3 +-- apint-zext2.ll | 3 +-- bit-tracking.ll | 4 ++-- bitcount.ll | 5 +++-- bittest.ll | 4 ++-- bswap-fold.ll | 6 ++++-- bswap.ll | 3 ++- call-cast-target.ll | 3 ++- call.ll | 3 ++- canonicalize_branch.ll | 3 ++- cast-and-cast.ll | 3 ++- cast-cast-to-and.ll | 3 ++- cast-load-gep.ll | 3 ++- cast-propagate.ll | 3 ++- cast.ll | 4 ++-- cast2.ll | 1 - cast_ptr.ll | 1 - deadcode.ll | 3 ++- dg.exp | 2 +- getelementptr-setcc.ll | 3 ++- getelementptr.ll | 3 ++- getelementptr_cast.ll | 4 +++- getelementptr_const.ll | 3 ++- hoist_instr.ll | 3 ++- icmp.ll | 2 +- load.ll | 2 +- malloc-free-delete.ll | 3 +-- malloc2.ll | 2 +- memmove.ll | 4 ++-- mul.ll | 1 - narrow.ll | 3 +-- or.ll | 5 ++--- or2.ll | 3 +-- phi.ll | 2 -- rem.ll | 1 - select.ll | 4 ++-- set.ll | 2 +- setcc-cast-cast.ll | 5 ++++- setcc-strength-reduce.ll | 5 +++-- shift-simplify.ll | 2 +- shift-sra.ll | 3 +-- shift.ll | 3 +-- signext.ll | 3 +-- sink_instruction.ll | 3 ++- stacksaverestore.ll | 1 - store.ll | 4 ++-- sub.ll | 3 +-- udiv_select_to_select_shift.ll | 10 +++++----- vec_demanded_elts.ll | 16 +++++++++++----- vec_insert_to_shuffle.ll | 9 ++++++--- vec_insertelt.ll | 2 +- vec_narrow.ll | 3 ++- vec_shuffle.ll | 1 - xor.ll | 6 +++--- xor2.ll | 4 +--- zeroext-and-reduce.ll | 2 +- zext.ll | 4 ++-- 116 files changed, 199 insertions(+), 171 deletions(-) Index: llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll diff -u llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll:1.7 llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll:1.8 --- llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll:1.7 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2002-08-02-CastTest.ll Sat Apr 14 15:13:02 2007 @@ -1,7 +1,7 @@ ; This testcase is incorrectly getting completely eliminated. There should be ; SOME instruction named %c here, even if it's a bitwise and. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep '%c' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep %c ; ulong %test3(ulong %A) { %c1 = cast ulong %A to ubyte Index: llvm/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll diff -u llvm/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll:1.3 llvm/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll:1.4 --- llvm/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll:1.3 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll Sat Apr 14 15:13:02 2007 @@ -1,6 +1,7 @@ ; This testcase can be simplified by "realizing" that alloca can never return ; null. -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | llvm-dis | not grep 'br ' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -simplifycfg | \ +; RUN: llvm-dis | not grep br implementation ; Functions: Index: llvm/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll diff -u llvm/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.3 llvm/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.4 --- llvm/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.3 Fri Jan 12 23:06:52 2007 +++ llvm/test/Transforms/InstCombine/2004-08-10-BoolSetCC.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret i1 false' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep {ret i1 false} bool %test(bool %V) { %Y = setlt bool %V, false ret bool %Y Index: llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx diff -u llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx:1.2 llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx:1.3 --- llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine.llx Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | not grep 'int 1' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg | llvm-dis | \ +; RUN: not grep {int 1} ; When propagating the load through the select, make sure that the load is ; inserted where the original load was, not where the select is. Not doing Index: llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.llx diff -u llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.llx:1.2 llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.llx:1.3 --- llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.llx:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.llx Sat Apr 14 15:13:02 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg -simplifycfg | llvm-dis | \ -; RUN: grep -v store | not grep 'int 1' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -mem2reg -simplifycfg | \ +; RUN: llvm-dis | grep -v store | not grep {int 1} ; Test to make sure that instcombine does not accidentally propagate the load ; into the PHI, which would break the program. Index: llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll diff -u llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.8 llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.9 --- llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll:1.8 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll Sat Apr 14 15:13:02 2007 @@ -9,7 +9,8 @@ ; be eliminated. In many cases the setCC is also eliminated based on the ; constant value and the range of the casted value. ; -; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | notcast '.*int' +; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: notcast .*int implementation ; Functions: Index: llvm/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll diff -u llvm/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll:1.2 llvm/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll:1.3 --- llvm/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'ret bool false' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: not grep {ret bool false} + bool %test(ulong %tmp.169) { %tmp.1710 = shr ulong %tmp.169, ubyte 1 %tmp.1912 = setgt ulong %tmp.1710, 0 Index: llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll diff -u llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll:1.3 llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll:1.4 --- llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll:1.3 Fri Jan 12 23:06:52 2007 +++ llvm/test/Transforms/InstCombine/2005-06-16-SetCCOrSetCCMiscompile.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ -; RUN: grep 'ret i1 true' +; RUN: grep {ret i1 true} ; PR586 %g_07918478 = external global uint ; [#uses=1] Index: llvm/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll diff -u llvm/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll:1.2 llvm/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-02-13-DemandedMiscompile.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep undef +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: not grep undef int %test(sbyte %A) { %B = cast sbyte %A to int Index: llvm/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll diff -u llvm/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll:1.3 llvm/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll:1.4 --- llvm/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll:1.3 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-04-28-ShiftShiftLongLong.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep shl && +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep shl ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast ; This cannot be turned into a sign extending cast! Index: llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll diff -u llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll:1.4 llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll:1.5 --- llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll:1.4 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,6 @@ ; The optimizer should be able to remove cast operation here. -; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | not grep 'sext.*i32' +; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: not grep sext.*i32 bool %eq_signed_to_small_unsigned(sbyte %SB) { %Y = cast sbyte %SB to uint ; [#uses=1] Index: llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll diff -u llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll:1.4 llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll:1.5 --- llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll:1.4 Sun Dec 31 00:01:59 2006 +++ llvm/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst.ll Sat Apr 14 15:13:02 2007 @@ -1,6 +1,7 @@ ; This test case is reduced from llvmAsmParser.cpp ; The optimizer should not remove the cast here. -; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'sext.*i32' +; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep sext.*i32 bool %test(short %X) { %A = cast short %X to uint Index: llvm/test/Transforms/InstCombine/2006-10-20-mask.ll diff -u llvm/test/Transforms/InstCombine/2006-10-20-mask.ll:1.2 llvm/test/Transforms/InstCombine/2006-10-20-mask.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-10-20-mask.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-10-20-mask.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | grep 'and' +; RUN: llvm-upgrade %s -o - | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep and ulong %foo(ulong %tmp, ulong %tmp2) { %tmp = cast ulong %tmp to uint %tmp2 = cast ulong %tmp2 to uint Index: llvm/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll diff -u llvm/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll:1.2 llvm/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-10-26-VectorReassoc.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep mul | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep mul | wc -l | grep 2 <4 x float> %test(<4 x float> %V) { Index: llvm/test/Transforms/InstCombine/2006-11-03-Memmove64.ll diff -u llvm/test/Transforms/InstCombine/2006-11-03-Memmove64.ll:1.2 llvm/test/Transforms/InstCombine/2006-11-03-Memmove64.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-11-03-Memmove64.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-11-03-Memmove64.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis |not grep memmove.i32 +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: not grep memmove.i32 ; Instcombine was trying to turn this into a memmove.i32 target datalayout = "e-p:64:64" Index: llvm/test/Transforms/InstCombine/2006-11-27-XorBug.ll diff -u llvm/test/Transforms/InstCombine/2006-11-27-XorBug.ll:1.2 llvm/test/Transforms/InstCombine/2006-11-27-XorBug.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-11-27-XorBug.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Transforms/InstCombine/2006-11-27-XorBug.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,6 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'and.*32' && -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'or.*153' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep and.*32 +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: not grep or.*153 ; PR1014 int %test(int %tmp1) { Index: llvm/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll diff -u llvm/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll:1.2 llvm/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll:1.2 Fri Dec 1 23:02:46 2006 +++ llvm/test/Transforms/InstCombine/2006-12-01-BadFPVectorXform.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep sub && +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep sub ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep add <4 x float> %test(<4 x float> %tmp26, <4 x float> %tmp53) { Index: llvm/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll diff -u llvm/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll:1.1 llvm/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll:1.2 --- llvm/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll:1.1 Fri Dec 8 11:38:55 2006 +++ llvm/test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep '%bothcond =' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep {%bothcond =} bool %Doit_bb(int %i.0) { bb: ; preds = %newFuncRoot %tmp = setgt int %i.0, 0 ; [#uses=1] Index: llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll diff -u llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.3 llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.4 --- llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.3 Wed Apr 11 11:04:04 2007 +++ llvm/test/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,7 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis|grep 'icmp sgt' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ +; RUN: grep {icmp sgt} +; END. + ; ModuleID = 'visible.bc' target datalayout = "e-p:32:32" target endian = little Index: llvm/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll diff -u llvm/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll:1.1 llvm/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll:1.2 --- llvm/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll:1.1 Fri Dec 8 23:13:01 2006 +++ llvm/test/Transforms/InstCombine/2006-12-08-Select-ICmp.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep select +; END. target datalayout = "e-p:32:32" target endian = little target pointersize = 32 Index: llvm/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll diff -u llvm/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll:1.1 llvm/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll:1.2 --- llvm/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll:1.1 Sat Dec 23 00:05:41 2006 +++ llvm/test/Transforms/InstCombine/2006-12-10-ICmp-GEP-GEP.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ -; RUN: grep -v 'icmp ult int' +; RUN: grep -v {icmp ult int} +; END. ; ModuleID = 'good.bc' target datalayout = "e-p:32:32" target endian = little Index: llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll diff -u llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll:1.2 llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll:1.2 Fri Dec 29 14:01:32 2006 +++ llvm/test/Transforms/InstCombine/2006-12-15-Range-Test.ll Sat Apr 14 15:13:02 2007 @@ -1,8 +1,9 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ -; RUN: grep 'icmp' | wc -l | grep 1 +; RUN: grep icmp | wc -l | grep 1 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \ -; RUN: grep 'icmp ugt' | wc -l | grep 1 -; +; RUN: grep {icmp ugt} | wc -l | grep 1 +; END. + ; ModuleID = 'bugpoint-tooptimize.bc' target datalayout = "e-p:32:32" target endian = little Index: llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll diff -u llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll:1.2 llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll:1.3 --- llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll:1.2 Fri Dec 29 14:01:32 2006 +++ llvm/test/Transforms/InstCombine/2006-12-23-Select-Cmp-Cmp.ll Sat Apr 14 15:13:02 2007 @@ -1,6 +1,7 @@ ; For PR1065. This causes an assertion in instcombine if a select with two cmp ; operands is encountered. ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output +; END. ; ModuleID = 'PR1065.bc' target datalayout = "e-p:32:32" target endian = little Index: llvm/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll diff -u llvm/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll:1.2 llvm/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll:1.3 --- llvm/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll:1.2 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/InstCombine/2007-01-14-FcmpSelf.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'fcmp uno.*0.0' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {fcmp uno.*0.0} ; PR1111 define i1 @test(double %X) { %tmp = fcmp une double %X, %X Index: llvm/test/Transforms/InstCombine/2007-01-27-AndICmp.ll diff -u llvm/test/Transforms/InstCombine/2007-01-27-AndICmp.ll:1.1 llvm/test/Transforms/InstCombine/2007-01-27-AndICmp.ll:1.2 --- llvm/test/Transforms/InstCombine/2007-01-27-AndICmp.ll:1.1 Sat Jan 27 17:07:12 2007 +++ llvm/test/Transforms/InstCombine/2007-01-27-AndICmp.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep "ugt.*, 1" +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ugt.*, 1} define i1 @test(i32 %tmp1030) { %tmp1037 = icmp ne i32 %tmp1030, 40 ; [#uses=1] Index: llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll diff -u llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll:1.2 llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll:1.3 --- llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll:1.2 Sat Feb 3 20:11:13 2007 +++ llvm/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,7 @@ -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep '%A = alloca' && -; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | not grep '%B = alloca' +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | grep {%A = alloca} +; RUN: llvm-as < %s | opt -instcombine -mem2reg | llvm-dis | \ +; RUN: not grep {%B = alloca} +; END. ; Ensure that instcombine doesn't sink the loads in entry/cond_true into ; cond_next. Doing so prevents mem2reg from promoting the B alloca. Index: llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll diff -u llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll:1.1 llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll:1.2 --- llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll:1.1 Wed Feb 7 16:23:47 2007 +++ llvm/test/Transforms/InstCombine/2007-02-07-PointerCast.ll Sat Apr 14 15:13:02 2007 @@ -1,11 +1,9 @@ -;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine |llvm-dis |grep zext +;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep zext -;Make sure the uint isn't removed. -;instcombine in llvm 1.9 was dropping the uint cast which was causing a sign -;extend -;this only affected code with pointers in the high half of memory, so it wasn't -;noticed much :) -;compile a kernel though... +; Make sure the uint isn't removed. Instcombine in llvm 1.9 was dropping the +; uint cast which was causing a sign extend. This only affected code with +; pointers in the high half of memory, so it wasn't noticed much +; compile a kernel though... target datalayout = "e-p:32:32" target endian = little Index: llvm/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll diff -u llvm/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll:1.1 llvm/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll:1.2 --- llvm/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll:1.1 Tue Mar 13 09:25:35 2007 +++ llvm/test/Transforms/InstCombine/2007-03-13-CompareMerge.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'icmp sle' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp sle} ; PR1244 define i1 @test(i32 %c.3.i, i32 %d.292.2.i) { Index: llvm/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll diff -u llvm/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll:1.2 llvm/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll:1.3 --- llvm/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll:1.2 Wed Mar 21 21:53:05 2007 +++ llvm/test/Transforms/InstCombine/2007-03-21-SignedRangeTest.ll Sat Apr 14 15:13:02 2007 @@ -1,5 +1,5 @@ ; For PR1248 -; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep 'ugt i32 .*, 11' +; RUN: llvm-as %s -o - | opt -instcombine | llvm-dis | grep {ugt i32 .*, 11} define i1 @test(i32 %tmp6) { %tmp7 = sdiv i32 %tmp6, 12 ; [#uses=1] icmp ne i32 %tmp7, -6 ; :1 [#uses=1] Index: llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll diff -u llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll:1.2 llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll:1.3 --- llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll:1.2 Mon Mar 26 13:04:38 2007 +++ llvm/test/Transforms/InstCombine/2007-03-25-BadShiftMask.ll Sat Apr 14 15:13:02 2007 @@ -1,6 +1,6 @@ ; PR1271 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: grep 'icmp eq i32 .tmp.*, 2146435072' +; RUN: grep {icmp eq i32 .tmp.*, 2146435072} %struct..0anon = type { i32, i32 } %struct..1anon = type { double } Index: llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll diff -u llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll:1.2 llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll:1.3 --- llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll:1.2 Tue Mar 27 21:38:26 2007 +++ llvm/test/Transforms/InstCombine/2007-03-26-BadShiftMask.ll Sat Apr 14 15:13:02 2007 @@ -1,6 +1,7 @@ ; PR1271 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ -; RUN: grep 'ashr i32 %.mp137, 2' +; RUN: grep {ashr i32 %.mp137, 2} +; END. 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" target triple = "i686-pc-linux-gnu" Index: llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll diff -u llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll:1.1 llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll:1.2 --- llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll:1.1 Tue Mar 27 20:43:35 2007 +++ llvm/test/Transforms/InstCombine/2007-03-27-PR1280.ll Sat Apr 14 15:13:02 2007 @@ -4,7 +4,7 @@ ; is not done. It should be removed when code gen supports "funny" ; bit widths. -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'add i49.*-8388608' +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i49.*-8388608} define i49 @test5(i49 %x) { ;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext. Index: llvm/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll diff -u llvm/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll:1.1 llvm/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll:1.2 --- llvm/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll:1.1 Sun Apr 1 00:34:53 2007 +++ llvm/test/Transforms/InstCombine/2007-03-31-InfiniteLoop.ll Sat Apr 14 15:13:02 2007 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -instcombine -disable-output +; END. 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" target triple = "i686-apple-darwin8" Index: llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll diff -u llvm/test/Transforms/InstCombine/2007-04-04-BadFoldBitcastIntoMalloc.ll:1.3 llvm/test/Transf