[PATCH] D110623: [SLP] Avoid calculating expensive spill cost when it is not required

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 24 14:47:41 PST 2021


dtemirbulatov marked 2 inline comments as done.
dtemirbulatov added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5370-5371
+      CallInst *CI = dyn_cast<CallInst>(&*PrevInstIt);
+      if ((CI && (!isa<DbgInfoIntrinsic>(CI) || !isa<AssumeInst>(CI) ||
+                  !CI->isLifetimeStartOrEnd())) &&
           &*PrevInstIt != PrevInst)
----------------
ABataev wrote:
> There is special function `IntrinsicInst::isAssumeLikeIntrinsic()`, use it here
We already dynamically cast to CallInst and instanceof AssumeInst is way cheaper.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7280
+    CallInst *CI = dyn_cast<CallInst>(I);
+    if (CI && (!isa<DbgInfoIntrinsic>(I) || !isa<AssumeInst>(I) ||
+               !CI->isLifetimeStartOrEnd()))
----------------
ABataev wrote:
> There is special function `IntrinsicInst::isAssumeLikeIntrinsic()`, use it here
We already dynamically cast to CallInst and instanceof to AssumeInst is way cheaper.


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

https://reviews.llvm.org/D110623



More information about the llvm-commits mailing list