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

    <tr>
        <th>Summary</th>
        <td>
            [SPIR-V] Prefer SPV_INTEL_optnone over SPV_EXT_optnone when both extensions are available
        </td>
    </tr>

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

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

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

<pre>
    Current implementation of support for the SPIR-V extension SPV_EXT_optnone prefers it over SPV_INTEL_optnone when both extensions are available. However, this leads to issues during run-time when a target knows about SPV_INTEL_optnone but not about SPV_EXT_optnone -- note that SPV_INTEL_optnone exists for a long time and SPV_EXT_optnone is a freshly introduced substitution of this extension.

To remediate the issue it'd be enough to simply change the order of picking one of those extensions when both are available, preferring SPV_INTEL_optnone over SPV_EXT_optnone to widen support of target systems. This solution would not change anything when a target specifies a required extension explicitly rather than allowing any of those (e.g., by providing `--spirv-ext=all` command line argument).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVMFupDgQ_RpzKYHcpmnSBw7ZybR2pNEq2omivY0MrgZvjM3aZTr8_crQm_RoIu2cOFT5Vb336iFD0L1FbFj1GxPieZHdgMHI-SvOC4WXZWFCsOohk5EG55sPGrLWqaX5FL1HS6DHyeCIliRpZ8GdIcRpcp7g7DzQgPDt8cuf-TPgK6ENqefb4_P3z389fXcTWWcRJo9n9AE0gZvRr_Uvfzx9_vrWcRnQQutoeEcJID2CnKU2sjVYwO_ugjN6Jj4BDTqAQakCkAMdQsQAKnpte_DR5qTHK6YEkr5HghfrLgFk6yJ9ML-NBNbRTf12_zxPRQQa5EeP8VUHCqscEoyzPazzpVU_IekAEs4ew2AW0Ja8U7FDBSG2gTTF_yReCb5JUTB-z_j9kwOPIyot111wIw6amKgVtAhoXeyHJElIri3QDdL2W6_zCn2CnnT3knRK66yTXMBb1d-t-EH_JPvm46ryzyq8OXvLlxxctEL7djNp4mZIWALhGAp4SlyDMxv5i4tGrV5cl5d2oSGN_NHPMGGnzxqToB7_idqjujlBfJ2M7jSZBbykAdOlSgvSGHdJYNIu7-yZuMOiLxLFdoHJu1mr1MQOPM_DpP2c4yux8kEaww4cOjeOyV2jLYL0fUzxYOJYZKop1bE8ygybXV0eSlHXvMqG5m5f1pzj8Y53x0O373b1uUKJtSq7fStxn-lGcFHxHb_jx13Fq2LXcn4UYleXLe7EgbM9x1FqUxgzj4Xzfba63-yE4HWVGdmiCdfQW7xst3GNum_So7yNfWB7btK1vsOQJrP-LbYYs-oBHleff9Xj_89uFr1pBqIpsPKeiRMTp17TENuicyMTp7TL9ZNP3v2NHTFx2mLNxOlKcW7EvwEAAP__YZi1yQ">