This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix RISCVTargetInfo::initFeatureMap, add non-ISA features back after implication
ClosedPublic

Authored by eopXD on Feb 11 2022, 4:42 AM.

Details

Summary

Previously D113336 makes RISCVTargetInfo::initFeatureMap return the results
processed by RISCVISAInfo, which only consists of ISA features and misses
non-ISA features like relax and save-restore.

This patch fixes the problem.

Diff Detail

Event Timeline

eopXD created this revision.Feb 11 2022, 4:42 AM
eopXD requested review of this revision.Feb 11 2022, 4:42 AM
eopXD retitled this revision from [RISCV] Fix RISCVTargetInfo::initFeatureMap, add non-isa features back after implication to [RISCV] Fix RISCVTargetInfo::initFeatureMap, add non-ISA features back after implication.Feb 11 2022, 4:42 AM
eopXD updated this revision to Diff 407852.Feb 11 2022, 5:31 AM

Add testcase.

junparser accepted this revision.Feb 13 2022, 6:16 PM

LGTM, thanks for the fix.

This revision is now accepted and ready to land.Feb 13 2022, 6:16 PM
rogfer01 added inline comments.Feb 14 2022, 8:06 AM
clang/test/Driver/riscv-default-features.c
4 ↗(On Diff #408325)

I think we may be missing are missing a RUN line for this case, right?

eopXD marked an inline comment as done.Feb 21 2022, 7:21 PM
eopXD added inline comments.
clang/test/Driver/riscv-default-features.c
4 ↗(On Diff #408325)

Created patch D120297, thanks!

I just noticed that target features (e.g. -mrelax) are broken in all LLVM 14 releases due to D113336 . This should have been cherry-picked back tot the release branch, but it's too late now. In the future please ensure that important fixes such as this one end up on the release branch as well.

Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 2:30 AM
asb added a comment.EditedNov 30 2022, 2:29 AM

I just noticed that target features (e.g. -mrelax) are broken in all LLVM 14 releases due to D113336 . This should have been cherry-picked back tot the release branch, but it's too late now. In the future please ensure that important fixes such as this one end up on the release branch as well.

Thanks for flagging that this was missed - definitely a collective failure here for us to recognise this was fixing an important bug in a shipping release. We'll try harder to keep in mind the possibility of cherry-picking into point releases in the future.