[PATCH] D48024: [DebugInfo] Check size of variable in ConvertDebugDeclareToDebugValue

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 05:43:19 PDT 2018


bjope updated this revision to Diff 151134.
bjope added a comment.

After some more testing I discovered a case when the added assert in

  void llvm::ConvertDebugDeclareToDebugValue(DbgInfoIntrinsic *DII,
                                             PHINode *APN, DIBuilder &Builder)

failed.

I think it is more correct to use getTypeStoreSizeInBits() instead of getTypeSizeInBits() in valueCoversEntireFragment(), as the store size tells the number of bits that would be overwritten if writing the value to memory (and the dbg.declare that we want to replace describes memory).

So this update is adding a test case that would trigger the assert, and an update in valueCoversEntireFragment() to use the store size.

@adrian: Is this still good?


Repository:
  rL LLVM

https://reviews.llvm.org/D48024

Files:
  include/llvm/IR/IntrinsicInst.h
  lib/IR/IntrinsicInst.cpp
  lib/Transforms/Utils/Local.cpp
  test/Transforms/InstCombine/debuginfo.ll
  test/Transforms/Mem2Reg/debug-alloca-phi-2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48024.151134.patch
Type: text/x-patch
Size: 7207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/1fe8a321/attachment.bin>


More information about the llvm-commits mailing list