[LLVMdev] Anderson's analysis, getresult instruction on x86_64

Matthijs Kooijman matthijs at stdin.nl
Tue Aug 5 12:31:00 PDT 2008


Hi Prakash,

> The above code would add the constraint as Copy/%mrv_gr/%74 instead of
> Copy/%mrv_gr/%74.0 (the actual field which is a pointer).
It does slightly depend on how you handle the multiple return statement in
this case (or for the svn version, insertvalue instructions). I guess that if
those are handled as copies as well (and Andersen's throws all the fields from
the struct on the same pile of "may alias"), then your code could be correct
(but certainly not optimal).

> Is there a way in which one can extract the Value* of the appropriate field
> of getresult using the index (0 in this case) and the base structure (%74) ?
> (or is this what you were refering to: "For aggregates in memory, the
> pointer to the part of the aggregate can simply be used, but no such thing
> for first class values.", Matthjis ?)
The problem is that there is no such Value*, or at best %mrv_gr in the above
example is that Value*. This requires some special handling AFAICS, but
something like that might already be present for structs in memory.

> Since in all the programs on which I am running Andersen's analysis, the
> only usage of getresult is in accessing non-pointers:
> 
> %mrv_gr205 = getresult { i64, i64 } %615, 1     ; <i64> [#uses=1]
> 
> , for now, it seems to be ok to just ignore such instructions for pointer
> analysis (by the above code).
Probably, this is how we "solved" this problem a while back as well. By now we
no longer need Andersen's, so this not biting us anymore.

Good luck!

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080805/c827ffcb/attachment.sig>


More information about the llvm-dev mailing list