It is not clear to me why this loop was using the `sources` array. AFAICT the
values written to this array are (1) not used by subsequent loop iterations (no
loop-carried dependency) and (2) not used after the loop before being
overwritten by other values.
This change cuts the dependency. A future commit will refactor the allocation in
this area to avoid allocating a possibly-unused array upfront.
e = edges[i];
}
x = e->x;
- sources[i].x = x[0];
- sources[i].y = x[1];
+ point_t source = {x[0], x[1]};
targets[i].x = x[e->dim*e->npoints - e->dim];
targets[i].y = x[e->dim*e->npoints - e->dim + 1];
- (*ink0) += hypot(sources[i].x - targets[i].x, sources[i].y - targets[i].y);
- begin = addPoint (begin, scalePoint(sources[i], e->wgt));
+ (*ink0) += hypot(source.x - targets[i].x, source.y - targets[i].y);
+ begin = addPoint (begin, scalePoint(source, e->wgt));
end = addPoint (end, scalePoint(targets[i], e->wgt));
wgt += e->wgt;
}