[llvm] [llvm][ARM][AArch64] Add attributes to synthetic functions. (PR #83153)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 11:16:14 PST 2024


================
@@ -378,6 +380,40 @@ Function *Function::createWithDefaultAttr(FunctionType *Ty,
   }
   if (M->getModuleFlag("function_return_thunk_extern"))
     B.addAttribute(Attribute::FnRetThunkExtern);
+
+  Triple T(M->getTargetTriple());
+
+  auto Profile = llvm::ARM::parseArchProfile(T.getArchName());
+  if ((T.isArmT32() && Profile == llvm::ARM::ProfileKind::M) || T.isAArch64()) {
----------------
nickdesaulniers wrote:

Perhaps you can avoid bringing in Triple.h and ARMTargetParser if we just always check for these attributes (even if they are arch specific?  I guess I'm curious about the M profile check here.  If we ran this on non-m-profile arm32, would the module attributes even ever exist?

https://github.com/llvm/llvm-project/pull/83153


More information about the llvm-commits mailing list