[LLVMdev] Unexpected DSAnalysis behavior

Kevin Streit kevin.streit at googlemail.com
Mon Mar 4 06:05:02 PST 2013


Hi,

during the hunt for a bug causing strange behavior of our automatic parallelization framework, 
I found some, at least for me, unexpected behavior of the DataStructureAnalysis in Poolalloc.

Consider the following simplified program:

====================
int ARR[4] = {1, 2, 3, 4};

int a(int pos) {
    return ARR[pos];
}

int sum(int op_a, int op_b) {
    return a(op_a) + a(op_b);
}

int main(int argc, const char *argv[]) {
    return sum(1, 3);
}
====================

The unexpected behavior is that the bottum-up-graphs (and consequently the top-down-graphs)
of methods sum and main do not contain any hint on the read of the global variable ARR. These 
graphs thus do not reflect the full effects of the methods, which I expected them to do. (Screenshots attached)

This seems to be deliberate as the code states that "[...] we don't care about merging globals [...] here" 
(BottomUpClosure.cpp:641 in the release_32 version from the poolalloc SVN).

The "here" in the comment suggests that this should happen at some later point, which it doesn't.

This behavior is also not in line with the PLDI Paper.
Is it intended? And if so, why?

Thanks for your efforts,
Kevin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130304/3997400c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dsa-test.png
Type: image/png
Size: 22919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130304/3997400c/attachment.png>


More information about the llvm-dev mailing list