<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99601>99601</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[llvm-opt-report] Incorrectly report function inline
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm-tools
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
According [llvm-opt-report.html](https://llvm.org/docs/CommandGuide/llvm-opt-report.html), the I is used to indicate inlined
> I: The function is inlined.
* mass.c: https://gcc.godbolt.org/z/bc78dMvKP
```
void foo (const int residue_numbers, const int *start, const int *end,
const float scaler, const VECTOR *center_of_mass, const VECTOR box_length, VECTOR *crd, int* periodicity)
{
for(int residue_i = 0; residue_i < residue_numbers; residue_i++) {
VECTOR trans_vec;
VECTOR com;
for (int atom_i = start[residue_i]; atom_i < end[residue_i]; atom_i++)
{
com = crd[atom_i];
trans_vec.x = com.x - floorf(com.x / box_length.x) * box_length.x;
trans_vec.y = com.y - floorf(com.y / box_length.y) * box_length.y;
trans_vec.z = com.z - floorf(com.z / box_length.z) * box_length.z;
trans_vec.x = scaler * trans_vec.x - com.x;
trans_vec.y = scaler * trans_vec.y - com.y;
trans_vec.z = scaler * trans_vec.z - com.z;
crd[atom_i] = crd[atom_i] + trans_vec;
}
}
}
```
* there is no sub function called in function foo, but the llvm-opt-report reports **I** and doesn't report and vector information
```
28 | void Map_Center_Of_Mass_CPU(const int residue_numbers, const int *start, const int *end,
29 | const float scaler, const VECTOR *center_of_mass, const VECTOR box_length, VECTOR *crd, int* periodicity)
30 | {
31 | for(int residue_i = 0; residue_i < residue_numbers; residue_i++) {
32 | VECTOR trans_vec;
33 | VECTOR com;
34 |
35 | for (int atom_i = start[residue_i]; atom_i < end[residue_i]; atom_i++)
36 | {
37 | com = crd[atom_i];
38 | trans_vec.x = com.x - floorf(com.x / box_length.x) * box_length.x;
39 | trans_vec.y = com.y - floorf(com.y / box_length.y) * box_length.y;
40 | trans_vec.z = com.z - floorf(com.z / box_length.z) * box_length.z;
41 | trans_vec.x = scaler * trans_vec.x - com.x;
42 | trans_vec.y = scaler * trans_vec.y - com.y;
43 | trans_vec.z = scaler * trans_vec.z - com.z;
44 I | crd[atom_i] = crd[atom_i] + trans_vec;
45 | }
46 | }
47 | }
```
* issue reproduce method
> step1: clang++ -Dmass_EXPORTS -march=armv9-a -O3 -c mass.cpp -S -w -fsave-optimization-record -g3
> step2: llvm-opt-report mass.opt.yaml -o mass.opt.lst
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEV11v6jgQ_TXmZZQoscNHHnjgo6yqVdXq3u5q35CxHfAqsZHtsIVfv3ISCIR027u63UWoNOPxnDOTyXGGWiu3SogpGs7RcDmgpdtpMz1kPMsGG82P0xlj2nCptoCG8zw_FIHeu8CIvTYu3LkiR8MlwpOdc3uLyAzhFcIr7xdqs0V4xTWzCK8Wuiio4r-UkovG4S4QThFegNsJeARpobSCg9MgFZeMOgFS5VIJjqIlimYAiDzAIyIzeN0JyErFnNTKb2z8wtqx-YtnUFBrQ-Z33LLdMhZuNd_o3DWkTwivNmw84U-HX1-aAKOo-VaXBy05ZFoDwhOmlXUglQMjrOSlWKuy2AhjfTrtIsIz66hxd1ahOMKLJq16Jcs1dWAZzYVp_X9_WLw-f_NbmFBOmLXO1j6pO4-NflvnQm3dzi9dbTMeyeP6euyFkZpLJt3R175Oczw_1xcg0wbhyXViEhBZQoTI_Ma0uMv82gHhefVN4Sa6_zTUnKHKrg-CIXJ2aFaYLi62260NQWgYUqeLhl5d5eG8JTBcekIXlwX4kr_ncKF7j3fH__xhuqigfYGH8yZOFbTf_5Jw-Fbv00X4BoG_79pkVU95A8Krq3sZvlU1xLNb28cYxwvGsYtx7GIcezCOn8A4XTBOXYxTF-PUg3FqMbrFqR-DasP1UlBX7dP594Y5NmE-n2JvmFMT5vRumE5n9HULIDzvexRuGnDZGi8X7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