diff options
author | Keith Walker <kwalker@arm.com> | 2016-09-22 14:13:25 +0000 |
---|---|---|
committer | Keith Walker <kwalker@arm.com> | 2016-09-22 14:13:25 +0000 |
commit | ba1598975ffe0a7d4f85845b3e77e60b49e25545 (patch) | |
tree | d9c84bee26ae4490060d485cc539910f7cabaa30 /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | |
parent | 14142bfc72f9e3ab52bd6cc7088b2a2b9cfc1bf0 (diff) | |
download | bcm5719-llvm-ba1598975ffe0a7d4f85845b3e77e60b49e25545.tar.gz bcm5719-llvm-ba1598975ffe0a7d4f85845b3e77e60b49e25545.zip |
Reapplying r281895 (and follow-up r281964) after fixing pr30468.
The additional fix is:
When adding debug information to a lowered phi node in mem2reg
check that we have a valid insertion point after the phi for adding
the debug information.
This change addresses the issue in pr30468 where a lowered phi was
added before a catchswitch and no debug information should be added
after the phi in this case.
Differential Revision: https://reviews.llvm.org/D24797
llvm-svn: 282155
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index cbf385d5633..35faa6f65ef 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -907,6 +907,8 @@ NextIteration: // The currently active variable for this block is now the PHI. IncomingVals[AllocaNo] = APN; + if (DbgDeclareInst *DDI = AllocaDbgDeclares[AllocaNo]) + ConvertDebugDeclareToDebugValue(DDI, APN, DIB); // Get the next phi node. ++PNI; |