[PATCH] D97673: [RFC] [[Coroutine] [Debug] Salvage dbg.values

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 19:59:47 PDT 2021


ChuanqiXu added a comment.

In D97673#2706798 <https://reviews.llvm.org/D97673#2706798>, @lxfind wrote:

> In D97673#2706610 <https://reviews.llvm.org/D97673#2706610>, @aprantl wrote:
>
>> @lxfind wrote:
>>
>>> Why doesn't replaceUsesOfWith work? Could you double check that replaceUsesOfWith doesn't work for DbgValueInst?
>>
>> This is by design. Metadata-uses of llvm:Value may not affect code generation, thus they also aren't found by any operation working on llvm::Uses.
>
> I don't think so.
> Take a look at this: https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/User.cpp#L34-L37
> I think replaceUsesOfWith works for DbgValueInst.
>
> It's true though that .users() does not include DbgValueInst, but that's a separate question than whether replaceUsesOfWith works.

Good Catcha. It looks like you are right. I have thought `DbgVariablesInst` uses different def-use architecture since users() didn't count DbgValueInst. I should have looked into the details.


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

https://reviews.llvm.org/D97673



More information about the llvm-commits mailing list