[PATCH] D15746: Normalize the features string in SubtargetFeatures::getFeatureBits

A. Skrobov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 11:16:17 PDT 2016

tyomitch added a comment.

In http://reviews.llvm.org/D15746#381104, @echristo wrote:

> I'm still uncertain we want to do this in the backend. I seem to recall you wanting to do this for a reason, but searching my email can't find it.

In http://reviews.llvm.org/D15746#319426, @tyomitch wrote:

> > How are you getting the feature strings that you're showing here?
> We have a sort of testing script which runs LLVM with different
>  combinations of enabled features, pasting together chunks of
>  feature strings, each such chunk enabling a different subset
>  of test cases.
> The existing implementation of getFeatureBits lets us "cancel out"
>  a `+feature` in a later chunk by appending a `-feature`; but
>  it doesn't allow to cancel out a `-feature`, which is what my
>  patch tries to achieve.

In http://reviews.llvm.org/D15746#381104, @echristo wrote:

> Why can't we rely/assert/verify that the list of features in the list is complete and non-contradictory rather than coping with "garbage" in the backend. This seems like something the front-end, or whatever is generating IR, should handle.

Pre-parsing the feature string to "sanitize" it is certainly a possibility; my preference for doing this in `SubtargetFeatures::getFeatureBits` was to reuse the existing feature string parser, and avoid code duplication.


More information about the llvm-commits mailing list