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

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)

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 -
-Xclang -target-feature -Xclang +

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 -
-Xclang -target-feature -Xclang +

Thanks!
Przemek