[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 8 13:09:31 PDT 2025
================
@@ -188,6 +188,13 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM,
continue;
}
+ // Set UseNativeLowPrecision using dx.nativelowprec module metadata
+ if (auto *NativeLowPrec = mdconst::extract_or_null<ConstantInt>(
+ M.getModuleFlag("dx.nativelowprec")))
+ if (MMDI.DXILVersion >= VersionTuple(1, 2) &&
----------------
farzonl wrote:
So I know the frontend likely has checks to confirm SM 6.2 or greater for this flag. If the backend is dxil-pc-shadermodel6.1 what would happen in a test case like `use-native-low-precision.ll`? Would we just expect to not see `!0 = !{i32 1, !"dx.nativelowprec", i32 1}`?
https://github.com/llvm/llvm-project/pull/134288
More information about the llvm-commits
mailing list