Skip to content

Commit 0e8b7fa

Browse files
committed
Add a comment describing the purpose of the NativeHalfType conditional
1 parent 09864cf commit 0e8b7fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ void CGHLSLRuntime::finishCodeGen() {
287287
Triple T(M.getTargetTriple());
288288
if (T.getArch() == Triple::ArchType::dxil)
289289
addDxilValVersion(TargetOpts.DxilValidatorVersion, M);
290+
291+
// NativeHalfType corresponds to the -fnative-half-type clang option which is
292+
// aliased by clang-dxc's -enable-16bit-types option. This option is used to
293+
// set the UseNativeLowPrecision DXIL module flag in the DirectX backend
290294
if (LangOpts.NativeHalfType)
291295
M.setModuleFlag(llvm::Module::ModFlagBehavior::Error, "dx.nativelowprec",
292296
1);

0 commit comments

Comments
 (0)