================
@@ -2749,6 +2749,15 @@ void 
CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
       B.addAttribute("aarch64_new_zt0");
   }
 
+  // Handle flatten_deep attribute for depth-based inlining
+  if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
+    if (const FlattenDeepAttr *FDA = FD->getAttr<FlattenDeepAttr>()) {
+      // Add the flatten_deep attribute with the max depth value as a typed int
+      // attribute
+      B.addRawIntAttr(llvm::Attribute::FlattenDeep, FDA->getMaxDepth());
----------------
yuxuanchen1997 wrote:

`addRawIntAttr` doesn't seem to be widely used outside of 
`llvm/IR/Attributes.cpp`. Can you not use `addFlattenDeepAttr`?

https://github.com/llvm/llvm-project/pull/165777
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to