This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Arith] Disallow casting between scalable and fixed-length vectors
ClosedPublic

Authored by jsetoain on Feb 11 2022, 11:10 AM.

Details

Summary

Casting between scalable vectors and fixed-length vectors doesn't make
sense. If one of the operands is scalable, the other has to be scalable
to be able to guarantee they have the same shape at runtime.

Diff Detail

Event Timeline

jsetoain created this revision.Feb 11 2022, 11:10 AM
jsetoain requested review of this revision.Feb 11 2022, 11:10 AM
rriddle added inline comments.Feb 11 2022, 11:21 AM
mlir/lib/IR/TypeUtilities.cpp
130–139

Can you just use one for loop here instead of two? Would be less code and more efficient.

131

Can you just use Type directly here instead of these autos? It's the same number of characters and also removes the need for a template lambda.

jsetoain updated this revision to Diff 408451.Feb 14 2022, 9:17 AM

Simplify check code

jsetoain marked 2 inline comments as done.Feb 14 2022, 9:18 AM
jsetoain added inline comments.
mlir/lib/IR/TypeUtilities.cpp
130–139

Something like this?

jsetoain marked an inline comment as done.Feb 14 2022, 9:22 AM
ThomasRaoux accepted this revision.Feb 14 2022, 2:25 PM
This revision is now accepted and ready to land.Feb 14 2022, 2:25 PM