[PATCH] D155794: [OpenMP][OpenMPIRBuilder] Migrate setPropertyExecutionMode() from Clang to OpenMPIRBuilder.
Raghu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 21 11:08:46 PDT 2023
raghavendhra marked 2 inline comments as done.
raghavendhra added inline comments.
================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:4914
+ GVMode->setVisibility(llvm::GlobalVariable::ProtectedVisibility);
+ assert(!GVMode->isDeclaration() &&
+ "Only globals with definition can force usage.");
----------------
jplehr wrote:
> Can this assertion ever be not be met? I'm just curious, given that you create that `GVMode` yourself.
Adopted this assert from Clang Codegen addCompilerUsedGlobal() which is called inside setPropertyExecutionMode() in CGOpenMPRuntimeGPU.cpp
Actual definition of addCompilerusedGlobal() in CodeGenModule.cpp
void CodeGenModule::addCompilerUsedGlobal(llvm::GlobalValue *GV) {
assert(!GV->isDeclaration() &&
"Only globals with definition can force usage.");
LLVMCompilerUsed.emplace_back(GV);
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155794/new/
https://reviews.llvm.org/D155794
More information about the cfe-commits
mailing list