[PATCH] D70752: LowerDbgDeclare: look through bitcasts.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 11:10:43 PST 2019


vsk added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1425
+    SmallVector<const Value *, 8> WorkList;
+    WorkList.push_back(AI);
+    while (!WorkList.empty()) {
----------------
aprantl wrote:
> I think the worklist is overkill here, since it will contain at most one element. How about turning the loop body into a helper function/lambda and calling it recursively?
I think the worklist would contain more than one element in this case:
```
%a = alloca
%c1 = bitcast %a to ...
call void @use(%c1)
%c2 = bitcast %a to ...
call void @use(%c2)
```
That is probably worth a test, though.


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