Re: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp
Hi Evan, > Can you get me a test case? I need to see what gcc is doing. Thanks, Sure. Zero sized fields in structs may not be very useful, but it is still legal to use them, in particular you can take their address, like this: struct Z {}; struct Y { int i; struct Z z; }; void *f(struct Y *y) { return &y->z; } This used to work before your patch. For that matter, llvm-gcc-4.2 itself fails to build here (linux x86-32; crashes compiling libgcov.c) for what looks to be the same reason. Also, don't forget that Ada can have fields of variable size in various places in a struct, and these can be represented by zero-size LLVM fields (this kind of struct doesn't get passed to functions by copy though). Can you please explain why you made this change (a testcase would be good). Best wishes, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp
On Jan 27, 2008, at 1:03 AM, Duncan Sands wrote: > Hi Evan, > >> Can you get me a test case? I need to see what gcc is doing. Thanks, > > Sure. Zero sized fields in structs may not be very useful, but it is > still legal to use them, in particular you can take their address, > like this: > > struct Z {}; > > struct Y { > int i; > struct Z z; > }; > > void *f(struct Y *y) { > return &y->z; > } > > This used to work before your patch. For that matter, llvm-gcc-4.2 > itself fails to build here (linux x86-32; crashes compiling > libgcov.c) for > what looks to be the same reason. Also, don't forget that Ada can > have > fields of variable size in various places in a struct, and these > can be > represented by zero-size LLVM fields (this kind of struct doesn't get > passed to functions by copy though). > > Can you please explain why you made this change (a testcase would be > good). > I'm running into this problem as well -- it crashing while compiling gcov.c on my PPC G4. -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp
> I'm running into this problem as well -- it crashing while compiling > gcov.c on my PPC G4. While r46381 seems the obvious culprit, to tell the truth I didn't check whether reverting this patch fixes the problem - so I could be wrong. Ciao, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46412 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h llvm-convert.cpp
On Jan 26, 2008, at 11:18 PM, Chris Lattner wrote: > Author: lattner > Date: Sun Jan 27 01:18:20 2008 > New Revision: 46412 > > URL: http://llvm.org/viewvc/llvm-project?rev=46412&view=rev > Log: > Change x86-32 aggregate passing code to pass many aggregates "by > pieces" > instead of passing them with byval. This allows us to get > significantly > better code without affecting the ABI (because x86-32 passes stuff > on the > stack). Most significantly, we pass _Complex as a two scalar fp > values > now. For example, before we compiled ccosf to: Not everything is passed on the stack with -msseregparm, which doesn't work now but should. In that mode a _Complex is not passed the same as two scalars. > _ccosf: > pushl %ebp > movl%esp, %ebp > pushl %edi > pushl %esi > subl$16, %esp > movss 12(%ebp), %xmm0 > xorps LCPI1_0, %xmm0 > movss 8(%ebp), %xmm1 > movss %xmm0, -16(%ebp) > movss %xmm1, -12(%ebp) > leal-16(%ebp), %esi > movl$2, %ecx > movl%esp, %edi > rep;movsl > call_ccoshf > addl$16, %esp > popl%esi > popl%edi > popl%ebp > ret > > now we get: > > _ccosf: > pushl %ebp > movl%esp, %ebp > subl$8, %esp > movss 8(%ebp), %xmm0 > movss %xmm0, 4(%esp) > movss 12(%ebp), %xmm0 > xorps LCPI1_0, %xmm0 > movss %xmm0, (%esp) > call_ccoshf > addl$8, %esp > popl%ebp > ret > > Evan, please review this. Thanks! > > > Modified: >llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h >llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp >llvm-gcc-4.2/trunk/gcc/llvm-abi.h >llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h > URL: > http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=46412&r1=46411&r2=46412&view=diff > > = > = > = > = > = > = > = > = > == > --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Sun Jan 27 > 01:18:20 2008 > @@ -62,20 +62,24 @@ > } \ > } > > -extern bool llvm_x86_should_pass_aggregate_in_memory(tree); > +#ifdef LLVM_ABI_H > +extern bool llvm_x86_should_pass_aggregate_in_memory(tree, const > Type *); > > -#define LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(X) \ > - llvm_x86_should_pass_aggregate_in_memory(X) > +#define LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(X, TY) \ > + llvm_x86_should_pass_aggregate_in_memory(X, TY) > > > -#ifdef LLVM_ABI_H > extern bool > -llvm_x86_64_should_pass_aggregate_in_mixed_regs(tree, > +llvm_x86_64_should_pass_aggregate_in_mixed_regs(tree, const Type *Ty, > +std::vector Type*>&); > +extern bool > +llvm_x86_32_should_pass_aggregate_in_mixed_regs(tree, const Type *Ty, > std::vector Type*>&); > > -#define LLVM_SHOULD_PASS_AGGREGATE_IN_MIXED_REGS(T, E) \ > - (TARGET_64BIT && \ > - llvm_x86_64_should_pass_aggregate_in_mixed_regs((T), (E))) > +#define LLVM_SHOULD_PASS_AGGREGATE_IN_MIXED_REGS(T, TY, > E)\ > + > (TARGET_64BIT ? \ > + llvm_x86_64_should_pass_aggregate_in_mixed_regs((T), (TY), > (E)) : \ > + llvm_x86_32_should_pass_aggregate_in_mixed_regs((T), (TY), (E))) > #endif /* LLVM_ABI_H */ > > /* LLVM LOCAL end (ENTIRE FILE!) */ > > Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp > URL: > http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=46412&r1=46411&r2=46412&view=diff > > = > = > = > = > = > = > = > = > == > --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original) > +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Sun Jan 27 > 01:18:20 2008 > @@ -691,7 +691,7 @@ > > /* Target hook for llvm-abi.h. It returns true if an aggregate of the >specified type should be passed in memory. */ > -bool llvm_x86_should_pass_aggregate_in_memory(tree TreeType) { > +bool llvm_x86_should_pass_aggregate_in_memory(tree TreeType, const > Type *Ty) { > enum machine_mode Mode = ix86_getNaturalModeForType(TreeType); > HOST_WIDE_INT Bytes = > (Mode == BLKmode) ? int_size_in_bytes(TreeType) : (int) > GET_MODE_SIZE(Mode); > @@ -706,8 +706,10 @@ > if (llvm_x86_is_all_integer_types(Ty)) > return false; > } > - if (!TARGET_64BIT) > -return true; > + if (!TARGET_64BIT) { > +std::vector Elts; > +return ! > llvm_x86_32_should_pass_aggregate_in_mixed_regs(TreeT
[llvm-commits] [llvm-gcc-4.2] r46415 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Author: baldrick Date: Sun Jan 27 12:11:13 2008 New Revision: 46415 URL: http://llvm.org/viewvc/llvm-project?rev=46415&view=rev Log: Do not mark a function readnone or readonly if it has a byval parameter. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46415&r1=46414&r2=46415&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Sun Jan 27 12:11:13 2008 @@ -1219,14 +1219,19 @@ DeclArgs = TREE_CHAIN(DeclArgs); } - // If we see a byval argument and if the function is 'readnone' we have to - // demote the function to being 'readonly' instead. Not doing so would allow - // optimizers to delete stores into the argument that is passed into the - // function. - if (HasByVal && Attrs[0].index == 0 && - (Attrs[0].attrs & ParamAttr::ReadNone)) { -Attrs[0].attrs &= ~ParamAttr::ReadNone; -Attrs[0].attrs |= ParamAttr::ReadOnly; + // If there is a byval argument then it is not safe to mark the function + // 'readnone' or 'readonly': gcc permits a 'const' or 'pure' function to + // write to struct arguments passed by value, but in LLVM this becomes a + // write through the byval pointer argument, which LLVM does not allow for + // readonly/readnone functions. + if (HasByVal && Attrs[0].index == 0) { +uint16_t &RAttrs = Attrs[0].attrs; +RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly); +if (RAttrs == ParamAttr::None) { + for (unsigned i = 1, e = Attrs.size(); i < e ; ++i) +Attrs[i-1] = Attrs[i]; + Attrs.pop_back(); +} } // If the argument list ends with a void type node, it isn't vararg. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46416 - in /llvm/trunk: lib/Transforms/Utils/InlineFunction.cpp test/Transforms/Inline/byval2.ll
Author: baldrick Date: Sun Jan 27 12:12:58 2008 New Revision: 46416 URL: http://llvm.org/viewvc/llvm-project?rev=46416&view=rev Log: Revert r46393: readonly/readnone functions are no longer allowed to write through byval arguments. Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp llvm/trunk/test/Transforms/Inline/byval2.ll Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=46416&r1=46415&r2=46416&view=diff == --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Sun Jan 27 12:12:58 2008 @@ -240,15 +240,12 @@ E = CalledFunc->arg_end(); I != E; ++I, ++AI, ++ArgNo) { Value *ActualArg = *AI; - // When byval arguments are inlined, we need to make the copy implied - // by them explicit. It is tempting to think that this is not needed if - // the callee is readonly, because the callee doesn't modify the struct. - // However this would be wrong: readonly means that any writes the callee - // performs are not visible to the caller. But writes by the callee to - // an argument passed byval are by definition not visible to the caller! - // Since we allow this kind of readonly function, there needs to be an - // explicit copy in order to keep the writes invisible after inlining. - if (CalledFunc->paramHasAttr(ArgNo+1, ParamAttr::ByVal)) { + // When byval arguments actually inlined, we need to make the copy implied + // by them explicit. However, we don't do this if the callee is readonly + // or readnone, because the copy would be unneeded: the callee doesn't + // modify the struct. + if (CalledFunc->paramHasAttr(ArgNo+1, ParamAttr::ByVal) && + !CalledFunc->onlyReadsMemory()) { const Type *AggTy = cast(I->getType())->getElementType(); const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); Modified: llvm/trunk/test/Transforms/Inline/byval2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/byval2.ll?rev=46416&r1=46415&r2=46416&view=diff == --- llvm/trunk/test/Transforms/Inline/byval2.ll (original) +++ llvm/trunk/test/Transforms/Inline/byval2.ll Sun Jan 27 12:12:58 2008 @@ -1,7 +1,7 @@ -; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {llvm.memcpy} +; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep {llvm.memcpy} -; Inlining a byval struct should cause an explicit copy -; into an alloca even if the function is readonly +; Inlining a byval struct should NOT cause an explicit copy +; into an alloca if the function is readonly %struct.ss = type { i32, i64 } @.str = internal constant [10 x i8] c"%d, %lld\0A\00" ; <[10 x i8]*> [#uses=1] ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46414 - in /llvm/trunk: lib/CodeGen/SelectionDAG/DAGCombiner.cpp test/CodeGen/X86/fp-in-intregs.ll
Author: lattner Date: Sun Jan 27 11:42:27 2008 New Revision: 46414 URL: http://llvm.org/viewvc/llvm-project?rev=46414&view=rev Log: Implement some dag combines that allow doing fneg/fabs/fcopysign in integer registers if used by a bitconvert or using a bitconvert. This allows us to avoid constant pool loads and use cheaper integer instructions when the values come from or end up in integer regs anyway. For example, we now compile CodeGen/X86/fp-in-intregs.ll to: _test1: movl$2147483648, %eax xorl4(%esp), %eax ret _test2: movl$1065353216, %eax orl 4(%esp), %eax andl$3212836864, %eax ret Instead of: _test1: movss 4(%esp), %xmm0 xorps LCPI2_0, %xmm0 movd%xmm0, %eax ret _test2: movss 4(%esp), %xmm0 andps LCPI3_0, %xmm0 movss LCPI3_1, %xmm1 andps LCPI3_2, %xmm1 orps%xmm0, %xmm1 movd%xmm1, %eax ret bitconverts can happen due to various calling conventions that require fp values to passed in integer regs in some cases, e.g. when returning a complex. Added: llvm/trunk/test/CodeGen/X86/fp-in-intregs.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46414&r1=46413&r2=46414&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Jan 27 11:42:27 2008 @@ -1190,7 +1190,7 @@ return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0); // If we know the sign bits of both operands are zero, strength reduce to a // udiv instead. Handles (X&15) /s 4 -> X&15 >> 2 - uint64_t SignBit = 1ULL << (MVT::getSizeInBits(VT)-1); + uint64_t SignBit = MVT::getIntVTSignBit(VT); if (DAG.MaskedValueIsZero(N1, SignBit) && DAG.MaskedValueIsZero(N0, SignBit)) return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1); @@ -1306,7 +1306,7 @@ return DAG.getNode(ISD::SREM, VT, N0, N1); // If we know the sign bits of both operands are zero, strength reduce to a // urem instead. Handles (X & 0x0FFF) %s 16 -> X&15 - uint64_t SignBit = 1ULL << (MVT::getSizeInBits(VT)-1); + uint64_t SignBit = MVT::getIntVTSignBit(VT); if (DAG.MaskedValueIsZero(N1, SignBit) && DAG.MaskedValueIsZero(N0, SignBit)) return DAG.getNode(ISD::UREM, VT, N0, N1); @@ -3276,6 +3276,57 @@ } } + // Fold bitconvert(fneg(x)) -> xor(bitconvert(x), signbit) + // Fold bitconvert(fabs(x)) -> and(bitconvert(x), ~signbit) + // This often reduces constant pool loads. + if ((N0.getOpcode() == ISD::FNEG || N0.getOpcode() == ISD::FABS) && + N0.Val->hasOneUse() && MVT::isInteger(VT) && !MVT::isVector(VT)) { +SDOperand NewConv = DAG.getNode(ISD::BIT_CONVERT, VT, N0.getOperand(0)); +AddToWorkList(NewConv.Val); + +uint64_t SignBit = MVT::getIntVTSignBit(VT); +if (N0.getOpcode() == ISD::FNEG) + return DAG.getNode(ISD::XOR, VT, NewConv, DAG.getConstant(SignBit, VT)); +assert(N0.getOpcode() == ISD::FABS); +return DAG.getNode(ISD::AND, VT, NewConv, DAG.getConstant(~SignBit, VT)); + } + + // Fold bitconvert(fcopysign(cst, x)) -> bitconvert(x)&sign | cst&~sign' + // Note that we don't handle copysign(x,cst) because this can always be folded + // to an fneg or fabs. + if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse() && + isa(N0.getOperand(0))) { +unsigned OrigXWidth = MVT::getSizeInBits(N0.getOperand(1).getValueType()); +SDOperand X = DAG.getNode(ISD::BIT_CONVERT, MVT::getIntegerType(OrigXWidth), + N0.getOperand(1)); +AddToWorkList(X.Val); + +// If X has a different width than the result/lhs, sext it or truncate it. +unsigned VTWidth = MVT::getSizeInBits(VT); +if (OrigXWidth < VTWidth) { + X = DAG.getNode(ISD::SIGN_EXTEND, VT, X); + AddToWorkList(X.Val); +} else if (OrigXWidth > VTWidth) { + // To get the sign bit in the right place, we have to shift it right + // before truncating. + X = DAG.getNode(ISD::SRL, X.getValueType(), X, + DAG.getConstant(OrigXWidth-VTWidth, X.getValueType())); + AddToWorkList(X.Val); + X = DAG.getNode(ISD::TRUNCATE, VT, X); + AddToWorkList(X.Val); +} + +uint64_t SignBit = MVT::getIntVTSignBit(VT); +X = DAG.getNode(ISD::AND, VT, X, DAG.getConstant(SignBit, VT)); +AddToWorkList(X.Val); + +SDOperand Cst = DAG.getNode(ISD::BIT_CONVERT, VT, N0.getOperand(0)); +Cst = DAG.getNode(ISD::AND, VT, Cst, DAG.getConstant(~SignBit, VT)); +AddToWorkList(Cst.Val); + +return DAG.getNode(ISD::OR, VT, X, Cst); + } + return SDOperand(); } @@ -3732,6 +3783,19 @@ if (
[llvm-commits] [llvm] r46417 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnroll.cpp test/Transforms/LoopUnroll/2007-11-05-Crash.ll
Author: nicholas Date: Sun Jan 27 12:35:00 2008 New Revision: 46417 URL: http://llvm.org/viewvc/llvm-project?rev=46417&view=rev Log: Be more careful modifying the use_list while also iterating through it. Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=46417&r1=46416&r2=46417&view=diff == --- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Sun Jan 27 12:35:00 2008 @@ -365,8 +365,9 @@ // be updated specially after unrolling all the way. if (*BB != LatchBlock) for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end(); - UI != UE; ++UI) { + UI != UE;) { Instruction *UseInst = cast(*UI); + ++UI; if (isa(UseInst) && !L->contains(UseInst->getParent())) { PHINode *phi = cast(UseInst); Value *Incoming = phi->getIncomingValueForBlock(*BB); Modified: llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll?rev=46417&r1=46416&r2=46417&view=diff == --- llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll (original) +++ llvm/trunk/test/Transforms/LoopUnroll/2007-11-05-Crash.ll Sun Jan 27 12:35:00 2008 @@ -1,5 +1,7 @@ ; RUN: llvm-as < %s | opt -disable-output -loop-unroll ; PR1770 +; PR1947 + %struct.cl_engine = type { i32, i16, i32, i8**, i8**, i8*, i8*, i8*, i8*, i8*, i8*, i8* } %struct.cl_limits = type { i32, i32, i32, i32, i16, i64 } %struct.cli_ac_alt = type { i8, i8*, i16, i16, %struct.cli_ac_alt* } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46415 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
> URL: http://llvm.org/viewvc/llvm-project?rev=46415&view=rev > Log: > Do not mark a function readnone or readonly if it has > a byval parameter. Thanks Duncan: > +uint16_t &RAttrs = Attrs[0].attrs; > +RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly); > +if (RAttrs == ParamAttr::None) { > + for (unsigned i = 1, e = Attrs.size(); i < e ; ++i) > +Attrs[i-1] = Attrs[i]; > + Attrs.pop_back(); > +} How about: if (RAttrs == ParamAttr::None) Attrs.erase(Attrs.begin()); ? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46415 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
> How about: > > if (RAttrs == ParamAttr::None) >Attrs.erase(Attrs.begin()); Now you see that I really don't know anything about std::vector :) I will change it. Ciao, Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc-4.2] r46418 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Author: baldrick Date: Sun Jan 27 12:58:34 2008 New Revision: 46418 URL: http://llvm.org/viewvc/llvm-project?rev=46418&view=rev Log: Baldrick discovers "erase". Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46418&r1=46417&r2=46418&view=diff == --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Sun Jan 27 12:58:34 2008 @@ -1227,11 +1227,8 @@ if (HasByVal && Attrs[0].index == 0) { uint16_t &RAttrs = Attrs[0].attrs; RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly); -if (RAttrs == ParamAttr::None) { - for (unsigned i = 1, e = Attrs.size(); i < e ; ++i) -Attrs[i-1] = Attrs[i]; - Attrs.pop_back(); -} +if (RAttrs == ParamAttr::None) + Attrs.erase(Attrs.begin()); } // If the argument list ends with a void type node, it isn't vararg. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46419 - /llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h
Author: resistor Date: Sun Jan 27 13:51:03 2008 New Revision: 46419 URL: http://llvm.org/viewvc/llvm-project?rev=46419&view=rev Log: Fixes for BreakCriticalMachineCodeEdge by Fernando. Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h?rev=46419&r1=46418&r2=46419&view=diff == --- llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h (original) +++ llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Sun Jan 27 13:51:03 2008 @@ -33,13 +33,14 @@ // insert the new block into the machine function. src->getParent()->getBasicBlockList().insert(src->getParent()->end(), - crit_mbb); + crit_mbb); // insert a unconditional branch linking the new block to dst const TargetMachine& TM = src->getParent()->getTarget(); const TargetInstrInfo* TII = TM.getInstrInfo(); std::vector emptyConditions; - TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0, emptyConditions); + TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0, +emptyConditions); // modify every branch in src that points to dst to point to the new // machine basic block instead: @@ -48,18 +49,18 @@ while (mii != src->begin()) { mii--; // if there are no more branches, finish the loop -if (!TII->isTerminatorInstr(mii->getOpcode())) { +if (!mii->getDesc().isTerminator()) { break; } - + // Scan the operands of this branch, replacing any uses of dst with // crit_mbb. for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { MachineOperand & mo = mii->getOperand(i); if (mo.isMachineBasicBlock() && - mo.getMachineBasicBlock() == dst) { + mo.getMBB() == dst) { found_branch = true; -mo.setMachineBasicBlock(crit_mbb); +mo.setMBB(crit_mbb); } } } @@ -68,7 +69,8 @@ // I am inserting too many gotos, but I am trusting that the asm printer // will optimize the unnecessary gotos. if(!found_branch) { -TII->InsertBranch(*src, crit_mbb, (MachineBasicBlock*)0, emptyConditions); +TII->InsertBranch(*src, crit_mbb, (MachineBasicBlock*)0, + emptyConditions); } /// Change all the phi functions in dst, so that the incoming block be @@ -77,29 +79,28 @@ /// the first instructions are always phi functions. if(mii->getOpcode() != TargetInstrInfo::PHI) break; - + // Find the operands corresponding to the source block std::vector toRemove; unsigned reg = 0; for (unsigned u = 0; u != mii->getNumOperands(); ++u) if (mii->getOperand(u).isMachineBasicBlock() && - mii->getOperand(u).getMachineBasicBlock() == src) { + mii->getOperand(u).getMBB() == src) { reg = mii->getOperand(u-1).getReg(); toRemove.push_back(u-1); } - // Remove all uses of this MBB for (std::vector::reverse_iterator I = toRemove.rbegin(), E = toRemove.rend(); I != E; ++I) { mii->RemoveOperand(*I+1); mii->RemoveOperand(*I); } - + // Add a single use corresponding to the new MBB -mii->addRegOperand(reg, false); -mii->addMachineBasicBlockOperand(crit_mbb); +mii->addOperand(MachineOperand::CreateReg(reg, false)); +mii->addOperand(MachineOperand::CreateMBB(crit_mbb)); } - + return crit_mbb; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46420 - /llvm/trunk/lib/CodeGen/RegAllocLocal.cpp
Author: resistor Date: Sun Jan 27 16:00:00 2008 New Revision: 46420 URL: http://llvm.org/viewvc/llvm-project?rev=46420&view=rev Log: Reg alloc doesn't really need LiveVariables. Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=46420&r1=46419&r2=46420&view=diff == --- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Sun Jan 27 16:00:00 2008 @@ -19,7 +19,6 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/RegAllocRegistry.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" @@ -51,7 +50,6 @@ MachineFunction *MF; const MRegisterInfo *MRI; const TargetInstrInfo *TII; -LiveVariables *LV; // StackSlotForVirtReg - Maps virtual regs to the frame index where these // values are spilled. @@ -148,7 +146,6 @@ } virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); AU.addRequiredID(PHIEliminationID); AU.addRequiredID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); @@ -497,9 +494,8 @@ Ops.push_back(OpNum); if (MachineInstr* FMI = TII->foldMemoryOperand(MI, Ops, FrameIndex)) { ++NumFolded; - // Since we changed the address of MI, make sure to update live variables - // to know that the new instruction has the properties of the old one. - LV->instructionChanged(MI, FMI); + // Update kill/dead flags. + FMI->copyKillDeadInfo(MI); return MBB.insert(MBB.erase(MI), FMI); } @@ -778,8 +774,6 @@ // Finally, if this is a noop copy instruction, zap it. unsigned SrcReg, DstReg; if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) { - LV->removeVirtualRegistersKilled(MI); - LV->removeVirtualRegistersDead(MI); MBB.erase(MI); } } @@ -821,7 +815,6 @@ TM = &Fn.getTarget(); MRI = TM->getRegisterInfo(); TII = TM->getInstrInfo(); - LV = &getAnalysis(); PhysRegsUsed.assign(MRI->getNumRegs(), -1); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp
Sorry I have been away from my computer for the last two days. I'll look at this later tonight. Evan On Jan 27, 2008, at 10:02 AM, Duncan Sands <[EMAIL PROTECTED]> wrote: >> I'm running into this problem as well -- it crashing while compiling >> gcov.c on my PPC G4. > > While r46381 seems the obvious culprit, to tell the truth I didn't > check > whether reverting this patch fixes the problem - so I could be wrong. > > Ciao, > > Duncan. > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46412 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386-target.h config/i386/llvm-i386.cpp llvm-abi.h llvm-convert.cpp
On Jan 27, 2008, at 10:09 AM, Dale Johannesen wrote: > On Jan 26, 2008, at 11:18 PM, Chris Lattner wrote: >> Author: lattner >> Date: Sun Jan 27 01:18:20 2008 >> New Revision: 46412 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46412&view=rev >> Log: >> Change x86-32 aggregate passing code to pass many aggregates "by >> pieces" >> instead of passing them with byval. This allows us to get >> significantly >> better code without affecting the ABI (because x86-32 passes stuff >> on the >> stack). Most significantly, we pass _Complex as a two scalar fp >> values >> now. For example, before we compiled ccosf to: > > Not everything is passed on the stack with -msseregparm, which doesn't > work now but should. In that mode a _Complex is not passed the same > as two scalars. Right, in that case, the scalars need to be marked with the inreg attribute though. In this case, they never will be marked with that, so I don't think this could cause a problem. The corollary is when you use -mregparm, which marks integer registers as inreg. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46421 - /llvm/trunk/tools/llvm-ld/llvm-ld.cpp
Author: lattner Date: Sun Jan 27 16:58:59 2008 New Revision: 46421 URL: http://llvm.org/viewvc/llvm-project?rev=46421&view=rev Log: Add support for frameworks. Patch by Shantonu Sen! Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp Modified: llvm/trunk/tools/llvm-ld/llvm-ld.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ld/llvm-ld.cpp?rev=46421&r1=46420&r2=46421&view=diff == --- llvm/trunk/tools/llvm-ld/llvm-ld.cpp (original) +++ llvm/trunk/tools/llvm-ld/llvm-ld.cpp Sun Jan 27 16:58:59 2008 @@ -55,10 +55,18 @@ cl::desc("Specify a library search path"), cl::value_desc("directory")); +static cl::list FrameworkPaths("F", cl::Prefix, + cl::desc("Specify a framework search path"), + cl::value_desc("directory")); + static cl::list Libraries("l", cl::Prefix, cl::desc("Specify libraries to link to"), cl::value_desc("library prefix")); +static cl::list Frameworks("framework", + cl::desc("Specify frameworks to link to"), + cl::value_desc("framework")); + // Options to control the linking, optimization, and code gen processes static cl::opt LinkAsLibrary("link-as-library", cl::desc("Link the .bc files together as a library, not an executable")); @@ -287,6 +295,8 @@ /// OutputFilename - The name of the file to generate. /// NativeLinkItems - The native libraries, files, code with which to link /// LibPaths- The list of directories in which to find libraries. +/// FrameworksPaths - The list of directories in which to find frameworks. +/// Frameworks - The list of frameworks (dynamic libraries) /// gcc - The pathname to use for GGC. /// envp- A copy of the process's current environment. /// @@ -331,10 +341,12 @@ args.push_back(OutputFilename); args.push_back(InputFilename); - // Add in the library paths + // Add in the library and framework paths for (unsigned index = 0; index < LibPaths.size(); index++) { -args.push_back("-L"); -args.push_back(LibPaths[index]); +args.push_back("-L" + LibPaths[index]); + } + for (unsigned index = 0; index < FrameworkPaths.size(); index++) { +args.push_back("-F" + FrameworkPaths[index]); } // Add the requested options @@ -350,6 +362,11 @@ args.push_back(LinkItems[index].first); } + // Add in frameworks to link. + for (unsigned index = 0; index < Frameworks.size(); index++) { +args.push_back("-framework"); +args.push_back(Frameworks[index]); + } // Now that "args" owns all the std::strings for the arguments, call the c_str // method to get the underlying string array. We do this game so that the ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46422 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Author: lattner Date: Sun Jan 27 17:21:58 2008 New Revision: 46422 URL: http://llvm.org/viewvc/llvm-project?rev=46422&view=rev Log: fix a crash on CodeGen/X86/vector-rem.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46422&r1=46421&r2=46422&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Jan 27 17:21:58 2008 @@ -1306,10 +1306,12 @@ return DAG.getNode(ISD::SREM, VT, N0, N1); // If we know the sign bits of both operands are zero, strength reduce to a // urem instead. Handles (X & 0x0FFF) %s 16 -> X&15 - uint64_t SignBit = MVT::getIntVTSignBit(VT); - if (DAG.MaskedValueIsZero(N1, SignBit) && - DAG.MaskedValueIsZero(N0, SignBit)) -return DAG.getNode(ISD::UREM, VT, N0, N1); + if (!MVT::isVector(VT)) { +uint64_t SignBit = MVT::getIntVTSignBit(VT); +if (DAG.MaskedValueIsZero(N1, SignBit) && +DAG.MaskedValueIsZero(N0, SignBit)) + return DAG.getNode(ISD::UREM, VT, N0, N1); + } // If X/C can be simplified by the division-by-constant logic, lower // X%C to the equivalent of X-X/C*C. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46423 - /llvm/trunk/test/CodeGen/ARM/fparith.ll
Author: lattner Date: Sun Jan 27 17:26:37 2008 New Revision: 46423 URL: http://llvm.org/viewvc/llvm-project?rev=46423&view=rev Log: Update this test. Due to dag combiner improvements, we now compile f7/f11 to: _f7: eor r0, r0, #2, 2 @ -2147483648 bx lr _f11: bic r0, r0, #2, 2 @ -2147483648 bx lr instead of: _f7: fmsr s0, r0 fnegs s0, s0 fmrs r0, s0 bx lr _f11: fmsr s0, r0 fabss s0, s0 fmrs r0, s0 bx lr Modified: llvm/trunk/test/CodeGen/ARM/fparith.ll Modified: llvm/trunk/test/CodeGen/ARM/fparith.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fparith.ll?rev=46423&r1=46422&r2=46423&view=diff == --- llvm/trunk/test/CodeGen/ARM/fparith.ll (original) +++ llvm/trunk/test/CodeGen/ARM/fparith.ll Sun Jan 27 17:26:37 2008 @@ -3,7 +3,7 @@ ; RUN: grep faddd %t ; RUN: grep fmuls %t ; RUN: grep fmuld %t -; RUN: grep fnegs %t +; RUN: grep eor %t ; RUN: grep fnegd %t ; RUN: grep fdivs %t ; RUN: grep fdivd %t ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46425 - /llvm/trunk/docs/Makefile
Author: lattner Date: Sun Jan 27 17:43:26 2008 New Revision: 46425 URL: http://llvm.org/viewvc/llvm-project?rev=46425&view=rev Log: Always for PACKAGEVERSION to 'mainline' for teh llvm web page. Modified: llvm/trunk/docs/Makefile Modified: llvm/trunk/docs/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Makefile?rev=46425&r1=46424&r2=46425&view=diff == --- llvm/trunk/docs/Makefile (original) +++ llvm/trunk/docs/Makefile Sun Jan 27 17:43:26 2008 @@ -13,15 +13,12 @@ ifdef BUILD_FOR_WEBSITE PROJ_OBJ_DIR = . DOXYGEN = doxygen -# Extract version number from the AC_INT line in configure.ac -# AC_INIT([[llvm]],[[2.1svn]],[EMAIL PROTECTED]) -PACKAGE_VERSION = $(shell grep AC_INIT ../autoconf/configure.ac | sed -e 's/^[^0-9]*\([0-9_.a-zA-Z-]*\).*/\1/' ) $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in cat $< | sed \ -e 's/@abs_top_srcdir@/../g' \ -e 's/@DOT@/dot/g' \ - -e 's/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/' \ + -e 's/@PACKAGE_VERSION@/mainline/' \ -e 's/@abs_top_builddir@/../g' > $@ endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46424 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Author: lattner Date: Sun Jan 27 17:32:17 2008 New Revision: 46424 URL: http://llvm.org/viewvc/llvm-project?rev=46424&view=rev Log: Fix PowerPC/./2007-10-18-PtrArithmetic.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46424&r1=46423&r2=46424&view=diff == --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Jan 27 17:32:17 2008 @@ -1190,10 +1190,12 @@ return DAG.getNode(ISD::SUB, VT, DAG.getConstant(0, VT), N0); // If we know the sign bits of both operands are zero, strength reduce to a // udiv instead. Handles (X&15) /s 4 -> X&15 >> 2 - uint64_t SignBit = MVT::getIntVTSignBit(VT); - if (DAG.MaskedValueIsZero(N1, SignBit) && - DAG.MaskedValueIsZero(N0, SignBit)) -return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1); + if (!MVT::isVector(VT)) { +uint64_t SignBit = MVT::getIntVTSignBit(VT); +if (DAG.MaskedValueIsZero(N1, SignBit) && +DAG.MaskedValueIsZero(N0, SignBit)) + return DAG.getNode(ISD::UDIV, N1.getValueType(), N0, N1); + } // fold (sdiv X, pow2) -> simple ops after legalize if (N1C && N1C->getValue() && !TLI.isIntDivCheap() && (isPowerOf2_64(N1C->getSignExtended()) || @@ -3297,7 +3299,8 @@ // Note that we don't handle copysign(x,cst) because this can always be folded // to an fneg or fabs. if (N0.getOpcode() == ISD::FCOPYSIGN && N0.Val->hasOneUse() && - isa(N0.getOperand(0))) { + isa(N0.getOperand(0)) && + MVT::isInteger(VT) && !MVT::isVector(VT)) { unsigned OrigXWidth = MVT::getSizeInBits(N0.getOperand(1).getValueType()); SDOperand X = DAG.getNode(ISD::BIT_CONVERT, MVT::getIntegerType(OrigXWidth), N0.getOperand(1)); @@ -3787,7 +3790,9 @@ // Transform fneg(bitconvert(x)) -> bitconvert(x^sign) to avoid loading // constant pool values. - if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse()) { + if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse() && + MVT::isInteger(N0.getOperand(0).getValueType()) && + !MVT::isVector(N0.getOperand(0).getValueType())) { SDOperand Int = N0.getOperand(0); MVT::ValueType IntVT = Int.getValueType(); if (MVT::isInteger(IntVT) && !MVT::isVector(IntVT)) { @@ -3819,7 +3824,9 @@ // Transform fabs(bitconvert(x)) -> bitconvert(x&~sign) to avoid loading // constant pool values. - if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse()) { + if (N0.getOpcode() == ISD::BIT_CONVERT && N0.Val->hasOneUse() && + MVT::isInteger(N0.getOperand(0).getValueType()) && + !MVT::isVector(N0.getOperand(0).getValueType())) { SDOperand Int = N0.getOperand(0); MVT::ValueType IntVT = Int.getValueType(); if (MVT::isInteger(IntVT) && !MVT::isVector(IntVT)) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp
On Jan 27, 2008, at 1:03 AM, Duncan Sands <[EMAIL PROTECTED]> wrote: > Hi Evan, > >> Can you get me a test case? I need to see what gcc is doing. Thanks, > > Sure. Zero sized fields in structs may not be very useful, but it is > still legal to use them, in particular you can take their address, > like this: > > struct Z {}; > > struct Y { >int i; >struct Z z; > }; > > void *f(struct Y *y) { > return &y->z; > } > > This used to work before your patch. For that matter, llvm-gcc-4.2 > itself fails to build here (linux x86-32; crashes compiling > libgcov.c) for > what looks to be the same reason. Also, don't forget that Ada can > have > fields of variable size in various places in a struct, and these can > be > represented by zero-size LLVM fields (this kind of struct doesn't get > passed to functions by copy though). > > Can you please explain why you made this change (a testcase would be > good) I did check in two test cases in a subsequent commit. Those used to choke llvm-gcc. I'll look at this today. It's obvious not all zero sized aggregates are not created equal. Evan > > > Best wishes, > > Duncan. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46427 - in /llvm/trunk: lib/Transforms/Scalar/SCCP.cpp test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll
Author: lattner Date: Sun Jan 27 18:32:30 2008 New Revision: 46427 URL: http://llvm.org/viewvc/llvm-project?rev=46427&view=rev Log: Fix PR1938 by forcing the code that uses an undefined value to branch one way or the other. Rewriting the code itself prevents subsequent analysis passes from making contradictory conclusions about the code that could cause an infeasible path to be made feasible. Added: llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=46427&r1=46426&r2=46427&view=diff == --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Sun Jan 27 18:32:30 2008 @@ -1313,15 +1313,30 @@ continue; } -// If the edge to the first successor isn't thought to be feasible yet, mark -// it so now. -if (KnownFeasibleEdges.count(Edge(BB, TI->getSuccessor(0 +// If the edge to the second successor isn't thought to be feasible yet, +// mark it so now. We pick the second one so that this goes to some +// enumerated value in a switch instead of going to the default destination. +if (KnownFeasibleEdges.count(Edge(BB, TI->getSuccessor(1 continue; // Otherwise, it isn't already thought to be feasible. Mark it as such now // and return. This will make other blocks reachable, which will allow new // values to be discovered and existing ones to be moved in the lattice. -markEdgeExecutable(BB, TI->getSuccessor(0)); +markEdgeExecutable(BB, TI->getSuccessor(1)); + +// This must be a conditional branch of switch on undef. At this point, +// force the old terminator to branch to the first successor. This is +// required because we are now influencing the dataflow of the function with +// the assumption that this edge is taken. If we leave the branch condition +// as undef, then further analysis could think the undef went another way +// leading to an inconsistent set of conclusions. +if (BranchInst *BI = dyn_cast(TI)) { + BI->setCondition(ConstantInt::getFalse()); +} else { + SwitchInst *SI = cast(TI); + SI->setCondition(SI->getCaseValue(1)); +} + return true; } Added: llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll?rev=46427&view=auto == --- llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll (added) +++ llvm/trunk/test/Transforms/SCCP/2008-01-27-UndefCorrelate.ll Sun Jan 27 18:32:30 2008 @@ -0,0 +1,36 @@ +; RUN: llvm-as < %s | opt -sccp | llvm-dis | grep undef | count 1 +; PR1938 + +define i32 @main() { +entry: + br label %bb + +bb: + %indvar = phi i32 [ 0, %entry ], [ %k, %bb.backedge ] + %k = add i32 %indvar, 1 + br i1 undef, label %cond_true, label %cond_false + +cond_true: + %tmp97 = icmp slt i32 %k, 10 + br i1 %tmp97, label %bb.backedge, label %bb12 + +bb.backedge: + br label %bb + +cond_false: + %tmp9 = icmp slt i32 %k, 10 + br i1 %tmp9, label %bb.backedge, label %bb12 + +bb12: + %tmp14 = icmp eq i32 %k, 10 + br i1 %tmp14, label %cond_next18, label %cond_true17 + +cond_true17: + tail call void @abort( ) + unreachable + +cond_next18: + ret i32 0 +} + +declare void @abort() ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46428 - /llvm/trunk/docs/LangRef.html
Author: lattner Date: Sun Jan 27 18:36:27 2008 New Revision: 46428 URL: http://llvm.org/viewvc/llvm-project?rev=46428&view=rev Log: make handling of overflow and undefined results much more clear. Patch by Eli Friedman, thanks! Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=46428&r1=46427&r2=46428&view=diff == --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Sun Jan 27 18:36:27 2008 @@ -2051,6 +2051,11 @@ Semantics: The value produced is the integer or floating point sum of the two operands. +If an integer sum has unsigned overflow, the result returned is the +mathematical result modulo 2n, where n is the bit width of +the result. +Because LLVM integers use a two's complement representation, this +instruction is appropriate for both signed and unsigned integers. Example:= add i32 4, %var ; yields {i32}:result = 4 + %var @@ -2076,6 +2081,11 @@ Semantics: The value produced is the integer or floating point difference of the two operands. +If an integer difference has unsigned overflow, the result returned is the +mathematical result modulo 2n, where n is the bit width of +the result. +Because LLVM integers use a two's complement representation, this +instruction is appropriate for both signed and unsigned integers. Example: = sub i32 4, %var ; yields {i32}:result = 4 - %var @@ -2101,9 +2111,15 @@ Semantics: The value produced is the integer or floating point product of the two operands. -Because the operands are the same width, the result of an integer -multiplication is the same whether the operands should be deemed unsigned or -signed. +If the result of an integer multiplication has unsigned overflow, +the result returned is the mathematical result modulo +2n, where n is the bit width of the result. +Because LLVM integers use a two's complement representation, and the +result is the same width as the operands, this instruction returns the +correct result for both signed and unsigned integers. If a full product +(e.g. i32xi32->i64) is needed, the operands +should be sign-extended or zero-extended as appropriate to the +width of the full product. Example: = mul i32 4, %var ; yields {i32}:result = 4 * %var @@ -2124,9 +2140,10 @@ types. This instruction can also take vector versions of the values in which case the elements must be integers. Semantics: -The value produced is the unsigned integer quotient of the two operands. This -instruction always performs an unsigned division operation, regardless of -whether the arguments are unsigned or not. +The value produced is the unsigned integer quotient of the two operands. +Note that unsigned integer division and signed integer division are distinct +operations; for signed integer division, use 'sdiv'. +Division by zero leads to undefined behavior. Example: = udiv i32 4, %var ; yields {i32}:result = 4 / %var @@ -2147,9 +2164,12 @@ types. This instruction can also take vector versions of the values in which case the elements must be integers. Semantics: -The value produced is the signed integer quotient of the two operands. This -instruction always performs a signed division operation, regardless of whether -the arguments are signed or not. +The value produced is the signed integer quotient of the two operands. +Note that signed integer division and unsigned integer division are distinct +operations; for unsigned integer division, use 'udiv'. +Division by zero leads to undefined behavior. Overflow also leads to +undefined behavior; this is a rare case, but can occur, for example, +by doing a 32-bit division of -2147483648 by -1. Example: = sdiv i32 4, %var ; yields {i32}:result = 4 / %var @@ -2194,6 +2214,9 @@ This instruction returns the unsigned integer remainder of a division. This instruction always performs an unsigned division to get the remainder, regardless of whether the arguments are unsigned or not. +Note that unsigned integer remainder and signed integer remainder are +distinct operations; for signed integer remainder, use 'srem'. +Taking the remainder of a division by zero leads to undefined behavior. Example: = urem i32 4, %var ; yields {i32}:result = 4 % %var @@ -2225,6 +2248,14 @@ Math Forum. For a table of how this is implemented in various languages, please see http://en.wikipedia.org/wiki/Modulo_operation";> Wikipedia: modulo operation. +Note that signed integer remainder and unsigned integer remainder are +distinct operations; for unsigned integer remainder, use 'urem'. +Taking the remainder of a division by zero leads to undefined behavior. +Overflow also leads to undefined behavior; this is a rare case, but can occur, +for example, by taking the remaind
[llvm-commits] [llvm] r46429 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-01-27-FloatSelect.ll
Author: lattner Date: Sun Jan 27 18:58:18 2008 New Revision: 46429 URL: http://llvm.org/viewvc/llvm-project?rev=46429&view=rev Log: Fix PR1932 by disabling an xform invalid for fdiv. Added: llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=46429&r1=46428&r2=46429&view=diff == --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun Jan 27 18:58:18 2008 @@ -2494,14 +2494,15 @@ if (isa(Op1)) return ReplaceInstUsesWith(I, Op1); - // Handle cases involving: div X, (select Cond, Y, Z) + // Handle cases involving: [su]div X, (select Cond, Y, Z) + // This does not apply for fdiv. if (SelectInst *SI = dyn_cast(Op1)) { -// div X, (Cond ? 0 : Y) -> div X, Y. If the div and the select are in the -// same basic block, then we replace the select with Y, and the condition -// of the select with false (if the cond value is in the same BB). If the -// select has uses other than the div, this allows them to be simplified -// also. Note that div X, Y is just as good as div X, 0 (undef) -if (Constant *ST = dyn_cast(SI->getOperand(1))) +// [su]div X, (Cond ? 0 : Y) -> div X, Y. If the div and the select are in +// the same basic block, then we replace the select with Y, and the +// condition of the select with false (if the cond value is in the same BB). +// If the select has uses other than the div, this allows them to be +// simplified also. Note that div X, Y is just as good as div X, 0 (undef) +if (ConstantInt *ST = dyn_cast(SI->getOperand(1))) if (ST->isNullValue()) { Instruction *CondI = dyn_cast(SI->getOperand(0)); if (CondI && CondI->getParent() == I.getParent()) @@ -2513,8 +2514,8 @@ return &I; } -// Likewise for: div X, (Cond ? Y : 0) -> div X, Y -if (Constant *ST = dyn_cast(SI->getOperand(2))) +// Likewise for: [su]div X, (Cond ? Y : 0) -> div X, Y +if (ConstantInt *ST = dyn_cast(SI->getOperand(2))) if (ST->isNullValue()) { Instruction *CondI = dyn_cast(SI->getOperand(0)); if (CondI && CondI->getParent() == I.getParent()) Added: llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll?rev=46429&view=auto == --- llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-01-27-FloatSelect.ll Sun Jan 27 18:58:18 2008 @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep select + +define double @fold(i1 %a, double %b) { +%s = select i1 %a, double 0., double 1. +%c = fdiv double %b, %s +ret double %c +} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46431 - in /llvm/trunk: include/llvm/Instructions.h lib/Transforms/Scalar/InstructionCombining.cpp lib/VMCore/Instructions.cpp test/Transforms/InstCombine/2008-01-21-MismatchedC
Author: nicholas Date: Sun Jan 27 21:48:02 2008 New Revision: 46431 URL: http://llvm.org/viewvc/llvm-project?rev=46431&view=rev Log: Handle some more combinations of extend and icmp. Fixes PR1940. Added: llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll Modified: llvm/trunk/include/llvm/Instructions.h llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/VMCore/Instructions.cpp Modified: llvm/trunk/include/llvm/Instructions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=46431&r1=46430&r2=46431&view=diff == --- llvm/trunk/include/llvm/Instructions.h (original) +++ llvm/trunk/include/llvm/Instructions.h Sun Jan 27 21:48:02 2008 @@ -642,6 +642,18 @@ /// @brief Return the signed version of the predicate. static Predicate getSignedPredicate(Predicate pred); + /// For example, EQ->EQ, SLE->ULE, UGT->UGT, etc. + /// @returns the predicate that would be the result if the operand were + /// regarded as unsigned. + /// @brief Return the unsigned version of the predicate + Predicate getUnsignedPredicate() const { +return getUnsignedPredicate(getPredicate()); + } + + /// This is a static version that you can use without an instruction. + /// @brief Return the unsigned version of the predicate. + static Predicate getUnsignedPredicate(Predicate pred); + /// isEquality - Return true if this predicate is either EQ or NE. This also /// tests for commutativity. static bool isEquality(Predicate P) { Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=46431&r1=46430&r2=46431&view=diff == --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun Jan 27 21:48:02 2008 @@ -5820,18 +5820,22 @@ if (RHSCIOp->getType() != LHSCIOp->getType()) return 0; -// If the signedness of the two compares doesn't agree (i.e. one is a sext +// If the signedness of the two casts doesn't agree (i.e. one is a sext // and the other is a zext), then we can't handle this. if (CI->getOpcode() != LHSCI->getOpcode()) return 0; -// Likewise, if the signedness of the [sz]exts and the compare don't match, -// then we can't handle this. -if (isSignedExt != isSignedCmp && !ICI.isEquality()) - return 0; - -// Okay, just insert a compare of the reduced operands now! -return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); +// Deal with equality cases early. +if (ICI.isEquality()) + return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); + +// A signed comparison of sign extended values simplifies into a +// signed comparison. +if (isSignedCmp && isSignedExt) + return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); + +// The other three cases all fold into an unsigned comparison. +return new ICmpInst(ICI.getUnsignedPredicate(), LHSCIOp, RHSCIOp); } // If we aren't dealing with a constant on the RHS, exit early Modified: llvm/trunk/lib/VMCore/Instructions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=46431&r1=46430&r2=46431&view=diff == --- llvm/trunk/lib/VMCore/Instructions.cpp (original) +++ llvm/trunk/lib/VMCore/Instructions.cpp Sun Jan 27 21:48:02 2008 @@ -2429,6 +2429,19 @@ } } +ICmpInst::Predicate ICmpInst::getUnsignedPredicate(Predicate pred) { + switch (pred) { +default: assert(! "Unknown icmp predicate!"); +case ICMP_EQ: case ICMP_NE: +case ICMP_UGT: case ICMP_ULT: case ICMP_UGE: case ICMP_ULE: + return pred; +case ICMP_SGT: return ICMP_UGT; +case ICMP_SLT: return ICMP_ULT; +case ICMP_SGE: return ICMP_UGE; +case ICMP_SLE: return ICMP_ULE; + } +} + bool ICmpInst::isSignedPredicate(Predicate pred) { switch (pred) { default: assert(! "Unknown icmp predicate!"); Added: llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll?rev=46431&view=auto == --- llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll Sun Jan 27 21:48:02 2008 @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | opt -instcombine | notcast +; RUN: llvm-as < %s | opt -instcombine | not grep {icmp s} +; PR1940 + +define i1 @test1(i8 %A, i8 %B) { +%a = zext i8 %A to i32 +%b
[llvm-commits] [llvm] r46432 - /llvm/trunk/Makefile.rules
Author: lattner Date: Sun Jan 27 22:18:41 2008 New Revision: 46432 URL: http://llvm.org/viewvc/llvm-project?rev=46432&view=rev Log: reduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE output. Patch contributed by Sam Bishop! Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=46432&r1=46431&r2=46432&view=diff == --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Sun Jan 27 22:18:41 2008 @@ -454,12 +454,11 @@ LD.Flags += -L$(LibDir) -L$(LLVMLibDir) CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. -CPP.Flags += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ --I$(PROJ_OBJ_ROOT)/include \ --I$(PROJ_SRC_ROOT)/include \ --I$(LLVM_OBJ_ROOT)/include \ --I$(LLVM_SRC_ROOT)/include \ -$(CPP.BaseFlags) +CPP.Flags += $(patsubst %,-I%/include,$(sort \ +$(PROJ_OBJ_DIR) $(PROJ_SRC_DIR) \ +$(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \ +$(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \ +$(CPP.BaseFlags) Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Makefile.rules patch: remove redundant -I compiler flags
On Jan 15, 2008, at 9:07 AM, Sam Bishop wrote: > The attached patch makes VERBOSE builds easier to wade through. > It's likely > to also permute the PROJ_* and LLVM_* includes, but I don't think that > should matter. I've done a full-tree compile and everything seems > to be > working. Applied, thanks! http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080121/057641.html -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm] r46394 - in /llvm/trunk/lib: Target/PowerPC/PPCAsmPrinter.cpp Transforms/Scalar/SimplifyCFG.cpp
>>> + BuildMI(MBB, MBB.end(), TM.getInstrInfo()->get(PPC::NOP)); >>> + } >> >> Is there any reason to actually make a machineinstr here? It seems >> like it would be possible to just emit "nop" to the .s file. The JIT >> doesn't need this. >> > I initially had that, but I thought that it would be better to do > things though the "print machine instruction" function just so I got > the syntax correct. But nop is probably safe to emit like that. "nop" is valid on arm, thanks. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm] r46433 - /llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp
Author: lattner Date: Sun Jan 27 22:41:43 2008 New Revision: 46433 URL: http://llvm.org/viewvc/llvm-project?rev=46433&view=rev Log: Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman. Modified: llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp Modified: llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp?rev=46433&r1=46432&r2=46433&view=diff == --- llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp Sun Jan 27 22:41:43 2008 @@ -919,6 +919,36 @@ } } memcmpOptimizer; +/// This LibCallOptimization will simplify a call to the memcpy library +/// function. It simply converts them into calls to llvm.memcpy.*; +/// the resulting call should be optimized later. +/// @brief Simplify the memcpy library function. +struct VISIBILITY_HIDDEN MemCpyOptimization : public LibCallOptimization { +public: + MemCpyOptimization() : LibCallOptimization("memcpy", + "Number of 'memcpy' calls simplified") {} + + /// @brief Make sure that the "memcpy" function has the right prototype + virtual bool ValidateCalledFunction(const Function *F, SimplifyLibCalls &SLC){ +const FunctionType *FT = F->getFunctionType(); +const Type* voidPtr = PointerType::getUnqual(Type::Int8Ty); +return FT->getReturnType() == voidPtr && FT->getNumParams() == 3 && + FT->getParamType(0) == voidPtr && + FT->getParamType(1) == voidPtr && + FT->getParamType(2) == SLC.getIntPtrType(); + } + + /// @brief Perform the memcpy optimization + virtual bool OptimizeCall(CallInst *CI, SimplifyLibCalls &SLC) { +Value *MemcpyOps[] = { + CI->getOperand(1), CI->getOperand(2), CI->getOperand(3), + ConstantInt::get(Type::Int32Ty, 1) // align = 1 always. +}; +new CallInst(SLC.get_memcpy(), MemcpyOps, MemcpyOps + 4, "", CI); +// memcpy always returns the destination +return ReplaceCallWith(CI, CI->getOperand(1)); + } +} MemCpyOptimizer; /// This LibCallOptimization will simplify a call to the memcpy library /// function by expanding it out to a single store of size 0, 1, 2, 4, or 8 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46434 - in /test-suite/trunk/MultiSource/Benchmarks/VersaBench: ./ README.txt beamformer/ beamformer/Makefile beamformer/beamformer.c dbms/
Author: lattner Date: Sun Jan 27 23:17:19 2008 New Revision: 46434 URL: http://llvm.org/viewvc/llvm-project?rev=46434&view=rev Log: add a benchmark from 'VersaBench'. Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/ test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/beamformer.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/ Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt?rev=46434&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt Sun Jan 27 23:17:19 2008 @@ -0,0 +1,2 @@ +Obtained from: +http://cag.csail.mit.edu/versabench/benchmarks.html Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile?rev=46434&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Sun Jan 27 23:17:19 2008 @@ -0,0 +1,10 @@ +LEVEL = ../../../.. + +PROG = beamformer +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = -i 400 +else +RUN_OPTIONS = -i 140 +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/beamformer.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/beamformer.c?rev=46434&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/beamformer.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/beamformer.c Sun Jan 27 23:17:19 2008 @@ -0,0 +1,402 @@ +/* + * Copyright (c) 2003 David Maze + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSEAND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * beamformer.c: Standalone beam-former reference implementation + * David Maze <[EMAIL PROTECTED]> + * $Id: beamformer.c,v 1.5 2003/11/07 08:47:00 thies Exp $ + */ + +/* Modified by: Rodric M. Rabbah 06-03-04 */ + +#include +#include +#include +#include + +/* +This implementation is derived from the StreamIt implementation, +rather than from the PCA VSIPL-based implementation. It is intended +to be easier to synchronize our reference implementation with our +StreamIt implementation, not have dependencies on extra libraries, and +generally be a fairer comparison with the StreamIt code (that is, +equivalent to our other benchmarks). + +This version gets consistent output with the StreamIt version when +compiled with RANDOM_INPUTS and RANDOM_WEIGHTS. The algorithm should +be equivalent to the SERIALIZED implementation. + +FLAGS: the StreamIt TemplateBeamFormer can be built with COARSE +defined or not, with SERIALIZED defined or not, and with RANDOM_INPUTS +defined or not. Defining COARSE changes the algorithm to add two +decimation stages; this presently isn't implemented. SERIALIZED +changes where in the graph printing happens; in the non-SERIALIZED +version printing happens in the detector stage, but this doesn't have +a deterministic order. RANDOM_INPUTS and RANDOM_WEIGHTS change +weights at several points in the code, where "RANDOM" is "something +the author made up" rather than "determined via rand()". The default +flags are both RANDOM_WEIGHTS and RANDOM_INPU
[llvm-commits] [test-suite] r46435 [1/4] - /test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/
Author: lattner Date: Sun Jan 27 23:23:39 2008 New Revision: 46435 URL: http://llvm.org/viewvc/llvm-project?rev=46435&view=rev Log: add a VersaBench benchmark. Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/calcMetricsData.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/chooseEntry.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/clearLine.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/closeFiles.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/consistent.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/createDataObject.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/createIndexEntry.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/createIndexNode.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/dataManagement.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/dataObject.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/dbms.ref.in test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/dbms.train.in test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/delete.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/delete.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/deleteDataObject.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/deleteEntry.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/deleteIndexEntry.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/deleteIndexNode.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/errorMessage.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/errorMessage.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getDeleteCommand.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getDeleteCommand.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getFloat.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getFloat.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInitCommand.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInitCommand.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInsertCommand.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInsertCommand.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInt.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getInt.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getKeyAttribute.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getKeyAttribute.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getNextCommandCode.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getNextCommandCode.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getNonKeyAttribute.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getNonKeyAttribute.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getQueryCommand.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getQueryCommand.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/getString.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/index.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/indexKey.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/initMetricsData.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/insert.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/insert.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/insertEntry.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/insertEntry.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/keyUnion.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/main.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/metrics.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/openFiles.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/openFiles.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/outputMetricsData.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/outputQuery.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/partitionEntries.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/penalty.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/query.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/query.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/setMetricsData.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/splitNode.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/splitNode.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/timer.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/updateMetricsData.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/valid.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/dbms/volume.c Ad
[llvm-commits] [test-suite] r46436 - in /test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b: ./ Makefile calc.c calc.h input.txt main.c testbench.c testbench.h
Author: lattner Date: Sun Jan 27 23:35:03 2008 New Revision: 46436 URL: http://llvm.org/viewvc/llvm-project?rev=46436&view=rev Log: add the 8b10b benchmark, hacked to take enough time to run to be interesting. Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/ test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.h test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/input.txt (with props) test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/main.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/testbench.c test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/testbench.h Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/Makefile?rev=46436&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/Makefile Sun Jan 27 23:35:03 2008 @@ -0,0 +1,10 @@ +LEVEL = ../../../.. + +PROG = 8b10b +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = input.txt 2000 +else +RUN_OPTIONS = input.txt 2 +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.c?rev=46436&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/8b10b/calc.c Sun Jan 27 23:35:03 2008 @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2002 David Wentzlaff + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSEAND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +//This is part of David Wentzlaff's Masters Thesis +//This file is Copyright David Wentzlaff 2002 All Rights Reserved. +// +// Filename : calc.c +// Date : 07/31/2002 + +/* Modified by: Rodric M. Rabbah 06-03-04 */ + +#include + +#include "calc.h" + +//note in all of these things, we assume that the K bit is the +//high order bit + +//also note that every thing here is little endian +//and the IBM systems journal paper is big endian. +//so that means that D.1 is 1 which lives in +//locattion 16 of the table not 1! + +#define ENCODE5B(DATA, FLIP, PLUS, MINUS, X) (((DATA)<<4)&0x3e0)|(((DATA)<<1)&2)|FLIP)<<3)|((PLUS)<<2)|((MINUS)<<1)|((X)))<<16) +#define ENCODE3B(DATA, FLIP, PLUS, MINUS, X) ((DATA)&1)|(((DATA)<<1)&0x1c)|FLIP)<<3)|((PLUS)<<2)|((MINUS)<<1)|((X)))<<16) + +#define GET_FLIP_5(DATA) (((DATA)>>(16+3))&1) +#define GET_PLUS_5(DATA) (((DATA)>>(16+2))&1) +#define GET_MINUS_5(DATA) (((DATA)>>(16+1))&1) +#define GET_X_5(DATA) (((DATA)>>(16))&1) + +#define GET_FLIP_3(DATA) (((DATA)>>(16+3))&1) +#define GET_PLUS_3(DATA) (((DATA)>>(16+2))&1) +#define GET_MINUS_3(DATA) (((DATA)>>(16+1))&1) +#define GET_X_3(DATA) (((DATA)>>(16))&1) + +#define B5_MASK0x3e2 +#define B3_MASK0x1d + +//setup the table for the 5b/6b part +unsigned int lookupTable5B[64] = +{ + /* 0 */ ENCODE5B(0x18,1,1,0,0), + /* 1 */ ENCODE5B(0x1b,1,0,1,0), + /* 2 */ ENCODE5B(0x06,1,1,0,0), + /* 3 */ ENCODE5B(0x0c,1,1,0,0), + /* 4 */ ENCODE5B(0x0a,1,1,0,0), + /* 5 */ ENCODE5B(0x0b,0,0,0,1), + /* 6 */ ENCODE5B(0x0d,0,0,0,1), + /* 7 */ ENCODE5B(0x0e,0,0,0,1), + /* 8 */ ENCODE5B(0x12,1,1,0,0), + /* 9 */ ENCODE5B(0x13,0,0,0,1), + /* 10 */ ENCODE5B(0x15,0,0,0,1), + /* 11 */ ENCODE5B(0x16,0,0,0,1), + /* 12 */ ENCODE5B(0x19,0,0,0,1), + /* 13 */ ENCODE5B(0x1a,0,0,0,1), + /* 14 */ ENCODE5
[llvm-commits] [test-suite] r46438 - in /test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm: ./ Makefile bmm.c
Author: lattner Date: Mon Jan 28 00:10:47 2008 New Revision: 46438 URL: http://llvm.org/viewvc/llvm-project?rev=46438&view=rev Log: add the bmm benchmark, hacked to not produce huge output nor use huge input. Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile?rev=46438&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile Mon Jan 28 00:10:47 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = bmm +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 1024 1024 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 128 32 +else +RUN_OPTIONS = 1024 64 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c?rev=46438&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c Mon Jan 28 00:10:47 2008 @@ -0,0 +1,246 @@ +/** + +SOFTWARE LICENSE AGREEMENT NOTICE + --- + +IT IS A BREACH OF THIS LICENSE AGREEMENT TO REMOVE THIS NOTICE FROM +THE FILE OR SOFTWARE, OR ANY MODIFIED VERSIONS OF THIS FILE OR +SOFTWARE OR DERIVATIVE WORKS. +___ + +Copyright Notices/Identification of Licensor(s) of Original Software +in the File + +Copyright (C) 1994 Hewlett-Packard Company + +All rights reserved by the foregoing, respectively. +___ + +Copyright Notices/Identification of Subsequent +Licensor(s)/Contributors of Derivative Works + +Copyright + + +All rights reserved by the foregoing, respectively. +___ + +The code contained in this file, including both binary and source [if +released by the owner(s)] (hereafter, Software) is subject to +copyright by the respective Licensor(s) and ownership remains with +such Licensor(s). The Licensor(s) of the original Software remain +free to license their respective proprietary Software for other +purposes that are independent and separate from this file, without +obligation to any party. + +Licensor(s) grant(s) you (hereafter, Licensee) a license to use the +Software for academic, research and internal business purposes only, +without a fee. "Internal business purposes" means that Licensee may +install, use and execute the Software for the purpose of designing and +evaluating products. Licensee may submit proposals for research +support, and receive funding from private and Government sponsors for +continued development, support and maintenance of the Software for the +purposes permitted herein. + +Licensee may also disclose results obtained by executing the Software, +as well as algorithms embodied therein. Licensee may redistribute the +Software to third parties provided that the copyright notices and this +License Agreement Notice statement are reproduced on all copies and +that no charge is associated with such copies. No patent or other +intellectual property license is granted or implied by this Agreement, +and this Agreement does not license any acts except those expressly +recited. + +Licensee may modify the Software to make derivative works (as defined +in Section 101 of Title 17, U.S. Code) (hereafter, Derivative Works), +as necessary for its own academic, research and internal business +purposes. Title to copyrights and other proprietary rights in +Derivative Works created by Licensee shall be owned by Licensee +subject, however, to the underlying ownership interest(s) of the +Licensor(s) in the copyrights and other proprietary rights in the +original Software. All the same rights and licenses granted herein +and all other terms and conditions contained in this Agreement +pertaining to the Software shall continue to apply to any parts of the +Software included in Derivative Works. Licensee's Derivative Work +should clearly notify users that it is a modified version and not the +original Software distributed by the Licensor(s). + +If Licensee wants to make its Derivative Works
[llvm-commits] [test-suite] r46439 - in /test-suite/trunk/MultiSource/Benchmarks: Makefile VersaBench/Makefile VersaBench/README.txt
Author: lattner Date: Mon Jan 28 00:14:28 2008 New Revision: 46439 URL: http://llvm.org/viewvc/llvm-project?rev=46439&view=rev Log: run versabench by default Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Makefile?rev=46439&r1=46438&r2=46439&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/Makefile Mon Jan 28 00:14:28 2008 @@ -4,6 +4,6 @@ PARALLEL_DIRS := Fhourstones Fhourstones-3.1 \ McCat Olden OptimizerEval Ptrdist llubenchmark \ sim FreeBench MallocBench Prolangs-C Prolangs-C++ SciMark2-C\ -mediabench ASCI_Purple MiBench tramp3d-v4 +mediabench ASCI_Purple MiBench VersaBench tramp3d-v4 include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile?rev=46439&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile Mon Jan 28 00:14:28 2008 @@ -0,0 +1,6 @@ +# MultiSource/VersaBench Makefile: Build all subdirectories automatically + +LEVEL = ../../.. +PARALLEL_DIRS = 8b10b beamformer bmm dbms ecbdes + +include $(LEVEL)/Makefile.programs Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt?rev=46439&r1=46438&r2=46439&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt Mon Jan 28 00:14:28 2008 @@ -1,2 +1,5 @@ Obtained from: http://cag.csail.mit.edu/versabench/benchmarks.html + +This contains a subset of the programs and some are hacked to run +long enough. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46440 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran: ./ enc-3des/ enc-3des/Makefile enc-3des/des.c enc-3des/des.h
Author: lattner Date: Mon Jan 28 00:27:00 2008 New Revision: 46440 URL: http://llvm.org/viewvc/llvm-project?rev=46440&view=rev Log: Add a benchmark from the trimaran collection Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile?rev=46440&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile Mon Jan 28 00:27:00 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-3des +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 200 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 10 +else +RUN_OPTIONS = 100 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c?rev=46440&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c Mon Jan 28 00:27:00 2008 @@ -0,0 +1,606 @@ +/* + * FIPS-46-3 compliant 3DES implementation + * + * Copyright (C) 2001-2003 Christophe Devine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "des.h" + +/* the eight DES S-boxes */ + +uint32 SB1[64] = +{ +0x01010400, 0x, 0x0001, 0x01010404, +0x01010004, 0x00010404, 0x0004, 0x0001, +0x0400, 0x01010400, 0x01010404, 0x0400, +0x01000404, 0x01010004, 0x0100, 0x0004, +0x0404, 0x01000400, 0x01000400, 0x00010400, +0x00010400, 0x0101, 0x0101, 0x01000404, +0x00010004, 0x0104, 0x0104, 0x00010004, +0x, 0x0404, 0x00010404, 0x0100, +0x0001, 0x01010404, 0x0004, 0x0101, +0x01010400, 0x0100, 0x0100, 0x0400, +0x01010004, 0x0001, 0x00010400, 0x0104, +0x0400, 0x0004, 0x01000404, 0x00010404, +0x01010404, 0x00010004, 0x0101, 0x01000404, +0x0104, 0x0404, 0x00010404, 0x01010400, +0x0404, 0x01000400, 0x01000400, 0x, +0x00010004, 0x00010400, 0x, 0x01010004 +}; + +static uint32 SB2[64] = +{ +0x80108020, 0x80008000, 0x8000, 0x00108020, +0x0010, 0x0020, 0x80100020, 0x80008020, +0x8020, 0x80108020, 0x80108000, 0x8000, +0x80008000, 0x0010, 0x0020, 0x80100020, +0x00108000, 0x00100020, 0x80008020, 0x, +0x8000, 0x8000, 0x00108020, 0x8010, +0x00100020, 0x8020, 0x, 0x00108000, +0x8020, 0x80108000, 0x8010, 0x8020, +0x, 0x00108020, 0x80100020, 0x0010, +0x80008020, 0x8010, 0x80108000, 0x8000, +0x8010, 0x80008000, 0x0020, 0x80108020, +0x00108020, 0x0020, 0x8000, 0x8000, +0x8020, 0x80108000, 0x0010, 0x8020, +0x00100020, 0x80008020, 0x8020, 0x00100020, +0x00108000, 0x, 0x80008000, 0x8020, +0x8000, 0x80100020, 0x80108020, 0x00108000 +}; + +static uint32 SB3[64] = +{ +0x0208, 0x08020200, 0x, 0x08020008, +0x08000200, 0x, 0x00020208, 0x08000200, +0x00020008, 0x0808, 0x0808, 0x0002, +0x08020208, 0x00020008, 0x0802, 0x0208, +0x0800, 0x0008, 0x08020200, 0x0200, +0x00020200, 0x0802, 0x08020008, 0x00020208, +0x08000208, 0x00020200, 0x0002, 0x08000208, +0x0008, 0x08020208, 0x0200, 0x0800, +0x08020200, 0x0800, 0x00020008, 0x0208, +0x0002, 0x08020200, 0x08000200, 0x, +0x0200, 0x00020008, 0x08020208, 0x08000200, +0x0808, 0x0200, 0x, 0x08020008,
[llvm-commits] [test-suite] r46441 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5: ./ Makefile md5.c md5.h
Author: lattner Date: Mon Jan 28 00:36:10 2008 New Revision: 46441 URL: http://llvm.org/viewvc/llvm-project?rev=46441&view=rev Log: add an adapted version of md5 Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile?rev=46441&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile Mon Jan 28 00:36:10 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-md5 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 50 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 1 +else +RUN_OPTIONS = 10 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c?rev=46441&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c Mon Jan 28 00:36:10 2008 @@ -0,0 +1,293 @@ +/* + * RFC 1321 compliant MD5 implementation + * + * Copyright (C) 2001-2003 Christophe Devine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "md5.h" + +#define GET_UINT32(n,b,i) \ +{ \ +(n) = ( (uint32) (b)[(i)] ) \ +| ( (uint32) (b)[(i) + 1] << 8 ) \ +| ( (uint32) (b)[(i) + 2] << 16 ) \ +| ( (uint32) (b)[(i) + 3] << 24 ); \ +} + +#define PUT_UINT32(n,b,i) \ +{ \ +(b)[(i)] = (uint8) ( (n) ); \ +(b)[(i) + 1] = (uint8) ( (n) >> 8 ); \ +(b)[(i) + 2] = (uint8) ( (n) >> 16 ); \ +(b)[(i) + 3] = (uint8) ( (n) >> 24 ); \ +} + +void md5_starts( md5_context *ctx ) +{ +ctx->total[0] = 0; +ctx->total[1] = 0; + +ctx->state[0] = 0x67452301; +ctx->state[1] = 0xEFCDAB89; +ctx->state[2] = 0x98BADCFE; +ctx->state[3] = 0x10325476; +} + +void md5_process( md5_context *ctx, uint8 data[64] ) +{ +uint32 X[16], A, B, C, D; + +GET_UINT32( X[0], data, 0 ); +GET_UINT32( X[1], data, 4 ); +GET_UINT32( X[2], data, 8 ); +GET_UINT32( X[3], data, 12 ); +GET_UINT32( X[4], data, 16 ); +GET_UINT32( X[5], data, 20 ); +GET_UINT32( X[6], data, 24 ); +GET_UINT32( X[7], data, 28 ); +GET_UINT32( X[8], data, 32 ); +GET_UINT32( X[9], data, 36 ); +GET_UINT32( X[10], data, 40 ); +GET_UINT32( X[11], data, 44 ); +GET_UINT32( X[12], data, 48 ); +GET_UINT32( X[13], data, 52 ); +GET_UINT32( X[14], data, 56 ); +GET_UINT32( X[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0x) >> (32 - n))) + +#define P(a,b,c,d,k,s,t)\ +{ \ +a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ +} + +A = ctx->state[0]; +B = ctx->state[1]; +C = ctx->state[2]; +D = ctx->state[3]; + +#define F(x,y,z) (z ^ (x & (y ^ z))) + +P( A, B, C, D, 0, 7, 0xD76AA478 ); +P( D, A, B, C, 1, 12, 0xE8C7B756 ); +P( C, D, A, B, 2, 17, 0x242070DB ); +P( B, C, D, A, 3, 22, 0xC1BDCEEE ); +P( A, B, C, D, 4, 7, 0xF57C0FAF ); +P( D, A, B, C, 5, 12, 0x4787C62A ); +P( C, D, A, B, 6, 17, 0xA8304613 ); +P( B, C, D, A, 7, 22, 0xFD469501 ); +P( A, B, C, D, 8, 7, 0x698098D8 ); +P( D, A, B, C, 9, 12, 0x8B44F7AF ); +P( C, D, A, B, 10, 17, 0x5BB1 ); +P( B, C, D, A, 11, 22, 0x895CD7BE ); +P( A, B, C, D, 12, 7, 0x6B901122 ); +P( D, A, B, C, 13, 12, 0xFD987193 ); +P( C, D, A, B, 14, 17, 0xA67943
[llvm-commits] [test-suite] r46442 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1: ./ Makefile pc1cod.c
Author: lattner Date: Mon Jan 28 00:52:21 2008 New Revision: 46442 URL: http://llvm.org/viewvc/llvm-project?rev=46442&view=rev Log: add a really scary benchmark Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile?rev=46442&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile Mon Jan 28 00:52:21 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-pc1 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 2000 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 100 +else +RUN_OPTIONS = 500 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c?rev=46442&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c Mon Jan 28 00:52:21 2008 @@ -0,0 +1,333 @@ + /* File PC1COD.c */ + /* written in Borland Turbo C 2.0 on PC */ + /* PC1 Cipher Algorithm ( Pukall Cipher 1 ) */ + /* By Alexander PUKALL 1991 */ + /* free code no restriction to use */ + /* please include the name of the Author in the final software */ + /* the Key is 256 bits */ + /* Tested with Turbo C 2.0 for DOS and Microsoft Visual C++ 5.0 for Win 32 */ + + /* Note that PC1COD256.c is the encryption routine */ + /* PC1DEC256.c is the decryption routine */ + /* Only the K zone change in the two routines */ + /* You can create a single routine with the two parts in it */ + +#include +#include +unsigned short ax, bx, cx, dx, si, tmp, x1a2, x1a0[16], res, i, +inter, cfc, cfd, compte; + +unsigned char cle[32]; /* les variables sont definies de facon + * globale */ + +unsigned char buff[32]; + +short c; + +int c1, count; + +short d, e; + +FILE * in; + + +assemble() +{ + + + x1a0[0] = (cle[0] * 256) + cle[1]; + + code(); + + inter = res; + + + x1a0[1] = x1a0[0] ^ ((cle[2] * 256) + cle[3]); + + code(); + + inter = inter ^ res; + + + x1a0[2] = x1a0[1] ^ ((cle[4] * 256) + cle[5]); + + code(); + + inter = inter ^ res; + + + x1a0[3] = x1a0[2] ^ ((cle[6] * 256) + cle[7]); + + code(); + + inter = inter ^ res; + + + x1a0[4] = x1a0[3] ^ ((cle[8] * 256) + cle[9]); + + code(); + + inter = inter ^ res; + + + x1a0[5] = x1a0[4] ^ ((cle[10] * 256) + cle[11]); + + code(); + + inter = inter ^ res; + + + x1a0[6] = x1a0[5] ^ ((cle[12] * 256) + cle[13]); + + code(); + + inter = inter ^ res; + + + x1a0[7] = x1a0[6] ^ ((cle[14] * 256) + cle[15]); + + code(); + + inter = inter ^ res; + + + x1a0[8] = x1a0[7] ^ ((cle[16] * 256) + cle[17]); + + code(); + + inter = inter ^ res; + + + x1a0[9] = x1a0[8] ^ ((cle[18] * 256) + cle[19]); + + code(); + + inter = inter ^ res; + + + x1a0[10] = x1a0[9] ^ ((cle[20] * 256) + cle[21]); + + code(); + + inter = inter ^ res; + + + x1a0[11] = x1a0[10] ^ ((cle[22] * 256) + cle[23]); + + code(); + + inter = inter ^ res; + + + x1a0[12] = x1a0[11] ^ ((cle[24] * 256) + cle[25]); + + code(); + + inter = inter ^ res; + + + x1a0[13] = x1a0[12] ^ ((cle[26] * 256) + cle[27]); + + code(); + + inter = inter ^ res; + + + x1a0[14] = x1a0[13] ^ ((cle[28] * 256) + cle[29]); + + code(); + + inter = inter ^ res; + + + x1a0[15] = x1a0[14] ^ ((cle[30] * 256) + cle[31]); + + code(); + + inter = inter ^ res; + + + i = 0; + + return (0); + +} + +code() +{ + + dx = x1a2 + i; + + ax = x1a0[i]; + + cx = 0x015a; + + bx = 0x4e35; + + + tmp = ax; + + ax = si; + + si = tmp; + + + tmp = ax; + + ax = dx; + + dx = tmp; + + + if (ax != 0) + + { + +ax = ax * bx; + + } + + tmp = ax; + + ax = cx; + + cx = tmp; + + + if (ax != 0) + + { + +ax = ax * si; + +cx = ax + cx; + + } + + tmp = ax; + + ax = si; + + si = tmp; + + ax = ax * bx; + + dx = cx + dx; + + + ax = ax + 1; + + + x1a2 = dx; + + x1a0[i] = ax; + + + res = ax ^ dx; + + i = i + 1; + + return (0); + +} + +/* Use Linear congruential PRNG */ +int my_rand_r(int *seedp) +{ + /* Knuth & Lewis */ + unsigned x = *seedp * 1664525 + 1013904223; + *seedp = x; + return (x >>
[llvm-commits] [test-suite] r46443 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4: ./ Makefile rc4.c rc4.h
Author: lattner Date: Mon Jan 28 00:56:33 2008 New Revision: 46443 URL: http://llvm.org/viewvc/llvm-project?rev=46443&view=rev Log: add a new benchmark. Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile?rev=46443&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile Mon Jan 28 00:56:33 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-rc4 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 100 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 2000 +else +RUN_OPTIONS = 20 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c?rev=46443&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c Mon Jan 28 00:56:33 2008 @@ -0,0 +1,153 @@ +/* + * An implementation of the ARC4 algorithm + * + * Copyright (C) 2001-2003 Christophe Devine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "rc4.h" + +void rc4_setup( struct rc4_state *s, unsigned char *key, int length ) +{ +int i, j, k, *m, a; + +s->x = 0; +s->y = 0; +m = s->m; + +for( i = 0; i < 256; i++ ) +{ +m[i] = i; +} + +j = k = 0; + +for( i = 0; i < 256; i++ ) +{ +a = m[i]; +j = (unsigned char) ( j + a + key[k] ); +m[i] = m[j]; m[j] = a; +if( ++k >= length ) k = 0; +} +} + +void rc4_crypt( struct rc4_state *s, unsigned char *data, int length ) +{ +int i, x, y, *m, a, b; + +x = s->x; +y = s->y; +m = s->m; + +for( i = 0; i < length; i++ ) +{ +x = (unsigned char) ( x + 1 ); a = m[x]; +y = (unsigned char) ( y + a ); +m[x] = b = m[y]; +m[y] = a; +data[i] ^= m[(unsigned char) ( a + b )]; +} + +s->x = x; +s->y = y; +} + +#include +#include + +/* + * ARC4 tests vectors from OpenSSL (crypto/rc4/rc4test.c) + */ + +static unsigned char keys[7][30]={ +{8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, +{8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, +{8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, +{4,0xef,0x01,0x23,0x45}, +{8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, +{4,0xef,0x01,0x23,0x45}, +}; + +static unsigned char data_len[7]={8,8,8,20,28,10}; +static unsigned char data[7][30]={ +{0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xff}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff}, +{0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0xff}, +{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, +{0}, +}; + +static unsigned char output[7][30]={ +{0x75,0xb7,0x87,0x80,0x99,0xe0,0xc5,0x96,0x00}, +{0x74,0x94,0xc2,0xe7,0x10,0x4b,0x08,0x79,0x00}, +{0xde,0x18,0x89,0x41,0xa3,0x37,0x5d,0x3a,0x00}, +{0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf, + 0xbd,0x61,0x5a,0x11,0x62,0xe1,0xc7,0xba, + 0x36,0xb6,0x78,0x58,0x00}, +{0x66,0xa0,0x94,0x9f,0x8a,0xf7,0xd6,0x89, + 0x1f,0x7f,0x83,0x2b,0xa8,0x33,0xc0,0x0c, + 0x89,0x2e,0xbe,0x30,0x14,0x3c,0xe2,0x87, + 0x40,0x01,0x1e,0xcf,0x00}, +{0xd6,0xa1,0x41,0x
[llvm-commits] [test-suite] r46445 - /test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile
Author: nicholas Date: Mon Jan 28 01:16:22 2008 New Revision: 46445 URL: http://llvm.org/viewvc/llvm-project?rev=46445&view=rev Log: Make this test a little more forgiving. Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile?rev=46445&r1=46444&r2=46445&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Mon Jan 28 01:16:22 2008 @@ -1,6 +1,7 @@ LEVEL = ../../../.. PROG = beamformer +FP_TOLERANCE = 0.01 ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = -i 400 else ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46447 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url: packet.c packet.h url.c
Author: lattner Date: Mon Jan 28 01:23:41 2008 New Revision: 46447 URL: http://llvm.org/viewvc/llvm-project?rev=46447&view=rev Log: make this program not read random memory Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c?rev=46447&r1=46446&r2=46447&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c Mon Jan 28 01:23:41 2008 @@ -22,25 +22,20 @@ /* Traces automatically drop the TCP checksum and urgent pointer, so header is 36 bytes */ #define HEADER_SIZE 36 -int packets_processed = 0; #ifdef CONSTANT_PACKET unsigned int packet_index = 0; #endif char * -get_next_packet () +get_next_packet (int packet_number) { + packet_number %= MAX_PACKETS; char *packet; unsigned int packet_length; - if (packets_processed == MAX_PACKETS) -{ - fprintf (stderr, "All packets (%d) processed, recompile with larger MAX_PACKETS \n", MAX_PACKETS); - exit (1); -} - packet_length = (packet_lengths[packets_processed]); + packet_length = (packet_lengths[packet_number]); if (packet_length < 40) { /* Should never happen */ @@ -61,10 +56,9 @@ } /* Copy the header information */ - memcpy ((void *)packet, (void *)headers[packets_processed], HEADER_SIZE); + memcpy ((void *)packet, (void *)headers[packet_number], HEADER_SIZE); #endif - packets_processed ++; return packet; } @@ -72,7 +66,6 @@ unsigned int packet_size (unsigned int packet_number) { - if (packet_number == MAX_PACKETS) -return (packet_lengths[packets_processed]); - else return (packet_lengths[packet_number]); + packet_number %= MAX_PACKETS; + return (packet_lengths[packet_number]); } Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h?rev=46447&r1=46446&r2=46447&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h Mon Jan 28 01:23:41 2008 @@ -13,9 +13,9 @@ * and improve what you give them. * */ -#define MAX_PACKETS 1500 +#define MAX_PACKETS 100 -char *get_next_packet (); +char *get_next_packet (int); /* For testing...*/ unsigned int packet_size (unsigned int); Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c?rev=46447&r1=46446&r2=46447&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Mon Jan 28 01:23:41 2008 @@ -113,7 +113,7 @@ { long original_checksum, checksum; - packet = get_next_packet(); + packet = get_next_packet(i); /* We only have to check the checksum to make sure nothing is changed.. */ #ifdef LITTLE_ENDIAN ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [test-suite] r46448 - in /test-suite/trunk/MultiSource/Benchmarks: Makefile Trimaran/Makefile Trimaran/README.txt
Author: lattner Date: Mon Jan 28 01:26:07 2008 New Revision: 46448 URL: http://llvm.org/viewvc/llvm-project?rev=46448&view=rev Log: Build trimaran benchmarks by default Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Makefile?rev=46448&r1=46447&r2=46448&view=diff == --- test-suite/trunk/MultiSource/Benchmarks/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/Makefile Mon Jan 28 01:26:07 2008 @@ -4,6 +4,6 @@ PARALLEL_DIRS := Fhourstones Fhourstones-3.1 \ McCat Olden OptimizerEval Ptrdist llubenchmark \ sim FreeBench MallocBench Prolangs-C Prolangs-C++ SciMark2-C\ -mediabench ASCI_Purple MiBench VersaBench tramp3d-v4 +mediabench ASCI_Purple MiBench Trimaran VersaBench tramp3d-v4 include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile?rev=46448&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile Mon Jan 28 01:26:07 2008 @@ -0,0 +1,7 @@ +# MultiSource/Trimaran Makefile: Build all subdirectories automatically + +LEVEL = ../../.. +PARALLEL_DIRS = enc-3des enc-md5 enc-pc1 enc-rc4 netbench-crc netbench-url + + +include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt?rev=46448&view=auto == --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt Mon Jan 28 01:26:07 2008 @@ -0,0 +1,3 @@ +this is obtained from here. One program was elided (ipchains) +because it was linux specific. +http://www.trimaran.org/benchmarks.shtml ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits