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

    <tr>
        <th>Summary</th>
        <td>
            __riscv_vsetvlmax_e64m1 & co not available with attribute target arch=+v
        </td>
    </tr>

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

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

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

<pre>
    Copying out of https://github.com/llvm/llvm-project/issues/56592:

The following fails to compile with `-march=rv64gc`, despite working with `-march=rv64gcv`, which should be what the `__attribute__` achieves:

```
#include<riscv_vector.h>

__attribute__((target("arch=+v")))
int vl_e64m1() {
    return __riscv_vsetvlmax_e64m1();
}
```
https://godbolt.org/z/rPnh5zYE5

I believe this would be because these definitions are preprocessor-gated: https://github.com/llvm/llvm-project/blob/33c42f8bc5615b4dc46cb45ab41da97be52474ec/clang/include/clang/Basic/riscv_vector.td#L637-L675
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycU02P4zYM_TX0hZjApiQ7PviQmVkDBfbQQy89BZLMRGoVK5Bkpzu_vnAms1_AHlqAgA36kSYf39M5-_PMPIB6BvVa6aW4mIbpTfuLrkycvgwv8frFz2eMS8F4QlfKNYM4AI1A49kXt5idjRegMYT14_F0TfEvtgVo9DkvnIFG1aqetsp6iz8c4ymGEG9b85P2IWOJaOPl6gPjzReH0NZPF52sA_Ga1laeLbQ10AtOnK--MN5i-nsr_wV6fcBvzluH2cUlTGgYb04XLI63kuNRl5K8WQofj9DWqK3zvHL-OunW5D3qA5Dwsw3LxCBeks92Pa5sS0w7B-LTO_7HjrQH2hedzlzu7_SYEOh5BSKg_hH1wc8F13DkVl6aO7ZH6J6hPiAiJi5LmvF4fPw1c1nDRf_zPRzEhobu9aepf7pZnEwMZRfTGWh8AxrT77NTb39-Uu8L_IaGw8YBFucz3j5oM2z1krcsZ8aJT372xcc5o06M18TXFC3nHNPTWReeQBz-u1xMiAZoFMJKOu2NVW2jjJysbK2RShvZTLrvDCuSnWQLNNqg522Tj8N8yzzr7DfED4cqE5D43Iru6XPbqWoaxNSLXlc8NJ3YU9_Usq_cwCdTd5PshDa2OZ3atjFCTh1LRe2euK38QDWpuhFNTaKjftfvmZSx-4ZFt2fZgKz5on3YbRtubFd3KwwNqUbJKmjDId-NRzTzDe9fN0mo1yoNd1rMcs4g6-Bzyd_aFF8CD79QAgK1aCPOsaBetQ_afNjpqyzxXY_4nRSrJYXh_3v7sdM60L8BAAD__7L5XqA">