The SLPVectorizer doesn't skip DebugInfo instructions when computing the spill cost, although these instruction make no difference.
SLP: Spill Cost = 4.
SLP: Extract Cost = 0.
SLP: Total Cost = 2.
SLP: Found cost=2 for VF=2
SLP: Analyzing a store chain of length 2
vs
SLP: Spill Cost = 0.
SLP: Extract Cost = 0.
SLP: Total Cost = -2.
SLP: Found cost=-2 for VF=2
SLP: Decided to vectorize cost=-2
The proposed fix is to skip them.
Fixes PR37261 / rdar://problem/39794738
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.