[llvm-bugs] [Bug 25490] New: [LV] non-deterministic output related to ext/trunc

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 11 08:16:03 PST 2015


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

            Bug ID: 25490
           Summary: [LV] non-deterministic output related to ext/trunc
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: anemet at apple.com, james.molloy at arm.com,
                    llvm-bugs at lists.llvm.org, mssimpso at codeaurora.org
    Classification: Unclassified

Given the below test case I get non-deterministic output from the loop
vectorizer:

void test(unsigned n, unsigned char *a, unsigned char *b, unsigned char *c)
{
  for (unsigned i = 0; i < n; ++i) {
    int tmp = c[i];
    a[i] = (((int)a[i] * ((int)tmp)) >> 8);
    b[i] = (((int)b[i] * ((int)tmp)) >> 8);
  }
}

Both outputs appear to be correct, but non-determinism is bad in general.

Reproduce with:
clang -S -o test1.ll -O3 --target=aarch64-linux-gnu -mcpu=cortex-a57 test.c
-emit-llvm

Emitting IR seems to work better than emitting assembly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151111/cf30e39e/attachment.html>


More information about the llvm-bugs mailing list