Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: sdardis, nemanjai, hiraditya, kbarton, jrtc27, MaskRay, atanasyan, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67704
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372230
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Return the alignment for the specified \p GV.
static llvm::Align getGVAlignment(const GlobalValue *GV, const DataLayout &DL,
- llvm::Align InAlign = llvm::Align(1));
+ llvm::Align InAlign = llvm::Align::None());
private:
/// Private state for PrintSpecial()
int offset = 0; // offset off of ptrVal
unsigned size = 0; // the size of the memory location
// (taken from memVT if zero)
- MaybeAlign align = Align(1); // alignment
+ MaybeAlign align = Align::None(); // alignment
MachineMemOperand::Flags flags = MachineMemOperand::MONone;
IntrinsicInfo() = default;
// Emit an alignment directive for this block, if needed.
const llvm::Align Align = MBB.getAlignment();
- if (Align > 1)
+ if (Align != llvm::Align::None())
EmitAlignment(Align);
MCCodePaddingContext Context;
setupCodePaddingContext(MBB, Context);
// object is 16-byte aligned. Note that unlike the non-fixed case, if the
// stack needs realignment, we can't assume that the stack will in fact be
// aligned.
- llvm::Align Alignment =
- commonAlignment(ForcedRealign ? llvm::Align() : StackAlignment, SPOffset);
+ llvm::Align Alignment = commonAlignment(
+ ForcedRealign ? llvm::Align::None() : StackAlignment, SPOffset);
Alignment = clampStackAlignment(!StackRealignable, Alignment, StackAlignment);
Objects.insert(Objects.begin(),
StackObject(Size, Alignment, SPOffset, IsImmutable,
int MachineFrameInfo::CreateFixedSpillStackObject(uint64_t Size,
int64_t SPOffset,
bool IsImmutable) {
- llvm::Align Alignment =
- commonAlignment(ForcedRealign ? llvm::Align() : StackAlignment, SPOffset);
+ llvm::Align Alignment = commonAlignment(
+ ForcedRealign ? llvm::Align::None() : StackAlignment, SPOffset);
Alignment = clampStackAlignment(!StackRealignable, Alignment, StackAlignment);
Objects.insert(Objects.begin(),
StackObject(Size, Alignment, SPOffset, IsImmutable,
MachineFunction::const_iterator NextBlock = ++Water->getIterator();
if (NextBlock == MF->end()) {
NextBlockOffset = BBInfo[Water->getNumber()].postOffset();
- NextBlockAlignment = llvm::Align();
+ NextBlockAlignment = llvm::Align::None();
} else {
NextBlockOffset = BBInfo[NextBlock->getNumber()].Offset;
NextBlockAlignment = NextBlock->getAlignment();
Info.ptrVal = I.getArgOperand(0);
Info.offset = -VT.getStoreSize()+1;
Info.size = 2*VT.getStoreSize()-1;
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags = MachineMemOperand::MOLoad;
return true;
}
Info.ptrVal = I.getArgOperand(0);
Info.offset = 0;
Info.size = VT.getStoreSize();
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags = MachineMemOperand::MOLoad;
return true;
}
Info.ptrVal = I.getArgOperand(1);
Info.offset = -VT.getStoreSize()+1;
Info.size = 2*VT.getStoreSize()-1;
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags = MachineMemOperand::MOStore;
return true;
}
Info.ptrVal = I.getArgOperand(1);
Info.offset = 0;
Info.size = VT.getStoreSize();
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags = MachineMemOperand::MOStore;
return true;
}
ScalarVT = MVT::i32;
Info.memVT = MVT::getVectorVT(ScalarVT, VT.getVectorNumElements());
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags |= MachineMemOperand::MOStore;
break;
}
unsigned NumElts = std::min(DataVT.getVectorNumElements(),
IndexVT.getVectorNumElements());
Info.memVT = MVT::getVectorVT(DataVT.getVectorElementType(), NumElts);
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags |= MachineMemOperand::MOLoad;
break;
}
unsigned NumElts = std::min(DataVT.getVectorNumElements(),
IndexVT.getVectorNumElements());
Info.memVT = MVT::getVectorVT(DataVT.getVectorElementType(), NumElts);
- Info.align = Align(1);
+ Info.align = Align::None();
Info.flags |= MachineMemOperand::MOStore;
break;
}