diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-05-19 10:37:17 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-05-19 12:49:28 -0700 |
commit | 0bebda17bea38785c90a6fec3ca01cf74eb78b7c (patch) | |
tree | e81ee1e5179e0b5302771a997360aaa23df10d52 /llvm/lib/IR/Instructions.cpp | |
parent | 1b25fce404d40c6c6358037104e1e3c3aedb60ef (diff) | |
download | llvm-0bebda17bea38785c90a6fec3ca01cf74eb78b7c.zip llvm-0bebda17bea38785c90a6fec3ca01cf74eb78b7c.tar.gz llvm-0bebda17bea38785c90a6fec3ca01cf74eb78b7c.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 e3691c1..9f099f4 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1609,9 +1609,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!"); } |