<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Got it, thank you Tim!
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Kaarthik A.</div>
</div>
</div>
<div name="messageReplySection">On Oct 23, 2019, 4:43 PM -0400, Tim Northover <t.p.northover@gmail.com>, wrote:<br>
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
On Wed, 23 Oct 2019 at 13:27, Kaarthik Alagapan<br>
<kaarthik@knights.ucf.edu> wrote:<br>
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
I initially was printing out the result from getName() (I.getParent()->getName()) and it printed out nothing sadly.<br>
<br>
when parsing the instructions in SelectionDAGBuilder but it was only visiting instructions in the first/main BB and outputted %2.<br>
</blockquote>
<br>
The instruction's parent is the (unnamed) entry block to the function<br>
(i.e. the block containing the instruction). By LLVM's automatic<br>
numbering system that's %2 in a function with two arguments. So yes,<br>
getName would return an empty string in that case.<br>
<br>
<br>
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
I'm not sure what's going on there, it would depend on which function<br>
you're modifying in SelectionDAG.<br>
<br>
I am calling it right after each instruction is visited in the visit(…) function. And it prints out the instruction’s number but it prints out only %2 when I call printAsOperand on the instruction’s parent, hence why I assumed that the visit function was going
 over only the main block.<br>
</blockquote>
<br>
I'm afraid I still don't have anything very helpful to tell you about that.<br>
<br>
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
That’s true. I’m now trying to detect the specific label in the LLParser and hopefully can insert my instruction there. Would creating a new pseudo instruction be a good way to emit “.byte …” assembly code?<br>
</blockquote>
<br>
An intrinsic would probably be simpler. You need to modify a lot of<br>
places to invent a new instruction (LL parser, LL printer, Bitcode<br>
parser, Bitcode printer, Codegen, ...)<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote>
</div>
</body>
</html>