This patch adds checks to the verifier to ensure the dimension arguments
passed to the matrix intrinsics match the vector types for their
arugments/return values.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
4805 | Quick query on this and the semantics: declare vectorty @llvm.matrix.multiply.*(vectorty %A, vectorty %B, i32 <OuterRows>, i32 <Inner>, i32 <OuterColumns>) do we expect the element types of vectors %A and %B to be same, and do we need to check this? |
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
4805 | Yes, the element types of all types must match currently, but I think it is neither checked in the verifier nor explicit in the LangRef. To generate code for llvm.aarch64.neon.udot & co, there probably needs to be a way to have different element type widths for result and source operands. |
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
4805 |
I started looking at the matrix support, getting up to speed with it, and this is where I started and the first thing I noticed. Was just asking about that here as a sanity check. I wouldn't mind putting up a patch for that if that's helpful. Probably the least we can do for not is to check if we are not mixing integers and float types, and then we also need to add that to LangRef and be explicit about that. |
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
4805 |
That would be great. I think things will fall apart/miscompile if the element types differ at the moment. |
llvm/lib/IR/Verifier.cpp | ||
---|---|---|
4805 | cool, will do. FYI: I started with committing a NFC patch adding some more negative tests: rG0fc17e9edc8f |
Quick query on this and the semantics:
do we expect the element types of vectors %A and %B to be same, and do we need to check this?