1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

[opaque pointer types] Serialize the value type for atomic store instructions

Without pointee types the space optimization of storing only the pointer
type and not the value type won't be viable - so add the extra type
information that would be missing.

llvm-svn: 235475
This commit is contained in:
David Blaikie 2015-04-22 04:14:46 +00:00
parent 253de8b56b
commit df921652b4
2 changed files with 10 additions and 5 deletions

View File

@ -345,10 +345,11 @@ namespace bitc {
FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...] FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol, FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
// ordering, synchscope] // ordering, synchscope]
FUNC_CODE_INST_STOREATOMIC = 42, // STORE: [ptrty,ptr,val, align, vol FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
// ordering, synchscope] // ordering, synchscope]
FUNC_CODE_INST_GEP = 43, // GEP: [inbounds, n x operands] FUNC_CODE_INST_GEP = 43, // GEP: [inbounds, n x operands]
FUNC_CODE_INST_STORE = 44, // STORE: [ptrty,ptr,valty,val, align, vol] FUNC_CODE_INST_STORE = 44, // STORE: [ptrty,ptr,valty,val, align, vol]
FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
}; };
enum UseListCodes { enum UseListCodes {

View File

@ -4067,14 +4067,18 @@ std::error_code BitcodeReader::ParseFunctionBody(Function *F) {
InstructionList.push_back(I); InstructionList.push_back(I);
break; break;
} }
case bitc::FUNC_CODE_INST_STOREATOMIC: { case bitc::FUNC_CODE_INST_STOREATOMIC:
case bitc::FUNC_CODE_INST_STOREATOMIC_OLD: {
// STOREATOMIC: [ptrty, ptr, val, align, vol, ordering, synchscope] // STOREATOMIC: [ptrty, ptr, val, align, vol, ordering, synchscope]
unsigned OpNum = 0; unsigned OpNum = 0;
Value *Val, *Ptr; Value *Val, *Ptr;
if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) || if (getValueTypePair(Record, OpNum, NextValueNo, Ptr) ||
popValue(Record, OpNum, NextValueNo, (BitCode == bitc::FUNC_CODE_INST_STOREATOMIC
cast<PointerType>(Ptr->getType())->getElementType(), Val) || ? getValueTypePair(Record, OpNum, NextValueNo, Val)
OpNum+4 != Record.size()) : popValue(Record, OpNum, NextValueNo,
cast<PointerType>(Ptr->getType())->getElementType(),
Val)) ||
OpNum + 4 != Record.size())
return Error("Invalid record"); return Error("Invalid record");
AtomicOrdering Ordering = GetDecodedOrdering(Record[OpNum+2]); AtomicOrdering Ordering = GetDecodedOrdering(Record[OpNum+2]);