This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][ARM][Clang] PerfMon Extension Added
ClosedPublic

Authored by mubashar_ on Jan 6 2022, 8:02 AM.

Details

Summary

Performance monitor architecture extension has been added to clang.

Diff Detail

Event Timeline

mubashar_ created this revision.Jan 6 2022, 8:02 AM
mubashar_ requested review of this revision.Jan 6 2022, 8:02 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 6 2022, 8:02 AM
lenary accepted this revision.Jan 6 2022, 8:12 AM

I'm happy with this patch, but you could update the description to be clearer that you're adding an option to allow PMU v3.4 to be enabled/disabled separately to the architecture - not adding the pmu extension itself.

This revision is now accepted and ready to land.Jan 6 2022, 8:12 AM
Matt added a subscriber: Matt.Jan 7 2022, 7:32 AM
This revision was landed with ongoing or failed builds.Jan 10 2022, 3:28 AM
This revision was automatically updated to reflect the committed changes.

Hmm. This appears to be mapping pmuv3p4 to "perfmon". But "perfmon" has been around a long time, not a new feature related to the pmuv3p4 update. It seems on the AArch64 side to control access to PMCCNTR, i.e. access to the base FEAT_PMUv3.

On the Arm side this is altering how HasV7Ops is define in https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/ARM/ARM.td#L515, which in turn is breaking Cortex-M cpus. It's probably a bug that HasV7Ops includes FeaturePerfMon, it shouldn't be included in HasV8MMainlineOps or ARMv7m if it's reading a system register with an mrc.

mubashar_ updated this revision to Diff 399685.Jan 13 2022, 8:42 AM

The command line option for Clang is now +pmuv3 to enable PerfMon.

lenary reopened this revision.Jan 13 2022, 8:49 AM
This revision is now accepted and ready to land.Jan 13 2022, 8:49 AM
dmgreen accepted this revision.Jan 13 2022, 9:35 AM

LGTM. Thanks for the update.

llvm/include/llvm/Support/AArch64TargetParser.def
130

The formatting is a little off, for the subsequent columns.

mubashar_ updated this revision to Diff 400518.Jan 17 2022, 6:26 AM
mubashar_ marked an inline comment as done.
This revision was landed with ongoing or failed builds.Jan 17 2022, 6:33 AM
This revision was automatically updated to reflect the committed changes.