aditya vishnubhotla
2008-May-07 16:25 UTC
[LLVMdev] Creation of Intrinsics with Pointer Return Types
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'>Hi,<br>I tried creating intrinsics which are to be<br>placeholders for a set of instructions (actually a section of a basic block) to be executed elsewhere(for e.g. in HW).<br>These intrinsics are to take care of the data dependencies of the set of instructions being replaced by them.<br>In the process I created a "migrate_begin" variable argument intrinsic which handles the incoming data dependenices to these set of instructions.<br>Entry in the Intrinsics.td file:<br>def int_migrate_begin : Intrinsic<[llvm_i32_ty,llvm_vararg_ty],[IntrWriteMem],"llvm.migrate_begin">;<br> <br>I want to replace the instructions from this set , having outgoing data dependencies, with " migrate_end " intrinsic instructions.<br>I created two migrate_end intrinsics with return types anyint(iAny Value Type) and any float(fAny Value Type).<br>Entries in the Intrinsics.td file:<br>def int_migrate_end_int : Intrinsic<[llvm_anyint_ty,llvm_i32_ty,llvm_i32_ty],[IntrWriteMem],"llvm.migrate_end_int">;<br>def int_migrate_end_float : Intrinsic<[llvm_anyfloat_ty,llvm_i32_ty,llvm_i32_ty],[IntrWriteMem],"llvm.migrate_end_float">;<br><br>I am not able to handle all of the pointer return type instructions.<br><br>I tried using the types such as:<br><br>def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here<br>def llvm_iPTR_ty : LLVMType<iPTR><br>def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; <br>and adding types<br>def llvm_ptriAny_ty : LLVMPointerType<llvm_anyint_ty>; <br>def llvm_ptrfAny_ty : LLVMPointerType<llvm_anyfloat_ty>;<br><br>but in vain. <br>I would be happy to know the type or types required for handling a pointer return type for an LLVM instruction, to create the "migrate_end" intrinsic.<br><br>Thank You,<br>Aditya<br> <br><br></td></tr></table><br> <hr size=1>Be a better friend, newshound, and know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>
Dan Gohman
2008-May-07 18:28 UTC
[LLVMdev] Creation of Intrinsics with Pointer Return Types
Hello, LLVM's intrinsic overloading mechanism does not currently support overloading on pointer types. Patches to implement this would be welcome. Dan On May 7, 2008, at 9:25 AM, aditya vishnubhotla wrote:> Hi, > I tried creating intrinsics which are to be > placeholders for a set of instructions (actually a section of a > basic block) to be executed elsewhere(for e.g. in HW). > These intrinsics are to take care of the data dependencies of the > set of instructions being replaced by them. > In the process I created a "migrate_begin" variable argument > intrinsic which handles the incoming data dependenices to these set > of instructions. > Entry in the Intrinsics.td file: > def int_migrate_begin : Intrinsic<[llvm_i32_ty,llvm_vararg_ty], > [IntrWriteMem],"llvm.migrate_begin">; > > I want to replace the instructions from this set , having outgoing > data dependencies, with " migrate_end " intrinsic instructions. > I created two migrate_end intrinsics with return types anyint(iAny > Value Type) and any float(fAny Value Type). > Entries in the Intrinsics.td file: > def int_migrate_end_int : > Intrinsic<[llvm_anyint_ty,llvm_i32_ty,llvm_i32_ty], > [IntrWriteMem],"llvm.migrate_end_int">; > def int_migrate_end_float : > Intrinsic<[llvm_anyfloat_ty,llvm_i32_ty,llvm_i32_ty], > [IntrWriteMem],"llvm.migrate_end_float">; > > I am not able to handle all of the pointer return type instructions. > > I tried using the types such as: > > def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here > def llvm_iPTR_ty : LLVMType<iPTR> > def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; > and adding types > def llvm_ptriAny_ty : LLVMPointerType<llvm_anyint_ty>; > def llvm_ptrfAny_ty : LLVMPointerType<llvm_anyfloat_ty>; > > but in vain. > I would be happy to know the type or types required for handling a > pointer return type for an LLVM instruction, to create the > "migrate_end" intrinsic. > > Thank You, > Aditya > > > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. > Try it now. _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Gordon Henriksen
2008-May-08 17:37 UTC
[LLVMdev] Creation of Intrinsics with Pointer Return Types
I'm not sure how you'd encode the pointer type name in the type. Another option is bitcast pointers to some fixed type. i8* is a good choice. The GC intrinsics do this. On May 7, 2008, at 14:28, Dan Gohman wrote:> Hello, > > LLVM's intrinsic overloading mechanism does not currently support > overloading on pointer types. Patches to implement this would be > welcome. > > Dan > > On May 7, 2008, at 9:25 AM, aditya vishnubhotla wrote: > >> Hi, >> I tried creating intrinsics which are to be >> placeholders for a set of instructions (actually a section of a >> basic block) to be executed elsewhere(for e.g. in HW). >> These intrinsics are to take care of the data dependencies of the >> set of instructions being replaced by them. >> In the process I created a "migrate_begin" variable argument >> intrinsic which handles the incoming data dependenices to these set >> of instructions. >> Entry in the Intrinsics.td file: >> def int_migrate_begin : Intrinsic<[llvm_i32_ty,llvm_vararg_ty], >> [IntrWriteMem],"llvm.migrate_begin">; >> >> I want to replace the instructions from this set , having outgoing >> data dependencies, with " migrate_end " intrinsic instructions. >> I created two migrate_end intrinsics with return types anyint(iAny >> Value Type) and any float(fAny Value Type). >> Entries in the Intrinsics.td file: >> def int_migrate_end_int : >> Intrinsic<[llvm_anyint_ty,llvm_i32_ty,llvm_i32_ty], >> [IntrWriteMem],"llvm.migrate_end_int">; >> def int_migrate_end_float : >> Intrinsic<[llvm_anyfloat_ty,llvm_i32_ty,llvm_i32_ty], >> [IntrWriteMem],"llvm.migrate_end_float">; >> >> I am not able to handle all of the pointer return type instructions. >> >> I tried using the types such as: >> >> def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg >> here >> def llvm_iPTR_ty : LLVMType<iPTR> >> def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; >> and adding types >> def llvm_ptriAny_ty : LLVMPointerType<llvm_anyint_ty>; >> def llvm_ptrfAny_ty : LLVMPointerType<llvm_anyfloat_ty>; >> >> but in vain. >> I would be happy to know the type or types required for handling a >> pointer return type for an LLVM instruction, to create the >> "migrate_end" intrinsic. >> >> Thank You, >> Aditya >> >> >> >> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. >> Try it now. _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev— Gordon
Apparently Analagous Threads
- [LLVMdev] Creation of Intrinsics with Pointer Return Types
- [LLVMdev] Invalid intrinsic name error
- define intrinsic function with pointer-typed parameter
- [LLVMdev] Problem with variable argument intrinsics
- [LLVMdev] Problem with variable argument intrinsics