[PATCH] D34874: [ArgPromotion] Remove llvm.dbg.value on removed argument
Mikael Holmén via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 10 21:49:13 PDT 2017
On 07/10/2017 10:46 PM, David Blaikie 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.
>
Yes I submitted that "other" version where I change it to undef after
Reid's suggestion.
Regards,
Mikael
> 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
> <mailto: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 <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list