[llvm-commits] CVS: llvm/test/Regression/Transforms/Reassociate/mul-factor3.ll mulfactor2.ll
Changes in directory llvm/test/Regression/Transforms/Reassociate: mul-factor3.ll added (r1.1) mulfactor2.ll updated: 1.1 -> 1.2 --- Log message: new testcase from a FIXME in the code --- Diffs of the changes: (+16 -2) mul-factor3.ll | 14 ++ mulfactor2.ll |4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) Index: llvm/test/Regression/Transforms/Reassociate/mul-factor3.ll diff -c /dev/null llvm/test/Regression/Transforms/Reassociate/mul-factor3.ll:1.1 *** /dev/null Tue Mar 14 02:13:19 2006 --- llvm/test/Regression/Transforms/Reassociate/mul-factor3.ll Tue Mar 14 02:13:09 2006 *** *** 0 --- 1,14 + ; This should be one add and two multiplies. + + ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 2 && + ; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 + + int %test(int %A, int %B, int %C) { + %aa = mul int %A, %A + %aab = mul int %aa, %B + + %ac = mul int %A, %C + %aac = mul int %ac, %A + %r = add int %aab, %aac + ret int %r + } Index: llvm/test/Regression/Transforms/Reassociate/mulfactor2.ll diff -u llvm/test/Regression/Transforms/Reassociate/mulfactor2.ll:1.1 llvm/test/Regression/Transforms/Reassociate/mulfactor2.ll:1.2 --- llvm/test/Regression/Transforms/Reassociate/mulfactor2.ll:1.1 Sat Mar 4 03:35:02 2006 +++ llvm/test/Regression/Transforms/Reassociate/mulfactor2.ll Tue Mar 14 02:13:09 2006 @@ -1,7 +1,7 @@ ; This should turn into one multiply and one add. -; RUN: llvm-as < mulfactor2.ll | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 && -; RUN: llvm-as < mulfactor2.ll | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 +; RUN: llvm-as < %s | opt -instcombine -reassociate -instcombine | llvm-dis | grep mul | wc -l | grep 1 && +; RUN: llvm-as < %s | opt -instcombine -reassociate -instcombine | llvm-dis | grep add | wc -l | grep 1 int %main(int %t) { %tmp.3 = mul int %t, 12 ; [#uses=1] %tmp.4 = add int %tmp.3, 5 ; [#uses=1] ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/Reassociate.cpp
Changes in directory llvm/lib/Transforms/Scalar: Reassociate.cpp updated: 1.59 -> 1.60 --- Log message: Implement a FIXME, recusively reassociating A*A*B + A*A*C --> A*(A*B+A*C) --> A*(A*(B+C)) This implements Reassociate/mul-factor3.ll --- Diffs of the changes: (+65 -26) Reassociate.cpp | 91 1 files changed, 65 insertions(+), 26 deletions(-) Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.59 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.60 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.59 Tue Mar 14 01:11:11 2006 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Tue Mar 14 10:04:29 2006 @@ -79,8 +79,8 @@ void BuildRankMap(Function &F); unsigned getRank(Value *V); void ReassociateExpression(BinaryOperator *I); -void RewriteExprTree(BinaryOperator *I, unsigned Idx, - std::vector &Ops); +void RewriteExprTree(BinaryOperator *I, std::vector &Ops, + unsigned Idx = 0); Value *OptimizeExpression(BinaryOperator *I, std::vector &Ops); void LinearizeExprTree(BinaryOperator *I, std::vector &Ops); void LinearizeExpr(BinaryOperator *I); @@ -174,7 +174,7 @@ /// isReassociableOp - Return true if V is an instruction of the specified /// opcode and if it only has one use. static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) { - if (V->hasOneUse() && isa(V) && + if ((V->hasOneUse() || V->use_empty()) && isa(V) && cast(V)->getOpcode() == Opcode) return cast(V); return 0; @@ -234,6 +234,10 @@ /// form of the the expression (((a+b)+c)+d), and collects information about the /// rank of the non-tree operands. /// +/// NOTE: These intentionally destroys the expression tree operands (turning +/// them into undef values) to reduce #uses of the values. This means that the +/// caller MUST use something like RewriteExprTree to put the values back in. +/// void Reassociate::LinearizeExprTree(BinaryOperator *I, std::vector &Ops) { Value *LHS = I->getOperand(0), *RHS = I->getOperand(1); @@ -262,6 +266,10 @@ // such, just remember these operands and their rank. Ops.push_back(ValueEntry(getRank(LHS), LHS)); Ops.push_back(ValueEntry(getRank(RHS), RHS)); + + // Clear the leaves out. + I->setOperand(0, UndefValue::get(I->getType())); + I->setOperand(1, UndefValue::get(I->getType())); return; } else { // Turn X+(Y+Z) -> (Y+Z)+X @@ -293,13 +301,17 @@ // Remember the RHS operand and its rank. Ops.push_back(ValueEntry(getRank(RHS), RHS)); + + // Clear the RHS leaf out. + I->setOperand(1, UndefValue::get(I->getType())); } // RewriteExprTree - Now that the operands for this expression tree are // linearized and optimized, emit them in-order. This function is written to be // tail recursive. -void Reassociate::RewriteExprTree(BinaryOperator *I, unsigned i, - std::vector &Ops) { +void Reassociate::RewriteExprTree(BinaryOperator *I, + std::vector &Ops, + unsigned i) { if (i+2 == Ops.size()) { if (I->getOperand(0) != Ops[i].Op || I->getOperand(1) != Ops[i+1].Op) { @@ -334,7 +346,7 @@ // Compactify the tree instructions together with each other to guarantee // that the expression tree is dominated by all of Ops. LHS->moveBefore(I); - RewriteExprTree(LHS, i+1, Ops); + RewriteExprTree(LHS, Ops, i+1); } @@ -474,14 +486,36 @@ Factors.erase(Factors.begin()+i); break; } - if (!FoundFactor) return 0; + if (!FoundFactor) { +// Make sure to restore the operands to the expression tree. +RewriteExprTree(BO, Factors); +return 0; + } if (Factors.size() == 1) return Factors[0].Op; - RewriteExprTree(BO, 0, Factors); + RewriteExprTree(BO, Factors); return BO; } +/// FindSingleUseMultiplyFactors - If V is a single-use multiply, recursively +/// add its operands as factors, otherwise add V to the list of factors. +static void FindSingleUseMultiplyFactors(Value *V, + std::vector &Factors) { + BinaryOperator *BO; + if ((!V->hasOneUse() && !V->use_empty()) || + !(BO = dyn_cast(V)) || + BO->getOpcode() != Instruction::Mul) { +Factors.push_back(V); +return; + } + + // Otherwise, add the LHS and RHS to the list of factors. + FindSingleUseMultiplyFactors(BO->getOperand(1), Factors); + FindSingleUseMultiplyFactors(BO->getOperand(0), Factors); +} + + Value *Reassociate::OptimizeExpression(BinaryOperator *I, std::vector &Ops) { @@ -627,26 +661,26 @@ if (!I->getType()->isFloatingPoint()) { for (unsigned i = 0, e = Ops.size(); i != e; ++i) { if (BinaryOperator *BOp = dyn_cast(Ops[i].Op)) -
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.166 -> 1.167 --- Log message: Fix an off by one error that caused PPC LLC failures last night. --- Diffs of the changes: (+1 -1) PPCISelDAGToDAG.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.166 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.167 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.166 Mon Mar 13 17:20:37 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Mar 14 11:56:49 2006 @@ -208,7 +208,7 @@ SSARegMap *RegMap = DAG.getMachineFunction().getSSARegMap(); bool HasVectorVReg = false; for (unsigned i = MRegisterInfo::FirstVirtualRegister, - e = RegMap->getLastVirtReg(); i != e; ++i) + e = RegMap->getLastVirtReg()+1; i != e; ++i) if (RegMap->getRegClass(i) == &PPC::VRRCRegClass) { HasVectorVReg = true; break; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Changes in directory llvm/lib/CodeGen: MachineDebugInfo.cpp updated: 1.30 -> 1.31 --- Log message: 1. Use null for serialized empty strings. 2. Allow for user defined debug descriptors. 3. Allow for user augmented fields on debug descriptors. --- Diffs of the changes: (+17 -9) MachineDebugInfo.cpp | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.30 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.31 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.30 Thu Mar 9 11:48:46 2006 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Mar 14 12:37:57 2006 @@ -270,7 +270,11 @@ Elements.push_back(ConstantBool::get(Field)); } virtual void Apply(std::string &Field) { -Elements.push_back(SR.getString(Field)); +if (Field.empty()) { + Elements.push_back(NULL); +} else { + Elements.push_back(SR.getString(Field)); +} } virtual void Apply(DebugInfoDesc *&Field) { GlobalVariable *GV = NULL; @@ -417,7 +421,7 @@ } virtual void Apply(std::string &Field) { Constant *C = CI->getOperand(I++); -IsValid = IsValid && isStringValue(C); +IsValid = IsValid && (!C || isStringValue(C)); } virtual void Apply(DebugInfoDesc *&Field) { // FIXME - Prepare the correct descriptor. @@ -1086,11 +1090,13 @@ // Create an empty instance of the correct sort. Slot = DebugInfoDesc::DescFactory(Tag); - assert(Slot && "Unknown Tag"); - // Deserialize the fields. - DIDeserializeVisitor DRAM(*this, GV); - DRAM.ApplyToFields(Slot); + // If not a user defined descriptor. + if (Slot) { +// Deserialize the fields. +DIDeserializeVisitor DRAM(*this, GV); +DRAM.ApplyToFields(Slot); + } return Slot; } @@ -1238,7 +1244,9 @@ // Construct an empty DebugInfoDesc. DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag); - if (!DD) return false; + + // Allow for user defined descriptors. + if (!DD) return true; // Get the initializer constant. ConstantStruct *CI = cast(GV->getInitializer()); @@ -1255,8 +1263,8 @@ Slot = CTAM.getCount(); } - // Field count must equal operand count. - if (Slot != N) { + // Field count must be at most equal operand count. + if (Slot > N) { delete DD; return false; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html
Changes in directory llvm/docs: SourceLevelDebugging.html updated: 1.13 -> 1.14 --- Log message: Reflect the fact that empty strings can be expressed as null. --- Diffs of the changes: (+5 -6) SourceLevelDebugging.html | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) Index: llvm/docs/SourceLevelDebugging.html diff -u llvm/docs/SourceLevelDebugging.html:1.13 llvm/docs/SourceLevelDebugging.html:1.14 --- llvm/docs/SourceLevelDebugging.html:1.13Tue Mar 14 12:08:46 2006 +++ llvm/docs/SourceLevelDebugging.html Tue Mar 14 12:50:50 2006 @@ -1407,14 +1407,13 @@ %llvm.dbg.derivedtype2 = internal constant %llvm.dbg.derivedtype.type { uint 15, { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), -sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), +sbyte* null, { }* null, int 0, uint 32, uint 32, uint 0, { }* cast (%llvm.dbg.derivedtype.type* %llvm.dbg.derivedtype3 to { }*) }, section "llvm.metadata" -%str2 = internal constant [1 x sbyte] zeroinitializer, section "llvm.metadata" ;; ;; Define the const type. @@ -1422,7 +1421,7 @@ %llvm.dbg.derivedtype3 = internal constant %llvm.dbg.derivedtype.type { uint 38, { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), -sbyte* getelementptr ([1 x sbyte]* %str2, int 0, int 0), +sbyte* null, { }* null, int 0, uint 0, @@ -1436,14 +1435,14 @@ %llvm.dbg.basictype1 = internal constant %llvm.dbg.basictype.type { uint 36, { }* cast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*), -sbyte* getelementptr ([4 x sbyte]* %str4, int 0, int 0), +sbyte* getelementptr ([4 x sbyte]* %str2, int 0, int 0), { }* null, int 0, uint 32, uint 32, uint 0, uint 5 }, section "llvm.metadata" -%str4 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata" +%str2 = internal constant [4 x sbyte] c"int\00", section "llvm.metadata" @@ -1640,7 +1639,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 18:08:46 $ + Last modified: $Date: 2006/03/14 18:50:50 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/README.txt
Changes in directory llvm/lib/Target: README.txt updated: 1.20 -> 1.21 --- Log message: add a note --- Diffs of the changes: (+8 -0) README.txt |8 1 files changed, 8 insertions(+) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.20 llvm/lib/Target/README.txt:1.21 --- llvm/lib/Target/README.txt:1.20 Tue Mar 14 00:57:34 2006 +++ llvm/lib/Target/README.txt Tue Mar 14 13:31:24 2006 @@ -113,3 +113,11 @@ //===-===// +This code: +int rot(unsigned char b) { int a = ((b>>1) ^ (b<<7)) & 0xff; return a; } + +Can be improved in two ways: + +1. The instcombiner should eliminate the type conversions. +2. The X86 backend should turn this into a rotate by one bit. + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Dominators.cpp
Changes in directory llvm/lib/VMCore: Dominators.cpp updated: 1.68 -> 1.69 --- Log message: Fix an et-forest memory leak. Patch by Daniel Berlin. --- Diffs of the changes: (+1 -0) Dominators.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/VMCore/Dominators.cpp diff -u llvm/lib/VMCore/Dominators.cpp:1.68 llvm/lib/VMCore/Dominators.cpp:1.69 --- llvm/lib/VMCore/Dominators.cpp:1.68 Sat Jan 14 14:55:09 2006 +++ llvm/lib/VMCore/Dominators.cpp Tue Mar 14 13:41:45 2006 @@ -682,6 +682,7 @@ rightmost->MinOccurrence = NewFatherOcc->MinOccurrence; } + delete ParentOcc; ParentOcc = NewFatherOcc; // Update *our* tree ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AutoUpgrade.cpp
Changes in directory llvm/lib/VMCore: AutoUpgrade.cpp updated: 1.13 -> 1.14 --- Log message: Bugfix, unbreaking CodeGen/PowerPC/cttz.ll --- Diffs of the changes: (+1 -1) AutoUpgrade.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/AutoUpgrade.cpp diff -u llvm/lib/VMCore/AutoUpgrade.cpp:1.13 llvm/lib/VMCore/AutoUpgrade.cpp:1.14 --- llvm/lib/VMCore/AutoUpgrade.cpp:1.13Mon Mar 13 20:00:35 2006 +++ llvm/lib/VMCore/AutoUpgrade.cpp Tue Mar 14 13:49:57 2006 @@ -259,7 +259,7 @@ Instruction *RetVal = NewCI; if (F->getReturnType() != NewFn->getReturnType()) { -RetVal = new CastInst(NewCI, NewFn->getReturnType(), +RetVal = new CastInst(NewCI, F->getReturnType(), NewCI->getName(), CI); NewCI->moveBefore(RetVal); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Intrinsics.td
Changes in directory llvm/include/llvm: Intrinsics.td updated: 1.7 -> 1.8 --- Log message: Fix the gcread/gcwrite intrinsic specifications, fixing CodeGen/Generic/GC/alloc_loop.ll --- Diffs of the changes: (+5 -5) Intrinsics.td | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.7 llvm/include/llvm/Intrinsics.td:1.8 --- llvm/include/llvm/Intrinsics.td:1.7 Mon Mar 13 16:38:32 2006 +++ llvm/include/llvm/Intrinsics.td Tue Mar 14 14:00:20 2006 @@ -73,12 +73,11 @@ def llvm_double_ty : LLVMType<"Type::DoubleTyID">; def llvm_ptr_ty: LLVMType<"Type::PointerTyID">; // sbyte* def llvm_ptrptr_ty : LLVMType<"Type::PointerTyID">; // sbyte** -def llvm_anchor_ty : LLVMType<"Type::PointerTyID">; // {}* def llvm_descriptor_ty : LLVMType<"Type::PointerTyID">; // global* def llvm_v4i32_ty : LLVMPackedType<4, llvm_int_ty>;// 4 x int def llvm_v4f32_ty : LLVMPackedType<4, llvm_float_ty>; // 4 x float -def llvm_v2f64_ty : LLVMPackedType<4, llvm_float_ty>; // 2 x double +def llvm_v2f64_ty : LLVMPackedType<4, llvm_double_ty>; // 2 x double //===--===// // Intrinsic Definitions. @@ -121,9 +120,10 @@ //===--- Garbage Collection Intrinsics ===// // def int_gcroot : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty, llvm_ptr_ty]>; -def int_gcread : Intrinsic<[llvm_ptr_ty, llvm_ptrptr_ty], [InstrReadArgMem]>; -def int_gcwrite : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptrptr_ty], -[InstrWriteArgMem]>; +def int_gcread : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, llvm_ptrptr_ty], +[InstrReadArgMem]>; +def int_gcwrite : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty, + llvm_ptrptr_ty], [InstrWriteArgMem]>; //===- Code Generator Intrinsics --===// // ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.139 -> 1.140 --- Log message: Update this to match the documentation in the GC doc and to match actual practice. --- Diffs of the changes: (+11 -7) LangRef.html | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.139 llvm/docs/LangRef.html:1.140 --- llvm/docs/LangRef.html:1.139Mon Mar 13 23:39:39 2006 +++ llvm/docs/LangRef.html Tue Mar 14 14:02:51 2006 @@ -2917,7 +2917,7 @@ Syntax: - declare sbyte* %llvm.gcread(sbyte** %Ptr) + declare sbyte* %llvm.gcread(sbyte* %ObjPtr, sbyte** %Ptr) Overview: @@ -2928,8 +2928,10 @@ Arguments: -The argument is the address to read from, which should be an address -allocated from the garbage collector. +The second argument is the address to read from, which should be an address +allocated from the garbage collector. The first object is a pointer to the +start of the referenced object, if needed by the language runtime (otherwise +null). Semantics: @@ -2950,7 +2952,7 @@ Syntax: - declare void %llvm.gcwrite(sbyte* %P1, sbyte** %P2) + declare void %llvm.gcwrite(sbyte* %P1, sbyte* %Obj, sbyte** %P2) Overview: @@ -2961,8 +2963,10 @@ Arguments: -The first argument is the reference to store, and the second is the heap -location to store to. +The first argument is the reference to store, the second is the start of the +object to store it to, and the third is the address of the field of Obj to +store to. If the runtime does not require a pointer to the object, Obj may be +null. Semantics: @@ -3694,7 +3698,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/03/14 20:02:51 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.140 -> 1.141 --- Log message: Split the 'vset' instruction into two instructions, 'vsetint' and 'vsetfp', to reflect the fact that the semantics are different for integer and fp values. --- Diffs of the changes: (+74 -39) LangRef.html | 113 ++- 1 files changed, 74 insertions(+), 39 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.140 llvm/docs/LangRef.html:1.141 --- llvm/docs/LangRef.html:1.140Tue Mar 14 14:02:51 2006 +++ llvm/docs/LangRef.html Tue Mar 14 14:55:28 2006 @@ -106,7 +106,8 @@ 'phi' Instruction 'cast .. to' Instruction 'select' Instruction - 'vset' Instruction + 'vsetint' Instruction + 'vsetfp' Instruction 'vselect' Instruction 'extractelement' Instruction 'insertelement' Instruction @@ -2331,56 +2332,50 @@ - 'vset' + 'vsetint' Instruction Syntax: -= vset , > , ; yields + = vsetint , > , ; yields Overview: -The 'vset' instruction returns a vector of boolean -values representing, at each position, the result of the comparison -between the values at that position in the two operands. +The 'vsetint' instruction takes two integer vectors and +returns a vector of boolean values representing, at each position, the +result of the comparison between the values at that position in the +two operands. Arguments: -The arguments to a 'vset' instruction are a comparison +The arguments to a 'vsetint' instruction are a comparison operation and two value arguments. The value arguments must be of packed type, and they must have identical types. -For value arguments of integral element type, the operation argument -must be one of eq, ne, lt, gt, -le, ge, ult, ugt, ule, -uge, true, and false. For value arguments -of floating point element type, the operation argument must be one of -eq, ne, lt, gt, le, -ge, oeq, one, olt, ogt, -ole, oge, ueq, une, ult, -ugt, ule, uge, o, u, -true, and false. The result is a packed -bool value with the same length as each operand. +href="#t_integral">integral packed type, +and they must have identical types. The operation argument must be +one of eq, ne, slt, sgt, +sle, sge, ult, ugt, ule, +uge, true, and false. The result is a +packed bool value with the same length as each operand. Semantics: -The following table shows the semantics of 'vset' for -integral value arguments. For each position of the result, the -comparison is done on the corresponding positions of the two value -arguments. Note that the signedness of the comparison depends on the -comparison opcode and not on the signedness of the value -operands. E.g., vset lt <4 x unsigned> %x, %y does an -elementwise signed comparison of %x and -%y. +The following table shows the semantics of 'vsetint'. For +each position of the result, the comparison is done on the +corresponding positions of the two value arguments. Note that the +signedness of the comparison depends on the comparison opcode and +not on the signedness of the value operands. E.g., vsetint +slt <4 x unsigned> %x, %y does an elementwise signed +comparison of %x and %y. OperationResult is true iffComparison is eqvar1 == var2-- nevar1 != var2-- -ltvar1 < var2signed -gtvar1 > var2signed -levar1 <= var2signed -gevar1 >= var2signed +sltvar1 < var2signed +sgtvar1 > var2signed +slevar1 <= var2signed +sgevar1 >= var2signed ultvar1 < var2unsigned ugtvar1 > var2unsigned ulevar1 <= var2unsigned @@ -2390,7 +2385,47 @@ -The following table shows the semantics of 'vset' for +Example: + = vsetint eq <2 x int> , ; yields {<2 x bool>}:result = false, false + = vsetint ne <2 x int> , ; yields {<2 x bool>}:result = true, true + = vsetint slt <2 x int> , ; yields {<2 x bool>}:result = true, false + = vsetint sgt <2 x int> , ; yields {<2 x bool>}:result = false, true + = vsetint sle <2 x int> , ; yields {<2 x bool>}:result = true, false + = vsetint sge <2 x int> , ; yields {<2 x bool>}:result = false, true + + + + + 'vsetfp' +Instruction + +Syntax: + = vsetfp , > , ; yields + + +Overview: + +The 'vsetfp' instruction takes two floating point vector +arguments and returns a vector of boolean values representing, at each +position, the result of the comparison between the values at that +position in the two operands. + +Arguments: + +The arguments to a 'vsetfp' instruction are a comparison +operation and
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.141 -> 1.142 --- Log message: Fixed a typo in the vsetfp examples. --- Diffs of the changes: (+7 -7) LangRef.html | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.141 llvm/docs/LangRef.html:1.142 --- llvm/docs/LangRef.html:1.141Tue Mar 14 14:55:28 2006 +++ llvm/docs/LangRef.html Tue Mar 14 17:22:57 2006 @@ -2461,12 +2461,12 @@ Example: -= vsetfp eq <2 x float> , ; yields {<2 x bool>}:result = false, false - = vsetfp ne <2 x float> , ; yields {<2 x bool>}:result = true, true - = vsetfp lt <2 x float> , ; yields {<2 x bool>}:result = true, false - = vsetfp gt <2 x float> , ; yields {<2 x bool>}:result = false, true - = vsetfp le <2 x float> , ; yields {<2 x bool>}:result = true, false - = vsetfp ge <2 x float> , ; yields {<2 x bool>}:result = false, true + = vsetfp eq <2 x float> , ; yields {<2 x bool>}:result = false, false + = vsetfp ne <2 x float> , ; yields {<2 x bool>}:result = true, true + = vsetfp lt <2 x float> , ; yields {<2 x bool>}:result = true, false + = vsetfp gt <2 x float> , ; yields {<2 x bool>}:result = false, true + = vsetfp le <2 x float> , ; yields {<2 x bool>}:result = true, false + = vsetfp ge <2 x float> , ; yields {<2 x bool>}:result = false, true @@ -3733,7 +3733,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 20:55:28 $ + Last modified: $Date: 2006/03/14 23:22:57 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Intrinsics.td
Changes in directory llvm/include/llvm: Intrinsics.td updated: 1.8 -> 1.9 --- Log message: Set TargetPrefix on target-specific intrinsics. That way, in theory, different targets could have different implemenations of a __builtin_foo gcc intrinsic. --- Diffs of the changes: (+7 -7) Intrinsics.td | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.8 llvm/include/llvm/Intrinsics.td:1.9 --- llvm/include/llvm/Intrinsics.td:1.8 Tue Mar 14 14:00:20 2006 +++ llvm/include/llvm/Intrinsics.td Tue Mar 14 19:32:36 2006 @@ -97,6 +97,7 @@ string name = ""> { string LLVMName = name; string GCCBuiltinName = ""; + string TargetPrefix = ""; // Set to a prefix for target-specific intrinsics. list Types = types; list Properties = properties; } @@ -204,8 +205,6 @@ def int_dbg_region_start : Intrinsic<[llvm_void_ty]>; def int_dbg_region_end : Intrinsic<[llvm_void_ty]>; def int_dbg_func_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>; -//dbg_declare, // Declare a local object - //===--===// @@ -214,8 +213,9 @@ //===--===// // PowerPC Intrinsics - -def int_ppc_altivec_lvx : Intrinsic<[llvm_v4i32_ty, llvm_int_ty, llvm_ptr_ty], -[IntrReadMem]>, - GCCBuiltin<"__builtin_altivec_lvx">; - +// +let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.". + def int_ppc_altivec_lvx : Intrinsic<[llvm_v4i32_ty, llvm_int_ty, llvm_ptr_ty], + [IntrReadMem]>, +GCCBuiltin<"__builtin_altivec_lvx">; +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/CodeGenIntrinsics.h IntrinsicEmitter.cpp IntrinsicEmitter.h
Changes in directory llvm/utils/TableGen: CodeGenIntrinsics.h updated: 1.5 -> 1.6 IntrinsicEmitter.cpp updated: 1.9 -> 1.10 IntrinsicEmitter.h updated: 1.6 -> 1.7 --- Log message: Autogenerate code to map from GCC builtin to LLVM intrinsic. --- Diffs of the changes: (+59 -1) CodeGenIntrinsics.h |1 IntrinsicEmitter.cpp | 57 ++- IntrinsicEmitter.h |2 + 3 files changed, 59 insertions(+), 1 deletion(-) Index: llvm/utils/TableGen/CodeGenIntrinsics.h diff -u llvm/utils/TableGen/CodeGenIntrinsics.h:1.5 llvm/utils/TableGen/CodeGenIntrinsics.h:1.6 --- llvm/utils/TableGen/CodeGenIntrinsics.h:1.5 Mon Mar 13 17:08:44 2006 +++ llvm/utils/TableGen/CodeGenIntrinsics.h Tue Mar 14 19:33:26 2006 @@ -26,6 +26,7 @@ std::string Name; // The name of the LLVM function "llvm.bswap.i32" std::string EnumName; // The name of the enum "bswap_i32" std::string GCCBuiltinName;// Name of the corresponding GCC builtin, or "". +std::string TargetPrefix; // Target prefix, e.g. "ppc" for t-s intrinsics. /// ArgTypes - The type primitive enum value for the return value and all /// of the arguments. These are things like Type::UIntTyID. Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.9 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.10 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.9Mon Mar 13 23:59:52 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.cppTue Mar 14 19:33:26 2006 @@ -34,7 +34,7 @@ throw "Intrinsic '" + DefName + "' does not start with 'int_'!"; EnumName = std::string(DefName.begin()+4, DefName.end()); GCCBuiltinName = R->getValueAsString("GCCBuiltinName"); - + TargetPrefix = R->getValueAsString("TargetPrefix"); Name = R->getValueAsString("LLVMName"); if (Name == "") { // If an explicit name isn't specified, derive one from the DefName. @@ -44,6 +44,21 @@ Name += '.'; else Name += EnumName[i]; + } else { +// Verify it starts with "llvm.". +if (Name.size() <= 5 || +std::string(Name.begin(), Name.begin()+5) != "llvm.") + throw "Intrinsic '" + DefName + "'s name does not start with 'llvm.'!"; + } + + // If TargetPrefix is specified, make sure that Name starts with + // "llvm..". + if (!TargetPrefix.empty()) { +if (Name.size() < 6+TargetPrefix.size() || +std::string(Name.begin()+5, Name.begin()+6+TargetPrefix.size()) + != (TargetPrefix+".")) + throw "Intrinsic '" + DefName + "' does not start with 'llvm." + +TargetPrefix + ".'!"; } // Parse the list of argument types. @@ -109,6 +124,9 @@ // Emit a list of intrinsics with corresponding GCC builtins. EmitGCCBuiltinList(Ints, OS); + + // Emit code to translate GCC builtins into LLVM intrinsics. + EmitIntrinsicToGCCBuiltinMap(Ints, OS); } void IntrinsicEmitter::EmitEnumInfo(const std::vector &Ints, @@ -253,3 +271,40 @@ OS << " }\n"; OS << "#endif\n\n"; } + +void IntrinsicEmitter:: +EmitIntrinsicToGCCBuiltinMap(const std::vector &Ints, + std::ostream &OS) { + typedef std::map, std::string> BIMTy; + BIMTy BuiltinMap; + for (unsigned i = 0, e = Ints.size(); i != e; ++i) { +if (!Ints[i].GCCBuiltinName.empty()) { + std::pair Key(Ints[i].GCCBuiltinName, + Ints[i].TargetPrefix); + if (!BuiltinMap.insert(std::make_pair(Key, Ints[i].EnumName)).second) +throw "Intrinsic '" + Ints[i].TheDef->getName() + + "': duplicate GCC builtin name!"; +} + } + + OS << "// Get the LLVM intrinsic that corresponds to a GCC builtin.\n"; + OS << "// This is used by the C front-end. The GCC builtin name is passed\n"; + OS << "// in as BuiltinName, and a target prefix (e.g. 'ppc') is passed\n"; + OS << "// in as TargetPrefix. The result is assigned to 'IntrinsicID'.\n"; + OS << "#ifdef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN\n"; + OS << " if (0);\n"; + // Note: this could emit significantly better code if we cared. + for (BIMTy::iterator I = BuiltinMap.begin(), E = BuiltinMap.end();I != E;++I){ +OS << " else if ("; +if (!I->first.second.empty()) { + // Emit this as a strcmp, so it can be constant folded by the FE. + OS << "!strcmp(TargetPrefix, \"" << I->first.second << "\") &&\n" + << " "; +} +OS << "!strcmp(BuiltinName, \"" << I->first.first << "\"))\n"; +OS << "IntrinsicID = Intrinsic::" << I->second << "\";\n"; + } + OS << " else\n"; + OS << "IntrinsicID = Intrinsic::not_intrinsic;\n"; + OS << "#endif\n\n"; +} Index: llvm/utils/TableGen/IntrinsicEmitter.h diff -u llvm/utils/TableGen/IntrinsicEmitter.h:1.6 llvm/utils/TableGen/IntrinsicEmitter.h:1.7 --- llvm/utils/TableGen/IntrinsicEmitter.h:1.6 Mon Mar 13 17:08:44 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.h Tue Mar 14 19:33:26 2
[llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp IntrinsicEmitter.h
Changes in directory llvm/utils/TableGen: IntrinsicEmitter.cpp updated: 1.10 -> 1.11 IntrinsicEmitter.h updated: 1.7 -> 1.8 --- Log message: Autogenerate a table of intrinsic names, so we can map from intrinsic ID to LLVM intrinsic function name. --- Diffs of the changes: (+22 -4) IntrinsicEmitter.cpp | 24 IntrinsicEmitter.h |2 ++ 2 files changed, 22 insertions(+), 4 deletions(-) Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.10 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.11 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.10 Tue Mar 14 19:33:26 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.cppTue Mar 14 19:55:21 2006 @@ -109,10 +109,13 @@ // Emit the enum information. EmitEnumInfo(Ints, OS); + + // Emit the intrinsic ID -> name table. + EmitIntrinsicToNameTable(Ints, OS); // Emit the function name recognizer. EmitFnNameRecognizer(Ints, OS); - + // Emit the intrinsic verifier. EmitVerifier(Ints, OS); @@ -158,9 +161,6 @@ char LastChar = 0; for (std::map::iterator I = IntMapping.begin(), E = IntMapping.end(); I != E; ++I) { -assert(I->first.size() > 5 && std::string(I->first.begin(), - I->first.begin()+5) == "llvm." && - "Invalid intrinsic name!"); if (I->first[5] != LastChar) { LastChar = I->first[5]; OS << " case '" << LastChar << "':\n"; @@ -175,6 +175,22 @@ OS << "#endif\n\n"; } +void IntrinsicEmitter:: +EmitIntrinsicToNameTable(const std::vector &Ints, + std::ostream &OS) { + std::vector Names; + for (unsigned i = 0, e = Ints.size(); i != e; ++i) +Names.push_back(Ints[i].Name); + std::sort(Names.begin(), Names.end()); + + OS << "// Intrinsic ID to name table\n"; + OS << "#ifdef GET_INTRINSIC_NAME_TABLE\n"; + OS << " // Note that entry #0 is the invalid intrinsic!\n"; + for (unsigned i = 0, e = Names.size(); i != e; ++i) +OS << " \"" << Names[i] << "\",\n"; + OS << "#endif\n\n"; +} + static void EmitTypeVerify(std::ostream &OS, const std::string &Val, Record *ArgType) { OS << "Assert1(" << Val << "->getTypeID() == " Index: llvm/utils/TableGen/IntrinsicEmitter.h diff -u llvm/utils/TableGen/IntrinsicEmitter.h:1.7 llvm/utils/TableGen/IntrinsicEmitter.h:1.8 --- llvm/utils/TableGen/IntrinsicEmitter.h:1.7 Tue Mar 14 19:33:26 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.h Tue Mar 14 19:55:21 2006 @@ -31,6 +31,8 @@ void EmitFnNameRecognizer(const std::vector &Ints, std::ostream &OS); +void EmitIntrinsicToNameTable(const std::vector &Ints, + std::ostream &OS); void EmitVerifier(const std::vector &Ints, std::ostream &OS); void EmitModRefInfo(const std::vector &Ints, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp
Changes in directory llvm/utils/TableGen: IntrinsicEmitter.cpp updated: 1.11 -> 1.12 --- Log message: remove typo --- Diffs of the changes: (+1 -1) IntrinsicEmitter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.11 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.12 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.11 Tue Mar 14 19:55:21 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.cppTue Mar 14 20:05:38 2006 @@ -318,7 +318,7 @@ << " "; } OS << "!strcmp(BuiltinName, \"" << I->first.first << "\"))\n"; -OS << "IntrinsicID = Intrinsic::" << I->second << "\";\n"; +OS << "IntrinsicID = Intrinsic::" << I->second << ";\n"; } OS << " else\n"; OS << "IntrinsicID = Intrinsic::not_intrinsic;\n"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp
Changes in directory llvm/utils/TableGen: IntrinsicEmitter.cpp updated: 1.12 -> 1.13 --- Log message: Fix VC++ build error. --- Diffs of the changes: (+1 -0) IntrinsicEmitter.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/utils/TableGen/IntrinsicEmitter.cpp diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.12 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.13 --- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.12 Tue Mar 14 20:05:38 2006 +++ llvm/utils/TableGen/IntrinsicEmitter.cppTue Mar 14 20:51:05 2006 @@ -14,6 +14,7 @@ #include "IntrinsicEmitter.h" #include "Record.h" #include "llvm/ADT/StringExtras.h" +#include using namespace llvm; //===--===// ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
Changes in directory llvm/lib/Analysis/DataStructure: Local.cpp updated: 1.140 -> 1.141 --- Log message: improve mem intrinsics and add a few things povray uses --- Diffs of the changes: (+30 -3) Local.cpp | 33 ++--- 1 files changed, 30 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/DataStructure/Local.cpp diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.140 llvm/lib/Analysis/DataStructure/Local.cpp:1.141 --- llvm/lib/Analysis/DataStructure/Local.cpp:1.140 Thu Mar 2 18:00:25 2006 +++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Mar 14 21:43:59 2006 @@ -545,10 +545,18 @@ return; case Intrinsic::vaend: return; // noop - case Intrinsic::memmove_i32: case Intrinsic::memcpy_i32: - case Intrinsic::memmove_i64: case Intrinsic::memcpy_i64: { +//write first location +if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) + N->setHeapNodeMarker()->setModifiedMarker(); +//and read second pointer +if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) + N->setReadMarker(); +return; + } + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: { // Merge the first & second arguments, and mark the memory read and // modified. DSNodeHandle RetNH = getValueDest(**CS.arg_begin()); @@ -676,7 +684,6 @@ Link.mergeWith(getValueDest(**CS.arg_begin())); } } - return; } else if (F->getName() == "fopen" || F->getName() == "fdopen" || F->getName() == "freopen") { @@ -981,6 +988,26 @@ N->mergeTypeInfo(Type::DoubleTy, H.getOffset()); } return; +} else if (F->getName() == "qsort") { + CallSite::arg_iterator AI = CS.arg_begin(); + if (DSNode *N = getValueDest(**AI).getNode()) +N->setModifiedMarker(); + //How do you mark a function pointer as being called? Assume it is a read + AI += 3; + if (DSNode *N = getValueDest(**AI).getNode()) +N->setReadMarker(); + return; +} else if (F->getName() == "strcat" || F->getName() == "strncat") { + //This might be making unsafe assumptions about usage + //Merge return and first arg + DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); + RetNH.mergeWith(getValueDest(**CS.arg_begin())); + if (DSNode *N = RetNH.getNode()) +N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); + //and read second pointer + if (DSNode *N = getValueDest(**(CS.arg_begin() + 1)).getNode()) +N->setReadMarker(); + return; } else { // Unknown function, warn if it returns a pointer type or takes a // pointer argument. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.241 -> 1.242 --- Log message: Handle one offset with growth case seen in povray. Namely, if we have an offset, and the offset lands at a field boundary in the old type, construct a new type, copying the fields masked by the offset from the old type, and unify with that. --- Diffs of the changes: (+39 -10) DataStructure.cpp | 49 +++-- 1 files changed, 39 insertions(+), 10 deletions(-) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.241 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.242 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.241 Sun Jan 22 17:19:18 2006 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Mar 14 22:04:21 2006 @@ -492,13 +492,51 @@ return true; } -if (Offset) { // We could handle this case, but we don't for now... +// If this node would have to have an unreasonable number of fields, just +// collapse it. This can occur for fortran common blocks, which have stupid +// things like { [1 x double], [100 x double] }. +unsigned NumFields = (NewTySize+Offset+DS::PointerSize-1) >> DS::PointerShift; +if (NumFields > 256) { + foldNodeCompletely(); + return true; +} + +if (Offset) { + //handle some common cases: + // Ty:struct { t1, t2, t3, t4, ..., tn} + // NewTy: struct { offset, stuff...} + // try merge with NewTy: struct {t1, t2, stuff...} if offset lands exactly on a field in Ty + if (isa(NewTy) && isa(Ty)) { +DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n"); +unsigned O = 0; +const StructType *STy = cast(Ty); +const StructLayout &SL = *TD.getStructLayout(STy); +unsigned i = SL.getElementContainingOffset(Offset); +//Either we hit it exactly or give up +if (SL.MemberOffsets[i] != Offset) { + if (FoldIfIncompatible) foldNodeCompletely(); + return true; +} +std::vector nt; +for (unsigned x = 0; x < i; ++x) + nt.push_back(STy->getElementType(x)); +STy = cast(NewTy); +nt.insert(nt.end(), STy->element_begin(), STy->element_end()); +//and merge +STy = StructType::get(nt); +DEBUG(std::cerr << "Trying with: " << *STy << "\n"); +return mergeTypeInfo(STy, 0); + } + std::cerr << "UNIMP: Trying to merge a growth type into " << "offset != 0: Collapsing!\n"; + abort(); if (FoldIfIncompatible) foldNodeCompletely(); return true; + } + // Okay, the situation is nice and simple, we are trying to merge a type in // at offset 0 that is bigger than our current type. Implement this by // switching to the new type and then merge in the smaller one, which should @@ -506,15 +544,6 @@ // ok, it will collapse the node as appropriate. // -// If this node would have to have an unreasonable number of fields, just -// collapse it. This can occur for fortran common blocks, which have stupid -// things like { [1 x double], [100 x double] }. -unsigned NumFields = (NewTySize+DS::PointerSize-1) >> DS::PointerShift; -if (NumFields > 256) { - foldNodeCompletely(); - return true; -} - const Type *OldTy = Ty; Ty = NewTy; NodeType &= ~Array; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrInfo.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstrInfo.td updated: 1.182 -> 1.183 --- Log message: Update scheduling info for vrsave instruction --- Diffs of the changes: (+2 -2) PPCInstrInfo.td |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.182 llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.183 --- llvm/lib/Target/PowerPC/PPCInstrInfo.td:1.182 Mon Mar 13 15:52:10 2006 +++ llvm/lib/Target/PowerPC/PPCInstrInfo.td Tue Mar 14 23:25:05 2006 @@ -710,10 +710,10 @@ // characteristics as an OR instruction. def MTVRSAVE : XFXForm_7_ext<31, 467, 256, (ops GPRC:$rS), "mtspr 256, $rS", IntGeneral>, - PPC970_Unit_FXU; + PPC970_DGroup_Single, PPC970_Unit_FXU; def MFVRSAVE : XFXForm_1_ext<31, 339, 256, (ops GPRC:$rT), "mfspr $rT, 256", IntGeneral>, - PPC970_Unit_FXU; + PPC970_DGroup_First, PPC970_Unit_FXU; def MFCR : XFXForm_3<31, 19, (ops GPRC:$rT), "mfcr $rT", SprMFCR>, PPC970_MicroCode, PPC970_Unit_CRU; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Changes in directory llvm/lib/Analysis/DataStructure: DataStructure.cpp updated: 1.242 -> 1.243 --- Log message: allow field sensitivity to be a tunable parameter --- Diffs of the changes: (+6 -2) DataStructure.cpp |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.242 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.243 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.242 Tue Mar 14 22:04:21 2006 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Mar 14 23:43:41 2006 @@ -39,6 +39,10 @@ Statistic<> NumDNE("dsa", "Number of nodes removed by reachability"); Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed"); Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed"); + static cl::opt + DSAFieldLimit("dsa-field-limit", cl::Hidden, +cl::desc("Number of fields to track before collapsing a node"), +cl::init(256)); }; #if 0 @@ -468,7 +472,7 @@ // collapse it. This can occur for fortran common blocks, which have stupid // things like { [1 x double], [100 x double] }. unsigned NumFields = (NewTySize+DS::PointerSize-1) >> DS::PointerShift; -if (NumFields > 256) { +if (NumFields > DSAFieldLimit) { foldNodeCompletely(); return true; } @@ -496,7 +500,7 @@ // collapse it. This can occur for fortran common blocks, which have stupid // things like { [1 x double], [100 x double] }. unsigned NumFields = (NewTySize+Offset+DS::PointerSize-1) >> DS::PointerShift; -if (NumFields > 256) { +if (NumFields > DSAFieldLimit) { foldNodeCompletely(); return true; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits