<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95033>95033</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/lib/CodeGen/RegAllocGreedy.h:428: Pointless copy of object ?
</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:
llvm/lib/CodeGen/RegAllocGreedy.h:428:28: performance: Function parameter 'other' should be passed by const reference. [passedByValue]
Source code is
void add(RAGreedyStats other) {
Suggest new code
void add( const RAGreedyStats & other) {
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkkFv2zwMhn8NfSEayJQdOwcdkgbu9UMLfHdZYmxtiuVJcgf_-8FugLXAMGAXAhSlhy_FV6fkholZQX2B-lroJY8hKmt6WVZFH-yq3rLOzqCetF8TRzTzbEY23zHpNYE8g7iCeETv3-9AnXc9UPccLL_wBNS98nD2PpiXyGzXwwjyXFEL8rwHnDneQrzryfCWdstksgsTzjrqO2eOCNSEPHIEajCNYfEWe8ZZp8QW-xVNmFLGyDeOPBk-INSXj-pl_V_7haG-ftb5FpZoGE2wjC59riAivgdnUVsL1L6ePzRvn5DwoeGE0Fy-4JZh4JRx4p878y_Ah9SvXKDjH9iFVdKe5EkXrMqmbEVdymNZjKplIXs2bcOCZNtaXTPVVFct35pKC1M4RYIqcSwFCTpReWArrOZjZZmtZWqgEnzXzh-2hR1CHAqX0sLqVAspC6979mm3BNG-Unnexhq2ZRLQMxBt-dOPRXuX1-2wvhZRbXef-mVIUAnvUk6_-dllz-pf_YH_BTdlzymhCfOK4Yah_8YmI8iuWKJXY87z7kLqgLrB5XHpDybsXR7NNlFzDNszoG4fNAF1H7O-K_oVAAD__0OE8WE">