- Extend spirv::ConstantOp::getZero/One to handle float, vector of int, and vector of float.
- Refactor ZeroExtendI1Pattern to use getZero/One methods.
- Add one more test for lowering std.zexti which extends vector<4xi1> to vector<4xi64>.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp | ||
---|---|---|
527 | We should generate spv.constant here? Actually for spirv::ConstantOp we have utility methods getZero and getOne, but now it only supports scalar integer. Could you extend those methods to support float and vectors? So we don't need to have this logic duplicated in all patterns needing zero/one (which is quite common). |
Comment Actions
I found that we have special handling for boolean, but I couldn't test it with vector<i1>. I think I can add another pattern to truncate a vector of integer to vector<*xi1> (which is missing) and cover the test there.
We should generate spv.constant here?
Actually for spirv::ConstantOp we have utility methods getZero and getOne, but now it only supports scalar integer. Could you extend those methods to support float and vectors? So we don't need to have this logic duplicated in all patterns needing zero/one (which is quite common).