Skip to content

Commit 54b1e87

Browse files
committed
Add comment
1 parent 00897b8 commit 54b1e87

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ void clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes(
345345
WaveSizeAttr->getPreferred());
346346
Fn->addFnAttr(WaveSizeKindStr, WaveSizeStr);
347347
}
348+
// HLSL entry functions are materialized for module functions with
349+
// HLSLShaderAttr attribute. SetLLVMFunctionAttributesForDefinition called
350+
// later in the compiler-flow for such module functions is not aware of and
351+
// hence not able to set attributes of the newly materialized entry functions.
352+
// So, set attributes of entry function here, as appropriate.
348353
if (CGM.getCodeGenOpts().OptimizationLevel == 0) {
349354
Fn->addFnAttr(llvm::Attribute::OptimizeNone);
350355
}

0 commit comments

Comments
 (0)