summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-14 15:31:13 +0000
committerTim Northover <tnorthover@apple.com>2014-07-14 15:31:13 +0000
commit6c647eae8b6c334eed00323413d63a16e44413ae (patch)
treeb7dbb69697cec80f756eb041eebfd4f1fd662d47 /llvm/lib/Target/X86
parent4d5e23f53a68937e3108293a5b408f2790b309e8 (diff)
downloadbcm5719-llvm-6c647eae8b6c334eed00323413d63a16e44413ae.tar.gz
bcm5719-llvm-6c647eae8b6c334eed00323413d63a16e44413ae.zip
X86: remove temporary atomicrmw used during lowering.
We construct a temporary "atomicrmw xchg" instruction when lowering atomic stores for widths that aren't supported natively. This isn't on the top-level worklist though, so it won't be removed automatically and we have to do it ourselves once that itself has been lowered. Thanks Saleem for pointing this out! llvm-svn: 212948
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86AtomicExpandPass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86AtomicExpandPass.cpp b/llvm/lib/Target/X86/X86AtomicExpandPass.cpp
index 1637b55b6d3..61eefbbf75b 100644
--- a/llvm/lib/Target/X86/X86AtomicExpandPass.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud