https://bugs.llvm.org/show_bug.cgi?id=43620

            Bug ID: 43620
           Summary: llvm.assume blocks vectorizer predication
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedb...@nondot.org
          Reporter: benny....@gmail.com
                CC: ayal.z...@intel.com, hfin...@anl.gov,
                    llvm-bugs@lists.llvm.org

$ cat t.cc
void foo(float *__restrict a, float *__restrict b, int n) {
  for (int i = 0; i != n; ++i) {
      float x = 1;
      if (i < 495616) {
          x = 23;
      } else if (i < 991232) {
          x = 42;
      } else {
          __builtin_unreachable();
      }
      b[i] = a[i] * x;
  }
}

This only gets vectorized if I remove the __builtin_unreachable, but that
shouldn't affect vectorization at all. The unreachable gets converted into an
llvm.assume by SimplifyCFG but LV doesn't understand that it's not blocking
predication.

Godbolt: https://godbolt.org/z/PYp4wa

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to