data dependency and fully loop unrolling

Hi, all

When I have a loop unrolled, in the loop body, the same element of the array may be accessed multiple times.
I see there are then load and store instructions and I can no longer trace the data dependency directly by comparing
the operands. So I am writing to see if anyone has done this or any methods in llvm that may help?

Best regards,


Are you looking specifically for an analysis that can 'undo' the
effects of loop unrolling, or do you want dependency analysis that can
run on the loop prior to unrolling?

For dependency analysis on loops (prior to unrolling) Preston and
Sanjoy have been working on this, see:
(and other related threads)



Thanks for our quick reply. I am expecting the data dependency after fully loop unrolling.
Actually I am trying to build the data dependency graph, I mean the data dependency between operands.
When there is no load and store in a basic block, I can simply compare the operands and build the data flow graph.
However, when there are both load and stores in a unrolled loop block, it is not easy to compare without knowing the address.
For example,
load a[i]
store b[i]
After fully loop unrolling, 'i' is a determined number. And the data dependency is
It seems pretty straightforward, but we can not draw the dependency without knowing the array index.

I have looked into the links that you have suggested, it seems quite related but I am not sure yet.
I will spend more time on it.

Best regards,