Displaying 2 results from an estimated 2 matches for "instr_ptr".
2017 May 04
6
Computing unique ID of IR instructions that can be mapped back
I am writing an analysis pass on LLVM which requires to:
[1] generate unique, positive ID corresponding to each instruction
[2] the ID must survive across runs
[3] given the ID, corresponding instruction has to be mapped back
For [1], the general suggestion is to use the Value* instr_ptr associated
to each instruction. The instr_ptr points to specific instruction in
memory, hence unique. However, it does change at every run, thus violating
[2]. I have a hacking workaround of getting the first instruction of 'main'
method and computing the offset. The problem is, this gives...
2017 May 09
2
Computing unique ID of IR instructions that can be mapped back
...nt the counter but how'll I assign an
> ID to an instruction. Because, I need these IDs during an
> instrumentation phase. In other words, how will the instrumentation
> phase know what ID has been assigned to a particular instruction?
> Because, the instrumentation knows about the instr_ptr (memory address
> of an instruction) which changes at every run.
>
>
>
> Two tactics come to mind. First, you can store the ID directly in the
> instruction (adding a field to the class) when you assign the IDs.
>
>
>
> Is there any standard means to add an extra fiel...