diff options
| author | Robin Morisset <morisset@google.com> | 2014-08-21 22:09:25 +0000 |
|---|---|---|
| committer | Robin Morisset <morisset@google.com> | 2014-08-21 22:09:25 +0000 |
| commit | 26b808922b78a1962ed8c8976c95effcea4b5058 (patch) | |
| tree | dfe3dd24b062ee264d11ec486f362e1cd5826e6a | |
| parent | 59c23cd946e6df7bef50e02fa28797469fecd805 (diff) | |
| download | bcm5719-llvm-26b808922b78a1962ed8c8976c95effcea4b5058.tar.gz bcm5719-llvm-26b808922b78a1962ed8c8976c95effcea4b5058.zip | |
Add hooks for emitLeading/TrailingFence
llvm-svn: 216232
| -rw-r--r-- | llvm/include/llvm/Target/TargetLowering.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index 3bcc71b706a..b1cac5a72e4 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/include/llvm/Target/TargetLowering.h @@ -956,6 +956,26 @@ public: llvm_unreachable("Store conditional unimplemented on this target"); } + /// Inserts in the IR a target-specific intrinsic specifying a fence. + /// It is called by AtomicExpandPass before expanding an + /// AtomicRMW/AtomicCmpXchg/AtomicStore/AtomicLoad. + /// RMW and CmpXchg set both IsStore and IsLoad to true. + /// Backends with !getInsertFencesForAtomic() should keep a no-op here + virtual void emitLeadingFence(IRBuilder<> &Builder, AtomicOrdering Ord, + bool IsStore, bool IsLoad) const { + assert(!getInsertFencesForAtomic()); + } + + /// Inserts in the IR a target-specific intrinsic specifying a fence. + /// It is called by AtomicExpandPass after expanding an + /// AtomicRMW/AtomicCmpXchg/AtomicStore/AtomicLoad. + /// RMW and CmpXchg set both IsStore and IsLoad to true. + /// Backends with !getInsertFencesForAtomic() should keep a no-op here + virtual void emitTrailingFence(IRBuilder<> &Builder, AtomicOrdering Ord, + bool IsStore, bool IsLoad) const { + assert(!getInsertFencesForAtomic()); + } + /// Return true if the given (atomic) instruction should be expanded by the /// IR-level AtomicExpand pass into a loop involving /// load-linked/store-conditional pairs. Atomic stores will be expanded in the |

