[LLVMdev] Executing a transformed program

Reid Kleckner reid.kleckner at gmail.com
Tue Jul 6 20:19:40 PDT 2010


You should post the errors you get when creating the final executable with gcc.

I'm guessing you need to do some linking with the VMKit runtime, but
you should look at the VMKit documentation.

Reid

On Sun, Jul 4, 2010 at 6:43 PM, Alysson <aishofpf at gmail.com> wrote:
> 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.
> So, after generating the example.bc, I remove some redundant instructions
> with my pass with opt.
>
> On Sun, Jul 4, 2010 at 8:32 PM, Alysson <aishofpf at gmail.com> wrote:
>>
>> Thank you for the answer Reid.
>> I've been already using the format `opt -load MyPass.so -my-pass input.bc
>> -o output.bc`.
>> But my problem is to execute the .s generated file.
>> As long as I know, gcc compiler is capable to generate target machine code
>> from assembly.
>> So I tried to compile it with gcc to generate machine code, but there was
>> many problems.
>> Is there any way to compile and run .s files?
>>
>> Best regards,
>> Alysson
>>
>> On Fri, Jul 2, 2010 at 2:20 AM, Reid Kleckner <reid.kleckner at gmail.com>
>> wrote:
>>>
>>> How are you getting LLVM to run your pass?  There's plenty of
>>> information here if you haven't found this document:
>>> http://llvm.org/docs/WritingAnLLVMPass.html
>>>
>>> I'm going to assume you're using `opt -load MyPass.so -my-pass
>>> input.bc -o output.bc` in which case you can just run llc on output.bc
>>> to get a .s file.
>>>
>>> Reid
>>>
>>> On Thu, Jul 1, 2010 at 8:16 PM, Alysson <aishofpf at gmail.com> wrote:
>>> > Hi all,
>>> > I´ve been working on a transformation pass which performs the remotion
>>> > of
>>> > some redundant instructions.
>>> > So now it´s finished I´d like to run the optimized programs generated
>>> > by my
>>> > pass.
>>> > But I´ve got  some problems to do this, because I didn´t find a way to
>>> > generate assembly from the code and then call the gcc compiler to
>>> > produce
>>> > machine-dependent code.
>>> > Please, does anybody know how to run programs optmized by passes?
>>> >
>>> > Thanks you all!
>>> > Best regards,
>>> > Alysson
>>> >
>>> > _______________________________________________
>>> > LLVM Developers mailing list
>>> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>> >
>>> >
>>
>
>




More information about the llvm-dev mailing list