[LLVMbugs] [Bug 714] NEW: [loopopt] Need index set analysis/splitting
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon Mar 6 18:36:17 PST 2006
http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=714
Summary: [loopopt] Need index set analysis/splitting
Product: libraries
Version: 1.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Loop Optimizer
AssignedTo: unassignedbugs at nondot.org
ReportedBy: sabre at nondot.org
Consider this:
----
#include <math.h>
void test(float *x, long ndat, float **y, float xcen,
long xmin, long xmax, float sigmal,
float contribution) {
long i,k;
float diff;
for (i=xmin,k=0; i<=xmax; i++, k++) {
if(i >= 0 && i < ndat) {
diff = fabs(xcen - x[i])/sigmal;
y[0][k] += contribution * 0.5*exp(-diff)/sigmal;
}
}
}
---
Through index set analysis, the two if statements inside the loop (comparing i to 0/ndat) can be
hoisted out.
-Chris
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list