Dumping the IR of newly created Operators/instructions rewriter.createOrFold

91 views
Skip to first unread message

Dinesh Deepani

unread,
Jun 3, 2021, 3:31:43 AM6/3/21
to MLIR
Is there a utility  function  to dump a set of newly created Operators through rewriter.createOrFold while doing a Dialect Conversion in matchAndRewrite() 

I can dump the individual operations and there operand/result using utility function 
https://github.com/llvm/llvm-project/blob/main/mlir/test/lib/IR/TestPrintDefUse.cpp
 
But I want to dump the entire IR of newly created instructions starting from the firstly created instruction to ensure that the use-def generated chain is as per expectation for the new set of instructions being created in  matchAndRewrite() .



 With old operation which came as argument to matchAndRewrite() it prints all the instructions in the Block .

    llvm::dbgs() << "New Op " << "\n";
    auto walkFnNewOp = [&](Operation *walkedOp) {
      walkedOp->dump();
    };
    for (Region &region : definingOp->getRegions())
       region.walk(walkFnNewOp);


But on newly created Value object but it didn't dump any thing , probably there is no region with newly created Value .




Mehdi AMINI

unread,
Jun 3, 2021, 11:40:21 AM6/3/21
to Dinesh Deepani, MLIR
Hi Dinesh,

Do you mind asking on Discourse for general questions on MLIR? See here: https://llvm.discourse.group
Here is more about TensorFlow related questions.

Thanks!

-- 
Mehdi


--
You received this message because you are subscribed to the Google Groups "MLIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/250eb50e-c20a-4578-aa4d-6280d73ad164n%40tensorflow.org.

Dinesh Deepani

unread,
Jun 3, 2021, 12:26:56 PM6/3/21
to Mehdi AMINI, MLIR
Thanks Mehdi ,
Understood basically this group is more about tf/tflite dialects of MLIR .
BTW I registered up there, But how do I post the queries there , I am unable to  see an option to compose a message on that page https://llvm.discourse.group/c/mlir/31 

Mehdi AMINI

unread,
Jun 3, 2021, 1:24:31 PM6/3/21
to Dinesh Deepani, MLIR
When you're logged in, the top-right part of the page should look like this:

Screen Shot 2021-06-03 at 10.21.19 AM.png


The "New Topic" is how you create one.

Cheers,

-- 
Mehdi

Dinesh Deepani

unread,
Jun 3, 2021, 1:57:18 PM6/3/21
to MLIR, joke...@gmail.com
Thx alot , Got it. 
Reply all
Reply to author
Forward
0 new messages