1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[TargetLowering] getABIAlignmentForCallingConv - pass DataLayout by const reference. NFCI.

Avoid unnecessary copies and match every other method in TargetLowering that takes DataLayout as an argument.
This commit is contained in:
Simon Pilgrim 2021-06-09 17:30:00 +01:00
parent fb9c8fd3dd
commit ffc4cc1eae
4 changed files with 6 additions and 6 deletions

View File

@ -1520,10 +1520,10 @@ public:
return getNumRegisters(Context, VT);
}
/// Certain targets have context senstive alignment requirements, where one
/// Certain targets have context sensitive alignment requirements, where one
/// type has the alignment requirement of another type.
virtual Align getABIAlignmentForCallingConv(Type *ArgTy,
DataLayout DL) const {
const DataLayout &DL) const {
return DL.getABITypeAlign(ArgTy);
}

View File

@ -20110,8 +20110,8 @@ static bool isHomogeneousAggregate(Type *Ty, HABaseType &Base,
}
/// Return the correct alignment for the current calling convention.
Align ARMTargetLowering::getABIAlignmentForCallingConv(Type *ArgTy,
DataLayout DL) const {
Align ARMTargetLowering::getABIAlignmentForCallingConv(
Type *ArgTy, const DataLayout &DL) const {
const Align ABITypeAlign = DL.getABITypeAlign(ArgTy);
if (!ArgTy->isVectorTy())
return ABITypeAlign;

View File

@ -712,7 +712,7 @@ class VectorType;
/// Return the correct alignment for the current calling convention.
Align getABIAlignmentForCallingConv(Type *ArgTy,
DataLayout DL) const override;
const DataLayout &DL) const override;
bool isDesirableToCommuteWithShift(const SDNode *N,
CombineLevel Level) const override;

View File

@ -303,7 +303,7 @@ class TargetRegisterClass;
/// Return the correct alignment for the current calling convention.
Align getABIAlignmentForCallingConv(Type *ArgTy,
DataLayout DL) const override {
const DataLayout &DL) const override {
const Align ABIAlign = DL.getABITypeAlign(ArgTy);
if (ArgTy->isVectorTy())
return std::min(ABIAlign, Align(8));