Having a generic CPU removes a warning when creating a subtarget without the CPU being explicitly specified.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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?
llvm/lib/Target/Mips/Mips.td | ||
---|---|---|
235 | 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?
Is it possible already to add any useful test case to the llvm/test/tools/llvm-exegesis/Mips? If so, let's add. Otherwise changes in the cpus.ll are good enough.
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.
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.