[LLVMdev] Failed to Unroll a Seemingly Simple Loop

Jingyue Wu jingyue at google.com
Sun Jun 22 11:05:57 PDT 2014


Hi,

I found LLVM cannot unroll the loop in the example below, while gcc can.
Before I dig more about this issue, is this behavior as designed?

bool bar(int i);

void foo(int *a, int x, int y) {
  for (int i = 0; i < 4; ++i) {
    if (bar(i)) {
      break;
    }
    a[i] = i;
  }
}

Btw, if s/break/continue, LLVM is able to unroll it.

Thanks,
Jingyue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140622/5cad23cb/attachment.html>


More information about the llvm-dev mailing list