[PATCH] D76146: [DebugInfo] Use DW_OP_LLVM_convert_generic after sign/zero exts

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 08:56:19 PST 2020


dstenb added a comment.

In D76146#2438388 <https://reviews.llvm.org/D76146#2438388>, @mib wrote:

> Hi @dstenb, any update on this ? I tried to look for `DW_OP_LLVM_convert_generic` in the codebase but couldn't find any occurence ... Thanks.

Hi! Sorry for the radio silence here!

I did not land this since this would break sign-extended cases like this:

  intX_t local = (intX_t)signed_val_with_smaller_width;

where `intX_t` is an integer that is wider than the generic type in DWARF. That is, we would incorrectly truncate the value for such cases.

I guess one solution to that would be to be more conservative in adding `DW_OP_LLVM_convert_generic` in the `DIExpression` expressions, and avoid adding that when no operation will be applied on the sign-extended value, but we don't really know if more operations will be added later on when adding the convert expression to `DIExpression`, so I guess we instead would want to insert those generic conversions when appending operations to the `DIExpression`. Another solution could be to postpone the emission of the generic convert operations to `DwarfExpression`, and only do that there when required, as @aprantl suggests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76146/new/

https://reviews.llvm.org/D76146



More information about the llvm-commits mailing list