diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-05-25 12:36:25 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-05-25 20:16:21 -0700 |
commit | 1202f559bdeebb62dbba29ee05ffafbfecd57d92 (patch) | |
tree | ba5ae3ef0ca5e0561342082bedebd678bd0aa97e /llvm/lib/IR/Instructions.cpp | |
parent | 564eb20e0deecd173a7b990dcfd0e57fb045c522 (diff) | |
download | llvm-1202f559bdeebb62dbba29ee05ffafbfecd57d92.zip llvm-1202f559bdeebb62dbba29ee05ffafbfecd57d92.tar.gz llvm-1202f559bdeebb62dbba29ee05ffafbfecd57d92.tar.bz2 |
[OpaquePtr] Make atomicrmw work with opaque pointers
FullTy is only necessary when we need to figure out what type an
instruction works with given a pointer's pointee type. However, we just
end up using the value operand's type, so FullTy isn't necessary.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D102788
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 08f9e8e..f1df500 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1602,9 +1602,9 @@ void AtomicRMWInst::Init(BinOp Operation, Value *Ptr, Value *Val, "All operands must be non-null!"); assert(getOperand(0)->getType()->isPointerTy() && "Ptr must have pointer type!"); - assert(getOperand(1)->getType() == - cast<PointerType>(getOperand(0)->getType())->getElementType() - && "Ptr must be a pointer to Val type!"); + assert(cast<PointerType>(getOperand(0)->getType()) + ->isOpaqueOrPointeeTypeMatches(getOperand(1)->getType()) && + "Ptr must be a pointer to Val type!"); assert(Ordering != AtomicOrdering::NotAtomic && "AtomicRMW instructions must be atomic!"); } |