Refactor emitFrameOffset to accept a StackOffset struct as its offset argument.
This method currently only supports byte offsets (MVT::i8) but will be extended
in a later patch to support scalable offsets (MVT::nxv1i8) as well.
Details
Diff Detail
Event Timeline
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
2968 | Are you intentionally performing the "DestReg == SrcReg && Offset == 0" both here and in emitFrameOffset? | |
3008 | "if (ShiftSize)" is always true? | |
3014 | The usage of "Sign" here is confusing; we always want a positive immediate for the SEH directives. | |
3022 | We should assert here that the remaining offset is zero, to make the expected control flow clear. | |
3026 | We should assert here that SrcReg is SP. | |
3045 | What is Offset.isZero() supposed to be checking here? |
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
2968 | No I wasn't, thanks for pointing out! | |
3008 | In this patch it is always true. However, in the subsequent patch D61437: [AArch64] Static (de)allocation of SVE stack objects. I add a new opcode for SVE where ShiftSize is 0 (on line 2983). | |
3014 | I'll remove it, and add an assert to check that Sign is always positive. | |
3045 | For the case where the StackOffset can contain both (fixed-size) bytes, and scalable bytes (i.e. MVT::nxv1i8 for SVE where we know there are 'n x bytes', with 'n' being a runtime constant), we want to use ADDXri to emit a frame-offset if:
Or:
The functionality is added in D61437: [AArch64] Static (de)allocation of SVE stack objects. (lines 3067-3082). |
LGTM
lib/Target/AArch64/AArch64InstrInfo.cpp | ||
---|---|---|
3045 | Oh, you don't want to emit the mov if the offset isn't empty because it would be redundant. That makes sense. |
My previous patch didn't have any context, so added it now (git format-patch -U999999)
Are you intentionally performing the "DestReg == SrcReg && Offset == 0" both here and in emitFrameOffset?