X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTarget%2FX86%2FX86AtomicExpandPass.cpp;h=61eefbbf75b19f090d5feee2c9267d295d56dc94;hp=1637b55b6d353e98946979d862a214c962a95817;hb=9e251d6d41beae57d4f5d6a13f50e3d35b292541;hpb=52a51e197f5c6929ad57a329a90947154e6fcac1 diff --git a/lib/Target/X86/X86AtomicExpandPass.cpp b/lib/Target/X86/X86AtomicExpandPass.cpp index 1637b55b6d3..61eefbbf75b 100644 --- a/lib/Target/X86/X86AtomicExpandPass.cpp +++ b/lib/Target/X86/X86AtomicExpandPass.cpp @@ -277,8 +277,11 @@ bool X86AtomicExpandPass::expandAtomicStore(StoreInst *SI) { SI->getValueOperand(), Order); // Now we have an appropriate swap instruction, lower it as usual. - if (shouldExpandAtomicRMW(AI)) - return expandAtomicRMW(AI); + if (shouldExpandAtomicRMW(AI)) { + expandAtomicRMW(AI); + AI->eraseFromParent(); + return true; + } return AI; }