Compute distance of Loop carried dependency

Hi,
I’m trying to get all the loop carried dependency and their distance to build a dependence graph, but I can’t find anything robust enough in the library. Is it possible to always get the distance of a loop carried dependency in a loop? if yes, there is a way to do it right now? (the getDistance method of the Dependence class doesn’t always work)
If no, how do you build a dependence graph to implement something like modulo scheduling?