[PATCH] D109441: [FuncSpec] Don't specialise call sites that have the MinSize attribute set

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 12:08:00 PDT 2021


snehasish added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:659
       auto &CS = *cast<CallBase>(U);
+      if (CS.hasFnAttr(Attribute::MinSize))
+        continue;
----------------
If I understand correctly this should only disallow specialization of this callsite as opposed to the function if any callsite is marked minsize. This is aligned with the intent of minsize applied at the callsite. Do we need to add a similar check to rewriteCallSites?


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:669
       // TrackValueOfGlobalVariable only tracks scalar global variables.
-      if (auto *GV = dyn_cast<GlobalVariable>(V)) {
-        if (!GV->getValueType()->isSingleValueType()) {
+      if (auto *GV = dyn_cast<GlobalVariable>(V))
+        if (!GV->getValueType()->isSingleValueType())
----------------
nit: Prefer submitting this unrelated style change as an NFC.


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

https://reviews.llvm.org/D109441



More information about the llvm-commits mailing list