I don't know if there is something to do with my problem, but I'm using VMKit front-end to generate the .bc files.<br>So, after generating the example.bc, I remove some redundant instructions with my pass with opt.<br>

<br><div class="gmail_quote">On Sun, Jul 4, 2010 at 8:32 PM, Alysson <span dir="ltr"><<a href="mailto:aishofpf@gmail.com">aishofpf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Thank you for the answer Reid.<br>I've been already using the format `opt -load MyPass.so -my-pass input.bc -o output.bc`.<br>But my problem is to execute the .s generated file.<br>As long as I know, gcc compiler is capable to generate target machine code from assembly.<br>


So I tried to compile it with gcc to generate machine code, but there was many problems.<br>Is there any way to compile and run .s files?<br><br>Best regards,<br><font color="#888888">Alysson</font><div><div></div><div class="h5">

<br><br><div class="gmail_quote">On Fri, Jul 2, 2010 at 2:20 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:reid.kleckner@gmail.com" target="_blank">reid.kleckner@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">How are you getting LLVM to run your pass?  There's plenty of<br>
information here if you haven't found this document:<br>
<a href="http://llvm.org/docs/WritingAnLLVMPass.html" target="_blank">http://llvm.org/docs/WritingAnLLVMPass.html</a><br>
<br>
I'm going to assume you're using `opt -load MyPass.so -my-pass<br>
input.bc -o output.bc` in which case you can just run llc on output.bc<br>
to get a .s file.<br>
<font color="#888888"><br>
Reid<br>
</font><div><div></div><div><br>
On Thu, Jul 1, 2010 at 8:16 PM, Alysson <<a href="mailto:aishofpf@gmail.com" target="_blank">aishofpf@gmail.com</a>> wrote:<br>
> Hi all,<br>
> Iīve been working on a transformation pass which performs the remotion of<br>
> some redundant instructions.<br>
> So now itīs finished Iīd like to run the optimized programs generated by my<br>
> pass.<br>
> But Iīve got  some problems to do this, because I didnīt find a way to<br>
> generate assembly from the code and then call the gcc compiler to produce<br>
> machine-dependent code.<br>
> Please, does anybody know how to run programs optmized by passes?<br>
><br>
> Thanks you all!<br>
> Best regards,<br>
> Alysson<br>
><br>
</div></div><div><div></div><div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>