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

George Burgess IV via llvm-dev llvm-dev at lists.llvm.org
Mon May 8 22:12:17 PDT 2017


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

Correct, but none of this is meant to be stored across runs, so the actual
address doesn't matter. You recompute the map every time your IR is loaded.

On Mon, May 8, 2017 at 7:34 PM, Dipanjan Das via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
>
> 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
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170508/597304a4/attachment.html>


More information about the llvm-dev mailing list