Added support to the Std dialect cast operations to do casts in vector types when feasible.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
---|---|---|
224 | Doc comment please (triple /). Please describe what the method referring to its args. | |
2340–2345 | All of these changes would be inconsistent with the current documentation / spec of these ops. See Ops.td file - those have to be updated first if the semantics indeed changed. For eg. UIToFP's doc comment says: let description = [{ Cast from a value interpreted as unsigned integer to the corresponding floating-point value. If the value cannot be exactly represented, it is rounded using the default rounding mode. Only scalars are currently supported. }]; We can't change the behavior while having the spec/doc to the contrary. | |
2422 | Comment would be outdated. |
I find the commit summary and the title a bit confusing. Isn't this extending standard dialect cast ops to work with vectors of those types? It's not that vector types are being cast to int/fp.
There are operations that support casting for vector types, but the code was missing. The necessary code and tests were added.
Please rephrase. Those operations existed in the LLVM dialect not in std dialect.
The test cases for a key change to a std dialect op's semantics should reside in the std dialect's test cases, and not just in the LLVM dialect ones.
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td | ||
---|---|---|
2433–2437 | Nit: Reflow. Please use the whole width. | |
3116–3118 | Likewise. |
Rewritten the title and the summary as well.
The tests are in the StandardToLLVM directory (as the rest of the similar conversion tests). This is not part of the LLVM? Or maybe I am wrong?
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td | ||
---|---|---|
2433–2437 | Fixed. Using no more than 80 characters. | |
3116–3118 | Fixed. Using no more than 80 characters. | |
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
221 | Fixed. | |
225 | Rewritten. | |
226–228 | Rewritten. |
Nit: Reflow. Please use the whole width.