svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
- From: "Ryan M. Lefever" <lefever AT illinois.edu>
- To: svadev AT cs.uiuc.edu
- Subject: [svadev] value preserving cast, ptr2int, and int2ptr
- Date: Tue, 12 Oct 2010 02:41:03 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev>
- List-id: <svadev.cs.uiuc.edu>
In the 2007 PLDI DSA paper, one of the cases for the local analysis (that constructs initial DSA graphs) is a value preserving cast. Does a value preserving cast include int2ptr and ptr2int casts? I am curious about the definition as far as the DSA algorithm is concerned and as far as the implementation is concerned.
It seams to me that DSA should not necessitate an implementation in which DS nodes associated with int2ptr and ptr2int casts have to be marked as unknown. Int2ptr and ptr2int casts can just be considered part of the definition of a value preserving casts. As long as the integer is big enough to hold a pointer, why does it matter that its typed as an integer? DSA only uses type information during loads, stores, and pointer arithmetic. If DSA can not preserve field-sensitivity after a ptr2int cast because of integer arithmetic, its no different than a program casting a value of T* to a char* and then performing pointer arithmetic. If the integer arithmetic can not be deciphered, the associated node simply collapses and loses field-sensitivity.
In the end, by treating int2ptr and ptr2int casts as value-preserving casts, you'll be able to eliminate unknown nodes. Sure some nodes might get merged together that would not have otherwise been merged, but if you hadn't treated int2ptr and ptr2int as value-preserving casts, those nodes would have been marked unknown and would't be reliable anyhow. You will probably end up with larger DS graphs too because you'll have more virtual registers to track, i.e., any virtual register big enough to hold an pointer. However, eliminating unknown nodes seams like it should be of utmost priority. After all, if you have one unknown node, since the unknown node can alias with any other unknown node, then by any node can alias any other node due to transitivity.
Does what I'm arguing seam correct?
Thanks,
Ryan
- [svadev] value preserving cast, ptr2int, and int2ptr, Ryan M. Lefever, 10/12/2010
Archive powered by MHonArc 2.6.16.