aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 2087188..69a119b 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -1542,6 +1542,13 @@ AtomicCmpXchgInst::AtomicCmpXchgInst(Value *Ptr, Value *Cmp, Value *NewVal,
Init(Ptr, Cmp, NewVal, SuccessOrdering, FailureOrdering, SSID);
}
+Align AtomicCmpXchgInst::getAlign() const {
+ // The default here is to assume it has NATURAL alignment, not
+ // DataLayout-specified alignment.
+ const DataLayout &DL = getModule()->getDataLayout();
+ return Align(DL.getTypeStoreSize(getCompareOperand()->getType()));
+}
+
//===----------------------------------------------------------------------===//
// AtomicRMWInst Implementation
//===----------------------------------------------------------------------===//
@@ -1623,6 +1630,13 @@ StringRef AtomicRMWInst::getOperationName(BinOp Op) {
llvm_unreachable("invalid atomicrmw operation");
}
+Align AtomicRMWInst::getAlign() const {
+ // The default here is to assume it has NATURAL alignment, not
+ // DataLayout-specified alignment.
+ const DataLayout &DL = getModule()->getDataLayout();
+ return Align(DL.getTypeStoreSize(getValOperand()->getType()));
+}
+
//===----------------------------------------------------------------------===//
// FenceInst Implementation
//===----------------------------------------------------------------------===//