[PATCH] D70752: LowerDbgDeclare: look through bitcasts.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 16:41:34 PST 2019


eugenis marked 3 inline comments as done.
eugenis added a comment.

I don't have a strong opinion either way, but since we seem to have 2-1 in favor of the worklist I'll leave it as is.
Please let me know if you disagree.

I've updated the test case to include two bitcasts of the same alloca.



================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1448
+          if (BI->getType()->isPointerTy())
+            WorkList.push_back(BI);
+        }
----------------
vsk wrote:
> Yeah, this is also giving up on chasing GEPs. PtrUseVisitor has a facility to follow GEPs and figure out the accumulated offset, so we could try to emit:
> 
> ```
> %a = alloca
> %g = gep %a, 0, 4
> store i32 %val, %g
> ; emit: dbg.value(%val, <var>, DIExpression(OP_LLVM_fragment 32 32))
> ```
> 
> It's certainly a larger change, so I wouldn't be opposed to landing a narrow fix for now, but perhaps that's an interesting future direction.
Agreed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70752





More information about the llvm-commits mailing list