[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
This commit is contained in:
@@ -5231,15 +5231,18 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
||||
unsigned OpNum = 0;
|
||||
|
||||
Value *Ptr = nullptr;
|
||||
if (getValueTypePair(Record, OpNum, NextValueNo, Ptr, &FullTy))
|
||||
if (getValueTypePair(Record, OpNum, NextValueNo, Ptr))
|
||||
return error("Invalid record");
|
||||
|
||||
if (!isa<PointerType>(Ptr->getType()))
|
||||
return error("Invalid record");
|
||||
|
||||
Value *Val = nullptr;
|
||||
if (popValue(Record, OpNum, NextValueNo,
|
||||
getPointerElementFlatType(FullTy), Val))
|
||||
if (popValue(Record, OpNum, NextValueNo, nullptr, Val))
|
||||
return error("Invalid record");
|
||||
|
||||
if (!cast<PointerType>(Ptr->getType())
|
||||
->isOpaqueOrPointeeTypeMatches(Val->getType()))
|
||||
return error("Invalid record");
|
||||
|
||||
if (!(NumRecords == (OpNum + 4) || NumRecords == (OpNum + 5)))
|
||||
@@ -5272,7 +5275,6 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
||||
Align(TheModule->getDataLayout().getTypeStoreSize(Val->getType()));
|
||||
|
||||
I = new AtomicRMWInst(Operation, Ptr, Val, *Alignment, Ordering, SSID);
|
||||
FullTy = getPointerElementFlatType(FullTy);
|
||||
cast<AtomicRMWInst>(I)->setVolatile(IsVol);
|
||||
|
||||
InstructionList.push_back(I);
|
||||
|
||||
Reference in New Issue
Block a user