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

    <tr>
        <th>Summary</th>
        <td>
            Can `-fmemory-profile-use` be used together with `-fmemory-profile`?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ## Background
I am currently trying to use memprof to optimize my program, but the test did not find obvious performance gains. **I now hope to develop a tool to observe whether the optimization is really effective.**
## Imagination
My idea is to use memory-profile and memory-profile-use at the same time, so that the memory access after memprof optimization can be collected. Then do some post-processing on this information to determine whether the correct clone is made. Furthermore, can a heat map be drawn based on the memory access situation, similar to BOLT.
## Question
1. I made the first attempt and found that `-fmemory-profile` and `-fmemory-profile-use` cannot be used at the same time. Is this not allowed by design?
2. **Are there other observation tools?** I looked through some options and only found `memprof-export-to-dot`, but this can only prove whether the clone is done, and cannot reflect whether the clone result is good enough.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8VM1u4zYQfhr6MrAgU4qzOujgbGHAQIuiwL4ARY4kdkmOQI7sep--IOVskDTdk2HN3_cnqZTsFBB78fQinn7bqZVniv0PPc67gcy9F7IRsoEXpb9PkdZgRH26gPKg1xgxsLsDx7sNEzDBmhA8-iXSmP_SwtbbHwj-DkukKSov5FcYVgaeERgTg7EGAjGMNhig4WppTbBgHCl6FTTCpGxIFQh5EvJ0gUA3mGnBvN_gFR0toICJXLk4JIxXhNuMPGMsZx4oFFsKYBNEVM7dAccRNdsrVttqUZ8eXC9eTTaUflGf_riDNajy5BtDivd9Zmkdggrmw6N97lIbyaQ8AluPmXki4PlR2EZAaY0pgRoZ40_t3kHWKsCAoMk51Iymgm8zBjAEiTzCQonz4bwm20ABeLYJbCgSlhVFK8bobXivjaYYUTNoRwEzRa8MVnBeY27xFAvsjEDBjIrBqyWDMVHdAgwqodkOfuSTLK-bgpm29dapmGG8_Pn7t-pN6r9WTA-dDxVcyvmybbQxMShm9AsXicccvk0-caz343vJxbEuXZ-Ushu5rFXIQRswm2j-408Fl7Qpl7uUc3RDA8MdDOZXRDRnUZ_kaxBPseCMCFTE3IL3qja5lPtLJ1zAEX3HjD3SOs2bbdliCqmApuDuD37iWD9CsMd_Foq8Z9obYnGs314dm4olZWyJ9CHvP700FIp9-cSDfMQxh-iT_ohpdZzHJiIDGDLUamf6xnRNp3bYH55b2XR13Xa7uR9le2x0N7byeUDZDOY4SjPqGtWIw5eh3dle1vKpbg7doTm0dVcdvzwfnrunrm3GthuaQbQ1emVd5dzVVxSnnU1pxf7QyFrWO6cGdKl8lqQMeINSFVLmr1Ts89B-WKck2trZxOltDVt22H9V4VdheE0B07QpcbM8_0-wRHPerdH1M_OSRHMS8izkebI8r0OlyQt5zscfP3nwb9Qs5LlATkKeH5yuvfw3AAD__4Rn3xE">