[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

Tony Tye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 13 11:44:47 PDT 2017


t-tye added inline comments.


================
Comment at: lib/CodeGen/CGAtomic.cpp:678
+  auto &Builder = CGF.Builder;
+  auto Scopes = getAllLanguageSyncScopes();
+  llvm::DenseMap<unsigned, llvm::BasicBlock *> BB;
----------------
yaxunl wrote:
> t-tye wrote:
> > Should only the scopes that apply to the language be returned otherwise will be generating code for invalid (possibly duplicate ABI) values?
> getAllLanguageSyncScopes() only returns scope values for current language. I will rename it to getRuntimeSyncScopeValuesForCurrentLanguage() to avoid confusing.
Curretly getAllLanguageSyncScopes does not take a LangOpt so not sure how it knows what the language is, and did not see it checking that the language is OpenCL internally. For non-OpenCL languages do they still have to support system scope?


https://reviews.llvm.org/D36580





More information about the cfe-commits mailing list