Skip to content

Commit 2fe2e7a

Browse files
Modify workaround of using FixedVector for ScalableVector
The workaround of checking wide_enough in get_vector_type() was causing the issue of mixing FixedVector and ScalableVector in generating a intrinsic instruction in SVE2 codegen. By this change, we select scalable vector for most of the cases. Note the workaround for vscale > 1 case will be addressed in a separate commit.
1 parent 2bbdc53 commit 2fe2e7a

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

src/CodeGen_LLVM.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5360,23 +5360,7 @@ llvm::Type *CodeGen_LLVM::get_vector_type(llvm::Type *t, int n,
53605360
switch (type_constraint) {
53615361
case VectorTypeConstraint::None:
53625362
if (effective_vscale > 0) {
5363-
bool wide_enough = true;
5364-
// TODO(https://github.com/halide/Halide/issues/8119): Architecture
5365-
// specific code should not go here. Ideally part of this can go
5366-
// away via LLVM fixes and modifying intrinsic selection to handle
5367-
// scalable vs. fixed vectors. Making this method virtual is
5368-
// possibly expensive.
5369-
if (target.arch == Target::ARM) {
5370-
if (!target.has_feature(Target::NoNEON)) {
5371-
// force booleans into bytes. TODO(https://github.com/halide/Halide/issues/8119): figure out a better way to do this.
5372-
int bit_size = std::max((int)t->getScalarSizeInBits(), 8);
5373-
wide_enough = (bit_size * n) > 128;
5374-
} else {
5375-
// TODO(https://github.com/halide/Halide/issues/8119): AArch64 SVE2 support is crashy with scalable vectors of min size 1.
5376-
wide_enough = (n / effective_vscale) > 1;
5377-
}
5378-
}
5379-
scalable = wide_enough && ((n % effective_vscale) == 0);
5363+
scalable = (n % effective_vscale) == 0;
53805364
if (scalable) {
53815365
n = n / effective_vscale;
53825366
}

0 commit comments

Comments
 (0)