<div dir="ltr"><br><div>Hi David,</div><div><br></div><div>I think you people can help me better if I explain what I am trying to achieve.</div><div><ol><li>I have compiled gmp with LLVM 2.9<br></li><li>Linked the library statically with a stub program (gmp_demo.bc)</li><li>Transformed the bitcode to LLVM IR: llvm-dis gmp_demo.bc -o gmp_demo.ll</li><li>Trying to convert the IR to high-level C code: llc -march=c gmp_demo.ll </li></ol><div>Though I know that llc C backend has many issues and has been removed from LLVM >=3.1, still I am desperate to make it work. The error I receive in the last step is the following: "LLVM ERROR: Code generator does not support intrinsic function 'llvm.uadd.with.overflow.i64'!"</div></div><div><br></div><div>I was planning to rewrite LLVM intrinsics not supported by llc to equivalent LLVM IR supported by llc. Is this approach feasible?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 10 September 2015 at 17:50, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10 Sep 2015, at 10:09, serge guelton via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> On Thu, Sep 10, 2015 at 04:20:01PM +0800, Dipanjan Das via llvm-dev wrote:<br>
>> Hello,<br>
>><br>
>> I can see the occurrences of several LLVM intrinsic functions in the LLVM<br>
>> IR generated by llvm-dis disassembler. Is there any means to rewrite these<br>
>> functions reliably using basic LLVM IR statements?<br>
><br>
> You can use `LowerIntrinsicCall` from "llvm/CodeGen/IntrinsicLowering.h"<br>
> to do so.<br>
<br>
This will lower intrinsics to (target-specific) function calls that implement the underlying functionality, which is almost certainly not what you want to do.<br>
<br>
The question doesn’t really make sense.  Intrinsics *are* ‘basic LLVM IR statements’.  The distinction between things that are intrinsics and things that are instructions is quite fuzzy.  Many intrinsics are intended to be operations that map to a single instruction on (at least some) targets and are all things that are not (or, at least, not easily) representable with LLVM IR instructions.<br>
<br>
To answer your question properly, it would help to understand what you’re actually trying to do.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</div>