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

    <tr>
        <th>Summary</th>
        <td>
            Improve argument filtering for CUDA sub-compilations targeting NVPTX
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          Artem-B
      </td>
    </tr>
</table>

<pre>
    From https://github.com/llvm/llvm-project/pull/70740#issuecomment-1786180822

>The current filtering mechanism is gross. We have code that does the following error checking for a lot of options and there are more and more of them. It is nearly infeasible to enumerate them.
>
> if (!Triple.isXXX()) { err_unsupported_opt_for_target  } else handle
When such an option is used in clang++ --cuda-path=/usr/local/cuda -x cu /dev/null -c -nocudainc -nocudalib $option, we will get an error for NVPTX.
>
> -mcmodel= turned out to be an issue just because we add this option globally.
>
> https://reviews.llvm.org/D105226 introduced a special case to exclude NVPTX for -fbasic-block-sections=, so this has a precedent, but we should figure out a way to handle the target-specific options in a more elegant way.
>
> I do not know whether we should use something similar to -fembed-bitcode's list.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVL1u4zgQfhqqGciQKdmyCxVJfALSHK7I3aYLhuRI4oYiBf7Ym7c_UMr6boE028hjj-j5_jgYgh4tUccOj-xwKTDFyfnuwUeay8dCOPXR9d7NMMW4BFY_MN4z3o86TknspJsZ7425_vwoF---k4yM90syhvG-rdqmYrzWISSSbp7JxnLfno77U3XinFUXVj18Pus_XiYCmbwnG2HQJpLXdoSZ5IRWhxl0gNG7EHbwjWDCK4F0iiBOGEE5ChAngsEZ4275IHnvPMiJ5Hv-OjgPCMZFcAO4JWpnA6BV-ZQnQE8wu1xYtRVuyK15B88xj7aE3nyAtgNh0MIQRAdk00weI22v3qncC9ADMH5ifP_i9WJop8Pr6-v6y5nxM7D2MQN9SzakZXE-knpzS3wbnH-L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