[PATCH] D89838: [DebugInfo] Fix legacy ZExt emission when FromBits >= 64 (PR47927)

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 00:53:49 PDT 2020


markus added a comment.

Some nits below but in general looks good to me.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:658
+    emitUnsigned((1ULL << FromBits) - 1);
+  } else {
+    emitOp(dwarf::DW_OP_lit1);
----------------
I think this is a good middle ground solution. 

Perhaps if one wanted to be more generic and do something about the current inability to encode arbitrarily large constants in the Dwarf expression one could make a generic DwarfExpression method that takes an APInt and encodes it with a  shift and or sequence.


================
Comment at: llvm/test/DebugInfo/X86/legacy-zext.ll:9
+define void @t(i64 %x) !dbg !6 {
+  call void @llvm.dbg.value(metadata i64 %x, metadata !9,
+                            metadata !DIExpression(DW_OP_LLVM_convert, 64, DW_ATE_unsigned,
----------------
I guess it does not matter much for what we want to test here but shouldn't !9 be a 128-bit type for this to make sense?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89838



More information about the llvm-commits mailing list