AArch64/GlobalISel: Fix incorrect ptrmask usage for alignment

I inverted the mask when I ported to the new form of G_PTRMASK in
8bc03d2168.

I don't think this really broke anything, since G_VASTART isn't
handled for types with an alignment higher than the stack alignment.
This commit is contained in:
Matt Arsenault 2020-05-30 16:03:16 -04:00 committed by Matt Arsenault
parent bfdc255266
commit 95f65a7c6c
2 changed files with 3 additions and 3 deletions

View File

@ -243,7 +243,7 @@ MachineInstrBuilder MachineIRBuilder::buildMaskLowPtrBits(const DstOp &Res,
LLT PtrTy = Res.getLLTTy(*getMRI());
LLT MaskTy = LLT::scalar(PtrTy.getSizeInBits());
Register MaskReg = getMRI()->createGenericVirtualRegister(MaskTy);
buildConstant(MaskReg, maskTrailingOnes<uint64_t>(NumBits));
buildConstant(MaskReg, maskTrailingZeros<uint64_t>(NumBits));
return buildPtrMask(Res, Op0, MaskReg);
}

View File

@ -23,8 +23,8 @@ body: |
; CHECK: [[LOAD2:%[0-9]+]]:_(p0) = G_LOAD [[COPY]](p0) :: (load 8)
; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
; CHECK: [[PTR_ADD2:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD2]], [[C1]](s64)
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[C1]](s64)
; CHECK: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD2]], [[COPY1]](s64)
; CHECK: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 -16
; CHECK: [[PTRMASK:%[0-9]+]]:_(p0) = G_PTRMASK [[PTR_ADD2]], [[C2]](s64)
; CHECK: [[PTR_ADD3:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTRMASK]], [[C]](s64)
; CHECK: G_STORE [[PTR_ADD3]](p0), [[COPY]](p0) :: (store 8)
%0:_(p0) = COPY $x0