================ @@ -345,6 +345,9 @@ void clang::CodeGen::CGHLSLRuntime::setHLSLEntryAttributes( WaveSizeAttr->getPreferred()); Fn->addFnAttr(WaveSizeKindStr, WaveSizeStr); } + if (CGM.getCodeGenOpts().OptimizationLevel == 0) { + Fn->addFnAttr(llvm::Attribute::OptimizeNone); + } Fn->addFnAttr(llvm::Attribute::NoInline); ---------------- bogner wrote:
Ok. I think a comment to the effect of "We need to manually set attributes here instead of relying on `SetLLVMFunctionAttributesForDefinition` to pick them up since these functions are injected by the compiler and won't go through the normal flow" (please reword as necessary to be accurate...) would be a good idea here. https://github.com/llvm/llvm-project/pull/125937 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits