[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:
Arthur Eubanks
2021-05-25 12:36:25 -07:00
parent 564eb20e0d
commit 1202f559bd
6 changed files with 39 additions and 5 deletions

View File

@@ -5251,9 +5251,11 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
if (popValue(Record, OpNum, NextValueNo,
getPointerElementFlatType(FullTy), Val))
return error("Invalid record");
FullTy = getPointerElementFlatType(FullTy);
} else {
if (getValueTypePair(Record, OpNum, NextValueNo, Val))
return error("Invalid record");
FullTy = Val->getType();
}
if (!(NumRecords == (OpNum + 4) || NumRecords == (OpNum + 5)))
@@ -5286,7 +5288,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);