sure! class TEST_INTINSIC_FM< string asmstr> : Intrinsic <llvm_i32_ty], [llvm_i32_ty, llvm_ptr_ty], [IntrReadWriteArgMem], !strconcat(“llvm.test”, asmstr),”.float”) >; tks On Jul 18, 2014, at 4:06 PM, Tom Stellard <tom at stellard.net> wrote:> On Fri, Jul 18, 2014 at 03:19:47PM -0400, kewuzhang wrote: >> en! >> >> my test is : %r1 = call<float> @test.adddiv( <float> %r0, <float>* %p0). >> since >> > > Can you show us the code from your .td file where you define the intrinsic? > > -Tom > >>>> but somehow it always fall into INTRINSIC_WO_CHAIN category. >> (caught it in lowering..) >> >> I think it doesn’t have chain in initial DAG. >> >> unfortunately the intrinsic “test.adddiv” is defined by me for now. not sure how to make it has a chain. >> >> kevin >> >> >> On Jul 18, 2014, at 3:06 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: >> >>> On 7/18/2014 2:00 PM, kewuzhang wrote: >>>> >>>> I am working on an intrinsic function, which will write to a pointer argument. >>>> So I am lowering it and think I need to catch it in lowerINTRINSIC_W_CHAIN, but somehow it always fall into INTRINSIC_WO_CHAIN category. >>>> >>>> I put [IntrReadwriteArgMem] into my Intrinsic class definition, it did not help. >>>> tried put [SDNPHasChain] into intrinsic class definition, cause errors” Element type mismatch for list”. >>>> >>>> wondering how to flag it to INTRINSIC_W_CHAIN? >>> >>> >>> Does it have chain in the initial DAG? >>> >>> -Krzysztof >>> >>> >>> -- >>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation >>> _______________________________________________ >>> 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140718/aedddc33/attachment.html>
On Fri, Jul 18, 2014 at 04:15:45PM -0400, kewuzhang wrote:> sure! > > class TEST_INTINSIC_FM< string asmstr> : Intrinsic > <llvm_i32_ty], [llvm_i32_ty, llvm_ptr_ty], > [IntrReadWriteArgMem], > !strconcat(“llvm.test”, asmstr),”.float”) > >;Have a look at the SelectionDAGBuilder::visitTargetIntrinsic() function in lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp. That is where intrinsics are lowered to SelectionDAG nodes, so you can start your debugging there to try to figure out why it is INSTRINSIC_WO_CHAIN. -Tom> > tks > On Jul 18, 2014, at 4:06 PM, Tom Stellard <tom at stellard.net> wrote: > > > On Fri, Jul 18, 2014 at 03:19:47PM -0400, kewuzhang wrote: > >> en! > >> > >> my test is : %r1 = call<float> @test.adddiv( <float> %r0, <float>* %p0). > >> since > >> > > > > Can you show us the code from your .td file where you define the intrinsic? > > > > -Tom > > > >>>> but somehow it always fall into INTRINSIC_WO_CHAIN category. > >> (caught it in lowering..) > >> > >> I think it doesn’t have chain in initial DAG. > >> > >> unfortunately the intrinsic “test.adddiv” is defined by me for now. not sure how to make it has a chain. > >> > >> kevin > >> > >> > >> On Jul 18, 2014, at 3:06 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: > >> > >>> On 7/18/2014 2:00 PM, kewuzhang wrote: > >>>> > >>>> I am working on an intrinsic function, which will write to a pointer argument. > >>>> So I am lowering it and think I need to catch it in lowerINTRINSIC_W_CHAIN, but somehow it always fall into INTRINSIC_WO_CHAIN category. > >>>> > >>>> I put [IntrReadwriteArgMem] into my Intrinsic class definition, it did not help. > >>>> tried put [SDNPHasChain] into intrinsic class definition, cause errors” Element type mismatch for list”. > >>>> > >>>> wondering how to flag it to INTRINSIC_W_CHAIN? > >>> > >>> > >>> Does it have chain in the initial DAG? > >>> > >>> -Krzysztof > >>> > >>> > >>> -- > >>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation > >>> _______________________________________________ > >>> 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 >
Tks Tom, That is my confusing part. How can I make it to "access memory” so it will HasChain? Is there any flag set like in typeProfile, Node, instructions? myLoad, mayStore, SDNPHasChain? -kevin On Jul 18, 2014, at 4:26 PM, Tom Stellard <tom at stellard.net> wrote:> On Fri, Jul 18, 2014 at 04:15:45PM -0400, kewuzhang wrote: >> sure! >> >> class TEST_INTINSIC_FM< string asmstr> : Intrinsic >> <llvm_i32_ty], [llvm_i32_ty, llvm_ptr_ty], >> [IntrReadWriteArgMem], >> !strconcat(“llvm.test”, asmstr),”.float”) >> >; > > Have a look at the SelectionDAGBuilder::visitTargetIntrinsic() > function in lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp. That is > where intrinsics are lowered to SelectionDAG nodes, so you can start > your debugging there to try to figure out why it is INSTRINSIC_WO_CHAIN. > > -Tom > >> >> tks >> On Jul 18, 2014, at 4:06 PM, Tom Stellard <tom at stellard.net> wrote: >> >>> On Fri, Jul 18, 2014 at 03:19:47PM -0400, kewuzhang wrote: >>>> en! >>>> >>>> my test is : %r1 = call<float> @test.adddiv( <float> %r0, <float>* %p0). >>>> since >>>> >>> >>> Can you show us the code from your .td file where you define the intrinsic? >>> >>> -Tom >>> >>>>>> but somehow it always fall into INTRINSIC_WO_CHAIN category. >>>> (caught it in lowering..) >>>> >>>> I think it doesn’t have chain in initial DAG. >>>> >>>> unfortunately the intrinsic “test.adddiv” is defined by me for now. not sure how to make it has a chain. >>>> >>>> kevin >>>> >>>> >>>> On Jul 18, 2014, at 3:06 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote: >>>> >>>>> On 7/18/2014 2:00 PM, kewuzhang wrote: >>>>>> >>>>>> I am working on an intrinsic function, which will write to a pointer argument. >>>>>> So I am lowering it and think I need to catch it in lowerINTRINSIC_W_CHAIN, but somehow it always fall into INTRINSIC_WO_CHAIN category. >>>>>> >>>>>> I put [IntrReadwriteArgMem] into my Intrinsic class definition, it did not help. >>>>>> tried put [SDNPHasChain] into intrinsic class definition, cause errors” Element type mismatch for list”. >>>>>> >>>>>> wondering how to flag it to INTRINSIC_W_CHAIN? >>>>> >>>>> >>>>> Does it have chain in the initial DAG? >>>>> >>>>> -Krzysztof >>>>> >>>>> >>>>> -- >>>>> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation >>>>> _______________________________________________ >>>>> 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 >>