Skip to content

Commit 263f6c6

Browse files
stevesuzuki-armalexreinking
authored andcommitted
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 5793e89 commit 263f6c6

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
@@ -5373,23 +5373,7 @@ llvm::Type *CodeGen_LLVM::get_vector_type(llvm::Type *t, int n,
53735373
switch (type_constraint) {
53745374
case VectorTypeConstraint::None:
53755375
if (effective_vscale > 0) {
5376-
bool wide_enough = true;
5377-
// TODO(https://github.com/halide/Halide/issues/8119): Architecture
5378-
// specific code should not go here. Ideally part of this can go
5379-
// away via LLVM fixes and modifying intrinsic selection to handle
5380-
// scalable vs. fixed vectors. Making this method virtual is
5381-
// possibly expensive.
5382-
if (target.arch == Target::ARM) {
5383-
if (!target.has_feature(Target::NoNEON)) {
5384-
// force booleans into bytes. TODO(https://github.com/halide/Halide/issues/8119): figure out a better way to do this.
5385-
int bit_size = std::max((int)t->getScalarSizeInBits(), 8);
5386-
wide_enough = (bit_size * n) > 128;
5387-
} else {
5388-
// TODO(https://github.com/halide/Halide/issues/8119): AArch64 SVE2 support is crashy with scalable vectors of min size 1.
5389-
wide_enough = (n / effective_vscale) > 1;
5390-
}
5391-
}
5392-
scalable = wide_enough && ((n % effective_vscale) == 0);
5376+
scalable = (n % effective_vscale) == 0;
53935377
if (scalable) {
53945378
n = n / effective_vscale;
53955379
}

0 commit comments

Comments
 (0)