[PATCH] D46199: [SLPVectorizer] Debug intrinsics shouldn't affect spill cost
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 27 10:47:40 PDT 2018
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2559
+ if ((isa<CallInst>(&*PrevInstIt) &&
+ !isa<DbgInfoIntrinsic>(&*PrevInstIt)) &&
+ &*PrevInstIt != PrevInst) {
----------------
vsk wrote:
> hsaito wrote:
> > If LLVM doesn't have a generic "skip for cost" utility already, I think it's time to start having one. It's very likely that this goes beyond just DbgInfoIntrinsic and functionality would be common to many optimizers. If there is one, we should use that instead.
> >
> I think you're right. Recently an instructionsWithoutDebug() helper method was introduced in BasicBlock, which is a step in the right direction. It would be nice to use that utility here, although that might be better as a follow-up, since the change looks invasive.
Yep I think having such a utility would be great. When adding instructionsWithoutDebug(), I was also prototyping a more generic skipInstructions function, which takes a range iterator and instruction types to skip and returns an iterator that skips over the ignored instructions. I can put it somewhere on phabricator again.
https://reviews.llvm.org/D46199
More information about the llvm-commits
mailing list