[PATCH] D140392: [SLP][AArch64] Incorrectly estimated intrinsic as a function call

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 05:21:14 PST 2023


dtemirbulatov added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7313-7318
+          InstructionCost IntrCost =
+              TTI->getIntrinsicInstrCost(ICA, TTI::TCK_RecipThroughput);
+          InstructionCost CallCost = TTI->getCallInstrCost(
+              nullptr, II->getType(), Tys, TTI::TCK_RecipThroughput);
+          if (IntrCost < CallCost)
+            NoCallIntrinsic = true;
----------------
ABataev wrote:
> Do we have a btter way to check if the intrinsic is lowered as an instruction rather than the call?
> ```
> NoCallIntrinsic = IntrCost < CallCost;
> ```
No, it looks to me the only way. We could duplicate the code from getTypeBasedIntrinsicInstrCost() and ask about legality of an operation from a target, but it would be too much to duplicate. Also, we could hardcode minimal call cost, for example 10, but it would look incorrect to me too.


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

https://reviews.llvm.org/D140392



More information about the llvm-commits mailing list