[llvm] [ExpandLargeDivRem] Scalarize vector types. (PR #86959)
Bevin Hansson via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 28 07:59:16 PDT 2024
================
@@ -54,8 +54,34 @@ static bool isSigned(unsigned int Opcode) {
return Opcode == Instruction::SDiv || Opcode == Instruction::SRem;
}
+static void scalarize(BinaryOperator *BO,
+ SmallVectorImpl<BinaryOperator *> &Replace) {
+ VectorType *VTy = cast<VectorType>(BO->getType());
+ assert(!VTy->isScalableTy() && "Tried to scalarize scalable vector!");
----------------
bevin-hansson wrote:
The actual expansion routine in IntegerDivision.cpp can't handle them.
```
assert(!Div->getType()->isVectorTy() && "Div over vectors not supported");
```
The best solution would be to teach it how to do it, but I think it gets a bit messy with vectors since there is control flow involved in all of these expansions.
https://github.com/llvm/llvm-project/pull/86959
More information about the llvm-commits
mailing list