| commit | fdff0bb43e1065a4704b0a4d50a0509b805e8178 | [log] [tgz] |
|---|---|---|
| author | Chris Lattner <sabre@nondot.org> | Wed Feb 15 22:52:05 2006 +0000 |
| committer | Chris Lattner <sabre@nondot.org> | Wed Feb 15 22:52:05 2006 +0000 |
| tree | b3a1bd5768f315e582872e46dc071a54544c87f9 | |
| parent | 76a7775ce1648f5b916303ae97a09488ada81e4e [diff] |
Implement trivial unswitching for switch stmts. This allows us to trivial
unswitch this loop on 2 before sweating to unswitch on 1/3.
void test4(int N, int i, int C, int*P, int*Q) {
int j;
for (j = 0; j < N; ++j) {
switch (C) { // general unswitching.
default: P[i+j] = 0; break;
case 1: Q[i+j] = 0; break;
case 3: P[i+j] = Q[i+j]; break;
case 2: break; // TRIVIAL UNSWITCH on C==2
}
}
}
llvm-svn: 26223