Skip to content
  • Chris Lattner's avatar
    Implement trivial unswitching for switch stmts. This allows us to trivial · fdff0bb4
    Chris Lattner authored
    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
    fdff0bb4
Loading