<p dir="ltr">Hi Ryan,</p>
<p dir="ltr">Yes. But I am unable to think where in the code will it go? Will it be in a .td file where I define a pattern and during InstructionSelection, the pattern matches and emits the code automatically? Or do I need to write a pass for it?</p>
<p dir="ltr">I am new to llvm backend and trying to figure out things. Any help will be a great deal. </p>
<p dir="ltr">Thanks.</p>
<p dir="ltr">Regards,<br>
Alex</p>
<div class="gmail_extra"><br><div class="gmail_quote">On 18 Oct 2016 3:17 a.m., "Ryan Taylor" <<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I was under the impression his answer was correct from your reply, no? </p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 17, 2016 17:45, "Alex Bradley via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Gentle Ping !! </p>
<p dir="ltr">I would appreciate any help on this. I want to generate following as described by Krzysztof :<br></p>
<p dir="ltr"> %v1 = load i32, i32* %a<br>
 %v2 = load i32, i32* %b<br>
 %v3 = add i32 %v1, %v2<br>
 store i32 %v3, i32* %c</p>
<p dir="ltr">maps to (using invented mnemonics):</p>
<p dir="ltr">ASSIGN R0, %a<br>
ASSIGN R1, %b<br>
ASSIGN R2, %c<br>
ADD *R2, *R0, *R1</p>
<p dir="ltr">Thanks.</p>
<p dir="ltr">Regards,<br>
Alex</p>
<div class="gmail_extra"><br><div class="gmail_quote">On 14 Oct 2016 1:00 p.m., "Alex Bradley" <<a href="mailto:alexbradley.bqc@gmail.com" target="_blank">alexbradley.bqc@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr"><br>
> If I understand correctly:<br>
><br>
> %v1 = load i32, i32* %a<br>
> %v2 = load i32, i32* %b<br>
> %v3 = add i32 %v1, %v2<br>
> store i32 %v3, i32* %c<br>
><br>
> maps to (using invented mnemonics):<br>
><br>
> ASSIGN R0, %a<br>
> ASSIGN R1, %b<br>
> ASSIGN R2, %c<br>
> ADD *R2, *R0, *R1<br>
><br>
> I.e. pattern<br>
>   (store %c, (add (load %a), (load %b)))<br>
> becomes<br>
>   (ADD (ASSIGN R2, %c), (ASSIGN R0, %a), (ASSIGN R1, %b))<br>
></p>
<p dir="ltr">Yes. Exactly. </p>
<p dir="ltr">Regards,<br>
Alex<br>
</p>
</blockquote></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div></div>
</blockquote></div></div>