A pattern to convert spv.CompositeInsert and spv.CompositeExtract.
In LLVM, there are 2 ops that correspond to each instruction depending
on the container type. If the container type is a vector type, then the result of
conversion is llvm.insertelement or llvm.extractelement. If the container
type is an aggregate type (i.e. struct, array), the result of conversion
is llvm.insertvalue or llvm.extractvalue.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp | ||
---|---|---|
242 | Can we split this? THere doesnt seem to much overlap between extract and insert and separate methods might better. | |
251 | If you do a dyn_cast, the value can be null. If you are not checking for the null value, you can just use cast<..> here. | |
260 | Please split these as well. Actually I really dont see a need for these helper functions. You could just do this at the call site itself. | |
267 | Same as above. Just use cast<..> if you are not checking for null value. | |
563 | Similar to other comments above. Might just be cleaner to split this into two patterns. One for insert and other for extract. There is not much to share here. |
Can we split this? THere doesnt seem to much overlap between extract and insert and separate methods might better.