diff options
author | Tim Northover <tnorthover@apple.com> | 2014-07-01 18:53:31 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-07-01 18:53:31 +0000 |
commit | 277066ab432e4214ec64ec636a09f6b0af04186d (patch) | |
tree | af190e663640b37ae8aefd54be13ff9deee18e01 /llvm/lib/Target/X86/X86TargetMachine.cpp | |
parent | 3ed22c4d4ed84fa1965ce9836e787dc216ea03d5 (diff) | |
download | bcm5719-llvm-277066ab432e4214ec64ec636a09f6b0af04186d.tar.gz bcm5719-llvm-277066ab432e4214ec64ec636a09f6b0af04186d.zip |
X86: expand atomics in IR instead of as MachineInstrs.
The logic for expanding atomics that aren't natively supported in
terms of cmpxchg loops is much simpler to express at the IR level. It
also allows the normal optimisations and CodeGen improvements to help
out with atomics, instead of using a limited set of possible
instructions..
rdar://problem/13496295
llvm-svn: 212119
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 74ce31a15d5..f12140f1f16 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -111,6 +111,7 @@ public: return *getX86TargetMachine().getSubtargetImpl(); } + void addIRPasses() override; bool addInstSelector() override; bool addILPOpts() override; bool addPreRegAlloc() override; @@ -123,6 +124,12 @@ TargetPassConfig *X86TargetMachine::createPassConfig(PassManagerBase &PM) { return new X86PassConfig(this, PM); } +void X86PassConfig::addIRPasses() { + addPass(createX86AtomicExpandPass(&getX86TargetMachine())); + + TargetPassConfig::addIRPasses(); +} + bool X86PassConfig::addInstSelector() { // Install an instruction selector. addPass(createX86ISelDag(getX86TargetMachine(), getOptLevel())); |