[PATCH] D106915: Add a DIExpression const-folder to prevent silly expressions

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 2 16:30:50 PDT 2021


aprantl added inline comments.


================
Comment at: llvm/test/DebugInfo/X86/convert-linked.ll:22
   call void @llvm.dbg.value(metadata i8 %x, metadata !13, metadata !DIExpression()), !dbg !14
-  call void @llvm.dbg.value(metadata i8 32, metadata !15, metadata !DIExpression(DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !17
+  call void @llvm.dbg.value(metadata i8 32, metadata !15, metadata !DIExpression(DW_OP_deref, DW_OP_LLVM_convert, 8, DW_ATE_signed, DW_OP_LLVM_convert, 32, DW_ATE_signed, DW_OP_stack_value)), !dbg !17
   ret i8 %x, !dbg !18
----------------
probinson wrote:
> aprantl wrote:
> > This looks wrong: What is a DW_OP_deref of the constant 32 supposed to be?
> It is supposed to be a way to keep the constant folder from firing.  It doesn't "mean" anything.  I can add a comment that says so?
I see. A comment explaining the reason for the strange expression would definitely help someone who needs to maintain the testcase later. Maybe we could even use something more neutral like `DW_OP_lit0 DW_OP_plus` if that also works?


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

https://reviews.llvm.org/D106915



More information about the llvm-commits mailing list