Issue 147733
Summary [SLP] SLP ignores command line options and creates oversized vectors
Labels llvm:SLPVectorizer
Assignees
Reporter ashermancinelli
    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

```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?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to