diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2015-10-07 19:29:56 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2015-10-07 19:29:56 +0000 |
commit | 39234fc67e3fbb4320e9000af8f2e0b0bed79d3f (patch) | |
tree | 72b29e8fb09d2df6d0afb5c4a9da38a341176bfc /llvm/lib/CodeGen | |
parent | 15ef5e174b2189231d837576e450b626e5bf730d (diff) | |
download | bcm5719-llvm-39234fc67e3fbb4320e9000af8f2e0b0bed79d3f.tar.gz bcm5719-llvm-39234fc67e3fbb4320e9000af8f2e0b0bed79d3f.zip |
[WinEH] Set NoModuleLevelChanges in clone flags
Summary:
This is necessary to keep the cloner from making bogus copies of debug
metadata attached to the IR it is cloning.
Also, avoid running RemapInstruction over all instructions in the common
case that no cloning was performed.
Reviewers: rnk, andrew.w.kaylor, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13514
llvm-svn: 249591
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/WinEHPrepare.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index 3f930c892e2..ddbe0002411 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -3222,6 +3222,10 @@ void WinEHPrepare::cloneCommonBlocks( Orig2Clone[BB] = CBB; } + // If nothing was cloned, we're done cloning in this funclet. + if (Orig2Clone.empty()) + continue; + // Update our color mappings to reflect that one block has lost a color and // another has gained a color. for (auto &BBMapping : Orig2Clone) { @@ -3235,12 +3239,13 @@ void WinEHPrepare::cloneCommonBlocks( BlockColors[OldBlock].erase(FuncletPadBB); } - // Loop over all of the instructions in the function, fixing up operand + // Loop over all of the instructions in this funclet, fixing up operand // references as we go. This uses VMap to do all the hard work. for (BasicBlock *BB : BlocksInFunclet) // Loop over all instructions, fixing each one as we find it... for (Instruction &I : *BB) - RemapInstruction(&I, VMap, RF_IgnoreMissingEntries); + RemapInstruction(&I, VMap, + RF_IgnoreMissingEntries | RF_NoModuleLevelChanges); // Check to see if SuccBB has PHI nodes. If so, we need to add entries to // the PHI nodes for NewBB now. |