[PATCH] [ARM] Improve build attributes emission

Amara Emerson amara.emerson at arm.com
Thu Oct 3 06:54:16 PDT 2013

  Thanks. I'll make the v6-M fix and add some more tests as requested.

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

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
Richard Barton wrote:
> 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.
You're right about the system extensions. Although since they're now part of the base v6-M architecture, I'll make it the default attribute for all v6-M cores.


More information about the llvm-commits mailing list