diff options
author | Fangrui Song <maskray@google.com> | 2019-04-14 06:27:07 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-14 06:27:07 +0000 |
commit | f42990e687427005402d17e13931b1518f4e0e9c (patch) | |
tree | c329ee9d16fadadb2a6850cb8f995586107fca09 /llvm/lib/Transforms | |
parent | 8f9bb2250b099a1c1bdf2532ed07511b267216c3 (diff) | |
download | bcm5719-llvm-f42990e687427005402d17e13931b1518f4e0e9c.tar.gz bcm5719-llvm-f42990e687427005402d17e13931b1518f4e0e9c.zip |
[Mem2Reg] Don't call LBI.deleteValue on AllocInst/DbgVariableIntrinsic
Only StoreInst/LoadInst are assigned numbers. Other types of instructions are not in LBI.
llvm-svn: 358350
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp index 28462e8c8b6..bdf1c209d59 100644 --- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -421,14 +421,12 @@ static bool rewriteSingleStoreAlloca(AllocaInst *AI, AllocaInfo &Info, DIBuilder DIB(*AI->getModule(), /*AllowUnresolved*/ false); ConvertDebugDeclareToDebugValue(DII, Info.OnlyStore, DIB); DII->eraseFromParent(); - LBI.deleteValue(DII); } // Remove the (now dead) store and alloca. Info.OnlyStore->eraseFromParent(); LBI.deleteValue(Info.OnlyStore); AI->eraseFromParent(); - LBI.deleteValue(AI); return true; } @@ -526,13 +524,10 @@ static bool promoteSingleBlockAlloca(AllocaInst *AI, const AllocaInfo &Info, } AI->eraseFromParent(); - LBI.deleteValue(AI); // The alloca's debuginfo can be removed as well. - for (DbgVariableIntrinsic *DII : Info.DbgDeclares) { + for (DbgVariableIntrinsic *DII : Info.DbgDeclares) DII->eraseFromParent(); - LBI.deleteValue(DII); - } ++NumLocalPromoted; return true; |