]> granicus.if.org Git - llvm/commit
[ArgumentPromotion] Change use of removed argument in llvm.dbg.value to undef
authorMikael Holmen <mikael.holmen@ericsson.com>
Mon, 10 Jul 2017 06:07:24 +0000 (06:07 +0000)
committerMikael Holmen <mikael.holmen@ericsson.com>
Mon, 10 Jul 2017 06:07:24 +0000 (06:07 +0000)
commit3c7da1cd618079ac67530580f295a46488f5a925
tree6796cf23dc0c874cf8f72002e3bdbdca04fa3f6c
parentd76565ff5faab6c38a56664223b493603c71bd56
[ArgumentPromotion] Change use of removed argument in llvm.dbg.value to undef

Summary:
This solves PR33641.

When removing a dead argument we must also handle possibly existing calls
to llvm.dbg.value that use the removed argument. Now we change the use
of the otherwise dead argument to an undef for some other pass to cleanup
later.

If the calls are left untouched, they will later on cause errors:
 "function-local metadata used in wrong function"
since the ArgumentPromotion rewrites the code by creating a new function
with the wanted signature, but the metadata is not recreated so the new
function may then erroneously use metadata from the old function.

Reviewers: mstorsjo, rnk, arsenm

Reviewed By: rnk

Subscribers: wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D34874

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307521 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/ArgumentPromotion.cpp
test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll [new file with mode: 0644]