[llvm-commits] [llvm] r59612 - /llvm/trunk/include/llvm/Intrinsics.td
sanjiv gupta
sanjiv.gupta at microchip.com
Thu Nov 20 03:45:28 PST 2008
I just ran the dejagnu tests.
opt is failing in getDeclaration () for these intrinsics.
In Intrinsics.gen the Tys[0] being passed is NULL, so it SEGV there.
Any idea where things are going wrong?
case Intrinsic::memset: // llvm.memset
ResultTy = Type::VoidTy;
ArgTys.push_back(PointerType::getUnqual(IntegerType::get(8)));
ArgTys.push_back(IntegerType::get(8));
ArgTys.push_back(Tys[0]);
ArgTys.push_back(IntegerType::get(32));
break;
On Thu, 2008-11-20 at 15:51 +0530, sanjiv gupta wrote:
> Please find the attached patch. Let me know if it looks okay.
>
> -Sanjiv
>
> On Wed, 2008-11-19 at 09:52 -0800, Chris Lattner wrote:
> > On Nov 19, 2008, at 12:50 AM, Sanjiv Gupta wrote:
> >
> > > Author: sgupta
> > > Date: Wed Nov 19 02:50:17 2008
> > > New Revision: 59612
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=59612&view=rev
> > > Log:
> > > Int type for PIC16 is i16. Added i16 intrinsics for memmove, memcpy
> > > and memset.
> >
> > hi Sangiv,
> >
> > The alignment argument should always be an i32. Note that the i64
> > version uses an i32 for the alignment.
> >
> > It would also be better to just go ahead and make these intrisnsics
> > type generic on the size argument, like the ctpop intrinsics etc are.
> > That would allow memcpy with a size of i42 if someone wanted it :)
> >
> > -Chris
> >
> > >
> > >
> > > Modified:
> > > llvm/trunk/include/llvm/Intrinsics.td
> > >
> > > Modified: llvm/trunk/include/llvm/Intrinsics.td
> > > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=59612&r1=59611&r2=59612&view=diff
> > >
> > > =
> > > =
> > > =
> > > =
> > > =
> > > =
> > > =
> > > =
> > > ======================================================================
> > > --- llvm/trunk/include/llvm/Intrinsics.td (original)
> > > +++ llvm/trunk/include/llvm/Intrinsics.td Wed Nov 19 02:50:17 2008
> > > @@ -190,18 +190,27 @@
> > > //
> > >
> > > let Properties = [IntrWriteArgMem] in {
> > > + def int_memcpy_i16 : Intrinsic<[llvm_void_ty],
> > > + [llvm_ptr_ty, llvm_ptr_ty,
> > > + llvm_i16_ty, llvm_i16_ty]>;
> > > def int_memcpy_i32 : Intrinsic<[llvm_void_ty],
> > > [llvm_ptr_ty, llvm_ptr_ty,
> > > llvm_i32_ty, llvm_i32_ty]>;
> > > def int_memcpy_i64 : Intrinsic<[llvm_void_ty],
> > > [llvm_ptr_ty, llvm_ptr_ty,
> > > llvm_i64_ty, llvm_i32_ty]>;
> > > + def int_memmove_i16 : Intrinsic<[llvm_void_ty],
> > > + [llvm_ptr_ty, llvm_ptr_ty,
> > > + llvm_i16_ty, llvm_i16_ty]>;
> > > def int_memmove_i32 : Intrinsic<[llvm_void_ty],
> > > [llvm_ptr_ty, llvm_ptr_ty,
> > > llvm_i32_ty, llvm_i32_ty]>;
> > > def int_memmove_i64 : Intrinsic<[llvm_void_ty],
> > > [llvm_ptr_ty, llvm_ptr_ty,
> > > llvm_i64_ty, llvm_i32_ty]>;
> > > + def int_memset_i16 : Intrinsic<[llvm_void_ty],
> > > + [llvm_ptr_ty, llvm_i8_ty,
> > > + llvm_i16_ty, llvm_i16_ty]>;
> > > def int_memset_i32 : Intrinsic<[llvm_void_ty],
> > > [llvm_ptr_ty, llvm_i8_ty,
> > > llvm_i32_ty, llvm_i32_ty]>;
> > >
> > >
> > > _______________________________________________
> > > llvm-commits mailing list
> > > llvm-commits at cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list