[PATCH] D62904: [DebugInfo] Honour variable fragments in LiveDebugValues

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 16:11:05 PDT 2019


aprantl added a comment.

> It's my belief that that's how SROA works, but I don't think it's a documented guarantee. SROA::splitAlloca certainly seems to completely rewrite dbg.declare's into ones that all use fragments. The verifier doesn't attempt to enforce this rule though.

Please note that SROA is not the only producer of DW_OP_LLVM_fragments. The Swift frontend, for example, can produce fragments from the point where LLVM IR is generated long before LLVM's SROA is invoked. If a condition is not enforced by the Verifier it is not generally safe to rely on it because LLVM IR is generated by many producers, not just Clang.



================
Comment at: include/llvm/IR/DebugInfoMetadata.h:2579
+  static unsigned getHashValue(const FragInfo &Frag) {
+    return hash_value(std::make_pair(Frag.SizeInBits, Frag.OffsetInBits));
+  }
----------------
`(Frag.SizeInBits & 0xffff) << 16 | (Frag.OffsetInBits & 0xffff)` should be a practically perfect hash function.


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

https://reviews.llvm.org/D62904





More information about the llvm-commits mailing list