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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 16:42:33 PDT 2018


vsk added inline comments.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:785
+  /// signed nor unsigned.
+  Optional<Signedness> getSignedness() const;
+
----------------
aprantl wrote:
> Why not make an `enum { Unknown, Signed, Unsigned }` ?
It makes it a bit too easy to make this mistake:
```
bool IsUnsigned = T.getSignedness() != Signedness::Signed;
```


================
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))
+  ;
----------------
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.


https://reviews.llvm.org/D48676





More information about the llvm-commits mailing list