alloca in function or private address space can be lowered to VariableOp. This allow values in memory if needed.
Details
Diff Detail
Event Timeline
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp | ||
---|---|---|
296–300 | You may have to check if the parent op has the AutomaticAllocationScope trait. When is the stack space for VariableOps reclaimed when they aren't immediately not surrounded by SPIRV functions? (or are they always are?) |
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp | ||
---|---|---|
289 | Is it possible to have std.alloca outside of builtin func? So I think we only have Function storage class case here? | |
296–300 | SPIR-V variable ops outside spv.func (that is, with Private storage class) have the lifetime as the SPIR-V module. But is it possible to have std.alloca outside of builtin func? std.alloca's semantics seem to allow that; I'm wondering whether we will see such cases in reality though. |
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp | ||
---|---|---|
290 | I am not really sure we want to support AllocaOps. The lifetime of the buffers cannot be enforced. So we are potentially breaking that semantics (I dont see a way of deallocating the OpVariable. Maybe some use case info might help |
Is it possible to have std.alloca outside of builtin func? So I think we only have Function storage class case here?