[PATCH] D14471: [AArch64] Fix a crash in driver

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 12 23:50:34 PST 2015


ahatanak added a comment.

> If you can get the CPU name, return it. If not, return "native". If you're on AArch64 and you can't get the CPU name, that's a bug that needs fixing. If it's always "generic", that's another piece of code that needs fixing. If whatever getCPU function you use doesn't return a valid name, and the name chosen was "native", you should return "native".


I'm guessing this is what you are suggesting:

In getAArch64TargetCPU, if it finds out the cpu name passed via -mtune or -mcpu is "native",

1. Call llvm::sys::getHostCPUName to get the host CPU name.
2. Check the host CPU name to see if it is a valid AArch64 CPU. A CPU is valid if it is one of these CPUs: cyclone, cortex-a53, cortex-a57, cortex-a72, or generic (this is the set of CPUs that are valid in DecodeAArch64Mcpu).
3. If the host CPU is valid, return the CPU name. Otherwise, return "native".


http://reviews.llvm.org/D14471





More information about the cfe-commits mailing list