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

    <tr>
        <th>Summary</th>
        <td>
            We should bring NonNull attribute into Intrinsics.td
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:optimizations
      </td>
    </tr>

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

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

<pre>
    Currently the intrinsic `llvm.threadlocal.address` would take the address of the global TLS variable and return it. Since the address of the global TLS variable shouldn't be null, the intrinsics itself shouldn't be null too.

But currently we can't set an intrinsic as NonNull directly in Intrinsics.td. And there should be other intrinsics which are not null.
So we might lose some minor optimization chances.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNksGOmzAQhp_GXEZFxEASH3zIZlWpUrWXVGqvNjbYrbFTe7zR9ulr2DSblfZQCQHDzPzz_YNlUC_8mGPUHt0LoNFgPUbrkx2AbBvnnucaTdRCuTAIVwulok6ppOASslOA4pde-64ZCOMaTi5I4eDb1xM8i2iFdKXEK4gac_RgsYaT9cN_9yazjPOE7hCkBp-dI_T4njgV2aTd-FExYAg1aR5Jc3i9P2SE4eb8omEQrw1JYyG924NI8BT80yKibNTDUm89fLmNrVHVcCjmCk38h7oMDsuHe76LsYMBUYp8wJXrynQKC8JsJ4PgQioiYV5iHyKEM9rZ_hFog4fBiLK1VFeab7bbhrKG0a5SvFWsZaJCi07z728QZfJ0wxdYSGTGdWfhvYMqR8cN4jmR9kDo53JNFk2W9RDmEixH4fr4dI7hZ9lDCW1KWafy0u82m7YyvNnvaS-3lAk2yo7KnZZMlf_bj3Lbqk5WTkjtEif9A6F0FW0P9w6LGCX9Y2U5bSht9hva7PqetrWkrNXdfmQd6wSTlHSNnoV19XpIQ5yqyFc6madUks4mTG9JkZKdvNbr5KIvMpoQ-dFk4X_bH5lVqxe-GvkLXxIPvA">