Cover some of the code paths from LLVMTypeConverter::convertPointerLike
and LLVMTypeConverter::convertSequenceType (specifically related to
whether or not the sequence type has a constant interior).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for adding these! I think that I've identified a couple more cases that are not covered here. Would it make sense to test them as well?
The conversions are not 100% clear to me TBH. For example, !fir.ref<!fir.array<10x?x11xf32>> becomes a plain !llvm.ptr (with no array inside) because the number of rows is unknown, correct?
flang/test/Fir/types-to-llvm.fir | ||
---|---|---|
6–7 | ||
39 | How about fir.box inside fir.ref? https://github.com/llvm/llvm-project/blob/5eb47961c42cef03d832c646860a1eff6f8b4104/flang/lib/Optimizer/CodeGen/TypeConverter.h#L282 | |
55 | There's a switch from column-major to row-major here, right? (hence 11 and 10 are swapped). Might be worth adding a comment. |
- Cover more code paths (dynamic and fixed-length chars, ref<box>).
- Add a comment that we're switching between column-major and row-major, and also modify the first test in the file to show this (was 10x10, is now 10x12 so we can see the difference).
Thanks for the comments, let me know if I missed any other cases :)
How about fir.char? https://github.com/llvm/llvm-project/blob/5eb47961c42cef03d832c646860a1eff6f8b4104/flang/lib/Optimizer/CodeGen/TypeConverter.h#L291