This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Use stable_sort in AppendTargetMangling
AbandonedPublic

Authored by BeMg on Aug 30 2023, 12:38 AM.

Details

Summary

For the target features in the same priority, make sure it is not a random mangling name.

Diff Detail

Event Timeline

BeMg created this revision.Aug 30 2023, 12:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 12:38 AM
Herald added a subscriber: mgrang. · View Herald Transcript
BeMg requested review of this revision.Aug 30 2023, 12:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 12:38 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
BeMg retitled this revision from [clang] Use stable_sort in AppendTargetMangling to [Clang] Use stable_sort in AppendTargetMangling.Aug 30 2023, 12:40 AM

Do you have a test-case where they were out of order? Or is that dependent on the C++ library?

I think I just moved this code from elsewhere when I changed it, but it sounds like a sensible change to me.

BeMg added a comment.Sep 1 2023, 9:26 PM

Thanks for the review.

I'm working on RISC-V FMV support, and we found the large set of extension features is hard to maintain the priority that doesn't collision at all.

Lack the appropriate priority, it will generate the random mangling name. The predictable mangling name is convenient for testing.

This goal could also be achieved by giving the serial number for each feature, but I think the stable sort approach is simpler.

ilinpv added a comment.Sep 4 2023, 1:33 AM

I'm working on RISC-V FMV support, and we found the large set of extension features is hard to maintain the priority that doesn't collision at all.

On AArch64 for FMV we are using target_version attribute and AppendTargetVersionMangling with llvm::stable_sort

BeMg abandoned this revision.Sun, Nov 26, 7:57 PM