Closed zzzDavid closed 2 years ago
First of all, what is "simple value":
This is related to the extended value type in LLVM:
Extended Value Type. Capable of holding value types which are not native for any processor (such as the i12345 type), as well as the types an MVT can represent.
Here, MVT means "machine value type":
Machine Value Type. Every type that is supported natively by some processor targeted by LLVM occurs here. This means that any legal value type can be represented by an MVT.
Simple value type is an enumerate defined here:
https://llvm.org/doxygen/classllvm_1_1MVT.html#a330aea6151cae3adaf5e179dcfe87346
This issue is related to arithmetic dialect's SIToFP
and UIToFP
operations.
When source integer type is not in [1, 8, 16, 32, 64]
, it throws this error.
Therefore, the solution is to extend/truncate the source integer to the same width as float first, and then cast to FP. This is done with a new pass LegalizeCast
Fixed by fd5eabef2c185253971984045f335d13196a7841
Not sure if anyone has bumped into this issue. This happens in
mlir/test_dtype.py::test_dtype_cast
when casting from int to float. A sample IR:The error message:
What is a "simple value"?