[PATCH] D48676: [Local] Teach insertReplacementDbgValues basic integer/pointer conversions

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 17:08:11 PDT 2018


aprantl added inline comments.


================
Comment at: test/Transforms/InstCombine/cast-set-preserve-signed-dbg-val.ll:17
+  ; CHECK-NEXT: call void @llvm.dbg.value(metadata i16 [[and]], metadata [[C:![0-9]+]],
+  ; CHECK-SAME:    metadata !DIExpression(DW_OP_constu, 15, DW_OP_shr, DW_OP_constu, 4294967295, DW_OP_mul, DW_OP_stack_value, DW_OP_LLVM_fragment, 16, 16))
+  ;
----------------
vsk wrote:
> aprantl wrote:
> > aprantl wrote:
> > > wouldn't `DW_OP_lit0 DW_OP_not` be shorter than `DW_OP_constu 0xfffffff` ?
> > To keep the IR simple we could also recognize and normalize this sequence in DwarfExpression.cpp
> Sounds good, thanks! I'll save the normalizing change for later.
While you're at it:

DW_OP_constu, 15 could be shortened to DW_OP_lit15 :-)

It should also be more efficient to join the two fragments `<lower> <upper> DW_OP_lit16 DW_OP_shl DW_OP_or`
That saves two DW_OP_LLVM_fragment expressions and one dbg.value.


https://reviews.llvm.org/D48676





More information about the llvm-commits mailing list