[PATCH] D156545: [DebugInfo][InstrRef] Don't produce over-sized DW_OP_deref_size expressions for very wide stack spills

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 08:51:58 PDT 2023


aprantl added inline comments.


================
Comment at: llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp:1175
+  unsigned ValueSizeInBits = getLocSizeInBits(MLoc);
+  unsigned DerefSizeInBytes = ValueSizeInBits / 8;
+  if (DerefSizeInBytes > PointerSizeBytes) {
----------------
Orlando wrote:
> Can `ValueSizeInBits` ever be a value that doesn't divide cleanly by 8? e.g. 1 from an `i1` type (I haven't looked at how `getLocSizeInBits` works). 
> 
> If so then I think we might need to use `divideCeil` from `MathExtras.h` here. Otherwise, with the code as is, a `1` would result in `DerefSizeInBytes` of `0`.
Would using a PointerSizeInBits instead help?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156545



More information about the llvm-commits mailing list