SPIR-V doesn't have poison, but poison can be converted to undef.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for taking care of this, @Hardcode84!
| mlir/include/mlir/Conversion/Passes.td | ||
|---|---|---|
| 1064 | Nit: 'Converts supported UB ops to SPIR-V dialect ops.' | |
| mlir/lib/Conversion/UBToSPIRV/UBToSPIRV.cpp | ||
| 25 | ||
| 39–41 | Could you define this inline? There no benefit to outlining these matchAndRewirte functions. This may be inconsistent with the older SPIR-V passed, but we converged on in-line definition in newer ones. | |
| 42 | Shouldn't we use the type from the adaptor, or are these the same? Also, if the adaptor is unused, the argument should be unnamed (, OpAdaptor, ) | |
| 62–63 | ||
| mlir/test/Conversion/UBToSPIRV/ub-to-spirv.mlir | ||
| 15–16 | Could you add one test with vector<4xi32> to document how the non-scalar case is handled? | |
| mlir/lib/Conversion/UBToSPIRV/UBToSPIRV.cpp | ||
|---|---|---|
| 42 | I don't see return type on adaptor, and I want to access unconverted type anyway, to avoid converting user types, which can coincidentally also be converted to primitive types. | |
| mlir/lib/Conversion/UBToSPIRV/UBToSPIRV.cpp | ||
|---|---|---|
| 42 | SG, thanks for the explanation | |
| mlir/test/Conversion/UBToSPIRV/ub-to-spirv.mlir | ||
|---|---|---|
| 15–16 | vector is not covered yet (will be rejected by isIntOrIndexOrFloat) | |
| mlir/test/Conversion/UBToSPIRV/ub-to-spirv.mlir | ||
|---|---|---|
| 15–16 | This doesn't prevent us from having a test with a TODO for unsupported types that checks that at least the code doesn't crash | |
Nit: 'Converts supported UB ops to SPIR-V dialect ops.'