[PATCH] [ARM] Improve build attributes emission

Richard Barton richard.barton.arm at gmail.com
Thu Oct 3 03:46:29 PDT 2013

  Hi Amara

  Apart from the technical nit in the comments above, I don't think your tests give good enough coverage for the changes you made. I would have expected a v7-M and v7-R profile test, and also a Thumb-2 only architecture test (e.g. v7-M.)

  Otherwise, this patch is promising IMO.


Comment at: test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll:63
@@ +62,3 @@
+; CORTEX-M0:  .cpu cortex-m0
+; CORTEX-M0:  .eabi_attribute 6, 6
+; CORTEX-M0:  .eabi_attribute 7, 77
Cortex-M0 is actually v6S-M, so this attribute should have the value 12. v6S-M is v6-M with the System extensions. I don't believe LLVM has any awareness of these extensions, so v6-M is probably the best we can do for Cortex-M* cores right now. 

I think this test is trying to test a Thumb1-only core, so perhaps the best thing to do here would be to test -march=armv6m instead of a Cortex-M CPU.

If the test was trying to test a normal v6 core, then you should try an arm11 core. Given the technical change you need to make, I think that test will be needed anyway.

Comment at: lib/Target/ARM/ARMAsmPrinter.cpp:757
@@ +756,3 @@
+    return ARMBuildAttrs::v7;
+  else if (Subtarget->hasV6T2Ops())
+    return ARMBuildAttrs::v6T2;
It looks like this table will have to also take into account M-Profile to distinguish between v6-M and normal v6 architectures.


More information about the llvm-commits mailing list