Having a generic CPU removes a warning when creating a subtarget without the CPU being explicitly specified.
removes a warning when creating a subtarget without the CPU being explicitly specified
Without this patch llc -mtriple=mips -filetype=obj < cpus.ll shows no error for me. How reproduce the initial problem?
I think we need to explicitly specify a feature set enabled by default. In our case it's FeatureMips32. Otherwise it looks like the "generic" CPU has no features.
Added FeatureMips32 feature.
I came across this while running llvm-exegesis on a mips board, e.g.:
llvm-exegesis -mode latency -snippets-file /dev/null
It gets the 'generic' CPU name with sys::getHostCPUName() and calls createTargetMachine(), which then emits a warning:
'generic' is not a recognized processor for this target (ignoring processor)
Should I add a unittest that recreates this process?
It's possible to run some tests manually but the test mentioned above, which will be part of lit.local.cfg and which checks whether lit can run llvm-exegesis tests on Mips, is encountering a segfault so I'm working on fixing that first.