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

    <tr>
        <th>Summary</th>
        <td>
            SystemZFrameLowering modifies underlying IR module
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:SystemZ
      </td>
    </tr>

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

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

<pre>
    [This](https://github.com/llvm/llvm-project/blob/ee6afeb72ef2cee918c1338c926c481ad36aa915/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp#L577) may illegally modify the IR if `mcount` isn't already declared in the module.

It shouldn't be necessary to have an IR declaration, at this point only the symbol name should be be necessary to emit the call 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkj2P3CwUhX8NbtBr4evvwsW8WVkaaavNVukucMcm4WMEeCL_-8gzk2wUpUkFAs7D0T0HUzKLJ5pY-z9rXwrc8hrihDGRd4UMej9u3leTWPvCYFhzviZWnxjMDObF5HWTpQqOwWzt7efy3zWGr6Qyg1naIBnMRB1eSPZAF1BEYzWoqq4HNUKnmqFCXXeIY9X-xjGH7h3jQgfn854yuS8fuzmio9fwnaLxS6muVwb1a9v3DEbucOfGWlrQ2p27oM1l53klfn7j5sJZJ5wKm8-sE9wkz6DPHG0k1DvXpCxG0tz4u8QFvVkqmTgxcTpnntawWf3QSOKeFKWEcec58BVvxNEf3zwwmE3wDD5xzDyvJvFrMD7z4O3DT9qdDJZ7dPQEH8w_seRMvj9XaC0v9FTrsR6xoKnq26ZpurFqinWSiONAIFGokWqpsRe9wK5vpKYGcSjMBAJaMYhOAFRtU8IAum8l9oh1K1XFGkEOjS2PDMoQl8KktNFUtQD1UFiUZNO9KgAS1TfymtWnX9HA0aA43RsgtyWxRliTcvrAZZMtTX9L8JGSocQ3ryna_Tg7vz3HX2zRTv_cvbv5xGB--r9N8CMAAP__jOH34w">