<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - switch is not converted into an argument LUT when a call return value is discarded"
   href="https://bugs.llvm.org/show_bug.cgi?id=41259">41259</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>switch is not converted into an argument LUT when a call return value is discarded
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>code-quality
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nok.raven@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>hans@chromium.org, htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For this code an argument LUT is constructed

int f(int);

int foo(int x)
{
    switch (x) {
    case 0: return f(12);
    case 1: return f(34);
    case 2: return f(56);
    case 3: return f(78);
    case 4: return f(90);
    }
}

But if the return value is discarded, as Hans Wennborg noticed in
<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - jump table switch also contains a branch (conditional jump to a first case)"
   href="show_bug.cgi?id=41242#c4">https://bugs.llvm.org/show_bug.cgi?id=41242#c4</a>

int f(int);

int foo(int x)
{
    switch (x) {
    case 0: f(12); break;
    case 1: f(34); break;
    case 2: f(56); break;
    case 3: f(78); break;
    case 4: f(90); break;
    }
}

The optimization did not work, and jump table is produced, while it could just
make a call instead of a jump.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>