This is an archive of the discontinued LLVM Phabricator instance.

[MC][AArch64] Enable '+v8a' when nothing specified for MCSubtargetInfo
ClosedPublic

Authored by oToToT on Apr 23 2022, 12:04 AM.

Details

Summary

Since D110065, the 'R' profile support is added to LLVM. It turns the
generic cpu into the intersection of v8-a and v8-r. However, this
makes some backward compatibility problems. The original patch makes
the clang driver implicitly pass -march=armv8-a when only the triple
is specified. Since it only applies to clang, other tools like
llvm-objdump still faces the backward compatibility problem.

This patch applies the same idea to MC related tools by enabling '+v8a'
feature when nothing is specified (both CPU and FS are empty) for
MCSubtargetInfo creation.

This patch should fix PR53956.

Diff Detail

Event Timeline

oToToT created this revision.Apr 23 2022, 12:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2022, 12:04 AM
oToToT requested review of this revision.Apr 23 2022, 12:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2022, 12:04 AM
labrinea added a comment.EditedApr 27 2022, 5:40 AM

I think it's good. The tests suggest that when the -mattr string is not empty then +v8a has to be explicitely specified. Is this good enough for https://github.com/llvm/llvm-project/issues/53956 or do we want to check whether FS contains +v8r?

oToToT added a comment.EditedApr 27 2022, 9:42 AM

Is this good enough for https://github.com/llvm/llvm-project/issues/53956 or do we want to check whether FS contains +v8r?

This is good enough for PR53956. With this patch, llvm-objdump can decompile v8a instruction correctly with default arguments.
Also, I think we don't need to check about '+v8r' since if FS contains '+v8r' or anything else, we will simply pass it to the function below without overriding it.

oToToT updated this revision to Diff 425545.Apr 27 2022, 9:45 AM
oToToT edited the summary of this revision. (Show Details)

Fix typo

labrinea accepted this revision.Apr 28 2022, 12:02 PM

Okay then, looks good.

This revision is now accepted and ready to land.Apr 28 2022, 12:02 PM
This revision was landed with ongoing or failed builds.Apr 28 2022, 1:54 PM
This revision was automatically updated to reflect the committed changes.