[PATCH] D41697: [DebugInfo][Metadata] Add support for a DIExpression as 'count' field of DISubrange.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 3 15:15:03 PST 2018
aprantl added a comment.
If we are going down this route,
In https://reviews.llvm.org/D41697#967047, @sdesmalen wrote:
> Hi @aprantl, the reason for extending the count field with DIExpression was originally to express the size of an SVE vector, which is expressed as a scaling of a Dwarf pseudo register that represents the size of a vector with so-called 'Vector Granules'. This pseudo register is detailed in section 3.1 of the DWARF for the ARM® 64-bit Architecture (AArch64) with SVE support Documentation (https://developer.arm.com/docs/100985/0000).
How are you planning to reference the pseudo-register? By generating a pseudo-DIVariable and putting it into the DISubrange(count: ), or were you intending to hard-code a DW_OP_reg46 in the DIExpression?
> There may also be reasons to combine a DIVariable with a DIExpression, but that's not required for C99 VLAs. I think it would be needed for Fortran arrays to e.g. access a field of an array descriptor object, but I'm not sure if something as advanced is required like you propose here (perhaps something similar to DIGlobalVariableExpression that combines a DI(Local)Variable and a DIExpression would be sufficient?). Do you have any other use-case in mind that would require something like that?
The use-case I had in mind was for describing generic Swift type metadata in optimized code where it might be useful to combine two variables in the same expression.
More information about the llvm-commits