[LLVMdev] DSA nodes do not get merged
Andrew Lenharth
andrewl at lenharth.org
Fri May 29 08:44:52 PDT 2009
On Fri, May 29, 2009 at 9:01 AM, Harmen van der Spek <hvdspek at liacs.nl> wrote:
> Hi all,
>
> I just ran into a strange problem. When using the Equivalence-class
> Bottom-up Data Structure Analysis pass and pool allocation, I noticed
> some objects using different pool descriptors where I expected them to
> be in the same pool. We use svn revision 66285 of the DSA.
But the two list nodes are provably disjoint so they are placed in two
different pools in the second example. The lack of the R flag in the
second node of the second example is also correct. I don't see any
problem with the DSGraphs for your programs.
Andrew
> The following 2 programs expose the problem. First the version that runs
> correctly, ie. producing a single DSNode.
>
> ---------
> typedef struct list {
> int X;
> struct list *Next;
> } list;
>
>
> void
> MakeList()
> {
> list *Result = malloc(sizeof(list));
> Result->X = 1;
> Result->Next = malloc(sizeof(list));
> Result = Result->Next;
> Result->X = 2;
> Result->Next = 0;
> }
>
> int main()
> {
> MakeList();
> return 0;
> }
> ---------
>
>
> You can view the corresponding DSGraph here:
> http://www.liacs.nl/~hvdspek/images/dsgraph_1node.png
>
> The following code produces 2 DSNodes:
>
>
> -------------
> typedef struct list {
> int X;
> struct list *Next;
> } list;
>
>
> void
> MakeList()
> {
> list *Result = malloc(sizeof(list));
> Result->X = 1;
> Result->Next = malloc(sizeof(list));
> Result->Next->X = 2;
> Result->Next->Next = 0;
> }
>
> int main()
> {
> MakeList();
> return 0;
> }
> ----------
>
> You can view the corresponding DSGraph here:
> http://www.liacs.nl/~hvdspek/images/dsgraph_2nodes.png
>
>
> Though one of the 2 nodes doesn't have the R flag, this is not the
> problem. Adding a printf statement does add the R flag, but still we get
> 2 nodes. Does anybody have an idea why these nodes are not merged?
>
>
>
> Harmen
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list