[PATCH] D133256: [ARM64EC 14/?] Set comdat for thunks and enable wowthk section to help reduce thunk numbers

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 13 16:54:55 PDT 2022


efriedma added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64Arm64ECCallLowering.cpp:245
+      if (!CB->getParamAttr(i, Attribute::StructRet).isValid())
+        ArgType = CanonicalizeThunkType(ArgType);
+      DefArgTypes.push_back(ArgType);
----------------
What does "canonicalizing" like this accomplish?


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp:89
+    if (const auto *F = dyn_cast<Function>(GO)) {
+      if (F->hasFnAttribute("arm64ec-thunk-type") && F->hasComdat()) {
+        unsigned Flags =
----------------
You shouldn't need to hack at the backend like this.  Just set the section name explicitly in IR, and make the linkage linkonce_odr.  That should put it in the right section with the right attributes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133256/new/

https://reviews.llvm.org/D133256



More information about the llvm-commits mailing list