[Power] Use AtomicExpandPass for fence insertion, and use lwsync where appropriate
authorRobin Morisset <morisset@google.com>
Tue, 23 Sep 2014 20:46:49 +0000 (20:46 +0000)
committerRobin Morisset <morisset@google.com>
Tue, 23 Sep 2014 20:46:49 +0000 (20:46 +0000)
commit58bca6e8ec2ab4a2ba1b1981401a76f54a84e6b2
treee43bdcb9c04cae558352ee8f734c8676f660e019
parentfd4c3c983ef77518dc660e9fe779c5497f591878
[Power] Use AtomicExpandPass for fence insertion, and use lwsync where appropriate

Summary:
This patch makes use of AtomicExpandPass in Power for inserting fences around
atomic as part of an effort to remove fence insertion from SelectionDAGBuilder.
As a big bonus, it lets us use sync 1 (lightweight sync, often used by the mnemonic
lwsync) instead of sync 0 (heavyweight sync) in many cases.

I also added a test, as there was no test for the barriers emitted by the Power
backend for atomic loads and stores.

Test Plan: new test + make check-all

Reviewers: jfb

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5180

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218331 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/IntrinsicsPowerPC.td
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/PowerPC/PPCTargetMachine.cpp
test/CodeGen/PowerPC/atomics.ll [new file with mode: 0644]