[NFC] Adding the align attribute on Atomic{CmpXchg|RMW}Inst
This is the first step to add support for the align attribute to AtomicRMWInst and AtomicCmpXchgInst. Next step is to add support in IRBuilder and BitcodeReader. Bug: https://bugs.llvm.org/show_bug.cgi?id=27168 Differential Revision: https://reviews.llvm.org/D83136
This commit is contained in:
@@ -5020,8 +5020,10 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
||||
else
|
||||
FailureOrdering = getDecodedOrdering(Record[OpNum + 3]);
|
||||
|
||||
I = new AtomicCmpXchgInst(Ptr, Cmp, New, SuccessOrdering, FailureOrdering,
|
||||
SSID);
|
||||
Align Alignment(
|
||||
TheModule->getDataLayout().getTypeStoreSize(Cmp->getType()));
|
||||
I = new AtomicCmpXchgInst(Ptr, Cmp, New, Alignment, SuccessOrdering,
|
||||
FailureOrdering, SSID);
|
||||
FullTy = StructType::get(Context, {FullTy, Type::getInt1Ty(Context)});
|
||||
cast<AtomicCmpXchgInst>(I)->setVolatile(Record[OpNum]);
|
||||
|
||||
@@ -5058,7 +5060,9 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
|
||||
Ordering == AtomicOrdering::Unordered)
|
||||
return error("Invalid record");
|
||||
SyncScope::ID SSID = getDecodedSyncScopeID(Record[OpNum + 3]);
|
||||
I = new AtomicRMWInst(Operation, Ptr, Val, Ordering, SSID);
|
||||
Align Alignment(
|
||||
TheModule->getDataLayout().getTypeStoreSize(Val->getType()));
|
||||
I = new AtomicRMWInst(Operation, Ptr, Val, Alignment, Ordering, SSID);
|
||||
FullTy = getPointerElementFlatType(FullTy);
|
||||
cast<AtomicRMWInst>(I)->setVolatile(Record[OpNum+1]);
|
||||
InstructionList.push_back(I);
|
||||
|
||||
Reference in New Issue
Block a user