This is an archive of the discontinued LLVM Phabricator instance.

[Target] use getSubtarget<> instead of static_cast<>(getSubtarget())
ClosedPublic

Authored by Ghost-LZW on May 11 2022, 8:14 AM.

Diff Detail

Event Timeline

Ghost-LZW created this revision.May 11 2022, 8:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2022, 8:14 AM
Ghost-LZW requested review of this revision.May 11 2022, 8:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2022, 8:14 AM
Ghost-LZW updated this revision to Diff 428684.May 11 2022, 8:52 AM

apply git-clang-format

myhsu accepted this revision.May 11 2022, 2:42 PM

Looks good on m68k changes

This revision is now accepted and ready to land.May 11 2022, 2:42 PM
zixuan-wu edited reviewers, added: zixuan-wu; removed: Zeson.May 12 2022, 1:06 AM
zixuan-wu added inline comments.May 12 2022, 1:09 AM
llvm/include/llvm/CodeGen/SelectionDAG.h
455

As we don't prefer to use static_cast, then why not delete original getSubtarget. Or it can't replace all places with template one?

Ghost-LZW added inline comments.May 12 2022, 2:59 AM
llvm/include/llvm/CodeGen/SelectionDAG.h
455

Somewhere may just need the abstract sub-target, so we need to keep the original getSubtarget. The MF->getSubtarget<> did the static_cast in fact, so we don't want static_cast the abstract sub-target into himself.

kparzysz accepted this revision.May 17 2022, 10:44 AM

Please note that I do not have commit rights.

Ping and Please note that I do not have commit rights.

myhsu added a comment.May 24 2022, 9:19 AM

Ping and Please note that I do not have commit rights.

I can help you with that. Please make sure the patch here has been rebased to tip-of-tree and please provide the name and email you would like to use in the commit.

Ghost-LZW updated this revision to Diff 431988.May 25 2022, 7:29 AM

rebase to top of tree

Ping and Please note that I do not have commit rights.

I can help you with that. Please make sure the patch here has been rebased to tip-of-tree and please provide the name and email you would like to use in the commit.

Thank you. Rebase is done, and Zongwei Lan <lanzongwei541@gmail.com> is fine.

Ghost-LZW updated this revision to Diff 431999.May 25 2022, 8:02 AM

rebase again

This revision was landed with ongoing or failed builds.May 26 2022, 11:24 AM
This revision was automatically updated to reflect the committed changes.