[llvm-bugs] [Bug 39091] New: Missed strlen(globalconststr) fold

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 26 13:44:13 PDT 2018


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

            Bug ID: 39091
           Summary: Missed strlen(globalconststr) fold
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

Currently, LLVM refuses to fold:

const char *key = "data"; // folded if key[]

int key_len(void) {
    return strlen(key);
}


Probably we need to support it in GetStringLength in ValueTracking.

-- 
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/20180926/6b56ac15/attachment.html>


More information about the llvm-bugs mailing list