[clang] [llvm] [DirectX] Set Shader Flag DisableOptimizations (PR #126813)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 12 10:21:07 PST 2025
================
@@ -142,6 +145,20 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM) {
// Merge SCCSF with that of F
FunctionFlags[F].merge(SCCSF);
}
+
+ // Set DisableOptimizations flag based on the presence of OptimizeNone
+ // attribute of entry functions.
+ if (MMDI.EntryPropertyVec.size() > 0) {
+ CombinedSFMask.DisableOptimizations =
+ MMDI.EntryPropertyVec[0].Entry->hasFnAttribute(
+ llvm::Attribute::OptimizeNone);
+ // Ensure all entry functions have the same optimization attribute
+ for (auto EF : MMDI.EntryPropertyVec)
----------------
bogner wrote:
Should be `const auto &` or `const EntryProperties &` rather than forcing copies here. Also what is "EF" an abbreviation of? It doesn't seem to have anything to do with what this variable represents. I'd probably call this "Props" or something like that.
https://github.com/llvm/llvm-project/pull/126813
More information about the cfe-commits
mailing list