[LLVMdev] Lowering x64bit LLVM IR to x86bit LLVM IR

Sandeep Kumar Singh deepdondo007 at gmail.com
Thu Dec 18 20:28:33 PST 2014


Hi Tim,

I have implemented this engine only for opcodes that are not using memory
(it is only for register to register) and currently I have lowered down
LLVM IR for mov and add opcode, and thus I need to test this code only.

Is there any other way to test the same?

Thanks,
Sandeep

On Thu, Dec 18, 2014 at 9:03 PM, Tim Northover <t.p.northover at gmail.com>
wrote:
>
> > This is generated with my are written. Now, I want to test this
> generated,
> > lowered x64bit IR for x86bit machine.
>
> It looks very different from the 64-bit input, but that's a problem
> for debugging to resolve I suppose.
>
> > Please let me know how I can test this. How I can test generated LLVM IR,
> > how I can debug this generated LLVM IR.
>
> If it was me, I'd start with functions with well-defined inputs and
> outputs (e.g. "int foo(int a, int b) { return a + b; }"). Create a
> test-harness that calls out to this function and then replace the
> default implementation with one that comes from your specially
> converted IR. Use that to make sure the values match up.
>
> You'd likely have difficulties with mismatched calling conventions, so
> it might be better to use global variables for all input/output (so
> "int a, b, res; void foo() { res = a + b; }" instead). They tend to be
> easier to get working.
>
> Cheers.
>
> Tim.
>


-- 

Thanks and Regards,
Sandeep Kumar Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141219/21a9e62b/attachment.html>


More information about the llvm-dev mailing list