diff --git a/llvm/include/llvm/CodeGen/TargetCallingConv.h b/llvm/include/llvm/CodeGen/TargetCallingConv.h --- a/llvm/include/llvm/CodeGen/TargetCallingConv.h +++ b/llvm/include/llvm/CodeGen/TargetCallingConv.h @@ -42,7 +42,7 @@ unsigned IsHvaStart : 1; ///< HVA structure start unsigned IsSecArgPass : 1; ///< Second argument unsigned ByValAlign : 4; ///< Log 2 of byval alignment - unsigned OrigAlign : 5; ///< Log 2 of original alignment + unsigned OrigLogAlign : 5; ///< Log 2 of original alignment unsigned IsInConsecutiveRegsLast : 1; unsigned IsInConsecutiveRegs : 1; unsigned IsCopyElisionCandidate : 1; ///< Argument copy elision candidate @@ -57,7 +57,7 @@ : IsZExt(0), IsSExt(0), IsInReg(0), IsSRet(0), IsByVal(0), IsNest(0), IsReturned(0), IsSplit(0), IsInAlloca(0), IsSplitEnd(0), IsSwiftSelf(0), IsSwiftError(0), IsHva(0), IsHvaStart(0), - IsSecArgPass(0), ByValAlign(0), OrigAlign(0), + IsSecArgPass(0), ByValAlign(0), OrigLogAlign(0), IsInConsecutiveRegsLast(0), IsInConsecutiveRegs(0), IsCopyElisionCandidate(0), IsPointer(0), ByValSize(0), PointerAddrSpace(0) { @@ -131,11 +131,11 @@ } unsigned getOrigAlign() const { - MaybeAlign A = decodeMaybeAlign(OrigAlign); - return A ? A->value() : 0; + const Align A(1ULL << OrigLogAlign); + return A.value(); } void setOrigAlign(Align A) { - OrigAlign = encode(A); + OrigLogAlign = Log2(A); assert(getOrigAlign() == A.value() && "bitfield overflow"); }