<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95642>95642</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/lib/Analysis/VectorUtils.cpp:1354:: Pointless string copy ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
code-quality,
llvm:analysis
</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/Analysis/VectorUtils.cpp:1354:57: performance: Function parameter 'FirstOrLast' should be passed by const reference. [passedByValue]
Source code is
auto InvalidateGroupIfMemberMayWrap = [&](InterleaveGroup<Instruction> *Group,
int Index,
std::string FirstOrLast) -> bool {
Suggest either use a StringRef or a constant reference.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkk-PozgQxT-NuZQ6AjvEcOBAOssq0rZ2ta3pORd2JfGMYzP-Ew3ffgSJpruPc0GiiqpX7_HDGM3ZEXWs3rP6UGBOFx86rUZRbYvR67l7TZiMAnRo50gB1DSpC6nvEHGOTPSsPLDy8bT2dmV8sGZkfOjXCRMZH95IJR--JGPjRk0TE30l6i0TfS2Z6GGicPLhik7R8jpkp5LxDiYMeKVEARiXgwkx_Rv-wZgYlxAvPlsNI8GEMZKGcQblXUwQ6ESBnKINsHp_7-7nN7SZWH34eO6rz0ERKK8JTPzYAcCcPBzdDa3RmOjv4PN0PL3QdaTwgvPXgBMwcVgkGN8ti3lzdImCJbzdP2fi-ehiCnl1w8RfwHh_7_Dnh45xCY5O08_3Ukx6iVX0MQXjzvDJeAtPy6LRewtM7j-5yeczxQRk0oUC5EiA8Lru-J9O4APgPSF0H0O6Dxe6E7oVLRbUVbJqtmInWllcOiWbsW0bkjU1vBp1q7UWDZ4kVqKWJ12Yjpd8W-6qupR8J-RGSC5JNU21a2sUJWfbkq5o7GahY-PDuTAxZuraerflhcWRbFz543z5E08_MlqTZsb5kgnnK1Six9848YXU0C31pzGfI9uW1sQU3wWSSZa6P6Zxge8_b1yyFCM84ld-moGJocjBdpeUphV6PjA-nE265HGj_CrzUFuumoL_RioxPqxWF9G721vHfwUAAP__mj8Y_Q">