This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix MachO CPU Subtype inference in llvm::createARMAsmBackend()
ClosedPublic

Authored by vsk on Aug 12 2015, 3:43 PM.

Details

Summary

This patch makes the Darwin ARM backend take advantage of TargetParser.

Previously, Darwin relied on a StringSwitch to convert architecture names to MachO CPU Subtypes. This was brittle and prone to bugs. Using TargetParser makes triple parsing more consistent across LLVM, and eliminates frontend <-> Darwin backend misunderstandings.

This patch also teaches TargetParser about ARMV7K for the first time.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk updated this revision to Diff 31993.Aug 12 2015, 3:43 PM
vsk retitled this revision from to [ARM] Fix MachO CPU Subtype inference in llvm::createARMAsmBackend().
vsk updated this object.
vsk added reviewers: aprantl, rengolin, t.p.northover.
vsk added a subscriber: llvm-commits.
rengolin accepted this revision.Aug 13 2015, 2:46 AM
rengolin edited edge metadata.

With the two comments, LGTM. Thanks!

lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
752 ↗(On Diff #31993)

the king of all nitpicks: too many spaces. :)

test/CodeGen/ARM/MachO-subtypes.ll
56 ↗(On Diff #31993)

Do you guys really use xscale? If not, I'd remove it from here.

Support for those deprecated arches is deprecated, and here only for legacy reasons. :)

This revision is now accepted and ready to land.Aug 13 2015, 2:46 AM
vsk updated this revision to Diff 32063.Aug 13 2015, 8:43 AM
vsk edited edge metadata.
  • Removed extra spaces.
  • Dropped the xscale subtype from the patch.
vsk added a comment.Aug 13 2015, 8:44 AM

Thanks Renato, the two changes you wanted are up. Could you commit this for me?

This revision was automatically updated to reflect the committed changes.