[LLVMbugs] [Bug 20242] New: Missed CSE opportunity

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 8 03:12:44 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20242

            Bug ID: 20242
           Summary: Missed CSE opportunity
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For this testcase

char *encode(char *p, unsigned v) {
  if (v < 23) {
    *(p++) = v | 128;
  } else if (v < 42) {
    *(p++) = v | 128;
    *(p++) = v;
  } else {
    *(p++) = v | 128;
    *(p++) = v >> 7;
  }
  return p;
}

The first line is the same in all 3 cases. We only merge the lower 2 cases at
clang -O3, leaving duplicated code around in the first and second case.

-- 
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/20140708/b3c1a02d/attachment.html>


More information about the llvm-bugs mailing list