Open
Description
The SLP vectorizer is creating vectors that exceed the maximum register size specified by -slp-max-reg-size
, the "prefer-vector-width"="N"
metadata, and the -force-vector-width=N
command line option.
https://godbolt.org/z/KMj67594P
I see a few checks like this in SLPVectorizer.cpp
// Lines 1804-1809
if (MaxVectorRegSizeOption.getNumOccurrences())
MaxVecRegSize = MaxVectorRegSizeOption;
else
MaxVecRegSize =
TTI->getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector)
.getFixedValue();
// Line 2072
unsigned getMaximumVF(unsigned ElemWidth, unsigned Opcode) const {
unsigned MaxVF = MaxVFOption.getNumOccurrences() ?
MaxVFOption : TTI->getMaximumVF(ElemWidth, Opcode);
return MaxVF ? MaxVF : UINT_MAX;
}
Is this expected behavior? Is there another way to force slp to use a given max vector width?