The LLVM function llvm::sys::getHostCPUFeatures(StringMap<bool>& Features) is specified to provide
A string mapping feature names to either true (if enabled) or false (if disabled). This routine makes no guarantees about exactly which features may appear in this map, except that they are all valid LLVM feature names.
The current implementation of getHostCPUFeatures is of type IO (Set CPUFeature) and returns information only on enabled features. It ought to be IO (Map CPUFeature Bool) so that it can indicate disabled features as well.
withTargetMachine currently takes a Set CPUFeature argument and at LLVM.General.Internal.Target:80 turns it into a space-separated list which is ultimately passed to llvm::Target::createTargetMachine(). This function, however, expects a comma-separated list in which each item is prefixed by a '+' (to enable the feature) or '-' (to disable it). LLVM applies this list as diff against the set of features implicitly enabled by the cpu argument. withTargetMachine should take a Map CPUFeature Bool and convert it to this format.
The LLVM function
llvm::sys::getHostCPUFeatures(StringMap<bool>& Features)
is specified to provideThe current implementation of
getHostCPUFeatures
is of typeIO (Set CPUFeature)
and returns information only on enabled features. It ought to beIO (Map CPUFeature Bool)
so that it can indicate disabled features as well.withTargetMachine
currently takes aSet CPUFeature
argument and at LLVM.General.Internal.Target:80 turns it into a space-separated list which is ultimately passed tollvm::Target::createTargetMachine()
. This function, however, expects a comma-separated list in which each item is prefixed by a '+' (to enable the feature) or '-' (to disable it). LLVM applies this list as diff against the set of features implicitly enabled by thecpu
argument.withTargetMachine
should take aMap CPUFeature Bool
and convert it to this format.