diff options
author | Alexander Shaposhnikov <ashaposhnikov@google.com> | 2022-07-25 22:51:25 +0000 |
---|---|---|
committer | Alexander Shaposhnikov <ashaposhnikov@google.com> | 2022-07-25 22:51:25 +0000 |
commit | 1e636f2676fab942e58fac4f814cd8fb5bf3e682 (patch) | |
tree | 63ba953550ecc0a4998c5cfc7c7c0750f2b0e245 /llvm/include | |
parent | 83882606dbd7ffb0bdd3460356202d97705809c8 (diff) | |
download | llvm-1e636f2676fab942e58fac4f814cd8fb5bf3e682.zip llvm-1e636f2676fab942e58fac4f814cd8fb5bf3e682.tar.gz llvm-1e636f2676fab942e58fac4f814cd8fb5bf3e682.tar.bz2 |
[IRBuilder] Add assert for AtomicRMW ordering
Add assert for AtomicRMW: Ordering != AtomicOrdering::Unordered
(https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Verifier.cpp#L3944)
and adjust expandAtomicStore accordingly.
Test plan:
1/ ninja check-llvm check-clang check-lld
2/ Bootstrapped LLVM/Clang pass tests
Differential revision: https://reviews.llvm.org/D130457
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/IR/Instructions.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h index 083fed5..480a559 100644 --- a/llvm/include/llvm/IR/Instructions.h +++ b/llvm/include/llvm/IR/Instructions.h @@ -848,6 +848,8 @@ public: void setOrdering(AtomicOrdering Ordering) { assert(Ordering != AtomicOrdering::NotAtomic && "atomicrmw instructions can only be atomic."); + assert(Ordering != AtomicOrdering::Unordered && + "atomicrmw instructions cannot be unordered."); setSubclassData<AtomicOrderingField>(Ordering); } |