<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/94378>94378</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm/include/llvm/CodeGenTypes/LowLevelType.h: 2 * pointless copy
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:codegen,
            code-quality
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          dcb314
      </td>
    </tr>
</table>

<pre>
    Static analyser cppcheck says:

1.

llvm/include/llvm/CodeGenTypes/LowLevelType.h:124:60: performance: Function parameter 'ScalarTy' should be passed by const reference. [passedByValue]

Source code is

  static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy) {

2.

llvm/include/llvm/CodeGenTypes/LowLevelType.h:71:52: performance: Function parameter 'ScalarTy' should be passed by const reference. [passedByValue]

Duplicate.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEU81u2zwQfJrVhYhALSXLOugg2_F3MfAdEuROkWuLLU2q_Emrty-kBIjPRYFeBMzuYnZmVpQxmpsj6qE5QHMqZE6TD71Wo6jqYvR66V-STEYx6aRdIgWm5llNpL6zKJcIYgB-Av75rcpHZO37HfBsnLJZE-D5s3D0mv4j97rMFAHPF__zQu9kV1xOIIYKaxDDjoMY2Ezh6sNdOkUrPGenkvGOzTLIOyUKDLB9UdLK8LoAtixOPlvNRmKzjJE0GxemvIuJBbpSIKeoZNAcPrqH5U3aTNCcHoW_-BwUMeU1MRMfO4zFjzg2Svo1B3a5vLK4Cfg_vJFKPgDuny3dyaWjzy6x5yPgcZv7EtoxaA-PzPhXomsrEEOD_yy5U56tUTLRp5tC90J3opMF9VVbtU3VVaIppp6L_Y7kuO-kaLXSYydarrCWNb9W3U7wwvTIseY7Xlc7sW-aEjl19fUqVaVQc82h5nSXxpZrNKUPt8LEmKnvatHuCytHsnH7rRG38MSw3vNGDhABj4C44qcfWVqTlrXYnIrQr7NPY75FqLk1McUv_mSSpf5PT8OQAQ5s9sYlSzEy5eelyMH2U0rz9pLwDHi-mTTlsVT-_sW9iZqD_0YqrbtXo-uSD6_vPf4OAAD__87HM54">