[PATCH] Default to armv7 cpu for NaCl when march=arm

Renato Golin renato.golin at linaro.org
Tue Mar 24 14:41:35 PDT 2015


The best way to fix this would be to either:

1. Use "armv7-*" as your triple in the first place, or
2. Set the CPU to what you really want, arch will follow, or
3. Get a NaCl toolchain class to do the actual transference

This patch "works" because the driver is dumb enough to go around in circles and pick the CPU from arch, arch from CPU and CPU from arch again, and this is just down in the middle. I believe the two existing hacks should go as soon as possible, and I wouldn't want to include a third one.

cheers,
--renato


================
Comment at: lib/Support/Triple.cpp:1077
@@ -1076,1 +1076,3 @@
     return "cortex-a9";
+  case llvm::Triple::NaCl:
+    if (MArch == "arm")
----------------
This fix is as wrong as the one above. You're trying to set to a random CPU because you want ARMv7, while it'd be much easier if you set "armv7" in the first place.

================
Comment at: lib/Support/Triple.cpp:1078
@@ +1077,3 @@
+  case llvm::Triple::NaCl:
+    if (MArch == "arm")
+      return "cortex-a9";
----------------
That's unnecessary, since this is an ARM-only function.

================
Comment at: lib/Support/Triple.cpp:1079
@@ +1078,3 @@
+    if (MArch == "arm")
+      return "cortex-a9";
+    break;
----------------
And cortex-a9 is not the best choice for almost anything. The base ARMv7 is Cortex-A8, and most NaCl devices will probably be running on Cortex-A15.

http://reviews.llvm.org/D8589

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list