[llvm-bugs] [Bug 41261] New: inline jump addresses into a jump table

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 27 10:04:46 PDT 2019


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

            Bug ID: 41261
           Summary: inline jump addresses into a jump table
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Keywords: code-quality
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: nok.raven at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

When a jump table label points to a jump its address could be just placed into
the jump table. An example:

int f1();
int f2();
int f3();
int f4();
int f5();

int foo(int i)
{
    switch (i) {
        case 1: return f1();
        case 2: return f2();
        case 3: return f3();
        case 4: return f4();
        case 5: return f5();
    }
}

GCC does not do this optimization too, but there is an old ticket on this with
an additional info https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14721

-- 
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/20190327/65bc9996/attachment.html>


More information about the llvm-bugs mailing list