Hi! I have a DAG (attached), which, according to me, should result in the code for coroutine_make be generated _before_ the ret. However, it seems that the corresponding EmitInstrWithCustomInserter is being called /after/ the RET instruction has already been emitted. The LLVM code I'm trying to compile is this (coroutine_make is an intrinsic I've added): declare i32 @llvm.coroutine_size() declare void @llvm.coroutine_make(i64 *, i64 *, i8 *, i32) define i64 * @foo() { %a = call i32 @llvm.coroutine_size() %b = alloca i64, i32 %a %func = bitcast i64* () * @foo to i64 * call void @llvm.coroutine_make(i64 * %b, i64 * %func, i8 * null, i32 20) ret i64 *%b } What am I doing wrong? How do I fix this? Thanks! -- Sanjoy Das http://playingwithpointers.com -------------- next part -------------- A non-text attachment was scrubbed... Name: dag.foo.dot.ps Type: application/postscript Size: 30784 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110806/11524b26/attachment.ps>
On 08/06/2011 02:40 AM, Sanjoy Das wrote:> Hi! > > I have a DAG (attached), which, according to me, should result in the > code for coroutine_make be generated _before_ the ret. > > However, it seems that the corresponding EmitInstrWithCustomInserter is > being called /after/ the RET instruction has already been emitted.That is strange, from the dump it looks like all the chain edges are there. What is the MI dump you get for this BB just after instruction selection?> Thanks!Cheers, Rafael
I need help with visualizing graphs before and after instruction selection. The llc options listed in the docs do not work as specified. -Omer 2011/8/8 Rafael Ávila de Espíndola <rafael.espindola at gmail.com>> On 08/06/2011 02:40 AM, Sanjoy Das wrote: > > Hi! > > > > I have a DAG (attached), which, according to me, should result in the > > code for coroutine_make be generated _before_ the ret. > > > > However, it seems that the corresponding EmitInstrWithCustomInserter is > > being called /after/ the RET instruction has already been emitted. > > That is strange, from the dump it looks like all the chain edges are there. > > What is the MI dump you get for this BB just after instruction selection? > > > Thanks! > > Cheers, > Rafael > _______________________________________________ > 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/20110812/526cd29d/attachment.html>