[PATCH] D125555: [clang] Add __has_target_feature

2022-05-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/LanguageExtensions.rst:260 +``__has_target_feature`` + yaxunl wrote: > aaron.ballman wrote: > > The first question that comes to mind for me is: why is `__has_feature` not > >

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > yaxunl wrote: > >

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Oops. forgot to hit 'submit' last week, so there's some overlap with Aaron's question. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); ---

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > aaron.ballman wrot

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:260 +``__has_target_feature`` + aaron.ballman wrote: > The first question that comes to mind for me is: why is `__has_fe

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. It's not clear to me why existing facilities shouldn't be extended to cover this case rather than coming up with another feature testing macro. There's already plenty of confusion for users to decide between `__has_feature` and `__has_extension`, and now we're tal

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); tra wrote: > Do you have a better

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); Do you have a better example? This particular case could've been handled by e

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 429265. yaxunl added a comment. fix typo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12/new/ https://reviews.llvm.org/D12 Files: clang/docs/LanguageExtensions.rst clang/docs/ReleaseNotes.rst clang/include/clang/Lex/Preprocessor.h c

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rsmith, aaron.ballman, tra. Herald added a project: All. yaxunl requested review of this revision. Depending on whether a target feature is enabled or not, programs may choose different algorithm or different builtin functions to use. Instead