<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98461>98461</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
'pure' attribute is not considered across multiple expressions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Sainan
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/WK1qbrcdh
Notice how in this case `my_func` is called multiple times, even tho it would be possible to avoid the second call. This behaviour would be preferable because the call could be very expensive, even if inlined.
The 'pure' attribute is already respected within the same expression: https://godbolt.org/z/Ezj5v7rTE
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEkk9v1DAQxT-Ncxl15TjZ_DnkUGhzQeJCJY7IsSebqRw7eJws20-PkgKtkBAXW7LnN2_m6WlmunjETpw_iPNDptc0hdh90eS1z4Zgb92U0sKiuBeqF6q_BDsEl04hXoTqX4Tqv37Kvw_R2EnIByHvX8_PIZFBmMIVyEOaiMFoRhCVnG_fxtUbUUk4Xp1DC_PqEi0OIdGMLNRHwA13MAAluIbVWRgQlsBMw14WQG-BLKQJgdEEb49WJ3jatQac9EZhje_QiCNGvcMDGr0yHuwOgfldtGG8Af5Y0DNt-GcMGoG8I4_29H7JpwlBqHpZIwpVg04p0rAm3PfSLqK2N4jIC5qEFq6UpsMLBNYz7jIRmSl4UdzD_1x-fHk-b3V8esxsV9i2aHWGXV4rWbXnpiqzqSsGbOV5NHkzYlGX50bnRV1JaUfEOpdVRp2SqpR1nue5LFV5aoq6qdqq1cWY16aSopQ4a3In57Z5186IecWubcoqz5we0PERFKU8XuH4FErtuYndztwN64VFKR1x4rcuiZLD7l9O-ZDABM9kMaIFbWJgfgvEm02crdH9HUdK0zqcTJiF6nfBX9fdEsMzmiRUf4zJQvWva2yd-hkAAP__IIf7Nw">