Page MenuHomePhabricator

[NFC][RISCV] Extract utility to calculate value through MajorVersion and MinorVersion
ClosedPublic

Authored by eopXD on Nov 30 2022, 9:20 AM.

Diff Detail

Event Timeline

eopXD created this revision.Nov 30 2022, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 30 2022, 9:20 AM
eopXD requested review of this revision.Nov 30 2022, 9:20 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 30 2022, 9:20 AM
eopXD added a comment.Nov 30 2022, 9:20 AM

I don't have preference to this, just doing this out of Jessica's comment in D138930.

asb added inline comments.Nov 30 2022, 10:50 AM
llvm/include/llvm/Support/RISCVISAInfo.h
25 ↗(On Diff #478982)

Would this be better as return getVersionValue(MajorVersion, MinorVersion); in order to maximise logic reuse?

Should this live in RISCVISAInfo.h rather than be a Clang-specific thing given it's just for squeezing version info into the preprocessor? I can't think of a use for it outside that at the moment.

eopXD added a comment.Nov 30 2022, 4:30 PM

Should this live in RISCVISAInfo.h rather than be a Clang-specific thing given it's just for squeezing version info into the preprocessor? I can't think of a use for it outside that at the moment.

This patch has the version value calculation in RISCVISAInfo.h, so sorry I don't quite get what you mean. Do you mean specifically __riscv_v_intrinsic macro?

If you mean to have macro information under the RISCVExtensionInfo, I don't see the need here as there are macro like __riscv_v_min_vlen that can be implied by multiple macro-s.

Should this live in RISCVISAInfo.h rather than be a Clang-specific thing given it's just for squeezing version info into the preprocessor? I can't think of a use for it outside that at the moment.

This patch has the version value calculation in RISCVISAInfo.h, so sorry I don't quite get what you mean. Do you mean specifically __riscv_v_intrinsic macro?

If you mean to have macro information under the RISCVExtensionInfo, I don't see the need here as there are macro like __riscv_v_min_vlen that can be implied by multiple macro-s.

I think the suggestion was that it didn’t need to be in RISCVISAInfo.h because it is a never used outside of RISCV.cpp. So it could just be a static function in the cpp file.

eopXD updated this revision to Diff 479175.Nov 30 2022, 11:18 PM

Address comment from Jessica, thanks Craig for explaining.

eopXD marked an inline comment as done.Nov 30 2022, 11:19 PM
eopXD added inline comments.
llvm/include/llvm/Support/RISCVISAInfo.h
25 ↗(On Diff #478982)

Reuse no longer needed here.

eopXD marked an inline comment as done.Dec 5 2022, 5:38 PM

Ping.

This revision is now accepted and ready to land.Dec 5 2022, 6:10 PM