[PATCH] D34874: [ArgPromotion] Remove llvm.dbg.value on removed argument

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 13:46:45 PDT 2017


+debugger cabal, for visibility.

On Mon, Jul 10, 2017 at 1:46 PM David Blaikie <dblaikie at gmail.com> wrote:

> I suspect removing this isn't the right option - changing its value to
> 'undef' (as done in the other review you sent, for arguments that were
> actually promoted/changed their type) is probably best.
>
> Nothing's going to work perfectly here. The user's going to be confused by
> the missing parameter, or the debuggers going to be confused when it tries
> to call the function with this parameter & it doesn't match the ABI
> anymore, etc... - I don't think there's a good answer at the moment.
>
> On Fri, Jun 30, 2017 at 8:27 AM Reid Kleckner via Phabricator via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>> rnk added inline comments.
>>
>>
>> ================
>> Comment at: lib/Transforms/IPO/ArgumentPromotion.cpp:135
>> +
>> +      BasicBlock &BB = F->getEntryBlock();
>> +      SmallVector<Instruction*, 8> InstrsToRemove;
>> ----------------
>> There's no reason to believe the only uses of the argument will appear in
>> the entry block. I think you really want to do
>> `I->replaceAllUsesWith(undef)` to replace all metadata uses of the
>> argument. Some other pass (instcombine?) can clean up the useless dbg.value
>> instructions. That's what the dead argument elimination pass does, anyway.
>>
>>
>> https://reviews.llvm.org/D34874
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170710/67170670/attachment.html>


More information about the llvm-commits mailing list