[llvm-bugs] [Bug 42865] New: Missed 'compress' codegen opportunity

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 1 14:20:17 PDT 2019


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

            Bug ID: 42865
           Summary: Missed 'compress' codegen opportunity
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

int floatcompress(float* __restrict__ in, float* __restrict__ out, int N,
                    float T) {
  int n = 0;
  for (int i = 0; i < N; ++i) {
    if (in[i] > T) out[n++] = in[i];
  }
  return n;
}

int intcompress(int* __restrict__ in, int* __restrict__ out, int N,
                    int T) {
  int n = 0;
  for (int i = 0; i < N; ++i) {
    if (in[i] > T) out[n++] = in[i];
  }
  return n;
}

-Ofast -march=icelake-server

ICC uses 'vcompressps' / 'vpcompressd', Clang's codegen should be improved to
use them too..


Current codegen: https://godbolt.org/z/eS733l

-- 
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/20190801/a9bd721c/attachment.html>


More information about the llvm-bugs mailing list