<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 - At least one condition is wrong (same conditional expr of if/else if) (llvm/lib/CodeGen/GlobalISel.cpp:1614 <=> 1617)"
   href="https://bugs.llvm.org/show_bug.cgi?id=46882">46882</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>At least one condition is wrong (same conditional expr of if/else if) (llvm/lib/CodeGen/GlobalISel.cpp:1614 <=> 1617)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>GlobalISel
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>info@ustchcs.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, quentin.colombet@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23784" name="attach_23784" title="tool-report-screenshot">attachment 23784</a> <a href="attachment.cgi?id=23784&action=edit" title="tool-report-screenshot">[details]</a></span>
tool-report-screenshot

The use of if (Condition) {...} else if (Condition) {...} pattern should be
avoided.

(commit:23d6525cbdc9de7cbfe7640d1e9e4f25a0c5dd85)

llvm/lib/CodeGen/GlobalISel.cpp:

  1574  LegalizerHelper::LegalizeResult
  1575  LegalizerHelper::widenScalarExtract(MachineInstr &MI, unsigned TypeIdx,
  1576                                      LLT WideTy) {
  ...
  1612      // Do a shift in the source type.
  1613      LLT ShiftTy = SrcTy;
  1614      if (WideTy.getSizeInBits() > SrcTy.getSizeInBits()) {
  1615        Src = MIRBuilder.buildAnyExt(WideTy, Src);
  1616        ShiftTy = WideTy;
  1617      } else if (WideTy.getSizeInBits() > SrcTy.getSizeInBits())
  1618        return UnableToLegalize;
  1619  
  1620      auto LShr = MIRBuilder.buildLShr(
  1621        ShiftTy, Src, MIRBuilder.buildConstant(ShiftTy, Offset));
  1622      MIRBuilder.buildTrunc(DstReg, LShr);
  1623      MI.eraseFromParent();
  1624      return Legalized;
  1625    }
  ...
  1651  }

Reported by: Ustchcs Toolsets Bugfinder
(bugfinder-2.2: The use of if (Condition) {...} else if (Condition) {...}
pattern should be avoided.)</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>