[llvm-dev] Computing unique ID of IR instructions that can be mapped back

Dipanjan Das via llvm-dev llvm-dev at lists.llvm.org
Mon May 8 19:34:55 PDT 2017


On 8 May 2017 at 18:14, Jonathan Roelofs <jonathan at codesourcery.com> wrote:

> An alternative way to do it, which would be less invasive and more
> upstreaming friendly, would be to implement this as an analysis pass.
>
> In the pass, calculate a map<Instruction*,ID>, and use that as the
> analysis result. Then query that result for the ID where you need it. If
> you've written the analysis correctly, then you'll always get the same IDs
> for the same instructions given the same input IR.
>

Isn't Instruction* a pointer to the instruction in memory? If so, it'll
change across runs.


-- 

Thanks & Regards,
Dipanjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170508/2f6f1ee2/attachment.html>


More information about the llvm-dev mailing list