This is an archive of the discontinued LLVM Phabricator instance.

Don't attempt to create vectors with complex element types.
ClosedPublic

Authored by jreiffers on Jan 12 2023, 12:55 AM.

Diff Detail

Event Timeline

jreiffers created this revision.Jan 12 2023, 12:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
jreiffers requested review of this revision.Jan 12 2023, 12:55 AM
pifon2a accepted this revision.Jan 12 2023, 12:56 AM
This revision is now accepted and ready to land.Jan 12 2023, 12:56 AM
This revision was landed with ongoing or failed builds.Jan 12 2023, 1:00 AM
This revision was automatically updated to reflect the committed changes.
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
48

getLegalVectorType / getValidVectorType plz, otherwise it's unclear why you're duplicating standard infra.

900

auto maybeReadType = ...

followed by

auto readType = *maybeReadType

and avoid propagating the FailureOr / ptr changes forward plz.

1220

This is a second different way of doing the same thing, please make it uniform and single entry point.
Either use the new method you introduced everywhere or use this.

Actually using this check everywhere is less footprint, so please just:

if (!VectorType::isValidElementType(a) || !VectorType::isValidElementType(b) ... )
  return failure();

everywhere plz and drop the getVectorType altogether.

The whole PR should be 5-10 lines of change.

Please address my comments as post-commit

Thanks for the contribution! It would be great to give more time for other reviewers to chime in. Do you plan to create a new diff for this?