[llvm-dev] Disabling/Enabling subtarget's feature from clang cmdline

Przemyslaw Ossowski via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 8 07:12:33 PDT 2021


I was looking for the solution without `-m[no]-<feature>` and definition it
in Options.td
So that's what I was looking for:
-Xclang -target-feature -Xclang -<feature to turn off>
-Xclang -target-feature -Xclang +<feature to turn on>

Thanks!
Przemek


On Wed, Oct 6, 2021 at 4:34 PM Nemanja Ivanovic <nemanja.i.ibm at gmail.com>
wrote:

> For anything that there isn't an associated `-m[no]-<feature>` option, you
> can pass the target feature directly (similarly to how you do with -mattr).
>
> In order to pass features directly to the back end, you can use:
> -Xclang -target-feature -Xclang -<feature to turn off>
> -Xclang -target-feature -Xclang +<feature to turn on>
>
> On Wed, Oct 6, 2021 at 10:17 AM Wang, Pengfei via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> It’s usually options like “-m<feature_name>” and “-mno-<feature_name>”
>>
>> You can find all usable options here, e.g.:
>>
>> https://clang.llvm.org/docs/ClangCommandLineReference.html#x86
>>
>>
>>
>> Thanks
>>
>> Phoebe (Pengfei)
>>
>>
>>
>> *From:* llvm-dev <llvm-dev-bounces at lists.llvm.org> *On Behalf Of *Przemyslaw
>> Ossowski via llvm-dev
>> *Sent:* Wednesday, October 6, 2021 8:53 PM
>> *To:* llvm-dev <llvm-dev at lists.llvm.org>
>> *Subject:* [llvm-dev] Disabling/Enabling subtarget's feature from clang
>> cmdline
>>
>>
>>
>> Hello,
>>
>> I have a set of two subtargets, each of them has a set of given features.
>>
>>
>>
>> From "llc" cmdline it is possible to enable/disable given feature on
>> given subtarget by adding: -attr=+/-<feature_name>
>>
>>
>>
>> Is it possible to explicitly disable/enable a given feature from clang
>> cmdline?
>>
>> I was trying to do it with "-mllvm -attr=feature_name", but it didn't
>> work.
>>
>>
>>
>> Thanks,
>>
>> Przemek
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211008/34f989c9/attachment.html>


More information about the llvm-dev mailing list