ArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 23 Jul 2014 22:09:29 +0000 (22:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 23 Jul 2014 22:09:29 +0000 (22:09 +0000)
commitccd1035ad49b552971487c42a1898118071312fa
tree6606e079d927def3bad0d48566c531a5482d9904
parent163a3f95f22035a06b8ba7844af62663ac5155ea
ArgPromo+DebugInfo: Handle updating debug info over multiple applications of argument promotion.

While the subprogram map cache used by Dead Argument Elimination works
there, I made a mistake when reusing it for Argument Promotion in
r212128 because ArgPromo may transform functions more than once whereas
DAE transforms each function only once, removing all the dead arguments
in one go.

To address this, ensure that the map is updated after each argument
promotion.

In retrospect it might be a little wasteful to create a map of all
subprograms when only handling a single CGSCC, but the alternative is
walking the debug info for each function in the CGSCC that gets updated.
It's not clear to me what the right tradeoff is there, but since the
current tradeoff seems to be working OK (and the code to keep things
updated is very cheap), let's stick with that for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213805 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/ArgumentPromotion.cpp
test/Transforms/ArgumentPromotion/dbg.ll