aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineMemOperand.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-08-20 20:50:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-08-20 20:50:12 +0000
commite6d1592492a3a379186bfb02bd0f4eda0669c0d5 (patch)
tree599ab169a01f1c86eda9adc774edaedde2f2db5b /include/llvm/CodeGen/MachineMemOperand.h
parent1a56a5ead7a2e84bee8240f5f6b033b5f1707154 (diff)
Diffstat (limited to 'include/llvm/CodeGen/MachineMemOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineMemOperand.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/llvm/CodeGen/MachineMemOperand.h b/include/llvm/CodeGen/MachineMemOperand.h
index 078ef7ca510c..65f706302bc2 100644
--- a/include/llvm/CodeGen/MachineMemOperand.h
+++ b/include/llvm/CodeGen/MachineMemOperand.h
@@ -1,9 +1,8 @@
//==- llvm/CodeGen/MachineMemOperand.h - MachineMemOperand class -*- C++ -*-==//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -19,8 +18,6 @@
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
-#include "llvm/IR/Instructions.h"
-#include "llvm/IR/Metadata.h"
#include "llvm/IR/Value.h" // PointerLikeTypeTraits<Value*>
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/DataTypes.h"
@@ -223,6 +220,9 @@ public:
/// Return the size in bytes of the memory reference.
uint64_t getSize() const { return Size; }
+ /// Return the size in bits of the memory reference.
+ uint64_t getSizeInBits() const { return Size * 8; }
+
/// Return the minimum known alignment in bytes of the actual memory
/// reference.
uint64_t getAlignment() const;
@@ -267,13 +267,13 @@ public:
bool isAtomic() const { return getOrdering() != AtomicOrdering::NotAtomic; }
/// Returns true if this memory operation doesn't have any ordering
- /// constraints other than normal aliasing. Volatile and atomic memory
- /// operations can't be reordered.
- ///
- /// Currently, we don't model the difference between volatile and atomic
- /// operations. They should retain their ordering relative to all memory
- /// operations.
- bool isUnordered() const { return !isVolatile(); }
+ /// constraints other than normal aliasing. Volatile and (ordered) atomic
+ /// memory operations can't be reordered.
+ bool isUnordered() const {
+ return (getOrdering() == AtomicOrdering::NotAtomic ||
+ getOrdering() == AtomicOrdering::Unordered) &&
+ !isVolatile();
+ }
/// Update this MachineMemOperand to reflect the alignment of MMO, if it has a
/// greater alignment. This must only be used when the new alignment applies