================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to